summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders/class1')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/exposureF.glsl19
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl1
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/skyV.glsl2
3 files changed, 11 insertions, 11 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/exposureF.glsl b/indra/newview/app_settings/shaders/class1/deferred/exposureF.glsl
index 689929fe38..861b78c961 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/exposureF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/exposureF.glsl
@@ -36,17 +36,16 @@ uniform sampler2D exposureMap;
uniform float dt;
uniform vec2 noiseVec;
-// calculate luminance the same way LLColor4::calcHSL does
+
float lum(vec3 col)
{
- float mx = max(max(col.r, col.g), col.b);
- float mn = min(min(col.r, col.g), col.b);
- return (mx + mn) * 0.5;
+ vec3 l = vec3(0.2126, 0.7152, 0.0722);
+ return dot(l, col);
}
void main()
{
- float step = 1.0/32.0;
+ float step = 1.0/16.0;
float start = step;
float end = 1.0-step;
@@ -55,13 +54,13 @@ void main()
vec3 col;
- vec2 nz = noiseVec * step * 0.5;
+ //vec2 nz = noiseVec * step * 0.5;
for (float x = start; x <= end; x += step)
{
for (float y = start; y <= end; y += step)
{
- vec2 tc = vec2(x,y) + nz;
+ vec2 tc = vec2(x,y); // + nz;
vec3 c = texture(diffuseRect, tc).rgb + texture(emissiveRect, tc).rgb;
float L = max(lum(c), 0.25);
@@ -82,11 +81,13 @@ void main()
float L = lum(col);
- float s = clamp(0.1/L, 0.5, 4.0);
+ float s = clamp(0.175/L, 0.125, 1.3);
+
float prev = texture(exposureMap, vec2(0.5,0.5)).r;
- s = mix(prev, s, min(dt*2.0, 0.04));
+ s = mix(prev, s, min(dt*2.0*abs(prev-s), 0.04));
+
frag_color = vec4(s, s, s, dt);
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl
index 7b4b62f0eb..bdbc0056f8 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl
@@ -124,7 +124,6 @@ vec3 toneMap(vec3 color)
// this factor is based on the exposure correction of Krzysztof Narkowicz in his
// implemetation of ACES tone mapping
color *= 1.0/0.6;
- //color /= 0.6;
color = toneMapACES_Hill(color);
#endif
diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
index fc6291d438..0090155e5c 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
@@ -91,7 +91,7 @@ void main()
vary_LightNormPosDot = rel_pos_lightnorm_dot;
// Initialize temp variables
- vec3 sunlight = (sun_up_factor == 1) ? sunlight_color*2.0 : moonlight_color*0.75;
+ vec3 sunlight = (sun_up_factor == 1) ? sunlight_color*2.0 : moonlight_color;
// Sunlight attenuation effect (hue and brightness) due to atmosphere
// this is used later for sunlight modulation at various altitudes