Version: Unity 6 Preview (6000.0)
Language : English
Add material properties
Access material properties in a script

Texture properties

For each texture that is setup as a shaderA program that runs on the GPU. More info
See in Glossary
/material property, Unity also sets up some extra information in additional vector properties.

Texture tiling & offset

MaterialsAn asset that defines how a surface should be rendered. More info
See in Glossary
often have Tiling and Offset fields for their texture properties. This information is passed into shaders in a float4 {TextureName}_ST property:

  • x contains X tiling value
  • y contains Y tiling value
  • z contains X offset value
  • w contains Y offset value

For example, if a shader contains texture named _MainTex, the tiling information will be in a _MainTex_ST vector.

Texture size

{TextureName}_TexelSize - a float4 property contains texture size information:

  • x contains 1.0/width
  • y contains 1.0/height
  • z contains width
  • w contains height

Texture HDR parameters

{TextureName}_HDR - a float4 property with information on how to decode a potentially HDRhigh dynamic range
See in Glossary
(e.g. RGBM-encoded) texture depending on the color space used. See DecodeHDR function in UnityCG.cginc shader include file.

Add material properties
Access material properties in a script