From 80f5174b732e028854f8f6f7d82f24fdf6404215 Mon Sep 17 00:00:00 2001 From: yum Date: Mon, 4 Nov 2024 01:03:26 -0800 Subject: Specular lighting now wraps --- MochieStandardBRDF.cginc | 5 +++++ 1 file changed, 5 insertions(+) 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); } -- cgit v1.2.3