Hey all, I'm trying to make an Occlusion Culling method that uses Ray Casting to determine whether a uniformally sized cube is hidden or not. Here's a little diagram. And here's the psuedocode for what I want to do. code:
Shameproof fucked around with this message at 02:59 on Oct 3, 2011 |
|
# ? Oct 3, 2011 02:54 |
|
|
# ? May 25, 2024 13:28 |
|
Shameproof posted:The ray casting part I am doing fine with. I am just wondering what the best way to remove points from the open set is. I'm thinking I could have a hashmap of booleans, and then whenever I trace back I can set all of the points contained in the polygon to false?
|
# ? Oct 3, 2011 03:27 |
|
Shameproof posted:Hey all, I'm trying to make an Occlusion Culling method that uses Ray Casting to determine whether a uniformally sized cube is hidden or not. Here's a little diagram. I'm curious as why you're using a tracer to do this instead of, say, rasterizing the shapes to a buffer and just pixel-counting at the end. Simple primary ray casting is one of those things rasterizers *usually* dominate tracers at. However, my first instinct would be to use some sort of system of rectangular regions, where each region defines an area known to be clear. After you are done casting pixels in the known regions, check each region for occluded pixels and subdivide if necessary (you could use a KD- or Quad-tree like approach, with a bit-mask for regions smaller than, say, 8x8)
|
# ? Oct 3, 2011 04:00 |
|
Why not use occlusion queries? This is what they're designed for. Update on my GPU voxel terrain project: http://www.youtube.com/watch?v=wkOA4udhHTc Moving the algorithm on the GPU means I can generate chunks at interactive frame rates, so I can have an infinitely-sized dynamically-generated world. Fun stuff.
|
# ? Oct 3, 2011 04:54 |
Hubis posted:I'm curious as why you're using a tracer to do this instead of, say, rasterizing the shapes to a buffer and just pixel-counting at the end. Simple primary ray casting is one of those things rasterizers *usually* dominate tracers at. As for excluding pixels from the open set, here's how I think I am going to do this. This approach takes advantage of the fact that the shape is guaranteed to be convex. I find the rectangle that is certain to be contained by the shape (marked in red), and I find the rectangle that is certain to be outside of the shape (marked in white). For the remaining areas (marked in blue), I can just check each point to see if a line to the origin will intersect any of the line segments making the shape.
|
|
# ? Oct 3, 2011 05:02 |
Paniolo posted:Moving the algorithm on the GPU means I can generate chunks at interactive frame rates, so I can have an infinitely-sized dynamically-generated world. Fun stuff. Did you have to use CUDA for that? Was it hard?
|
|
# ? Oct 3, 2011 05:06 |
|
If that's the case you are probably not going to see any speedup whatsoever from any kind of voxel-level occlusion culling. In fact it will probably run slower because you're doing unnecessary work. ^^ No, using geometry shaders at the moment. The only really hard part so far is that it's literally impossible to debug Direct3D when using stream out shaders so all my debugging is via trial and error. Paniolo fucked around with this message at 05:10 on Oct 3, 2011 |
# ? Oct 3, 2011 05:08 |
So for your game, you can't send the terrain back to the CPU and have any kind of interaction with it? What would you suggest that I do for the occlusion culling? Should I stream the Voxel Octrees onto both the GPU and the main memory, then do occlusion culling in the the geometry shader? That'll make debugging more stressful so I'm a bit hesitant. Plus XNA's Ray class has a nice Intersect(BoundingBox b) method, which is really nice.
|
|
# ? Oct 3, 2011 05:24 |
|
Another thing to realize is that AABBs and spheres are both incredibly cheap to do plane-side checks on. For AABBs you just take the corner nearest or farthest to the plane which is easily determined by just checking the signs of the plane normal, for spheres you just offset the plane distance by the sphere radius. Because of that, determining if either is completely outside of a convex visibility volume or completely within an occluder volume is very cheap. Occlusion queries are more ideal for dealing with complex occluder shapes, but for large simple convex occluders, you skip even doing that. You can also convert convex 3D volumes into screen-space occluder volumes by casting the volume points and edges into screen space then selecting the edges which can put all of the volume points on the edge plane or on one side of it. OneEightHundred fucked around with this message at 05:33 on Oct 3, 2011 |
# ? Oct 3, 2011 05:27 |
|
Shameproof posted:So for your game, you can't send the terrain back to the CPU and have any kind of interaction with it? The voxel field is generated on the CPU, as it's pretty fast - just a handful of simplex noise samples per voxel. I've considered moving that onto the GPU as well and then copying the data back to the CPU, but at this point that would be a premature optimization. One neat thing is that it's pretty trivial to do picking and collisions by ray-casting into the low-resolution density field, while getting the same results as if you were running an intersection test against the high-resolution mesh. Shameproof posted:What would you suggest that I do for the occlusion culling? Should I stream the Voxel Octrees onto both the GPU and the main memory, then do occlusion culling in the the geometry shader? That'll make debugging more stressful so I'm a bit hesitant. Plus XNA's Ray class has a nice Intersect(BoundingBox b) method, which is really nice. I would suggest you some basic frustum culling and nothing else until you can provably demonstrate that you are performance bound by the number of primitives in the scene. Which, for a minecraft-esque cube world, I highly doubt you will ever be. Paniolo fucked around with this message at 05:43 on Oct 3, 2011 |
# ? Oct 3, 2011 05:40 |
OneEightHundred posted:Another thing to realize is that AABBs and spheres are both incredibly cheap to do plane-side checks on. For AABBs you just take the corner nearest or farthest to the plane which is easily determined by just checking the signs of the plane normal, for spheres you just offset the plane distance by the sphere radius. You're saying I should do this for occlusion culling instead of ray casting? Or instead of my method for eliminating unnecessary ray casts? OneEightHundred posted:You can also convert convex 3D volumes into screen-space occluder volumes by casting the volume points and edges into screen space then selecting the edges which can put all of the volume points on the edge plane or on one side of it. Could you explain this a bit more please? quote:I would suggest you some basic frustum culling and nothing else until you can provably demonstrate that you are performance bound by the number of primitives in the scene. Which, for a minecraft-esque cube world, I highly doubt you will ever be. Shameproof fucked around with this message at 06:10 on Oct 3, 2011 |
|
# ? Oct 3, 2011 06:00 |
|
Shameproof posted:You're saying I should do this for occlusion culling instead of ray casting? Or instead of my method for eliminating unnecessary ray casts? quote:Could you explain this a bit more please? If the gray area is the occluder volume and the cyan dots are the occluder points, the black edges are acceptable ones since all of the occluder points are either on it or on one side of it. The red edges are discarded because there are points on both sides. I'm not sure how well this sort of thing would scale to voxels though.
|
# ? Oct 3, 2011 06:38 |
This helps, thanks!
|
|
# ? Oct 3, 2011 06:53 |
|
Shameproof posted:So for your game, you can't send the terrain back to the CPU and have any kind of interaction with it? If you're using XNA you'll be limited to DirectX 9c which doesn't have geometry shaders. If you really need geometry shaders and want to work in C# you'll need to use the SlimDX libraries to get DX10 or 11. Unfortunately SlimDX is a lot less user friendly than XNA is.
|
# ? Oct 3, 2011 22:59 |
|
Quick question; for collision detection (essentially just ray tracing) with my code on the q3dm1sample map from quake3 on an AMD X4 955 computer takes around 18 seconds to do 1 million ray traces. A bit on the slow side?
|
# ? Oct 4, 2011 18:20 |
|
FlyingDodo posted:Quick question; for collision detection (essentially just ray tracing) with my code on the q3dm1sample map from quake3 on an AMD X4 955 computer takes around 18 seconds to do 1 million ray traces. A bit on the slow side?
|
# ? Oct 5, 2011 03:58 |
|
I'm curious as to how it compares to something like q3map in comparison when doing tracing for calculating lightmaps, or just within quake3 in general. Is there any easy way to test quake3's tracing speed?
|
# ? Oct 5, 2011 18:04 |
|
Sure, just hammer the trace function and time it. q3map's trace function is significantly faster though because it early-outs on the first thing that blocks a trace, the engine will continue to search until it finds the one closest to the point of origin, reason for that being that the engine doesn't want to penetrate walls and the compiler only cares about whether a light ray is being blocked or not. I would advise against traces for lightmap compilation regardless, scanline rasterization and volume trees are both substantially faster.
|
# ? Oct 6, 2011 04:07 |
|
I'm not actually considering using lightmaps, I just looking for a way to benchmark my code against an existing games line tracing. I suppose I could do a silly mod to quake3 and make a weapon do a ton of traces and time them and do a console output.
|
# ? Oct 6, 2011 06:21 |
|
Dunno if anyone is actually interested, but I've made some good progress on my voxel engine: http://www.youtube.com/watch?v=4XtArcFMfe4 The algorithm for generating an indexed vertex stream is basically a modified version of what's described in this article (section 1.4.4): http://http.developer.nvidia.com/GPUGems3/gpugems3_ch01.html Getting that to work is by far the most difficult thing I've ever programmed, as I was unable to debug any of the shaders due to Microsoft sucking rear end and not bothering to bring DirectX 11 out of a beta state. So it was a pretty monstrous effort of trial and error.
|
# ? Oct 8, 2011 21:37 |
|
I've come across the need for an algorithm and I'm at a loss. I've been trying to make a simple 2D platformer where the player character has a gun and making it as such that their arm is shaped like a 90 degree angle and turns so that the hand always points at the mouse, but no matter how many times I draw it on graph paper I can't for the life of me figure out what trig functions need to go where to give me the angle that I need to adjust by to make that happen. Best I've come up with is some iterative approach that is as bad as you could imagine. Anyone have any ideas? e: I can draw a picture if need be but it's basically just an L shape that pivots at one end so that the line at the bottom contains a point on the screen.
|
# ? Oct 10, 2011 04:38 |
|
Mr.Hotkeys posted:I've come across the need for an algorithm and I'm at a loss. I've been trying to make a simple 2D platformer where the player character has a gun and making it as such that their arm is shaped like a 90 degree angle and turns so that the hand always points at the mouse, but no matter how many times I draw it on graph paper I can't for the life of me figure out what trig functions need to go where to give me the angle that I need to adjust by to make that happen. Best I've come up with is some iterative approach that is as bad as you could imagine. I think what you're looking for is something like: atan2(y2 - y1, x2 - x1)
|
# ? Oct 10, 2011 05:41 |
|
I think he means he wants the dude's forearm to point somewhere, so he needs to figure out the angle at which the shoulder should be rotated to achieve this, given that the elbow forms a 90 degree angle. If you think of the positions the elbow could be at as forming a circle, the line between the target and the elbow will be tangent to this circle, like this. If you find the point where the line and circle intersect, the angle between the shoulder and that point (via atan2) will be the shoulder rotation you want. Do I make any sense?
|
# ? Oct 10, 2011 06:02 |
|
Hello! I'm Griff, and I'm a writer, photographer, and work in animation. I work at Frederator studios, which does Adventure Time, and am a big fan of games. I can't code to save my life, but I can certainly design gameplay mechanics, levels, art direction, and other stuff. If anyone wants to do something sometime, shoot me a PM! I'd love to get into Game Development! I work for free!
|
# ? Oct 10, 2011 22:28 |
|
MixMasterGriff posted:Hello! I'm Griff, and I'm a writer, photographer, and work in animation. I work at Frederator studios, which does Adventure Time, and am a big fan of games. This is awesome and you are awesome. Show us some work of yours! I also have some prototype things that don't have any art past mspaint programmer stuff so maybe I'll contact you soon.
|
# ? Oct 11, 2011 00:28 |
|
ambushsabre posted:This is awesome and you are awesome. Show us some work of yours! I also have some prototype things that don't have any art past mspaint programmer stuff so maybe I'll contact you soon. (I'll need levels/rooms too, but there's no point assembling levels out of lovely hideous tiles.)
|
# ? Oct 11, 2011 01:00 |
|
roomforthetuna posted:That's approximately what I was going to say too, but then I noticed that the list of things contained "art direction", but did not contain any of pixel graphics, vector graphics or 3D graphics. Are any of those on offer? This is an excellent point, I was just so blinded by the adventure time thing that I kind of forgot to read the rest of the post.
|
# ? Oct 11, 2011 01:09 |
|
Griff: glad to meet ya! You've got a pretty spiffy range of skills, but is there anything you're interested in learning? Are you curious to pick up the basics of coding? What can we do for you?
|
# ? Oct 11, 2011 01:40 |
|
programmersdesperatelylookingforart.txt That being said -- what kind of games are you interested in? It's probably a fairly good starting point to figure out what kind of games you would/wouldn't want to pour time and energy into. If you already have an idea, can't hurt to post it and see if anyone wants to take you up on the offer! I collaborated with a forums user A HUGE loving BLUNT on a small project because he had an idea and was willing to do the art for it, while there were a ton of Game Dev entries that were goon projects. e: It might also be worth posting in the Making Games Megathread, if you're also looking for a more general audience. RoboCicero fucked around with this message at 01:58 on Oct 11, 2011 |
# ? Oct 11, 2011 01:55 |
|
I am a decent artist, and I work with artists regularly, but, to be perfectly honest, I don't know anything about supplying art for a game. Maybe like, 8-bit or 16-bit, but perhaps I was unclear of what Art Direction meant. I can oversee and hire artists to guide the look of a project, and design levels visually and for gameplay, but the technicalities of each of those aren't my strong point. I'm an excellent and strong writer though! I'm more of a Steve Jobs than a Steve Wozniak. I can help guide the vision, look, and feel of games, but the actual technicalities are a bit out of my hands. Not to say I can't learn mind you, I just don't have them right now. I threw my offer out to you guys because I figured you'd need an extra hand. I'm surprised to have received such a warm reception! I don't want to miss-sell myself, I don't want to seem something I'm not. tl;dr: I'm very good at guiding and directing art and concepts as well as a strong writer, but the actual technical stuff I'm bad at (but willing to learn.) Sorry for any mix-ups! Still willing to do any grunt-work you need! EDIT: quote:Q: How do I be the guy that tells everyone what to do? And this is why I suck and am a terrible person! Hah, sorry, I'm sure you've heard people like me way too much! My offer to help with the little stuff still stands though. I don't have many skills, but I want to learn! Digi_Kraken fucked around with this message at 02:05 on Oct 11, 2011 |
# ? Oct 11, 2011 02:02 |
|
MixMasterGriff posted:I am a decent artist, and I work with artists regularly, but, to be perfectly honest, I don't know anything about supplying art for a game. Maybe like, 8-bit or 16-bit, but perhaps I was unclear of what Art Direction meant. I can oversee and hire artists to guide the look of a project, and design levels visually and for gameplay, but the technicalities of each of those aren't my strong point. I'm an excellent and strong writer though! Honestly if you have any skills at all that are even semi-related to game design (like art) at all, you can start to make your own stuff or collaborate pretty easily. So you say you can do art stuff but not game art? The good news is that it's not that different (at the level most of us are at independently, which is small games and prototypes really). If you specialize in landscape paintings or whatever, you could do an adventure game. Or if you want to learn to do sprite art, there are a bunch of tutorials . If you're having trouble with coding, there are a bunch of tools available for you, no matter what your level of expertise is. As long as you're not in it to make the next indie masterpiece you'll be fine as long as you have some amount of dedication. Some other good resources to check out if you want to get into the indie games scene or w/e are: tigsource, the #tigirc channel on espernet, the roguelike thread and irc channel if you're interested in that, as well as indiegames.com. Twitter is also a pretty cool place to meet other devs as well. I dunno if that all runs together or what because I'm kind of tired right now, but I'm going to finish it off with a brief overview of my very limited experience with all this (keep in mind I am a pretty young kid). I decided I wanted to make games like 6 or 7 years ago (very very very young), and it was really difficult for me to come to grips with the fact that I couldn't make the next 3d shooter extreme masterpiece whatever. Luckily, instead of giving up, I kind of put the whole dream aside and started to learn how to program, and about linux and about computers in general. I literally (and still am) learned about every piece of technology I could get my hands on, installed every piece of software I could find, read wikipedia articles about SSL, it was pretty clear I found my passion pretty early on. About a year ago, after taking a few classes about programming and spending almost every day doing computer-ish stuff, I realized that I might be ready to sit down and actually try to learn how to make games. A bunch of prototypes later, I just a few weeks ago released a 5 minute long flash game that people seem to think is a pretty neat idea. Yeah, it sucks in comparison to what other people on these forums are doing, but it's immensely satisfying after all that time to take something start to finish. I'm just as proud of my prototypes as well, because I can point to it and say, "I made that. I am a kid and I make my own video games and that is awesome." It's honestly been the best times of my life. It's a wild hobby, because I think that the time in-between projects is kind of a temporary depression, and the projects are certainly an addiction and a temporary high in a way, which I'm sure other people here can confirm. I'm not sure what the difference is between an obsession and a passion, but it's certainly a line I'm sure a lot of people here are walking and feel the same way. Fakeedit: I have no idea what the gently caress I just wrote. It might not have any relation to what you asked or said or anything, but for some reason it's something that I've wanted to write down for a long time now and I just now got to do it. There are also probably a ton of mistakes because I'm not proofreading it. realedit: make games
|
# ? Oct 11, 2011 02:25 |
|
On the subject of wanting to learn, is there any effective, clever way to do sprite-type pixel graphics? The way I've always done it is just "zoom in a lot and painstakingly draw every single loving pixel individually" (not quite literally, but close). I asked the one guy I know who does pixel graphics much better and faster than I do, and he says that yeah, that's pretty much how it's done, and it just gets faster and better with practice. Is that really the only effective way? I realize there is the sometimes helpful method "render things from 3D and then just tidy up the edges one pixel at a time to make nice sprites", but that doesn't help because I find doing things in 3D even more difficult than doing pixel art (though I'm sure this method would help if I was doing something heavily animated - but on the other hand, if I was doing that I'd probably just go "Another World" style anyway.) (MixMasterGriff, unfortunately this is the sort of non-programming grunt work that programmers mostly need doing, it is not very much fun at all. And a lot of it is even less exciting than you imagine, because it's poo poo like "draw some grass" and "draw a brick wall".)
|
# ? Oct 11, 2011 02:34 |
|
roomforthetuna posted:On the subject of wanting to learn, is there any effective, clever way to do sprite-type pixel graphics? The way I've always done it is just "zoom in a lot and painstakingly draw every single loving pixel individually" (not quite literally, but close). I asked the one guy I know who does pixel graphics much better and faster than I do, and he says that yeah, that's pretty much how it's done, and it just gets faster and better with practice. Is that really the only effective way? Well, according to this tutorial, yeah, that's pretty much how it's done. A friend and I get the pixel look by drawing everything in 8x8 or 16x16, which is pretty easy to do by hand, and then in our game we use a zoom level of 2. Obviously that's pretty limited, but you can get a mega-man, retroish look with it.
|
# ? Oct 11, 2011 02:38 |
|
roomforthetuna: In my experience, drawing something as something other than pixel art and then "cleaning it up" takes about as long as drawing it from scratch. That said, doing drafts either freehand in a graphics app or in pencil can help a lot- even if you aren't tracing them, you'll have a much better idea of where the pixels should go when you start pushing them around. Also I highly suggest trying to work in black and white first. When you have something that is recognizable with two colors, adding shading, softening edges and bringing out details is much easier. So that I'm not talking out of my rear end, here's some stuff I've done:
|
# ? Oct 11, 2011 02:46 |
|
ambushsabre posted:Well, according to this tutorial, yeah, that's pretty much how it's done. A friend and I get the pixel look by drawing everything in 8x8 or 16x16, which is pretty easy to do by hand, and then in our game we use a zoom level of 2. Obviously that's pretty limited, but you can get a mega-man, retroish look with it. Internet Janitor - starting with outlines is a great idea that should have been obvious, and will probably help me. I think the real problem for me is that I'm not very good at drawing in the first place, so I probably need to work on that before getting into the technical stuff. Or hope to have a lot of spare money to pay someone else to draw for me.
|
# ? Oct 11, 2011 02:53 |
|
Honestly I'm not that great at drawing either, I just keep at it. Here's the sprite sheet for an RTS I made eons ago- timestamp on the file says 2004: You'll get better.
|
# ? Oct 11, 2011 03:07 |
|
Internet Janitor posted:Honestly I'm not that great at drawing either, I just keep at it. Here's the sprite sheet for an RTS I made eons ago- timestamp on the file says 2004: (Though to be fair, I can achieve comparable quality if I spend a really ridiculously long time per sprite, and I don't know if you were doing that.)
|
# ? Oct 11, 2011 03:25 |
|
I really don't want to talk about how long it took to draw that sheet in MSPaint so many years ago. Let's just say I didn't have any more of a social life in high school than I do now.
|
# ? Oct 11, 2011 03:31 |
|
I'm having a weird issue with XNA. I'm trying to load a Texture2D, but it's not working for some reason. creaturePath can be ignored, and ArtPath is equal to "\\Art\\Dynamic\\Creatures\\Dog\\". code:
Error loading "\Art\Dynamic\Creatures\Dog\dog3_idle_n". Cannot open file. I've added the file through Visual studio and if I remove the files and re-add them the proper .xnb files are created. Can anyone tell me what's up? Edit: Nevermind. I did more reading about how content managers and stuff work so now It's working fine. I'm just passing the content service provider from the main "Game1.cs" class to my creature class, and making a new content manager there. The Monarch fucked around with this message at 05:22 on Oct 11, 2011 |
# ? Oct 11, 2011 04:57 |
|
|
# ? May 25, 2024 13:28 |
|
MixMasterGriff posted:I am a decent artist, and I work with artists regularly, but, to be perfectly honest, I don't know anything about supplying art for a game. Maybe like, 8-bit or 16-bit, but perhaps I was unclear of what Art Direction meant. I can oversee and hire artists to guide the look of a project, and design levels visually and for gameplay, but the technicalities of each of those aren't my strong point. I'm an excellent and strong writer though! Quick question, but do you have any IM's of sorts? I don't have PM's, but I'd like to say hello and talk for a while if that could be arranged! Mine are in my profile, feel free to add them, or post yours here.
|
# ? Oct 11, 2011 07:01 |