diff options
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl')
-rwxr-xr-x | indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index 9197df2628..b688c1a70c 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -231,9 +231,9 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) { + tmpAmbient))); //brightness of surface both sunlight and ambient - setSunlitColor(pow(vec3(sunlight * .5), vec3(global_gamma)) * 2.2); - setAmblitColor(pow(vec3(tmpAmbient * .25), vec3(global_gamma)) * 2.2); - setAdditiveColor(pow(getAdditiveColor() * vec3(1.0 - temp1), vec3(global_gamma)) * 2.2); + setSunlitColor(pow(vec3(sunlight * .5), vec3(global_gamma)) * global_gamma); + setAmblitColor(pow(vec3(tmpAmbient * .25), vec3(global_gamma)) * global_gamma); + setAdditiveColor(pow(getAdditiveColor() * vec3(1.0 - temp1), vec3(global_gamma)) * global_gamma); } vec3 atmosLighting(vec3 light) @@ -308,7 +308,7 @@ void main() col.rgb *= ambient; - col += atmosAffectDirectionalLight(max(min(da, 1.0) * 2.6, diffuse.a)); + col += atmosAffectDirectionalLight(max(min(da, 1.0) * 2.6, 0.0)); col *= diffuse.rgb; @@ -328,17 +328,28 @@ void main() col += spec_contrib; } + col = mix(col.rgb, diffuse.rgb, diffuse.a); + if (envIntensity > 0.0) { //add environmentmap vec3 env_vec = env_mat * refnormpersp; - col = mix(col.rgb, pow(textureCube(environmentMap, env_vec).rgb, vec3(2.2)) * 2.2, + + float exponent = mix(2.2, 1.0, diffuse.a); + + col = mix(col.rgb, pow(textureCube(environmentMap, env_vec).rgb, vec3(exponent)) * exponent, envIntensity); + + exponent = mix(1.0, 2.2, diffuse.a); + col.rgb = pow(col.rgb, vec3(exponent))/exponent; } - col = atmosLighting(col); - col = scaleSoftClip(col); + if (norm.w < 0.5) + { + col = atmosLighting(col); + col = scaleSoftClip(col); + } - col = mix(col.rgb, diffuse.rgb, diffuse.a); + //col.g = envIntensity; } frag_color.rgb = col; |