- Home /
How to connect shader and script
I heard that shader property can be controlled by script.
That is only from script to shader? or reverse can be?
If you have sample code, please show me that.
Comment
Typically a script communicates to a shader by changing material properties. See the $$anonymous$$aterial reference page for a list of Get and Set functions for the various property types. Note assigning to $$anonymous$$aterial.mainTexture and $$anonymous$$aterial.color are just short cuts to setting a couple of common properties.
Your answer

Follow this Question
Related Questions
How to force the compilation of a shader in Unity? 5 Answers
Adding BRDF lighting to custom Terrain Shader. 0 Answers
Combine Shaders 0 Answers
UnityObjectToClipPos is inverted? 0 Answers