Sign in to follow this  
IntegralKing

Dual paraboloid point light shadow mapping in deferred lighting setup.

Recommended Posts

IntegralKing    105
I've been playing around with [url="http://jcoluna.wordpress.com/2011/04/27/xna-4-0-light-pre-pass-casting-shadows/"]this tutorial/sample code[/url] that demonstrates a simple implementation of light-pre-pass, which is a type of deferred lighting setup.

I'm in the process of implementing point light shadows, using dual-paraboloid shadow maps. I'm following this description of DPM: [url="http://gamedevelop.eu/en/tutorials/dual-paraboloid-shadow-mapping.htm"]http://gamedevelop.eu/en/tutorials/dual-paraboloid-shadow-mapping.htm[/url]

I am able to create the shadow maps, and they seem to look fine.

I believe that the current problem I'm having is in my pixel shader that looks up a depth value in the shadow map when rendering point lights.

Here is my point light shader code: [url="http://olhovsky.com/shadow_mapping/PointLight.fx"]http://olhovsky.com/shadow_mapping/PointLight.fx[/url]

The pixel shader function of interest is PointLightMeshShadowPS.

Does anyone see a glaring error in that function?




[img]http://olhovsky.com/shadow_mapping/DPM_point_shadows2.png[/img]





As you can see in the image above, the post's shadows do not match up with the positions of the posts, so some transformation is wrong somewhere...

This is what it looks like when the point light is very close to the ground (almost touching the ground).


[img]http://olhovsky.com/shadow_mapping/DPM_point_shadows_point_light_very_close_to_ground.png[/img]


As the point light moves closer to the ground, the shadows come together and touch along the line where the two shadow maps meet (that is, along the plane where the light camera was flipped to capture the two shadow maps).

Share this post


Link to post
Share on other sites
Coluna    314
I still haven't implemented the shadows for point lights on my game (I'm using a spot light with cone angle of 45º pointing down to fake it :P). I took a quick look at your code and I couldn't find the shader to render to the shadow map. For PSM, I think you have to have another technique to render the meshes to the SM, since my sample uses a "regular" projection scheme. Just add a new technique, following the paper you've linked, and change the ShadowRenderer to use that technique instead of the default one. Hope that helps.
J.Coluna

Share this post


Link to post
Share on other sites
IntegralKing    105
[quote name='Coluna' timestamp='1307207810' post='4819476']
I still haven't implemented the shadows for point lights on my game (I'm using a spot light with cone angle of 45º pointing down to fake it :P). I took a quick look at your code and I couldn't find the shader to render to the shadow map. For PSM, I think you have to have another technique to render the meshes to the SM, since my sample uses a "regular" projection scheme.[/quote]

I'm not using PSSM.

The shader that draws the shadows is in the pixel shader function "PointLightMeshShadowPS" in the shader I linked, like I said :P

How did you think that the shadows in the screenshots above were being drawn if I had no shadow shader? :)

Here's a further clue:

[img]http://olhovsky.com/shadow_mapping/DPM_point_shadows3.png[/img]


When I move the point light away from the origin, there is a line parallel to the light camera's "right" vector that clips the shadow. The above image shows the result of moving the point light to the left. If I move the point light to the right, there is an equivalent clipping line on the right instead. So I think this indicates that I'm transforming something incorrectly in the pixel shader, like I thought.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this