Restore setting the inv proj matrix for advanced atmo render path.

Set nSight debug setting to 0 to fix ALM snapshots.

Add popMatrix call to balance push around heavenly body rendering in ALM and fix mat stack overflow.
meow-7.2.2
Graham Linden 2018-07-09 18:27:01 +01:00
parent 0bf678e23b
commit a9fba594dd
2 changed files with 12 additions and 4 deletions

View File

@ -8664,7 +8664,7 @@
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
<integer>0</integer>
</map>
<key>RenderLocalLights</key>
<map>

View File

@ -116,9 +116,6 @@ void LLDrawPoolWLSky::endDeferredPass(S32 pass)
void LLDrawPoolWLSky::renderFsSky(const LLVector3& camPosLocal, F32 camHeightLocal, LLGLSLShader * shader) const
{
// Draw WL Sky w/ normal cam pos (where you are) for adv atmo sky
//gGL.syncMatrices();
sky_shader->uniform3f(sCamPosLocal, camPosLocal.mV[0], camPosLocal.mV[1], camPosLocal.mV[2]);
gSky.mVOWLSkyp->drawFsSky();
}
@ -176,6 +173,13 @@ void LLDrawPoolWLSky::renderSkyHazeDeferred(const LLVector3& camPosLocal, F32 ca
sky_shader->uniform3fv(LLShaderMgr::DEFERRED_SUN_DIR, 1, sun_dir.mV);
sky_shader->uniform3fv(LLShaderMgr::DEFERRED_MOON_DIR, 1, moon_dir.mV);
llassert(sky_shader->getUniformLocation(LLShaderMgr::INVERSE_PROJECTION_MATRIX));
glh::matrix4f proj_mat = get_current_projection();
glh::matrix4f inv_proj = proj_mat.inverse();
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())
{
@ -183,6 +187,8 @@ void LLDrawPoolWLSky::renderSkyHazeDeferred(const LLVector3& camPosLocal, F32 ca
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();
@ -459,6 +465,8 @@ void LLDrawPoolWLSky::renderDeferred(S32 pass)
gGL.translatef(origin.mV[0], origin.mV[1], origin.mV[2]);
renderHeavenlyBodies();
gGL.popMatrix();
}
}
gGL.setColorMask(true, true);