mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 12:28:02 +02:00
Fix for deferred lighting/ambient occlusion when glow effect is disabled.
This commit is contained in:
parent
98c51f87d2
commit
37b4fe5166
2 changed files with 5 additions and 16 deletions
|
@ -589,8 +589,6 @@ void Application::paintGL() {
|
||||||
bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
|
bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
|
||||||
PerformanceWarning warn(showWarnings, "Application::paintGL()");
|
PerformanceWarning warn(showWarnings, "Application::paintGL()");
|
||||||
|
|
||||||
const bool glowEnabled = Menu::getInstance()->isOptionChecked(MenuOption::EnableGlowEffect);
|
|
||||||
|
|
||||||
// Set the desired FBO texture size. If it hasn't changed, this does nothing.
|
// Set the desired FBO texture size. If it hasn't changed, this does nothing.
|
||||||
// Otherwise, it must rebuild the FBOs
|
// Otherwise, it must rebuild the FBOs
|
||||||
if (OculusManager::isConnected()) {
|
if (OculusManager::isConnected()) {
|
||||||
|
@ -665,16 +663,11 @@ void Application::paintGL() {
|
||||||
updateShadowMap();
|
updateShadowMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
//If we aren't using the glow shader, we have to clear the color and depth buffer
|
if (OculusManager::isConnected()) {
|
||||||
if (!glowEnabled) {
|
|
||||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
|
||||||
} else if (OculusManager::isConnected()) {
|
|
||||||
//Clear the color buffer to ensure that there isnt any residual color
|
//Clear the color buffer to ensure that there isnt any residual color
|
||||||
//Left over from when OR was not connected.
|
//Left over from when OR was not connected.
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
}
|
|
||||||
|
|
||||||
if (OculusManager::isConnected()) {
|
|
||||||
//When in mirror mode, use camera rotation. Otherwise, use body rotation
|
//When in mirror mode, use camera rotation. Otherwise, use body rotation
|
||||||
if (whichCamera.getMode() == CAMERA_MODE_MIRROR) {
|
if (whichCamera.getMode() == CAMERA_MODE_MIRROR) {
|
||||||
OculusManager::display(whichCamera.getRotation(), whichCamera.getPosition(), whichCamera);
|
OculusManager::display(whichCamera.getRotation(), whichCamera.getPosition(), whichCamera);
|
||||||
|
@ -687,9 +680,7 @@ void Application::paintGL() {
|
||||||
TV3DManager::display(whichCamera);
|
TV3DManager::display(whichCamera);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (glowEnabled) {
|
_glowEffect.prepare();
|
||||||
_glowEffect.prepare();
|
|
||||||
}
|
|
||||||
|
|
||||||
glMatrixMode(GL_MODELVIEW);
|
glMatrixMode(GL_MODELVIEW);
|
||||||
glPushMatrix();
|
glPushMatrix();
|
||||||
|
@ -697,9 +688,7 @@ void Application::paintGL() {
|
||||||
displaySide(whichCamera);
|
displaySide(whichCamera);
|
||||||
glPopMatrix();
|
glPopMatrix();
|
||||||
|
|
||||||
if (glowEnabled) {
|
_glowEffect.render();
|
||||||
_glowEffect.render();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Menu::getInstance()->isOptionChecked(MenuOption::Mirror)) {
|
if (Menu::getInstance()->isOptionChecked(MenuOption::Mirror)) {
|
||||||
renderRearViewMirror(_mirrorViewRect);
|
renderRearViewMirror(_mirrorViewRect);
|
||||||
|
|
|
@ -140,7 +140,7 @@ QOpenGLFramebufferObject* GlowEffect::render(bool toTexture) {
|
||||||
|
|
||||||
QOpenGLFramebufferObject* destFBO = toTexture ?
|
QOpenGLFramebufferObject* destFBO = toTexture ?
|
||||||
Application::getInstance()->getTextureCache()->getSecondaryFramebufferObject() : NULL;
|
Application::getInstance()->getTextureCache()->getSecondaryFramebufferObject() : NULL;
|
||||||
if (_isEmpty && _renderMode != DIFFUSE_ADD_MODE) {
|
if (!Menu::getInstance()->isOptionChecked(MenuOption::EnableGlowEffect) || (_isEmpty && _renderMode != DIFFUSE_ADD_MODE)) {
|
||||||
// copy the primary to the screen
|
// copy the primary to the screen
|
||||||
if (QOpenGLFramebufferObject::hasOpenGLFramebufferBlit()) {
|
if (QOpenGLFramebufferObject::hasOpenGLFramebufferBlit()) {
|
||||||
QOpenGLFramebufferObject::blitFramebuffer(destFBO, primaryFBO);
|
QOpenGLFramebufferObject::blitFramebuffer(destFBO, primaryFBO);
|
||||||
|
|
Loading…
Reference in a new issue