diff options
author | Graham Linden <graham@lindenlab.com> | 2019-05-29 15:57:24 -0700 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2019-05-29 15:57:24 -0700 |
commit | 2f2cf6d855e1e5977ef0ed3583238636e890220a (patch) | |
tree | 23469b9f26f53271d3df526aa8f9c767383d833f /indra/newview/app_settings/shaders/class1/deferred | |
parent | a00dd2837d92ffc1b3732fb2df273bb3759eed90 (diff) |
SL-10969
Modify ambient handling and forward projector lighting again to stamp out alpha fires.
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred')
3 files changed, 12 insertions, 21 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index 2b5509400e..93359e0d4c 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -102,8 +102,6 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 diffuse, vec3 v, vec3 n, vec return col; } - dist /= la; - /* clip to projector bounds vec4 proj_tc = proj_mat * lp; @@ -117,16 +115,17 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 diffuse, vec3 v, vec3 n, vec return col; }*/ - fa += 1.0; - if (dist > 0.0 && la > 0.0 && fa > 0.0) + if (dist > 0.0 && la > 0.0) { + dist /= la; + //normalize light vector lv = normalize(lv); //distance attenuation float dist_atten = clamp(1.0-(dist-1.0*(1.0-fa))/fa, 0.0, 1.0); dist_atten *= dist_atten; - dist_atten *= 2.0f; + //dist_atten *= 2.0f; if (dist_atten <= 0.0) { @@ -177,14 +176,14 @@ void main() #ifdef USE_DIFFUSE_TEX vec4 diffuse_srgb = texture2D(diffuseMap,vary_texcoord0.xy); - vec4 diffuse_linear = vec4(srgb_to_linear(diffuse_srgb.rgb), diffuse_srgb.a); #endif #ifdef USE_INDEXED_TEX - vec4 diffuse_linear = diffuseLookup(vary_texcoord0.xy); - vec4 diffuse_srgb = vec4(linear_to_srgb(diffuse_linear.rgb), diffuse_linear.a); + vec4 diffuse_srgb = diffuseLookup(vary_texcoord0.xy); #endif + vec4 diffuse_linear = vec4(srgb_to_linear(diffuse_srgb.rgb), diffuse_srgb.a); + #ifdef FOR_IMPOSTOR vec4 color; color.rgb = diffuse_srgb.rgb; @@ -236,9 +235,7 @@ void main() float ambient = da; ambient *= 0.5; ambient *= ambient; - - float ambient_clamp = getAmbientClamp() + 0.1; - ambient = (1.0 - ambient) * ambient_clamp; + ambient = (1.0 - ambient); vec3 sun_contrib = min(final_da, shadow) * sunlit; @@ -268,7 +265,7 @@ vec3 post_atmo = color.rgb; // to linear! color.rgb = srgb_to_linear(color.rgb); - #define LIGHT_LOOP(i) light.rgb += calcPointLightOrSpotLight(light_diffuse[i].rgb, diffuse_srgb.rgb, pos.xyz, norm, light_position[i], light_direction[i].xyz, light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z, light_attenuation[i].w); + #define LIGHT_LOOP(i) light.rgb += calcPointLightOrSpotLight(light_diffuse[i].rgb, diffuse_linear.rgb, pos.xyz, norm, light_position[i], light_direction[i].xyz, light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z, light_attenuation[i].w); LIGHT_LOOP(1) LIGHT_LOOP(2) diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl index c3ca9a6904..4701157909 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl @@ -112,8 +112,7 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 npos, vec3 diffuse, vec4 spe return col; }*/ - fa += 1.0; - if (dist > 0.0 && la > 0.0 && fa > 0.0) + if (dist > 0.0 && la > 0.0) { //normalize light vector lv = normalize(lv); @@ -121,7 +120,7 @@ vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 npos, vec3 diffuse, vec4 spe //distance attenuation float dist_atten = clamp(1.0-(dist-1.0*(1.0-fa))/fa, 0.0, 1.0); dist_atten *= dist_atten; - dist_atten *= 2.0f; + //dist_atten *= 2.0f; if (dist_atten <= 0.0) { @@ -328,9 +327,7 @@ void main() float ambient = da; ambient *= 0.5; ambient *= ambient; - - float ambient_clamp = getAmbientClamp() + 0.1; - ambient = (1.0 - ambient) * ambient_clamp; + ambient = (1.0 - ambient); vec3 sun_contrib = min(final_da, shadow) * sunlit; diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index 39d14314cc..e07b31b3c1 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -106,10 +106,7 @@ void main() float ambient = da; ambient *= 0.5; ambient *= ambient; - ambient = (1.0 - ambient); - float ambient_clamp = getAmbientClamp() + 0.1; - ambient *= ambient_clamp; vec3 sun_contrib = final_da * sunlit; |