S
shader-graph-create-custom-node
About shader-graph-create-custom-node
A skill for creating custom Shader Graph nodes in Unity by generating annotated HLSL functions and writing them to ShaderInclude assets.
Key features
- 01Generate HLSL function definitions
- 02Add required Shader Graph hint tags
- 03Inspect existing ShaderInclude assets
- 04Confirm before appending code
- 05Create a new .hlsl asset when needed
Use cases
- 01Author a custom Shader Graph node
- 02Add a node to an existing HLSL include
- 03Create an include asset for a new node
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ unity-technologies/ skills --skill shader-graph-create-custom-nodeAfter installing, type/shader-graph-create-custom-nodein Claude Code to confirm it loaded.
Bundled filesresources/all_hints.hlsl
Details
From the project READMEGenerating a custom Shader Graph node
Step 1: Generate an HLSL function definition
- The function must be preceded by the preprocessor define
UNITY_EXPORT_REFLECTION
Step 2: Decorate with Shader Graph hint tags
- See
resources/all_hints.hlslfor all valid hint tags and usage patterns - C#-style documentation tags are supported outside of
funchintsorparamhintsblocks - Required function hints:
sg:ProviderKeysg:SearchCategorysg:SearchTermssg:DisplayName
Step 3: Write the code to an asset
- Search the project for a
ShaderIncludeasset (.hlsl) that already contains custom Shader Graph nodes - If a matching asset exists, show the user its current contents and ask for confirmation before appending the new code
- If no matching asset exists, create a new
.hlslasset - Ensure the file begins with
#include "ShaderApiReflectionSupport.hlsl"
Comments
Markdown supported