ShaderLab 属性,特性声明

  • Numbers and Sliders
name ("display name", Range (min, max)) = number
name ("display name", Float) = number
name ("display name", Int) = number
  • Colors and Vectors
name ("display name", Color) = (number,number,number,number)
name ("display name", Vector) = (number,number,number,number)
  • Textures
name ("display name", 2D) = "defaulttexture" {}
name ("display name", Cube) = "defaulttexture" {}
name ("display name", 3D) = "defaulttexture" {}

Attribute

  • [HideInInspector]
    does not show the property value in the material inspector.

  • [NoScaleOffset]
    material inspector will not show texture tiling/offset fields for texture properties with this attribute.

  • [Normal]
    indicates that a texture property expects a normal-map.

  • [HDR]
    indicates that a texture property expects a high-dynamic range (HDR) texture.

  • [Gamma]
    indicates that a float/vector property is specified as sRGB value in the UI (just like colors are), and possibly needs conversion according to color space used. See Properties in Shader Programs.

  • [PerRendererData]
    indicates that a texture property will be coming from per-renderer data in the form of a MaterialPropertyBlock. Material inspector changes the texture slot UI for these properties.

https://docs.unity3d.com/Manual/SL-Properties.html

你可能感兴趣的:(ShaderLab 属性,特性声明)