In this "How To," we intend to show you how you can setup and use Translucent Shadow Color to create a material that can cast a colored shadow. There are many applications where this could be useful to inject some color into your scene, but a common use would be for something like a stained glass window.
Example:
Translucent Shadow Color
Translucent Shadow Color is the term used to describe how shadows will pick up colors of objects that they pass through also known asTransmission. The amount of light that passes through the material is determined is directly determined by its opacity value between 0 and 1 and how much light is being cast onto the material. For example, if the opacity was set to 0, the light transmission for a colored shadow from the material would be none. If the opacity value were set to 1, then it would be fully opaque.
Material Setup
-
For the following examples these will be using Translucent as the Blend Mode of choice.
-
Lit and Unlit Blend Modes that can be used: Translucent, Additive, and Modulate
Lit Material
Alpha Channel for Mask
-
Select the Material Inputs and change the following:
-
Blend Mode: Translucent
-
(Optional) Two Sided: Checked
-
Translucency Lighting Model: TLM_Surface
-
-
Plug the alpha channel of the Texture sample into Opacity to mask parts of material.
Custom Opacity
-
Select the Material Inputs and change the following:
-
Blend Mode: Translucent
-
(Optional) Two Sided: Checked
-
Translucency Lighting Model: TLM_Surface
-
-
Create a Multiply Node and plug into Opacity on the Material Inputs
-
Plug the alpha of the Texture Sample into pin A
-
Create a Constant value and set the value to anything below 1. Zero being fully transparent and 1 being fully opaque.
Unlit Material
-
Select the Material Inputs and change the following:
-
Blend Mode: Translucent
-
Shading Model: Unlit
-
(Optional) Two Sided: Checked
-
Translucency Lighting Model: TLM_Surface
-
-
Plug the Texture Sample into Emissive
Colored Translucent Shadows in Action
Alpha Channel for Mask
-
Blend Mode: Translucent
-
Shading Model: Lit or Unlit
Custom Opacity
-
Blend Mode: Translucent
-
Shading Model: Lit or Unlit
Shadow Sharpness
Shadow sharpness can be affected by several different factors, including the lightmap resolution of the mesh receiving the Translucent Shadow Color, the source angle of the light, and the quality of the texture sample.
Lightmap Resolution
Lightmap Resolution = 64 | Lightmap Resolution = 1024 |
Limitations
-
Translucent Shadow Color is only supported by Static Lights
Conclusion
The most important thing to remember about colored shadows is that it only supports Static Lights. Also, you will want to make sure that you are selecting the best blending mode (Translucent, Additive, and Modulate) that fits your needs for your design. There are a number of applications for colored shadows and each blend mode can be used to work within your needs for your projects.