Jump to content
  • Advertisement
Sign in to follow this  
Eduards Brown

D3D11 Shadow Mapping with Deferred Rendering

This topic is 1077 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

Hi,

 

I have implemented deferred rendering where I have G-Buffer pass, in which I go through the geometry and collect normals, material and position information. In the second  pass I use that information to do lighting...

 

The problem is I cant get my shadow maps to work anymore.

 

Where do I even put the shadow mapping G-Buffer pass or Light pass?

To me it makes sense to do the shadows in G - Buffer pass, as I can easily calculate Light View Position from world matrix.

But no luck...

 

Any help will be appreciated!

Share this post


Link to post
Share on other sites
Advertisement

When exactly is not relevant, it just needs to happen before the light pass.

 

In the light pass, for the lights that can cast shadows, you sample the shadowmap and compute lighting from there (instead of doing the normal pass without shadows). That result gets added to the light accumulation buffer. You add there all lighting results (shadowed or non-shadowed).

Share this post


Link to post
Share on other sites

I am so happy!!!!!!!!!!! Just done it xD

 

Thank you for your answer.

 

The mistake that I made was I was trying to sample Depth Maps inside G-Buffer pass as I thought it would work if I just set diffuse and specular texture to float(0, 0, 0, 1).

I thought it was easier as Light View Projection was already there...

 

But to fix my mistake I just had to pass light view projection into the light pass and calculate light view position inside Pixel Shader!

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!