From 11f2d740308df31ed56ccd2c2d36771e6b1268bc Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Thu, 9 Jul 2015 17:33:25 -0700 Subject: [PATCH] Simple cleaning to remove dependancies on the viewStateInterface in the deferredLightingEffect --- .../render-utils/src/DeferredLightingEffect.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libraries/render-utils/src/DeferredLightingEffect.cpp b/libraries/render-utils/src/DeferredLightingEffect.cpp index a721e0cad3..9bda5b8048 100644 --- a/libraries/render-utils/src/DeferredLightingEffect.cpp +++ b/libraries/render-utils/src/DeferredLightingEffect.cpp @@ -9,7 +9,6 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -// include this before QOpenGLFramebufferObject, which includes an earlier version of OpenGL #include #include @@ -24,7 +23,7 @@ #include "TextureCache.h" #include "gpu/Batch.h" -#include "gpu/GLBackend.h" +#include "gpu/Context.h" #include "gpu/StandardShaderLib.h" #include "simple_vert.h" @@ -269,7 +268,7 @@ void DeferredLightingEffect::render(RenderArgs* args) { // Fetch the ViewMatrix; glm::mat4 invViewMat; - _viewState->getViewTransform().getMatrix(invViewMat); + invViewMat = args->_viewFrustum->getView(); auto& program = _directionalLight; const LightLocations* locations = &_directionalLightLocations; @@ -344,7 +343,8 @@ void DeferredLightingEffect::render(RenderArgs* args) { float left, right, bottom, top, nearVal, farVal; glm::vec4 nearClipPlane, farClipPlane; - _viewState->computeOffAxisFrustum(left, right, bottom, top, nearVal, farVal, nearClipPlane, farClipPlane); + args->_viewFrustum->computeOffAxisFrustum(left, right, bottom, top, nearVal, farVal, nearClipPlane, farClipPlane); + batch._glUniform1f(locations->nearLocation, nearVal); float depthScale = (farVal - nearVal) / farVal; @@ -394,9 +394,9 @@ void DeferredLightingEffect::render(RenderArgs* args) { // enlarge the scales slightly to account for tesselation const float SCALE_EXPANSION = 0.05f; - - const glm::vec3& eyePoint = _viewState->getCurrentViewFrustum()->getPosition(); - float nearRadius = glm::distance(eyePoint, _viewState->getCurrentViewFrustum()->getNearTopLeft()); + + auto eyePoint = args->_viewFrustum->getPosition(); + float nearRadius = glm::distance(eyePoint, args->_viewFrustum->getNearTopLeft()); auto geometryCache = DependencyManager::get();