Custom culling in 2.0

Discussion area about developing with Ogre2 branches (2.1, 2.2 and beyond)
Post Reply
rogual
Gnoblar
Posts: 21
Joined: Sun Mar 01, 2015 9:33 pm
x 4

Custom culling in 2.0

Post by rogual »

I have a game where the camera motion is very restricted, and so the culling code can be incredibly simple.

In Ogre 1.x I used to override SceneManager::_findVisibleObjects to use my custom culling code, but that no longer exists. What is the best way to do this in 2.0?

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 4208
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 802
Contact:

Re: Custom culling in 2.0

Post by dark_sylinc »

I'm afraid frustum culling can't be turned off.

If you're curious the code is in MovableObject::cullFrustum.

Note that it does not only cull the frustum, but also check flags like visibility masks, whether the object is visible and attached to a SceneNode, and shadow casting settings (i.e. skip non-casters while performing the shadow mapping pass)

Note that considering frustum culling takes less than 0.2ms for around 10.000 objects on a modern machine, I wouldn't worry about it. In Ogre 1.x frustum culling took a significant chunk of the frame time where as in Ogre 2.x it has been optimized to death (threaded, made SIMD-friendly, made cache-friendly).

rogual
Gnoblar
Posts: 21
Joined: Sun Mar 01, 2015 9:33 pm
x 4

Re: Custom culling in 2.0

Post by rogual »

Great, thanks.

Post Reply