Re: [osg-users] [osgPlugins] osgShadow LiSPSM culling problem
Hi Robert, I checked the svn/trunk last week and as you said the clipping problem seems to have been resolved. After exploring your new VDSM implementation further, it seems that there is a bug with the ReceivesShadowTraversalMask (or I am missing something). If I turn off this mask bit the geometry is culled out entirely. The Casting bit seems to work fine as expected. This is demonstrated in the osgshadow example by setting the mask on one of the models. For instance adding: scene-setNodeMask(scene-getNodeMask() ~ReceivesShadowTraversalMask); in Model Three. I'm attempting to track this down now, but hoped you might have some insight. Thanks much, Garrett -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52212#52212 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] osgShadow LiSPSM culling problem
Hi Robert, This is a super-delayed follow-up but I've finally circled back around to this issue. Using the standard osgshadow example I can reproduce the general problem I'm having (shadows being clipped prior to the edge of the screen) by running with the following parameters: osgshadow --directionalLight --light-dir 0.969358 -0.218775 -0.111722 --noUpdate --vdsm -3 Then if you hit '3' to change navigation mode and move the mouse right such that the models move towards the left edge of the screen, you will see that near the edge shadows on the sphere get clipped out entirely. This is the behavior that I am seeing in many other instances in my own testing and have narrowed it down to the clipping but not made it much farther than that. Any insight you have would be greatly appreciated. ... Thank you! Cheers, Garrett -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52013#52013 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] osgShadow LiSPSM culling problem
Hi Garret, I used your suggestion command line options but haven't spotted the clipping issue yet. I'm using svn/trunk version of the OSG. Which version are you using? Could you record an animation path by pressing 'z' to start and again 'z' to stop and save to a saved_animation.path file. This file can be passed to osgshadow on the command line by adding -p saved_animation.path. Using this method it's possible to reproduce exactly the same camera angles, and can be attached to an email so that others can reproduce exactly what you are testing. Thanks, Robert. On 18 January 2013 15:25, Garrett Cope garrett.cope@simcen.usuhs.edu wrote: osgshadow --directionalLight --light-dir 0.969358 -0.218775 -0.111722 --noUpdate --vdsm -3 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] osgShadow LiSPSM culling problem
Hi Robert, Thanks for the quick reply. I am using 3.1.1 with the hopes of remaining somewhat stable. ;) Perhaps I should try the svn/trunk version. Attached is the animation path that shows the clipping on my installation. The forum would not allow the *.path extension so I change it to .txt Thanks again. Cheers, Garrett -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52016#52016 Attachments: http://forum.openscenegraph.org//files/saved_animation_139.txt ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] osgShadow LiSPSM culling problem
Hi Garret, On 23 August 2012 19:28, Garrett Cope garrett.cope@simcen.usuhs.edu wrote: Attached are two screen shots. 'shadow_before' is the base state with a box casting a perfectly fine shadow. 'shadow_after' is where I have rotated the camera such that the box has moved out of view to the right. In this image you can see another clipping edge beginning at the bottom of the shadow that moves relatively vertically as the box continues to rotate to the right of the viewing window. Thanks for the screenshots, unfortunately it doesn't quite provide enough clues to know what might be amiss. Could you output a small model that using the osgshadow example can be used to recreate the issue? You can record a camera path with osgshadow by pressing 'z' to start and 'Z' to finish, this then writes out a file saved_animation.path, you can then replay this in osgviewer/osgshadow using the command line option -p saved_animation.path. As with the LiSPSM implementation, if I comment out the clipping section (here in adjustPerspectiveShadowMapCameraSettings(..) function), it looks fine but of course is then not clipped at all. It sounds like the light space extents isn't being fitted properly, or there is an error in the adjustment of the shadow map projection matrix for the light space extents. Debugging these issues requires models that can recreate the issue though, there isn't really anything I can do without being able to reproduce the problem. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] osgShadow LiSPSM culling problem
Hi Robert, I haven't been able to reproduce my specific problem with the osgshadow example, but I have been able to reproduce all kinds of weird clipping planes. Just none that are resolved by commenting out the aforementioned section. For instance, if I set the default light direction in the example to pretty much anything other than 0,0,1 (for instance: 0,-1,1) and then rotate the model around with the manipulator, the shadows get clipped along strange lines. I will keep trying to reproduce my specific instance of the issue. Thanks again for the help, Garrett -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49501#49501 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] osgShadow LiSPSM culling problem
Hi Garret, Could I suggest that you try out the new osgShadow::ViewDependentShadowMap found in svn/trunk of the OSG, it's more robust and flexible than the old LispSM implementation. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] osgShadow LiSPSM culling problem
Hi Robert, Thanks for the suggestion! VDSM is nice and concise - nice work! But unfortunately I still get the same clipping problem with it, so I'm sure it's something wrong on my end. I'll keep plugging away and see what I can come up with. Thanks again, Garrett ... -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49479#49479 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] osgShadow LiSPSM culling problem
Hi Garret, On 23 August 2012 18:18, Garrett Cope garrett.cope@simcen.usuhs.edu wrote: Thanks for the suggestion! VDSM is nice and concise - nice work! But unfortunately I still get the same clipping problem with it, so I'm sure it's something wrong on my end. I'll keep plugging away and see what I can come up with. You'll need to post screen shots so can get an idea of what is happening at your end. If it's possible to recreate using the osgshadow example then it'd be really useful. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] osgShadow LiSPSM culling problem
Robert, Attached are two screen shots. 'shadow_before' is the base state with a box casting a perfectly fine shadow. 'shadow_after' is where I have rotated the camera such that the box has moved out of view to the right. In this image you can see another clipping edge beginning at the bottom of the shadow that moves relatively vertically as the box continues to rotate to the right of the viewing window. As with the LiSPSM implementation, if I comment out the clipping section (here in adjustPerspectiveShadowMapCameraSettings(..) function), it looks fine but of course is then not clipped at all. Thanks again, Garrett ... [/img] -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49481#49481 Attachments: http://forum.openscenegraph.org//files/shadow_after_115.png http://forum.openscenegraph.org//files/shadow_before_410.png ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] osgShadow LiSPSM culling problem
Hi Wojtek, Thanks for replying. The projection matrix at the points you mention matches what it is in my main app. I also set do_not_compute for the near/far planes on the main camera but didn't find any difference. If I understand the clipping correctly, it's just a polytope representing the bounds of the shadow cut by a unit bounding box transformed by the main camera projection matrix. This means that either the shadow bounds calculation is wrong or my fundamental projection matrix is wrong... Does this sound right? I will try to come up with a simpler example to see which is the culprit. Thanks again for your help. ... Thank you! Cheers, Garrett -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49364#49364 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] [osgPlugins] osgShadow LiSPSM culling problem
Hi, I'm working with the osgShadow LiSPSM implementation as that seems to be the one that people have had the most success with. The shadows are great, but are being clipped vertically as the shadowing object moves near the left or right edge of the window. I've seen similar issues in other threads, but have tried the following previously suggested solutions with no result: - Using one directional light angled at the geometry - Tried various values for minLightMargin - Set distant MaxFarPlane If I comment out the clipping function in MinimalShadowMap everything works as expected, but of course I need to clip the shadows for it to be feasible. The problem seems to be with the calculation of the CullVisitor's projection matrix used for clipping, but I have yet to find out where this is being calculated so I can see what the problem might be. I'm hoping Wojtek or someone more familiar with this plugin can point me in the right direction. ... Thank you! Cheers, Garrett -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49305#49305 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] [osgPlugins] osgShadow LiSPSM culling problem
Hi Garret, I have not worked on Lispsm for long time but description of your problem may suggest that my method of obtaining main camera and its projection matrix may not work as it used to or your setup uses unusual multi channel master / slave configuration that was not tested so far. I am obtaining main view camera in several places in the code using this construct: _cv-getRenderStage()-getCamera() you may check if its still returning the right camera by adding asserts checking its projection matrix (getProjectionMatrixAsFrustum and check if near/far/left/right/top/bottom values are correct). One of the older problems with main camera was use of COMPUTE_NEAR_FAR flag. You may try turning it off and see if it affects your results. If above does not help, I will ask you to create simple applet to show your problem and I may try to debug it in spare time. Cheers, Wojtek Lewandowski 2012/8/17 Garrett Cope garrett.cope@simcen.usuhs.edu Hi, I'm working with the osgShadow LiSPSM implementation as that seems to be the one that people have had the most success with. The shadows are great, but are being clipped vertically as the shadowing object moves near the left or right edge of the window. I've seen similar issues in other threads, but have tried the following previously suggested solutions with no result: - Using one directional light angled at the geometry - Tried various values for minLightMargin - Set distant MaxFarPlane If I comment out the clipping function in MinimalShadowMap everything works as expected, but of course I need to clip the shadows for it to be feasible. The problem seems to be with the calculation of the CullVisitor's projection matrix used for clipping, but I have yet to find out where this is being calculated so I can see what the problem might be. I'm hoping Wojtek or someone more familiar with this plugin can point me in the right direction. ... Thank you! Cheers, Garrett -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=49305#49305 ___ 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