Why is shadow strength always full black (1.0) in lightmap?

Hi

Why is it that shadows are always baked as full strength, even though I set the shadow strength on my light to, say, 0.5?

I’ve tried many permutations of settings and new projects, but always the same result.

The realtime shadow displays correctly, but of course it means they become darker as I leave the shadow-distance area.

This was asked before, but didn’t get an answer:

Shadow-strength-doesnt-matter-in-beast-lightmapping

If this is simply how Beast works, is there another way to get paler shadows?

Thanks

Steve

Beast ignores several Unity settings, including shadow strength and even whether or not an object is marked as a shadow caster. In my game we had to physically disable alpha objects before doing a bake to prevent them from polluting the lightmaps. I chalk this up to sloppy Beast integration in the Unity code.

Onto your shadow strength. In a way, one can understand why shadow strength doesn’t make sense to a ray tracer: it’s job is to collect light, there’s no such thing as shadow strength. To get the look of 50% shadow strength in a ray tracer one would have to make shadow casters 50% translucent or add an ambient light to the scene to bring the overall lighting up.

There is no ambient light in Unity*, however (*actually there is! see below)

  • Sky Light. There is a Sky Light in the Lightmapping Bake settings. You need at least one bounce to enable this feature. Sky light isn’t exactly an ambient light but for outdoor scenes this can bring your lightmap brightness up.
  • Bounces. Sufficient bounces fills in shadows by virtue of light scattering. Another way to flood more light into the darks of the lightmaps, but again not the same as ambient light.
  • Just add ambient light in your shader. In your game shaders instead of tapping the lightmap and using those values directly you can add light to fake shadow strength. You can lerp or do a saturate(lmValue + a) in which a is (1 - shadow strength). This is the most visually correct way to match your dynamic light shadow strength, but it costs instructions in the pixel shader so it’s less elegant.

In my game we used pairs of weather settings for in-game and lightmap baking (sunset dynamic, sunset lightmap) specifically so we could tune lighting in lightmap bakes to match the dynamic lighting of the game. There are several reasons besides shadow strength to do this, such as Beast making lightmaps that are brighter than the light source itself which mucks up dynamic highlights.