Install
$ agentstack add skill-xeldaralz-everything-claude-unity-shader-graph ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
ShaderGraph
Overview
ShaderGraph is Unity's visual shader editor. Node-based, works with URP and HDRP. Generates HLSL shader code from the graph.
Master Stack Outputs
Vertex Stage
- Position (object/world/absolute world)
- Normal (object/tangent)
Fragment Stage (URP Lit)
- Base Color, Normal (Tangent), Metallic, Smoothness, Emission, Ambient Occlusion, Alpha
Fragment Stage (URP Unlit)
- Base Color, Alpha
Custom Function Nodes
Inline (small functions)
// In Custom Function node, Type: String
void MyFunction_float(float3 In, out float3 Out)
{
Out = In * 2.0;
}
External File (complex functions)
Create .hlsl file in project:
// Assets/Shaders/MyFunctions.hlsl
void TriplanarMapping_float(
float3 Position, float3 Normal, float Sharpness,
UnityTexture2D Tex, UnitySamplerState Sampler,
out float4 Color)
{
float3 blend = pow(abs(Normal), Sharpness);
blend /= dot(blend, 1.0);
float4 xProj = SAMPLE_TEXTURE2D(Tex, Sampler, Position.yz);
float4 yProj = SAMPLE_TEXTURE2D(Tex, Sampler, Position.xz);
float4 zProj = SAMPLE_TEXTURE2D(Tex, Sampler, Position.xy);
Color = xProj * blend.x + yProj * blend.y + zProj * blend.z;
}
Reference in Custom Function node: Source = Asset, File = MyFunctions.hlsl
Keywords (Shader Variants)
- Boolean Keyword: toggle features on/off per material
- Enum Keyword: select between N options
- Use
shader_feature(stripped if unused) notmulti_compile(always included) - Use
shader_feature_localfor material-only keywords
Keep total variant count under 1000 per shader.
Common Patterns
Dissolve Effect
- Sample noise texture (Gradient Noise or texture)
- Compare noise value to "Dissolve Amount" property (Step or SmoothStep)
- Multiply with Alpha output
- Add emission at dissolve edge (edge = small range above threshold)
Fresnel / Rim Lighting
- Fresnel Effect node (View Direction, Normal)
- Multiply by color
- Add to Emission
Scrolling UV (Water, Lava)
- Time node → Multiply by scroll speed
- Add to UV coordinates
- Sample texture with modified UVs
Vertex Displacement (Wind, Waves)
- Object Position + Time → noise function
- Multiply by displacement amount
- Add to Vertex Position output
Outline (Inverted Hull Method)
Two-pass: Pass 1 = normal render, Pass 2 = vertex-expanded back faces with solid color. (Requires custom Renderer Feature in URP or ShaderGraph with two materials.)
Sub-Graphs
Reusable node groups. Create for common operations:
- Triplanar mapping
- Tiling and offset with rotation
- Blend modes (overlay, multiply, screen)
- Parallax mapping
Performance Tips
- Minimize texture samples per fragment
- Use
halfprecision where possible (set in graph settings) - Avoid branching (use lerp/step instead)
- Fewer keywords = fewer variants = faster build times
- Preview variant count in Shader Inspector
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: XeldarAlz
- Source: XeldarAlz/everything-claude-unity
- License: MIT
- Homepage: https://github.com/XeldarAlz/everything-claude-unity#readme
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.