vault backup: 2025-02-06 22:31:20
This commit is contained in:
parent
8e9daf7717
commit
d75d8e0c62
@ -455,6 +455,27 @@ FDirectLighting ToonBxDF(FGBufferData GBuffer, half3 N, half3 V, half3 L, float
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Diffuse
|
||||||
|
```c++
|
||||||
|
...
|
||||||
|
float3 LightColorAndAttenuation = AreaLight.FalloffColor * MooaToonContext.LightColor * Falloff;
|
||||||
|
ColorSaturationPowerAndScale(LightColorAndAttenuation, View.MooaLightSaturationScale);
|
||||||
|
...
|
||||||
|
...
|
||||||
|
float DiffuseColorRampU = min3(saturate(Shadow.SurfaceShadow + HairShadowOffset), GBuffer.GBufferAO, ShadowGradient);
|
||||||
|
half4 DiffuseColorRamp = SampleGlobalRamp(View.MooaGlobalDiffuseColorRampAtlas, DiffuseColorRampU, ToonGBuffer.DiffuseColorRampIndex, View.MooaGlobalDiffuseColorRampAtlasHeight);
|
||||||
|
Shadow.SurfaceShadow = DiffuseColorRampU;
|
||||||
|
|
||||||
|
half3 ToonDiffuseColor = GBuffer.DiffuseColor;
|
||||||
|
half3 ToonShadowColor = ToonGBuffer.MainLightShadowColor * (1 - GBuffer.Metallic) * GetShadowColorIntensity(MooaToonContext);
|
||||||
|
#if USE_DEVELOPMENT_SHADERS
|
||||||
|
ToonShadowColor *= View.DiffuseOverrideParameter.w + View.DiffuseOverrideParameter.xyz;
|
||||||
|
#endif
|
||||||
|
ToonDiffuseColor = lerp(ToonShadowColor, ToonDiffuseColor, DiffuseColorRamp.a);
|
||||||
|
|
||||||
|
Lighting.Diffuse = Diffuse_Lambert(ToonDiffuseColor) * DiffuseColorRamp.rgb * LightColorAndAttenuation;
|
||||||
|
```
|
||||||
|
|
||||||
# 实用函数
|
# 实用函数
|
||||||
如果需要脸部SDF阴影,就覆盖ShadowGradient。
|
如果需要脸部SDF阴影,就覆盖ShadowGradient。
|
||||||
```c++
|
```c++
|
||||||
|
Loading…
x
Reference in New Issue
Block a user