- Home /
Finding a list of properties in Shaders
I'm new to shaders when it comes to Unity and I want to experiment as much as I can with them to better understand what I create with them. One thing that keeps me wondering though is how all the properties of a new shader are applied when inputting them through C#. Usually, the default property is _MainTex, which is the main texture of the shader, but I can never find a source that properly details it, so I'm not able to understand what other properties are also available to add such as _TintColor. Is there a list or dictionary of all the available properties that can be used for any new shaders I create?
Answer by hexagonius · Dec 16, 2019 at 09:07 PM
A quick lookup gave me this:
https://answers.unity.com/questions/845757/what-are-the-property-names-in-the-new-unity-5-sta.html
But that's just the Standard shader. From the description of of the ShaderLabs syntax you can define those names yourself in your shaders.
https://docs.unity3d.com/Manual/SL-Properties.html
Exactly. There is nothing like a predefined purpose. The standard shaders just have the convention of using _$$anonymous$$ainTex for the main texture and _Color for specifying a color for the shader. This convention is also implemented through some of the shortcut property helpers such as mainTexture or color. However a shader can define any property for any purpose. The case of _TintColor already shows an example where even some standard shaders do not follow the convention. In general just from a property name you can not necessarily infer the purpose. Unity's "standard shader" is a gigantic beast. It has countless of properties, settings and tags. It's meant to be configured through the inspector. In general if you want to know what properties a shader offers and what they do is to look at the shader source code.