Thursday, December 24, 2015

Unity Shader Graph, set blackboard properties from code


I have a Shader Graph shader with a blackboard property that I want to change from within my code. The property is called Highlight here are the things I have tried:


Color myColor = new Color(1f,0,0,1f);
material.Color = myColor; // throws error (as I expected)
material.SetVector("Highlight", myColor); // Name in blackboard window

material.SetVector("HighlightColour", myColor); // Name in material property
material.SetVector("Color_8C3A526", myColor); // Name in the shader inspector

None of these work.


Here's the shader set up: The Unity Shader Graph showing a fresnel shader with a Highlight property in the blackboard




No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...