Removing self-shadow acne

Started by
1 comment, last by dpadam450 7 years, 10 months ago

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 !
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.

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).

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

This topic is closed to new replies.

Advertisement