diff --git a/packages/custom-material/src/advanced-shader/sss/SSSFunction.glsl b/packages/custom-material/src/advanced-shader/sss/SSSFunction.glsl index 05868ed8..1345c911 100644 --- a/packages/custom-material/src/advanced-shader/sss/SSSFunction.glsl +++ b/packages/custom-material/src/advanced-shader/sss/SSSFunction.glsl @@ -41,14 +41,14 @@ if (all(lessThanEqual(abs(x0), x1))) return scale * y + bias; } -// Normalized SG +// Normalized sg FsphericalGaussian makeNormalizedSG(vec3 lightdir , vec3 sharpness) { -FsphericalGaussian SG; -SG.Axis = lightdir; -SG.Sharpness = sharpness; -SG.Amplitude = SG.Sharpness /((2.0 * PI) * (1.0 - exp(-2.0 * SG.Sharpness))); -return SG; +FsphericalGaussian sg; +sg.Axis = lightdir; +sg.Sharpness = sharpness; +sg.Amplitude = sg.Sharpness /((2.0 * PI) * (1.0 - exp(-2.0 * sg.Sharpness))); +return sg; } vec3 sgdiffuseLighting(vec3 light ,vec3 normal ,vec3 scatterAmt) diff --git a/packages/custom-material/src/advanced-shader/sss/SSSLightDirect.glsl b/packages/custom-material/src/advanced-shader/sss/SSSLightDirect.glsl index 76f2ea4d..a34f9bf8 100644 --- a/packages/custom-material/src/advanced-shader/sss/SSSLightDirect.glsl +++ b/packages/custom-material/src/advanced-shader/sss/SSSLightDirect.glsl @@ -17,8 +17,8 @@ void surfaceShadingSSS(Varyings varyings, SurfaceData surfaceData, BRDFData brdf float skintexture = skinCurvatureTexture.r * material_CurvaturePower ; vec3 scatterAmt = material_SkinScatterAmount.rgb * skintexture; - vec3 SG = sgdiffuseLighting(incidentDirection, surfaceData.normal, scatterAmt); - vec3 irradiance = SG * lightColor * PI; + vec3 sg = sgdiffuseLighting(incidentDirection, surfaceData.normal, scatterAmt); + vec3 irradiance = sg * lightColor * PI; // ClearCoat Lobe float attenuation = clearCoatLobe(varyings, surfaceData, brdfData, incidentDirection, lightColor, specularColor);