summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpoolbump.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lldrawpoolbump.cpp')
-rw-r--r--indra/newview/lldrawpoolbump.cpp52
1 files changed, 35 insertions, 17 deletions
diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp
index 8db6a10e26..cd9ff0192e 100644
--- a/indra/newview/lldrawpoolbump.cpp
+++ b/indra/newview/lldrawpoolbump.cpp
@@ -443,7 +443,20 @@ void LLDrawPoolBump::beginFullbrightShiny()
}
LLCubeMap* cube_map = gSky.mVOSkyp ? gSky.mVOSkyp->getCubeMap() : NULL;
- if( cube_map )
+
+ if (cube_map)
+ {
+ // Make sure that texture coord generation happens for tex unit 1, as that's the one we use for
+ // the cube map in the one pass shiny shaders
+ gGL.getTexUnit(1)->disable();
+ cube_channel = shader->enableTexture(LLViewerShaderMgr::ENVIRONMENT_MAP, LLTexUnit::TT_CUBE_MAP);
+ cube_map->enableTexture(cube_channel);
+ diffuse_channel = shader->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
+
+ gGL.getTexUnit(cube_channel)->bind(cube_map);
+ gGL.getTexUnit(0)->activate();
+ }
+
{
LLMatrix4 mat;
mat.initRows(LLVector4(gGLModelView+0),
@@ -464,16 +477,14 @@ void LLDrawPoolBump::beginFullbrightShiny()
LLVector4 vec4(vec, gShinyOrigin.mV[3]);
shader->uniform4fv(LLViewerShaderMgr::SHINY_ORIGIN, 1, vec4.mV);
- cube_map->setMatrix(1);
- // Make sure that texture coord generation happens for tex unit 1, as that's the one we use for
- // the cube map in the one pass shiny shaders
- gGL.getTexUnit(1)->disable();
- cube_channel = shader->enableTexture(LLViewerShaderMgr::ENVIRONMENT_MAP, LLTexUnit::TT_CUBE_MAP);
- cube_map->enableTexture(cube_channel);
- diffuse_channel = shader->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
-
- gGL.getTexUnit(cube_channel)->bind(cube_map);
- gGL.getTexUnit(0)->activate();
+ if (LLPipeline::sReflectionProbesEnabled)
+ {
+ gPipeline.bindReflectionProbes(*shader);
+ }
+ else
+ {
+ gPipeline.setEnvMat(*shader);
+ }
}
if (mShaderLevel > 1)
@@ -488,7 +499,6 @@ void LLDrawPoolBump::renderFullbrightShiny()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_RENDER_SHINY);
- if( gSky.mVOSkyp->getCubeMap() )
{
LLGLEnable blend_enable(GL_BLEND);
@@ -526,6 +536,10 @@ void LLDrawPoolBump::endFullbrightShiny()
{
cube_map->disable();
cube_map->restoreMatrix();
+ if (shader->mFeatures.hasReflectionProbes)
+ {
+ gPipeline.unbindReflectionProbes(*shader);
+ }
shader->unbind();
}
@@ -549,8 +563,7 @@ void LLDrawPoolBump::renderGroup(LLSpatialGroup* group, U32 type, U32 mask, BOOL
params.mGroup->rebuildMesh();
}
params.mVertexBuffer->setBuffer(mask);
- params.mVertexBuffer->drawRange(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset);
- gPipeline.addTrianglesDrawn(params.mCount, params.mDrawMode);
+ params.mVertexBuffer->drawRange(LLRender::TRIANGLES, params.mStart, params.mEnd, params.mCount, params.mOffset);
}
}
@@ -673,6 +686,7 @@ void LLDrawPoolBump::endBump(U32 pass)
S32 LLDrawPoolBump::getNumDeferredPasses()
{
+#if 0 //DEPRECATED -- RenderObjectBump should always be TRUE
if (gSavedSettings.getBOOL("RenderObjectBump"))
{
return 1;
@@ -681,6 +695,9 @@ S32 LLDrawPoolBump::getNumDeferredPasses()
{
return 0;
}
+#else
+ return 1;
+#endif
}
void LLDrawPoolBump::renderDeferred(S32 pass)
@@ -741,6 +758,7 @@ void LLDrawPoolBump::renderDeferred(S32 pass)
void LLDrawPoolBump::renderPostDeferred(S32 pass)
{
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL
for (int i = 0; i < 2; ++i)
{ // two passes -- static and rigged
mRigged = (i == 1);
@@ -1421,7 +1439,7 @@ void LLDrawPoolBump::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL
params.mGroup->rebuildMesh();
}
params.mVertexBuffer->setBufferFast(mask);
- params.mVertexBuffer->drawRangeFast(params.mDrawMode, params.mStart, params.mEnd, params.mCount, params.mOffset);
+ params.mVertexBuffer->drawRangeFast(LLRender::TRIANGLES, params.mStart, params.mEnd, params.mCount, params.mOffset);
if (tex_setup)
{
@@ -1449,11 +1467,11 @@ void LLDrawPoolInvisible::render(S32 pass)
}
U32 invisi_mask = LLVertexBuffer::MAP_VERTEX;
- glStencilMask(0);
+ //glStencilMask(0); //deprecated
gGL.setColorMask(false, false);
pushBatches(LLRenderPass::PASS_INVISIBLE, invisi_mask, FALSE);
gGL.setColorMask(true, false);
- glStencilMask(0xFFFFFFFF);
+ //glStencilMask(0xFFFFFFFF); //deprecated
if (gPipeline.shadersLoaded())
{