Hi Adrian, I bet you based your current PSSM on osgShadow::ShadowMap code. osgShadow::StandardShadowMap is functional equivalent of osgShadow::ShadowMap. Its associated osgShadow::StandardShadowMap::ViewData object cull method performs similar steps to osgShadow::ShadowMap::cull. The difference is that I have dividied steps in the cull method into separate virtual functions.
Please have a look at these steps in StandardShadowMap::ViewData::cull() method. They correspond to osgShadow cull functionality so you may learn which functions you will need to override. Additionally MinimalShadowMap::ViewData introduces frameShadowCastingCamera method which is used by all MinimalXXXShadowMap & LispSM classes to fine tune ShadowMap projection matrix. This tunning means that projection matrix is optimized to contain shadow volume with minimal overhead. Actual LispSM matrix application is done during frameShadowCastingCamera. LIspSM is made using decorator design pattern. Actual class implementation is derived from ProjectedShadowMap template class based on one of MinimalXXXShadowMap classes and LispSM algorithm class which is used for light space perspective projection. If I was to create hybrid PSSM/LispSM I would also derive from ProjectedShadowMap but would create special LispSM/PSSM algorithm. But additionally one would need to override StandardShadowMap::ViewData methods to fork cull traversal into a number of render stages and generate texgens needed for each PSSM shadow map. As I write this explanation I realize that whole topic might be actually very complex. I wish the code was bit simpler but I wanted to create a grid of solutions that could cooperate or be used alternatively so the framework has a lot of internal crossdependencies which could make it into difficult labirynth. I tried to make it clean and elegant but I am afraid I had to sacrifice simplicity for multithreaded/multimonitor use in the same time providing number of methods of shadow volume optimizations. I hope you will manage to pass through this maze somehow ;-). Cheers, Wojtek ----- Original Message ----- From: Adrian Egli OpenSceneGraph (3D) To: OpenSceneGraph Users Sent: Monday, October 06, 2008 1:51 PM Subject: Re: [osg-users] Lispsm / PSSM merge ? Hi Wojtek, the idea of PSSM is to split the view frustum into n-parts. then for each of such sub volume (frustum) we have to render one shadow map and apply the shadow for such a volume. or in other words, we like to get one texture (shadow map) for one sub-frustum starting at near (plane : split i) and end at far (plane : split i + 1). in this sub frustum the shadow map [i,i+1] is active, and this map is used to render the shadow. so if we can define in the Lispsm a range [i,i+1] /// [near,far] then we have one split for the pssm. next we need many such splits, and finally we get the pssm working (many for n splits from near_frustum = near_0, far_frustum = far_n [near_0, far_0][near_1=far_0,far_1] [far_1,...] [far_n-1,far_n = far_frustum] would this be easy to do? multiple shadow technic nodes in one scene to get such maps. /adrian 2008/10/6 Wojciech Lewandowski <[EMAIL PROTECTED]> Adrian, I am afraid I don't understand what you want to do. Could you provide bit more explicit explanation ? At higher level of abstraction using LispSM with PSSM should be possible but I am not that familiar with PSSM implementations to judge whether it is easy or difficult task to merge two approaches. If you closely look at LightPerspectiveShadowMap class you will find that it basicaly overrides one method of ProjectionShadowMap template class. Rest of heavy work is done by underlying MinimalXXXShadowMaps. These classes attempt to compute minimal shadowed volume (as ConvexPolyhedron - polytope like object). This volume could be used by modified PSSM instead of view frustum. This computed volume is passed as one of the input arguments to the method that LispSM overrrides. Cheers, Wojtek ----- Original Message ----- From: Adrian Egli OpenSceneGraph (3D) To: OpenSceneGraph Users Sent: Monday, October 06, 2008 11:40 AM Subject: [osg-users] Lispsm / PSSM merge ? Hi all The osgShadow lib becomes a really nice shadow toolkit, thanks all to work out on different shadow technics. As we all understand is that the PSSM would be one of the most robust shadowing technic for large terrain, now we should be able to merge the lispsm with the pssm idea: would it be possible to add one feature to lispsm: start shadow at near plane and stop shadow at far plane, then we will need a combiner of the lispsm shadow, then we gets pssm idea back. would this be possible to do, or do we need to rewrite the whole pssm stuff? would it be possible to add some filter into the GLSL shader code for shadows: pcf ... ? adrian -- ******************************************** Adrian Egli -------------------------------------------------------------------------- _______________________________________________ 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 -- ******************************************** Adrian Egli ------------------------------------------------------------------------------ _______________________________________________ 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