Skip to content

A Unity implementation of Texel Splatting, a 3D to pixel art pipeline

Notifications You must be signed in to change notification settings

TomMoore515/TexelSplatting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Texel Splatting

This project implements Texel Splatting, a 3D to pixel art pipeline, in Unity.

This implementation is based on research by IndividualKex and adapted for use within the Unity engine. IndividualKex is currently writing a formal research paper on the technique which I will link here once it is published.

image

Requirements

  • Unity 6.3
  • Universal Render Pipeline 17

Installation

Via Unity Package Manager (Git URL)

  1. Open Window > Package Manager
  2. Click the + button in the top-left
  3. Select Add package from git URL...
  4. Enter:
    https://github.com/TomMoore515/TexelSplatting.git?path=/Assets/TexelSplatting
    

Manual Installation

Copy the Assets/TexelSplatting folder into your project's Assets directory.

Setup

  1. Add the Texel Splatting Feature to your URP Renderer:

    • Select your URP Renderer Asset
    • Click Add Renderer Feature > Texel Splatting Feature
  2. Add the Texel Splatting Controller to your Main Camera:

    • Select your Main Camera
    • Click Add Component > Texel Splatting Controller

How It Works

Texel Splatting converts a 3D scene into a stable pixel art image by capturing the world from a fixed probe and re-projecting it as flat, texel splats (posterized billboard quads).

  1. Probe Capture Six cameras arranged as a cubemap render the scene from a grid-snapped point near the main camera. Snapping to a grid prevents sub-pixel jitter between frames, which is what eliminates shimmer. To optimize things, faces are lazily rendered as they become visible to the main camera, and results are cached until the probe moves to a new grid cell.

  2. Depth Linearization Each probe face's depth buffer is converted from non-linear Z to linear eye depth via a blit pass. This is needed for accurate world-space reconstruction in the next step.

  3. Splat Generation (compute shader) Every texel of every active probe face is unprojected into world space using the linearized depth and the face's inverse view matrix. The resulting color is posterized (quantized to a fixed number of levels), and a splat (position, size, color) is appended to a GPU buffer. Any splats outside the main camera's frustum are culled.

  4. Billboard Rendering The splat buffer is drawn with DrawMeshInstancedIndirect. Each splat becomes a camera-facing quad whose size is proportional to its distance from the probe, scaled up slightly to close gaps between neighbors.

  5. Compositing The splat render target is blitted over the camera image. Where splats cover the screen, their flat color is used directly. Gaps (disocclusion) fall back to a posterized cubemap captured from the main camera's position, giving a stable pixel art background.

Contributing

Contributions to this project are welcome! I probably won't be actively developing this project myself, but I will review and merge any pull requests which are submitted.

Issues won't be addressed, only pull requests containing contributions.

About

A Unity implementation of Texel Splatting, a 3D to pixel art pipeline

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages