diff --git a/libraries/render-utils/src/DeferredGlobalLight.slh b/libraries/render-utils/src/DeferredGlobalLight.slh index c3ab17f72b..f6c1d290a7 100644 --- a/libraries/render-utils/src/DeferredGlobalLight.slh +++ b/libraries/render-utils/src/DeferredGlobalLight.slh @@ -20,7 +20,6 @@ <@include LightAmbient.slh@> <@include LightDirectional.slh@> - <@func fetchGlobalLight()@> // Get light Light light = getKeyLight(); @@ -193,14 +192,13 @@ vec3 evalGlobalLightingAlphaBlended(mat4 invViewMat, float shadowAttenuation, fl vec3 ambientSpecular; evalLightingAmbient(ambientDiffuse, ambientSpecular, lightAmbient, surfaceWS, metallic, fresnel, albedo, obscurance); color += ambientDiffuse; - color += ambientSpecular / opacity; // Directional vec3 directionalDiffuse; vec3 directionalSpecular; evalLightingDirectional(directionalDiffuse, directionalSpecular, lightDirection, lightIrradiance, surfaceWS, metallic, fresnel, albedo, shadowAttenuation); color += directionalDiffuse; - color += directionalSpecular / opacity; + color += (ambientSpecular + directionalSpecular) / opacity; return color; } @@ -227,14 +225,13 @@ vec3 evalGlobalLightingAlphaBlendedWithHaze( vec3 ambientSpecular; evalLightingAmbient(ambientDiffuse, ambientSpecular, lightAmbient, surfaceWS, metallic, fresnel, albedo, obscurance); color += ambientDiffuse; - color += ambientSpecular / opacity; // Directional vec3 directionalDiffuse; vec3 directionalSpecular; evalLightingDirectional(directionalDiffuse, directionalSpecular, lightDirection, lightIrradiance, surfaceWS, metallic, fresnel, albedo, shadowAttenuation); color += directionalDiffuse; - color += directionalSpecular / opacity; + color += (ambientSpecular + directionalSpecular) / opacity; // Haze if ((hazeParams.hazeMode & HAZE_MODE_IS_ACTIVE) == HAZE_MODE_IS_ACTIVE) { diff --git a/libraries/render-utils/src/ForwardGlobalLight.slh b/libraries/render-utils/src/ForwardGlobalLight.slh index 3aadb182fa..84999f347b 100644 --- a/libraries/render-utils/src/ForwardGlobalLight.slh +++ b/libraries/render-utils/src/ForwardGlobalLight.slh @@ -20,7 +20,6 @@ <@include LightAmbient.slh@> <@include LightDirectional.slh@> - <@func prepareGlobalLight(positionES, normalWS)@> // prepareGlobalLight // Transform directions to worldspace @@ -192,14 +191,13 @@ vec3 evalGlobalLightingAlphaBlended(mat4 invViewMat, float shadowAttenuation, fl vec3 ambientSpecular; evalLightingAmbient(ambientDiffuse, ambientSpecular, lightAmbient, surfaceWS, metallic, fresnel, albedo, obscurance); color += ambientDiffuse; - color += ambientSpecular / opacity; // Directional vec3 directionalDiffuse; vec3 directionalSpecular; evalLightingDirectional(directionalDiffuse, directionalSpecular, lightDirection, lightIrradiance, surfaceWS, metallic, fresnel, albedo, shadowAttenuation); color += directionalDiffuse; - color += directionalSpecular / opacity; + color += (ambientSpecular + directionalSpecular) / opacity; return color; } @@ -219,14 +217,13 @@ vec3 evalGlobalLightingAlphaBlendedWithHaze( vec3 ambientSpecular; evalLightingAmbient(ambientDiffuse, ambientSpecular, lightAmbient, surfaceWS, metallic, fresnel, albedo, obscurance); color += ambientDiffuse; - color += ambientSpecular / opacity; // Directional vec3 directionalDiffuse; vec3 directionalSpecular; evalLightingDirectional(directionalDiffuse, directionalSpecular, lightDirection, lightIrradiance, surfaceWS, metallic, fresnel, albedo, shadowAttenuation); color += directionalDiffuse; - color += directionalSpecular / opacity; + color += (ambientSpecular + directionalSpecular) / opacity; // Haze // FIXME - temporarily removed until we support it for forward...