summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/skyF.glsl7
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl5
-rw-r--r--indra/newview/lldrawpoolwlsky.cpp3
3 files changed, 7 insertions, 8 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl
index cc5280d929..596e9321e8 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/skyF.glsl
@@ -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);
-
}
diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
index 5cc7ea698a..9b9739ba22 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
@@ -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;
diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp
index a9cc138549..303916110c 100644
--- a/indra/newview/lldrawpoolwlsky.cpp
+++ b/indra/newview/lldrawpoolwlsky.cpp
@@ -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);
}