Shader Graphs
Last updated
Last updated
Wireframe Shader Instructions contains section for Shader Graph and Amplify Shader Editor.
Based on the used shader editor click on the Read Wireframe button and required node file will be highlighted inside Project window:
Drag & and drop file inside shader editor and connect to the target.
Node reads wireframe data baked inside mesh's UV4 buffer. Output result is in the range of [0, 1].
Note, Thickness and Smoothness values should be in the range of [0, 1]
In Shader Graph and Amplify Shader Editor wireframe nodes can be added using context menu too:
Package includes nodes for calculating distance fade and dynamic mask effects. Output of those nodes are in the range of [0, 1] and can be multiplied with the Read Wireframe (or any other) node.
For using Plane Mask node, shader additionally should declare two Vector3 variables _WireframeShaderMaskPlanePosition and _WireframeShaderMaskPlaneNormal
These variables are updated using WireframeMaskController script (explained in theDynamic Mask Controller chapter).
When clicking on the mask node button inside Shader Instructions window, Unity's Console window will print variable types and names required by that node.
Sphere Mask node requires Vector3 _WireframeShaderMaskSpherePosition and float _WireframeShaderMaskSphereRadius variables.
Box Mask node requires Matrix4 _WireframeShaderMaskBoxMatrixTRS and Vector3 _WireframeShaderMaskBoxBoundingBox variables.