Re: [osg-users] Aircraft Getting Invisible ?
Hi Robert; I have tried all your advices and osg::Fog effect works the invisibility problem. I try to other ; 1 - changing setNearFarRatio' value, 2 - adding viewer.getCamera()-setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR ); pattern and 3 - osg::CullStack::CullingMode cullingMode = sceneview-getCullingMode(); cullingMode = ~ ( osg::CullStack::SMALL_FEATURE_CULLING ); sceneview-setCullingMode( cullingMode ); // You can also control the size of the screen space that is used to cull // small features with sceneview-setSmallFeatureCullingPixelSize( minimumSize ); but any of them didn't help me. So why the osg::fog effect fix the problem? I guess; it reduce the detail of scene and so this has resulted of protecting the models visibility. Does it could be right ? Thanks so much Robert :) ÜMİT UZUN Date: Wed, 7 May 2008 09:38:08 +0100 From: [EMAIL PROTECTED] To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] Aircraft Getting Invisible ? Hi Umit, I'd guess that you are probably coming across a near plane clipping issue, rather than a culling issue. Unfortunately its easy to confuse clipping with culling when you just see disappearing, but its too very different mechanisms at play so its important to work out whether it is clipping or culling that is at play. The way to know is study how the object disappears - does it slowly get eaten away or does it just pop out of existance - the former will be near plane clipping down on the GPU, the later most likely culling. Both clipping and culling problems can be caused by incorrect bounding volume computations - if your plane was a custom drawable or you'd just a shader to modify its geometry then this might be a candidate. If you are using standard osg::Geometry then its very unlikely that culling as at fault as the OSG's native codes for computing bounding volumes and doing cull testing are very well established and tested. My guess is that most likely you have an issue with near plane clipping, and if you have a very large model extents this can be very common - as the far plane will be pushed out so far. The OSG does have support for cluster culling, and this will be used by default in geocentric databases built by VPB, this will cull out tiles beyond the horizon line and pull in the max far distance, but it doesn't solve all the potential problems as the furtherest tile can still be a long way out. If you want to pull it in further you could manually control it but then you'll need to make sure you use glFog/osg::Fog on the terrain to make sure that you can only see up to a set maximum distanace. If you use this trick then disabling the compute of near far will be required. You should be able to enable the far clipping plane as well. The other thing you can do is to reduce the NearFarRatio by setting setNearFarRatio to something lower than it's default of 0.0005f ( see src/osg/CullSettings.cpp's setDefaults() method where it's set.) Robert. Robert. 2008/5/5 ümit uzun : Hi all, I have an aircraft. I resize it and add scene on the earth but it get invisible when I resized much smaller like that, float size = 0.0005f / mAircraftModel.get( )-getBound( ).radius( ); mAircraftTransform-setDataVariance( osg::Object::STATIC ); mAircraftTransform-setMatrix( osg::Matrix::scale( size, size, size ) * osg::Matrix::rotate( osg::DegreesToRadians( 90.0f ), 1.0f, 0.0f, 0.0f ) * osg::Matrix::rotate( osg::DegreesToRadians( -90.0f ), 0.0f, 0.0f, 1.0f ) * osg::Matrix::rotate( osg::DegreesToRadians( 5.0f ), 1.0f, 0.0f, 0.0f ) ); Earth size is, float size = 2000.0f / mTerrainModel.get( )-getBound( ).radius( ); mTerrainTransform-setDataVariance( osg::Object::STATIC ); mTerrainTransform-setMatrix( osg::Matrix::scale( size, size, size ) ); What can I do for protect the aircraft visibility? Thanks so much! ÜMİT UZUN _ Şimdi aileye katılmanın tam zamanı - Yeni nesil Ücretsiz Windows Live Hizmetlerini şimdi edinin! http://get.live.com ___ 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 _ Şimdi aileye katılmanın tam zamanı - Yeni nesil Ücretsiz Windows Live Hizmetlerini şimdi edinin! http://get.live.com ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Aircraft Getting Invisible ?
Hi Umit, I'd guess that you are probably coming across a near plane clipping issue, rather than a culling issue. Unfortunately its easy to confuse clipping with culling when you just see disappearing, but its too very different mechanisms at play so its important to work out whether it is clipping or culling that is at play. The way to know is study how the object disappears - does it slowly get eaten away or does it just pop out of existance - the former will be near plane clipping down on the GPU, the later most likely culling. Both clipping and culling problems can be caused by incorrect bounding volume computations - if your plane was a custom drawable or you'd just a shader to modify its geometry then this might be a candidate. If you are using standard osg::Geometry then its very unlikely that culling as at fault as the OSG's native codes for computing bounding volumes and doing cull testing are very well established and tested. My guess is that most likely you have an issue with near plane clipping, and if you have a very large model extents this can be very common - as the far plane will be pushed out so far. The OSG does have support for cluster culling, and this will be used by default in geocentric databases built by VPB, this will cull out tiles beyond the horizon line and pull in the max far distance, but it doesn't solve all the potential problems as the furtherest tile can still be a long way out. If you want to pull it in further you could manually control it but then you'll need to make sure you use glFog/osg::Fog on the terrain to make sure that you can only see up to a set maximum distanace. If you use this trick then disabling the compute of near far will be required. You should be able to enable the far clipping plane as well. The other thing you can do is to reduce the NearFarRatio by setting setNearFarRatio to something lower than it's default of 0.0005f ( see src/osg/CullSettings.cpp's setDefaults() method where it's set.) Robert. Robert. 2008/5/5 ümit uzun [EMAIL PROTECTED]: Hi all, I have an aircraft. I resize it and add scene on the earth but it get invisible when I resized much smaller like that, float size = 0.0005f / mAircraftModel.get( )-getBound( ).radius( ); mAircraftTransform-setDataVariance( osg::Object::STATIC ); mAircraftTransform-setMatrix( osg::Matrix::scale( size, size, size ) * osg::Matrix::rotate( osg::DegreesToRadians( 90.0f ), 1.0f, 0.0f, 0.0f ) * osg::Matrix::rotate( osg::DegreesToRadians( -90.0f ), 0.0f, 0.0f, 1.0f ) * osg::Matrix::rotate( osg::DegreesToRadians( 5.0f ), 1.0f, 0.0f, 0.0f ) ); Earth size is, float size = 2000.0f / mTerrainModel.get( )-getBound( ).radius( ); mTerrainTransform-setDataVariance( osg::Object::STATIC ); mTerrainTransform-setMatrix( osg::Matrix::scale( size, size, size ) ); What can I do for protect the aircraft visibility? Thanks so much! ÜMİT UZUN _ Şimdi aileye katılmanın tam zamanı - Yeni nesil Ücretsiz Windows Live Hizmetlerini şimdi edinin! http://get.live.com ___ 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] Aircraft getting invisible by AutoCullingSystem
Hi Robert, Firstly you are welcome to mail list :) I have an question about culling problem. I have an aircraft and earth model. Their size is aircraft = 0e-07 and earth = 2e+07. When I add the aircraft node to the coordinateSystemNode which all nodes tied to it, aircraft get invisible. I think automatic culling system is culling the aircraft from the scene. I have try to add ; viewer.getCamera()-setComputeNearFarMode( osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR ); std::coutNearFarMode : getComputeNearFarMode()getCullingMode(); cullingMode = ~ ( osg::CullStack::SMALL_FEATURE_CULLING ); viewer.getCamera()-setCullingMode( cullingMode ); then result is same. Why my little aircraft culling from scene? How can I fix this problem? Thanks so much... ÜMİT UZUN _ Gelen kutunuzda hiç yer kalmamasından bıktınız mı? Windows Live Hotmail şimdi size 5GB ÜCRETSİZ depolama alanı sunuyor! Ücretsiz Windows Live Hotmail hesabınızı buradan alın! http://get.live.com/mail/overview ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Aircraft getting invisible by AutoCullingSystem
ümit uzun wrote: Hi Robert, Firstly you are welcome to mail list :) I have an question about culling problem. I have an aircraft and earth model. Their size is aircraft = 0e-07 and earth = 2e+07. When I add the aircraft node to the coordinateSystemNode which all nodes tied to it, aircraft get invisible. I think automatic culling system is culling the aircraft from the scene. I have try to add ; viewer.getCamera()-setComputeNearFarMode( osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR ); If you turn off automatic clipping range calculation you will have to specify a suitable range yourself. Did you check the range you use? Paul std::coutNearFarMode : getComputeNearFarMode()getCullingMode(); cullingMode = ~ ( osg::CullStack::SMALL_FEATURE_CULLING ); viewer.getCamera()-setCullingMode( cullingMode ); then result is same. Why my little aircraft culling from scene? How can I fix this problem? Thanks so much... ÜMİT UZUN _ Gelen kutunuzda hiç yer kalmamasından bıktınız mı? Windows Live Hotmail şimdi size 5GB ÜCRETSİZ depolama alanı sunuyor! Ücretsiz Windows Live Hotmail hesabınızı buradan alın! http://get.live.com/mail/overview ___ 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] Aircraft getting invisible by AutoCullingSystem
ÜMİT UZUN Date: Tue, 6 May 2008 16:13:09 +0200 From: [EMAIL PROTECTED] To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] Aircraft getting invisible by AutoCullingSystem ümit uzun wrote: Hi Robert, Firstly you are welcome to mail list :) I have an question about culling problem. I have an aircraft and earth model. Their size is aircraft = 0e-07 and earth = 2e+07. When I add the aircraft node to the coordinateSystemNode which all nodes tied to it, aircraft get invisible. I think automatic culling system is culling the aircraft from the scene. I have try to add ; viewer.getCamera()-setComputeNearFarMode( osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR ); If you turn off automatic clipping range calculation you will have to specify a suitable range yourself. Did you check the range you use? Paul Hi Paul, I didn't check the range after I use viewer.getCamera()-setComputeNearFarMode( osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR ); command. How can I do and what will it give me? Actually I don't understand what is for. Thanks.. std::coutNearFarMode : getComputeNearFarMode()cullingMode = ~ ( osg::CullStack::SMALL_FEATURE_CULLING ); viewer.getCamera()-setCullingMode( cullingMode ); then result is same. Why my little aircraft culling from scene? How can I fix this problem? Thanks so much... ÜMİT UZUN _ Gelen kutunuzda hiç yer kalmamasından bıktınız mı? Windows Live Hotmail şimdi size 5GB ÜCRETSİZ depolama alanı sunuyor! Ücretsiz Windows Live Hotmail hesabınızı buradan alın! http://get.live.com/mail/overview ___ 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 _ Şimdi aileye katılmanın tam zamanı - Yeni nesil Ücretsiz Windows Live Hizmetlerini şimdi edinin! http://get.live.com ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Aircraft getting invisible by AutoCullingSystem
ümit uzun wrote on Tuesday 06 May 2008: Hi Robert, Firstly you are welcome to mail list :) I have an question about culling problem. I have an aircraft and earth model. Their size is aircraft = 0e-07 and earth = 2e+07. When I add the aircraft node to the coordinateSystemNode which all nodes tied to it, aircraft get invisible. I think automatic culling system is culling the aircraft from the scene. I have try to add ; viewer.getCamera()-setComputeNearFarMode( osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR ); std::coutNearFarMode : getComputeNearFarMode()getCullingMode(); cullingMode = ~ ( osg::CullStack::SMALL_FEATURE_CULLING ); viewer.getCamera()-setCullingMode( cullingMode ); I think this has something to do with fustrum. I use this code: double fovy=45.; double aspectRatio=1.32773; double zNear=0.2; double zFar=5.; osg::Matrixd CameraPerspective; CameraPerspective.makePerspective( fovy, aspectRatio, zNear, zFar); viewer.getCamera() - setProjectionMatrix( CameraPerspective ); viewer.getCamera() - setComputeNearFarMode( osgUtil::CullVisitor::DO_NOT_COMPUTE_NEAR_FAR ); bye Zoltán then result is same. Why my little aircraft culling from scene? How can I fix this problem? Thanks so much... ÜMÝT UZUN _ Gelen kutunuzda hiç yer kalmamasýndan býktýnýz mý? Windows Live Hotmail þimdi size 5GB ÜCRETSÝZ depolama alaný sunuyor! Ücretsiz Windows Live Hotmail hesabýnýzý buradan alýn! http://get.live.com/mail/overview ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-op enscenegraph.org -- Zoltan http://sourceforge.net/projects/zsim ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Aircraft getting invisible by AutoCullingSystem
ümit uzun wrote: ÜMİT UZUN Date: Tue, 6 May 2008 16:13:09 +0200 From: [EMAIL PROTECTED] To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] Aircraft getting invisible by AutoCullingSystem ümit uzun wrote: Hi Robert, Firstly you are welcome to mail list :) I have an question about culling problem. I have an aircraft and earth model. Their size is aircraft = 0e-07 and earth = 2e+07. When I add the aircraft node to the coordinateSystemNode which all nodes tied to it, aircraft get invisible. I think automatic culling system is culling the aircraft from the scene. I have try to add ; viewer.getCamera()-setComputeNearFarMode( osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR ); If you turn off automatic clipping range calculation you will have to specify a suitable range yourself. Did you check the range you use? Paul Hi Paul, I didn't check the range after I use viewer.getCamera()-setComputeNearFarMode( osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR ); command. How can I do and what will it give me? Actually I don't understand what is for. Then you might want to read up on (OpenGL) near/far culling. Basically it means that 3D objects that are either too close to or too far away from the current viewpoint are not drawn at all, they are simply discarded (culled). See the piece of code that Zoltan just posted for details on how to control the culling in OSG manually. Paul Thanks.. std::coutNearFarMode : getComputeNearFarMode()cullingMode = ~ ( osg::CullStack::SMALL_FEATURE_CULLING ); viewer.getCamera()-setCullingMode( cullingMode ); then result is same. Why my little aircraft culling from scene? How can I fix this problem? Thanks so much... ÜMİT UZUN _ Gelen kutunuzda hiç yer kalmamasından bıktınız mı? Windows Live Hotmail şimdi size 5GB ÜCRETSİZ depolama alanı sunuyor! Ücretsiz Windows Live Hotmail hesabınızı buradan alın! http://get.live.com/mail/overview ___ 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 _ Şimdi aileye katılmanın tam zamanı - Yeni nesil Ücretsiz Windows Live Hizmetlerini şimdi edinin! http://get.live.com ___ 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] Aircraft getting invisible by AutoCullingSystem
Hi Gordon, Sorry for my simple question but how can I specify Cull Callback for any node ? I search the mail list for it but I can't understand how it can be done? ÜMİT UZUN From: [EMAIL PROTECTED] To: osg-users@lists.openscenegraph.org Date: Tue, 6 May 2008 10:19:25 -0400 Subject: Re: [osg-users] Aircraft getting invisible by AutoCullingSystem Sounds like this may be a floating point precision issue in the Z-buffer and your aircraft is simply failing z-buffer test but passing the OSG culling test it might also be failing the cull test because of that One way to check if is that type of issue is to place a cull callback on the aircraft node, if it gets called/visited then you know you passed the cull test and that's it's a zbuffer issue -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of ümit uzun Sent: Tuesday, May 06, 2008 10:11 AM To: osg-users@lists.openscenegraph.org Subject: [osg-users] Aircraft getting invisible by AutoCullingSystem Hi Robert, Firstly you are welcome to mail list :) I have an question about culling problem. I have an aircraft and earth model. Their size is aircraft = 0e-07 and earth = 2e+07. When I add the aircraft node to the coordinateSystemNode which all nodes tied to it, aircraft get invisible. I think automatic culling system is culling the aircraft from the scene. I have try to add ; viewer.getCamera()-setComputeNearFarMode( osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR ); std::coutNearFarMode : getComputeNearFarMode() cullingMode = ~ ( osg::CullStack::SMALL_FEATURE_CULLING ); viewer.getCamera()-setCullingMode( cullingMode ); then result is same. Why my little aircraft culling from scene? How can I fix this problem? Thanks so much... ÜMİT UZUN _ Gelen kutunuzda hiç yer kalmamasından bıktınız mı? Windows Live Hotmail şimdi size 5GB ÜCRETSİZ depolama alanı sunuyor! Ücretsiz Windows Live Hotmail hesabınızı buradan alın! http://get.live.com/mail/overview ___ 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 _ Şimdi aileye katılmanın tam zamanı - Yeni nesil Ücretsiz Windows Live Hizmetlerini şimdi edinin! http://get.live.com ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Aircraft Getting Invisible ?
I would guess its small feature culling See http://www.vis-sim.com/osg/osg_faq_1.htm#f22 Gordon -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Zoltán Sent: Monday, May 05, 2008 4:44 AM To: OpenSceneGraph Users Subject: Re: [osg-users] Aircraft Getting Invisible ? This looks like a culling issue. You might try such a code: viewer.getCamera() - setComputeNearFarMode( osgUtil::CullVisitor::DO_NOT_COMPUTE_NEAR_FAR ); bye Zoltán ümit uzun wrote on Monday 05 May 2008: Hi all, I have an aircraft. I resize it and add scene on the earth but it get invisible when I resized much smaller like that, float size = 0.0005f / mAircraftModel.get( )-getBound( ).radius( ); mAircraftTransform-setDataVariance( osg::Object::STATIC ); mAircraftTransform-setMatrix( osg::Matrix::scale( size, size, size ) * osg::Matrix::rotate( osg::DegreesToRadians( 90.0f ), 1.0f, 0.0f, 0.0f ) * osg::Matrix::rotate( osg::DegreesToRadians( -90.0f ), 0.0f, 0.0f, 1.0f ) * osg::Matrix::rotate( osg::DegreesToRadians( 5.0f ), 1.0f, 0.0f, 0.0f ) ); Earth size is, float size = 2000.0f / mTerrainModel.get( )-getBound( ).radius( ); mTerrainTransform-setDataVariance( osg::Object::STATIC ); mTerrainTransform-setMatrix( osg::Matrix::scale( size, size, size ) ); What can I do for protect the aircraft visibility? Thanks so much! ÜMÝT UZUN _ Þimdi aileye katýlmanýn tam zamaný - Yeni nesil Ücretsiz Windows Live Hizmetlerini þimdi edinin! http://get.live.com -- Zoltan ___ 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