diff options
author | Jacek Antonelli | 2010-02-09 21:16:01 -0600 |
---|---|---|
committer | Jacek Antonelli | 2010-02-16 18:50:22 -0600 |
commit | 8fe8ad59a2f8df4fb1b90ee7cb4d884d9b366920 (patch) | |
tree | 2bfd446fe29250cbd31cb912f952fe2c2ab05c68 /linden/indra | |
parent | Ported some stats and texture console changes from Snowglobe. (diff) | |
download | meta-impy-8fe8ad59a2f8df4fb1b90ee7cb4d884d9b366920.zip meta-impy-8fe8ad59a2f8df4fb1b90ee7cb4d884d9b366920.tar.gz meta-impy-8fe8ad59a2f8df4fb1b90ee7cb4d884d9b366920.tar.bz2 meta-impy-8fe8ad59a2f8df4fb1b90ee7cb4d884d9b366920.tar.xz |
Ported some minor rendering engine changes from Snowglobe.
Diffstat (limited to 'linden/indra')
-rw-r--r-- | linden/indra/newview/llappviewer.cpp | 2 | ||||
-rw-r--r-- | linden/indra/newview/llviewerobject.cpp | 18 | ||||
-rw-r--r-- | linden/indra/newview/llviewerobject.h | 1 | ||||
-rw-r--r-- | linden/indra/newview/llviewerobjectlist.cpp | 64 | ||||
-rw-r--r-- | linden/indra/newview/llvlcomposition.cpp | 9 | ||||
-rw-r--r-- | linden/indra/newview/llvosky.h | 2 | ||||
-rw-r--r-- | linden/indra/newview/pipeline.cpp | 10 |
7 files changed, 51 insertions, 55 deletions
diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp index 3a509ff..1eac043 100644 --- a/linden/indra/newview/llappviewer.cpp +++ b/linden/indra/newview/llappviewer.cpp | |||
@@ -250,7 +250,7 @@ F32 gFPSClamped = 10.f; // Pretend we start at target rate. | |||
250 | F32 gFrameDTClamped = 0.f; // Time between adjacent checks to network for packets | 250 | F32 gFrameDTClamped = 0.f; // Time between adjacent checks to network for packets |
251 | U64 gStartTime = 0; // gStartTime is "private", used only to calculate gFrameTimeSeconds | 251 | U64 gStartTime = 0; // gStartTime is "private", used only to calculate gFrameTimeSeconds |
252 | U32 gFrameStalls = 0; | 252 | U32 gFrameStalls = 0; |
253 | const F64 FRAME_STALL_THRESHOLD = 5.0; | 253 | const F64 FRAME_STALL_THRESHOLD = 1.0; |
254 | 254 | ||
255 | LLTimer gRenderStartTime; | 255 | LLTimer gRenderStartTime; |
256 | LLFrameTimer gForegroundTime; | 256 | LLFrameTimer gForegroundTime; |
diff --git a/linden/indra/newview/llviewerobject.cpp b/linden/indra/newview/llviewerobject.cpp index 860052c..ca741c4 100644 --- a/linden/indra/newview/llviewerobject.cpp +++ b/linden/indra/newview/llviewerobject.cpp | |||
@@ -506,8 +506,6 @@ void LLViewerObject::setParent(LLViewerObject* parent) | |||
506 | 506 | ||
507 | void LLViewerObject::addChild(LLViewerObject *childp) | 507 | void LLViewerObject::addChild(LLViewerObject *childp) |
508 | { | 508 | { |
509 | BOOL result = TRUE; | ||
510 | |||
511 | for (child_list_t::iterator i = mChildList.begin(); i != mChildList.end(); ++i) | 509 | for (child_list_t::iterator i = mChildList.begin(); i != mChildList.end(); ++i) |
512 | { | 510 | { |
513 | if (*i == childp) | 511 | if (*i == childp) |
@@ -525,16 +523,6 @@ void LLViewerObject::addChild(LLViewerObject *childp) | |||
525 | childp->setParent(this); | 523 | childp->setParent(this); |
526 | mChildList.push_back(childp); | 524 | mChildList.push_back(childp); |
527 | 525 | ||
528 | if (!result) | ||
529 | { | ||
530 | llwarns << "Failed to attach child " << childp->getID() << " to object " << getID() << llendl; | ||
531 | removeChild(childp); | ||
532 | if (mJointInfo) | ||
533 | { | ||
534 | delete mJointInfo; | ||
535 | mJointInfo = NULL; | ||
536 | } | ||
537 | } | ||
538 | } | 526 | } |
539 | 527 | ||
540 | void LLViewerObject::removeChild(LLViewerObject *childp) | 528 | void LLViewerObject::removeChild(LLViewerObject *childp) |
@@ -637,8 +625,8 @@ BOOL LLViewerObject::setDrawableParent(LLDrawable* parentp) | |||
637 | 625 | ||
638 | BOOL ret = mDrawable->mXform.setParent(parentp ? &parentp->mXform : NULL); | 626 | BOOL ret = mDrawable->mXform.setParent(parentp ? &parentp->mXform : NULL); |
639 | gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE); | 627 | gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_VOLUME, TRUE); |
640 | if( old_parent != parentp && | 628 | if( (old_parent != parentp && old_parent) |
641 | old_parent || (parentp && parentp->isActive())) | 629 | || (parentp && parentp->isActive())) |
642 | { | 630 | { |
643 | // *TODO we should not be relying on setDrawable parent to call markMoved | 631 | // *TODO we should not be relying on setDrawable parent to call markMoved |
644 | gPipeline.markMoved(mDrawable, FALSE); | 632 | gPipeline.markMoved(mDrawable, FALSE); |
@@ -1814,7 +1802,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, | |||
1814 | if (cdp) | 1802 | if (cdp) |
1815 | { | 1803 | { |
1816 | F32 ping_delay = 0.5f * mTimeDilation * ( ((F32)cdp->getPingDelay()) * 0.001f + gFrameDTClamped); | 1804 | F32 ping_delay = 0.5f * mTimeDilation * ( ((F32)cdp->getPingDelay()) * 0.001f + gFrameDTClamped); |
1817 | LLVector3 diff = getVelocity() * (0.5f*mTimeDilation*(gFrameDTClamped + ((F32)ping_delay)*0.001f)); | 1805 | LLVector3 diff = getVelocity() * ping_delay; |
1818 | new_pos_parent += diff; | 1806 | new_pos_parent += diff; |
1819 | } | 1807 | } |
1820 | else | 1808 | else |
diff --git a/linden/indra/newview/llviewerobject.h b/linden/indra/newview/llviewerobject.h index 88f967f..7f8bd63 100644 --- a/linden/indra/newview/llviewerobject.h +++ b/linden/indra/newview/llviewerobject.h | |||
@@ -50,7 +50,6 @@ | |||
50 | #include "v3dmath.h" | 50 | #include "v3dmath.h" |
51 | #include "v3math.h" | 51 | #include "v3math.h" |
52 | #include "llvertexbuffer.h" | 52 | #include "llvertexbuffer.h" |
53 | #include "llpartdata.h" | ||
54 | 53 | ||
55 | class LLAgent; // TODO: Get rid of this. | 54 | class LLAgent; // TODO: Get rid of this. |
56 | class LLAudioSource; | 55 | class LLAudioSource; |
diff --git a/linden/indra/newview/llviewerobjectlist.cpp b/linden/indra/newview/llviewerobjectlist.cpp index 3ac8fc4..21a9252 100644 --- a/linden/indra/newview/llviewerobjectlist.cpp +++ b/linden/indra/newview/llviewerobjectlist.cpp | |||
@@ -166,7 +166,7 @@ U64 LLViewerObjectList::getIndex(const U32 local_id, | |||
166 | 166 | ||
167 | BOOL LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject &object) | 167 | BOOL LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject &object) |
168 | { | 168 | { |
169 | if (object.mRegionp) | 169 | if(object.getRegion()) |
170 | { | 170 | { |
171 | U32 local_id = object.mLocalID; | 171 | U32 local_id = object.mLocalID; |
172 | LLHost region_host = object.getRegion()->getHost(); | 172 | LLHost region_host = object.getRegion()->getHost(); |
@@ -176,7 +176,22 @@ BOOL LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject &object) | |||
176 | U32 index = sIPAndPortToIndex[ipport]; | 176 | U32 index = sIPAndPortToIndex[ipport]; |
177 | 177 | ||
178 | U64 indexid = (((U64)index) << 32) | (U64)local_id; | 178 | U64 indexid = (((U64)index) << 32) | (U64)local_id; |
179 | return sIndexAndLocalIDToUUID.erase(indexid) > 0 ? TRUE : FALSE; | 179 | |
180 | std::map<U64, LLUUID>::iterator iter = sIndexAndLocalIDToUUID.find(indexid); | ||
181 | if (iter == sIndexAndLocalIDToUUID.end()) | ||
182 | { | ||
183 | return FALSE; | ||
184 | } | ||
185 | |||
186 | // Found existing entry | ||
187 | if (iter->second == object.getID()) | ||
188 | { // Full UUIDs match, so remove the entry | ||
189 | sIndexAndLocalIDToUUID.erase(iter); | ||
190 | return TRUE; | ||
191 | } | ||
192 | // UUIDs did not match - this would zap a valid entry, so don't erase it | ||
193 | //llinfos << "Tried to erase entry where id in table (" | ||
194 | // << iter->second << ") did not match object " << object.getID() << llendl; | ||
180 | } | 195 | } |
181 | return FALSE; | 196 | return FALSE; |
182 | } | 197 | } |
@@ -429,13 +444,27 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, | |||
429 | 444 | ||
430 | // This looks like it will break if the local_id of the object doesn't change | 445 | // This looks like it will break if the local_id of the object doesn't change |
431 | // upon boundary crossing, but we check for region id matching later... | 446 | // upon boundary crossing, but we check for region id matching later... |
432 | if (objectp && (objectp->mLocalID != local_id)) | 447 | // Reset object local id and region pointer if things have changed |
448 | if (objectp && | ||
449 | ((objectp->mLocalID != local_id) || | ||
450 | (objectp->getRegion() != regionp))) | ||
433 | { | 451 | { |
434 | removeFromLocalIDTable(*objectp); | 452 | removeFromLocalIDTable(*objectp); |
435 | setUUIDAndLocal(fullid, | 453 | setUUIDAndLocal(fullid, |
436 | local_id, | 454 | local_id, |
437 | gMessageSystem->getSenderIP(), | 455 | gMessageSystem->getSenderIP(), |
438 | gMessageSystem->getSenderPort()); | 456 | gMessageSystem->getSenderPort()); |
457 | |||
458 | if (objectp->mLocalID != local_id) | ||
459 | { // Update local ID in object with the one sent from the region | ||
460 | objectp->mLocalID = local_id; | ||
461 | } | ||
462 | |||
463 | if (objectp->getRegion() != regionp) | ||
464 | { // Object changed region, so update it | ||
465 | objectp->setRegion(regionp); | ||
466 | objectp->updateRegion(regionp); // for LLVOAvatar | ||
467 | } | ||
439 | } | 468 | } |
440 | 469 | ||
441 | if (!objectp) | 470 | if (!objectp) |
@@ -478,20 +507,6 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, | |||
478 | justCreated = TRUE; | 507 | justCreated = TRUE; |
479 | mNumNewObjects++; | 508 | mNumNewObjects++; |
480 | } | 509 | } |
481 | else | ||
482 | { | ||
483 | if (objectp->getRegion() != regionp) | ||
484 | { | ||
485 | // Object has changed region! Update lookup tables, set region pointer. | ||
486 | removeFromLocalIDTable(*objectp); | ||
487 | setUUIDAndLocal(fullid, | ||
488 | local_id, | ||
489 | gMessageSystem->getSenderIP(), | ||
490 | gMessageSystem->getSenderPort()); | ||
491 | objectp->setRegion(regionp); | ||
492 | } | ||
493 | objectp->updateRegion(regionp); // for LLVOAvatar | ||
494 | } | ||
495 | 510 | ||
496 | 511 | ||
497 | if (objectp->isDead()) | 512 | if (objectp->isDead()) |
@@ -837,10 +852,17 @@ void LLViewerObjectList::removeDrawable(LLDrawable* drawablep) | |||
837 | 852 | ||
838 | for (S32 i = 0; i < drawablep->getNumFaces(); i++) | 853 | for (S32 i = 0; i < drawablep->getNumFaces(); i++) |
839 | { | 854 | { |
840 | LLViewerObject* objectp = drawablep->getFace(i)->getViewerObject(); | 855 | LLFace* facep = drawablep->getFace(i) ; |
856 | if(facep) | ||
857 | { | ||
858 | LLViewerObject* objectp = facep->getViewerObject(); | ||
859 | if(objectp) | ||
860 | { | ||
841 | mSelectPickList.erase(objectp); | 861 | mSelectPickList.erase(objectp); |
842 | } | 862 | } |
843 | } | 863 | } |
864 | } | ||
865 | } | ||
844 | 866 | ||
845 | BOOL LLViewerObjectList::killObject(LLViewerObject *objectp) | 867 | BOOL LLViewerObjectList::killObject(LLViewerObject *objectp) |
846 | { | 868 | { |
@@ -876,10 +898,6 @@ void LLViewerObjectList::killObjects(LLViewerRegion *regionp) | |||
876 | if (objectp->mRegionp == regionp) | 898 | if (objectp->mRegionp == regionp) |
877 | { | 899 | { |
878 | killObject(objectp); | 900 | killObject(objectp); |
879 | |||
880 | // invalidate region pointer. region will become invalid, but | ||
881 | // refcounted objects may survive the cleanDeadObjects() call below | ||
882 | objectp->mRegionp = NULL; | ||
883 | } | 901 | } |
884 | } | 902 | } |
885 | 903 | ||
@@ -917,7 +935,7 @@ void LLViewerObjectList::killAllObjects() | |||
917 | if (!mMapObjects.empty()) | 935 | if (!mMapObjects.empty()) |
918 | { | 936 | { |
919 | llwarns << "Some objects still on map object list!" << llendl; | 937 | llwarns << "Some objects still on map object list!" << llendl; |
920 | mActiveObjects.clear(); | 938 | mMapObjects.clear(); |
921 | } | 939 | } |
922 | } | 940 | } |
923 | 941 | ||
diff --git a/linden/indra/newview/llvlcomposition.cpp b/linden/indra/newview/llvlcomposition.cpp index 9c383c7..e12504c 100644 --- a/linden/indra/newview/llvlcomposition.cpp +++ b/linden/indra/newview/llvlcomposition.cpp | |||
@@ -80,13 +80,8 @@ LLVLComposition::LLVLComposition(LLSurface *surfacep, const U32 width, const F32 | |||
80 | // Initialize the texture matrix to defaults. | 80 | // Initialize the texture matrix to defaults. |
81 | for (S32 i = 0; i < CORNER_COUNT; ++i) | 81 | for (S32 i = 0; i < CORNER_COUNT; ++i) |
82 | { | 82 | { |
83 | //Zwag: I'm making these static values because they are a LARGE performance problem | 83 | mStartHeight[i] = gSavedSettings.getF32("TerrainColorStartHeight"); |
84 | // right now, and I've never heard of anyone changing them, they are not referenced | 84 | mHeightRange[i] = gSavedSettings.getF32("TerrainColorHeightRange"); |
85 | // elsewhere, and have not changed in defaults since the original source code release. | ||
86 | // We can move these back to signal connected statics if they really become important | ||
87 | // variables in the future. | ||
88 | mStartHeight[i] = 20.f;//gSavedSettings.getF32("TerrainColorStartHeight"); | ||
89 | mHeightRange[i] = 60.f;//gSavedSettings.getF32("TerrainColorHeightRange"); | ||
90 | } | 85 | } |
91 | mTexScaleX = 16.f; | 86 | mTexScaleX = 16.f; |
92 | mTexScaleY = 16.f; | 87 | mTexScaleY = 16.f; |
diff --git a/linden/indra/newview/llvosky.h b/linden/indra/newview/llvosky.h index 333e144..dabf5b1 100644 --- a/linden/indra/newview/llvosky.h +++ b/linden/indra/newview/llvosky.h | |||
@@ -147,7 +147,7 @@ protected: | |||
147 | 147 | ||
148 | static S32 getResolution() { return sResolution; } | 148 | static S32 getResolution() { return sResolution; } |
149 | static S32 getCurrent() { return sCurrent; } | 149 | static S32 getCurrent() { return sCurrent; } |
150 | static S32 stepCurrent() { return (sCurrent = (sCurrent+1) % 2); } | 150 | static S32 stepCurrent() { sCurrent++; sCurrent&=1; return sCurrent; } |
151 | static S32 getNext() { return ((sCurrent+1) % 2); } | 151 | static S32 getNext() { return ((sCurrent+1) % 2); } |
152 | static S32 getWhich(const BOOL curr) { return curr ? sCurrent : getNext(); } | 152 | static S32 getWhich(const BOOL curr) { return curr ? sCurrent : getNext(); } |
153 | 153 | ||
diff --git a/linden/indra/newview/pipeline.cpp b/linden/indra/newview/pipeline.cpp index d3ee8b6..e36e296 100644 --- a/linden/indra/newview/pipeline.cpp +++ b/linden/indra/newview/pipeline.cpp | |||
@@ -1272,6 +1272,7 @@ F32 LLPipeline::calcPixelArea(LLVector3 center, LLVector3 size, LLCamera &camera | |||
1272 | F32 dist = lookAt.length(); | 1272 | F32 dist = lookAt.length(); |
1273 | 1273 | ||
1274 | //ramp down distance for nearby objects | 1274 | //ramp down distance for nearby objects |
1275 | //shrink dist by dist/16. | ||
1275 | if (dist < 16.f) | 1276 | if (dist < 16.f) |
1276 | { | 1277 | { |
1277 | dist /= 16.f; | 1278 | dist /= 16.f; |
@@ -2540,8 +2541,8 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) | |||
2540 | //to guaranttee at least updating one VBO buffer every frame | 2541 | //to guaranttee at least updating one VBO buffer every frame |
2541 | //to walk around the bug caused by ATI card --> DEV-3855 | 2542 | //to walk around the bug caused by ATI card --> DEV-3855 |
2542 | // | 2543 | // |
2543 | if(forceVBOUpdate) | 2544 | //if(forceVBOUpdate) |
2544 | gSky.mVOSkyp->updateDummyVertexBuffer() ; | 2545 | // gSky.mVOSkyp->updateDummyVertexBuffer() ; |
2545 | 2546 | ||
2546 | gFrameStats.start(LLFrameStats::RENDER_GEOM); | 2547 | gFrameStats.start(LLFrameStats::RENDER_GEOM); |
2547 | 2548 | ||
@@ -4202,11 +4203,6 @@ void LLPipeline::enableLightsAvatar() | |||
4202 | 4203 | ||
4203 | void LLPipeline::enableLightsAvatarEdit(const LLColor4& color) | 4204 | void LLPipeline::enableLightsAvatarEdit(const LLColor4& color) |
4204 | { | 4205 | { |
4205 | if (mLightingDetail < 1) | ||
4206 | { | ||
4207 | return; | ||
4208 | } | ||
4209 | |||
4210 | U32 mask = 0x2002; // Avatar backlight only, set ambient | 4206 | U32 mask = 0x2002; // Avatar backlight only, set ambient |
4211 | setupAvatarLights(TRUE); | 4207 | setupAvatarLights(TRUE); |
4212 | enableLights(mask); | 4208 | enableLights(mask); |