Re: [osg-users] Shadow techniques status
Hello Jim, ShadowMap does suffer from bad aliasing when the viewpoint is very near the shadow. The Orange book (GLSL shader) describes how to super-sample the depth buffer to mitigate aliasing. Indeed, aliasing is a big problem with vanilla shadow mapping in almost all real-world cases. What you describe can easily be done by client code, using the osgShadow::ShadowMap::clearShaderList() and osgShadow::ShadowMap::addShader() methods with the appropriate shaders. One thing that you need to be careful about when replacing the default shaders is to use the same uniform names to access the shadow map sampler and other variables. J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Shadow techniques status
ShadowMap does suffer from bad aliasing when the viewpoint is very near the shadow. The Orange book (GLSL shader) describes how to super-sample the depth buffer to mitigate aliasing. Indeed, aliasing is a big problem with vanilla shadow mapping in almost all real-world cases. What you describe can easily be done by client code, using the osgShadow::ShadowMap::clearShaderList() and osgShadow::ShadowMap::addShader() methods with the appropriate shaders. One thing that you need to be careful about when replacing the default shaders is to use the same uniform names to access the shadow map sampler and other variables. Doh! I wrote shadow map code from scratch but was based on osg::ShadowMap. My shader used 9x9 sampling (IIRC) which produced little aliasing with a slight loss of speed. Of course, 1x1 sampling can be used if the VP isn't near the shadowed object. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Shadow techniques status
Hello Dan, I'm looking at shadow techniques provided by the osgshadow nodekit for use in a production project. On the wiki it reads like only ShadowMap is production ready and all the others have problems. Is this the case? Or have the others been marked as experimental because they do not work across video cards? Here is my opinion on the current shadow techniques in osgShadow. Please take these with a grain of salt. And bare in mind that it's pretty easy to compare them yourself in your environment, because in most cases once you have one shadow technique running you can just swap out the ShadowTechnique that you give to your ShadowedScene for another one. Some tweaks are technique-specific but that will give you a good idea of what they look like in your context. osgShadow::ShadowVolume is broken, I have never seen it work correctly even with simple test scenes. There are inverted shadows everywhere (which hints at a problem with the z-pass or z-fail implementation). If someone wants to fix it, it would be a nice alternative to other techniques in some situations. osgShadow::ShadowTexture is the simplest technique. It works well for planar shadows, but for anything more complex you'll want at least osgShadow::ShadowMap. osgShadow::ShadowMap is what I would call the main workforce of osgShadow at the moment. It works well, is well tested, and is flexible. The only downside is the heavy shadow map aliasing you get on medium to large environments, but this is to be expected from a simple technique like this. It's really just the basic shadow map, no bells or whistles. osgShadow::SoftShadowMap is ShadowMap augmented with a simple filtering of shadows. The look is not too realistic (it smooths everywhere uniformly instead of considering distance of occluder for the width of the penumbra, which would be more complex of course) but it alleviates the aliasing problem somewhat. It can still only go so far if the environments are large. osgShadow::ParallelSplitShadowMap is the first of the next-gen shadow mapping techniques integrated into OSG. Essentially, it uses several shadow maps and is view-dependent which reduces aliasing dramatically. It's less tested, and until recently was completely broken. It now should work on most machines, but I'm still not confident enough about it to use it in production (my personal opinion - try it out and see for yourself). A few more techniques will soon be added (shortly after 2.6, hopefully) which are also view dependent, and will give some more choices to users. Essentially a shadow technique is a tool, and you just have to find the right one for your needs. If the wiki misrepresents this state of affairs, could you please update it or post the pages where there is outdated info here? Hope this helps, J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Shadow techniques status
2008/7/29 Jean-Sébastien Guay [EMAIL PROTECTED] Hello Dan, I'm looking at shadow techniques provided by the osgshadow nodekit for use in a production project. On the wiki it reads like only ShadowMap is production ready and all the others have problems. Is this the case? Or have the others been marked as experimental because they do not work across video cards? Here is my opinion on the current shadow techniques in osgShadow. Please take these with a grain of salt. And bare in mind that it's pretty easy to compare them yourself in your environment, because in most cases once you have one shadow technique running you can just swap out the ShadowTechnique that you give to your ShadowedScene for another one. Some tweaks are technique-specific but that will give you a good idea of what they look like in your context. osgShadow::ShadowVolume is broken, I have never seen it work correctly even with simple test scenes. There are inverted shadows everywhere (which hints at a problem with the z-pass or z-fail implementation). If someone wants to fix it, it would be a nice alternative to other techniques in some situations. osgShadow::ShadowTexture is the simplest technique. It works well for planar shadows, but for anything more complex you'll want at least osgShadow::ShadowMap. osgShadow::ShadowMap is what I would call the main workforce of osgShadow at the moment. It works well, is well tested, and is flexible. The only downside is the heavy shadow map aliasing you get on medium to large environments, but this is to be expected from a simple technique like this. It's really just the basic shadow map, no bells or whistles. osgShadow::SoftShadowMap is ShadowMap augmented with a simple filtering of shadows. The look is not too realistic (it smooths everywhere uniformly instead of considering distance of occluder for the width of the penumbra, which would be more complex of course) but it alleviates the aliasing problem somewhat. It can still only go so far if the environments are large. osgShadow::ParallelSplitShadowMap is the first of the next-gen shadow mapping techniques integrated into OSG. Essentially, it uses several shadow maps and is view-dependent which reduces aliasing dramatically. It's less tested, and until recently was completely broken. It now should work on most machines, but I'm still not confident enough about it to use it in production (my personal opinion - try it out and see for yourself). Parallel Split Shadow Map: it's still under *beta* release :-) i wait for a review by a specialist, ... please review, test this algorithme, for terrain, ... it's once of the most robust algorithm, but it has to be tested. *** A few more techniques will soon be added (shortly after 2.6, hopefully) which are also view dependent, and will give some more choices to users. Essentially a shadow technique is a tool, and you just have to find the right one for your needs. If the wiki misrepresents this state of affairs, could you please update it or post the pages where there is outdated info here? Hope this helps, J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Adrian Egli ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Shadow techniques status
Hello Adrian, Parallel Split Shadow Map: it's still under *beta* release :-) i wait for a review by a specialist, ... please review, test this algorithme, for terrain, ... it's once of the most robust algorithm, but it has to be tested. I knew any talk about PSSM would get a reply from you :-) I was not criticizing your work. Please don't take it so personally. I only gave my opinion of the current state of things. As for review, someone will need to have the knowledge of the algorithm to be able to review it, and that isn't my case personally... It's a very specialized and low-level thing to be able to review this kind of code. J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Shadow techniques status
ShadowMap does suffer from bad aliasing when the viewpoint is very near the shadow. The Orange book (GLSL shader) describes how to super-sample the depth buffer to mitigate aliasing. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Shadow techniques status
Thanks for the replies. I'll take a closer look at PSSM. Dan. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Shadow techniques status
No, i have no problem with the PSSM and all of the discussion about it. but i would like to pass the pssm through a review, because i am not computer graphics specialist, i am more computer vision guy. :-) this is the only raison why i am answering all of the emails people asking for enhanced shadow techniques, may there will be once a guy helping me in bug fixing the whole pssm shadow and others shadow techniques. i guess there are still some bugs inside. /adrian 2008/7/29 Jean-Sébastien Guay [EMAIL PROTECTED] Hello Adrian, Parallel Split Shadow Map: it's still under *beta* release :-) i wait for a review by a specialist, ... please review, test this algorithme, for terrain, ... it's once of the most robust algorithm, but it has to be tested. I knew any talk about PSSM would get a reply from you :-) I was not criticizing your work. Please don't take it so personally. I only gave my opinion of the current state of things. As for review, someone will need to have the knowledge of the algorithm to be able to review it, and that isn't my case personally... It's a very specialized and low-level thing to be able to review this kind of code. J-S -- __ Jean-Sebastien Guay[EMAIL PROTECTED] http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Adrian Egli ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Shadow techniques status
Hi. I'm looking at shadow techniques provided by the osgshadow nodekit for use in a production project. On the wiki it reads like only ShadowMap is production ready and all the others have problems. Is this the case? Or have the others been marked as experimental because they do not work across video cards? Our software will be used on a controlled hardware platform so if the techniques are restricted to certain cards it may not be an issue. Thanks, Dan. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org