How to find out the name of an Shader attribute?

Hello,

I am using the following default shader :

  • Transparent/VertexLit.

Trying to interact with the Main Color attribut.

material.color = color.green

nothing…

material.SetColor ("_MainColor", color.green)

nothing…

material.SetColor("mainColor", color.green)

nothing…

material.SetColor("color", color.green)

nothing, nothing and nothing.

Cannot open the shader to check out the attribut name.
Cannot access to such info from the editor.

I use to change value of shader by script, no big deal.
But when using Unity’s shader, always the same dance to find out attribute names.

And why 50% of the shader can be edited and the other 50% do not allow it.

Boring…

Any idea?

Thanks guy!

Yes you can; download them here.

–Eric

erf yes I have…

But what is the good reason some shader are editable from the editor and other aren’t?
Such simple info as attribute name could be available from single right or middle mouse click on the attribue from the editor to get the original name…

And the worst is still having original attribute name not matching with the editor label…

→ Main Color is “_Color”

Finally need to find the shader with a similar name in the long list…

Actually could be a good idea to put them in sub folders like they are from the editor :

  • …/Transparent/ etc…

----> Actually shader can be found in “Transparent/VertexLit.” and it is called “Alpha-VertexLit”

Alright a colleague just point me out the Debug mode in runtime we can browse the shader shader content from the inspector…
Didn’t know this debug mode O_o…

It helps a lot!