Tweaks to stencil handling to allow masking out of sky (or geometry).

Reset stencil clear value to 0 after done clearing.
This commit is contained in:
Shyotl
2014-03-27 22:31:47 -05:00
parent 07a261a259
commit 894261862d
5 changed files with 7 additions and 0 deletions

View File

@@ -253,6 +253,7 @@ void LLDrawPoolWater::render(S32 pass)
glClearStencil(1);
glClear(GL_STENCIL_BUFFER_BIT);
glClearStencil(0);
LLGLEnable gls_stencil(GL_STENCIL_TEST);
glStencilOp(GL_KEEP, GL_REPLACE, GL_KEEP);
glStencilFunc(GL_ALWAYS, 0, 0xFFFFFFFF);

View File

@@ -326,6 +326,7 @@ void LLDrawPoolWLSky::renderDeferred(S32 pass)
const F32 camHeightLocal = LLWLParamManager::getInstance()->getDomeOffset() * LLWLParamManager::getInstance()->getDomeRadius();
LLGLDisable stencil(GL_STENCIL_TEST);
LLGLSNoFog disableFog;
LLGLDepthTest depth(GL_TRUE, GL_FALSE);
LLGLDisable clip(GL_CLIP_PLANE0);

View File

@@ -1676,6 +1676,7 @@ void LLManipTranslate::highlightIntersection(LLVector3 normal,
glStencilMask(stencil_mask);
glClearStencil(1);
glClear(GL_STENCIL_BUFFER_BIT);
glClearStencil(0);
LLGLEnable cull_face(GL_CULL_FACE);
LLGLEnable stencil(GL_STENCIL_TEST);
LLGLDepthTest depth (GL_TRUE, GL_FALSE, GL_ALWAYS);

View File

@@ -1528,6 +1528,7 @@ static LLFastTimer::DeclareTimer FTM_OCCLUSION_DRAW("Draw");
void LLSpatialGroup::doOcclusion(LLCamera* camera)
{
LLGLDisable stencil(GL_STENCIL_TEST);
if (mSpatialPartition->isOcclusionEnabled() && LLPipeline::sUseOcclusion > 1)
{
//static const LLCachedControl<BOOL> render_water_void_culling("RenderWaterVoidCulling", TRUE);
@@ -3867,6 +3868,8 @@ public:
return;
}
LLGLDisable stencil(GL_STENCIL_TEST);
group->rebuildGeom();
group->rebuildMesh();

View File

@@ -2334,6 +2334,7 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl
LLGLDisable blend(GL_BLEND);
LLGLDisable test(GL_ALPHA_TEST);
LLGLDisable stencil(GL_STENCIL_TEST);
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);