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:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -1225,7 +1225,8 @@ void render_ui(F32 zoom_factor, int subfield, bool tiling)
|
||||
/// and then display it again with compositor effects.
|
||||
/// Using render to texture would be faster/better, but I don't have a
|
||||
/// grasp of their full display stack just yet.
|
||||
LLPostProcess::getInstance()->apply(gViewerWindow->getWindowDisplayWidth(), gViewerWindow->getWindowDisplayHeight());
|
||||
if(gPipeline.canUseVertexShaders())
|
||||
LLPostProcess::getInstance()->apply(gViewerWindow->getWindowDisplayWidth(), gViewerWindow->getWindowDisplayHeight());
|
||||
|
||||
render_hud_elements();
|
||||
render_hud_attachments();
|
||||
|
||||
@@ -178,7 +178,7 @@ LLViewerRegion* LLWorld::addRegion(const U64 ®ion_handle, const LLHost &host,
|
||||
|
||||
U32 iindex = 0;
|
||||
U32 jindex = 0;
|
||||
mWidth = region_size_x; //MegaRegion
|
||||
mWidth = region_size_x; //MegaRegion
|
||||
mWidthInMeters = mWidth * mScale; //MegaRegion
|
||||
from_region_handle(region_handle, &iindex, &jindex);
|
||||
S32 x = (S32)(iindex/256); //MegaRegion
|
||||
@@ -1266,16 +1266,16 @@ void process_enable_simulator(LLMessageSystem *msg, void **user_data)
|
||||
// which simulator should we modify?
|
||||
LLHost sim(ip_u32, port);
|
||||
|
||||
U32 region_size_x = 256;
|
||||
msg->getU32Fast(_PREHASH_SimulatorInfo, _PREHASH_RegionSizeX, region_size_x);
|
||||
|
||||
U32 region_size_y = 256;
|
||||
msg->getU32Fast(_PREHASH_SimulatorInfo, _PREHASH_RegionSizeY, region_size_y);
|
||||
|
||||
if (region_size_y == 0 || region_size_x == 0)
|
||||
{
|
||||
region_size_x = 256;
|
||||
region_size_y = 256;
|
||||
U32 region_size_x = 256;
|
||||
msg->getU32Fast(_PREHASH_SimulatorInfo, _PREHASH_RegionSizeX, region_size_x);
|
||||
|
||||
U32 region_size_y = 256;
|
||||
msg->getU32Fast(_PREHASH_SimulatorInfo, _PREHASH_RegionSizeY, region_size_y);
|
||||
|
||||
if (region_size_y == 0 || region_size_x == 0)
|
||||
{
|
||||
region_size_x = 256;
|
||||
region_size_y = 256;
|
||||
}
|
||||
|
||||
// Viewer trusts the simulator.
|
||||
|
||||
Reference in New Issue
Block a user