ABOUT PORTFOLIO GAMES DEVLOG DOCS TOOLS CONTACT
HOME > DOCS > Shader / URP > 3D 씬의 실시간 2D 픽셀 아트화 (Low-Res RenderTexture & Point Upscaling)Real-Time 3D-to-2D Pixel Art Pipeline (Low-Res RenderTexture & Point Upscaling)
Shader / URP Intermediate Unity 2022.3+ / Unity 6 (URP)

3D 씬의 실시간 2D 픽셀 아트화 (Low-Res RenderTexture & Point Upscaling)Real-Time 3D-to-2D Pixel Art Pipeline (Low-Res RenderTexture & Point Upscaling)

3D 지형과 애니메이션 모델을 320x180 저해상도 RenderTexture에 렌더링한 뒤 Nearest-Neighbor(Point) 필터로 디스플레이에 선명하게 업스케일하는 렌더링 파이프라인.A rendering pipeline that renders 3D environments and animated models into a low-resolution 320x180 RenderTexture and upscales them cleanly to the display using Nearest-Neighbor (Point) filtering.

#Shader #URP #3D-to-2D #PixelArt #RenderTexture #Retro
핵심 개념*A Short Hike*, *Signalis*, *Dead Cells* 등에서는 3D 조명·물리·카메라 시스템을 활용하면서도, 화면 전체를 저해상도 RenderTexture(예: 320×180, 480×270)에 렌더링한 후 FilterMode.Point로 확대 출력하여 실시간 도트 픽셀 아트 스타일을 구현합니다.
Core ConceptGames such as *A Short Hike*, *Signalis*, and *Dead Cells* leverage 3D lighting, physics, and camera systems while rendering the entire frame into a low-resolution RenderTexture (e.g., 320×180 or 480×270) and upscaling it with FilterMode.Point to achieve a real-time pixel art presentation.

1. 실시간 저해상도 픽셀 다운샘플링 컨트롤러1. Real-Time Low-Resolution Pixel Downsampling Controller

PixelArtRenderFeatureController.cs
using UnityEngine;
using UnityEngine.UI;

[RequireComponent(typeof(Camera))]
public class PixelArtRenderFeatureController : MonoBehaviour
{
    [Header("타겟 저해상도 (레트로 해상도)")]
    [SerializeField] private int targetWidth = 320;
    [SerializeField] private int targetHeight = 180;

    [Header("출력 캔버스 RawImage (전체 화면)")]
    [SerializeField] private RawImage displayScreen;

    private RenderTexture _pixelRenderTexture;
    private Camera _camera;

    private void Awake()
    {
        _camera = GetComponent<Camera>();
        CreatePixelRenderTexture();
    }

    private void CreatePixelRenderTexture()
    {
        // 1. 기존 텍스처 해제
        if (_pixelRenderTexture != null)
        {
            _camera.targetTexture = null;
            _pixelRenderTexture.Release();
        }

        // 2. 도트 경계 유지를 위한 FilterMode.Point 설정 (바이리니어 블러 제거)
        _pixelRenderTexture = new RenderTexture(targetWidth, targetHeight, 24, RenderTextureFormat.ARGB32)
        {
            filterMode = FilterMode.Point,
            antiAliasing = 1, // 안티앨리어싱 비활성화
            useMipMap = false
        };
        _pixelRenderTexture.Create();

        // 3. 카메라 타겟 바인딩
        _camera.targetTexture = _pixelRenderTexture;

        // 4. UI 캔버스 RawImage로 풀스크린 전송
        if (displayScreen != null)
        {
            displayScreen.texture = _pixelRenderTexture;
        }
    }

    private void OnDestroy()
    {
        if (_pixelRenderTexture != null)
        {
            _pixelRenderTexture.Release();
            Destroy(_pixelRenderTexture);
        }
    }
}
PixelArtRenderFeatureController.cs
using UnityEngine;
using UnityEngine.UI;

[RequireComponent(typeof(Camera))]
public class PixelArtRenderFeatureController : MonoBehaviour
{
    [Header("Target Low Resolution (Retro Resolution)")]
    [SerializeField] private int targetWidth = 320;
    [SerializeField] private int targetHeight = 180;

    [Header("Output Canvas RawImage (Full Screen)")]
    [SerializeField] private RawImage displayScreen;

    private RenderTexture _pixelRenderTexture;
    private Camera _camera;

    private void Awake()
    {
        _camera = GetComponent<Camera>();
        CreatePixelRenderTexture();
    }

    private void CreatePixelRenderTexture()
    {
        // 1. Release existing RenderTexture
        if (_pixelRenderTexture != null)
        {
            _camera.targetTexture = null;
            _pixelRenderTexture.Release();
        }

        // 2. Set FilterMode.Point to preserve crisp pixel edges (disable bilinear blur)
        _pixelRenderTexture = new RenderTexture(targetWidth, targetHeight, 24, RenderTextureFormat.ARGB32)
        {
            filterMode = FilterMode.Point,
            antiAliasing = 1, // Disable anti-aliasing
            useMipMap = false
        };
        _pixelRenderTexture.Create();

        // 3. Bind camera target texture
        _camera.targetTexture = _pixelRenderTexture;

        // 4. Output to full-screen UI Canvas RawImage
        if (displayScreen != null)
        {
            displayScreen.texture = _pixelRenderTexture;
        }
    }

    private void OnDestroy()
    {
        if (_pixelRenderTexture != null)
        {
            _pixelRenderTexture.Release();
            Destroy(_pixelRenderTexture);
        }
    }
}

2. 픽셀 일관성을 위한 URP 렌더러 필수 세팅2. Essential URP Renderer Settings for Pixel Consistency

  • 오소그래픽(Orthographic) 카메라 사용: 원근 왜곡(Perspective)이 있으면 카메라와 가까운 오브젝트의 픽셀 그리드가 커지고 멀리 있는 픽셀이 촘촘해져 도트 크기가 달라집니다. 일정한 픽셀 밀도(Pixel Density)를 유지하려면 직교 투영 카메라를 사용하는 것이 적합합니다.
  • MSAA 비활성화: URP 에셋 설정에서 Anti-Aliasing을 Off로 변경해야 3D 모델 외곽선에 반투명 보간 픽셀이 섞이지 않고 선명한 도트 경계가 유지됩니다.
  • 텍스처 밉맵 제거: 3D 모델에 적용된 텍스처의 Mipmap을 끄거나 바이어스를 조정해야 원거리에서도 텍스처가 흐려지지 않고 픽셀 경계가 보존됩니다.
  • Use an Orthographic Camera: Perspective projection causes objects near the camera to display larger pixel grids than distant objects. Using an orthographic camera maintains uniform pixel density across the scene.
  • Disable MSAA: Set Anti-Aliasing to Off in the URP Asset settings so that 3D model silhouettes retain crisp pixel steps without interpolated edge blending.
  • Disable Texture Mipmaps: Turn off Mipmaps on textures applied to 3D models so surface details remain sharp rather than blurring at oblique angles or distances.

저해상도 RenderTexture와 Point 필터 업스케일링을 조합하면 3D 에셋 워크플로우를 유지하면서도 일관된 해상도의 2D 픽셀 아트 화면을 구성할 수 있습니다.

Combining a low-resolution RenderTexture with Point-filtered upscaling preserves a 3D asset workflow while producing a consistent 2D pixel art output.

참고자료 & 관련 링크