History

Removing almost all the QFramebufferObject (instead in overlay layer) in favor of gpu::Framebuffer, eveyrthing seems to work properly

Sam Gateau committed 11 years ago

Commit fec52f61 parent 870302313 files · +133 −288Browse files

Showing the changes to interface/src/Application.cpp (1 of 13 files). Show all

Unified · Split

interface/src/Application.cpp+4−8
@@ -35,7 +35,6 @@ · 34 unmodified lines
35#include <QMouseEvent>35#include <QMouseEvent>
36#include <QNetworkReply>36#include <QNetworkReply>
37#include <QNetworkDiskCache>37#include <QNetworkDiskCache>
38#include <QOpenGLFramebufferObject>
39#include <QObject>38#include <QObject>
40#include <QWheelEvent>39#include <QWheelEvent>
41#include <QScreen>40#include <QScreen>
@@ -798,7 +797,6 @@ void Application::paintGL() { · 756 unmodified lines
798 DependencyManager::get<GlowEffect>()->prepare();797 DependencyManager::get<GlowEffect>()->prepare();
799 798
800 // Viewport is assigned to the size of the framebuffer799 // Viewport is assigned to the size of the framebuffer
801 // QSize size = DependencyManager::get<TextureCache>()->getPrimaryFramebufferObject()->size();
802 QSize size = DependencyManager::get<TextureCache>()->getFrameBufferSize();800 QSize size = DependencyManager::get<TextureCache>()->getFrameBufferSize();
803 glViewport(0, 0, size.width(), size.height());801 glViewport(0, 0, size.width(), size.height());
804 802
@@ -2637,11 +2635,8 @@ void Application::updateShadowMap() { · 1832 unmodified lines
2637 activeRenderingThread = QThread::currentThread();2635 activeRenderingThread = QThread::currentThread();
2638 2636
2639 PerformanceTimer perfTimer("shadowMap");2637 PerformanceTimer perfTimer("shadowMap");
2640// QOpenGLFramebufferObject* fbo = DependencyManager::get<TextureCache>()->getShadowFramebufferObject();
2641// fbo->bind();
2642 auto shadowFramebuffer = DependencyManager::get<TextureCache>()->getShadowFramebuffer();2638 auto shadowFramebuffer = DependencyManager::get<TextureCache>()->getShadowFramebuffer();
2643 GLuint shadowFBO = gpu::GLBackend::getFramebufferID(shadowFramebuffer);2639 glBindFramebuffer(GL_FRAMEBUFFER, gpu::GLBackend::getFramebufferID(shadowFramebuffer));
2644 glBindFramebuffer(GL_FRAMEBUFFER, shadowFBO);
2645 2640
2646 glEnable(GL_DEPTH_TEST);2641 glEnable(GL_DEPTH_TEST);
2647 glClear(GL_DEPTH_BUFFER_BIT);2642 glClear(GL_DEPTH_BUFFER_BIT);
@@ -2838,7 +2833,8 @@ PickRay Application::computePickRay(float x, float y) { · 190 unmodified lines
2838}2833}
2839 2834
2840QImage Application::renderAvatarBillboard() {2835QImage Application::renderAvatarBillboard() {
2841 DependencyManager::get<TextureCache>()->getPrimaryFramebufferObject()->bind();2836 auto primaryFramebuffer = DependencyManager::get<TextureCache>()->getPrimaryFramebuffer();
2837 glBindFramebuffer(GL_FRAMEBUFFER, gpu::GLBackend::getFramebufferID(primaryFramebuffer));
2842 2838
2843 // the "glow" here causes an alpha of one2839 // the "glow" here causes an alpha of one
2844 Glower glower;2840 Glower glower;
@@ -2851,7 +2847,7 @@ QImage Application::renderAvatarBillboard() { · 6 unmodified lines
2851 QImage image(BILLBOARD_SIZE, BILLBOARD_SIZE, QImage::Format_ARGB32);2847 QImage image(BILLBOARD_SIZE, BILLBOARD_SIZE, QImage::Format_ARGB32);
2852 glReadPixels(0, 0, BILLBOARD_SIZE, BILLBOARD_SIZE, GL_BGRA, GL_UNSIGNED_BYTE, image.bits());2848 glReadPixels(0, 0, BILLBOARD_SIZE, BILLBOARD_SIZE, GL_BGRA, GL_UNSIGNED_BYTE, image.bits());
2853 2849
2854 DependencyManager::get<TextureCache>()->getPrimaryFramebufferObject()->release();2850 glBindFramebuffer(GL_FRAMEBUFFER, 0);
2855 2851
2856 return image;2852 return image;
2857}2853}