Set blendtype back to BT_ALPHA after postprocess, because ui assumes such [aka: glBlendFunc(GL_SOURCE_ALPHA, GL_ONE_MINUS_SOURCE_ALPHA)]. Also, line-ending fixup.. again.

This commit is contained in:
Shyotl
2011-12-30 17:19:23 -06:00
parent 23b97efb69
commit 48552e3027
3 changed files with 23 additions and 27 deletions

View File

@@ -247,10 +247,6 @@ void LLPostProcess::applyColorFilterShader(void)
gPostColorFilterProgram.uniform3fv("contrastBase", 1, LLVector3(baseR, baseG, baseB).mV);
gPostColorFilterProgram.uniform1f("saturation", tweaks.getSaturation());
gPostColorFilterProgram.uniform3fv("lumWeights", 1, LLVector3(LUMINANCE_R, LUMINANCE_G, LUMINANCE_B).mV);
LLGLEnable blend(GL_BLEND);
gGL.setSceneBlendType(LLRender::BT_REPLACE);
LLGLDepthTest depth(GL_FALSE);
/// Draw a screen space quad
drawOrthoQuad(QUAD_NORMAL);
@@ -271,11 +267,7 @@ void LLPostProcess::applyNightVisionShader(void)
gPostNightVisionProgram.uniform1f("noiseStrength", tweaks.getNoiseStrength());
mNoiseTextureScale = 0.001f + ((100.f - tweaks.getNoiseSize()) / 100.f);
mNoiseTextureScale *= (mScreenHeight / NOISE_SIZE);
LLGLEnable blend(GL_BLEND);
gGL.setSceneBlendType(LLRender::BT_REPLACE);
LLGLDepthTest depth(GL_FALSE);
/// Draw a screen space quad
drawOrthoQuad(QUAD_NOISE);
gPostNightVisionProgram.unbind();
@@ -291,9 +283,6 @@ void LLPostProcess::applyGaussBlurShader(void)
gGL.getTexUnit(0)->bind(mSceneRenderTexture);
LLGLEnable blend(GL_BLEND);
LLGLDepthTest depth(GL_FALSE);
gGL.setSceneBlendType(LLRender::BT_REPLACE);
GLint horiz_pass = gPostGaussianBlurProgram.getUniformLocation("horizontalPass");
for(int i = 0;i<pass_count;++i)
{
@@ -316,9 +305,13 @@ void LLPostProcess::doEffects(void)
copyFrameBuffer();
/// Clear the frame buffer.
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
LLGLDisable(GL_DEPTH_TEST);
//glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
//glClear(GL_COLOR_BUFFER_BIT);
//Disable depth. Set blendmode to replace.
LLGLDepthTest depth(GL_FALSE);
LLGLEnable blend(GL_BLEND);
gGL.setSceneBlendType(LLRender::BT_REPLACE);
/// Change to an orthogonal view
gGL.matrixMode(LLRender::MM_PROJECTION);
@@ -341,6 +334,8 @@ void LLPostProcess::doEffects(void)
gGL.matrixMode( LLRender::MM_MODELVIEW );
gGL.popMatrix();
gGL.setSceneBlendType(LLRender::BT_ALPHA); //Restore blendstate. Alpha is ASSUMED for hud/ui render, etc.
gGL.getTexUnit(1)->disable();
checkError();
}