Double-sided self shadowing doesn't seem to work

I have several meshes that are basically wrinkled planes, meant to represent 3D terrain, and which are lit using a directional light. When the directional light’s angle is a few degrees below the plane of the mesh, any part of the mesh which is only shadowed by the underside of the mesh seems to not receive shadows. This is strange, as the mesh is set to use two-sided shadows and therefore both sides of the mesh should cast shadows (if I am not mistaken). In this case, choosing between “On” and “two sided” for the mesh shadow casting seems to not even have any effect other than changing the shadow bias slightly.

Choosing very large values of bias for the light doesn’t even reduce the intensity of the light at these areas (in addition to making lighting less accurate) so it’s not a solution.

Adding a second gameobject with a new mesh between this mesh and the light source and either having it face downwards or cast two-sided shadows fixes these bright areas, but this “fix” is not perfect because it requires me to maintain a large number of additional gameobjects, slows rendering, and doesn’t support shadows at large distances.

Can anybody clarify what is happening here, and whether there is a way to fix this without adding additional meshes or writing a custom shader?


Mesh set to one-sided shadows, directional light source marked with a small white circle


Mesh set to two-sided shadows. Seems to be identical to one-sided, except the shadows are slightly broader.


Using additional bottom-facing meshes underneath the mesh to cast additional shadows (fixes the problem, but impacts performance)


Schematic of what I believe is happening. The light source is below the mesh, and so the entire mesh should be unlit, but areas which have normals less than 90 degrees to the light source and which are only obstructed by the underside of the mesh are erroneously lit (they should be in shadow because the mesh is set to cast two-sided shadows)

Bias pushes the shadow surface away from the light. A higher bias is to reduce self shadowing, regardless of the angle. A low bias is what you want if you do want self shadowing like this.

Normal bias pushes the shadow surface way from the surface normal, and increasing this will help self shadowing from underneath a bit, but not if your bias is already set high enough to counteract the normal bias.

You can set the shadows to two sided, bias to 0.0, and normal bias to 3.0 and you should get decent self shadowing when the light is below the plane’s horizon. However setting those values high enough to ensure self shadowing from below will probably have a negative affect on the visuals when the light is above the horizon with small details not casting any shadows, and even larger details having lower shadows than you might otherwise expect.

However, really the correct solution really is to put a bottom on your geometry, like you tried. Instead of using lots extra geometry, you can use a single quad facing down, set to shadow only, and scaled by a script to cover the entire area you need it to rather than having each terrain “chunk” have it’s own bottom. Or really you could just have a really huge shadow only quad that’s always there just a bit below the lowest terrain. This won’t affect performance in any real way and will solve your shadowing problem.