设计与多媒体

2d-pixel-perfect

unity-technolog…s/skills

Sets up, diagnoses, and fixes pixel perfect 2D rendering with PixelPerfectCamera in URP or Built-in. Use when a retro-style or pixel art 2D game looks blurry, jittery, or misaligned. Not for HD 2D or high-resolution art.

  • 3686 次安装
  • 1200 星标
  • 收录于

安装命令

npx skills add https://github.com/unity-technologies/skills --skill 2d-pixel-perfect

SKILL.md

Set up, diagnose, and fix pixel perfect 2D rendering in Unity projects.


⚠ There Are Two Completely Separate Implementations

Pixel perfect rendering in Unity is not one system — it is two separate, incompatible implementations, one per render pipeline. Always detect the pipeline before writing or diagnosing any code.

URP Built-in
Component UnityEngine.Rendering.Universal.PixelPerfectCamera UnityEngine.U2D.PixelPerfectCamera
Package Built into URP — no extra install com.unity.2d.pixel-perfect v6.0.0+
API style Enums (gridSnapping, cropFrame) Booleans (pixelSnapping, upscaleRT, cropFrameX/Y)

Do not install com.unity.2d.pixel-perfect in a URP project.

→ Always call DetectPipeline() first (references/pipeline-detection.cs), then branch your setup, diagnostics, and fixes based on the result.


Set up, diagnose, and fix pixel perfect 2D rendering in Unity projects.


⚠ There Are Two Completely Separate Implementations

Pixel perfect rendering in Unity is not one system — it is two separate, incompatible implementations, one per render pipeline. Always detect the pipeline before writing or diagnosing any code.

URP Built-in
Component UnityEngine.Rendering.Universal.PixelPerfectCamera UnityEngine.U2D.PixelPerfectCamera
Package Built into URP — no extra install com.unity.2d.pixel-perfect v6.0.0+
API style Enums (gridSnapping, cropFrame) Booleans (pixelSnapping, upscaleRT, cropFrameX/Y)

Do not install com.unity.2d.pixel-perfect in a URP project.

→ Always call DetectPipeline() first (references/pipeline-detection.cs), then branch your setup, diagnostics, and fixes based on the result.