Shader object names? Where can I get a list of them

Where can I get the full list of default shader object names like _MainTex _BumpMap and so on...

1 Answer

1

The two you mentioned, _Cube, and _Color are the only properties that we've been told are reliable. If you want to make some kind of system that depends on naming, you can open the shaders you care about, look for the other common properties you care about, and use them. Just don't count on it being future-proof (if anything does break in the future, you can always do a find/replace in the shader to make it work again, though.)

http://forum.unity3d.com/forums/16-ShaderLab http://unity3d.com/support/resources/assets/built-in-shaders

I agree, but there are shaders that don't even have a _Color property. All particle shaders uses _TintColor. That's why material.color will fail on particla shaders. A Shader in general is not required to have any property at all but most built-in shaders have those common properties. With Material.HasProperty you can check if the shader have a certain property.

For as opaque as Unity makes shaders out to be, I'd call that a bug. I only use custom shaders, and I always use the _Color convention, if I need at least one color, but this ought to be reported.