Overview

Pixel Perfect Camera is Unity’s camera-side helper for keeping pixel art aligned cleanly to the screen’s pixel grid. It sits on the camera, not on the sprite and not on the Tilemap Renderer. That means it solves a different problem from import settings such as Filter Mode: Point or correct Pixels Per Unit. Unity’s current 2D art guidance treats camera, sprite workflow, tilemaps, and rendering as one connected 2D pipeline rather than isolated settings pages (Unity, How to Make a 2D Game: Art, Animation, and Lighting for Artists, see source-unity-2d-art-animation-lighting).

In practice the component works out an integer zoom (how many screen pixels each art pixel covers: 2×, 3×, 4× and so on) from the screen size and your Reference Resolution, and then sets the camera’s orthographic size for you. Integer scaling is what keeps every art pixel the same size on screen. (This description follows the component’s source code in Unity’s URP package, where the zoom is the smaller of the horizontal and vertical whole-number ratios and the orthographic size is derived from it.)

Which version? In Unity 6 with URP, the Pixel Perfect Camera is part of URP and is included by default in projects made from the Universal 2D template. Unity warns not to install the separate 2D Pixel Perfect package, which works only with the Built-in Render Pipeline (Unity Technologies, Unity Manual: Scale and rotate pixel art precisely in URP).

Setup

Typical workflow:

  1. Import sprites correctly using unity-pixel-art-pipeline: Filter Mode: Point, Compression: None, and the same Pixels Per Unit on every sprite. Unity also recommends setting each sprite’s pivot to Custom with Pivot Unit Mode: Pixels, so pivots sit on whole pixels (Unity Technologies, Unity Manual: Add a pixel perfect camera).
  2. Select the main camera, Add Component, type pixel, and add Pixel Perfect Camera.
  3. Set Assets Pixels Per Unit to the same value as your sprites’ Pixels Per Unit.
  4. Set Reference Resolution to the pixel-art resolution of your game, for example 320 × 180. The camera then shows 320 sprite pixels across and 180 down (Unity Technologies, Unity Manual: Add a pixel perfect camera).
  5. Build the level with unity-tilemap if the environment is tile-based.
  6. In the Scene view’s Grid and Snap overlay, set Grid Size to 1 ÷ Assets Pixels Per Unit (0.0625 for PPU 16) and enable grid snapping, so objects you place by hand land on whole pixels (Unity Technologies, Unity Manual: Add a pixel perfect camera).
  7. Test the final result in the actual Game view resolution you plan to ship.
WhereSettingRecommended valueWhy
Sprite / tileset importFilter ModePoint (no filter)No smoothing between pixels
Sprite / tileset importCompressionNoneNo compression artefacts
Sprite / tileset importPixels Per UnitOne project-wide value, usually the tile size (e.g. 16)Every texel is the same size in the world
Pixel Perfect CameraAssets Pixels Per UnitSame as the sprite PPUThe component’s maths assumes it
Pixel Perfect CameraReference ResolutionYour native art resolution, e.g. 320 × 180 or 640 × 360320 × 180 scales by exactly 6× to 1920 × 1080 and 12× to 3840 × 2160
Pixel Perfect CameraCrop FrameNone to start; Windowbox or Letterbox/Pillarbox if you must keep exactly the reference view on every screen; Stretch Fill to fill the screenSee below
Pixel Perfect CameraGrid SnappingUpscale Render Texture for the most faithful retro look; Pixel Snapping if you want smooth high-resolution rotationSee below
Pixel Perfect CameraFilter Mode (Stretch Fill only)Point for sharpest pixels; Retro AA to reduce shimmerDefault is Retro AA
URP Asset (Quality)Anti Aliasing (MSAA)DisabledPractice recommendation: MSAA softens sprite edges and does nothing useful for pixel art
CameraPost-processing Anti-aliasingNonePractice recommendation: FXAA/SMAA blur pixel edges
URP Asset (Quality)Render Scale1.0Crop Frame and Upscale Render Texture are not supported at other values
Camera rendererRenderer2D RendererURP’s Pixel Perfect Camera requires it

The import and component rows follow Unity’s manual pages cited above. The Render Scale and 2D Renderer rows come from warnings built into the component’s Inspector in Unity’s URP package source (“URP Pixel Perfect Camera requires a camera using a 2D Renderer”; “Crop Frame and Upscale Render Texture are not supported when Render Scale is not 1.0”). The two anti-aliasing rows are common pixel-art practice rather than a statement in Unity’s Pixel Perfect Camera documentation, so treat them as a strong recommendation that you confirm by eye.

Usage

Where the setting actually belongs

If a student asks whether Pixel Perfect Camera settings belong on the sprite or the Tilemap renderer, the practical answer is:

  • Sprite import settings control how the art is imported.
  • Tilemap Renderer controls how the tilemap layer is drawn.
  • Pixel Perfect Camera belongs on the camera.

So the “pixel perfect” result comes from several layers working together, but the camera component itself is still a camera tool. There is no “Pixel Perfect” checkbox on the Sprite Renderer or the Tilemap Renderer; the “Pixel Perfect” checkbox that does exist belongs to a UI Canvas in Screen Space mode and has nothing to do with sprites in the world.

Pixel Perfect Camera vs sprite import settings

Use both:

  • Filter Mode: Point
  • Compression: None
  • matching Pixels Per Unit
  • a camera configured for pixel-perfect presentation

If the import settings are wrong, the camera cannot rescue blurry art. If the import settings are right but the camera scales awkwardly, the result can still shimmer or look uneven.

Component properties explained

Unity’s component reference lists these properties (Unity Technologies, Unity Manual: Pixel Perfect Camera component reference for URP):

  • Asset Pixels Per Unit: how many sprite pixels make one world unit. Match it to the PPU of all sprites in the scene.
  • Reference Resolution: the screen resolution your sprites are designed for.
  • Crop Frame: adds black bars to hide areas outside the Reference Resolution’s aspect ratio. Pillarbox adds bars left and right, Letterbox top and bottom, Windowbox on all sides, and Stretch Fill stretches the camera view to fill the viewport.
  • Grid Snapping:
    • None does not align or upscale.
    • Pixel Snapping renders sprites aligned to the pixel grid so they do not sit between pixels; it does not change sprites’ Transform positions.
    • Upscale Render Texture renders the scene to a small texture at the Reference Resolution (or slightly larger for wider or taller screens) and then scales it up to the screen, giving “unaliased and unrotated pixels”.
  • Filter Mode: only used with Stretch Fill. Point keeps pixels sharp but can shimmer; Retro AA uses bilinear filtering, which softens pixel edges slightly but reduces shimmer. The default is Retro AA (Unity Technologies, Unity Manual: Configure a pixel perfect camera).
  • Current Pixel Ratio (read-only): how many times larger the sprites appear than their original size, for example 2:1.

Pixel Snapping or Upscale Render Texture?

By default Unity renders at the full screen resolution, so a rotated sprite gets smooth, high-resolution diagonal edges. Upscale Render Texture keeps rotated pixels upright and square, because everything is drawn at the low resolution first (Unity Technologies, Unity Manual: Configure a pixel perfect camera). Choose it when you want an authentic low-resolution look in which nothing, including rotation and sub-pixel motion, can be drawn finer than one art pixel. Choose Pixel Snapping when you want sprites locked to the pixel grid but are happy for rotations and effects to render at screen resolution.

Camera shimmer and wobble

Common causes of pixels that shimmer, wobble or change width as the camera moves:

  • sprites with different PPU values, or Assets Pixels Per Unit not matching them
  • a Game view or window size that is not an integer multiple of the Reference Resolution (the component also warns when it ends up rendering at an odd-numbered resolution)
  • Grid Snapping set to None while the camera follows the player at sub-pixel positions
  • Stretch Fill with Point filtering, which Unity notes can shimmer; Retro AA trades a little softness for stability
  • MSAA or post-processing anti-aliasing left on
  • a follow camera from Cinemachine that is not using Cinemachine’s Pixel Perfect extension (Unity’s setup page points to Make Cinemachine compatible with the pixel perfect camera; see cinemachine-overview)
  • camera stacking: the Inspector warns that the component “won’t function properly if stacked with another camera”

Pixel Perfect Camera and physics

Pixel Perfect Camera changes only what is drawn: orthographic size, render resolution and on-screen snapping. It does not move Transforms and does not change Collider2D shapes, so it has no effect on physics. It therefore does not matter whether you add it before or after a Tilemap Collider 2D, and it cannot make collision boundaries “crisper”. Crisp collision comes from the colliders themselves; see Colliders and physics in Unity Tilemap and unity-collider2d-and-triggers.

Gotchas

  • Pixel Perfect Camera does not replace correct import settings.
  • Apply the component to the camera you actually render through, not a random helper object.
  • Tilemaps still need consistent PPU and clean tileset slicing, otherwise gaps and scaling issues remain.
  • In a URP project, do not install the old 2D Pixel Perfect package from the Package Manager; it is for the Built-in Render Pipeline only.
  • The component sets the camera’s orthographic size itself, so changing Size on the Camera has no lasting effect. Change the Reference Resolution instead.
  • With Crop Frame and Upscale Render Texture, keep the URP Render Scale at 1.0.
  • The component does nothing for physics; see Pixel Perfect Camera and physics.

unity-pixel-art-pipeline · unity-tilemap · unity-aseprite-importer · pixel-art-environment-art · unity-urp-overview · cinemachine-overview · unity-collider2d-and-triggers · unity-2d-lighting