Jump to content
  • Advertisement
Sign in to follow this  
fire67

Removing self-shadow acne

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

Hey there,

 

I am trying to apply a shadow map on my model and use it to calculate transmittance. But I am facing a common issue of shadow-mapping and I can't fix it by simply modifying the offset because it creates discontinuities on surface and shapes.

 

Here is the issue :

[attachment=31992:shadow.jpg]

 

This can remove the issue but it creates bad behaviour around the ears for example. This is not an acceptable solution as the shadow map is not correctly applied on some parts.

float cosAngle = saturate(1.0f - dot(wLight, wNormal));
float3 scaledNormalOffset = wNormal * (_Offset * cosAngle * _ShadowMap_TexelSize);
float4 shadowCoord = mul(unity_World2Shadow[0], float4(i.wPos + scaledNormalOffset, 1.0f));
float shadow = tex2D(_ShadowMap, shadowCoord);
Is there any easy and efficient way to get rig of shadow acne ? Maybe some blurring on depth discontinuities ?
Thanks a lot !

Share this post


Link to post
Share on other sites
Advertisement

This is my favorite reference regarding shadow maps:

 

https://mynameismjp.wordpress.com/2013/09/10/shadow-maps/

 

To improve self-shadowing, check out the various biasing techniques, such as receiver plane bias.  Also, variance based filtering methods (VSM/EVSM/MSM) tend to behave much better with shadow acne.  They are more expensive and they have their own artifacts, but they can be a good choice.

Share this post


Link to post
Share on other sites

What is the rest of your shader? Typically the shadow component needs to be multiplied by the light contribution (N*L) and not multiplied at some later time (like after adding ambient and what not).

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!