From e0febbe2e5af3969a296bcaa274c03cad29395e9 Mon Sep 17 00:00:00 2001 From: Patricio Gonzalez Vivo Date: Fri, 21 Oct 2022 10:30:36 -0400 Subject: [PATCH] fixing shadowmap textures on OSX --- CMakeLists.txt | 2 +- deps/vera | 2 +- src/sceneRender.cpp | 9 +++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ea5560e..2195e5c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.2) set(VERSION_MAJOR 3) set(VERSION_MINOR 0) -set(VERSION_PATCH 2) +set(VERSION_PATCH 3) set(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") project(glslViewer diff --git a/deps/vera b/deps/vera index 9f68003c..105eaf49 160000 --- a/deps/vera +++ b/deps/vera @@ -1 +1 @@ -Subproject commit 9f68003c784626b225c36db25910d858510eb67c +Subproject commit 105eaf49f42b4a8a45345147afea4e60911d0108 diff --git a/src/sceneRender.cpp b/src/sceneRender.cpp index 15b996d5..84b04b40 100644 --- a/src/sceneRender.cpp +++ b/src/sceneRender.cpp @@ -496,16 +496,17 @@ void SceneRender::updateBuffers(Uniforms& _uniforms, int _width, int _height) { if (_uniforms.functions["u_sceneNormal"].present && ( !normalFbo.isAllocated() || normalFbo.getWidth() != _width || normalFbo.getHeight() != _height ) ) - normalFbo.allocate(_width, _height, vera::GBUFFER_TEXTURE); + normalFbo.allocate(_width, _height, vera::GBUFFER_TEXTURE); + if (_uniforms.functions["u_scenePosition"].present && ( !positionFbo.isAllocated() || positionFbo.getWidth() != _width || positionFbo.getHeight() != _height ) ) - positionFbo.allocate(_width, _height, vera::GBUFFER_TEXTURE); + positionFbo.allocate(_width, _height, vera::GBUFFER_TEXTURE); for (size_t i = 0; i < buffersFbo.size(); i++) if (buffersFbo[i].isAllocated() || - buffersFbo[i].getWidth() != _width || buffersFbo[i].getHeight() ) + buffersFbo[i].getWidth() != _width || buffersFbo[i].getHeight() ) buffersFbo[i].allocate(_width, _height, vera::GBUFFER_TEXTURE); } @@ -620,7 +621,7 @@ void SceneRender::renderNormalBuffer(Uniforms& _uniforms) { } void SceneRender::renderPositionBuffer(Uniforms& _uniforms) { - if (!normalFbo.isAllocated()) + if (!positionFbo.isAllocated()) return; positionFbo.bind();