mcpField
S
shader-graph-create-custom-node

shader-graph-create-custom-node

github.com/unity-technologiesDevelopment57753 installsUpdated 6d ago
Repository

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

  1. 01HLSL 函数定义与反射标记
  2. 02Shader Graph 提示标签
  3. 03查找现有 ShaderInclude 资产
  4. 04创建或追加 .hlsl 代码

Use cases

  1. 01为 Shader Graph 添加自定义节点
  2. 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-node

After installing, type/shader-graph-create-custom-nodein Claude Code to confirm it loaded.

Bundled filesresources/all_hints.hlsl

Details

From the project README

Generating 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.hlsl for all valid hint tags and usage patterns
  • C#-style documentation tags are supported outside of funchints or paramhints blocks
  • Required function hints:
    • sg:ProviderKey
    • sg:SearchCategory
    • sg:SearchTerms
    • sg:DisplayName

Step 3: Write the code to an asset

  • Search the project for a ShaderInclude asset (.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 .hlsl asset
  • Ensure the file begins with #include "ShaderApiReflectionSupport.hlsl"

Comments

Markdown supported