Use Ready Shadow Map



In the illustration above, we use a ready image - caustic pattern as shadow map, please pay attention to the image is color inverted. bounding frame of the ready image. When rendering shadow, the ready image is taken from mobile's source shadow material - first lookup material's texture play, if no, use texture0.

To use ready map, you need do these:

1. Enable mobile's Projected Shadow style and check the 'Use Map' option.

   

2. New two materials (assume named as 'M' and 'SM'); assign M to the mobile; in the Dynamic Shadow group of M, set 'Source' material as 'SM'.

   


3. Set the ready map to the texture0 of 'SM'.

 

Remark:

There is a console variable 'r_shadowclip_offset' (0~1) to control the shadow clip plane offset, the shadow clip plane used to avoid projecting shadow map to the front of shadow caster.