   Lispsm
  Hello,I've been trying to implement Lispsm for quite some time now, but time after time, i've failed.The source from their main site is just so confusing. I would like to ask to you all: If you have source for a lispsm implementation, would you be so kind to let me read it, cause I'm really stuck at this.I'm able to calculate the 8 points of the eyeFrustum without any problems. But what am I supposed to do next? I have to translate them into lightspace or something, but I don't really know what that means.My email is: credoandjeroen@hotmail.com, feel free to add me to your msn too.Thanx in advance,Jeroen   
  Hi...Unfortunately i haven't implemented LiSPSM myself so i don't have any source to give. But if you have to tranform the eye frustum into light space, i think you have to tranform the 8 points with the light's mvp (Modelview-Projection) matrix. The resulted points will be in light space.HellRaiZer   ;  The modelviewProj matrix, is that the light's view matrix multiplied with it's projection matrix?   ;  Light can be modelled as a camera (ortho for directional and perspective(s) for spot/omni). So you can transform points into camera's space using it's mvp matrix.   ;Quote:The modelviewProj matrix, is that the light's view matrix multiplied with it's projection matrix?Yes. But keep in mind that LiSPSM may not be able to model all light types. I don't know this (i haven't read the paper),so see if it can model both ortho and perspective projections.HellRaiZer   ;  I've been thinking to implement LiPSM too. The fact is that it happens to be quite difficult. I have switched to implement trapezoidal shadow map which are AFAIK a more advanced technique and is very, very well documented ;http://www.comp.nus.edu.sg/~tants/tsm.htmlWhat's marvellous with shadow map technique is that you can always spend time improving them ; starts with a standard shadow map, move on to trapezoidal shadow map, add PCF or variance filtering, move on to cascaded shadow map or subdivided shadow map... When you start shadow mapping, you get plenty of work for the upcoming monthes !   ;  I've tried implementing TSM before LisPSM, but had no success. The reason why I swithed to LisPSM is that it seemed easier.In the sourcecode of their sample, they've implemented both uniform shadow mapping and lispsm shadowmapping in lightspace. When you render the scene from the light's point of view (F3), the view frustum nicely rotates with the camera like it should and it always remains perpendicular to the screen (more or less).When I draw my view frustum, it's quite a bit different, although the uniform shadowmapping with it actually works!The lispsm implementation is correct for some parts of the screen, but has severe artifacts due to the stretching I see from the light's point of view.Can someone tell me how to post screenshots here, then I can show you?Jeroen   ;  Source code is provided in a NVIDIA example called perspective shadow map. It covers the original PSM, TSM and LiSPSM ... very cool. I think the implementation is also a bit more game specific, but can be wrong on this ...- Wolf   ;  I think that sample of nvidia is just plain useless. The code gives me a headache and it uses all kinds of weird bounding box thingies that don't seem to have anything to do with the original algorithms.Oh yeah, and I'm programming for OpenGL, so with that sample being Direct3D is an extra minus.   ;  ShaderX4 has a nice implementation preview of LiSPSM, where everything is rather good explained, and it has a demo in OpenGL and DirectX. I added/tried to add the LiSPSM to my engine, but actually I am rather dissapointed. In some scenes in really works nice, but the problem, as soon as you start moving your camera, you get the 'dancing shadow effect', which only makes your shadow look worse if you ask me. I also tried to combine this with Variance shadow maps (see some previous post of me), and the result was not really what I was looking. I did not only get dancing shadows, but fade in and fade out of shadows because of variance shadow maps. Perhaps I am doing something wrong, but I don't think you can do a lot of things wrong when using VSM. In the end I think, I will use LiSPSM only for dynammic object, and use a region based projected Shadow approach, which I can preblur, and project 'on top of my objects'. When I blend this together with my LiSPSM (perhaps with or without VSM), the result might still be oké. Still working on it though ..So far I haven't found anything good yet .. :(PS: if you want to I can give you the name of the writer of the article in ShaderX4, and when you contact him, you can have his source code, but I don't think I am allowed to give you the source when you don't have the book .. perhaps wolf can help on this :)   