diff options
| author | yum <yum.food.vr@gmail.com> | 2024-11-04 01:03:26 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2024-11-04 01:04:59 -0800 |
| commit | 80f5174b732e028854f8f6f7d82f24fdf6404215 (patch) | |
| tree | e43068eb37193dafed40df2677886f4d2e1a90c9 /MochieStandardBRDF.cginc | |
| parent | b80cbe56d30e0f5a12d77dae029b883338187711 (diff) | |
Specular lighting now wraps
Diffstat (limited to 'MochieStandardBRDF.cginc')
| -rw-r--r-- | MochieStandardBRDF.cginc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/MochieStandardBRDF.cginc b/MochieStandardBRDF.cginc index 867904a..5d8026e 100644 --- a/MochieStandardBRDF.cginc +++ b/MochieStandardBRDF.cginc @@ -137,6 +137,10 @@ half4 BRDF1_Mochie_PBS ( half3 diffCol = 0; diffCol = diffColor * (gi.diffuse + light.color * lerp(diffuseTerm, wrappedDiffuse, thickness)); + // TODO this should probably use its own version of _WrappingFactor + specularTerm = saturate((specularTerm + _WrappingFactor) / + (1.0f + _WrappingFactor)) * 2 / (2 * (1 + _WrappingFactor)); + half3 specCol = specularTerm * light.color * FresnelTerm (specColor, lh) * _SpecularStrength; half3 reflCol = surfaceReduction * gi.specular * FresnelLerp (specColor, grazingTerm, lerp(1, nv, _FresnelStrength*_UseFresnel)) * reflection_strength; @@ -201,6 +205,7 @@ half4 BRDF1_Mochie_PBS ( // reflCol *= lerp(1, vertexColor, _ReflVertexColor*_ReflVertexColorStrength); // #endif +diffCol = 0; return half4(diffCol + specCol + reflCol + subsurfaceCol, 1); } |
