UE4 How To use Colored Translucent Shadows

1649 篇文章 12 订阅
1623 篇文章 23 订阅

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_T.JPG

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

Notes

  • Indirect lighting will sometimes wash out the translucent shadows and make them less saturated than the emissive or diffuse of the translucent materials.

  • Normal map intensity can be artificially adjust by increasing the Translucency Directional Light Intensity

  • Using Blend Mode Modulate will require you to disable Separate Translucency in the Material Inputs panel.

Lit Material

Alpha Channel for Mask

TCS_Lit_Masked.PNG

  1. Select the Material Inputs and change the following:

    • Blend Mode: Translucent

    • (Optional) Two Sided: Checked

    • Translucency Lighting Model: TLM_Surface

  2. Plug the alpha channel of the Texture sample into Opacity to mask parts of material.

Custom Opacity

TCS_Lit_CustomOpacity.PNG

  1. Select the Material Inputs and change the following:

    • Blend Mode: Translucent

    • (Optional) Two Sided: Checked

    • Translucency Lighting Model: TLM_Surface

  2. Create a Multiply Node and plug into Opacity on the Material Inputs

  3. Plug the alpha of the Texture Sample into pin A

  4. Create a Constant value and set the value to anything below 1. Zero being fully transparent and 1 being fully opaque.TCS_LIT_CO_constantValue.PNG

Notes

  • Two sided is a good choice to use if you intend the player to see both sides of the mesh with the material.

  • When not using Two Sided, the light must cast onto the visible side of the mesh with the material.

  • To mask part of the image, you will need to have an alpha channel with your texture.

Unlit Material

TCS_Unlit_Mat.PNG

  1. Select the Material Inputs and change the following:

    • Blend Mode: Translucent

    • Shading Model: Unlit

    • (Optional) Two Sided: Checked

    • Translucency Lighting Model: TLM_Surface

  2. Plug the Texture Sample into Emissive

Colored Translucent Shadows in Action

Alpha Channel for Mask

  • Blend Mode: Translucent

  • Shading Model: Lit or Unlit

Logo_LIT_Masked.PNG

Custom Opacity

  • Blend Mode: Translucent

  • Shading Model: Lit or Unlit

TCS_Lit_CO_Result.PNG

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

TCS_LmRes_64.png TCS_lmRes_1024.png
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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值