The Shader Graph is a hardware and software module that adds specific rendering effects to 3D graphics.
Shader Graph - Add: Add
Creating the shader graph:
First, create a shader:
1. Right click in your project and select Create> Shader> PBR Graph.
2. Name the new shader "New ShaderGraph".
3. Double click on ShaderGraph to open the Shader Graph Editor.
4. Right-click in the new window and select Create Node.
5. Enter "Add" and click on the corresponding result.
There is now an Add node in your diagram.
This node is known as the Operations Node because it takes multiple inputs and performs a computation that results in a single output. Specifically, this node takes two inputs, adds them, and returns the sum.
inputs:
A: First input value
B: Second input value
outputs:
Out: The output of the sum of the two inputs.
Use this Add-Knot by adding two colors to get a different color.
1. Create two color nodes.
2. Change one of the color nodes to green and the other to blue.
3. Drag the green Out pin to the A input of the Add node.
4. Drag the blue Out pin to the B input of the Add node.
5. The resulting color should be cyan / teal. Unplug the out pin of the add node and plug it into the albedo of the PBR master node.
If you get the following error message: "The Current Render Pipeline is not compatible with this Master Node", do the following:
Download the Lightweight Render Pipeline from the Package Manager.
Right click in the asset folder: Create–> Rendering–> Lightweight pipeline Asset -> Name it what you want
Then select in the main menu above: Edit–> Project Settings–> Graphics
There you drag the pipeline asset and add the render pipeline settings.
Figure 02: Connecting the Add Node to the PBR Master Node
This connects our work with the last node of the shader graph to be rendered. The PBR master node is shown below with a small preview that shows you the final result of the shader.
Complete the shader graph
Save your asset to view the shader:
1. Click the Save Asset button in the top left of your PBRGraph.
2. Create a new material in your project window by right clicking on it to select it
Create> Material.
3. In the Materials window, select the Shader drop-down list and find the shader you created.
4. Apply the material to an object in your scene.
4. Conclusion on the Shader Graph
The "Add" node can do more than just add two colors together. It is possible to create a combination of effects when you start developing your own shader. After you understand the basics of this node, add gradients, transparency masks, or panning textures with a color overlay.
More information about You can find Shader Graph at Unity
Originally posted on 2020-03-13 11:30:00.