Skip to content
Snippets Groups Projects
Commit 457b720f authored by David Parks's avatar David Parks
Browse files

#965 Fix for EEP skies being too bright

parent 522c4b4f
No related branches found
No related tags found
No related merge requests found
......@@ -86,7 +86,9 @@ void main()
pos = env_mat * pos;
vec2 texCoord = vec2(atan(pos.z, pos.x) + PI, acos(pos.y)) / vec2(2.0 * PI, PI);
vec3 color = textureLod(environmentMap, texCoord.xy, 0).rgb * sky_hdr_scale;
color = min(color, vec3(8192*8192*16));
color = min(color, vec3(8192*8192*16)); // stupidly large value arrived at by binary search -- avoids framebuffer corruption from some HDRIs
frag_data[2] = vec4(0.0,0.0,0.0,GBUFFER_FLAG_HAS_HDRI);
#else
// Potential Fill-rate optimization. Add cloud calculation
......@@ -104,12 +106,11 @@ void main()
color.rgb *= 2.;
color.rgb = clamp(color.rgb, vec3(0), vec3(5));
frag_data[2] = vec4(0.0,0.0,0.0,GBUFFER_FLAG_SKIP_ATMOS);
#endif
frag_data[0] = vec4(0);
frag_data[1] = vec4(0);
frag_data[2] = vec4(0.0,0.0,0.0,GBUFFER_FLAG_SKIP_ATMOS);
frag_data[3] = vec4(color.rgb, 1.0);
}
......@@ -191,11 +191,12 @@ void main()
}
else if (GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_HDRI))
{
// actual HDRI sky, just copy color value
color = texture(emissiveRect, tc).rgb;
}
else if (!GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_ATMOS))
else if (GET_GBUFFER_FLAG(GBUFFER_FLAG_SKIP_ATMOS))
{
//should only be true of WL sky, just port over base color value
//should only be true of WL sky, port over base color value and scale for fake HDR
color = texture(emissiveRect, tc).rgb;
color = srgb_to_linear(color);
color *= sky_hdr_scale;
......
......@@ -470,8 +470,6 @@ void LLDrawPoolWLSky::renderDeferred(S32 pass)
const F32 camHeightLocal = LLEnvironment::instance().getCamHeight();
gGL.setColorMask(true, false);
LLVector3 const & origin = LLViewerCamera::getInstance()->getOrigin();
if (gPipeline.canUseWindLightShaders())
......@@ -488,7 +486,6 @@ void LLDrawPoolWLSky::renderDeferred(S32 pass)
renderSkyCloudsDeferred(origin, camHeightLocal, cloud_shader);
}
}
gGL.setColorMask(true, true);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment