From 32b56a4bf7242a8ce13af1bf436748d4f2a19df1 Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Mon, 28 Sep 2015 16:09:57 -0700 Subject: [PATCH 1/2] fix the slight flicker that's being caused by error in calculating the model inverse matrix --- libraries/gpu/src/gpu/GLBackendTransform.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/gpu/src/gpu/GLBackendTransform.cpp b/libraries/gpu/src/gpu/GLBackendTransform.cpp index 99db7b38e8..b2408be172 100755 --- a/libraries/gpu/src/gpu/GLBackendTransform.cpp +++ b/libraries/gpu/src/gpu/GLBackendTransform.cpp @@ -97,7 +97,11 @@ void GLBackend::TransformStageState::preUpdate(size_t commandIndex, const Stereo if (_invalidModel) { _model.getMatrix(_object._model); - _model.getInverseMatrix(_object._modelInverse); + + // FIXME - we don't want to be using glm::inverse() here but it fixes the flickering issue we are + // seeing with slightly physical objects. + //_model.getInverseMatrix(_object._modelInverse); + _object._modelInverse =glm::inverse(_object._model); } if (_invalidView || _invalidProj || _invalidViewport) { From 670df7e443dbd9c5d68b17129b4371d7864cbcc8 Mon Sep 17 00:00:00 2001 From: Brad Hefta-Gaub Date: Mon, 28 Sep 2015 17:36:42 -0700 Subject: [PATCH 2/2] fix coding standard issue and comment --- libraries/gpu/src/gpu/GLBackendTransform.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libraries/gpu/src/gpu/GLBackendTransform.cpp b/libraries/gpu/src/gpu/GLBackendTransform.cpp index b2408be172..4a55155a86 100755 --- a/libraries/gpu/src/gpu/GLBackendTransform.cpp +++ b/libraries/gpu/src/gpu/GLBackendTransform.cpp @@ -99,9 +99,10 @@ void GLBackend::TransformStageState::preUpdate(size_t commandIndex, const Stereo _model.getMatrix(_object._model); // FIXME - we don't want to be using glm::inverse() here but it fixes the flickering issue we are - // seeing with slightly physical objects. + // seeing with planky blocks in toybox. Our implementation of getInverseMatrix() is buggy in cases + // of non-uniform scale. We need to fix that. In the mean time, glm::inverse() works. //_model.getInverseMatrix(_object._modelInverse); - _object._modelInverse =glm::inverse(_object._model); + _object._modelInverse = glm::inverse(_object._model); } if (_invalidView || _invalidProj || _invalidViewport) {