Coder Social home page Coder Social logo

urp_toon's Introduction

URP Toon Shader

Introduction

基于URP的通用卡通着色器,使用URP标准的PBR模型(Minimalist CookTorrance BRDF)进行改造,纯代码实现,没有使用ShaderGraph,兼容SPR Batch.
Universal Toon shader based on URP , use PBR lighting(Minimalist CookTorrance BRDF) in URP,use code without ShaderGraph,SPR Batch Compatible.

  • Unity 2019.3.15+、URP 7.4.1+

image-UnityChan

Properties

SurfaceOptions

image-SurfaceOptions

  • Workflow Mode : Specular or Metallic
  • Render Face : Front Back Both (For Forward Pass)
  • Alpha Clipping : ClipMask(裁剪遮罩),Threshold(阈值)
  • Stencil : 模板测试,用于实现眼睛的遮挡效果,参考UTS(Stencil Test,used to achieve transparent effects for toon eyes,reference from UTS)
  • Stencil Type : Mask-写入缓冲的物体,渲染队列要比Out优先(Things that want to write to the buffer,Render Queue Less than "Out"):
    Stencil {
    Ref[_StencilChannel]
    Comp Always
    Pass Replace
    Fail Replace
    }
    Out-从缓冲读取的物体(Read from the buffer)
    Stencil {
    Ref[_StencilChannel]
    Comp NotEqual
    Pass Keep
    Fail Keep
    }
    Stencil Channel : 1-255

Base

image-Base

Shadow

image-Shadow

  • ShadeMap : 用于全局照明颜色
  • UseRampMapShadow : 使用RampMap控制阴影衰减。
  • VOffset : RampMap采样的V坐标
  • ShadowMinus : 用于淡化阴影颜色
  • ShadowStep : 阴影阈值
  • ShadowFeather : 阴影羽化值
  • EnableInShadowMap : 固定阴影贴图
  • Receive Shadow : 接收阴影(ShadowCoord)

Specular

image-Specular

  • Specular
  • SpecularStep : 高光阈值
  • SpecularFeather : 高光羽化
  • Smoothness : 光滑度
  • HairSpecular : 各向异性头发高光
  • HairShiftMap : 切线偏移图、偏移强度
  • SpecularShift : 第一层高光偏移量
  • SpecularShiftSec : 第二层高光偏移量
  • SpecularSecMul : 第二层高光强度(*Specular)
  • SmoothnessSecMul : 第二层光滑度(*First Smoothness)
  • EnablesSpecularHighlights : 是否使用高光

Rim

image-Rim

  • EnbleRim :启用边缘光
  • BlendRim : 颜色插值
  • RimColor
  • RimPower : 强度
  • RimStep
  • RimFeather

Outline

image-Outline

AdvancedOptions

image-AdvancedOptions

  • Environment Reflections : 是否接收反射
  • Enable GPU Instancing : 使用GPU Instancing合批
  • RenderQueue : 渲染队列

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

Licenses

MIT

"Assets/UnityChan/License"

© Unity Technologies Japan/UCL

urp_toon's People

Contributors

chilimilk avatar

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.