Horde3D
http://www.horde3d.org/forums/

occlusion culling
http://www.horde3d.org/forums/viewtopic.php?f=2&t=473
Page 1 of 1

Author:  jimbo [ 25.08.2008, 11:56 ]
Post subject:  occlusion culling

What should be the performance increase of occlusion culling?
I've created a small demo based on the Knight demo that only reduces about 20-30% of tris.

http://corrado.bsdwebhosting.com/~jimbo/cullingtest.zip

Author:  DarkAngel [ 26.08.2008, 01:35 ]
Post subject:  Re: occlusion culling

The performance increase is heavily dependent on the scene. I wouldn't expect too much of an increase in the Knight scene as it doesn't involve that many objects.

In a scene with a lot of objects which could be occluded I would expect a bigger speed-up, especially if the culled objects have expensive vertex shaders (such as skinning).

Author:  jimbo [ 26.08.2008, 06:32 ]
Post subject:  Re: occlusion culling

The demo I've linked contains 100 crates in rows and columns, it's not the knight demo.

Author:  DarkAngel [ 26.08.2008, 07:03 ]
Post subject:  Re: occlusion culling

Ahh sorry. I've actually looked at your test scene now, and it seems Horde's Occlusion Culling doesn't work as well as it should.
For instance, if I move the camera to the corner of the boxes and zoom right in (so only one box is visible), most of them still aren't occluded. Then I move the camera to the opposite corner and do the same thing, but this time *no* boxes are occluded at all. This seems to suggest that it is dependent on the order in which the boxes are rendered...

Author:  swiftcoder [ 26.08.2008, 14:14 ]
Post subject:  Re: occlusion culling

DarkAngel wrote:
This seems to suggest that it is dependent on the order in which the boxes are rendered...
Isn't that how occlusion culling is supposed to work? You need to sort the scene front-to-back before rendering.

Author:  marciano [ 26.08.2008, 20:09 ]
Post subject:  Re: occlusion culling

To be added to the manual:

Code:
Occlusion Culling

Occlusion culling is an optimization technique that makes it possible to cull objects that are not visible since they are hidden/occluded by other objects. Horde3D uses hardware occlusion queries for its occlusion culling implementation. These queries have a delay of one frame to avoid stalls that would happen when waiting for the query result directly. The drawback of this approach is that some slight popping can occur when an object that was hidden in the previous frame becomes visible in the current frame. The implementation uses the depth buffer to check for occlusion of objects, so occlusion culling is only working if the rendering pass has proper scene depth information.

Horde3D supports multiple occlusion sets for different cameras. Enabling occlusion culling for a camera is basically very simple and works by setting a Camera node parameter. But in order that occlusion culling works efficiently, the scene needs to be sorted in front-to-back order. In Horde3D this sorting can be achieved through a special parameter in the pipeline drawing commands.

All renderable objects act automatically as occluders. Occludees (objects that can be culled because of occlusion) are currently models and particle emitters. Meshes of a model can occlude other models but a single mesh cannot occlude a mesh of the same Model node. With forward lighting, light sources can also be occluded by other geometry which can be very useful in indoor scenes. Occlusion of light sources is currently not supported for deferred shading.


Note that the occlusion of light sources patch is not yet on the svn.

Author:  DarkAngel [ 27.08.2008, 02:24 ]
Post subject:  Re: occlusion culling

swiftcoder wrote:
DarkAngel wrote:
This seems to suggest that it is dependent on the order in which the boxes are rendered...
Isn't that how occlusion culling is supposed to work? You need to sort the scene front-to-back before rendering.
I haven't actually used/implemented it before so I'm just guessing ;)
Given the nature of the 1-frame-delay though, I always imagined that you would render the entire scene, then 'render' the occlusion queries using the final depth-buffer - eliminating the any draw-order dependencies.

Author:  jimbo [ 27.08.2008, 07:25 ]
Post subject:  Re: occlusion culling

I've changed the pipeline configuration to this:

Code:
<!-- Forward Shading Pipeline -->
<Pipeline>
   <CommandQueue>
      <Stage id="Geometry" link="globalSettings.material.xml">
         <ClearTarget depthBuf="true" colBuf0="true" />
         
         <DrawGeometry context="AMBIENT" class="~Translucent" order="FRONT_TO_BACK" />
         <DoForwardLightLoop class="~Translucent" order="FRONT_TO_BACK" />
         
         <DrawGeometry context="TRANSLUCENT" class="Translucent" order="FRONT_TO_BACK" />
      </Stage>
      
      <Stage id="Overlays">
         <DrawOverlays context="OVERLAY" />
      </Stage>
   </CommandQueue>
</Pipeline>


But it doesn't seem to have any effect?

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/