Texture properties
Set shader variables with material property values

Access material properties in a script

Material properties are represented in C# code by the MaterialProperty class.

To access variables defined in your HLSL code, you can call Material.GetFloat, Material.SetFloat. There are other, similar methods; see the Material API documentation for a full list. When you access HLSL variables using these APIs, it doesn’t matter whether the variable is a material property or not.


Did you find this page useful? Please give it a rating:

  • Texture properties
    Set shader variables with material property values