Unity - Scripting API: RenderingLayerMask
struct in UnityEngine
Success!
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
Submission failed
For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
Description
The Render Pipeline allows you to use Rendering Layers, which are LayerMasks to make Lights or effects only affect specific Renderers.
Rendering Layers are also supported on decal projectors, and can be sampled from the ShaderGraph to implement custom effects.
Rendering Layers are a Bitmask and it represents the 32 Layers and define them as true or false. Each bitmask describes whether the RenderingLayer is used. As an example, bit 5 can be set to 1 (true).
Edit->Settings->Tags and Layers option shows the use of the 32 bitmasks. Each RenderingLayer is shown with a string setting. As an example Layer 0 is set as Default. There is always at least one defined RenderingLayer.
Properties
| Property | Description |
|---|---|
| value | Converts a layer mask value to an integer value. |
Operators
| Operator | Description |
|---|---|
| RenderingLayerMask | Implicitly converts uint to a RenderingLayerMask. |