summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpoolterrain.cpp
diff options
context:
space:
mode:
authorEuclid Linden <euclid@lindenlab.com>2021-12-01 15:59:02 +0000
committerEuclid Linden <euclid@lindenlab.com>2021-12-01 15:59:02 +0000
commit3f82f7ce3d4fb51407f366b2ad2f15d990de40b2 (patch)
tree45be0f3213f0e095d9a7929c693f4671c8b58e08 /indra/newview/lldrawpoolterrain.cpp
parent01317a2faded53c79db7e0814426f1d8b2fd12fc (diff)
parentabd7d80048529fd971e1b65ea3afe0f7e78bd356 (diff)
Merged in euclid-pre-16386 (pull request #793)
Purge LLGLSLShader::sNoFixedFunction, and all that flows from it. No functional changes. Approved-by: Michael Pohoreski Approved-by: Dave Parks
Diffstat (limited to 'indra/newview/lldrawpoolterrain.cpp')
-rw-r--r--indra/newview/lldrawpoolterrain.cpp74
1 files changed, 2 insertions, 72 deletions
diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp
index 9cea8f5460..adea1909a3 100644
--- a/indra/newview/lldrawpoolterrain.cpp
+++ b/indra/newview/lldrawpoolterrain.cpp
@@ -467,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
//
@@ -477,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
//
@@ -495,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
//
@@ -504,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
@@ -527,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
//
@@ -541,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
//
@@ -559,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
//
@@ -574,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);
@@ -627,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()
@@ -667,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();
//----------------------------------------------------------------------------
@@ -682,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
//
@@ -701,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);
@@ -723,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
//
@@ -741,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();
@@ -763,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);
@@ -779,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);
@@ -814,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);
}
@@ -837,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();
@@ -861,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);
}
//============================================================================