diff options
author | Jonathan Goodman <geenz@lindenlab.com> | 2022-11-14 18:12:22 +0000 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2022-11-14 18:12:22 +0000 |
commit | 97277e74a9d966ed441e51f844f9012f55cca3dc (patch) | |
tree | ed6a5c00a5065951ff9f77bf0277fb202dff0c0e /indra/llrender/llrender.cpp | |
parent | 843a5c287e34855fb7bd4882d8d0a106e987a9f7 (diff) |
Merged in SL-18332 (pull request #1194)
First pass of Screen Space Reflections
Approved-by: Dave Parks
Diffstat (limited to 'indra/llrender/llrender.cpp')
-rw-r--r-- | indra/llrender/llrender.cpp | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 39e3a0243c..c58fbe6c8e 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -1087,13 +1087,20 @@ void LLRender::syncMatrices() { //update projection matrix, normal, and MVP glh::matrix4f& mat = mMatrix[MM_PROJECTION][mMatIdx[MM_PROJECTION]]; - // it would be nice to have this automatically track the state of the proj matrix - // but certain render paths (deferred lighting) require it to be mismatched *sigh* - //if (shader->getUniformLocation(LLShaderMgr::INVERSE_PROJECTION_MATRIX)) - //{ - // glh::matrix4f inv_proj = mat.inverse(); - // shader->uniformMatrix4fv(LLShaderMgr::INVERSE_PROJECTION_MATRIX, 1, FALSE, inv_proj.m); - //} + // GZ: This was previously disabled seemingly due to a bug involving the deferred renderer's regular pushing and popping of mats. + // We're reenabling this and cleaning up the code around that - that would've been the appropriate course initially. + // Anything beyond the standard proj and inv proj mats are special cases. Please setup special uniforms accordingly in the future. + if (shader->getUniformLocation(LLShaderMgr::INVERSE_PROJECTION_MATRIX)) + { + glh::matrix4f inv_proj = mat.inverse(); + shader->uniformMatrix4fv(LLShaderMgr::INVERSE_PROJECTION_MATRIX, 1, FALSE, inv_proj.m); + } + + // Used by some full screen effects - such as full screen lights, glow, etc. + if (shader->getUniformLocation(LLShaderMgr::IDENTITY_MATRIX)) + { + shader->uniformMatrix4fv(LLShaderMgr::IDENTITY_MATRIX, 1, GL_FALSE, glh::matrix4f::identity().m); + } shader->uniformMatrix4fv(name[MM_PROJECTION], 1, GL_FALSE, mat.m); shader->mMatHash[MM_PROJECTION] = mMatHash[MM_PROJECTION]; |