Skip to content

A Toon Shader in Unity Universal Render Pipeline.

License

Notifications You must be signed in to change notification settings

YanTree/URP_Toon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

88 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

URP Toon Shader

Introduction

Simple toon shader in unity universal pipeline.

image-UnityChan

Properties

SurfaceOptions

image-SurfaceOptions

Base

image-Base

Shadow

image-Shadow

ShadowType

DoubleShade

Adjustable two-layer shadow.(Reference UTS)

RampMapShadow

Shadows based on rampmap.

SDF_FaceShadow (Reference Genshin Impact)

Used for face shadow, sample a precomputed shadow mask to generate shadows. Limit:symmetrical face uv.

SDFMask

Need to add a script to the object, set the forward and left direction(ObjectSpace).

SDFScript

About how to generate sdf shadow mask. Node:Generate mask in r16 format(antialiasing).

https://zhuanlan.zhihu.com/p/389668800

SSAO (Add "ScreenSpaceAmbientOcclusion" RenderFeature)

Control SSAO strength.

CastHairShadowMask (Add "RenderFrontHairShadowMaskFeature" RenderFeature)

Cast a shadow mask in screen space for face shadow.(Check it on front hair material or something)

ReceiveHairShadowMask

Sample "CastHairShadowMask" for shadow.(Check it on face material)

Specular

image-Specular

Rim

image-Rim

  • BlendRim
    image-BlendRim Left:BlendRim=0 Right:BlendRim=1

Outline

image-Outline

AdvancedOptions

image-AdvancedOptions

Multi Pass Batch

In the default URP, if render multiple pass shaders(outline), the Rendering order like this:
Object1.Pass1-
Objcet1.Pass2-
Object2.Pass1-
Object2.Pass2......
image-BeforeBatch
It will stop SPRBatch.
image-NotSupportBatch
We can change the Rendering order like this by using RenderFeature:
Object1.Pass1-
Objcet2.Pass1-
Object1.Pass2-
Object2.Pass2......
image-AfterBatch

Reference

https://github.com/unity3d-jp/UnityChanToonShaderVer2_Project
https://github.com/Jason-Ma-233/JasonMaToonRenderPipeline
https://github.com/you-ri/LiliumToonGraph
https://github.com/Kink3d/kShading
https://unity.cn/projects/china-unity-tech-week_linruofeng

Licenses

MIT

"Assets/UnityChan/License"

© Unity Technologies Japan/UCL

About

A Toon Shader in Unity Universal Render Pipeline.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 54.1%
  • HLSL 27.6%
  • ShaderLab 18.3%