unity-rendering

v2026.09.24

Unity rendering pipelines (Built-in / URP / HDRP), Shader Graph, Renderer Features, Volume framework, post-processing, materials, lighting, and GPU Resident Drawer. USE WHEN: choosing or migrating rendering pipeline, writing/editing shaders (Shader Graph, HLSL, ShaderLab), tuning lighting, debugging draw calls, configuring Volume profiles, custom render passes. DO NOT USE FOR: 2D Renderer specifics (use `unity-2d-lighting`); UI Toolkit rendering (use `unity-input-ui`); profiling-only questions (use `unity-performance`).

GitHub
安装命令
npx skhub add claude-dev-suite/unity-rendering
Markdown
SKILL.md

Unity Rendering

Pipeline selection

PipelineUse whenAvoid when
URPMobile, indie, mid-fidelity, broad platform reach, custom Renderer FeaturesCinematic AAA, volumetrics, screen-space GI
HDRPHigh-end PC/console, photoreal, advanced lightingMobile, WebGL, low-spec hardware
Built-inLegacy projects, very specific shaders not portableNew projects (default to URP)

Switching pipeline mid-project is painful — pick once, upfront.

Shader Graph (URP/HDRP)

Vertex stage  → object-space → world-space transforms, vertex displacement
Fragment      → albedo, normal, metallic, smoothness, emission, AO
Custom Function node → write HLSL inline for branchless ops
Subgraph      → reusable groups; export as .shadersubgraph

Author URP shaders in Shader Graph by default. Drop to handwritten ShaderLab/HLSL only when SG can't express the math (e.g. compute, geometry, custom render textures).

Volume framework (URP/HDRP)

// Per-camera profile override
var volume = camera.GetComponent<Volume>();
if (volume.profile.TryGet<Bloom>(out var bloom)) {
    bloom.intensity.value = 1.5f;
    bloom.threshold.value = 0.9f;
}

Global volume + per-trigger local volumes; use weights for smooth transitions (e.g. entering interior).

Renderer Features (URP)

Add custom passes (outline, fog, decal) by extending ScriptableRendererFeature + ScriptableRenderPass. Inject at BeforeRenderingTransparents, AfterRenderingPostProcessing, etc.

public class OutlineFeature : ScriptableRendererFeature {
    public Material outlineMat;
    OutlinePass _pass;
    public override void Create() => _pass = new OutlinePass(outlineMat);
    public override void AddRenderPasses(ScriptableRenderer r, ref RenderingData d)
        => r.EnqueuePass(_pass);
}

GPU Resident Drawer / BatchRendererGroup (Unity 6)

Big draw-call wins for static + lots of instances. Toggle GPU Resident Drawer in Quality settings; objects must be Static + share materials/meshes; auto-instances them on the GPU.

Lighting

NeedUse
Static scenes (level geo)Baked Global Illumination (Progressive Lightmapper GPU) + Light Probes for dynamic objects
Outdoor day-night cycleMixed lighting (Shadowmask) + dynamic skybox
Stylized cel-shadingCustom Shader Graph with ramp texture
HDRP photorealVolumetric lights + Screen-Space GI + Adaptive Probe Volumes

Reflection Probes: bake on key viewpoints; use box projection for indoors; pure realtime probes only for hero objects.

Anti-patterns

Anti-patternFix
Different shader per material variantMaterial Property Block via Renderer.SetPropertyBlock
Switching shaders at runtimePre-warm with shader variants collection asset
Per-frame material instantiationrenderer.material clones — use sharedMaterial for reads, MaterialPropertyBlock for per-instance overrides
Camera.Render() in UpdateUse Render Texture + Camera.targetTexture once
Mixing pipelines (URP shader on Built-in)Convert via Edit > Render Pipeline > Universal > Convert Selected Materials

Production checklist

  • Pipeline asset set in Graphics + Quality settings
  • Volume profiles configured for global + relevant local triggers
  • Shader variants collection generated and preloaded for the build
  • Static objects flagged Static; lighting baked
  • Light Probes / Reflection Probes placed
  • Frame Debugger inspected — no surprise opaque draws on UI
  • HDRP-only: Adaptive Probe Volumes configured if static GI is critical
发现
标签

此技能尚未发布标签。

版本
最新版本元数据

版本

v2026.09.24

发布时间

2026年9月24日

分类

未分类

许可证

MIT

源路径

skills/gamedev/unity-rendering

默认分支

main

最新提交

9496306

Tree SHA

fe4e2f1