diff options
author | Graham Madarasz <graham@lindenlab.com> | 2013-04-19 07:48:05 -0700 |
---|---|---|
committer | Graham Madarasz <graham@lindenlab.com> | 2013-04-19 07:48:05 -0700 |
commit | 6adc6d71a7147a7f53f266bb05cd0157e34f9f4b (patch) | |
tree | ad3b8886cd2c09cc1510db6a8c2e2e87ffafb441 /indra/newview/app_settings/shaders/class2/windlight | |
parent | 8bccedd163f1eb25c631e8501bdd468c24e6bf40 (diff) | |
parent | f9ff68b5e3b016a53fe987e5b51442741ca88f15 (diff) |
Merge viewer-dev-materials
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/windlight')
-rw-r--r-- | indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl index da3d922017..d543479b85 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl @@ -54,6 +54,7 @@ uniform float density_multiplier; uniform float distance_multiplier; uniform float max_y; uniform vec4 glow; +uniform float global_gamma; void calcAtmospherics(vec3 inPositionEye) { @@ -129,11 +130,17 @@ void calcAtmospherics(vec3 inPositionEye) { vec3(blue_horizon * blue_weight * (sunlight*(1.-cloud_shadow) + tmpAmbient) + (haze_horizon * haze_weight) * (sunlight*(1.-cloud_shadow) * temp2.x + tmpAmbient))); + + float gammaScale = 1.0; + if (global_gamma > 1.0) + { + gammaScale = global_gamma / 2 + global_gamma; + } //brightness of surface both sunlight and ambient - setSunlitColor(vec3(sunlight * .5)); - setAmblitColor(vec3(tmpAmbient * .25)); - setAdditiveColor(getAdditiveColor() * vec3(1.0 - temp1)); + setSunlitColor(pow(vec3(sunlight * .5), vec3(global_gamma)) * gammaScale); + setAmblitColor(pow(vec3(tmpAmbient * .25), vec3(global_gamma)) * gammaScale); + setAdditiveColor(pow(getAdditiveColor() * vec3(1.0 - temp1), vec3(global_gamma)) * gammaScale); // vary_SunlitColor = vec3(0); // vary_AmblitColor = vec3(0); |