summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2018-10-22 18:53:20 +0000
committerRider Linden <rider@lindenlab.com>2018-10-22 18:53:20 +0000
commit2cee3e6ef4789c78fdcd59c1db093e78aeeb8511 (patch)
tree9cd65266cfd64249b7e68832499dd7deab6bc538 /indra/newview
parentd2428d53b5816ce33adf10423ae7bb8229d4b915 (diff)
parentdba9521cf6e2b14a345f7e4a2554e536fb69feff (diff)
Merged in graham_linden/viewer-eep-graham (pull request #165)
SL-9806
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/starsV.glsl8
-rw-r--r--indra/newview/lldrawpoolwlsky.cpp12
-rw-r--r--indra/newview/llvowlsky.cpp4
3 files changed, 17 insertions, 7 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl b/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl
index e14d02a4a9..bb2a2ee72b 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl
@@ -38,7 +38,13 @@ VARYING vec2 screenpos;
void main()
{
//transform vertex
- gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
+ vec4 pos = modelview_projection_matrix * vec4(position, 1.0);
+
+// bias z to fix SL-9806 and get stars to depth test against clouds
+ pos.z += 0.001f;
+
+ gl_Position = pos;
+
float t = mod(time, 1.25f);
screenpos = position.xy * vec2(t, t);
vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp
index b9e041a3d5..c4560e89f4 100644
--- a/indra/newview/lldrawpoolwlsky.cpp
+++ b/indra/newview/lldrawpoolwlsky.cpp
@@ -325,6 +325,8 @@ void LLDrawPoolWLSky::renderStarsDeferred(void) const
{
LLGLSPipelineSkyBox gls_sky;
LLGLEnable blend(GL_BLEND);
+ LLGLDepthTest depth_test(GL_TRUE, GL_FALSE, GL_LESS);
+
gGL.setSceneBlendType(LLRender::BT_ADD_WITH_ALPHA);
F32 star_alpha = LLEnvironment::instance().getCurrentSky()->getStarBrightness() / 500.0f;
@@ -386,6 +388,7 @@ void LLDrawPoolWLSky::renderSkyClouds(const LLVector3& camPosLocal, F32 camHeigh
{
if (gPipeline.canUseWindLightShaders() && gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS) && gSky.mVOSkyp->getCloudNoiseTex())
{
+ LLGLDepthTest depth(GL_TRUE, GL_TRUE);
LLGLEnable blend(GL_BLEND);
gGL.setSceneBlendType(LLRender::BT_ALPHA);
@@ -549,22 +552,21 @@ void LLDrawPoolWLSky::renderDeferred(S32 pass)
if (gPipeline.canUseWindLightShaders())
{
{
+ // Disable depth-writes for sky, but re-enable depth writes for the cloud
+ // rendering below so the cloud shader can write out depth for the stars to test against
LLGLDepthTest depth(GL_TRUE, GL_FALSE);
if (gPipeline.useAdvancedAtmospherics())
{
- //LLGLSquashToFarClip far_clip(get_current_projection());
renderSkyHazeDeferred(origin, camHeightLocal);
}
else
{
- // Disable depth-test for sky, but re-enable depth writes for the cloud
- // rendering below so the cloud shader can write out depth for the stars to test against
- renderSkyHaze(origin, camHeightLocal);
-
+ renderSkyHaze(origin, camHeightLocal);
}
renderHeavenlyBodies();
}
+
renderSkyClouds(origin, camHeightLocal);
}
gGL.setColorMask(true, true);
diff --git a/indra/newview/llvowlsky.cpp b/indra/newview/llvowlsky.cpp
index a8bc8d4d45..b4b6bb252f 100644
--- a/indra/newview/llvowlsky.cpp
+++ b/indra/newview/llvowlsky.cpp
@@ -299,7 +299,9 @@ void LLVOWLSky::drawDome(void)
updateGeometry(mDrawable);
}
- LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
+ // This is handled upstream now as we may make different decisions
+ // for some dome users (the sky) than for others (the clouds)
+ //LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
const U32 data_mask = LLDrawPoolWLSky::SKY_VERTEX_DATA_MASK;