28 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: ToonShaderModel
date: 2023-12-18 10:00:34
excerpt:
tags:
rating: ⭐
---
# ToonStandardCel打底
## Diffuse
```c++
//Lighting.Diffuse *= AreaLight.FalloffColor * (Falloff * HalfLambert);
//TODO:添加阴影过渡效果。
//ToonShadow添加类型1.PBR(只能调整过渡颜色) Lighting.Diffuse = DiffuseColor * (1 / PI) * AreaLight.FalloffColor * (Falloff * HalfLambert); 2.ShadowColorTexture兼容RampTexture效果也就是原神的效果还需要添加ShadowColorIntensity后需要改成曝光相关额东西。Lighting.Diffuse = DiffuseColor * (1 / PI);
//ToonLighting添加类型1.PBR多光源模式2.主光有效针对cel。
//---------------------------------------------------------
//Specular
//ToonSpecular添加类型1.PBR 2. 各项异性defaultLit3. 各项异性头发 4. 自定义高光大小与过渡效果 https://zhuanlan.zhihu.com/p/361918341 5.自定义高光形状贴图 https://zhuanlan.zhihu.com/p/640258070 https://github.com/AnCG7/URPShaderCodeSample/blob/891034b3fa6e838e2b231390755479f0f649f181/Assets/Shaders/NPR/Cartoon/Stylized%20Highlight%20(Transform).shader#L2
```
ToonShadow
1. PBR为了兼容默认阴影效果。
2. ShadowColorTexture
实现阴影偏移以及阴影羽化效果。
## Specular
# 厚涂 ShaderModel通过修改预积分ShaderModel