Sign in to follow this  

Optimization

This topic is 3666 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

I'm looking for some information on how to do Vertex Culling, I believe thats what its called... Basically if a poly is facing the camera but behind another poly, i don't want to render it. Can anyone help?

Share this post


Link to post
Share on other sites
It's generally called occlusion culling. But before we explain the methods, are you sure this is what you want to do?

A typical game won't benefit from occlusion culling. It is only when you are vertex-throughput-limited that it is worthwhile, but a vast majority of games are bottlenecked at the CPU or pixel renderer. If your game falls into this category (particularly if it's CPU-limited) then occlusion-culling will only slow things down further.

Share this post


Link to post
Share on other sites
I guess really, then, what I'm looking to do is modify my QuadTree so that if there is a hill in the way of an entire quadrant, yet the quadrant is visible in the view frustrum, the hidden quadrant is not drawn... This, I believe, is still occlusion culling but instead of each vertex it checks to see if a quadrant's bounding box is visible with no hill/wall in front of it? That make more sense?

Share this post


Link to post
Share on other sites
I always assumed this was done automatically by depth buffer.

ie if you pass an object that is behind (depth testing) another object it will not draw it (or only visable bits).

Of course if you draw the far object first them the closer will be drawn over it so you are still rendering two objects when only one was visable.

This i assumed was why it is a good idea to draw from near to far in terms of depth.

Regards

Share this post


Link to post
Share on other sites
Quote:
Original post by Tophurious
I guess really, then, what I'm looking to do is modify my QuadTree so that if there is a hill in the way of an entire quadrant, yet the quadrant is visible in the view frustrum, the hidden quadrant is not drawn... This, I believe, is still occlusion culling but instead of each vertex it checks to see if a quadrant's bounding box is visible with no hill/wall in front of it? That make more sense?

Yep, that makes a lot of sense. The most appropriate technology is called PVS-culling (potentially-visible set). Google would be a great place to start.

Share this post


Link to post
Share on other sites
Quote:
Original post by galapogos22
I always assumed this was done automatically by depth buffer.

ie if you pass an object that is behind (depth testing) another object it will not draw it (or only visable bits).


It will not be visible on screen, you're right, but be aware that in order to get to the point where pixels are rejected by the depth test, you would have already paid the CPU price for all those set constants, set vertex formats, set render states, draw primitive, etc., plus all the GPU price for processing the geometry (vertices).

So culling entire parts of an octree as early as possible is definitely a good thing, if done efficiently

JA

Share this post


Link to post
Share on other sites
Does anyone know if PVS culling of QuadTree quadrants would slow down performance? Seems like it would based on the computations that I've been reading about on how to implement PVS...

Share this post


Link to post
Share on other sites
Quote:
Original post by Tophurious
Does anyone know if PVS culling of QuadTree quadrants would slow down performance? Seems like it would based on the computations that I've been reading about on how to implement PVS...


It won't because those computations are not meant to be done at runtime (for static things at least). You do them once as an offline preprocess then store the potentially visible set list as data in each quadtree node (to a sensible depth, you don't necessarily need PVS data in every node of the tree).

Share this post


Link to post
Share on other sites

This topic is 3666 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this