Логотип Unity Graphics

Unity Graphics

Организация
Nice-Wolf-Studio
unity-graphics

Unity 6 graphics and rendering guide. Use when working with render pipelines (URP, HDRP, Built-in), shaders, Shader Graph, materials, textures, cameras, post-processing, or rendering optimization. Covers Render Graph, batching, draw call optimization, and GPU instancing. Based on Unity 6.3 LTS documentation.

Обзор

ИздательNice-Wolf-Studio
Репозиторийunity-claude-skills
Название навыкаunity-graphics
Звёзды
40
Форки
5
Встроенные файлы
4
ЛицензияMIT
Ссылки
  • Инструкции в формате Markdown

    Файл SKILL.md, который модель загружает по необходимости, поэтому токены расходуются только при подходящем запросе.

  • Работает с любой языковой моделью

    Навыки ИИ — это обычный Markdown, а не код для конкретного поставщика, поэтому они работают с GPT, Claude, Gemini, Grok и локальными моделями.

  • Файлы в комплекте: 4

    Скрипты, шаблоны и справочные материалы, которые модель может читать во время работы. Файлы доступны только для чтения и никогда не выполняются.

  • Открытый исходный код

    Опубликовано на GitHub: Nice-Wolf-Studio. Перед установкой изучите исходные материалы.

Установка

Установите навык ИИ Unity Graphics в TypingMind, чтобы использовать его с любой LLM, или добавьте его в другой агент, который умеет читать SKILL.md.

1

Установка в TypingMind

TypingMind устанавливает навык прямо из его папки на GitHub: читает SKILL.md, собирает файлы ресурсов и сохраняет результат локально.

  1. Откройте приложение и перейдите в раздел «Плагины → Навыки».
  2. Выберите «Установить из GitHub».
  3. Вставьте указанную ниже ссылку на папку навыка и подтвердите установку.
    https://github.com/Nice-Wolf-Studio/unity-claude-skills/tree/main/skills/unity-graphics
  4. Включите навык в каждом чате, где хотите его использовать.
Плагины → Навыки → Новый навык → По ссылке GitHub, затем вставьте ссылку на папку и нажмите «Продолжить».
2

Установка в другом агенте

Любой агент с поддержкой формата Agent Skills может использовать этот навык — скопируйте папку в каталог навыков этого агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Nice-Wolf-Studio/unity-claude-skills.git /tmp/unity-claude-skills
mkdir -p .claude/skills
cp -r /tmp/unity-claude-skills/skills/unity-graphics .claude/skills/unity-graphics
После копирования перезапустите Claude Code, чтобы загрузить новый навык.

Использование в TypingMind

Включите навык Unity Graphics в любом чате TypingMind, и дальше модель всё сделает сама. Его название и описание хранятся в системном промпте, а при появлении подходящего запроса модель сама загружает полные инструкции. Вам не нужно вызывать навык вручную, и до фактического использования он не расходует токены.

Модель сама загружает навык Unity Graphics, как только появляется подходящий для него запрос.

Работает с любой моделью ИИ

Навыки ИИ — это обычные инструкции в Markdown, а не код для конкретного поставщика, поэтому навык Unity Graphics не привязан к модели, для которой он был создан. Установите его один раз в TypingMind и используйте с GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama или локальной моделью, которую запускаете самостоятельно, — со своими API-ключами.

  • Загружается только при необходимости

    Системный промпт содержит только название и описание. Инструкции загружаются при первом подходящем запросе, поэтому неиспользуемый навык не расходует токены.

  • Меняйте модели прямо в чате

    Навык состоит из инструкций, а не кода, поэтому смена модели не нарушает его работу: новая модель читает тот же файл SKILL.md.

Инструкции навыка

Это содержимое файла SKILL.md, которое загружает модель. Прочитайте его перед установкой: навык — это инструкции, которым будет следовать ваша модель.

Unity Graphics and Rendering

Render Pipeline Selection Guide

A render pipeline performs a series of operations that take the contents of a scene and displays them on a screen. Unity provides three render pipelines:

CriteriaBuilt-in Render PipelineUniversal Render Pipeline (URP)High Definition Render Pipeline (HDRP)
TargetLegacy projectsMobile to high-end consoles/PCsAAA, automotive, architectural
CustomizationLimitedScriptable, extensible via Renderer FeaturesScriptable, Custom Passes, Full Frame Settings
Rendering PathsForward, DeferredForward, Forward+, DeferredForward, Deferred (hybrid tile/cluster)
Shader AuthoringShaderLab + Surface ShadersShader Graph (recommended), HLSLShader Graph (recommended), HLSL
SRP BatcherNoYesYes
Ray TracingNoNoYes (DXR)
VolumetricsNoNoYes (fog, clouds)
Anti-AliasingMSAAFXAA, SMAA, TAA, MSAAFXAA, SMAA, TAA, MSAA
PlatformsAllAll (scalable)High-end (DX11/12, Metal, Vulkan)
GPU RequirementStandardStandardCompute shader capable

Decision flow:

  1. Need ray tracing, volumetric clouds, or physically-based sky? --> HDRP
  2. Need to target mobile, WebGL, or widest platform range? --> URP
  3. Maintaining a legacy project with no migration budget? --> Built-in
  4. Starting a new project? --> URP (most projects) or HDRP (high fidelity)

Warning: Render pipelines are NOT interchangeable. Materials, shaders, and post-processing from one pipeline do not work in another without conversion. Upgrading Built-in materials to URP/HDRP requires the pipeline's material upgrader; objects render bright pink if their shader is incompatible.

Source: Render Pipelines

URP (Universal Render Pipeline)

URP is a prebuilt Scriptable Render Pipeline made by Unity for creating optimized graphics across a range of platforms, from mobile to high-end consoles and PCs.

Key features:

  • Forward, Forward+, and Deferred rendering paths
  • Anti-aliasing: FXAA, SMAA, TAA, MSAA
  • 2D Renderer for 2D games
  • Renderer Features for custom rendering injection
  • SRP Batcher for draw call optimization
  • Built-in post-processing via Volume system

See: references/urp-guide.md Source: URP

HDRP (High Definition Render Pipeline)

HDRP is a prebuilt Scriptable Render Pipeline targeting AAA-quality games, automotive demos, and architectural visualization on high-end hardware. It requires compute shader-capable GPUs (DirectX 11/12, Metal, Vulkan).

Key features:

  • Physically-based lighting with Physical Light Units
  • Material types: Lit, StackLit, Layered Lit, Hair, Fabric, Eye, AxF, Terrain
  • Ray tracing: reflections, GI, shadows, AO, subsurface scattering
  • Volumetric fog and volumetric clouds
  • Physically Based Sky, HDRI Sky, Gradient Sky
  • Path tracing with denoising (Optix, Intel Open Image Denoise)
  • Water system with caustics and underwater rendering
  • Dynamic resolution with DLSS, FSR 1.0, TAA Upscaling

See: references/hdrp-guide.md Source: HDRP

Shader Graph

Shader Graph enables building shaders visually by creating and connecting nodes in a graph framework instead of writing code. Changes are reflected with instant feedback.

Render pipeline compatibility:

PipelineSupported
URPYes
HDRPYes
Built-in Render PipelineYes
Custom SRPNo

Shader Graph is included automatically when you install URP or HDRP.

Custom Function Node -- Inject custom HLSL code into Shader Graphs:

  • String mode: Write HLSL directly; use $precision token for half/float
  • File mode: Reference external .hlsl files with include guards
hlsl
// File mode example with include guards
//UNITY_SHADER_NO_UPGRADE
#ifndef MYHLSLINCLUDE_INCLUDED
#define MYHLSLINCLUDE_INCLUDED

void MyFunction_float(float3 A, float B, out float3 Out)
{
    Out = A + B;
}
#endif //MYHLSLINCLUDE_INCLUDED

Pipeline detection in Custom Function nodes:

hlsl
#ifdef SHADERGRAPH_PREVIEW
    half3 color = half3(0,0,0);
#else
    #if defined(UNIVERSAL_PIPELINE_CORE_INCLUDED)
        half4 shadowCoord = TransformWorldToShadowCoord(WorldPosition);
        Light mainLight = GetMainLight(shadowCoord);
        half3 color = mainLight.color;
    #else
        half3 color = half3(0, 0, 0);
    #endif
#endif

Conditional keywords by pipeline:

  • Built-in: BUILTIN_PIPELINE_CORE_INCLUDED
  • URP: UNIVERSAL_PIPELINE_CORE_INCLUDED
  • HDRP: UNITY_HEADER_HD_INCLUDED
  • Preview window: SHADERGRAPH_PREVIEW

See: references/shader-graph.md Source: Shader Graph

Shaders

A shader is a program that runs on the GPU. Unity categorizes shaders into three types:

  1. Graphics Pipeline Shaders -- Most common; work with Shader objects to determine scene appearance
  2. Compute Shaders -- Perform GPU calculations outside the regular graphics pipeline
  3. Ray Tracing Shaders -- Handle ray tracing calculations (HDRP only)

Key terminology:

  • Shader Object -- Instance of the Shader class wrapping shader programs and GPU instructions
  • ShaderLab -- Unity's language for defining Shader object structure
  • Shader Graph -- Visual, code-free shader creation tool
  • Shader Asset -- A .shader file defining a Shader object
  • HLSL -- High Level Shader Language used inside shader code blocks

Surface Shaders (Built-in pipeline ONLY):

  • Streamlined way to write lighting-interactive shaders
  • Auto-generates vertex/pixel shaders and rendering passes
  • NOT supported in URP or HDRP; use Shader Graph instead

HLSL in ShaderLab:

  • Use HLSLPROGRAM directive to add shader code to Pass blocks
  • Declare structs connecting shader variables to mesh vertex data
  • Use #pragma directives to control compilation
  • Support 16-bit precision for mobile optimization

Source: Shaders Introduction

Materials and Textures

Materials and shaders work together to define the appearance of a scene.

Materials

Key workflows:

  • Create material assets and assign them to GameObjects
  • Modify material properties at runtime via scripting
  • Use Material Variants for managing large material collections
  • Upgrade Built-in materials to URP/HDRP to prevent pink rendering

Material API -- Key properties and methods:

Property/MethodPurpose
colorMain color of the material
mainTexturePrimary texture
shaderAssigned shader reference
renderQueueRender order override
enableInstancingGPU instancing toggle
SetColor(name, color)Change a color property
SetFloat(name, value)Set a float property
SetTexture(name, texture)Assign a texture
SetVector(name, vector)Set a vector property
SetMatrix(name, matrix)Set a matrix property
HasProperty(name)Check if property exists
EnableKeyword(keyword)Enable a shader keyword
CopyPropertiesFromMaterial(mat)Copy from another material
Lerp(start, end, t)Interpolate between materials

Important: Set your desired shader BEFORE modifying properties. Property assignments have no effect if the current shader does not support them.

Textures

Textures are bitmap images applied to mesh surfaces. Key concepts:

  • Power-of-two dimensions recommended: 32, 64, 128, 256, 512, 1024, 2048, 4096
  • LDR (Low Dynamic Range): PNG, JPG -- values 0.0-1.0
  • HDR (High Dynamic Range): EXR, HDR -- extended color ranges
  • RGBA: RGB color plus alpha channel for transparency
  • Bits per pixel (bpp): Lower values reduce memory and improve GPU cache
  • Anisotropic filtering: Improves quality at steep viewing angles

See: references/materials-textures.md Source: Materials, Textures

Cameras

Cameras create an image of a particular viewpoint in a scene, with output displayed on-screen or captured as a texture.

Projection modes:

  • Perspective -- Replicates human vision; distant objects appear smaller (default)
  • Orthographic -- No perspective; objects render at consistent size regardless of distance; useful for isometric/2D games

Key details:

  • At least one camera required per scene
  • Multiple cameras supported with configurable render order
  • Render path set in Player settings; overridable per camera
  • URP and HDRP have pipeline-specific camera documentation
  • Orthographic cameras render fog uniformly rather than depth-based

Common camera setups:

  • Puzzle games: static camera for full visibility
  • FPS: camera parented to player at eye level
  • Racing: camera following the vehicle

Source: Cameras

Post-Processing

Post-processing effects simulate physical camera/film properties or enable stylized visuals.

PipelinePost-Processing Solution
URPBuilt-in (installed with URP template)
HDRPBuilt-in (installed with HDRP template)
Built-inPost-Processing Version 2 package (separate)

Warning: Post-processing solutions are NOT interchangeable across render pipelines. Each pipeline's effects and implementation methods differ.

HDRP anti-aliasing options:

  • MSAA -- Most resource-intensive
  • TAA -- Motion-dependent temporal smoothing
  • SMAA -- Pattern-based edge blending
  • FXAA -- Per-pixel; least intensive

HDRP exposure: Histogram-based with percentile selection, metering modes, and pre-exposure for precision with Physical Light Units.

Source: Post-Processing

Render Graph (Unity 6)

The Render Graph system provides a high-level representation of custom SRP render passes, explicitly stating how passes use resources. Both URP and HDRP use Render Graph.

Core Principles

  1. Handle-based resources -- Use TextureHandle, BufferHandle, RendererListHandle instead of direct references
  2. Scoped access -- Actual resources only accessible inside render pass execution code
  3. Explicit declaration -- Each pass declares reads/writes, enabling dependency tracking
  4. No persistence -- Resources created within one execution cannot carry to the next
  5. RTHandle dependency -- Textures use RTHandle system

Three-Phase Execution (per frame)

  1. Setup -- Declare all render passes and resource dependencies
  2. Compilation -- System culls unused passes, calculates resource lifetimes for efficient allocation
  3. Execution -- Run non-culled passes in declaration order

Key API Pattern -- AddRenderPass

csharp
using UnityEngine.Rendering;
using UnityEngine.Rendering.RenderGraphModule;

// 1. Define pass data
class MyPassData { public TextureHandle input, output; public float param; }

// 2. Create and configure pass
using (var builder = renderGraph.AddRenderPass<MyPassData>("MyPass", out var passData))
{
    passData.input = builder.ReadTexture(inputTexture);
    passData.output = builder.UseColorBuffer(
        renderGraph.CreateTexture(new TextureDesc(Vector2.one, true, true)
        { colorFormat = GraphicsFormat.R8G8B8A8_UNorm, name = "Output" }), 0);
    passData.param = 2.5f;

    builder.SetRenderFunc((MyPassData data, RenderGraphContext ctx) =>
    {
        var mpb = ctx.renderGraphPool.GetTempMaterialPropertyBlock();
        mpb.SetTexture("_MainTexture", data.input);
        mpb.SetFloat("_FloatParam", data.param);
        CoreUtils.DrawFullScreen(ctx.cmd, material, mpb);
    });
}

// 3. Lifecycle: new RenderGraph() -> BeginRecording() -> AddPasses -> EndRecordingAndExecute() -> Cleanup()

RenderGraphBuilder Key Methods

MethodPurpose
ReadTexture / WriteTextureDeclare texture read/write dependency
UseColorBuffer / UseDepthBufferWrite + auto-bind as render/depth target
CreateTransientTextureTemporary texture scoped to pass
ReadComputeBuffer / WriteComputeBufferDeclare buffer read/write
UseRendererListDeclare renderer list usage
SetRenderFuncSet rendering callback
EnableAsyncCompute / AllowPassCullingControl pass behavior

Resource creation: CreateTexture(), CreateComputeBuffer(), CreateRendererList() Import external: ImportTexture(), ImportBackbuffer(), ImportBuffer()

Source: Render Graph

Rendering Optimization

Draw Call Batching

Batching combines meshes using the same material so Unity renders them with fewer render state updates.

SRP Batcher (URP/HDRP only):

  • Reduces CPU time for draw calls by minimizing render-state changes between calls
  • Material data persists in GPU memory
  • Uses dedicated per-object GPU constant buffer
  • For best results: use as few shader variants as possible
  • Compatible with URP, HDRP, and custom SRP; NOT Built-in pipeline

Static Batching:

  • Merges stationary meshes into unified vertex/index buffers (world-space)
  • Each buffer supports up to 64,000 vertices
  • Works at build time or runtime
  • Only for Mesh Renderers (not Skinned Mesh Renderers)

Dynamic Batching:

  • Transforms vertices to world space on CPU at runtime
  • Useful for procedurally generated geometry (particles, lines, trails)
  • Meshes limited to 900 vertex attributes or 300 vertices
  • Not recommended for most uses: CPU overhead may exceed draw call savings
  • Not supported in HDRP

GPU Instancing:

  • Renders multiple instances of the same mesh in one draw call
  • Enable via Material.enableInstancing
  • Add per-instance properties (color, transform) via HLSL macros
  • Requires shader support with instancing macros

Occlusion Culling

Prevents rendering of GameObjects hidden behind others. Works with frustum culling.

  • Baking phase (Editor): Divides scene into cells, generates visibility data
  • Runtime: Loads baked data, performs per-camera visibility queries
  • Best for: GPU-bound projects with overdraw; small areas separated by solid geometry
  • Limitation: Dynamic objects can be occluded but cannot occlude others
  • URP/HDRP: Can use GPU occlusion culling instead of CPU-based approach

Source: Draw Call Batching, SRP Batcher

Common Patterns (C#)

Material Property Access at Runtime

csharp
// Set shader before modifying properties
material.SetColor("_BaseColor", Color.red);
material.SetFloat("_Smoothness", 0.8f);
material.SetTexture("_BaseMap", myTexture);
if (material.HasProperty("_Metallic"))
    material.SetFloat("_Metallic", 1.0f);
material.EnableKeyword("_EMISSION");

Instance vs Shared Material

csharp
Renderer rend = GetComponent<Renderer>();
rend.material.color = Color.blue;        // SAFE: creates per-object instance
// rend.sharedMaterial.color = Color.blue; // DANGEROUS: modifies asset for ALL objects

MaterialPropertyBlock (Per-Object Variation Without Material Instances)

csharp
// WARNING: MaterialPropertyBlock BREAKS SRP Batcher compatibility.
// Use only when SRP Batcher is not critical (e.g., Built-in pipeline, few unique objects).
// For SRP Batcher-compatible per-object variation, use GPU Instancing with instance properties
// or create material instances via renderer.material.
private static readonly int BaseColorID = Shader.PropertyToID("_BaseColor");
private MaterialPropertyBlock _propBlock = new MaterialPropertyBlock();

void SetColor(Color color)
{
    Renderer rend = GetComponent<Renderer>();
    rend.GetPropertyBlock(_propBlock);
    _propBlock.SetColor(BaseColorID, color);
    rend.SetPropertyBlock(_propBlock);
}

Anti-Patterns

Anti-PatternProblemSolution
Modifying renderer.sharedMaterial at runtimeChanges the material asset; affects ALL objects using itUse renderer.material (creates instance) or MaterialPropertyBlock
Creating new Material instances every frameMemory leak; unbounded allocationsCache material instances; use MaterialPropertyBlock for per-object variation
Using Surface Shaders in URP/HDRPNot supported; will fail or render pinkUse Shader Graph or write HLSL shaders
Mixing render pipeline assetsShaders/materials from wrong pipeline render pinkUse pipeline-specific shaders; run material upgrader when switching
Non-power-of-two texture dimensionsCompression fails; higher memory usageUse 32, 64, 128, 256, 512, 1024, 2048, 4096
Enabling dynamic batching by defaultCPU overhead often exceeds draw call savingsPrefer SRP Batcher (URP/HDRP) or static batching
Too many shader variantsIncreased build time, memory, and load timeStrip unused variants; minimize keyword usage
Using Shader.Find() at runtimeSlow; may fail if shader not included in buildCache shader references; assign in Inspector
Forgetting to call m_RenderGraph.Cleanup()GPU resource leakAlways cleanup in pipeline Dispose()
Ignoring render queue for transparent objectsZ-fighting, incorrect sort orderSet appropriate renderQueue; sort transparent back-to-front

Key API Quick Reference

Class/StructNamespacePurpose
MaterialUnityEngineControls shader properties on a renderer
ShaderUnityEngineReferences compiled shader programs
Texture2DUnityEngine2D texture asset
RenderTextureUnityEngineGPU-rendered texture target
CameraUnityEngineScene viewpoint and rendering control
RendererUnityEngineBase class for all renderers
MaterialPropertyBlockUnityEnginePer-object shader properties without instancing
CommandBufferUnityEngine.RenderingGPU command list
RenderGraphUnityEngine.Rendering.RenderGraphModuleFrame render pass management
TextureHandleUnityEngine.Rendering.RenderGraphModuleRender Graph texture reference
BufferHandleUnityEngine.Rendering.RenderGraphModuleRender Graph buffer reference
RenderGraphBuilderUnityEngine.Rendering.RenderGraphModuleConfigures individual render passes
CoreUtilsUnityEngine.RenderingUtility methods (DrawFullScreen, etc.)
VolumeUnityEngine.RenderingPost-processing/environment effect container
VolumeProfileUnityEngine.RenderingCollection of volume effect overrides

Related Skills

  • unity-lighting-vfx -- Lighting setup, light types, baking, VFX Graph, particle systems
  • unity-platforms -- Platform-specific rendering settings, quality tiers, shader stripping
  • unity-2d -- 2D Renderer (URP), sprite rendering, tilemap rendering

Additional Resources

Встроенные файлы

Модель читает эти файлы по мере необходимости, пока навык загружен. Они доступны только для чтения и никогда не выполняются.

Часто задаваемые вопросы

Что делает навык ИИ Unity Graphics?

Unity 6 graphics and rendering guide. Use when working with render pipelines (URP, HDRP, Built-in), shaders, Shader Graph, materials, textures, cameras, post-processing, or rendering optimization. Covers Render Graph, batching, draw call optimization, and GPU instancing. Based on Unity 6.3 LTS documentation.

Зачем использовать Unity Graphics в TypingMind?

Потому что вы устанавливаете навык один раз и используете его с любой моделью. Unity Graphics — это обычный текст в формате Markdown, а не код для конкретного поставщика, поэтому один и тот же навык работает с GPT-5, Claude, Gemini, Grok или локальной моделью. Вы можете менять модель прямо во время чата, и навык продолжит работать. TypingMind использует ваши собственные ключи API, поэтому вы платите поставщикам напрямую, а не оформляете подписку с оплатой за каждое место. Ваши навыки и чаты остаются в вашем собственном хранилище.

Как установить Unity Graphics в TypingMind?

В TypingMind откройте «Плагины → Навыки → Установить из GitHub» и вставьте https://github.com/Nice-Wolf-Studio/unity-claude-skills/tree/main/skills/unity-graphics. TypingMind прочитает файл SKILL.md, включит сопутствующие файлы в пакет и установит навык, который можно включать отдельно для каждого чата.

Какие модели ИИ могут использовать Unity Graphics?

Любая модель, которую вы подключите в TypingMind. Навыки ИИ — это обычные инструкции в формате Markdown, а не код для конкретного поставщика, поэтому GPT, Claude, Gemini, Grok и локальные модели могут загружать этот навык, когда запрос ему соответствует.

Со сколькими моделями ИИ можно использовать Unity Graphics?

С любым количеством. Если модель поддерживает навыки, вы можете использовать с ней Unity Graphics: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama и другие — всё в TypingMind с вашими собственными ключами API.

Бесплатен ли навык ИИ Unity Graphics?

Да. Навык опубликован на GitHub автором Nice-Wolf-Studio по лицензии MIT. Вы платите только своему поставщику ИИ за использованные токены.

Что такое навыки ИИ?

Навык ИИ — это многоразовый набор инструкций, который объясняет модели ИИ, как выполнять конкретную задачу. Он соответствует открытому формату Agent Skills: файл SKILL.md с названием и описанием, а также любые скрипты, шаблоны или справочные файлы, которые могут понадобиться модели. Модель читает инструкции, только когда ваш запрос соответствует навыку, поэтому установленный навык ничего не стоит, пока не используется.

Чем навыки ИИ отличаются от плагинов и серверов MCP?

Плагин или сервер MCP даёт модели новые инструменты для вызова — код, который где-то выполняется и возвращает результат. Навык ИИ вместо этого даёт модели знания и порядок действий: как подойти к задаче, какие шаги выполнить и каким должен быть хороший результат. Навыки — это обычный текст в формате Markdown, поэтому им не нужны сервер, ключ API или среда выполнения, и они работают с любой моделью.

Все

Создайте свою рабочую ИИ-среду сейчас

Подпишитесь на нашу рассылку, чтобы узнавать о новых функциях и предстоящих розыгрышах 👇