urp-hlsl-templates

Installation
SKILL.md

URP HLSL Shader Code Templates

TRIGGER

Use this skill when the user wants to write a Unity shader in HLSL/ShaderLab code (not Shader Graph) for Universal Render Pipeline. Triggers include: "URP shader", "HLSL", "ShaderLab", "write a shader", "custom shader", "vertex fragment shader", "SRP Batcher", "CBUFFER", "custom lit shader", "unlit shader", or any code-based shader authoring in URP. Also trigger when converting Built-in pipeline shaders to URP, or when the user references Cyanilux templates, phi-lira gists, or NedMakesGames tutorials.


CORE RULES — URP HLSL

  1. Always use HLSLPROGRAM / ENDHLSL, never CGPROGRAM / ENDCG. URP uses HLSL, not CG. CG blocks will compile but miss URP-specific includes and macros.

  2. All material properties must be in a CBUFFER_START(UnityPerMaterial) / CBUFFER_END block for SRP Batcher compatibility. Without this, each material breaks batching and gets its own draw call.

  3. Include URP Core, not legacy Unity includes.

    // CORRECT (URP)
    #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
    #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
    
Installs
38
GitHub Stars
9
First Seen
Mar 28, 2026
urp-hlsl-templates — adevra/unity-shader-agent-skills