summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpoolterrain.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lldrawpoolterrain.cpp')
-rw-r--r--[-rwxr-xr-x]indra/newview/lldrawpoolterrain.cpp66
1 files changed, 33 insertions, 33 deletions
diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp
index 33ce3d0111..b716a76543 100755..100644
--- a/indra/newview/lldrawpoolterrain.cpp
+++ b/indra/newview/lldrawpoolterrain.cpp
@@ -62,28 +62,15 @@ LLDrawPoolTerrain::LLDrawPoolTerrain(LLViewerTexture *texturep) :
LLFacePool(POOL_TERRAIN),
mTexturep(texturep)
{
- U32 format = GL_ALPHA8;
- U32 int_format = GL_ALPHA;
-
// Hack!
sDetailScale = 1.f/gSavedSettings.getF32("RenderTerrainScale");
sDetailMode = gSavedSettings.getS32("RenderTerrainDetail");
- mAlphaRampImagep = LLViewerTextureManager::getFetchedTextureFromFile("alpha_gradient.tga",
- FTT_LOCAL_FILE,
- TRUE, LLGLTexture::BOOST_UI,
- LLViewerTexture::FETCHED_TEXTURE,
- format, int_format,
- LLUUID("e97cf410-8e61-7005-ec06-629eba4cd1fb"));
+ mAlphaRampImagep = LLViewerTextureManager::getFetchedTexture(IMG_ALPHA_GRAD);
//gGL.getTexUnit(0)->bind(mAlphaRampImagep.get());
mAlphaRampImagep->setAddressMode(LLTexUnit::TAM_CLAMP);
- m2DAlphaRampImagep = LLViewerTextureManager::getFetchedTextureFromFile("alpha_gradient_2d.j2c",
- FTT_LOCAL_FILE,
- TRUE, LLGLTexture::BOOST_UI,
- LLViewerTexture::FETCHED_TEXTURE,
- format, int_format,
- LLUUID("38b86f85-2575-52a9-a531-23108d8da837"));
+ m2DAlphaRampImagep = LLViewerTextureManager::getFetchedTexture(IMG_ALPHA_GRAD_2D);
//gGL.getTexUnit(0)->bind(m2DAlphaRampImagep.get());
m2DAlphaRampImagep->setAddressMode(LLTexUnit::TAM_CLAMP);
@@ -220,24 +207,7 @@ void LLDrawPoolTerrain::render(S32 pass)
// Special-case for land ownership feedback
if (gSavedSettings.getBOOL("ShowParcelOwners"))
{
- if (mVertexShaderLevel > 1)
- { //use fullbright shader for highlighting
- LLGLSLShader* old_shader = sShader;
- sShader->unbind();
- sShader = &gHighlightProgram;
- sShader->bind();
- gGL.diffuseColor4f(1,1,1,1);
- LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL);
- glPolygonOffset(-1.0f, -1.0f);
- renderOwnership();
- sShader = old_shader;
- sShader->bind();
- }
- else
- {
- gPipeline.disableLights();
- renderOwnership();
- }
+ hilightParcelOwners();
}
}
@@ -265,7 +235,15 @@ void LLDrawPoolTerrain::renderDeferred(S32 pass)
{
return;
}
+
renderFullShader();
+
+ // Special-case for land ownership feedback
+ if (gSavedSettings.getBOOL("ShowParcelOwners"))
+ {
+ hilightParcelOwners();
+ }
+
}
void LLDrawPoolTerrain::beginShadowPass(S32 pass)
@@ -454,6 +432,28 @@ void LLDrawPoolTerrain::renderFullShader()
gGL.matrixMode(LLRender::MM_MODELVIEW);
}
+void LLDrawPoolTerrain::hilightParcelOwners()
+{
+ if (mVertexShaderLevel > 1)
+ { //use fullbright shader for highlighting
+ LLGLSLShader* old_shader = sShader;
+ sShader->unbind();
+ sShader = &gHighlightProgram;
+ sShader->bind();
+ gGL.diffuseColor4f(1, 1, 1, 1);
+ LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL);
+ glPolygonOffset(-1.0f, -1.0f);
+ renderOwnership();
+ sShader = old_shader;
+ sShader->bind();
+ }
+ else
+ {
+ gPipeline.disableLights();
+ renderOwnership();
+ }
+}
+
void LLDrawPoolTerrain::renderFull4TU()
{
// Hack! Get the region that this draw pool is rendering from!