Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


ShaderPropertyFlags

Flags that control how a shader property behaves.
Read time 1 minuteLast updated 5 days ago

Definition

[Flags]public enum ShaderPropertyFlags

Remarks

When the Unity Editor compiles a ShaderLab script, it assigns shader property flags to its shader properties based on the attributes you assign to those properties. For example, if you add the "[HideInInspector]" attribute to a shader property declaration, Unity sets the HideInInspector flag when it compiles the script. If you add more than one attribute to a property, the Editor combines the flags using a bitwise OR operation.

Fields

Value

Description

GammaSignifies that values of this property are in gamma space. If the active color space is linear, Unity converts the values to linear space values.
HDRSignifies that values of this property contain High Dynamic Range (HDR) data.
HideInInspectorSignifies that Unity hides the property in the default Material Inspector.
MainColorSignifies that value of this property contains the main color of the Material.
MainTextureSignifies that value of this property contains the main texture of the Material.
NoneNo flags are set.
NonModifiableTextureDataYou cannot edit this Texture property in the default Material Inspector.
NormalSignifies that values of this property contain Normal (normalized vector) data.
NoScaleOffsetDo not show UV scale/offset fields next to Textures in the default Material Inspector.
PerRendererDataIn the Material Inspector, Unity queries the value for this property from the Renderer's MaterialPropertyBlock, instead of from the Material. The value will also appear as read-only.
Vector2Signifies that this property should be treated like a Vector2 in the default Material Inspector.
Vector3Signifies that this property should be treated like a Vector3 in the default Material Inspector.