hardware instancing?

Started by
14 comments, last by ChristianFrantz 10 years, 6 months ago

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.

void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.
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

If you see a post from me, you can safely assume its C# and XNA :)

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.

Previously "Krohm"

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

If you see a post from me, you can safely assume its C# and XNA :)

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.

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

If you see a post from me, you can safely assume its C# and XNA :)

This topic is closed to new replies.

Advertisement