diff options
| author | Graham Linden <graham@lindenlab.com> | 2018-10-22 19:23:10 +0100 |
|---|---|---|
| committer | Graham Linden <graham@lindenlab.com> | 2018-10-22 19:23:10 +0100 |
| commit | dba9521cf6e2b14a345f7e4a2554e536fb69feff (patch) | |
| tree | 31e0705b6c752f8eeadb6b4c56b7dab12710008e /indra/newview/lldrawpoolwlsky.cpp | |
| parent | 91615351b56cbf36ef26fdd05fb3212414a2d679 (diff) | |
SL-9806
Get dome rendering to not assert the depth test state behind deferred render's back.
Make clouds write and test depth to give stars something to depth test against.
Add z-bias in star vert shader to force some depth testing of stars against clouds.
Diffstat (limited to 'indra/newview/lldrawpoolwlsky.cpp')
| -rw-r--r-- | indra/newview/lldrawpoolwlsky.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
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); |
