# 2d Pixel Perfect

Sets up, diagnoses, and fixes pixel perfect 2D rendering with PixelPerfectCamera in URP...

- Repository: https://github.com/Unity-Technologies/skills (1197 stars)
- Category: Engineering
- License: see repository
- Last updated: 2026-10-30
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add Unity-Technologies/skills --skill 2d-pixel-perfect -g -a claude-code -y`
Codex: `npx skills add Unity-Technologies/skills --skill 2d-pixel-perfect -g -a codex -y`
Cursor: `npx skills add Unity-Technologies/skills --skill 2d-pixel-perfect -g -a cursor -y`
Gemini CLI: `npx skills add Unity-Technologies/skills --skill 2d-pixel-perfect -g -a gemini-cli -y`

## Description

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.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

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.

---

## When NOT to use this skill

- **HD 2D or high-resolution 2D games**, pixel snapping and point filtering will make smooth art look wrong
- **UI-only scenes**, use Canvas Scaler instead
- **HDRP projects**, Pixel Perfect Camera is not supported

---

## Critical Reminders

⚠ **Detect the render pipeline first**, URP and Built-in use different Pixel Perfect Camera components that are not interchangeable.
⚠ **Filter Mode = Point is the #1 fix**, bilinear filtering is Unity's default and is almost always the cause of blurry sprites.
⚠ **Anti-Aliasing must be disabled**, in Quality Settings and on the camera. AA actively blurs pixel edges.

## Key Principles

### 1. Pipeline Detection & Camera Component Selection

See the two-path comparison table at the top of this file. Assembly name note: the standalone Built-in package installs into a `Runtime/` folder, but the asmdef `"name"` field is `Unity.2D.PixelPerfect`, no `Runtime` suffix. HDRP is unsupported, see the HDRP fallback section under Common Issues.

The rest: https://github.com/Unity-Technologies/skills/blob/HEAD/skills/2d-pixel-perfect/SKILL.md
