DRTVWR-559 Auto exposure tuning.
parent
70bdf55439
commit
46702c4e80
|
|
@ -36,12 +36,11 @@ 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()
|
||||
|
|
@ -82,7 +81,7 @@ void main()
|
|||
|
||||
float L = lum(col);
|
||||
|
||||
float s = clamp(0.1/L, 0.5, 2.5);
|
||||
float s = clamp(0.175/L, 0.125, 1.3);
|
||||
|
||||
|
||||
float prev = texture(exposureMap, vec2(0.5,0.5)).r;
|
||||
|
|
|
|||
|
|
@ -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 : moonlight_color;
|
||||
|
||||
// Sunlight attenuation effect (hue and brightness) due to atmosphere
|
||||
// this is used later for sunlight modulation at various altitudes
|
||||
|
|
|
|||
|
|
@ -62,8 +62,8 @@ void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, ou
|
|||
|
||||
vec3 rel_pos_norm = normalize(rel_pos);
|
||||
float rel_pos_len = length(rel_pos);
|
||||
float scale = 2.0;
|
||||
vec3 sunlight = (sun_up_factor == 1) ? sunlight_color * scale: moonlight_color*0.75;
|
||||
|
||||
vec3 sunlight = (sun_up_factor == 1) ? sunlight_color: moonlight_color;
|
||||
|
||||
// sunlight attenuation effect (hue and brightness) due to atmosphere
|
||||
// this is used later for sunlight modulation at various altitudes
|
||||
|
|
@ -141,7 +141,7 @@ void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, ou
|
|||
|
||||
// fudge sunlit and amblit to get consistent lighting compared to legacy
|
||||
// midday before PBR was a thing
|
||||
sunlit = sunlight.rgb / scale;
|
||||
sunlit = sunlight.rgb;
|
||||
amblit = tmpAmbient.rgb * 0.25;
|
||||
|
||||
additive *= vec3(1.0 - combined_haze);
|
||||
|
|
|
|||
|
|
@ -676,7 +676,7 @@ void sampleReflectionProbesWater(inout vec3 ambenv, inout vec3 glossenv,
|
|||
sampleReflectionProbes(ambenv, glossenv, tc, pos, norm, glossiness);
|
||||
|
||||
// fudge factor to get PBR water at a similar luminance ot legacy water
|
||||
glossenv *= 0.5;
|
||||
glossenv *= 0.4;
|
||||
}
|
||||
|
||||
void debugTapRefMap(vec3 pos, vec3 dir, float depth, int i, inout vec4 col)
|
||||
|
|
|
|||
|
|
@ -212,6 +212,7 @@ void main()
|
|||
{
|
||||
//should only be true of WL sky, just port over base color value
|
||||
color = srgb_to_linear(texture2D(emissiveRect, tc).rgb);
|
||||
color *= sun_up_factor + 1.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue