summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2010-05-21 18:12:38 -0600
committerXiaohong Bao <bao@lindenlab.com>2010-05-21 18:12:38 -0600
commit28d4fe68f8a44924df294473471b47ccb11a2eb1 (patch)
treefcd07f996b3d80887765088f934b3a5b57cbacad /indra/newview
parent79f697ad513525893fe9ebab62bf2a61186342ec (diff)
parent81e6f6131bdc0d0c42dc9a21b7842c911f4dd81d (diff)
Automated merge with ssh://hg.lindenlab.com/dessie/viewer-public
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/low_graphics.xml2
-rw-r--r--indra/newview/featuretable.txt1
-rw-r--r--indra/newview/featuretable_linux.txt1
-rw-r--r--indra/newview/featuretable_mac.txt1
-rw-r--r--indra/newview/featuretable_solaris.txt1
-rw-r--r--indra/newview/lldrawpooltree.cpp15
-rw-r--r--indra/newview/lltexturefetch.cpp20
-rw-r--r--indra/newview/llvotree.cpp38
-rw-r--r--indra/newview/llvotree.h1
-rw-r--r--indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml40
10 files changed, 88 insertions, 32 deletions
diff --git a/indra/newview/app_settings/low_graphics.xml b/indra/newview/app_settings/low_graphics.xml
index 3f67a70d7a..d02a13a671 100644
--- a/indra/newview/app_settings/low_graphics.xml
+++ b/indra/newview/app_settings/low_graphics.xml
@@ -4,6 +4,8 @@
<RenderAvatarCloth value="FALSE"/>
<!--Default for now-->
<RenderAvatarLODFactor value="0.5"/>
+ <!--Default for now-->
+ <RenderAvatarMaxVisible value="3"/>
<!--NO SHADERS-->
<RenderAvatarVP value="FALSE"/>
<!--Short Range-->
diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt
index 5f31ccbb19..f1c1a142ad 100644
--- a/indra/newview/featuretable.txt
+++ b/indra/newview/featuretable.txt
@@ -65,6 +65,7 @@ list Low
RenderAnisotropic 1 0
RenderAvatarCloth 1 0
RenderAvatarLODFactor 1 0.5
+RenderAvatarMaxVisible 1 3
RenderAvatarVP 1 0
RenderFarClip 1 64
RenderFlexTimeFactor 1 0.5
diff --git a/indra/newview/featuretable_linux.txt b/indra/newview/featuretable_linux.txt
index 61a8e51c50..d1d11ee173 100644
--- a/indra/newview/featuretable_linux.txt
+++ b/indra/newview/featuretable_linux.txt
@@ -63,6 +63,7 @@ list Low
RenderAnisotropic 1 0
RenderAvatarCloth 1 0
RenderAvatarLODFactor 1 0.5
+RenderAvatarMaxVisible 1 3
RenderAvatarVP 1 0
RenderFarClip 1 64
RenderFlexTimeFactor 1 0.5
diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt
index 12d47a904c..efd7ec7a91 100644
--- a/indra/newview/featuretable_mac.txt
+++ b/indra/newview/featuretable_mac.txt
@@ -65,6 +65,7 @@ list Low
RenderAnisotropic 1 0
RenderAvatarCloth 1 0
RenderAvatarLODFactor 1 0.5
+RenderAvatarMaxVisible 1 3
RenderAvatarVP 1 0
RenderFarClip 1 64
RenderFlexTimeFactor 1 0.5
diff --git a/indra/newview/featuretable_solaris.txt b/indra/newview/featuretable_solaris.txt
index f24cbde5e2..6edd280686 100644
--- a/indra/newview/featuretable_solaris.txt
+++ b/indra/newview/featuretable_solaris.txt
@@ -117,6 +117,7 @@ UseOcclusion 0 0
list low
RenderVBO 1 0
RenderAniso 1 0
+RenderAvatarMaxVisible 1 3
RenderLighting 1 0
list medium
diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp
index 1a5d55d793..1571415e63 100644
--- a/indra/newview/lldrawpooltree.cpp
+++ b/indra/newview/lldrawpooltree.cpp
@@ -113,9 +113,12 @@ void LLDrawPoolTree::render(S32 pass)
iter != mDrawFace.end(); iter++)
{
LLFace *face = *iter;
- face->mVertexBuffer->setBuffer(LLDrawPoolTree::VERTEX_DATA_MASK);
- face->mVertexBuffer->drawRange(LLRender::TRIANGLES, 0, face->mVertexBuffer->getRequestedVerts()-1, face->mVertexBuffer->getRequestedIndices(), 0);
- gPipeline.addTrianglesDrawn(face->mVertexBuffer->getRequestedIndices());
+ if(face->mVertexBuffer.notNull())
+ {
+ face->mVertexBuffer->setBuffer(LLDrawPoolTree::VERTEX_DATA_MASK);
+ face->mVertexBuffer->drawRange(LLRender::TRIANGLES, 0, face->mVertexBuffer->getRequestedVerts()-1, face->mVertexBuffer->getRequestedIndices(), 0);
+ gPipeline.addTrianglesDrawn(face->mVertexBuffer->getRequestedIndices());
+ }
}
}
}
@@ -333,7 +336,7 @@ void LLDrawPoolTree::renderTree(BOOL selecting)
S32 stop_depth = 0;
F32 app_angle = treep->getAppAngle()*LLVOTree::sTreeFactor;
F32 alpha = 1.0;
- S32 trunk_LOD = 0;
+ S32 trunk_LOD = LLVOTree::sMAX_NUM_TREE_LOD_LEVELS;
for (S32 j = 0; j < 4; j++)
{
@@ -344,6 +347,10 @@ void LLDrawPoolTree::renderTree(BOOL selecting)
break;
}
}
+ if(trunk_LOD >= LLVOTree::sMAX_NUM_TREE_LOD_LEVELS)
+ {
+ continue ; //do not render.
+ }
if (app_angle < (THRESH_ANGLE_FOR_BILLBOARD - BLEND_RANGE_FOR_BILLBOARD))
{
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp
index 7fa04ce574..913a0b92c2 100644
--- a/indra/newview/lltexturefetch.cpp
+++ b/indra/newview/lltexturefetch.cpp
@@ -328,11 +328,7 @@ public:
partial = true;
}
}
- else
- {
- worker->setGetStatus(status, reason);
-// llwarns << status << ": " << reason << llendl;
- }
+
if (!success)
{
worker->setGetStatus(status, reason);
@@ -904,7 +900,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
if (mGetStatus == HTTP_NOT_FOUND)
{
mHTTPFailCount = max_attempts = 1; // Don't retry
- //llinfos << "Texture missing from server (404): " << mUrl << llendl;
+ llwarns << "Texture missing from server (404): " << mUrl << llendl;
//roll back to try UDP
mState = INIT ;
@@ -921,6 +917,17 @@ bool LLTextureFetchWorker::doWork(S32 param)
max_attempts = mHTTPFailCount+1; // Keep retrying
LL_INFOS_ONCE("Texture") << "Texture server busy (503): " << mUrl << LL_ENDL;
}
+ else if(mGetStatus >= HTTP_MULTIPLE_CHOICES && mGetStatus < HTTP_BAD_REQUEST) //http re-direct
+ {
+ ++mHTTPFailCount;
+ max_attempts = 5 ; //try at most 5 times to avoid infinite redirection loop.
+
+ llwarns << "HTTP GET failed because of redirection: " << mUrl
+ << " Status: " << mGetStatus << " Reason: '" << mGetReason << llendl ;
+
+ //assign to the new url
+ mUrl = mGetReason ;
+ }
else
{
const S32 HTTP_MAX_RETRY_COUNT = 3;
@@ -930,6 +937,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
<< " Status: " << mGetStatus << " Reason: '" << mGetReason << "'"
<< " Attempt:" << mHTTPFailCount+1 << "/" << max_attempts << llendl;
}
+
if (mHTTPFailCount >= max_attempts)
{
if (cur_size > 0)
diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp
index b89c0cd638..eb5b6c6618 100644
--- a/indra/newview/llvotree.cpp
+++ b/indra/newview/llvotree.cpp
@@ -66,12 +66,14 @@ const F32 LEAF_TOP = 1.0f;
const F32 LEAF_BOTTOM = 0.52f;
const F32 LEAF_WIDTH = 1.f;
-S32 LLVOTree::sLODVertexOffset[4];
-S32 LLVOTree::sLODVertexCount[4];
-S32 LLVOTree::sLODIndexOffset[4];
-S32 LLVOTree::sLODIndexCount[4];
-S32 LLVOTree::sLODSlices[4] = {10, 5, 4, 3};
-F32 LLVOTree::sLODAngles[4] = {30.f, 20.f, 15.f, 0.f};
+const S32 LLVOTree::sMAX_NUM_TREE_LOD_LEVELS = 4 ;
+
+S32 LLVOTree::sLODVertexOffset[sMAX_NUM_TREE_LOD_LEVELS];
+S32 LLVOTree::sLODVertexCount[sMAX_NUM_TREE_LOD_LEVELS];
+S32 LLVOTree::sLODIndexOffset[sMAX_NUM_TREE_LOD_LEVELS];
+S32 LLVOTree::sLODIndexCount[sMAX_NUM_TREE_LOD_LEVELS];
+S32 LLVOTree::sLODSlices[sMAX_NUM_TREE_LOD_LEVELS] = {10, 5, 4, 3};
+F32 LLVOTree::sLODAngles[sMAX_NUM_TREE_LOD_LEVELS] = {30.f, 20.f, 15.f, 0.00001f};
F32 LLVOTree::sTreeFactor = 1.f;
@@ -373,12 +375,11 @@ BOOL LLVOTree::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
}
}
- S32 trunk_LOD = 0;
+ S32 trunk_LOD = sMAX_NUM_TREE_LOD_LEVELS ;
F32 app_angle = getAppAngle()*LLVOTree::sTreeFactor;
- for (S32 j = 0; j < 4; j++)
+ for (S32 j = 0; j < sMAX_NUM_TREE_LOD_LEVELS; j++)
{
-
if (app_angle > LLVOTree::sLODAngles[j])
{
trunk_LOD = j;
@@ -445,16 +446,15 @@ void LLVOTree::setPixelAreaAndAngle(LLAgent &agent)
// This should be the camera's center, as soon as we move to all region-local.
LLVector3 relative_position = getPositionAgent() - gAgentCamera.getCameraPositionAgent();
- F32 range = relative_position.length(); // ugh, square root
+ F32 range_squared = relative_position.lengthSquared() ;
F32 max_scale = mBillboardScale * getMaxScale();
F32 area = max_scale * (max_scale*mBillboardRatio);
// Compute pixels per meter at the given range
- F32 pixels_per_meter = LLViewerCamera::getInstance()->getViewHeightInPixels() /
- (tan(LLViewerCamera::getInstance()->getView()) * range);
+ F32 pixels_per_meter = LLViewerCamera::getInstance()->getViewHeightInPixels() / tan(LLViewerCamera::getInstance()->getView());
- mPixelArea = (pixels_per_meter) * (pixels_per_meter) * area;
+ mPixelArea = (pixels_per_meter) * (pixels_per_meter) * area / range_squared;
#if 0
// mAppAngle is a bit of voodoo;
// use the one calculated LLViewerObject::setPixelAreaAndAngle above
@@ -506,6 +506,13 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable)
{
LLFastTimer ftm(FTM_UPDATE_TREE);
+ if(mTrunkLOD >= sMAX_NUM_TREE_LOD_LEVELS) //do not display the tree.
+ {
+ mReferenceBuffer = NULL ;
+ mDrawable->getFace(0)->mVertexBuffer = NULL ;
+ return TRUE ;
+ }
+
if (mReferenceBuffer.isNull() || mDrawable->getFace(0)->mVertexBuffer.isNull())
{
const F32 SRR3 = 0.577350269f; // sqrt(1/3)
@@ -523,7 +530,7 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable)
face->mCenterAgent = getPositionAgent();
face->mCenterLocal = face->mCenterAgent;
- for (lod = 0; lod < 4; lod++)
+ for (lod = 0; lod < sMAX_NUM_TREE_LOD_LEVELS; lod++)
{
slices = sLODSlices[lod];
sLODVertexOffset[lod] = max_vertices;
@@ -700,7 +707,7 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable)
// Generate the vertices
// Generate the indices
- for (lod = 0; lod < 4; lod++)
+ for (lod = 0; lod < sMAX_NUM_TREE_LOD_LEVELS; lod++)
{
slices = sLODSlices[lod];
F32 base_radius = 0.65f;
@@ -892,7 +899,6 @@ void LLVOTree::updateMesh()
S32 stop_depth = 0;
F32 alpha = 1.0;
-
U32 vert_count = 0;
U32 index_count = 0;
diff --git a/indra/newview/llvotree.h b/indra/newview/llvotree.h
index feac9e0675..036ad692b1 100644
--- a/indra/newview/llvotree.h
+++ b/indra/newview/llvotree.h
@@ -152,6 +152,7 @@ public:
};
static F32 sTreeFactor; // Tree level of detail factor
+ static const S32 sMAX_NUM_TREE_LOD_LEVELS ;
friend class LLDrawPoolTree;
protected:
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
index 0a56f711dd..10beb89940 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
@@ -160,7 +160,7 @@
layout="topleft"
left="5"
name="CustomGraphics Panel"
- top="124"
+ top="76"
width="485">
<text
type="string"
@@ -351,7 +351,7 @@
top_delta="0"
width="128">
m
- </text>
+ </text>
<slider
control_name="RenderMaxPartCount"
decimal_digits="0"
@@ -367,6 +367,34 @@
name="MaxParticleCount"
top_pad="7"
width="303" />
+ <slider
+ control_name="RenderAvatarMaxVisible"
+ decimal_digits="0"
+ follows="left|top"
+ height="16"
+ increment="2"
+ initial_value="35"
+ label="Max. avatar draw distance:"
+ label_width="185"
+ layout="topleft"
+ left_delta="0"
+ max_val="65"
+ min_val="1"
+ name="MaxAvatarDrawDistance"
+ top_pad="4"
+ width="290" />
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="12"
+ layout="topleft"
+ left_delta="291"
+ name="DrawDistanceMeterText2"
+ top_delta="0"
+ width="128">
+ m
+ </text>
<slider
control_name="RenderGlowResolutionPow"
decimal_digits="0"
@@ -377,7 +405,7 @@
label="Post process quality:"
label_width="185"
layout="topleft"
- left_delta="0"
+ left="200"
max_val="9"
min_val="8"
name="RenderPostProcess"
@@ -522,7 +550,7 @@
layout="topleft"
left="469"
name="PostProcessText"
- top="305"
+ top="60"
width="128">
Low
</text>
@@ -607,7 +635,7 @@
layout="topleft"
left="200"
name="LightingDetailText"
- top_pad="8"
+ top_pad="18"
width="140">
Lighting detail:
</text>
@@ -644,7 +672,7 @@
layout="topleft"
left_pad="-30"
name="TerrainDetailText"
- top="465"
+ top="226"
width="155">
Terrain detail:
</text>