History

Fix for specular issue on Nvidia, try passing along material colors.

Andrzej Kapolka committed 12 years ago

Commit 70c8c141 parent 9caa4d35 files · +16 −10Browse files

Showing the changes to interface/src/renderer/DeferredLightingEffect.cpp (1 of 5 files). Show all

Unified · Split

interface/src/renderer/DeferredLightingEffect.cpp+8−2
@@ -28,9 +28,15 @@ void DeferredLightingEffect::init() { · 27 unmodified lines
28 28
29void DeferredLightingEffect::prepare() {29void DeferredLightingEffect::prepare() {
30 // clear the normal and specular buffers30 // clear the normal and specular buffers
31 Application::getInstance()->getTextureCache()->setPrimaryDrawBuffers(false, true, true);31 Application::getInstance()->getTextureCache()->setPrimaryDrawBuffers(false, true, false);
32 glClear(GL_COLOR_BUFFER_BIT);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
36void DeferredLightingEffect::render() {42void DeferredLightingEffect::render() {