mirror of
https://github.com/lubosz/overte.git
synced 2025-04-25 18:15:26 +02:00
Merge pull request #5297 from samcake/daft
Remove unecessary dependencies in DeferredLightingEffect
This commit is contained in:
commit
cf7f3336d0
1 changed files with 7 additions and 7 deletions
|
@ -9,7 +9,6 @@
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
// 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 <gpu/GPUConfig.h>
|
#include <gpu/GPUConfig.h>
|
||||||
|
|
||||||
#include <GLMHelpers.h>
|
#include <GLMHelpers.h>
|
||||||
|
@ -24,7 +23,7 @@
|
||||||
#include "TextureCache.h"
|
#include "TextureCache.h"
|
||||||
|
|
||||||
#include "gpu/Batch.h"
|
#include "gpu/Batch.h"
|
||||||
#include "gpu/GLBackend.h"
|
#include "gpu/Context.h"
|
||||||
#include "gpu/StandardShaderLib.h"
|
#include "gpu/StandardShaderLib.h"
|
||||||
|
|
||||||
#include "simple_vert.h"
|
#include "simple_vert.h"
|
||||||
|
@ -269,7 +268,7 @@ void DeferredLightingEffect::render(RenderArgs* args) {
|
||||||
|
|
||||||
// Fetch the ViewMatrix;
|
// Fetch the ViewMatrix;
|
||||||
glm::mat4 invViewMat;
|
glm::mat4 invViewMat;
|
||||||
_viewState->getViewTransform().getMatrix(invViewMat);
|
invViewMat = args->_viewFrustum->getView();
|
||||||
|
|
||||||
auto& program = _directionalLight;
|
auto& program = _directionalLight;
|
||||||
const LightLocations* locations = &_directionalLightLocations;
|
const LightLocations* locations = &_directionalLightLocations;
|
||||||
|
@ -344,7 +343,8 @@ void DeferredLightingEffect::render(RenderArgs* args) {
|
||||||
|
|
||||||
float left, right, bottom, top, nearVal, farVal;
|
float left, right, bottom, top, nearVal, farVal;
|
||||||
glm::vec4 nearClipPlane, farClipPlane;
|
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);
|
batch._glUniform1f(locations->nearLocation, nearVal);
|
||||||
|
|
||||||
float depthScale = (farVal - nearVal) / farVal;
|
float depthScale = (farVal - nearVal) / farVal;
|
||||||
|
@ -395,8 +395,8 @@ void DeferredLightingEffect::render(RenderArgs* args) {
|
||||||
// enlarge the scales slightly to account for tesselation
|
// enlarge the scales slightly to account for tesselation
|
||||||
const float SCALE_EXPANSION = 0.05f;
|
const float SCALE_EXPANSION = 0.05f;
|
||||||
|
|
||||||
const glm::vec3& eyePoint = _viewState->getCurrentViewFrustum()->getPosition();
|
auto eyePoint = args->_viewFrustum->getPosition();
|
||||||
float nearRadius = glm::distance(eyePoint, _viewState->getCurrentViewFrustum()->getNearTopLeft());
|
float nearRadius = glm::distance(eyePoint, args->_viewFrustum->getNearTopLeft());
|
||||||
|
|
||||||
auto geometryCache = DependencyManager::get<GeometryCache>();
|
auto geometryCache = DependencyManager::get<GeometryCache>();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue