Showing the changes to interface/src/renderer/DeferredLightingEffect.cpp (1 of 16 files). Show all
Unified · Split
| @@ -26,6 +26,13 @@ void DeferredLightingEffect::init() { · 25 unmodified lines | ||
| 26 | 26 | _directionalLightCascadedShadowMapLocations); |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | +void DeferredLightingEffect::prepare() { | |
| 30 | + // clear the normal buffer | |
| 31 | + Application::getInstance()->getTextureCache()->setPrimaryDrawBuffers(false, true); | |
| 32 | + glClear(GL_COLOR_BUFFER_BIT); | |
| 33 | + Application::getInstance()->getTextureCache()->setPrimaryDrawBuffers(true, false); | |
| 34 | +} | |
| 35 | + | |
| 29 | 36 | void DeferredLightingEffect::render() { |
| 30 | 37 | // perform deferred lighting, rendering to free fbo |
| 31 | 38 | glPushMatrix(); |
| @@ -38,6 +45,7 @@ void DeferredLightingEffect::render() { · 6 unmodified lines | ||
| 38 | 45 | glDisable(GL_BLEND); |
| 39 | 46 | glDisable(GL_LIGHTING); |
| 40 | 47 | glDisable(GL_DEPTH_TEST); |
| 48 | + glDisable(GL_COLOR_MATERIAL); | |
| 41 | 49 | glDepthMask(false); |
| 42 | 50 | |
| 43 | 51 | QOpenGLFramebufferObject* primaryFBO = Application::getInstance()->getTextureCache()->getPrimaryFramebufferObject(); |
| @@ -133,6 +141,7 @@ void DeferredLightingEffect::render() { · 89 unmodified lines | ||
| 133 | 141 | glDisable(GL_TEXTURE_2D); |
| 134 | 142 | |
| 135 | 143 | glEnable(GL_LIGHTING); |
| 144 | + glEnable(GL_COLOR_MATERIAL); | |
| 136 | 145 | glEnable(GL_DEPTH_TEST); |
| 137 | 146 | glDepthMask(true); |
| 138 | 147 | |