Jump to content
  • Advertisement
Sign in to follow this  

Dual Paraboloid Shadow Mapping + Deferred Rendering

This topic is 2601 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am trying to modify this sample/tutorial code which demonstrates a simple light pre pass deferred lighting setup, so that point lights have shadows.

I am trying to implement dual paraboloid shadows, and I'm following this:

The problem is that J. Coluna does lighting in camera view space, but the DPM paper finds the shadow map position by transforming a light pixel from world space into light space.. I think. This is partly because the DPM paper assumes that forward rendering is used.

See how J. Coluna's deferred shadows are done with a spot light here:

I don't have the world space position of the pixel, so I'm not sure how to find the tex coords to sample from in the shadow map.
Here's what I'm currently doing with point lights:

Click here to see what my point light shadows currently look like (with the wrong pixel shader transformations).

So what I can do, is reconstruct the world space position of the pixel, and then just find the sampling position in the shadow map -- I think that makes sense?

However, I'm wondering if I actually *need* to bother with the world space position of the pixel? J. Coluna seems to have no trouble sampling shadow maps for a spot light without using the world position of the pixel, so it seems that I shouldn't need it for a point light.

While I'm currently enrolled in a linear algebra course, and I'm working on understanding this math in more complete way, I was hoping that someone could help me with this in the meantime, so that I can make a meaningful contribution to this project.

Thanks in advance for any assistance! :)

I tried making a thread the other day about this issue, but I don't think that I was very concise, so I'm trying again, this time reducing the problem as much as I can. Hopefully this isn't viewed as a repost, as the question has been framed very differently :)

If you'd like to try to help figure this out but need to see what is going on, just let me know and I can send you a copy of this project. (It uses XNA/C#).

Share this post

Link to post
Share on other sites
In your deferred renderer I assume that you are able to reconstruct your view space pixel position? With this information, you'll be able to get the world space position by multiplying the view space position with inverse view matrix.

Practically, if you need a position in any light space, just create a single matrix that transforms the point to the world space (inverted view matrix) and then to the light space (inverted light matrix). You can transform your position directly from view space to any other space. World space is the common space for your lights and cameras so for that reason you'll probably need to make it part of your calculations.


Share this post

Link to post
Share on other sites
Thanks for the assist Kauna :)

It actually turned out that my WorldViewProjection matrix was missing the world multiply in the creation of the shadow maps.

So all of the code I posted actually works! (as long as you set all of the matricies to the correct values :))

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!