What are the property names in the new Unity 5 standard shader
Hello, I am trying to assign textures and such via C# code to the new standard shaders using the functions found in the Material class (setTexture, setFloat, etc). The problem is, I don't know what the properties are called or how to find that out (google is no help so far). To be clear, something like this. go.GetComponent().material.setTexture("Diffuse", someTexture);
I have tried "Diffuse", "_Diffuse", "Albedo", "_Albedo". I would like all the names of the properties available in the shader. As a bonus, pointing me as to how to find the information myself in the future is a plus.
Also read this if you're setting values on a material using the Standard Shader:
http://docs.unity3d.com/$$anonymous$$anual/$$anonymous$$aterialsAccessingViaScript.html
Important info.
Answer by Jopan · Dec 03, 2014 at 04:42 AM
Answer to my own question.
Diffuse - "_MainTex"
Specular/Roughness - "_SpecGlossMap"
Normal - "_BumpMap"
AO - "_Occlusion"
etc...
You can find these by switching the inspector to debug mode. Then inspecting the standard material.
Answer by aormsby · Jul 02, 2015 at 09:05 AM
Hi @Jopan! I know I'm a bit late to this thread, but you can also select a Game Object, right-click on its material, and select 'Edit Shader' to see a list of its properties in the Inspector. Pretty handy.
And if by chance you're still working on updating your Materials to use the Standard shaders, I actually just released a tool on the Asset Store called Legacy 2 PBR that might help you if you're still having any trouble. I invite you to check it out. :)
I modified your link to point to the asset page not the publisher page.
You just saved me a full night of sleep. Thank you. https://media.giphy.com/media/1Z02vuppxP1Pa/200.gif
Answer by kbr0n · Sep 09, 2016 at 01:19 AM
thank you so much
i've been looking for the correct property name for days!!!
it was _GlossMapScale -> the property that control Smoothness
thank you man, thank you lord!
Your answer
Follow this Question
Related Questions
Highlighting Multiple Objects with an Outline Shader 0 Answers
Check if emission is enabled in URP Lit Shader from C# script 0 Answers
Accessing shader colors 1 Answer
NavMeshAgent dont find the right way on runtime build NavMesh 0 Answers
How to know whether material's emission is enabled or not by C# script? 0 Answers