GithubHelp home page GithubHelp logo

kyapp69 / urp-toon-shader Goto Github PK

View Code? Open in Web Editor NEW

This project forked from delt06/urp-toon-shader

0.0 1.0 0.0 77.08 MB

๐ŸŒ” Toon shader for Unity's Universal Rendering Pipeline.

License: MIT License

ShaderLab 35.79% C# 27.35% HLSL 36.86%

urp-toon-shader's Introduction

URP Toon Shader for Unity

A toon shader compatible with the Universal Rendering Pipeline.

Developed and verified with Unity 2020.3.0f1 LTS and URP package 10.3.2

Main

Table of Contents

Toon Shader Capabilities
Toon Shader (Lite) Capabilities
Inverted Hull Outline
Installation
Documentation
Examples
Performance Benchmark
Used Assets

Toon Shader Capabilities

Toon Icon

Surface

  • Opaque/Transparent with blending modes:
    • Alpha/Premultiply/Additive/Multiply
  • Alpha Clipping
  • Culling
    • Back/Front/Off

Color

  • 2 or 3-step ramp with configurable thresholds and smoothness
  • Ramp textures
  • Normal Maps
  • Main light
  • Additional lights
    • per-vertex or per-pixel, depending on URP settings
    • optional specular highlights
  • Casting and receiving shadows
  • Configurable shadow color (both in multiplicative and "pure" modes)
  • Emission
  • Rim lighting (Fresnel effect) and specular highlights with HDR color support (e.g. for bloom)
  • Anisotropic specular (e.g. for hair)
  • Fog
  • SSAO
  • Environment Lighting
  • Baked lights and shadows
    • Dynamically receive via light probes
    • Contribute to bake process ("meta" pass)
  • Vertex Color

Performance

  • SRP Batcher compatibility
  • GPU Instancing

Toon Shader (Lite) Capabilities

Toon Lite Icon

Color

  • 2-step ramp with configurable threshold and smoothness
  • Main light (per-vertex or per-pixel)
  • Casting shadows
  • Configurable shadow color
  • Fog
  • Vertex Color

Performance

  • SRP Batcher compatibility
  • GPU Instancing

Inverted Hull Outline

A simple and performant outline shader. Renders outlines of objects on certain layers via a Renderer Feature.

Inverted Hull Outline

Installation

Option 1

Option 2

Add the following line to Packages/manifest.json:

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

Documentation

Forest Demo Breakdown

Examples

Toony Tiny City Demo

Anime Character: Arisa

warrior

fur

Performance Benchmark

Lit vs. URP Toon Shader vs. Toony Colors Pro (Hybrid)

The results are obtained with Mali Offline Compiler.

Shader Type Vertex Shader Cycles (L/S) Fragment Shader Cycles (L/S)
Lit 9 15
URP Toon Shader 12 10
Toony Colors Pro (Hybrid) 7 15

L/S = Load/Store.

Configuration

Hardware: Mali-G78 r1p1
Architecture: Valhall
Driver: r25p0-00rel0

Enabled keywords

Lit:

Global Keywords: FOG_LINEAR _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE  _SHADOWS_SOFT
Local Keywords: _EMISSION

URP Toon Shader:

Global Keywords: FOG_LINEAR _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _SHADOWS_SOFT 
Local Keywords: _ADDITIONAL_LIGHTS_ENABLED _ENVIRONMENT_LIGHTING_ENABLED _FOG _FRESNEL _RAMP_TRIPLE _SPECULAR

Toony Colors Pro (Hybrid)

Global Keywords: FOG_LINEAR TCP2_HYBRID_URP _ADDITIONAL_LIGHTS _ADDITIONAL_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _SHADOWS_SOFT 
Local Keywords: TCP2_REFLECTIONS_FRESNEL TCP2_RIM_LIGHTING_LIGHTMASK TCP2_SHADOW_LIGHT_COLOR

Used Assets

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.