A P3D Rendering Related Question

This question might be better suited for drwr…

You know how everything that’s not within the camera’s field of view gets “weeded out” or not rendered…?

Are those non rendered objects treated as if they are not attached to the scene graph (P3D)?

I’m trying to decide if it’s better to remove objects outside the FOV from the graph or just leave them since they are not rendered.

Which way is softer on the fps?

i am not a deep-down engine-expert, but iirc the cull process walks down your scenegraph, testing each nodes bounding sphere against the frustum. if a node that bounding sphere is not intersecting with the camera view at all, it’ll be simply not send to the gpu and thus not take any further computation time.

this process is pretty fast, but can slow down if you have thousands of nodes with a very flat hirarchy.
if you group up nodepathes that are close together, you can help speeding the process up.

so in most cases, you can just leave them as they are and let panda do the magic. if you notice that “cull” takes a long time ( in pstats) then you may want to restructure your scenegraph to help panda with the culling.

If you call showBounds() on a model, it renders the bounds of a model, which is usually a basic object such as a sphere or box that completely contains your model. Every node has such a boundary, and every parent node holds a bounding volume that encompasses all of its child bounding volumes.

When Panda traverses down the scene graph during the Cull pass, every step of the way, it checks if the bounding volume intersects with the frustum. If it does, it traverses further down, if it doesn’t, it tosses the node.

So, a node that is out of view will not get rendered. If there are many nodes in a particular location, as Thomas indicated, it helps to have a parent node so that Panda can check against the bounding volume of the whole instead of checking every single node.

In any case, you never need to do your own culling. If you want to improve the process, you can use your own bounding volumes that fit more tightly than Panda’s quickly calculated ones or you can structure your hierarchy to be more optimal for culling.