Sign in to follow this  

Dirty way for discart not-in-frustum objects. Help plz

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

Hello!!! In a level loaded in my 3dengine i have some hi-poly count static objects. I have that objects in a object manager class that renders that objects. But I also render objects that is not in the camera frustum!This is waste of fps. My Engine has a BSP Tree but the only optimization I have in it is Bounding Box optmimization and I can't discart all the objects that are not in the camera frustum using the BSP Tree. Is there any other way to do this? I was thinking this: before render the actual object render the bounding box or sphere of the object using an occlusion query to see if the object is visible at camera frustum. if yes then draw it. if not then dont draw it. but to do all this stuff i must render the bounding box/sphere first. and the bounding box will appear to the screen! how can I erase that? well I know that you can not just erase something. but there must be some trick to "hide" it. thanks in advance;

Share this post


Link to post
Share on other sites
Disable colour and z writes (or use an alpha blend of SRCBLEND_ZERO).

Be warned that the occlusion query probably won't execute quickly enough to give you results the same frame (at least, not without having you sit around for a while and wait). You'll likely want to use the results of the query you made the previous frame, sort of thing.

Share this post


Link to post
Share on other sites
It depends on a lot of things (such as the heavyness of your vertex shader). You'll have to profile, but my gut feeling is that yes, trying to get the results of the query back the same frame will cause you slowdown.

Share this post


Link to post
Share on other sites
i use them and i have some extra fps because now i dont draw the objects that are behind the walls. :)
In a simple level with some complex geometry I can discart 30.000 - 40.000 vertices whitch is behind the walls. :)

Share this post


Link to post
Share on other sites

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