diff options
Diffstat (limited to 'indra/newview/llvograss.cpp')
-rw-r--r-- | indra/newview/llvograss.cpp | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp index 96fa1df218..b814f15232 100644 --- a/indra/newview/llvograss.cpp +++ b/indra/newview/llvograss.cpp @@ -38,7 +38,6 @@ #include "llsky.h" #include "llsurface.h" #include "llsurfacepatch.h" -#include "llvosky.h" #include "llviewercamera.h" #include "llviewertexturelist.h" #include "llviewerregion.h" @@ -265,7 +264,7 @@ U32 LLVOGrass::processUpdateMessage(LLMessageSystem *mesgsys, if (mDrawable) { - gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE); + gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME); } return retval; @@ -291,12 +290,12 @@ void LLVOGrass::idleUpdate(LLAgent &agent, const F64 &time) if (!LLVOTree::isTreeRenderingStopped() && !mNumBlades)//restart grass rendering { mNumBlades = GRASS_MAX_BLADES; - gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE); + gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL); return; } if (mPatch && (mLastPatchUpdateTime != mPatch->getLastUpdateTime())) { - gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE); + gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME); } return; @@ -349,7 +348,7 @@ BOOL LLVOGrass::updateLOD() { mNumBlades = 0 ; face->setSize(0, 0); - gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE); + gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL); } return TRUE ; } @@ -374,7 +373,7 @@ BOOL LLVOGrass::updateLOD() { face->setSize(mNumBlades*8, mNumBlades*12); } - gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE); + gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL); } else if (num_blades <= (mNumBlades >> 1)) { @@ -387,7 +386,7 @@ BOOL LLVOGrass::updateLOD() { face->setSize(mNumBlades*8, mNumBlades*12); } - gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE); + gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL); return TRUE; } @@ -594,7 +593,7 @@ U32 LLVOGrass::getPartitionType() const } LLGrassPartition::LLGrassPartition(LLViewerRegion* regionp) -: LLSpatialPartition(LLDrawPoolAlpha::VERTEX_DATA_MASK | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, GL_STREAM_DRAW, regionp) +: LLSpatialPartition(LLDrawPoolAlpha::VERTEX_DATA_MASK | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, regionp) { mDrawableType = LLPipeline::RENDER_TYPE_GRASS; mPartitionType = LLViewerRegion::PARTITION_GRASS; @@ -602,13 +601,10 @@ LLGrassPartition::LLGrassPartition(LLViewerRegion* regionp) mDepthMask = TRUE; mSlopRatio = 0.1f; mRenderPass = LLRenderPass::PASS_GRASS; - mBufferUsage = GL_DYNAMIC_DRAW; } void LLGrassPartition::addGeometryCount(LLSpatialGroup* group, U32& vertex_count, U32& index_count) { - group->mBufferUsage = mBufferUsage; - mFaceList.clear(); LLViewerCamera* camera = LLViewerCamera::getInstance(); @@ -624,11 +620,6 @@ void LLGrassPartition::addGeometryCount(LLSpatialGroup* group, U32& vertex_count LLAlphaObject* obj = (LLAlphaObject*) drawablep->getVObj().get(); obj->mDepth = 0.f; - if (drawablep->isAnimating()) - { - group->mBufferUsage = GL_STREAM_DRAW; - } - U32 count = 0; for (S32 j = 0; j < drawablep->getNumFaces(); ++j) { @@ -707,8 +698,7 @@ void LLGrassPartition::getGeometry(LLSpatialGroup* group) S32 idx = draw_vec.size()-1; - BOOL fullbright = facep->isState(LLFace::FULLBRIGHT); - F32 vsize = facep->getVirtualSize(); + bool fullbright = facep->isState(LLFace::FULLBRIGHT); if (idx >= 0 && draw_vec[idx]->mEnd == facep->getGeomIndex()-1 && draw_vec[idx]->mTexture == facep->getTexture() && @@ -719,7 +709,6 @@ void LLGrassPartition::getGeometry(LLSpatialGroup* group) { draw_vec[idx]->mCount += facep->getIndicesCount(); draw_vec[idx]->mEnd += facep->getGeomCount(); - draw_vec[idx]->mVSize = llmax(draw_vec[idx]->mVSize, vsize); } else { @@ -731,17 +720,13 @@ void LLGrassPartition::getGeometry(LLSpatialGroup* group) //facep->getTexture(), buffer, object->isSelected(), fullbright); - const LLVector4a* exts = group->getObjectExtents(); - info->mExtents[0] = exts[0]; - info->mExtents[1] = exts[1]; - info->mVSize = vsize; draw_vec.push_back(info); //for alpha sorting facep->setDrawInfo(info); } } - buffer->flush(); + buffer->unmapBuffer(); mFaceList.clear(); } @@ -752,13 +737,13 @@ void LLVOGrass::updateDrawable(BOOL force_damped) if (mDrawable.notNull()) { mDrawable->updateXform(TRUE); - gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL, TRUE); + gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_ALL); } clearChanged(SHIFTED); } // virtual -BOOL LLVOGrass::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& end, S32 face, BOOL pick_transparent, BOOL pick_rigged, S32 *face_hitp, +BOOL LLVOGrass::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& end, S32 face, BOOL pick_transparent, BOOL pick_rigged, BOOL pick_unselectable, S32 *face_hitp, LLVector4a* intersection,LLVector2* tex_coord, LLVector4a* normal, LLVector4a* tangent) { |