S
shader-graph-create-custom-node
About shader-graph-create-custom-node
A skill for creating custom Unity Shader Graph nodes in HLSL. It guides generation of function hints and writing code to an existing or new ShaderInclude asset.
Key features
- 01HLSL 函数定义与反射标记
- 02Shader Graph 提示标签
- 03查找现有 ShaderInclude 资产
- 04创建或追加 .hlsl 代码
Use cases
- 01为 Shader Graph 添加自定义节点
- 02将节点代码写入项目 HLSL 资产
Install
Copy the command and run it in a terminal.
$
npx skills add https:/ / github.com/ unity-technologies/ unity-agent-plugin --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