From 251b75ea2ed5e652c245f9bed33ff96092b830fe Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Wed, 29 Jun 2022 17:49:10 -0700 Subject: SL-17274: PBR: Add c_diff and fix kDiffuse --- .../newview/app_settings/shaders/class3/deferred/softenLightF.glsl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview/app_settings/shaders') diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index a64d059d06..2749dfed30 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -222,6 +222,7 @@ void main() #endif float metal = packedORM.b; + vec3 c_diff = mix(diffuse.rgb,vec3(0),metal); vec3 reflect90 = vec3(0); vec3 v = -normalize(pos.xyz); #if DEBUG_PBR_VERT2CAM1 @@ -276,7 +277,7 @@ void main() vec3 avg = specWeight * (reflect0 + (1.0 - reflect0) / 21.0); vec3 AvgEms = avg * Ems; vec3 FmsEms = AvgEms * FssEssLambert / (1.0 - AvgEms); - vec3 kDiffuse = colorDiffuse * (1.0 - FssEssLambert + FmsEms); + vec3 kDiffuse = c_diff * (1.0 - FssEssLambert + FmsEms); colorDiffuse += (FmsEms + kDiffuse) * irradiance; colorDiffuse *= packedORM.r; // Occlusion -- NOTE: pbropaque will need occlusion_strength pre-multiplied into spec.r @@ -330,6 +331,9 @@ void main() #if DEBUG_PBR_BRDF_SCALE_BIAS color.rgb = vec3(vScaleBias,0.0); #endif + #if DEBUG_PBR_DIFFUSE_C + color.rgb = c_diff; + #endif #if DEBUG_PBR_DIFFUSE_K color.rgb = kDiffuse; #endif -- cgit v1.2.3