aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--linden/indra/llmath/llvolume.h4
-rw-r--r--linden/indra/newview/llhudtext.cpp15
-rw-r--r--linden/indra/newview/llhudtext.h1
-rw-r--r--linden/indra/newview/llviewerobject.cpp13
-rw-r--r--linden/indra/newview/llviewerobject.h2
-rw-r--r--linden/indra/newview/llvovolume.cpp77
-rw-r--r--linden/indra/newview/llvovolume.h2
-rw-r--r--linden/indra/newview/pipeline.cpp5
-rw-r--r--linden/indra/newview/pipeline.h2
9 files changed, 73 insertions, 48 deletions
diff --git a/linden/indra/llmath/llvolume.h b/linden/indra/llmath/llvolume.h
index 0b9002f..77af2c4 100644
--- a/linden/indra/llmath/llvolume.h
+++ b/linden/indra/llmath/llvolume.h
@@ -949,9 +949,11 @@ public:
949 LLVector3 mLODScaleBias; // vector for biasing LOD based on scale 949 LLVector3 mLODScaleBias; // vector for biasing LOD based on scale
950 950
951 void sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data, S32 sculpt_level); 951 void sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data, S32 sculpt_level);
952
953 F32 sculptGetSurfaceArea();
954
952private: 955private:
953 void sculptGenerateMapVertices(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data, U8 sculpt_type); 956 void sculptGenerateMapVertices(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data, U8 sculpt_type);
954 F32 sculptGetSurfaceArea();
955 void sculptGeneratePlaceholder(); 957 void sculptGeneratePlaceholder();
956 void sculptCalcMeshResolution(U16 width, U16 height, U8 type, S32& s, S32& t); 958 void sculptCalcMeshResolution(U16 width, U16 height, U8 type, S32& s, S32& t);
957 959
diff --git a/linden/indra/newview/llhudtext.cpp b/linden/indra/newview/llhudtext.cpp
index 7c0c469..457249f 100644
--- a/linden/indra/newview/llhudtext.cpp
+++ b/linden/indra/newview/llhudtext.cpp
@@ -723,6 +723,21 @@ void LLHUDText::setDoFade(const BOOL do_fade)
723 mDoFade = do_fade; 723 mDoFade = do_fade;
724} 724}
725 725
726std::string LLHUDText::getStringUTF8()
727{
728 std::string out("");
729 int t = mTextSegments.size();
730 int i = 0;
731 for (std::vector<LLHUDTextSegment>::iterator segment_iter = mTextSegments.begin();
732 segment_iter != mTextSegments.end(); ++segment_iter )
733 {
734 out.append(wstring_to_utf8str((*segment_iter).getText()));
735 i++;
736 if(i < t) out.append("\n");
737 }
738 return out;
739}
740
726void LLHUDText::updateVisibility() 741void LLHUDText::updateVisibility()
727{ 742{
728 if (mSourceObject) 743 if (mSourceObject)
diff --git a/linden/indra/newview/llhudtext.h b/linden/indra/newview/llhudtext.h
index 297e4d5..fbe984f 100644
--- a/linden/indra/newview/llhudtext.h
+++ b/linden/indra/newview/llhudtext.h
@@ -103,6 +103,7 @@ public:
103 void setZCompare(const BOOL zcompare); 103 void setZCompare(const BOOL zcompare);
104 void setDoFade(const BOOL do_fade); 104 void setDoFade(const BOOL do_fade);
105 void setVisibleOffScreen(BOOL visible) { mVisibleOffScreen = visible; } 105 void setVisibleOffScreen(BOOL visible) { mVisibleOffScreen = visible; }
106 std::string getStringUTF8();
106 107
107 // mMaxLines of -1 means unlimited lines. 108 // mMaxLines of -1 means unlimited lines.
108 void setMaxLines(S32 max_lines) { mMaxLines = max_lines; } 109 void setMaxLines(S32 max_lines) { mMaxLines = max_lines; }
diff --git a/linden/indra/newview/llviewerobject.cpp b/linden/indra/newview/llviewerobject.cpp
index 58b8490..e622a7f 100644
--- a/linden/indra/newview/llviewerobject.cpp
+++ b/linden/indra/newview/llviewerobject.cpp
@@ -207,7 +207,8 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe
207 mJointInfo(NULL), 207 mJointInfo(NULL),
208 mState(0), 208 mState(0),
209 mMedia(NULL), 209 mMedia(NULL),
210 mClickAction(0) 210 mClickAction(0),
211 mSculptSurfaceArea(0.0)
211{ 212{
212 if(!is_global) 213 if(!is_global)
213 { 214 {
@@ -4014,7 +4015,7 @@ LLBBox LLViewerObject::getBoundingBoxAgent() const
4014 LLQuaternion rot; 4015 LLQuaternion rot;
4015 LLViewerObject* root_edit = (LLViewerObject*)getRootEdit(); 4016 LLViewerObject* root_edit = (LLViewerObject*)getRootEdit();
4016 LLViewerObject* avatar_parent = (LLViewerObject*)root_edit->getParent(); 4017 LLViewerObject* avatar_parent = (LLViewerObject*)root_edit->getParent();
4017 if (avatar_parent && avatar_parent->isAvatar() && root_edit->mDrawable.notNull()) 4018 if (avatar_parent && avatar_parent->isAvatar() && root_edit && root_edit->mDrawable.notNull())
4018 { 4019 {
4019 LLXform* parent_xform = root_edit->mDrawable->getXform()->getParent(); 4020 LLXform* parent_xform = root_edit->mDrawable->getXform()->getParent();
4020 position_agent = (getPositionEdit() * parent_xform->getWorldRotation()) + parent_xform->getWorldPosition(); 4021 position_agent = (getPositionEdit() * parent_xform->getWorldRotation()) + parent_xform->getWorldPosition();
@@ -4112,6 +4113,14 @@ void LLViewerObject::setDebugText(const std::string &utf8text)
4112 mText->setDoFade(FALSE); 4113 mText->setDoFade(FALSE);
4113 updateText(); 4114 updateText();
4114} 4115}
4116std::string LLViewerObject::getDebugText()
4117{
4118 if(mText)
4119 {
4120 return mText->getStringUTF8();
4121 }
4122 return "";
4123}
4115 4124
4116void LLViewerObject::setIcon(LLViewerImage* icon_image) 4125void LLViewerObject::setIcon(LLViewerImage* icon_image)
4117{ 4126{
diff --git a/linden/indra/newview/llviewerobject.h b/linden/indra/newview/llviewerobject.h
index 33e8da2..9b05470 100644
--- a/linden/indra/newview/llviewerobject.h
+++ b/linden/indra/newview/llviewerobject.h
@@ -353,6 +353,7 @@ public:
353 void setCanSelect(BOOL canSelect); 353 void setCanSelect(BOOL canSelect);
354 354
355 void setDebugText(const std::string &utf8text); 355 void setDebugText(const std::string &utf8text);
356 std::string getDebugText();
356 void setIcon(LLViewerImage* icon_image); 357 void setIcon(LLViewerImage* icon_image);
357 void clearIcon(); 358 void clearIcon();
358 359
@@ -552,6 +553,7 @@ public:
552 LLPointer<LLHUDIcon> mIcon; 553 LLPointer<LLHUDIcon> mIcon;
553 554
554 static BOOL sUseSharedDrawables; 555 static BOOL sUseSharedDrawables;
556 F32 mSculptSurfaceArea;
555 557
556protected: 558protected:
557 // delete an item in the inventory, but don't tell the 559 // delete an item in the inventory, but don't tell the
diff --git a/linden/indra/newview/llvovolume.cpp b/linden/indra/newview/llvovolume.cpp
index 7aaf845..8666e4a 100644
--- a/linden/indra/newview/llvovolume.cpp
+++ b/linden/indra/newview/llvovolume.cpp
@@ -72,6 +72,10 @@ const S32 MIN_QUIET_FRAMES_COALESCE = 30;
72const F32 FORCE_SIMPLE_RENDER_AREA = 512.f; 72const F32 FORCE_SIMPLE_RENDER_AREA = 512.f;
73const F32 FORCE_CULL_AREA = 8.f; 73const F32 FORCE_CULL_AREA = 8.f;
74 74
75static const F32 sSculptSAThresh = 1750.f; // Surface area at which sculpts are considered for not being rendered
76static const F32 sSculptSAMax = 50000.f; // The maximum combined surface area of sculpts(per frame) that are above the
77 // threshold before they stop being rendered
78
75BOOL gAnimateTextures = TRUE; 79BOOL gAnimateTextures = TRUE;
76extern BOOL gHideSelectedObjects; 80extern BOOL gHideSelectedObjects;
77 81
@@ -89,6 +93,7 @@ LLVOVolume::LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *re
89 mRelativeXformInvTrans.setIdentity(); 93 mRelativeXformInvTrans.setIdentity();
90 94
91 mLOD = MIN_LOD; 95 mLOD = MIN_LOD;
96 mSculptLevel = -2;
92 mTextureAnimp = NULL; 97 mTextureAnimp = NULL;
93 mVObjRadius = LLVector3(1,1,0.5f).length(); 98 mVObjRadius = LLVector3(1,1,0.5f).length();
94 mNumFaces = 0; 99 mNumFaces = 0;
@@ -502,8 +507,9 @@ void LLVOVolume::updateTextureVirtualSize()
502 507
503 if (isSculpted()) 508 if (isSculpted())
504 { 509 {
505 updateSculptTexture(); 510 LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT);
506 511 LLUUID id = sculpt_params->getSculptTexture();
512 mSculptTexture = gImageList.getImage(id);
507 if (mSculptTexture.notNull()) 513 if (mSculptTexture.notNull())
508 { 514 {
509 mSculptTexture->setBoostLevel(llmax((S32)mSculptTexture->getBoostLevel(), 515 mSculptTexture->setBoostLevel(llmax((S32)mSculptTexture->getBoostLevel(),
@@ -526,22 +532,22 @@ void LLVOVolume::updateTextureVirtualSize()
526 } 532 }
527 } 533 }
528 534
529 S32 texture_discard = mSculptTexture->getDiscardLevel(); //try to match the texture 535 S32 texture_discard = mSculptTexture->getCachedRawImageLevel(); //try to match the texture
530 S32 current_discard = getVolume() ? getVolume()->getSculptLevel() : -2 ; 536 S32 current_discard = mSculptLevel;
531 537
532 if (texture_discard >= 0 && //texture has some data available 538 if (texture_discard >= 0 && //texture has some data available
533 (texture_discard < current_discard || //texture has more data than last rebuild 539 (texture_discard < current_discard || //texture has more data than last rebuild
534 current_discard < 0)) //no previous rebuild 540 current_discard < 0)) //no previous rebuild
535 { 541 {
536 gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, FALSE); 542 markForUpdate(FALSE);
537 mSculptChanged = TRUE; 543 mSculptChanged = TRUE;
538 } 544 }
539 545
540 if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SCULPTED)) 546 if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_SCULPTED))
541 { 547 {
542 setDebugText(llformat("T%d C%d V%d\n%dx%d", 548 setDebugText(llformat("T%d C%d V%d\n%dx%d SA%f",
543 texture_discard, current_discard, getVolume()->getSculptLevel(), 549 texture_discard, current_discard, getVolume()->getSculptLevel(),
544 mSculptTexture->getHeight(), mSculptTexture->getWidth())); 550 mSculptTexture->getHeight(), mSculptTexture->getWidth(), mSculptSurfaceArea));
545 } 551 }
546 } 552 }
547 } 553 }
@@ -681,50 +687,25 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams &volume_params, const S32 detail
681 mVolumeImpl->onSetVolume(volume_params, detail); 687 mVolumeImpl->onSetVolume(volume_params, detail);
682 } 688 }
683 689
684 updateSculptTexture();
685
686 if (isSculpted()) 690 if (isSculpted())
687 { 691 {
692 mSculptTexture = gImageList.getImage(volume_params.getSculptID());
688 if (mSculptTexture.notNull()) 693 if (mSculptTexture.notNull())
689 { 694 {
690 sculpt(); 695 sculpt();
696 mSculptLevel = getVolume()->getSculptLevel();
697 mSculptSurfaceArea = getVolume()->sculptGetSurfaceArea();
691 } 698 }
692 } 699 }
693 700 else
694 return TRUE;
695 }
696 return FALSE;
697}
698
699void LLVOVolume::updateSculptTexture()
700{
701 LLPointer<LLViewerImage> old_sculpt = mSculptTexture;
702
703 if (isSculpted())
704 {
705 LLSculptParams *sculpt_params = (LLSculptParams *)getParameterEntry(LLNetworkData::PARAMS_SCULPT);
706 LLUUID id = sculpt_params->getSculptTexture();
707 if (id.notNull())
708 { 701 {
709 mSculptTexture = gImageList.getImage(id); 702 mSculptTexture = NULL;
703 mSculptSurfaceArea = 0.0;
710 } 704 }
711 }
712 else
713 {
714 mSculptTexture = NULL;
715 }
716 705
717 if (mSculptTexture != old_sculpt) 706 return TRUE;
718 {
719 if (old_sculpt.notNull())
720 {
721 old_sculpt->removeVolume(this);
722 }
723 if (mSculptTexture.notNull())
724 {
725 mSculptTexture->addVolume(this);
726 }
727 } 707 }
708 return FALSE;
728} 709}
729 710
730// sculpt replaces generate() for sculpted surfaces 711// sculpt replaces generate() for sculpted surfaces
@@ -737,7 +718,7 @@ void LLVOVolume::sculpt()
737 S8 sculpt_components = 0; 718 S8 sculpt_components = 0;
738 const U8* sculpt_data = NULL; 719 const U8* sculpt_data = NULL;
739 720
740 S32 discard_level = mSculptTexture->getDiscardLevel(); 721 S32 discard_level = mSculptTexture->getCachedRawImageLevel() ;
741 LLImageRaw* raw_image = mSculptTexture->getCachedRawImage() ; 722 LLImageRaw* raw_image = mSculptTexture->getCachedRawImage() ;
742 723
743 S32 max_discard = mSculptTexture->getMaxDiscardLevel(); 724 S32 max_discard = mSculptTexture->getMaxDiscardLevel();
@@ -781,7 +762,7 @@ void LLVOVolume::sculpt()
781 } 762 }
782 getVolume()->sculpt(sculpt_width, sculpt_height, sculpt_components, sculpt_data, discard_level); 763 getVolume()->sculpt(sculpt_width, sculpt_height, sculpt_components, sculpt_data, discard_level);
783 764
784 //notify rebuild any other VOVolumes that reference this sculpty volume 765 /*//notify rebuild any other VOVolumes that reference this sculpty volume
785 for (S32 i = 0; i < mSculptTexture->getNumVolumes(); ++i) 766 for (S32 i = 0; i < mSculptTexture->getNumVolumes(); ++i)
786 { 767 {
787 LLVOVolume* volume = (*(mSculptTexture->getVolumeList()))[i]; 768 LLVOVolume* volume = (*(mSculptTexture->getVolumeList()))[i];
@@ -789,7 +770,7 @@ void LLVOVolume::sculpt()
789 { 770 {
790 gPipeline.markRebuild(volume->mDrawable, LLDrawable::REBUILD_GEOMETRY, FALSE); 771 gPipeline.markRebuild(volume->mDrawable, LLDrawable::REBUILD_GEOMETRY, FALSE);
791 } 772 }
792 } 773 }*/
793 } 774 }
794} 775}
795 776
@@ -2298,6 +2279,16 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group)
2298 } 2279 }
2299 2280
2300 LLVOVolume* vobj = drawablep->getVOVolume(); 2281 LLVOVolume* vobj = drawablep->getVOVolume();
2282
2283 if (vobj->mSculptSurfaceArea > sSculptSAThresh)
2284 {
2285 LLPipeline::sSculptSurfaceAreaFrame += vobj->mSculptSurfaceArea;
2286 if(LLPipeline::sSculptSurfaceAreaFrame > sSculptSAMax)
2287 {
2288 continue;
2289 }
2290 }
2291
2301 llassert_always(vobj); 2292 llassert_always(vobj);
2302 vobj->updateTextureVirtualSize(); 2293 vobj->updateTextureVirtualSize();
2303 vobj->preRebuild(); 2294 vobj->preRebuild();
diff --git a/linden/indra/newview/llvovolume.h b/linden/indra/newview/llvovolume.h
index 7c8a68d..7fba28c 100644
--- a/linden/indra/newview/llvovolume.h
+++ b/linden/indra/newview/llvovolume.h
@@ -171,7 +171,6 @@ public:
171 void setTexture(const S32 face); 171 void setTexture(const S32 face);
172 S32 getIndexInTex() const {return mIndexInTex ;} 172 S32 getIndexInTex() const {return mIndexInTex ;}
173 /*virtual*/ BOOL setVolume(const LLVolumeParams &volume_params, const S32 detail, bool unique_volume = false); 173 /*virtual*/ BOOL setVolume(const LLVolumeParams &volume_params, const S32 detail, bool unique_volume = false);
174 void updateSculptTexture();
175 void setIndexInTex(S32 index) { mIndexInTex = index ;} 174 void setIndexInTex(S32 index) { mIndexInTex = index ;}
176 void sculpt(); 175 void sculpt();
177 void updateRelativeXform(); 176 void updateRelativeXform();
@@ -233,6 +232,7 @@ private:
233 LLFrameTimer mTextureUpdateTimer; 232 LLFrameTimer mTextureUpdateTimer;
234 S32 mLOD; 233 S32 mLOD;
235 BOOL mLODChanged; 234 BOOL mLODChanged;
235 S32 mSculptLevel;
236 BOOL mSculptChanged; 236 BOOL mSculptChanged;
237 LLMatrix4 mRelativeXform; 237 LLMatrix4 mRelativeXform;
238 LLMatrix3 mRelativeXformInvTrans; 238 LLMatrix3 mRelativeXformInvTrans;
diff --git a/linden/indra/newview/pipeline.cpp b/linden/indra/newview/pipeline.cpp
index 5458af5..ae0e605 100644
--- a/linden/indra/newview/pipeline.cpp
+++ b/linden/indra/newview/pipeline.cpp
@@ -257,7 +257,8 @@ BOOL LLPipeline::sRenderFrameTest = FALSE;
257BOOL LLPipeline::sRenderAttachedLights = TRUE; 257BOOL LLPipeline::sRenderAttachedLights = TRUE;
258BOOL LLPipeline::sRenderAttachedParticles = TRUE; 258BOOL LLPipeline::sRenderAttachedParticles = TRUE;
259BOOL LLPipeline::sRenderDeferred = FALSE; 259BOOL LLPipeline::sRenderDeferred = FALSE;
260S32 LLPipeline::sVisibleLightCount = 0; 260S32 LLPipeline::sVisibleLightCount = 0;
261F32 LLPipeline::sSculptSurfaceAreaFrame = 0.0;
261 262
262static LLCullResult* sCull = NULL; 263static LLCullResult* sCull = NULL;
263 264
@@ -2198,6 +2199,8 @@ void LLPipeline::postSort(LLCamera& camera)
2198 LLFastTimer ftm(LLFastTimer::FTM_STATESORT_POSTSORT); 2199 LLFastTimer ftm(LLFastTimer::FTM_STATESORT_POSTSORT);
2199 2200
2200 assertInitialized(); 2201 assertInitialized();
2202
2203 sSculptSurfaceAreaFrame = 0.0;
2201 2204
2202 //rebuild drawable geometry 2205 //rebuild drawable geometry
2203 for (LLCullResult::sg_list_t::iterator i = sCull->beginDrawableGroups(); i != sCull->endDrawableGroups(); ++i) 2206 for (LLCullResult::sg_list_t::iterator i = sCull->beginDrawableGroups(); i != sCull->endDrawableGroups(); ++i)
diff --git a/linden/indra/newview/pipeline.h b/linden/indra/newview/pipeline.h
index 1ecb56e..2252fbd 100644
--- a/linden/indra/newview/pipeline.h
+++ b/linden/indra/newview/pipeline.h
@@ -579,6 +579,8 @@ protected:
579public: 579public:
580 static BOOL sRenderBeacons; 580 static BOOL sRenderBeacons;
581 static BOOL sRenderHighlight; 581 static BOOL sRenderHighlight;
582 static F32 sSculptSurfaceAreaFrame;
583
582}; 584};
583 585
584void render_bbox(const LLVector3 &min, const LLVector3 &max); 586void render_bbox(const LLVector3 &min, const LLVector3 &max);