- Home /
How to change color of material from shader graf per script,How to change color of material from shader graf
Hi I have a glow effect in my 2d game with a shader Graf does anyone know how to change the color of the material using a script? thanks :pray:,Hi I have a glow effect in my 2d game with a shader Graf does anyone know how to change the color of the material using a script? thanks
Answer by Ejlersen · Mar 24, 2021 at 10:21 AM
You can either use renderer.material.SetColor, or use a MaterialPropertyBlock.
The thing with shader graph is that the name you need to use in code is not the same as shown in the graph. The graph shows the display name (inspector), you need to show the detailed information of the color property, where the property ID is displayed.
Your answer
Follow this Question
Related Questions
HLSL Post Process Shader Fixing UV/Texcoord 1 Answer
Why doesn't this shader work when using it with as a custom effect on the post processing stack 1 Answer
In FastBloom(Bloom Optimized) shader, what's the difference between Standard and Sgx blur type? 0 Answers
Post processing layer in Universal RP 5 Answers
Curved Screen Post Processing Effect 1 Answer