summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpooltree.cpp
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2010-05-21 18:04:32 -0600
committerXiaohong Bao <bao@lindenlab.com>2010-05-21 18:04:32 -0600
commit81e6f6131bdc0d0c42dc9a21b7842c911f4dd81d (patch)
tree143bd2a9a6bf73334f4f1cff828461243e1ef60c /indra/newview/lldrawpooltree.cpp
parent517e8914f8825051988755a903c5c2d131559db3 (diff)
EXT-7394: FIXED: Trees have more polys at low detail than at high detail.
Diffstat (limited to 'indra/newview/lldrawpooltree.cpp')
-rw-r--r--indra/newview/lldrawpooltree.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp
index 1a5d55d793..1571415e63 100644
--- a/indra/newview/lldrawpooltree.cpp
+++ b/indra/newview/lldrawpooltree.cpp
@@ -113,9 +113,12 @@ void LLDrawPoolTree::render(S32 pass)
iter != mDrawFace.end(); iter++)
{
LLFace *face = *iter;
- face->mVertexBuffer->setBuffer(LLDrawPoolTree::VERTEX_DATA_MASK);
- face->mVertexBuffer->drawRange(LLRender::TRIANGLES, 0, face->mVertexBuffer->getRequestedVerts()-1, face->mVertexBuffer->getRequestedIndices(), 0);
- gPipeline.addTrianglesDrawn(face->mVertexBuffer->getRequestedIndices());
+ if(face->mVertexBuffer.notNull())
+ {
+ face->mVertexBuffer->setBuffer(LLDrawPoolTree::VERTEX_DATA_MASK);
+ face->mVertexBuffer->drawRange(LLRender::TRIANGLES, 0, face->mVertexBuffer->getRequestedVerts()-1, face->mVertexBuffer->getRequestedIndices(), 0);
+ gPipeline.addTrianglesDrawn(face->mVertexBuffer->getRequestedIndices());
+ }
}
}
}
@@ -333,7 +336,7 @@ void LLDrawPoolTree::renderTree(BOOL selecting)
S32 stop_depth = 0;
F32 app_angle = treep->getAppAngle()*LLVOTree::sTreeFactor;
F32 alpha = 1.0;
- S32 trunk_LOD = 0;
+ S32 trunk_LOD = LLVOTree::sMAX_NUM_TREE_LOD_LEVELS;
for (S32 j = 0; j < 4; j++)
{
@@ -344,6 +347,10 @@ void LLDrawPoolTree::renderTree(BOOL selecting)
break;
}
}
+ if(trunk_LOD >= LLVOTree::sMAX_NUM_TREE_LOD_LEVELS)
+ {
+ continue ; //do not render.
+ }
if (app_angle < (THRESH_ANGLE_FOR_BILLBOARD - BLEND_RANGE_FOR_BILLBOARD))
{