diff options
Diffstat (limited to 'linden/indra/newview/llvopartgroup.cpp')
-rw-r--r-- | linden/indra/newview/llvopartgroup.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/linden/indra/newview/llvopartgroup.cpp b/linden/indra/newview/llvopartgroup.cpp index a0f8068..b040366 100644 --- a/linden/indra/newview/llvopartgroup.cpp +++ b/linden/indra/newview/llvopartgroup.cpp | |||
@@ -108,7 +108,7 @@ void LLVOPartGroup::setPixelAreaAndAngle(LLAgent &agent) | |||
108 | } | 108 | } |
109 | } | 109 | } |
110 | 110 | ||
111 | void LLVOPartGroup::updateTextures() | 111 | void LLVOPartGroup::updateTextures(LLAgent &agent) |
112 | { | 112 | { |
113 | // Texture stats for particles need to be updated in a different way... | 113 | // Texture stats for particles need to be updated in a different way... |
114 | } | 114 | } |
@@ -154,6 +154,11 @@ BOOL LLVOPartGroup::updateGeometry(LLDrawable *drawable) | |||
154 | group = drawable->getSpatialGroup(); | 154 | group = drawable->getSpatialGroup(); |
155 | } | 155 | } |
156 | 156 | ||
157 | if (group && group->isVisible()) | ||
158 | { | ||
159 | dirtySpatialGroup(TRUE); | ||
160 | } | ||
161 | |||
157 | if (!num_parts) | 162 | if (!num_parts) |
158 | { | 163 | { |
159 | if (group && drawable->getNumFaces()) | 164 | if (group && drawable->getNumFaces()) |
@@ -186,13 +191,12 @@ BOOL LLVOPartGroup::updateGeometry(LLDrawable *drawable) | |||
186 | S32 count=0; | 191 | S32 count=0; |
187 | mDepth = 0.f; | 192 | mDepth = 0.f; |
188 | S32 i = 0 ; | 193 | S32 i = 0 ; |
189 | LLVector3 camera_agent = getCameraPosition(); | ||
190 | for (i = 0 ; i < (S32)mViewerPartGroupp->mParticles.size(); i++) | 194 | for (i = 0 ; i < (S32)mViewerPartGroupp->mParticles.size(); i++) |
191 | { | 195 | { |
192 | const LLViewerPart *part = mViewerPartGroupp->mParticles[i]; | 196 | const LLViewerPart *part = mViewerPartGroupp->mParticles[i]; |
193 | 197 | ||
194 | LLVector3 part_pos_agent(part->mPosAgent); | 198 | LLVector3 part_pos_agent(part->mPosAgent); |
195 | LLVector3 at(part_pos_agent - camera_agent); | 199 | LLVector3 at(part_pos_agent - LLViewerCamera::getInstance()->getOrigin()); |
196 | 200 | ||
197 | F32 camera_dist_squared = at.lengthSquared(); | 201 | F32 camera_dist_squared = at.lengthSquared(); |
198 | F32 inv_camera_dist_squared; | 202 | F32 inv_camera_dist_squared; |
@@ -315,7 +319,7 @@ void LLVOPartGroup::getGeometry(S32 idx, | |||
315 | up *= 0.5f*part.mScale.mV[1]; | 319 | up *= 0.5f*part.mScale.mV[1]; |
316 | 320 | ||
317 | 321 | ||
318 | LLVector3 normal = -LLViewerCamera::getInstance()->getXAxis(); | 322 | const LLVector3& normal = -LLViewerCamera::getInstance()->getXAxis(); |
319 | 323 | ||
320 | *verticesp++ = part_pos_agent + up - right; | 324 | *verticesp++ = part_pos_agent + up - right; |
321 | *verticesp++ = part_pos_agent - up - right; | 325 | *verticesp++ = part_pos_agent - up - right; |
@@ -352,12 +356,12 @@ U32 LLVOPartGroup::getPartitionType() const | |||
352 | } | 356 | } |
353 | 357 | ||
354 | LLParticlePartition::LLParticlePartition() | 358 | LLParticlePartition::LLParticlePartition() |
355 | : LLSpatialPartition(LLDrawPoolAlpha::VERTEX_DATA_MASK) | 359 | : LLSpatialPartition(LLDrawPoolAlpha::VERTEX_DATA_MASK, TRUE, GL_DYNAMIC_DRAW_ARB) |
356 | { | 360 | { |
357 | mRenderPass = LLRenderPass::PASS_ALPHA; | 361 | mRenderPass = LLRenderPass::PASS_ALPHA; |
358 | mDrawableType = LLPipeline::RENDER_TYPE_PARTICLES; | 362 | mDrawableType = LLPipeline::RENDER_TYPE_PARTICLES; |
359 | mPartitionType = LLViewerRegion::PARTITION_PARTICLE; | 363 | mPartitionType = LLViewerRegion::PARTITION_PARTICLE; |
360 | mBufferUsage = GL_DYNAMIC_DRAW_ARB; | 364 | // mBufferUsage = GL_DYNAMIC_DRAW_ARB; // KL SD hybrid code |
361 | mSlopRatio = 0.f; | 365 | mSlopRatio = 0.f; |
362 | mLODPeriod = 1; | 366 | mLODPeriod = 1; |
363 | } | 367 | } |
@@ -481,7 +485,9 @@ void LLParticlePartition::getGeometry(LLSpatialGroup* group) | |||
481 | U32 end = start + facep->getGeomCount()-1; | 485 | U32 end = start + facep->getGeomCount()-1; |
482 | U32 offset = facep->getIndicesStart(); | 486 | U32 offset = facep->getIndicesStart(); |
483 | U32 count = facep->getIndicesCount(); | 487 | U32 count = facep->getIndicesCount(); |
484 | LLDrawInfo* info = new LLDrawInfo(start,end,count,offset,facep->getTexture(), buffer, fullbright); | 488 | LLDrawInfo* info = new LLDrawInfo(start,end,count,offset,facep->getTexture(), |
489 | facep->getTexture(), | ||
490 | buffer, fullbright); | ||
485 | info->mExtents[0] = group->mObjectExtents[0]; | 491 | info->mExtents[0] = group->mObjectExtents[0]; |
486 | info->mExtents[1] = group->mObjectExtents[1]; | 492 | info->mExtents[1] = group->mObjectExtents[1]; |
487 | info->mVSize = vsize; | 493 | info->mVSize = vsize; |