Skip to content

Patcher for Unity Shadergraph shaders. Adds some features that are currently not available in Shadergraph.

License

Notifications You must be signed in to change notification settings

dotmos/UnityShaderGraphPatcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Unity Shadergraph Patcher

UnityVersion GitHub

Patcher utility for Unity Shadergraph shaders.
Adds features to Shadergraph shaders that are currently not available in Shadergraph.
Tested with Shadergraph 14.0.11 and URP 14.0.11 . HDRP has not been tested.

Features

  • Use SV_InstanceID instead of unity_InstanceID when using the InstanceID-node. This breaks instancing support for the shader, but in return allows using the shader with IndexedIndirect render functions. i.e. Graphics.RenderPrimitivesIndexedIndirect
  • Add "nointerpolation" attribute to CustomInterpolators / Vertexshader output
  • Support for uint, int, min16uint and min16int vertex input attributes. i.e. "float4 uv2 : TEXCOORD2;" becomes "min16uint4 uv2 : TEXCOORD2;". NOTE: This will ONLY patch vertex INPUT! All other nodes/code will not be affected.

Patching

When patching a shader, the original shader(graph) will not be touched and a new shader will be created instead.
The new shader will have the suffix "_Patched".
i.e. Opaque.shadergraph will become Opaque_Patched.shadergraph
The name of the new shader will also be changed.
i.e. "Shader Graphs/Opaque" will become "Shader Graphs/Opaque_Patched"

If patching both SV_InstanceID and nointerpolation, "InstanceID" in the screenshot above will contain SV_InstanceID instead of unity_InstanceID and "NoInterpolationData" will get the "nointerpolation" attribute.

How To

Copy the "Editor" folder to your Unity project. The patcher will then be available under "Tools/Shader Graph Patcher".
Drag and drop a shadergraph or shader to the window and select the features you want to patch.
Then press "Patch"

~ Use at your own risk. ~

About

Patcher for Unity Shadergraph shaders. Adds some features that are currently not available in Shadergraph.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages