Showing the changes to interface/src/renderer/DeferredLightingEffect.cpp (1 of 5 files). Show all
Unified · Split
| @@ -28,9 +28,15 @@ void DeferredLightingEffect::init() { · 27 unmodified lines | ||
| 28 | 28 | |
| 29 | 29 | void DeferredLightingEffect::prepare() { |
| 30 | 30 | // clear the normal and specular buffers |
| 31 | − Application::getInstance()->getTextureCache()->setPrimaryDrawBuffers(false, true, true); | |
| 31 | + Application::getInstance()->getTextureCache()->setPrimaryDrawBuffers(false, true, false); | |
| 32 | 32 | glClear(GL_COLOR_BUFFER_BIT); |
| 33 | − Application::getInstance()->getTextureCache()->setPrimaryDrawBuffers(true, false); | |
| 33 | + Application::getInstance()->getTextureCache()->setPrimaryDrawBuffers(false, false, true); | |
| 34 | + // clearing to zero alpha for specular causes problems on my Nvidia card; clear to lowest non-zero value instead | |
| 35 | + const float MAX_SPECULAR_EXPONENT = 128.0f; | |
| 36 | + glClearColor(0.0f, 0.0f, 0.0f, 1.0f / MAX_SPECULAR_EXPONENT); | |
| 37 | + glClear(GL_COLOR_BUFFER_BIT); | |
| 38 | + glClearColor(0.0f, 0.0f, 0.0f, 0.0f); | |
| 39 | + Application::getInstance()->getTextureCache()->setPrimaryDrawBuffers(true, false, false); | |
| 34 | 40 | } |
| 35 | 41 | |
| 36 | 42 | void DeferredLightingEffect::render() { |