From f9615f7cffc3c9b2e9c8c4031cc81a3f6eb07afb Mon Sep 17 00:00:00 2001 From: Ptolemy Date: Tue, 9 Aug 2022 01:15:53 -0700 Subject: SL-17763: PBR: Add BRDF to spot light --- .../app_settings/shaders/class3/deferred/multiSpotLightF.glsl | 8 ++------ .../app_settings/shaders/class3/deferred/spotLightF.glsl | 11 ++--------- 2 files changed, 4 insertions(+), 15 deletions(-) (limited to 'indra/newview/app_settings/shaders') diff --git a/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl index eed714c8db..371c9d88f4 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl @@ -196,12 +196,8 @@ void main() dlit = getProjectedLightDiffuseColor( l_dist, proj_tc.xy ); slit = getProjectedLightSpecularColor( pos, n ); -// vec3 intensity = getLightIntensitySpot( color, size, lightDist, v ); - colorDiffuse = shadow * dlit * nl * dist_atten; - colorSpec = shadow * slit * nl * dist_atten; - -// colorDiffuse *= BRDFLambertian ( reflect0, reflect90, c_diff , specWeight, vh ); -// colorSpec *= BRDFSpecularGGX( reflect0, reflect90, alphaRough, specWeight, vh, nl, nv, nh ); + colorDiffuse = shadow * dist_atten * nl * (dlit*0.5 + BRDFLambertian ( reflect0, reflect90, c_diff , specWeight, vh )); + colorSpec = shadow * dist_atten * nl * (slit + BRDFSpecularGGX( reflect0, reflect90, alphaRough, specWeight, vh, nl, nv, nh )); #if DEBUG_PBR_SPOT_DIFFUSE colorDiffuse = dlit.rgb; colorSpec = vec3(0); diff --git a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl index a82581d1a1..3b028d9fae 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl @@ -167,15 +167,8 @@ void main() dlit = getProjectedLightDiffuseColor( l_dist, proj_tc.xy ); slit = getProjectedLightSpecularColor( pos, n ); -// vec3 intensity = getLightIntensitySpot( color, size, lightDist, v ); -// colorDiffuse = shadow * dlit * nl; -// colorSpec = shadow * slit * nl; - -// colorDiffuse *= BRDFLambertian ( reflect0, reflect90, c_diff , specWeight, vh ); -// colorSpec *= BRDFSpecularGGX( reflect0, reflect90, alphaRough, specWeight, vh, nl, nv, nh ); - - colorDiffuse = shadow * dlit * nl * dist_atten; - colorSpec = shadow * slit * nl * dist_atten; + colorDiffuse = shadow * dist_atten * nl * (dlit*0.5 + BRDFLambertian ( reflect0, reflect90, c_diff , specWeight, vh )); + colorSpec = shadow * dist_atten * nl * (slit + BRDFSpecularGGX( reflect0, reflect90, alphaRough, specWeight, vh, nl, nv, nh )); #if DEBUG_PBR_SPOT_DIFFUSE colorDiffuse = dlit.rgb; colorSpec = vec3(0); -- cgit v1.2.3