Increasing fps by hiding textures and other objects

Hi, do you think if you send a ray out to see what the player can “see” then only .show() them and .hide() everything else help, with fps that are on big maps with alot of differnt textures and objects?

What you are talking about is called Frustrum Culling.

A bit of background info: Using Level Of Detail on models/textures is a better technique. Also, backface culling is kinda related to what you are talking about, I’m sure panda3D does this automatically, unless you tell it not to.

Culling objects outside the Field of View (Frustrum Culling) can definitely be done (and can even be combined with LOD to get really good performance, see T-Strip LOD).

I don’t know if using rays to do it is a good idea, however. Perhaps the isInView function?

To try and combine LOD and FC, the depth buffer could perhaps be used? I’m not really sure.

Hope this helps

Thanks, i’m perty sure you can, i’ll see what the forum has to say (looking at other post).

Panda already does view-frustum culling (as well as backface culling) automatically. It doesn’t do occlusion culling, so if something is in front of the camera but behind a wall, it will be sent to the graphics card for processing. This means there is some potential for optimization by figuring out which objects are behind a wall, and hiding() them.

Note that the problem of occlusion culling is a very difficult one to solve in general. If you just naively use collisions to shoot a ray every frame at each object to see which are behind walls, you will spend more time in the collision detection phase than you will save in the rendering.

In order to make occlusion culling work effectively, you have to employ specialized knowledge of your particular environment. For instance, you can divide the floor into grid squares, and associate a table of visible objects with each grid square. Then you just have to know which grid square your avatar is walking on, which you can determine by examining the X and Y coordinates.


I would love to see models LOD managed by P3D automatically, could we hope to see it happens one day?

Hmm, can’t panda already do that through the LODNode (and FadeLODNode) interface?

I’m just coming from the panda reference docs and thinking to edit my previous post - indeed there is already some - I wasn’t aware of that, mainly because in the official manual it’s not cited. Happy to know that but now I feel the lack of some ready-to-play snippet. I’ll see if I manage to do one with the info provided in the reference.

Actully if I remember right I think someone did a example of it when I was loooking in for the forums. Maybe take a look?

yeah I’d found this - I gotta prepare some LOD meshes cos’ the link provided in the page is dead.

If you do, go on and post it up if you can so we all can see it.

there you have it - I used the built-in blender ape face to make the lod models - it have been so easy using the multires feature coupled with the decimate modifier - I included the .blend file for reference