/toon-rp

🌔 A Scriptable Render Pipeline (SRP) designed for toon/stylized visuals (WIP).

Primary LanguageC#MIT LicenseMIT

Toon Render Pipeline (Unity SRP)

GitHub release (latest SemVer including pre-releases) GitHub license

A Scriptable Render Pipeline (SRP) designed specifically for toon/stylized visuals.

The project is in its very early stages and has not been tested in production.

Main

Unity Version

Developed and verified with Unity 2021.3.15f1 LTS and Core RP Library v12.1.8.

Table of Contents

Installation

1. Add the package

Option 1

  • Open Package Manager through Window/Package Manager
  • Click "+" and choose "Add package from git URL..."
  • Insert the URL:
https://github.com/Delt06/toon-rp.git?path=Packages/com.deltation.toon-rp

Option 2

Add the following line to Packages/manifest.json:

"com.deltation.toon-rp": "https://github.com/Delt06/toon-rp.git?path=Packages/com.deltation.toon-rp",

2. Create a pipeline asset

Inside the Project window, right click and select Create/Rendering/Toon Render Pipeline Asset.

3. Set the pipeline asset

Go to Edit/Project Settings/Graphics and set the field Scriptable Render Pipeline Settings with the newly created pipeline asset.

Features

  • Toon Shader
    • Globally/locally configurable ramp
    • Alpha Clipping and Transparency
    • Normal Map
    • GPU Instancing
    • SRP Batcher Support

Toon Shader

  • Crisp anti-aliased ramp

Crisp AA Ramp

  • Variance Shadow Mapping (VSM)
    • Optional: crisp anti-aliased ramp
    • Optional: up to four cascades

VSM

  • Blob Shadows
    • Optional: crisp anti-aliased ramp

Blob Shadows

  • Additional Lights

Additional Lights

  • MSAA

MSAA

  • FXAA
    • Optional: low quality variant, about 1.5-2 times faster

FXAA

  • HDR
  • Bloom
    • Optional: stylized pattern

Bloom

  • Light Scattering (Post FX)

Light Scattering

  • Outline (Inverted Hull)
    • Distance fade
    • Optional: get normals from a custom channel to improve outlines quality. Comes with a utility to bake these custom normals.
    • Optional: remove inner outlines via stencil.
    • Optional: randomize thickness.

Outline (Inverted Hull)

Outline Fade

  • Outline (Screen Space)
    • Based on colors, normals, and depth.

Outline (Screen Space)

  • SSAO
    • Optional: stylized pattern

SSAO

  • Fog:
    • Affects the outlines too

Fog

  • Matcap:
    • Additive (e.g., fake lighting)
    • Multiplicative: (e.g., fake reflections)

Matcap: Additive

Matcap: Multiplicative

References

Used Assets