Re: [osg-users] osgShadow ECEF precision problems
HI Marius, When you're happy with your changes you could please post the whole modified files to osg-submissions so I can review them. Thanks, Robert. On Wed, Dec 30, 2009 at 1:49 PM, Marius Heise mhe...@heise-network.com wrote: Hi Wojtek, small difference big change :-). Shadow is rock solid now. I only thoroughly tested the directional lighting but it should work for the other cases too. Cheers, Marius -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=21974#21974 Attachments: http://forum.openscenegraph.org//files/standardshadowmapcpppatch_180.txt ___ 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] osgShadow ECEF precision problems
Hi Wojtek, I solved my directional light case. I changed all floats to doubles in * StandardShadowMap::ViewData::aimShadowCastingCamera The light camera position was calculated as float as was thus jumping around. Of course the change from yesterday using double bounding volumes also has to be activated. In the process I also upgraded the polytope class to double (I don't think this is necessary). I can fix the other light type cases (VB/CB/DB) but someone will have to give me a quick walk-through on posting updates to osg so I don't have to do my work twice. Thanks a lot for your support. Cheers, Marius -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=21954#21954 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgShadow ECEF precision problems
Hi Marius, My congratulations! I am glad you did it. I solved my directional light case. I changed all floats to doubles in * StandardShadowMap::ViewData::aimShadowCastingCamera The code in the above method was based on original ShadowMap code and indeed used floats (I must admit I neglected this method). In the process I also upgraded the polytope class to double (I don't think this is necessary). I can fix the other light type cases (VB/CB/DB) but someone will have to give me a quick walk-through on posting updates to osg so I don't have to do my work twice. osg::Polytope is double based by default as far as I know. Other classes stemming from ViewDependentShadowTechnique inherit and use StandardShadowMap::ViewData::aimShadowCastingCamera method so you have fixed them all in one shot ;-) Can you post your modified StandardShadowMap.cpp ? I am preparing few fixes and I would like to merge my changes with the change you have meade before sending my submissions. Cheers, Wojtek - Original Message - From: Marius Heise mhe...@heise-network.com To: osg-users@lists.openscenegraph.org Sent: Wednesday, December 30, 2009 11:04 AM Subject: Re: [osg-users] osgShadow ECEF precision problems Hi Wojtek, The light camera position was calculated as float as was thus jumping around. Of course the change from yesterday using double bounding volumes also has to be activated. Thanks a lot for your support. Cheers, Marius -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=21954#21954 ___ 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] osgShadow ECEF precision problems
Hi Wojtek, :-) will do. Since I am currently on osg 2.9.5 I will switch to trunk and check if the double modifications only in StandardShadowMap.cpp are enough to solve the problem I had. If this is the case, I will send you the svn patch for osg trunk. My 2.9.5 is too dirty and old that I can send you that patch. Will let you know as soon as I've done it Cheers, Marius -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=21969#21969 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgShadow ECEF precision problems
Hi Marius, Current trunk version does not draw debug volumes, don't be surprised not seeing them. Its a problem outside of the osgShadow related to changes in COLOR_PER_PRIMITIVE handling. Cheers, Wojtek - Original Message - From: Marius Heise mhe...@heise-network.com To: osg-users@lists.openscenegraph.org Sent: Wednesday, December 30, 2009 1:37 PM Subject: Re: [osg-users] osgShadow ECEF precision problems Hi Wojtek, :-) will do. Since I am currently on osg 2.9.5 I will switch to trunk and check if the double modifications only in StandardShadowMap.cpp are enough to solve the problem I had. If this is the case, I will send you the svn patch for osg trunk. My 2.9.5 is too dirty and old that I can send you that patch. Will let you know as soon as I've done it Cheers, Marius -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=21969#21969 ___ 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] osgShadow ECEF precision problems
Hi Wojtek, small difference big change :-). Shadow is rock solid now. I only thoroughly tested the directional lighting but it should work for the other cases too. Cheers, Marius -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=21974#21974 Attachments: http://forum.openscenegraph.org//files/standardshadowmapcpppatch_180.txt ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] osgShadow ECEF precision problems
Hi! I have been using osgShadow::LightSpacePerspectiveShadowMapVB very successfully in previous osg projects. I am currently making the transition from a local XYZ to a whole earth ECEF database. In general the shadow still works correctly, but jumps around by about a meter or two when my model moves. It looks like the underlying shadow bounding volume calculation architecture is not completely implemented with double precision. If so, could anybody give me a hint if the modifications are simple and where they are? Thanks a lot - any help is appreciated. Cheers, Marius -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=21909#21909 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgShadow ECEF precision problems
Hi Marius, I am not sure what ECEF acronym means. I guess its WGS84 eliposoid coordinate system with origin in ellipsoid center. We are using LispSM with VPB generated terrain. Do you use setModellingSpaceToWorldTransform method ? It should be helpful in your work. See example of usage and setting it in osgshadow.cpp lines 832-851 (OSG trunk). However, I have not tested it with LispsmVB though, but LispsmCB and LispsmDB. And they seem to work precisely enough most of the time. When impleneting Lispsm/Minimal Shadow Map algorithms, I made the effort to make all computations using doubles. At the time when I was doing this, bounding boxes were based on floats so it may be the case that some issues could be related to inacurate bounding box precision. But my observations regarding shadow volume computations suggest different cause: even double precision is not enough for convex polytope math in WGS84 world coords when these convex polytopes are made from view frustums with very short near planes. For this case it would be better to make all shadow volume computations in view space. I wish I could do this someday but frankly I do not expect it to happen anytime soon. Cheers, Wojtek Lewandowski - Original Message - From: Marius Heise mhe...@heise-network.com To: osg-users@lists.openscenegraph.org Sent: Tuesday, December 29, 2009 12:20 PM Subject: [osg-users] osgShadow ECEF precision problems Hi! I have been using osgShadow::LightSpacePerspectiveShadowMapVB very successfully in previous osg projects. I am currently making the transition from a local XYZ to a whole earth ECEF database. In general the shadow still works correctly, but jumps around by about a meter or two when my model moves. It looks like the underlying shadow bounding volume calculation architecture is not completely implemented with double precision. If so, could anybody give me a hint if the modifications are simple and where they are? Thanks a lot - any help is appreciated. Cheers, Marius -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=21909#21909 ___ 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] osgShadow ECEF precision problems
Hi Wojtek, thanks for your reply. Sorry for the ECEF (earth-centered-earth-fixed) acronym. Basically we are talking about the same thing. A quick update. I activated setDebugDraw() and both the geometry bounding volume and light volume were jumping. I just noticed and undefined the OSG_USE_FLOAT_BOUNDINGBOX in osg\config. Now the bounding volume is precise and the light volume bounces. I can up you a video link of the problem via PM if you like. Thanks a lot for the setModellingSpaceToWorldTransform tip. I will give this a try right away. I am open for any suggestions. Even if it means switching from LightSpacePerspectiveShadowMapVB to something else. I just remember testing all shadow mapping versions and VB worked the most reliable for my application with a lot of camera movement, wide spaced objects and keeping the resolution of the map high. Cheers, Marius -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=21914#21914 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgShadow ECEF precision problems
Hi Wojtek, I have done various tests with the osgShadow demo. All three versions of the LightSpacePerspectiveShadowMap (VB/CB/DB) have the same precision problem even if setModellingSpaceToWorldTransform() is used. I did the following to reproduce: Simulate a large database by changing osgShadow demo line 371 to: osg::Vec3 center(3000.0, 3000.0, 3000.0); Execute the demo with the following: osgshadow --directionalLight --lispsm --ViewBounds --debugHUD -2 osgshadow --directionalLight --lispsm --CullBounds --debugHUD -2 osgshadow --directionalLight --lispsm --DrawBounds --debugHUD -2 Any ideas? Thanks a lot for your effort! Cheers, Marius -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=21919#21919 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgShadow ECEF precision problems
Hi Marius, When I do this I see empty blue screen. No model displayed. Looks like camera is positioned far from the model. Perhaps you have done more modifications ? Wojtek - Original Message - From: Marius Heise mhe...@heise-network.com To: osg-users@lists.openscenegraph.org Sent: Tuesday, December 29, 2009 4:17 PM Subject: Re: [osg-users] osgShadow ECEF precision problems Hi Wojtek, I have done various tests with the osgShadow demo. All three versions of the LightSpacePerspectiveShadowMap (VB/CB/DB) have the same precision problem even if setModellingSpaceToWorldTransform() is used. I did the following to reproduce: Simulate a large database by changing osgShadow demo line 371 to: osg::Vec3 center(3000.0, 3000.0, 3000.0); Execute the demo with the following: osgshadow --directionalLight --lispsm --ViewBounds --debugHUD -2 osgshadow --directionalLight --lispsm --CullBounds --debugHUD -2 osgshadow --directionalLight --lispsm --DrawBounds --debugHUD -2 Any ideas? Thanks a lot for your effort! Cheers, Marius -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=21919#21919 ___ 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] osgShadow ECEF precision problems
Hi Wojtek, sorry.. press '1' and then SPACE ... the camera home position is then calculated automatically to fit the model into the view. This is all caused because the model is so far away. Good luck :-) Cheers, Marius -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=21922#21922 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgShadow ECEF precision problems
Marius, We must have been using different OSG versions. 1 , SPACE seems to not work on my trunk code. I solved this by setting home postion manually. I was able replicate your problem but unfortunately have no more time to spare now and any aditional hints do not cross my mind at the moment. However, I am curious what can be wrong myself and will look into it in next or two days. Wojtek - Original Message - From: Marius Heise mhe...@heise-network.com To: osg-users@lists.openscenegraph.org Sent: Tuesday, December 29, 2009 5:05 PM Subject: Re: [osg-users] osgShadow ECEF precision problems Hi Wojtek, sorry.. press '1' and then SPACE ... the camera home position is then calculated automatically to fit the model into the view. This is all caused because the model is so far away. Good luck :-) Cheers, Marius -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=21922#21922 ___ 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