Before version 1.5.0, there was a problem that blob shadows were overlapping with static lightmap shadows.

From version 1.5.0, Mesh Shadow Receiver can have lightmap UVs, that makes Lightmaps and Shadowmasks available in Projector shaders. As a result, blob shadows can be properly mixed with lightmap shadows like the image below.

There are a few things to do for mixed lighting blob shadows.

  1. Build a mesh tree with lightmap UVs
    Lightmap index and lightmap scale offset are stored in the mesh tree. It must be rebuilt every time when the lightmaps are changed.

Terrain mesh tree doesn’t have this field, because Lightmap UVs are generated from vertex positions.
    For more details, see Create a Mesh Tree section.

  2. Create a new material and choose a correct shader
    
Fast Shadow Receiver provides the following 3 shaders for mixed lighting

    Shader Name Lighting Mode Performance and Quality
    Multiply Lightmap Subtractive Shadow Subtractive This mode uses lightmap textures only. It has the highest performance. However you need to manually adjust Ambient Color in material editor.
    Multiply Lightmap Shadowmasked Shadow Shadowmask Since this mode uses lightmap textures and Shadowmask texutres, it has the lowest performance, but the highest quality.
    Multiply Diffuse x ShadowMask Shadowmask Simpler version for shadowmask mode. It still uses lightmap textures and shadowmask textures for drawing static objects and the performance is lower than subtractive mode. You need to manually adjust Ambient in material editor.

    For more details, see Projector Shaders section.

  3. Use the new material as a ‘Projector Material For Lightmapped Mesh‘. Also don’t forget to check ‘Has Normals‘, because the mixed lighting shaders use normal vectors for lighting computation. (see Setup Shadow Receiver section)

Links

Leave a Reply

Your email address will not be published. Required fields are marked *

Anti Spam Code *