Re: [osg-users] Disabling culling for the entire scene?

2008-11-13 Thread Robert Osfield
Hi Benoit,

You are doing the right thing to disable culling, but... the OSG is
optimized to switch off the view frustum culling test when it find
objects entirely within the view frustum sides so it's likely off for
most of your scene anyway.

Culling isn't the most expensive operation in the cull traversal
though - if you have lots of fine grained objects with lots of
StateSet's and lots of Transform nodes then cull will be long just
sifting through it all and generating the rendering backend.

Could you describe in more detail about your scene graph, the culling
itself is a red herring in this case.

Robert.

On Thu, Nov 13, 2008 at 12:29 AM, Benoit Gagnon [EMAIL PROTECTED] wrote:
 Hi all,

 what would be the most effective way to disable culling for my entire scene?

 I am using a fixed orthographic camera looking at the XY plane. I use the Z
 axis solely for layering my various nodes which are all 2D as well. All my
 nodes are always visible by the camera so culling is (almost) useless. The
 stats handler reports the culling operation to be (by a long run) the most
 time consuming operation.

 So, I wish to disable culling for my entire scene. Is that possible? I tried
 the following but it doesn't seem to do anything:

 osgViewer::Viewer viewer;
 viewer.setSceneData( root );
 viewer.setUpViewInWindow( 100, 100, 1024, 768, 0 );

 osgViewer::ViewerBase::Cameras cameras;
 osg::Camera* camera = viewer.getCamera();
 camera-setProjectionMatrixAsOrtho( -512, 512, -384, 384, 0, 20 );
 camera-setViewMatrixAsLookAt(
 osg::Vec3d( 0, 0, 100 ),
 osg::Vec3d( 0, 0, 0 ),
 osg::Vec3d( 0, 1, 0 )
 );
 camera-setClearColor(  osg::Vec4d( 0.64, 0.72, 0.78, 1 ) );
 camera-setCullingMode( osg::CullSettings::NO_CULLING );

 I assume the solution is very trivial but any help is apreciated!


 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Disabling culling for the entire scene?

2008-11-12 Thread Benoit Gagnon
Hi all,

what would be the most effective way to disable culling for my entire scene?

I am using a fixed orthographic camera looking at the XY plane. I use the Z
axis solely for layering my various nodes which are all 2D as well. All my
nodes are always visible by the camera so culling is (almost) useless. The
stats handler reports the culling operation to be (by a long run) the most
time consuming operation.

So, I wish to disable culling for my entire scene. Is that possible? I tried
the following but it doesn't seem to do anything:

osgViewer::Viewer viewer;
viewer.setSceneData( root );
viewer.setUpViewInWindow( 100, 100, 1024, 768, 0 );

osgViewer::ViewerBase::Cameras cameras;
osg::Camera* camera = viewer.getCamera();
camera-setProjectionMatrixAsOrtho( -512, 512, -384, 384, 0, 20 );
camera-setViewMatrixAsLookAt(
osg::Vec3d( 0, 0, 100 ),
osg::Vec3d( 0, 0, 0 ),
osg::Vec3d( 0, 1, 0 )
);
camera-setClearColor(  osg::Vec4d( 0.64, 0.72, 0.78, 1 ) );
camera-setCullingMode( osg::CullSettings::NO_CULLING );

I assume the solution is very trivial but any help is apreciated!
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org