Jump to content
  • Advertisement
Sign in to follow this  
ddengster

directional shadow map problem

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

8v1C1RU.png

 

As shown on screen, there seems to be an oddity with the shadows. I'm using a directional shadow map, which means I render the shadow map from an orthographic camera. I also confirmed the cyan blocks are positioned and connected to the grey floor. Is this a known bug and are there ways to get around it?

Share this post


Link to post
Share on other sites
Advertisement

this shouln't happen.
My guess is thet you have a bug in projecting or comparing with the shadowmap.

Edited by imoogiBG

Share this post


Link to post
Share on other sites
What unbird said ^^^: it's from having a bias value that's too large, causing the shadow comparison to pass even though it should fail.

Share this post


Link to post
Share on other sites

You can use bias value that depends on angle between surface normal and direction to light:

float bias = clamp(0.005 * tan(acos(NoL)), 0, 0.01);

where: NoL = dot(surfaceNormal, lightDirection);

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!