diff options
author | Graham Linden <graham@lindenlab.com> | 2018-09-10 20:39:48 +0100 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2018-09-10 20:39:48 +0100 |
commit | 642a4ddd60745db292c543a5cea3b1e5fe606795 (patch) | |
tree | c6e54329fff754cb502a3086aaf2e81a33740d9c /indra/newview/lldrawpoolwlsky.cpp | |
parent | e5c0022a7c102e96d3e93d91eda08af81defeef1 (diff) |
Fixes for switching between atmospherics implementations on the fly.
Diffstat (limited to 'indra/newview/lldrawpoolwlsky.cpp')
-rw-r--r-- | indra/newview/lldrawpoolwlsky.cpp | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp index 0d49c5a339..205b6441e7 100644 --- a/indra/newview/lldrawpoolwlsky.cpp +++ b/indra/newview/lldrawpoolwlsky.cpp @@ -163,7 +163,7 @@ void LLDrawPoolWLSky::renderDome(const LLVector3& camPosLocal, F32 camHeightLoca void LLDrawPoolWLSky::renderSkyHazeDeferred(const LLVector3& camPosLocal, F32 camHeightLocal) const { - if (gPipeline.useAdvancedAtmospherics() && gPipeline.canUseWindLightShaders() && gAtmosphere) + if (gPipeline.useAdvancedAtmospherics() && gPipeline.canUseWindLightShaders()) { sky_shader->bind(); @@ -192,7 +192,7 @@ void LLDrawPoolWLSky::renderSkyHazeDeferred(const LLVector3& camPosLocal, F32 ca sky_shader->uniform3f(sCamPosLocal, camPosLocal.mV[0], camPosLocal.mV[1], camPosLocal.mV[2]); renderFsSky(camPosLocal, camHeightLocal, sky_shader); - + sky_shader->unbind(); } } @@ -497,18 +497,22 @@ void LLDrawPoolWLSky::renderDeferred(S32 pass) if (gPipeline.canUseWindLightShaders()) { - if (gPipeline.useAdvancedAtmospherics()) { - renderSkyHazeDeferred(origin, camHeightLocal); - renderHeavenlyBodies(); - } - 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 LLGLDepthTest depth(GL_TRUE, GL_FALSE); - renderSkyHaze(origin, camHeightLocal); - renderHeavenlyBodies(); + + 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); + + } + renderHeavenlyBodies(); } renderSkyClouds(origin, camHeightLocal); } |