Jump to content
  • Advertisement
Sign in to follow this  
ChristianFrantz

hardware instancing?

This topic is 2178 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

The pipeline is independent from your language. It's the method used by the GPU to process the data you send it. There are a lot of optimizations built in to it. Face culling, stenciling, frustum culling, etc. If you configure it correctly it can do a hell of an impressive job, even under bad conditions. Since you're an XNA fan, check out all the XNA docs surrounding rendering configuration. The simple tools are often the most powerful in this case.

Share this post


Link to post
Share on other sites
Advertisement
What interested me was culling faces of cubes and frustum culling. With hardware instancing, i dont need to cull faces so that gets rid of the headache associated with that. Frustum culling is two or three,lines of code. Simple enough

Share this post


Link to post
Share on other sites

I'd suggest to just merge all cubes of the same type in the same batch. Even with extreme interaction rates (say 5 per second) you should have no problem in updating the buffers correctly if you did your octree right.

What mhagain states is completely correct, but there's no need to do that on the complete dataset each frame - just draw all the "surface", potentially visible cubes.

Edited by Krohm

Share this post


Link to post
Share on other sites

What's the point of using instancing if i still have to cull faces? The reason im using instancing is because i could never figure out face culling lol

I think we're talking of three different types of "culling" here.

First, your cubes have faces that cannot be seen from any camera position because they are "congruent" with other faces. This does not change if your camera (player) moves, so this kind of "static" culling can be done once for many frames. Of course, you have to update the list of visible faces when you add or remove cubes (that is, you update the instance vertex buffer, but not the geometry vertex buffer or index buffer).

Culling faces that are visible from somewhere, but not from your current camera position is best done by the GPU. This changes from frame to frame as typically your player moves around in the world.

Frustum culling again needs to be done from frame to frame, but typically it is not applied to each single object, but to bounding boxes containing "chunks" of objects. So this can be done easily on the CPU.

Share this post


Link to post
Share on other sites
Ah ok. When i talk about culling faces im talking about sides of a block that share a side with another block. Backface culling is done for you with xna so i dont worry about that. And frustum culling is easy enough to do, just loop through a list of chunks

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!