Wireframe Shader
  • Wireframe Shader
  • Quick Start
  • Wireframe Mesh Creator
  • Wireframe Texture Creator
  • Dynamic Wireframe Rendering
  • Dynamic Mask Controller
  • Custom Shaders
    • Hand-written shaders
    • Shader Graphs
  • Run-time API
  • Help & Contact
Powered by GitBook
On this page
  1. Custom Shaders

Shader Graphs

PreviousHand-written shadersNextRun-time API

Last updated 5 months ago

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

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.

These variables are updated using WireframeMaskController script (explained in the chapter).

Dynamic Mask Controller
Example of using wireframe node in Shader Graph
Example of using wireframe node in Amplify Shader Editor
Shader Graph and Amplify Shader Editor context menus