diff options
author | Rider Linden <rider@lindenlab.com> | 2018-09-11 18:41:52 +0000 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2018-09-11 18:41:52 +0000 |
commit | fe28c3e886aa8a9d5c5b9bc582b532f1235bd76c (patch) | |
tree | 9eb0310081f3c8ea2b302fcf0fe2fc76a3683e5d /indra/newview/lldrawpoolwlsky.cpp | |
parent | 43c8f5959f8afaf2f67fbbf49e78965802859b55 (diff) | |
parent | 1207c2fd006842a86e4ecf45bf653dc54081db1b (diff) |
Merged in graham_linden/viewer-eep-graham (pull request #77)
SL-1936 and SL-1912 WIP
Diffstat (limited to 'indra/newview/lldrawpoolwlsky.cpp')
-rw-r--r-- | indra/newview/lldrawpoolwlsky.cpp | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp index 26454d2bd1..e7929e0bbf 100644 --- a/indra/newview/lldrawpoolwlsky.cpp +++ b/indra/newview/lldrawpoolwlsky.cpp @@ -94,7 +94,7 @@ void LLDrawPoolWLSky::beginRenderPass( S32 pass ) void LLDrawPoolWLSky::endRenderPass( S32 pass ) { sky_shader = nullptr; - cloud_shader = nullptr; + cloud_shader = nullptr; sun_shader = nullptr; moon_shader = nullptr; } @@ -118,7 +118,7 @@ void LLDrawPoolWLSky::beginDeferredPass(S32 pass) void LLDrawPoolWLSky::endDeferredPass(S32 pass) { sky_shader = nullptr; - cloud_shader = nullptr; + cloud_shader = nullptr; sun_shader = nullptr; moon_shader = nullptr; } @@ -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(); @@ -174,8 +174,8 @@ void LLDrawPoolWLSky::renderSkyHazeDeferred(const LLVector3& camPosLocal, F32 ca sky_shader->bindTexture(LLShaderMgr::ILLUMINANCE_TEX, gAtmosphere->getIlluminance()); LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky(); - LLVector4 sun_dir = LLEnvironment::instance().getClampedSunNorm(); - LLVector4 moon_dir = LLEnvironment::instance().getClampedMoonNorm(); + LLVector3 sun_dir = LLEnvironment::instance().getSunDirection(); + LLVector3 moon_dir = LLEnvironment::instance().getMoonDirection(); F32 sunSize = (float)cosf(psky->getSunArcRadians()); sky_shader->uniform1f(LLShaderMgr::SUN_SIZE, sunSize); @@ -189,17 +189,10 @@ void LLDrawPoolWLSky::renderSkyHazeDeferred(const LLVector3& camPosLocal, F32 ca sky_shader->uniformMatrix4fv(LLShaderMgr::INVERSE_PROJECTION_MATRIX, 1, FALSE, inv_proj.m); - // clouds are rendered along with sky in adv atmo - if (gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS) && gSky.mVOSkyp->getCloudNoiseTex()) - { - sky_shader->bindTexture(LLShaderMgr::CLOUD_NOISE_MAP, gSky.mVOSkyp->getCloudNoiseTex()); - sky_shader->bindTexture(LLShaderMgr::CLOUD_NOISE_MAP_NEXT, gSky.mVOSkyp->getCloudNoiseTexNext()); - } - sky_shader->uniform3f(sCamPosLocal, camPosLocal.mV[0], camPosLocal.mV[1], camPosLocal.mV[2]); renderFsSky(camPosLocal, camHeightLocal, sky_shader); - + sky_shader->unbind(); } } @@ -357,10 +350,11 @@ void LLDrawPoolWLSky::renderSkyClouds(const LLVector3& camPosLocal, F32 camHeigh LLGLEnable blend(GL_BLEND); gGL.setSceneBlendType(LLRender::BT_ALPHA); - gGL.getTexUnit(0)->bind(gSky.mVOSkyp->getCloudNoiseTex()); - gGL.getTexUnit(1)->bind(gSky.mVOSkyp->getCloudNoiseTexNext()); - cloud_shader->bind(); + + cloud_shader->bindTexture(LLShaderMgr::CLOUD_NOISE_MAP, gSky.mVOSkyp->getCloudNoiseTex()); + cloud_shader->bindTexture(LLShaderMgr::CLOUD_NOISE_MAP_NEXT, gSky.mVOSkyp->getCloudNoiseTexNext()); + F32 blend_factor = LLEnvironment::instance().getCurrentSky()->getBlendFactor(); cloud_shader->uniform1f(LLShaderMgr::BLEND_FACTOR, blend_factor); @@ -505,21 +499,22 @@ void LLDrawPoolWLSky::renderDeferred(S32 pass) if (gPipeline.canUseWindLightShaders()) { { - // 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); + 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); } gGL.setColorMask(true, true); |