Showing the changes to libraries/render-utils/src/DeferredLightingEffect.cpp (1 of 13 files). Show all
Unified · Split
| @@ -12,7 +12,6 @@ · 11 unmodified lines | ||
| 12 | 12 | // include this before QOpenGLFramebufferObject, which includes an earlier version of OpenGL |
| 13 | 13 | #include <gpu/GPUConfig.h> |
| 14 | 14 | |
| 15 | −#include <QOpenGLFramebufferObject> | |
| 16 | 15 | |
| 17 | 16 | #include <GLMHelpers.h> |
| 18 | 17 | #include <PathUtils.h> |
| @@ -183,12 +182,13 @@ void DeferredLightingEffect::render() { · 164 unmodified lines | ||
| 183 | 182 | |
| 184 | 183 | auto textureCache = DependencyManager::get<TextureCache>(); |
| 185 | 184 | |
| 186 | − // QOpenGLFramebufferObject* primaryFBO = textureCache->getPrimaryFramebufferObject(); | |
| 187 | − // primaryFBO->release(); | |
| 185 | + glBindFramebuffer(GL_FRAMEBUFFER, 0 ); | |
| 186 | + | |
| 188 | 187 | QSize framebufferSize = textureCache->getFrameBufferSize(); |
| 189 | 188 | |
| 190 | − QOpenGLFramebufferObject* freeFBO = DependencyManager::get<GlowEffect>()->getFreeFramebufferObject(); | |
| 191 | − freeFBO->bind(); | |
| 189 | + auto freeFBO = DependencyManager::get<GlowEffect>()->getFreeFramebuffer(); | |
| 190 | + glBindFramebuffer(GL_FRAMEBUFFER, gpu::GLBackend::getFramebufferID(freeFBO)); | |
| 191 | + | |
| 192 | 192 | glClear(GL_COLOR_BUFFER_BIT); |
| 193 | 193 | // glEnable(GL_FRAMEBUFFER_SRGB); |
| 194 | 194 | |
| @@ -211,11 +211,7 @@ void DeferredLightingEffect::render() { · 16 unmodified lines | ||
| 211 | 211 | const int VIEWPORT_Y_INDEX = 1; |
| 212 | 212 | const int VIEWPORT_WIDTH_INDEX = 2; |
| 213 | 213 | const int VIEWPORT_HEIGHT_INDEX = 3; |
| 214 | − /* float sMin = viewport[VIEWPORT_X_INDEX] / (float)primaryFBO->width(); | |
| 215 | − float sWidth = viewport[VIEWPORT_WIDTH_INDEX] / (float)primaryFBO->width(); | |
| 216 | − float tMin = viewport[VIEWPORT_Y_INDEX] / (float)primaryFBO->height(); | |
| 217 | − float tHeight = viewport[VIEWPORT_HEIGHT_INDEX] / (float)primaryFBO->height(); | |
| 218 | − */ | |
| 214 | + | |
| 219 | 215 | float sMin = viewport[VIEWPORT_X_INDEX] / (float)framebufferSize.width(); |
| 220 | 216 | float sWidth = viewport[VIEWPORT_WIDTH_INDEX] / (float)framebufferSize.width(); |
| 221 | 217 | float tMin = viewport[VIEWPORT_Y_INDEX] / (float)framebufferSize.height(); |
| @@ -436,7 +432,9 @@ void DeferredLightingEffect::render() { · 214 unmodified lines | ||
| 436 | 432 | glActiveTexture(GL_TEXTURE0); |
| 437 | 433 | glBindTexture(GL_TEXTURE_2D, 0); |
| 438 | 434 | |
| 439 | − freeFBO->release(); | |
| 435 | + //freeFBO->release(); | |
| 436 | + glBindFramebuffer(GL_FRAMEBUFFER, 0); | |
| 437 | + | |
| 440 | 438 | // glDisable(GL_FRAMEBUFFER_SRGB); |
| 441 | 439 | |
| 442 | 440 | glDisable(GL_CULL_FACE); |
| @@ -445,12 +443,12 @@ void DeferredLightingEffect::render() { · 2 unmodified lines | ||
| 445 | 443 | glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_CONSTANT_ALPHA, GL_ONE); |
| 446 | 444 | glColorMask(true, true, true, false); |
| 447 | 445 | |
| 448 | − auto primaryFBO = gpu::GLBackend::getFramebufferID(textureCache->getPrimaryOpaqueFramebuffer()); | |
| 446 | + auto primaryFBO = gpu::GLBackend::getFramebufferID(textureCache->getPrimaryFramebuffer()); | |
| 449 | 447 | glBindFramebuffer(GL_DRAW_FRAMEBUFFER, primaryFBO); |
| 450 | 448 | |
| 451 | 449 | //primaryFBO->bind(); |
| 452 | 450 | |
| 453 | − glBindTexture(GL_TEXTURE_2D, freeFBO->texture()); | |
| 451 | + glBindTexture(GL_TEXTURE_2D, gpu::GLBackend::getTextureID(freeFBO->getRenderBuffer(0))); | |
| 454 | 452 | glEnable(GL_TEXTURE_2D); |
| 455 | 453 | |
| 456 | 454 | glPushMatrix(); |