View Full Version : testing objects if they were rendered
05-12-2011, 01:17 PM
If I have a set of many spheres in the screen, as I move closer using a "camera" some of the spheres will disappear from view. How can I test which spheres are not visible? for example, to my right and left of where I'm looking at?
05-12-2011, 02:40 PM
The term to google is frustum culling.
You build a hierarchy of bounding volumes around your objects and test the bounding volume against the view frustum. If they intersect you test the next level of volumes in the hierarchy until you've reached the leaves. If a leaf volume intersects the frustum you assume the object to be visible and render it.
Of course this is only a performance win if you can perform the testing faster than simply rendering the objects regardless of visibility - which means the objects to test need to be complex enough. In your case you may need to group a number of spheres into a leaf of your bounding volume hierarchy for best performance.
05-13-2011, 08:43 AM
Powered by vBulletin® Version 4.2.2 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.