Culling

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
grantkrieger
Posts: 25
Joined: Fri Jul 27, 2007 10:02 am

Culling

Post by grantkrieger »

Hello,

Is there anyway to have "culling" set on the camera. I hope I am using the correct term. I only want the camera to worry about what is visible. I have lots of 3D models and some are hidden behind others. It appears that the camera is taking all of these hidden 3D models into consideration and slowing down the camera.

Many thanks

Grant
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

The scene manager already does simple bounding box culling. The view frustum [the area that the camera is looking at] is used to see if nodes are potentially visible. If the node is in the frustum bounding box, it will be rendered.
It sounds like you want occlusion culling. If some object is completely hidden behind some other object, the first object won't be rendered at all. This is much more sophistocated technique and is not implemented by Irrlicht. You can do primitive occlusion culling with the scene collision manager and object bounding boxes [fast and inaccurate] or triangle selectors [slow but more accurate].

The D3D and OpenGL libraries have this functionality built in. You can render a primitive representations of the nodes in a scene, then for each node, you can go back and ask the driver if any pixels were rendered. If no pixels were drawn, then you don't need to render the full mesh.

There are also ways to do this stuff in software.


Travis
belfegor
Posts: 383
Joined: Mon Sep 18, 2006 7:22 pm
Location: Serbia

Post by belfegor »

"culling" is enabled by default, but if certain object is behind other it
is still in cameras view frustum so it is not "culled" you have to find workaround for that yourself. Maybie somehow determine how far should
be far clip based on cam position and certain room you'r in or something.
And there is in DX also something called (forgat correct name) "Occlusion quary"
but not all cards support that feature.
Small FPS demo made using Irrlicht&NewtonDEMO
InfoHERE
Its at very early stage but i think im crazy enough to finish it all alone.
grantkrieger
Posts: 25
Joined: Fri Jul 27, 2007 10:02 am

Post by grantkrieger »

Thanks for all your help
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

Could there be a quick way to do some occlusion culling based on nodes?

Like:
- Do some test to see if the nodes from the node tree is in the view frustum. What method could we take for making that test?
- Build a list of node to be tested for culling. Ok this should be simple list.
- From that list, hide the node that are occluded. But how could it be done?

This culling method should only be good on scenes with lots of nodes. (Like lots of tree, or elements). A single level (one big mesh) will not benefit from this.

I'm only asking to see how complicated it will be to implement. I'd like to have something like that in my next project. My previous project could have got a very nice framerate with some more advanced culling (Not that bad, it only show in some areas)
Post Reply