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 | _directionalLightCascadedShadowMapLocations); | 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 | void DeferredLightingEffect::render() { | 36 | void DeferredLightingEffect::render() { |
| 30 | // perform deferred lighting, rendering to free fbo | 37 | // perform deferred lighting, rendering to free fbo |
| 31 | glPushMatrix(); | 38 | glPushMatrix(); |
| @@ -38,6 +45,7 @@ void DeferredLightingEffect::render() { · 6 unmodified lines | |||
| 38 | glDisable(GL_BLEND); | 45 | glDisable(GL_BLEND); |
| 39 | glDisable(GL_LIGHTING); | 46 | glDisable(GL_LIGHTING); |
| 40 | glDisable(GL_DEPTH_TEST); | 47 | glDisable(GL_DEPTH_TEST); |
| 48 | glDisable(GL_COLOR_MATERIAL); | ||
| 41 | glDepthMask(false); | 49 | glDepthMask(false); |
| 42 | 50 | ||
| 43 | QOpenGLFramebufferObject* primaryFBO = Application::getInstance()->getTextureCache()->getPrimaryFramebufferObject(); | 51 | QOpenGLFramebufferObject* primaryFBO = Application::getInstance()->getTextureCache()->getPrimaryFramebufferObject(); |
| @@ -133,6 +141,7 @@ void DeferredLightingEffect::render() { · 89 unmodified lines | |||
| 133 | glDisable(GL_TEXTURE_2D); | 141 | glDisable(GL_TEXTURE_2D); |
| 134 | 142 | ||
| 135 | glEnable(GL_LIGHTING); | 143 | glEnable(GL_LIGHTING); |
| 144 | glEnable(GL_COLOR_MATERIAL); | ||
| 136 | glEnable(GL_DEPTH_TEST); | 145 | glEnable(GL_DEPTH_TEST); |
| 137 | glDepthMask(true); | 146 | glDepthMask(true); |
| 138 | 147 | ||