Using properties in a Surface Shader
Now that we have created some properties in Shader Graph, let’s hook them up to the shader so that we can tweak the value and make the material process much more interactive. Shader properties allow users to tweak shader values directly from the material’s Inspector window, providing a flexible and user-friendly way to adjust shader parameters without modifying the shader code itself.
Getting ready
For this recipe, we will refit the shader we created previously. Instead of using a texture to create the visuals, the shader will only use a color and some other properties that we will be able to change directly from the Inspector window:
- Start by duplicating
StandardDiffuseShader
. You can do this by selecting it from the Inspector window and pressing Ctrl + D. This will create a copy calledStandardDiffuseShader 1
. Go ahead and rename itParameterExample
. - Next, create a new material (
ParameterExampleMaterial
...