Hook floater with primary focus(and is therefore opaque) into the occlusion system.

This commit is contained in:
Shyotl
2012-08-20 01:46:57 -05:00
committed by Siana Gearz
parent a957d58939
commit e748b74c67

View File

@@ -951,9 +951,47 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot, boo
{
LLViewerCamera::sCurCameraID = LLViewerCamera::CAMERA_WORLD;
LLCachedControl<bool> render_depth_pre_pass("RenderDepthPrePass", false);
static LLCachedControl<bool> render_ui_occlusion("RenderUIOcclusion", false);
if(render_ui_occlusion && LLGLSLShader::sNoFixedFunction)
{
LLFloater* floaterp = gFloaterView->getFrontmost();
if(floaterp && floaterp->getVisible() && floaterp->isBackgroundVisible() && floaterp->isBackgroundOpaque())
{
LLGLDepthTest depth(GL_TRUE, GL_TRUE);
gGL.setColorMask(false, false);
gOcclusionProgram.bind();
LLRect rect = floaterp->calcScreenRect();
rect.stretch(-1);
gGL.matrixMode(LLRender::MM_PROJECTION);
gGL.pushMatrix();
gGL.loadIdentity();
gGL.ortho(0.0f, gViewerWindow->getWindowWidth(), 0.0f, gViewerWindow->getWindowHeight(), 0.f, 1.0f);
gGL.matrixMode(LLRender::MM_MODELVIEW);
gGL.pushMatrix();
gGL.loadIdentity();
gGL.color4fv( LLColor4::white.mV );
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
gGL.begin( LLRender::QUADS );
gGL.vertex3f(rect.mLeft, rect.mTop,0.f);
gGL.vertex3f(rect.mLeft, rect.mBottom,0.f);
gGL.vertex3f(rect.mRight, rect.mBottom,0.f);
gGL.vertex3f(rect.mRight, rect.mTop,0.f);
gGL.end();
gGL.matrixMode(LLRender::MM_PROJECTION);
gGL.popMatrix();
gGL.matrixMode(LLRender::MM_MODELVIEW);
gGL.popMatrix();
gOcclusionProgram.unbind();
}
}
static LLCachedControl<bool> render_depth_pre_pass("RenderDepthPrePass", false);
if (render_depth_pre_pass && LLGLSLShader::sNoFixedFunction)
{
LLGLDepthTest depth(GL_TRUE, GL_TRUE);
LLGLEnable cull_face(GL_CULL_FACE);
gGL.setColorMask(false, false);
U32 types[] = {
@@ -968,11 +1006,9 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot, boo
{
gPipeline.renderObjects(types[i], LLVertexBuffer::MAP_VERTEX, FALSE);
}
gOcclusionProgram.unbind();
}
gGL.setColorMask(true, false);
if (LLPipeline::sRenderDeferred && !LLPipeline::sUnderWaterRender)
{