# shader-graph-create-custom-node

Generates custom Shader Graph nodes from HLSL code, so your own shader functions appear as nodes in Unity.

Skill by Unity. Category: Design and frontend.

## Install

Project (for this project only):

```sh
npx skills add unity-technologies/skills --skill shader-graph-create-custom-node
```

Works with: Claude Code, Codex CLI, Cursor, Antigravity, Copilot CLI, opencode.

Global (for every project on this machine):

```sh
npx skills add unity-technologies/skills --skill shader-graph-create-custom-node -g
```

Works with: Claude Code, Codex CLI, Cursor, Antigravity, Copilot CLI, opencode.

## Tags

- Runs on your computer: It runs as a program on your machine, with your access.

## Security audits

- Gen Agent Trust Hub: Pass
- Socket: Pass
- Snyk: Pass

Installs: 4594. Installs counted by skills.sh. [Open on skills.sh](https://www.skills.sh/unity-technologies/skills/shader-graph-create-custom-node)

## Source

[Open the source](https://github.com/unity-technologies/skills/tree/HEAD/skills/shader-graph-create-custom-node). Checked 2026-10-10. This summary may contain AI-generated text, so it can be wrong. Check the source before you rely on it.

## SKILL.md

````markdown
---
name: shader-graph-create-custom-node
description: Generates custom Shader Graph nodes from HLSL code. Use when the user wants a new Shader Graph node or to make existing HLSL work as a reflected function node.
required_packages:
  com.unity.shadergraph: ">=17.5.0"
---
# 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"`
````

- Previous: [optimize-audio](https://syn4pse.dev/terminal/unity-optimize-audio.md)
- Next: [validate-urp-render-graph-renderer-feature](https://syn4pse.dev/terminal/unity-validate-urp-render-graph-renderer-feature.md)
- [Terminal](https://syn4pse.dev/terminal.md)
- [Suggest a change](mailto:terminal@syn4pse.dev?subject=Terminal%20suggestion)
