Re: [osg-users] View Frustrum Culling
On Wed, Aug 20, 2008 at 2:09 AM, Ulrich Hertlein [EMAIL PROTECTED] wrote: Check out osgSim::VisibilityGroup as well as PagedLOD. They may already do what you need i.e. select the visible room and loading it. Something like VG - P_LOD - roomGroup That's a good suggestion that I missed. A further refinement would be to use ProxyNode rather PagedLOD. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] View Frustrum Culling
@paul: Yes indeed. Thank you for the tip. @Robert: In my Application I have rooms and fixed camera-positions. The Data I load in this application constist of loaded IVE-Files. Every loaded node is a single object, but is composed by some subnodes i dont care about. Because Im loading many many files the loading time takes too much So my decision was to make a preprocessing step. I once load all Objects in a room. Then I look whether the object is visible from a camera-viewpoint. I mark them in our database. The next time I try to load a Camera-Viewpoint I don't have to load all the objects in the room but only the visible objects. So I can speedup loading. If I would want to write a custom visitor I need to get this polytope somehow out of the actual cam-parameters and the do some manual testing. Do you have some hints for that? Greetings Hagen ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] View Frustrum Culling
Hi Hagen, It does sounds like paging would help you out - as it'll manage the loading of only visible items automatically. Creating a PagedLOD based database would allow you to keep you app simple, with no need for trying to be clever about picking what parts to load - it'll all come free as part of osgViewer. Robert. On Tue, Aug 19, 2008 at 2:57 PM, Kaiser, Hagen [EMAIL PROTECTED] wrote: @paul: Yes indeed. Thank you for the tip. @Robert: In my Application I have rooms and fixed camera-positions. The Data I load in this application constist of loaded IVE-Files. Every loaded node is a single object, but is composed by some subnodes i dont care about. Because Im loading many many files the loading time takes too much So my decision was to make a preprocessing step. I once load all Objects in a room. Then I look whether the object is visible from a camera-viewpoint. I mark them in our database. The next time I try to load a Camera-Viewpoint I don't have to load all the objects in the room but only the visible objects. So I can speedup loading. If I would want to write a custom visitor I need to get this polytope somehow out of the actual cam-parameters and the do some manual testing. Do you have some hints for that? Greetings Hagen ___ 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
Re: [osg-users] View Frustrum Culling
Hello Hagen, Kaiser, Hagen wrote: In my Application I have rooms and fixed camera-positions. ... I once load all Objects in a room. Then I look whether the object is visible from a camera-viewpoint. I mark them in our database. The next time I try to load a Camera-Viewpoint I don't have to load all the objects in the room but only the visible objects. So I can speedup loading. If I would want to write a custom visitor I need to get this polytope somehow out of the actual cam-parameters and the do some manual testing. Do you have some hints for that? Check out osgSim::VisibilityGroup as well as PagedLOD. They may already do what you need i.e. select the visible room and loading it. Something like VG - P_LOD - roomGroup Cheers, /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] View Frustrum Culling
Hi Hagen, Could you not just using the OSG's built in osg::PagedLOD/osgDB::DatabasePager for managing the loading of your scene in a more balanced way? Robert. On Tue, Jul 29, 2008 at 8:56 AM, Kaiser, Hagen (CT) [EMAIL PROTECTED] wrote: Hello everyone, Maybe it sounds basic. I have camera that will never change place. I have a database with one Object/onFile-Mapping. So next time I load my Scene id like to load only relevant Objects to shorten Loading time. Simple Task: I need to get a list of all VISIBLE Objects in the ViewFrustrum. Can this be done with the cull-Traverser. The docs say it collects all the objects in a special order. Are these objects all objects in the end or only the visible? How can I get the visbile Nodes? What things are to be taken care of? Greetings? ___ 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] View Frustrum Culling
Hello everyone, Maybe it sounds basic. I have camera that will never change place. I have a database with one Object/onFile-Mapping. So next time I load my Scene id like to load only relevant Objects to shorten Loading time. Simple Task: I need to get a list of all VISIBLE Objects in the ViewFrustrum. Can this be done with the cull-Traverser. The docs say it collects all the objects in a special order. Are these objects all objects in the end or only the visible? How can I get the visbile Nodes? What things are to be taken care of? Greetings? ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] View Frustrum Culling
Hi Kaiser, I have just done parts of what you need. Make yourself a group node which you place as the root of the scene-graph that you need to list objects from. Override it's traverse function and post process the cull-visitor: void yourGroupClass::traverse( osg::NodeVisitor nv ) { osg::Group::traverse( nv ); if( nv.getVisitorType() == osg::NodeVisitor::CULL_VISITOR ) { osgUtil::CullVisitor* cv = dynamic_castosgUtil::CullVisitor*( nv ); if( cv ) { // Do your stuff here // You should be able to find what you need inside cv-RenderStage-RenderBinList... // The cull-traverse is done, so everything that is visible must be stored in the render-bins. // I am pretty sure you should be able to find some information in these structures which points you to your objects. } } }Cheers, Viggo Date: Tue, 29 Jul 2008 09:56:59 +0200From: [EMAIL PROTECTED]: [EMAIL PROTECTED]: [osg-users] View Frustrum Culling Hello everyone, Maybe it sounds basic. I have camera that will never change place. I have a database with one Object/onFile-Mapping. So next time I load my Scene id like to load only relevant Objects to shorten Loading time. Simple Task: I need to get a list of all VISIBLE Objects in the ViewFrustrum. Can this be done with the cull-Traverser. The docs say it collects all the objects in a special order. Are these objects all objects in the end or only the visible? How can I get the visbile Nodes? What things are to be taken care of? Greetings? _ Windows Live Messenger - også på mobilen. http://windowslivemobile.msn.com/Homepage.aspx?lang=nb-noocid=30032___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] view-frustrum-culling problem in bigger scene
Hi, In a small scene whose bounding sphere's radius is 300, I moved the eye point near to a plane( the distance is about 6 ), then the scene behind the plane could not be seen, this is a correct result. However, when the scene turned to bigger( 5000 * 5000 ), the eye point was at the same positon, but the scene behind the plane is visiable, it means the plane was culled. Besides, I tested that even I put the eye point further to the plane( the distance is about 20 ), the behind scene was still visiable. I'm using OSG2.3.7, and no ClipNode, just default visialbe culling. Could anyboby give me some hints? 3X! litingbaotou 2008-04-21 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] view-frustrum-culling problem in bigger scene
Hi Litingbaotou, I can only guess that either small feature culling or near plane clipping (done on the GPU) has clipped out the geometry, the later being most probably the problem. Move the camera around and observer what happens - when you can see the plane and when you can't. Once you have a better handle on when you can see it you'll have a better chance of diagnosing the problem. One things I'd suggest its highly unlikely to be is view frustum culling, near plan clipping is most likely. Robert. On Mon, Apr 21, 2008 at 8:10 AM, litingbaotou [EMAIL PROTECTED] wrote: Hi, In a small scene whose bounding sphere's radius is 300, I moved the eye point near to a plane( the distance is about 6 ), then the scene behind the plane could not be seen, this is a correct result. However, when the scene turned to bigger( 5000 * 5000 ), the eye point was at the same positon, but the scene behind the plane is visiable, it means the plane was culled. Besides, I tested that even I put the eye point further to the plane( the distance is about 20 ), the behind scene was still visiable. I'm using OSG2.3.7, and no ClipNode, just default visialbe culling. Could anyboby give me some hints? 3X! litingbaotou 2008-04-21 ___ 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
Re: [osg-users] view-frustrum-culling problem in bigger scene
Hi, Robert Thanks for your advise, I think it's a near plan clipping problem. I've tried change the near plan param in setProjectionMatrixAsPerspective () from 0.01 to 1.0, but it didn't work. Could you give me some advise about how to fix this near plan clipping problem? Thanks. litingbaotou 2008-04-21 发件人: Robert Osfield 发送时间: 2008-04-21 15:49:25 收件人: OpenSceneGraph Users 抄送: 主题: Re: [osg-users] view-frustrum-culling problem in bigger scene Hi Litingbaotou, I can only guess that either small feature culling or near plane clipping (done on the GPU) has clipped out the geometry, the later being most probably the problem. Move the camera around and observer what happens - when you can see the plane and when you can't. Once you have a better handle on when you can see it you'll have a better chance of diagnosing the problem. One things I'd suggest its highly unlikely to be is view frustum culling, near plan clipping is most likely. Robert. On Mon, Apr 21, 2008 at 8:10 AM, litingbaotou [EMAIL PROTECTED] wrote: Hi, In a small scene whose bounding sphere's radius is 300, I moved the eye point near to a plane( the distance is about 6 ), then the scene behind the plane could not be seen, this is a correct result. However, when the scene turned to bigger( 5000 * 5000 ), the eye point was at the same positon, but the scene behind the plane is visiable, it means the plane was culled. Besides, I tested that even I put the eye point further to the plane( the distance is about 20 ), the behind scene was still visiable. I'm using OSG2.3.7, and no ClipNode, just default visialbe culling. Could anyboby give me some hints? 3X! litingbaotou 2008-04-21 ___ 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
Re: [osg-users] view-frustrum-culling problem in bigger scene
Hi Litingbaotou, On Mon, Apr 21, 2008 at 12:57 PM, litingbaotou [EMAIL PROTECTED] wrote: Thanks for your advise, I think it's a near plan clipping problem. I've tried change the near plan param in setProjectionMatrixAsPerspective () from 0.01 to 1.0, but it didn't work. Could you give me some advise about how to fix this near plan clipping problem? Thanks. By default the OSG automatically computes the near and far planes so they encompass the scene, when you have a big scene this push the far plan out as far as the most distant point in your view frustum. If you are inside the model then the near plane will in effect move to coincide with the eye point - but OpenGL can't handle near plane distances of 0 so it'll compute it's position based on a near distance = near far ratio * far distance. The near far ratio is stored in the osg::CullSettings class, which is inherited into osg::Camera, if you lower the near far ratio, then the near plane will move near to you - so it'll clip out less, but... the downside is the depth precision of the depth buffer goes down so z fighting will become more likely. camera-setNearFarRatio(0.0001f;); // default is 0.0005f; Alternatively you can set the env var OSG_NEAR_FAR_RATIO to the value you want, this will override the default. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org