summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpoolterrain.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lldrawpoolterrain.cpp')
-rw-r--r--indra/newview/lldrawpoolterrain.cpp95
1 files changed, 12 insertions, 83 deletions
diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp
index 37dc80e2b7..cc5cb667f0 100644
--- a/indra/newview/lldrawpoolterrain.cpp
+++ b/indra/newview/lldrawpoolterrain.cpp
@@ -111,7 +111,7 @@ void LLDrawPoolTerrain::prerender()
void LLDrawPoolTerrain::beginRenderPass( S32 pass )
{
- LL_RECORD_BLOCK_TIME(FTM_RENDER_TERRAIN);
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_RENDER_TERRAIN);
LLFacePool::beginRenderPass(pass);
sShader = LLPipeline::sUnderWaterRender ?
@@ -126,7 +126,7 @@ void LLDrawPoolTerrain::beginRenderPass( S32 pass )
void LLDrawPoolTerrain::endRenderPass( S32 pass )
{
- LL_RECORD_BLOCK_TIME(FTM_RENDER_TERRAIN);
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_RENDER_TERRAIN);
//LLFacePool::endRenderPass(pass);
if (mShaderLevel > 1 && sShader->mShaderLevel > 0) {
@@ -154,7 +154,7 @@ void LLDrawPoolTerrain::boostTerrainDetailTextures()
void LLDrawPoolTerrain::render(S32 pass)
{
- LL_RECORD_BLOCK_TIME(FTM_RENDER_TERRAIN);
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_RENDER_TERRAIN);
if (mDrawFace.empty())
{
@@ -213,7 +213,7 @@ void LLDrawPoolTerrain::render(S32 pass)
void LLDrawPoolTerrain::beginDeferredPass(S32 pass)
{
- LL_RECORD_BLOCK_TIME(FTM_RENDER_TERRAIN);
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_RENDER_TERRAIN);
LLFacePool::beginRenderPass(pass);
sShader = LLPipeline::sUnderWaterRender ? &gDeferredTerrainWaterProgram : &gDeferredTerrainProgram;
@@ -223,14 +223,14 @@ void LLDrawPoolTerrain::beginDeferredPass(S32 pass)
void LLDrawPoolTerrain::endDeferredPass(S32 pass)
{
- LL_RECORD_BLOCK_TIME(FTM_RENDER_TERRAIN);
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_RENDER_TERRAIN);
LLFacePool::endRenderPass(pass);
sShader->unbind();
}
void LLDrawPoolTerrain::renderDeferred(S32 pass)
{
- LL_RECORD_BLOCK_TIME(FTM_RENDER_TERRAIN);
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_RENDER_TERRAIN);
if (mDrawFace.empty())
{
return;
@@ -250,7 +250,7 @@ void LLDrawPoolTerrain::renderDeferred(S32 pass)
void LLDrawPoolTerrain::beginShadowPass(S32 pass)
{
- LL_RECORD_BLOCK_TIME(FTM_SHADOW_TERRAIN);
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_SHADOW_TERRAIN);
LLFacePool::beginRenderPass(pass);
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
gDeferredShadowProgram.bind();
@@ -261,14 +261,14 @@ void LLDrawPoolTerrain::beginShadowPass(S32 pass)
void LLDrawPoolTerrain::endShadowPass(S32 pass)
{
- LL_RECORD_BLOCK_TIME(FTM_SHADOW_TERRAIN);
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_SHADOW_TERRAIN);
LLFacePool::endRenderPass(pass);
gDeferredShadowProgram.unbind();
}
void LLDrawPoolTerrain::renderShadow(S32 pass)
{
- LL_RECORD_BLOCK_TIME(FTM_SHADOW_TERRAIN);
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL; //LL_RECORD_BLOCK_TIME(FTM_SHADOW_TERRAIN);
if (mDrawFace.empty())
{
return;
@@ -343,8 +343,6 @@ void LLDrawPoolTerrain::renderFullShader()
LLSettingsWater::ptr_t pwater = LLEnvironment::instance().getCurrentWater();
- ((LLSettingsVOWater*)pwater.get())->updateShader(shader);
-
//
// detail texture 1
//
@@ -469,8 +467,6 @@ void LLDrawPoolTerrain::renderFull4TU()
glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV);
glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV);
- gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_TEX_COLOR);
-
//
// Stage 1: Generate alpha ramp for detail0/detail1 transition
//
@@ -479,10 +475,6 @@ void LLDrawPoolTerrain::renderFull4TU()
gGL.getTexUnit(1)->enable(LLTexUnit::TT_TEXTURE);
gGL.getTexUnit(1)->activate();
- // Care about alpha only
- gGL.getTexUnit(1)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR);
- gGL.getTexUnit(1)->setTextureAlphaBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_TEX_ALPHA);
-
//
// Stage 2: Interpolate detail1 with existing based on ramp
//
@@ -497,8 +489,6 @@ void LLDrawPoolTerrain::renderFull4TU()
glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV);
glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV);
- gGL.getTexUnit(2)->setTextureColorBlend(LLTexUnit::TBO_LERP_PREV_ALPHA, LLTexUnit::TBS_PREV_COLOR, LLTexUnit::TBS_TEX_COLOR);
-
//
// Stage 3: Modulate with primary (vertex) color for lighting
//
@@ -506,9 +496,6 @@ void LLDrawPoolTerrain::renderFull4TU()
gGL.getTexUnit(3)->enable(LLTexUnit::TT_TEXTURE);
gGL.getTexUnit(3)->activate();
- // Set alpha texture and do lighting modulation
- gGL.getTexUnit(3)->setTextureColorBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_PREV_COLOR, LLTexUnit::TBS_VERT_COLOR);
-
gGL.getTexUnit(0)->activate();
// GL_BLEND disabled by default
@@ -529,8 +516,6 @@ void LLDrawPoolTerrain::renderFull4TU()
glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV);
glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV);
- gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_TEX_COLOR);
-
//
// Stage 1: Generate alpha ramp for detail2/detail3 transition
//
@@ -543,10 +528,6 @@ void LLDrawPoolTerrain::renderFull4TU()
gGL.loadIdentity();
gGL.translatef(-2.f, 0.f, 0.f);
- // Care about alpha only
- gGL.getTexUnit(1)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR);
- gGL.getTexUnit(1)->setTextureAlphaBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_TEX_ALPHA);
-
//
// Stage 2: Interpolate detail2 with existing based on ramp
//
@@ -561,8 +542,6 @@ void LLDrawPoolTerrain::renderFull4TU()
glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV);
glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV);
- gGL.getTexUnit(2)->setTextureColorBlend(LLTexUnit::TBO_LERP_PREV_ALPHA, LLTexUnit::TBS_TEX_COLOR, LLTexUnit::TBS_PREV_COLOR);
-
//
// Stage 3: Generate alpha ramp for detail1/detail2 transition
//
@@ -576,10 +555,6 @@ void LLDrawPoolTerrain::renderFull4TU()
gGL.translatef(-1.f, 0.f, 0.f);
gGL.matrixMode(LLRender::MM_MODELVIEW);
- // Set alpha texture and do lighting modulation
- gGL.getTexUnit(3)->setTextureColorBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_PREV_COLOR, LLTexUnit::TBS_VERT_COLOR);
- gGL.getTexUnit(3)->setTextureAlphaBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_TEX_ALPHA);
-
gGL.getTexUnit(0)->activate();
{
LLGLEnable blend(GL_BLEND);
@@ -629,8 +604,6 @@ void LLDrawPoolTerrain::renderFull4TU()
gGL.matrixMode(LLRender::MM_TEXTURE);
gGL.loadIdentity();
gGL.matrixMode(LLRender::MM_MODELVIEW);
-
- gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
}
void LLDrawPoolTerrain::renderFull2TU()
@@ -669,8 +642,6 @@ void LLDrawPoolTerrain::renderFull2TU()
glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV);
glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV);
- gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_COLOR, LLTexUnit::TBS_VERT_COLOR);
-
drawLoop();
//----------------------------------------------------------------------------
@@ -684,11 +655,6 @@ void LLDrawPoolTerrain::renderFull2TU()
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
- // Care about alpha only
- gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR);
- gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_TEX_ALPHA);
-
-
//
// Stage 1: Write detail1
//
@@ -703,9 +669,6 @@ void LLDrawPoolTerrain::renderFull2TU()
glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV);
glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV);
- gGL.getTexUnit(1)->setTextureColorBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_COLOR, LLTexUnit::TBS_VERT_COLOR);
- gGL.getTexUnit(1)->setTextureAlphaBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_ALPHA);
-
gGL.getTexUnit(0)->activate();
{
LLGLEnable blend(GL_BLEND);
@@ -725,10 +688,6 @@ void LLDrawPoolTerrain::renderFull2TU()
gGL.translatef(-1.f, 0.f, 0.f);
gGL.matrixMode(LLRender::MM_MODELVIEW);
- // Care about alpha only
- gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR);
- gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_TEX_ALPHA);
-
//
// Stage 1: Write detail2
//
@@ -743,9 +702,6 @@ void LLDrawPoolTerrain::renderFull2TU()
glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV);
glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV);
- gGL.getTexUnit(1)->setTextureColorBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_COLOR, LLTexUnit::TBS_VERT_COLOR);
- gGL.getTexUnit(1)->setTextureAlphaBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_ALPHA);
-
{
LLGLEnable blend(GL_BLEND);
drawLoop();
@@ -765,10 +721,6 @@ void LLDrawPoolTerrain::renderFull2TU()
gGL.translatef(-2.f, 0.f, 0.f);
gGL.matrixMode(LLRender::MM_MODELVIEW);
- // Care about alpha only
- gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR);
- gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_TEX_ALPHA);
-
// Stage 1: Write detail3
gGL.getTexUnit(1)->bind(detail_texture3p);
gGL.getTexUnit(1)->enable(LLTexUnit::TT_TEXTURE);
@@ -781,9 +733,6 @@ void LLDrawPoolTerrain::renderFull2TU()
glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV);
glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV);
- gGL.getTexUnit(1)->setTextureColorBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_COLOR, LLTexUnit::TBS_VERT_COLOR);
- gGL.getTexUnit(1)->setTextureAlphaBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_ALPHA);
-
gGL.getTexUnit(0)->activate();
{
LLGLEnable blend(GL_BLEND);
@@ -816,7 +765,6 @@ void LLDrawPoolTerrain::renderFull2TU()
gGL.matrixMode(LLRender::MM_TEXTURE);
gGL.loadIdentity();
gGL.matrixMode(LLRender::MM_MODELVIEW);
- gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
}
@@ -839,22 +787,8 @@ void LLDrawPoolTerrain::renderSimple()
tp0.setVec(tscale, 0.f, 0.0f, -1.f*(origin_agent.mV[0]/256.f));
tp1.setVec(0.f, tscale, 0.0f, -1.f*(origin_agent.mV[1]/256.f));
- if (LLGLSLShader::sNoFixedFunction)
- {
- sShader->uniform4fv(LLShaderMgr::OBJECT_PLANE_S, 1, tp0.mV);
- sShader->uniform4fv(LLShaderMgr::OBJECT_PLANE_T, 1, tp1.mV);
- }
- else
- {
- glEnable(GL_TEXTURE_GEN_S);
- glEnable(GL_TEXTURE_GEN_T);
- glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
- glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_OBJECT_LINEAR);
- glTexGenfv(GL_S, GL_OBJECT_PLANE, tp0.mV);
- glTexGenfv(GL_T, GL_OBJECT_PLANE, tp1.mV);
- }
-
- gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_COLOR, LLTexUnit::TBS_VERT_COLOR);
+ sShader->uniform4fv(LLShaderMgr::OBJECT_PLANE_S, 1, tp0.mV);
+ sShader->uniform4fv(LLShaderMgr::OBJECT_PLANE_T, 1, tp1.mV);
drawLoop();
@@ -863,15 +797,9 @@ void LLDrawPoolTerrain::renderSimple()
gGL.getTexUnit(0)->activate();
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
- if (!LLGLSLShader::sNoFixedFunction)
- {
- glDisable(GL_TEXTURE_GEN_S);
- glDisable(GL_TEXTURE_GEN_T);
- }
gGL.matrixMode(LLRender::MM_TEXTURE);
gGL.loadIdentity();
gGL.matrixMode(LLRender::MM_MODELVIEW);
- gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
}
//============================================================================
@@ -922,6 +850,7 @@ void LLDrawPoolTerrain::renderOwnership()
void LLDrawPoolTerrain::dirtyTextures(const std::set<LLViewerFetchedTexture*>& textures)
{
+ LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL;
LLViewerFetchedTexture* tex = LLViewerTextureManager::staticCastToFetchedTexture(mTexturep) ;
if (tex && textures.find(tex) != textures.end())
{