diff options
author | Oz Linden <oz@lindenlab.com> | 2013-06-28 11:44:10 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2013-06-28 11:44:10 -0400 |
commit | 290882cda8abfa72ee2f25288b3748d4adecc7dc (patch) | |
tree | 94e94bce483ada5ac4f1782301fd5b5720d95e80 /indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl | |
parent | 2ca2b28dfdca94200d93dfa47952953481d20989 (diff) | |
parent | 6060e5e46acbeb20a301070a0fd0efea029d33d0 (diff) |
merge changes for 3.6.1-release
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl')
-rwxr-xr-x | indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index b40850e769..08583ad0f2 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -248,9 +248,9 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) { + tmpAmbient))); //brightness of surface both sunlight and ambient - 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); + setSunlitColor(vec3(sunlight * .5)); + setAmblitColor(vec3(tmpAmbient * .25)); + setAdditiveColor(getAdditiveColor() * vec3(1.0 - temp1)); } vec3 atmosLighting(vec3 light) @@ -325,8 +325,13 @@ void main() norm.xyz = decode_normal(norm.xy); // unpack norm float da = max(dot(norm.xyz, sun_dir.xyz), 0.0); + da = pow(da, 1.0/1.3); vec4 diffuse = texture2DRect(diffuseRect, tc); + + //convert to gamma space + diffuse.rgb = pow(diffuse.rgb, vec3(1.0/2.2)); + vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy); vec3 col; float bloom = 0.0; @@ -341,7 +346,7 @@ void main() col.rgb *= ambient; - col += atmosAffectDirectionalLight(max(min(da, 1.0) * 2.6, 0.0)); + col += atmosAffectDirectionalLight(max(min(da, 1.0), 0.0)); col *= diffuse.rgb; @@ -362,23 +367,18 @@ void main() } - col = mix(col.rgb, pow(diffuse.rgb, vec3(1.0/2.2)), diffuse.a); - - + col = mix(col.rgb, diffuse.rgb, diffuse.a); + if (envIntensity > 0.0) { //add environmentmap vec3 env_vec = env_mat * refnormpersp; - float exponent = mix(2.2, 1.0, diffuse.a); - vec3 refcol = pow(textureCube(environmentMap, env_vec).rgb, vec3(exponent))*exponent; + + vec3 refcol = textureCube(environmentMap, env_vec).rgb; col = mix(col.rgb, refcol, envIntensity); - } - - float exponent = mix(1.0, 2.2, diffuse.a); - col = pow(col, vec3(exponent)); if (norm.w < 0.5) { @@ -386,10 +386,12 @@ void main() col = mix(scaleSoftClip(col), fullbrightScaleSoftClip(col), diffuse.a); } + col = pow(col, vec3(2.2)); + //col = vec3(1,0,1); //col.g = envIntensity; } - + frag_color.rgb = col; frag_color.a = bloom; |