summaryrefslogtreecommitdiff
path: root/indra/newview/llvopartgroup.cpp
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2011-07-07 14:08:36 -0400
committerOz Linden <oz@lindenlab.com>2011-07-07 14:08:36 -0400
commit5d92dc44026f7dd237aa871593080fd151064e62 (patch)
tree4f0c70e428824a0a01e38ff77850fb009b6c13f0 /indra/newview/llvopartgroup.cpp
parent7614ceff24129643ecb96f57f0491507e4ff8dbd (diff)
parent4d77146b9016a4db37112e153e71c05c596f7fdc (diff)
merge changes for 2.7.4 release
Diffstat (limited to 'indra/newview/llvopartgroup.cpp')
-rw-r--r--indra/newview/llvopartgroup.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp
index 6f354b78b1..a4b0910c92 100644
--- a/indra/newview/llvopartgroup.cpp
+++ b/indra/newview/llvopartgroup.cpp
@@ -324,10 +324,18 @@ void LLVOPartGroup::getGeometry(S32 idx,
LLVector3 normal = -LLViewerCamera::getInstance()->getXAxis();
-
+
+ //HACK -- the verticesp->mV[3] = 0.f here are to set the texture index to 0 (particles don't use texture batching, maybe they should)
+ // this works because there is actually a 4th float stored after the vertex position which is used as a texture index
+ // also, somebody please VECTORIZE THIS
+
+ verticesp->mV[3] = 0.f;
*verticesp++ = part_pos_agent + up - right;
+ verticesp->mV[3] = 0.f;
*verticesp++ = part_pos_agent - up - right;
+ verticesp->mV[3] = 0.f;
*verticesp++ = part_pos_agent + up + right;
+ verticesp->mV[3] = 0.f;
*verticesp++ = part_pos_agent - up + right;
*colorsp++ = part.mColor;
@@ -360,7 +368,7 @@ U32 LLVOPartGroup::getPartitionType() const
}
LLParticlePartition::LLParticlePartition()
-: LLSpatialPartition(LLDrawPoolAlpha::VERTEX_DATA_MASK, TRUE, GL_STREAM_DRAW_ARB)
+: LLSpatialPartition(LLDrawPoolAlpha::VERTEX_DATA_MASK | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, GL_STREAM_DRAW_ARB)
{
mRenderPass = LLRenderPass::PASS_ALPHA;
mDrawableType = LLPipeline::RENDER_TYPE_PARTICLES;
@@ -418,6 +426,7 @@ void LLParticlePartition::addGeometryCount(LLSpatialGroup* group, U32& vertex_co
mFaceList.push_back(facep);
vertex_count += facep->getGeomCount();
index_count += facep->getIndicesCount();
+ llassert(facep->getIndicesCount() < 65536);
}
obj->mDepth /= count;