Commit 13568204 authored by Rye Mutt's avatar Rye Mutt 🍞
Browse files

Clean up matrix inverse in bindDeferredShader

parent 5fd28bf0
......@@ -8591,12 +8591,12 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* light_
stop_glerror();
}
glh::matrix4f projection = get_current_projection();
glh::matrix4f inv_proj = projection.inverse();
if (shader.getUniformLocation(LLShaderMgr::INVERSE_PROJECTION_MATRIX) != -1)
{
shader.uniformMatrix4fv(LLShaderMgr::INVERSE_PROJECTION_MATRIX, 1, FALSE, inv_proj.m);
LLMatrix4a inv_proj;
inv_proj.loadu(get_current_projection().m);
inv_proj.invert();
shader.uniformMatrix4fv(LLShaderMgr::INVERSE_PROJECTION_MATRIX, 1, FALSE, inv_proj.getF32ptr());
}
if (shader.getUniformLocation(LLShaderMgr::VIEWPORT) != -1)
......@@ -8756,8 +8756,11 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* light_
if (shader.getUniformLocation(LLShaderMgr::DEFERRED_NORM_MATRIX) >= 0)
{
glh::matrix4f norm_mat = get_current_modelview().inverse().transpose();
shader.uniformMatrix4fv(LLShaderMgr::DEFERRED_NORM_MATRIX, 1, FALSE, norm_mat.m);
LLMatrix4a norm_mat;
norm_mat.loadu(get_current_modelview().m);
norm_mat.invert();
norm_mat.transpose();
shader.uniformMatrix4fv(LLShaderMgr::DEFERRED_NORM_MATRIX, 1, FALSE, norm_mat.getF32ptr());
}
shader.uniform4fv(LLShaderMgr::SUNLIGHT_COLOR, 1, mSunDiffuse.mV);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment