summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/app_settings/settings.xml13
-rw-r--r--indra/newview/generate_breakpad_symbols.py52
-rw-r--r--indra/newview/lldrawable.cpp2
-rw-r--r--indra/newview/lldrawpoolavatar.cpp10
-rw-r--r--indra/newview/lldrawpoolwlsky.cpp2
-rw-r--r--indra/newview/llflexibleobject.cpp7
-rwxr-xr-xindra/newview/llfloatermodelpreview.cpp187
-rw-r--r--indra/newview/llfloatermodelpreview.h2
-rwxr-xr-xindra/newview/llmeshrepository.cpp2
-rw-r--r--indra/newview/llmeshrepository.h8
-rw-r--r--indra/newview/llpanelobject.cpp4
-rw-r--r--indra/newview/llspatialpartition.cpp132
-rw-r--r--indra/newview/llspatialpartition.h12
-rw-r--r--indra/newview/llviewercontrol.cpp12
-rw-r--r--indra/newview/llviewerdisplay.cpp6
-rw-r--r--indra/newview/llviewerjointmesh.cpp2
-rw-r--r--indra/newview/llvoavatar.cpp26
-rw-r--r--indra/newview/llvopartgroup.cpp2
-rw-r--r--indra/newview/llvotree.cpp2
-rw-r--r--indra/newview/llvovolume.cpp23
-rw-r--r--indra/newview/llvowater.cpp2
-rwxr-xr-xindra/newview/pipeline.cpp290
-rw-r--r--indra/newview/pipeline.h1
-rw-r--r--indra/newview/skins/default/xui/en/floater_region_debug_console.xml3
-rw-r--r--indra/newview/tests/test_llxmlrpc_peer.py2
-rw-r--r--indra/newview/viewer_manifest.py54
26 files changed, 353 insertions, 505 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index d71b84739c..ec6b942e3e 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -8810,7 +8810,18 @@
<key>Value</key>
<integer>1</integer>
</map>
- <key>RenderVolumeLODFactor</key>
+ <key>RenderPreferStreamDraw</key>
+ <map>
+ <key>Comment</key>
+ <string>Use GL_STREAM_DRAW in place of GL_DYNAMIC_DRAW</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
+ <key>RenderVolumeLODFactor</key>
<map>
<key>Comment</key>
<string>Controls level of detail of primitives (multiplier for current screen area when calculated level of detail)</string>
diff --git a/indra/newview/generate_breakpad_symbols.py b/indra/newview/generate_breakpad_symbols.py
index 4fd04d780e..5ebec1563e 100644
--- a/indra/newview/generate_breakpad_symbols.py
+++ b/indra/newview/generate_breakpad_symbols.py
@@ -1,29 +1,31 @@
#!/usr/bin/env python
-# @file generate_breakpad_symbols.py
-# @author Brad Kittenbrink <brad@lindenlab.com>
-# @brief Simple tool for generating google_breakpad symbol information
-# for the crash reporter.
-#
-# $LicenseInfo:firstyear=2010&license=viewerlgpl$
-# Second Life Viewer Source Code
-# Copyright (C) 2010, Linden Research, Inc.
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation;
-# version 2.1 of the License only.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
-# $/LicenseInfo$
+"""\
+@file generate_breakpad_symbols.py
+@author Brad Kittenbrink <brad@lindenlab.com>
+@brief Simple tool for generating google_breakpad symbol information
+ for the crash reporter.
+
+$LicenseInfo:firstyear=2010&license=viewerlgpl$
+Second Life Viewer Source Code
+Copyright (C) 2010-2011, Linden Research, Inc.
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation;
+version 2.1 of the License only.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+$/LicenseInfo$
+"""
import collections
diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp
index cbee800acb..d370c72a04 100644
--- a/indra/newview/lldrawable.cpp
+++ b/indra/newview/lldrawable.cpp
@@ -1052,7 +1052,7 @@ BOOL LLDrawable::isVisible() const
//=======================================
LLSpatialBridge::LLSpatialBridge(LLDrawable* root, BOOL render_by_group, U32 data_mask)
-: LLSpatialPartition(data_mask, render_by_group, FALSE)
+: LLSpatialPartition(data_mask, render_by_group, GL_STREAM_DRAW_ARB)
{
mDrawable = root;
root->setSpatialBridge(this);
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index ae3421a019..b044a89af8 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -507,6 +507,11 @@ void LLDrawPoolAvatar::beginRenderPass(S32 pass)
//reset vertex buffer mappings
LLVertexBuffer::unbind();
+ if (pass == 0)
+ { //make sure no stale colors are left over from a previous render
+ glColor4f(1,1,1,1);
+ }
+
if (LLPipeline::sImpostorRender)
{ //impostor render does not have impostors or rigid rendering
pass += 2;
@@ -1030,6 +1035,7 @@ void LLDrawPoolAvatar::beginDeferredSkinned()
sVertexProgram->bind();
+ sDiffuseChannel = sVertexProgram->enableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
enable_vertex_weighting(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT]);
gGL.getTexUnit(0)->activate();
@@ -1042,6 +1048,8 @@ void LLDrawPoolAvatar::endDeferredSkinned()
disable_vertex_weighting(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT]);
sVertexProgram->unbind();
+ sVertexProgram->disableTexture(LLViewerShaderMgr::DIFFUSE_MAP);
+
sShaderLevel = mVertexShaderLevel;
gGL.getTexUnit(0)->activate();
@@ -1126,8 +1134,6 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
return;
}
- LLOverrideFaceColor color(this, 1.0f, 1.0f, 1.0f, 1.0f);
-
if (pass == 0)
{
if (!LLPipeline::sReflectionRender)
diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp
index eaa6aa7e37..696c2d1abd 100644
--- a/indra/newview/lldrawpoolwlsky.cpp
+++ b/indra/newview/lldrawpoolwlsky.cpp
@@ -192,7 +192,7 @@ void LLDrawPoolWLSky::renderSkyClouds(F32 camHeightLocal) const
&gWLCloudProgram;
LLGLEnable blend(GL_BLEND);
- LLGLSBlendFunc blendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ gGL.setSceneBlendType(LLRender::BT_ALPHA);
gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT);
gGL.getTexUnit(0)->bind(sCloudNoiseTexture);
diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp
index 689fa72958..bd939d8636 100644
--- a/indra/newview/llflexibleobject.cpp
+++ b/indra/newview/llflexibleobject.cpp
@@ -366,7 +366,7 @@ void LLVolumeImplFlexible::doFlexibleUpdate()
LLFastTimer ftm(FTM_DO_FLEXIBLE_UPDATE);
LLVolume* volume = mVO->getVolume();
LLPath *path = &volume->getPath();
- if (mSimulateRes == 0 && mVO->mDrawable->isVisible())
+ if ((mSimulateRes == 0 || !mInitialized) && mVO->mDrawable->isVisible())
{
mVO->markForUpdate(TRUE);
if (!doIdleUpdate(gAgent, *LLWorld::getInstance(), 0.0))
@@ -375,6 +375,11 @@ void LLVolumeImplFlexible::doFlexibleUpdate()
}
}
+ if (!mVO->mDrawable->isVisible())
+ {
+ return;
+ }
+
llassert_always(mInitialized);
S32 num_sections = 1 << mSimulateRes;
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 7d42c842e8..42c93a91a5 100755
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -1653,7 +1653,7 @@ void LLModelLoader::run()
std::vector<LLImportMaterial> materials;
materials.resize(model->getNumVolumeFaces());
- mScene[transformation].push_back(LLModelInstance(model, transformation, materials));
+ mScene[transformation].push_back(LLModelInstance(model, model->mLabel, transformation, materials));
stretch_extents(model, transformation, mExtents[0], mExtents[1], mFirstTransform);
}
}
@@ -1944,7 +1944,8 @@ void LLModelLoader::processElement(daeElement* element)
mesh_scale *= transformation;
transformation = mesh_scale;
- mScene[transformation].push_back(LLModelInstance(model, transformation, materials));
+ std::string label = getElementLabel(instance_geo);
+ mScene[transformation].push_back(LLModelInstance(model, label, transformation, materials));
stretch_extents(model, transformation, mExtents[0], mExtents[1], mFirstTransform);
}
@@ -2615,188 +2616,6 @@ void LLModelPreview::generateNormals()
}
-void LLModelPreview::consolidate()
-{
- std::map<LLImportMaterial, std::vector<LLModelInstance> > composite;
-
- LLMatrix4 identity;
-
- //bake out each node in current scene to composite
- for (LLModelLoader::scene::iterator iter = mScene[mPreviewLOD].begin(); iter != mScene[mPreviewLOD].end(); ++iter)
- { //for each transform in current scene
- LLMatrix4 mat = iter->first;
- glh::matrix4f inv_trans = glh::matrix4f((F32*) mat.mMatrix).inverse().transpose();
- LLMatrix4 norm_mat(inv_trans.m);
-
- for (LLModelLoader::model_instance_list::iterator model_iter = iter->second.begin(); model_iter != iter->second.end(); ++model_iter)
- { //for each instance with that transform
- LLModelInstance& source_instance = *model_iter;
- LLModel* source = source_instance.mModel;
-
- if (!validate_model(source))
- {
- llerrs << "Invalid model found!" << llendl;
- }
-
- for (S32 i = 0; i < source->getNumVolumeFaces(); ++i)
- { //for each face in instance
- const LLVolumeFace& src_face = source->getVolumeFace(i);
- LLImportMaterial& source_material = source_instance.mMaterial[i];
-
- //get model in composite that is composite for this material
- LLModel* model = NULL;
-
- if (composite.find(source_material) != composite.end())
- {
- model = composite[source_material].rbegin()->mModel;
- if (model->getVolumeFace(0).mNumVertices + src_face.mNumVertices > 65535)
- {
- model = NULL;
- }
- }
-
- if (model == NULL)
- { //no model found, make new model
- std::vector<LLImportMaterial> materials;
- materials.push_back(source_material);
- LLVolumeParams volume_params;
- volume_params.setType(LL_PCODE_PROFILE_SQUARE, LL_PCODE_PATH_LINE);
- model = new LLModel(volume_params, 0.f);
- model->mLabel = source->mLabel;
- model->setNumVolumeFaces(0);
- composite[source_material].push_back(LLModelInstance(model, identity, materials));
- }
-
- model->appendFace(src_face, source->mMaterialList[i], mat, norm_mat);
- }
- }
- }
-
-
- //condense composite into as few LLModel instances as possible
- LLModelLoader::model_list new_model;
- std::vector<LLModelInstance> instance_list;
-
- LLVolumeParams volume_params;
- volume_params.setType(LL_PCODE_PROFILE_SQUARE, LL_PCODE_PATH_LINE);
-
- std::vector<LLImportMaterial> empty_material;
- LLModelInstance cur_instance(new LLModel(volume_params, 0.f), identity, empty_material);
- cur_instance.mModel->setNumVolumeFaces(0);
-
- BOOL first_transform = TRUE;
-
- LLModelLoader::scene new_scene;
- LLVector3 min,max;
-
- for (std::map<LLImportMaterial, std::vector<LLModelInstance> >::iterator iter = composite.begin();
- iter != composite.end();
- ++iter)
- {
- std::map<LLImportMaterial, std::vector<LLModelInstance> >::iterator next_iter = iter; ++next_iter;
-
- for (std::vector<LLModelInstance>::iterator instance_iter = iter->second.begin();
- instance_iter != iter->second.end();
- ++instance_iter)
- {
- LLModel* source = instance_iter->mModel;
-
- if (instance_iter->mMaterial.size() != 1)
- {
- llerrs << "WTF?" << llendl;
- }
-
- if (source->getNumVolumeFaces() != 1)
- {
- llerrs << "WTF?" << llendl;
- }
-
- if (source->mMaterialList.size() != 1)
- {
- llerrs << "WTF?" << llendl;
- }
-
- cur_instance.mModel->addFace(source->getVolumeFace(0));
- cur_instance.mMaterial.push_back(instance_iter->mMaterial[0]);
- cur_instance.mModel->mMaterialList.push_back(source->mMaterialList[0]);
-
- BOOL last_model = FALSE;
-
- std::vector<LLModelInstance>::iterator next_instance = instance_iter; ++next_instance;
-
- if (next_iter == composite.end() &&
- next_instance == iter->second.end())
- {
- last_model = TRUE;
- }
-
- if (last_model || cur_instance.mModel->getNumVolumeFaces() >= MAX_MODEL_FACES)
- {
- cur_instance.mModel->mLabel = source->mLabel;
-
- cur_instance.mModel->optimizeVolumeFaces();
- cur_instance.mModel->normalizeVolumeFaces();
-
- if (!validate_model(cur_instance.mModel))
- {
- llerrs << "Invalid model detected." << llendl;
- }
-
- new_model.push_back(cur_instance.mModel);
-
- LLMatrix4 transformation = LLMatrix4();
-
- // adjust the transformation to compensate for mesh normalization
- LLVector3 mesh_scale_vector;
- LLVector3 mesh_translation_vector;
- cur_instance.mModel->getNormalizedScaleTranslation(mesh_scale_vector, mesh_translation_vector);
-
- LLMatrix4 mesh_translation;
- mesh_translation.setTranslation(mesh_translation_vector);
- mesh_translation *= transformation;
- transformation = mesh_translation;
-
- LLMatrix4 mesh_scale;
- mesh_scale.initScale(mesh_scale_vector);
- mesh_scale *= transformation;
- transformation = mesh_scale;
-
- cur_instance.mTransform = transformation;
-
- new_scene[transformation].push_back(cur_instance);
- stretch_extents(cur_instance.mModel, transformation, min, max, first_transform);
-
- if (!last_model)
- {
- cur_instance = LLModelInstance(new LLModel(volume_params, 0.f), identity, empty_material);
- cur_instance.mModel->setNumVolumeFaces(0);
- }
- }
- }
- }
-
- mScene[mPreviewLOD] = new_scene;
- mModel[mPreviewLOD] = new_model;
- mVertexBuffer[mPreviewLOD].clear();
-
- if (mPreviewLOD == LLModel::LOD_HIGH)
- {
- mBaseScene = new_scene;
- mBaseModel = new_model;
- clearGLODGroup();
- mVertexBuffer[5].clear();
- }
-
- mPreviewTarget = (min+max)*0.5f;
- mPreviewScale = (max-min)*0.5f;
- setPreviewTarget(mPreviewScale.magVec()*2.f);
-
- clearIncompatible(mPreviewLOD);
-
- mResourceCost = calcResourceCost();
- refresh();
-}
-
void LLModelPreview::clearMaterials()
{
for (LLModelLoader::scene::iterator iter = mScene[mPreviewLOD].begin(); iter != mScene[mPreviewLOD].end(); ++iter)
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index 8fc85cebb9..e1c520134b 100644
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -279,7 +279,7 @@ public:
void loadModelCallback(S32 lod);
void genLODs(S32 which_lod = -1, U32 decimation = 3, bool enforce_tri_limit = false);
void generateNormals();
- void consolidate();
+
void clearMaterials();
U32 calcResourceCost();
void rebuildUploadData();
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index a2b0ac09af..b6e3626cba 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -2981,7 +2981,7 @@ LLSD LLMeshUploadThread::createObject(LLModelInstance& instance)
object_params["pos"] = ll_sd_from_vector3(position + mOrigin);
object_params["rotation"] = ll_sd_from_quaternion(quat_rotation);
object_params["scale"] = ll_sd_from_vector3(scale);
- object_params["name"] = instance.mModel->getName();
+ object_params["name"] = instance.mLabel;
// load material from dae file
object_params["facelist"] = LLSD::emptyArray();
diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h
index b642a89192..0fcb2213de 100644
--- a/indra/newview/llmeshrepository.h
+++ b/indra/newview/llmeshrepository.h
@@ -108,14 +108,16 @@ class LLModelInstance
public:
LLPointer<LLModel> mModel;
LLPointer<LLModel> mLOD[5];
-
+
+ std::string mLabel;
+
LLUUID mMeshID;
LLMatrix4 mTransform;
std::vector<LLImportMaterial> mMaterial;
- LLModelInstance(LLModel* model, LLMatrix4& transform, std::vector<LLImportMaterial>& materials)
- : mModel(model), mTransform(transform), mMaterial(materials)
+ LLModelInstance(LLModel* model, const std::string& label, LLMatrix4& transform, std::vector<LLImportMaterial>& materials)
+ : mModel(model), mLabel(label), mTransform(transform), mMaterial(materials)
{
}
};
diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp
index 42da966b92..0300ea0c92 100644
--- a/indra/newview/llpanelobject.cpp
+++ b/indra/newview/llpanelobject.cpp
@@ -1178,13 +1178,13 @@ void LLPanelObject::getState( )
if (mCtrlSculptMirror)
{
mCtrlSculptMirror->set(sculpt_mirror);
- mCtrlSculptMirror->setEnabled(editable && (sculpt_stitching != LL_SCULPT_TYPE_MESH));
+ mCtrlSculptMirror->setEnabled(editable);
}
if (mCtrlSculptInvert)
{
mCtrlSculptInvert->set(sculpt_invert);
- mCtrlSculptInvert->setEnabled(editable && (!isMesh));
+ mCtrlSculptInvert->setEnabled(editable);
}
if (mLabelSculptType)
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index 5dd1b5ba7e..14775f0f21 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -252,11 +252,15 @@ U8* get_box_fan_indices_ptr(LLCamera* camera, const LLVector4a& center)
}
+static LLFastTimer::DeclareTimer FTM_BUILD_OCCLUSION("Build Occlusion");
+
void LLSpatialGroup::buildOcclusion()
{
if (mOcclusionVerts.isNull())
{
- mOcclusionVerts = new LLVertexBuffer(LLVertexBuffer::MAP_VERTEX, GL_DYNAMIC_DRAW_ARB);
+
+ mOcclusionVerts = new LLVertexBuffer(LLVertexBuffer::MAP_VERTEX,
+ LLVertexBuffer::sUseStreamDraw ? mBufferUsage : 0); //if GL has a hard time with VBOs, don't use them for occlusion culling.
mOcclusionVerts->allocateBuffer(8, 64, true);
LLStrider<U16> idx;
@@ -275,40 +279,47 @@ void LLSpatialGroup::buildOcclusion()
LLStrider<LLVector3> pos;
- mOcclusionVerts->getVertexStrider(pos);
-
- LLVector4a* v = (LLVector4a*) pos.get();
-
- const LLVector4a& c = mBounds[0];
- const LLVector4a& s = r;
-
- static const LLVector4a octant[] =
{
- LLVector4a(-1.f, -1.f, -1.f),
- LLVector4a(-1.f, -1.f, 1.f),
- LLVector4a(-1.f, 1.f, -1.f),
- LLVector4a(-1.f, 1.f, 1.f),
+ LLFastTimer t(FTM_BUILD_OCCLUSION);
+ mOcclusionVerts->getVertexStrider(pos);
+ }
- LLVector4a(1.f, -1.f, -1.f),
- LLVector4a(1.f, -1.f, 1.f),
- LLVector4a(1.f, 1.f, -1.f),
- LLVector4a(1.f, 1.f, 1.f),
- };
+ {
+ LLVector4a* v = (LLVector4a*) pos.get();
- //vertex positions are encoded so the 3 bits of their vertex index
- //correspond to their axis facing, with bit position 3,2,1 matching
- //axis facing x,y,z, bit set meaning positive facing, bit clear
- //meaning negative facing
+ const LLVector4a& c = mBounds[0];
+ const LLVector4a& s = r;
+
+ static const LLVector4a octant[] =
+ {
+ LLVector4a(-1.f, -1.f, -1.f),
+ LLVector4a(-1.f, -1.f, 1.f),
+ LLVector4a(-1.f, 1.f, -1.f),
+ LLVector4a(-1.f, 1.f, 1.f),
+
+ LLVector4a(1.f, -1.f, -1.f),
+ LLVector4a(1.f, -1.f, 1.f),
+ LLVector4a(1.f, 1.f, -1.f),
+ LLVector4a(1.f, 1.f, 1.f),
+ };
+
+ //vertex positions are encoded so the 3 bits of their vertex index
+ //correspond to their axis facing, with bit position 3,2,1 matching
+ //axis facing x,y,z, bit set meaning positive facing, bit clear
+ //meaning negative facing
+
+ for (S32 i = 0; i < 8; ++i)
+ {
+ LLVector4a p;
+ p.setMul(s, octant[i]);
+ p.add(c);
+ v[i] = p;
+ }
+ }
- for (S32 i = 0; i < 8; ++i)
{
- LLVector4a p;
- p.setMul(s, octant[i]);
- p.add(c);
- v[i] = p;
+ mOcclusionVerts->setBuffer(0);
}
-
- mOcclusionVerts->setBuffer(0);
clearState(LLSpatialGroup::OCCLUSION_DIRTY);
}
@@ -1189,7 +1200,7 @@ LLSpatialGroup::LLSpatialGroup(OctreeNode* node, LLSpatialPartition* part) :
mOctreeNode(node),
mSpatialPartition(part),
mVertexBuffer(NULL),
- mBufferUsage(GL_STATIC_DRAW_ARB),
+ mBufferUsage(part->mBufferUsage),
mDistance(0.f),
mDepth(0.f),
mLastUpdateDistance(-1.f),
@@ -1616,6 +1627,10 @@ void LLSpatialGroup::checkOcclusion()
}
}
+static LLFastTimer::DeclareTimer FTM_PUSH_OCCLUSION_VERTS("Push Occlusion");
+static LLFastTimer::DeclareTimer FTM_SET_OCCLUSION_STATE("Occlusion State");
+static LLFastTimer::DeclareTimer FTM_OCCLUSION_EARLY_FAIL("Occlusion Early Fail");
+
void LLSpatialGroup::doOcclusion(LLCamera* camera)
{
if (mSpatialPartition->isOcclusionEnabled() && LLPipeline::sUseOcclusion > 1)
@@ -1623,6 +1638,7 @@ void LLSpatialGroup::doOcclusion(LLCamera* camera)
// Don't cull hole/edge water, unless we have the GL_ARB_depth_clamp extension
if (earlyFail(camera, this))
{
+ LLFastTimer t(FTM_OCCLUSION_EARLY_FAIL);
setOcclusionState(LLSpatialGroup::DISCARD_QUERY);
assert_states_valid(this);
clearOcclusionState(LLSpatialGroup::OCCLUDED, LLSpatialGroup::STATE_MODE_DIFF);
@@ -1664,41 +1680,47 @@ void LLSpatialGroup::doOcclusion(LLCamera* camera)
sPendingQueries.insert(mOcclusionQuery[LLViewerCamera::sCurCameraID]);
#endif
- glBeginQueryARB(mode, mOcclusionQuery[LLViewerCamera::sCurCameraID]);
+ {
+ LLFastTimer t(FTM_PUSH_OCCLUSION_VERTS);
+ glBeginQueryARB(mode, mOcclusionQuery[LLViewerCamera::sCurCameraID]);
- mOcclusionVerts->setBuffer(LLVertexBuffer::MAP_VERTEX);
+ mOcclusionVerts->setBuffer(LLVertexBuffer::MAP_VERTEX);
- if (!use_depth_clamp && mSpatialPartition->mDrawableType == LLDrawPool::POOL_VOIDWATER)
- {
- LLGLSquashToFarClip squash(glh_get_current_projection(), 1);
- if (camera->getOrigin().isExactlyZero())
- { //origin is invalid, draw entire box
- mOcclusionVerts->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, 0);
- mOcclusionVerts->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, b111*8);
- }
- else
+ if (!use_depth_clamp && mSpatialPartition->mDrawableType == LLDrawPool::POOL_VOIDWATER)
{
- mOcclusionVerts->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, get_box_fan_indices(camera, mBounds[0]));
- }
- }
- else
- {
- if (camera->getOrigin().isExactlyZero())
- { //origin is invalid, draw entire box
- mOcclusionVerts->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, 0);
- mOcclusionVerts->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, b111*8);
+ LLGLSquashToFarClip squash(glh_get_current_projection(), 1);
+ if (camera->getOrigin().isExactlyZero())
+ { //origin is invalid, draw entire box
+ mOcclusionVerts->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, 0);
+ mOcclusionVerts->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, b111*8);
+ }
+ else
+ {
+ mOcclusionVerts->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, get_box_fan_indices(camera, mBounds[0]));
+ }
}
else
{
- mOcclusionVerts->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, get_box_fan_indices(camera, mBounds[0]));
+ if (camera->getOrigin().isExactlyZero())
+ { //origin is invalid, draw entire box
+ mOcclusionVerts->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, 0);
+ mOcclusionVerts->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, b111*8);
+ }
+ else
+ {
+ mOcclusionVerts->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, get_box_fan_indices(camera, mBounds[0]));
+ }
}
- }
- glEndQueryARB(mode);
+ glEndQueryARB(mode);
+ }
}
- setOcclusionState(LLSpatialGroup::QUERY_PENDING);
- clearOcclusionState(LLSpatialGroup::DISCARD_QUERY);
+ {
+ LLFastTimer t(FTM_SET_OCCLUSION_STATE);
+ setOcclusionState(LLSpatialGroup::QUERY_PENDING);
+ clearOcclusionState(LLSpatialGroup::DISCARD_QUERY);
+ }
}
}
}
diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h
index 664d957e49..0d9cad914a 100644
--- a/indra/newview/llspatialpartition.h
+++ b/indra/newview/llspatialpartition.h
@@ -148,6 +148,17 @@ public:
};
+ struct CompareMatrixTexturePtr
+ {
+ bool operator()(const LLPointer<LLDrawInfo>& lhs, const LLPointer<LLDrawInfo>& rhs)
+ {
+ return lhs.get() != rhs.get()
+ && (lhs.isNull() || (rhs.notNull() && (lhs->mModelMatrix > rhs->mModelMatrix ||
+ (lhs->mModelMatrix == rhs->mModelMatrix && lhs->mTexture.get() > rhs->mTexture.get()))));
+ }
+
+ };
+
struct CompareBump
{
bool operator()(const LLPointer<LLDrawInfo>& lhs, const LLPointer<LLDrawInfo>& rhs)
@@ -532,6 +543,7 @@ public:
sg_list_t::iterator beginAlphaGroups();
sg_list_t::iterator endAlphaGroups();
+ bool hasOcclusionGroups() { return mOcclusionGroupsSize > 0; }
sg_list_t::iterator beginOcclusionGroups();
sg_list_t::iterator endOcclusionGroups();
diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index 414036c597..46aa44b2bb 100644
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -339,15 +339,6 @@ static bool handleNumpadControlChanged(const LLSD& newvalue)
return true;
}
-static bool handleRenderUseVBOChanged(const LLSD& newvalue)
-{
- if (gPipeline.isInit())
- {
- gPipeline.setUseVBO(newvalue.asBoolean());
- }
- return true;
-}
-
static bool handleWLSkyDetailChanged(const LLSD&)
{
if (gSky.mVOWLSkyp.notNull())
@@ -636,8 +627,9 @@ void settings_setup_listeners()
gSavedSettings.getControl("MuteVoice")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2));
gSavedSettings.getControl("MuteAmbient")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2));
gSavedSettings.getControl("MuteUI")->getSignal()->connect(boost::bind(&handleAudioVolumeChanged, _2));
- gSavedSettings.getControl("RenderVBOEnable")->getSignal()->connect(boost::bind(&handleRenderUseVBOChanged, _2));
+ gSavedSettings.getControl("RenderVBOEnable")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2));
gSavedSettings.getControl("RenderUseStreamVBO")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2));
+ gSavedSettings.getControl("RenderPreferStreamDraw")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2));
gSavedSettings.getControl("WLSkyDetail")->getSignal()->connect(boost::bind(&handleWLSkyDetailChanged, _2));
gSavedSettings.getControl("NumpadControl")->getSignal()->connect(boost::bind(&handleNumpadControlChanged, _2));
gSavedSettings.getControl("JoystickAxis0")->getSignal()->connect(boost::bind(&handleJoystickChanged, _2));
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 97d6a222c5..b45d1aa3a6 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -616,10 +616,10 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
&& gSavedSettings.getBOOL("UseOcclusion")
&& gGLManager.mHasOcclusionQuery) ? 2 : 0;
- if (LLPipeline::sUseOcclusion && LLPipeline::sRenderDeferred)
- { //force occlusion on for all render types if doing deferred render
+ /*if (LLPipeline::sUseOcclusion && LLPipeline::sRenderDeferred)
+ { //force occlusion on for all render types if doing deferred render (tighter shadow frustum)
LLPipeline::sUseOcclusion = 3;
- }
+ }*/
LLPipeline::sAutoMaskAlphaDeferred = gSavedSettings.getBOOL("RenderAutoMaskAlphaDeferred");
LLPipeline::sAutoMaskAlphaNonDeferred = gSavedSettings.getBOOL("RenderAutoMaskAlphaNonDeferred");
diff --git a/indra/newview/llviewerjointmesh.cpp b/indra/newview/llviewerjointmesh.cpp
index 14b9a03fd5..aa6da5c9f3 100644
--- a/indra/newview/llviewerjointmesh.cpp
+++ b/indra/newview/llviewerjointmesh.cpp
@@ -533,7 +533,7 @@ U32 LLViewerJointMesh::drawShape( F32 pixelArea, BOOL first_pass, BOOL is_dummy)
stop_glerror();
- LLGLSSpecular specular(LLColor4(1.f,1.f,1.f,1.f), mShiny && !(mFace->getPool()->getVertexShaderLevel() > 0));
+ LLGLSSpecular specular(LLColor4(1.f,1.f,1.f,1.f), mFace->getPool()->getVertexShaderLevel() > 0 ? 0.f : mShiny);
//----------------------------------------------------------------
// setup current texture
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 439584c7e8..e982df1c92 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -1332,20 +1332,7 @@ const LLVector3 LLVOAvatar::getRenderPosition() const
}
else if (isRoot())
{
- if ( mHasPelvisOffset )
- {
- LLVector3 returnVec( mDrawable->getPositionAgent() );
- //1. Move the pelvis down by the old amount
- returnVec[VZ] -= (mLastPelvisToFoot);
- //2. Now move the pelvis up by the new amount
- returnVec[VZ] += mPelvisToFoot;
- //3. Return the fixed up pelvis position
- return returnVec;
- }
- else
- {
- return mDrawable->getPositionAgent();
- }
+ return mDrawable->getPositionAgent();
}
else
{
@@ -3486,15 +3473,8 @@ BOOL LLVOAvatar::updateCharacter(LLAgent &agent)
// correct for the fact that the pelvis is not necessarily the center
// of the agent's physical representation
- if ( !mHasPelvisOffset )
- {
- root_pos.mdV[VZ] -= (0.5f * mBodySize.mV[VZ]) - mPelvisToFoot;
- }
- else
- {
- root_pos.mdV[VZ] -= (0.65f * mBodySize.mV[VZ]) - mPelvisToFoot;
- }
-
+ root_pos.mdV[VZ] -= (0.5f * mBodySize.mV[VZ]) - mPelvisToFoot;
+
LLVector3 newPosition = gAgent.getPosAgentFromGlobal(root_pos);
if (newPosition != mRoot.getXform()->getWorldPosition())
diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp
index d966bd1614..f762f04d8e 100644
--- a/indra/newview/llvopartgroup.cpp
+++ b/indra/newview/llvopartgroup.cpp
@@ -360,7 +360,7 @@ U32 LLVOPartGroup::getPartitionType() const
}
LLParticlePartition::LLParticlePartition()
-: LLSpatialPartition(LLDrawPoolAlpha::VERTEX_DATA_MASK, TRUE, GL_DYNAMIC_DRAW_ARB)
+: LLSpatialPartition(LLDrawPoolAlpha::VERTEX_DATA_MASK, TRUE, GL_STREAM_DRAW_ARB)
{
mRenderPass = LLRenderPass::PASS_ALPHA;
mDrawableType = LLPipeline::RENDER_TYPE_PARTICLES;
diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp
index 20ca02efda..1b5aed804f 100644
--- a/indra/newview/llvotree.cpp
+++ b/indra/newview/llvotree.cpp
@@ -1330,7 +1330,7 @@ U32 LLVOTree::getPartitionType() const
}
LLTreePartition::LLTreePartition()
-: LLSpatialPartition(0, FALSE, 0)
+: LLSpatialPartition(0, FALSE, GL_DYNAMIC_DRAW_ARB)
{
mDrawableType = LLPipeline::RENDER_TYPE_TREE;
mPartitionType = LLViewerRegion::PARTITION_TREE;
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 1b7cd801da..e3cc2f2589 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -1204,10 +1204,23 @@ BOOL LLVOVolume::calcLOD()
S32 cur_detail = 0;
- F32 radius = getVolume()->mLODScaleBias.scaledVec(getScale()).length();
- F32 distance = mDrawable->mDistanceWRTCamera; //llmin(mDrawable->mDistanceWRTCamera, MAX_LOD_DISTANCE);
- distance *= sDistanceFactor;
+ F32 radius;
+ F32 distance;
+
+ if (mDrawable->isState(LLDrawable::RIGGED))
+ {
+ LLVOAvatar* avatar = getAvatar();
+ distance = avatar->mDrawable->mDistanceWRTCamera;
+ radius = avatar->getBinRadius();
+ }
+ else
+ {
+ distance = mDrawable->mDistanceWRTCamera;
+ radius = getVolume()->mLODScaleBias.scaledVec(getScale()).length();
+ }
+ distance *= sDistanceFactor;
+
F32 rampDist = LLVOVolume::sLODFactor * 2;
if (distance < rampDist)
@@ -3691,6 +3704,10 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep,
else
{
model_mat = &(drawable->getRegion()->mRenderMatrix);
+ if (model_mat->isIdentity())
+ {
+ model_mat = NULL;
+ }
}
U8 bump = (type == LLRenderPass::PASS_BUMP || type == LLRenderPass::PASS_POST_BUMP) ? facep->getTextureEntry()->getBumpmap() : 0;
diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp
index 9f3ec9cadc..77875859e9 100644
--- a/indra/newview/llvowater.cpp
+++ b/indra/newview/llvowater.cpp
@@ -289,7 +289,7 @@ U32 LLVOVoidWater::getPartitionType() const
}
LLWaterPartition::LLWaterPartition()
-: LLSpatialPartition(0, FALSE, 0)
+: LLSpatialPartition(0, FALSE, GL_DYNAMIC_DRAW_ARB)
{
mInfiniteFarClip = TRUE;
mDrawableType = LLPipeline::RENDER_TYPE_WATER;
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 9d7af4aace..a8e36df294 100755
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -383,6 +383,7 @@ void LLPipeline::init()
sRenderBump = gSavedSettings.getBOOL("RenderObjectBump");
sUseTriStrips = gSavedSettings.getBOOL("RenderUseTriStrips");
LLVertexBuffer::sUseStreamDraw = gSavedSettings.getBOOL("RenderUseStreamVBO");
+ LLVertexBuffer::sPreferStreamDraw = gSavedSettings.getBOOL("RenderPreferStreamDraw");
sRenderAttachedLights = gSavedSettings.getBOOL("RenderAttachedLights");
sRenderAttachedParticles = gSavedSettings.getBOOL("RenderAttachedParticles");
@@ -2079,33 +2080,34 @@ void LLPipeline::markOccluder(LLSpatialGroup* group)
void LLPipeline::doOcclusion(LLCamera& camera)
{
- LLVertexBuffer::unbind();
-
- if (hasRenderDebugMask(LLPipeline::RENDER_DEBUG_OCCLUSION))
- {
- gGL.setColorMask(true, false, false, false);
- }
- else
+ if (LLPipeline::sUseOcclusion > 1 && sCull->hasOcclusionGroups())
{
- gGL.setColorMask(false, false);
- }
- LLGLDisable blend(GL_BLEND);
- LLGLDisable test(GL_ALPHA_TEST);
- gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
- LLGLDepthTest depth(GL_TRUE, GL_FALSE);
+ LLVertexBuffer::unbind();
- LLGLDisable cull(GL_CULL_FACE);
- if (LLPipeline::sUseOcclusion > 1)
- {
+ if (hasRenderDebugMask(LLPipeline::RENDER_DEBUG_OCCLUSION))
+ {
+ gGL.setColorMask(true, false, false, false);
+ }
+ else
+ {
+ gGL.setColorMask(false, false);
+ }
+ LLGLDisable blend(GL_BLEND);
+ LLGLDisable test(GL_ALPHA_TEST);
+ gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
+ LLGLDepthTest depth(GL_TRUE, GL_FALSE);
+
+ LLGLDisable cull(GL_CULL_FACE);
+
for (LLCullResult::sg_list_t::iterator iter = sCull->beginOcclusionGroups(); iter != sCull->endOcclusionGroups(); ++iter)
{
LLSpatialGroup* group = *iter;
group->doOcclusion(&camera);
group->clearOcclusionState(LLSpatialGroup::ACTIVE_OCCLUSION);
}
+
+ gGL.setColorMask(true, false);
}
-
- gGL.setColorMask(true, false);
}
BOOL LLPipeline::updateDrawableGeom(LLDrawable* drawablep, BOOL priority)
@@ -2941,21 +2943,6 @@ void LLPipeline::postSort(LLCamera& camera)
//rebuild groups
sCull->assertDrawMapsEmpty();
- /*LLSpatialGroup::sNoDelete = FALSE;
- for (LLCullResult::sg_list_t::iterator i = sCull->beginVisibleGroups(); i != sCull->endVisibleGroups(); ++i)
- {
- LLSpatialGroup* group = *i;
- if (sUseOcclusion &&
- group->isState(LLSpatialGroup::OCCLUDED))
- {
- continue;
- }
-
- group->rebuildGeom();
- }
- LLSpatialGroup::sNoDelete = TRUE;*/
-
-
rebuildPriorityGroups();
llpushcallstacks ;
@@ -4625,16 +4612,19 @@ void LLPipeline::setupAvatarLights(BOOL for_edit)
light_pos.normalize();
+ LLLightState* light = gGL.getLight(1);
+
mHWLightColors[1] = diffuse;
- glLightfv(GL_LIGHT1, GL_DIFFUSE, diffuse.mV);
- glLightfv(GL_LIGHT1, GL_AMBIENT, LLColor4::black.mV);
- glLightfv(GL_LIGHT1, GL_SPECULAR, LLColor4::black.mV);
- glLightfv(GL_LIGHT1, GL_POSITION, light_pos.mV);
- glLightf (GL_LIGHT1, GL_CONSTANT_ATTENUATION, 1.0f);
- glLightf (GL_LIGHT1, GL_LINEAR_ATTENUATION, 0.0f);
- glLightf (GL_LIGHT1, GL_QUADRATIC_ATTENUATION, 0.0f);
- glLightf (GL_LIGHT1, GL_SPOT_EXPONENT, 0.0f);
- glLightf (GL_LIGHT1, GL_SPOT_CUTOFF, 180.0f);
+
+ light->setDiffuse(diffuse);
+ light->setAmbient(LLColor4::black);
+ light->setSpecular(LLColor4::black);
+ light->setPosition(light_pos);
+ light->setConstantAttenuation(1.f);
+ light->setLinearAttenuation(0.f);
+ light->setQuadraticAttenuation(0.f);
+ light->setSpotExponent(0.f);
+ light->setSpotCutoff(180.f);
}
else if (gAvatarBacklight) // Always true (unless overridden in a devs .ini)
{
@@ -4665,22 +4655,28 @@ void LLPipeline::setupAvatarLights(BOOL for_edit)
backlight_diffuse *= backlight_mag / max_component;
mHWLightColors[1] = backlight_diffuse;
- glLightfv(GL_LIGHT1, GL_POSITION, backlight_pos.mV); // this is just sun/moon direction
- glLightfv(GL_LIGHT1, GL_DIFFUSE, backlight_diffuse.mV);
- glLightfv(GL_LIGHT1, GL_AMBIENT, LLColor4::black.mV);
- glLightfv(GL_LIGHT1, GL_SPECULAR, LLColor4::black.mV);
- glLightf (GL_LIGHT1, GL_CONSTANT_ATTENUATION, 1.0f);
- glLightf (GL_LIGHT1, GL_LINEAR_ATTENUATION, 0.0f);
- glLightf (GL_LIGHT1, GL_QUADRATIC_ATTENUATION, 0.0f);
- glLightf (GL_LIGHT1, GL_SPOT_EXPONENT, 0.0f);
- glLightf (GL_LIGHT1, GL_SPOT_CUTOFF, 180.0f);
+
+ LLLightState* light = gGL.getLight(1);
+
+ light->setPosition(backlight_pos);
+ light->setDiffuse(backlight_diffuse);
+ light->setAmbient(LLColor4::black);
+ light->setSpecular(LLColor4::black);
+ light->setConstantAttenuation(1.f);
+ light->setLinearAttenuation(0.f);
+ light->setQuadraticAttenuation(0.f);
+ light->setSpotExponent(0.f);
+ light->setSpotCutoff(180.f);
}
else
{
+ LLLightState* light = gGL.getLight(1);
+
mHWLightColors[1] = LLColor4::black;
- glLightfv(GL_LIGHT1, GL_DIFFUSE, LLColor4::black.mV);
- glLightfv(GL_LIGHT1, GL_AMBIENT, LLColor4::black.mV);
- glLightfv(GL_LIGHT1, GL_SPECULAR, LLColor4::black.mV);
+
+ light->setDiffuse(LLColor4::black);
+ light->setAmbient(LLColor4::black);
+ light->setSpecular(LLColor4::black);
}
}
@@ -4861,15 +4857,17 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
LLVector4 light_pos(mSunDir, 0.0f);
LLColor4 light_diffuse = mSunDiffuse;
mHWLightColors[0] = light_diffuse;
- glLightfv(GL_LIGHT0, GL_POSITION, light_pos.mV); // this is just sun/moon direction
- glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse.mV);
- glLightfv(GL_LIGHT0, GL_AMBIENT, LLColor4::black.mV);
- glLightfv(GL_LIGHT0, GL_SPECULAR, LLColor4::black.mV);
- glLightf (GL_LIGHT0, GL_CONSTANT_ATTENUATION, 1.0f);
- glLightf (GL_LIGHT0, GL_LINEAR_ATTENUATION, 0.0f);
- glLightf (GL_LIGHT0, GL_QUADRATIC_ATTENUATION, 0.0f);
- glLightf (GL_LIGHT0, GL_SPOT_EXPONENT, 0.0f);
- glLightf (GL_LIGHT0, GL_SPOT_CUTOFF, 180.0f);
+
+ LLLightState* light = gGL.getLight(0);
+ light->setPosition(light_pos);
+ light->setDiffuse(light_diffuse);
+ light->setAmbient(LLColor4::black);
+ light->setSpecular(LLColor4::black);
+ light->setConstantAttenuation(1.f);
+ light->setLinearAttenuation(0.f);
+ light->setQuadraticAttenuation(0.f);
+ light->setSpotExponent(0.f);
+ light->setSpotCutoff(180.f);
}
// Light 1 = Backlight (for avatars)
@@ -4927,13 +4925,15 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
float linatten = x / (light_radius); // % of brightness at radius
mHWLightColors[cur_light] = light_color;
- S32 gllight = GL_LIGHT0+cur_light;
- glLightfv(gllight, GL_POSITION, light_pos_gl.mV);
- glLightfv(gllight, GL_DIFFUSE, light_color.mV);
- glLightfv(gllight, GL_AMBIENT, LLColor4::black.mV);
- glLightf (gllight, GL_CONSTANT_ATTENUATION, 0.0f);
- glLightf (gllight, GL_LINEAR_ATTENUATION, linatten);
- glLightf (gllight, GL_QUADRATIC_ATTENUATION, 0.0f);
+ LLLightState* light_state = gGL.getLight(cur_light);
+
+ light_state->setPosition(light_pos_gl);
+ light_state->setDiffuse(light_color);
+ light_state->setAmbient(LLColor4::black);
+ light_state->setConstantAttenuation(0.f);
+ light_state->setLinearAttenuation(linatten);
+ light_state->setQuadraticAttenuation(0.f);
+
if (light->isLightSpotlight() // directional (spot-)light
&& (LLPipeline::sRenderDeferred || gSavedSettings.getBOOL("RenderSpotLightsInNondeferred"))) // these are only rendered as GL spotlights if we're in deferred rendering mode *or* the setting forces them on
{
@@ -4941,22 +4941,21 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
LLQuaternion quat = light->getRenderRotation();
LLVector3 at_axis(0,0,-1); // this matches deferred rendering's object light direction
at_axis *= quat;
- //llinfos << "SPOT!!!!!!! fov: " << spotparams.mV[0] << " focus: " << spotparams.mV[1] << " dir: " << at_axis << llendl;
- glLightfv(gllight, GL_SPOT_DIRECTION, at_axis.mV);
- glLightf (gllight, GL_SPOT_EXPONENT, 2.0f); // 2.0 = good old dot product ^ 2
- glLightf (gllight, GL_SPOT_CUTOFF, 90.0f); // hemisphere
- const float specular[] = {0.f, 0.f, 0.f, 0.f};
- glLightfv(gllight, GL_SPECULAR, specular);
+
+ light_state->setSpotDirection(at_axis);
+ light_state->setSpotCutoff(90.f);
+ light_state->setSpotExponent(2.f);
+
+ light_state->setSpecular(LLColor4::black);
}
else // omnidirectional (point) light
{
- glLightf (gllight, GL_SPOT_EXPONENT, 0.0f);
- glLightf (gllight, GL_SPOT_CUTOFF, 180.0f);
-
+ light_state->setSpotExponent(0.f);
+ light_state->setSpotCutoff(180.f);
+
// we use specular.w = 1.0 as a cheap hack for the shaders to know that this is omnidirectional rather than a spotlight
- const float specular[] = {0.f, 0.f, 0.f, 1.f};
- glLightfv(gllight, GL_SPECULAR, specular);
- //llinfos << "boring light" << llendl;
+ const LLColor4 specular(0.f, 0.f, 0.f, 1.f);
+ light_state->setSpecular(specular);
}
cur_light++;
if (cur_light >= 8)
@@ -4968,10 +4967,11 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
for ( ; cur_light < 8 ; cur_light++)
{
mHWLightColors[cur_light] = LLColor4::black;
- S32 gllight = GL_LIGHT0+cur_light;
- glLightfv(gllight, GL_DIFFUSE, LLColor4::black.mV);
- glLightfv(gllight, GL_AMBIENT, LLColor4::black.mV);
- glLightfv(gllight, GL_SPECULAR, LLColor4::black.mV);
+ LLLightState* light = gGL.getLight(cur_light);
+
+ light->setDiffuse(LLColor4::black);
+ light->setAmbient(LLColor4::black);
+ light->setSpecular(LLColor4::black);
}
if (gAgentAvatarp &&
gAgentAvatarp->mSpecialRenderMode == 3)
@@ -4988,23 +4988,24 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
float linatten = x / (light_radius); // % of brightness at radius
mHWLightColors[2] = light_color;
- S32 gllight = GL_LIGHT2;
- glLightfv(gllight, GL_POSITION, light_pos_gl.mV);
- glLightfv(gllight, GL_DIFFUSE, light_color.mV);
- glLightfv(gllight, GL_AMBIENT, LLColor4::black.mV);
- glLightfv(gllight, GL_SPECULAR, LLColor4::black.mV);
- glLightf (gllight, GL_CONSTANT_ATTENUATION, 0.0f);
- glLightf (gllight, GL_LINEAR_ATTENUATION, linatten);
- glLightf (gllight, GL_QUADRATIC_ATTENUATION, 0.0f);
- glLightf (gllight, GL_SPOT_EXPONENT, 0.0f);
- glLightf (gllight, GL_SPOT_CUTOFF, 180.0f);
+ LLLightState* light = gGL.getLight(2);
+
+ light->setPosition(light_pos_gl);
+ light->setDiffuse(light_color);
+ light->setAmbient(LLColor4::black);
+ light->setSpecular(LLColor4::black);
+ light->setQuadraticAttenuation(0.f);
+ light->setConstantAttenuation(0.f);
+ light->setLinearAttenuation(linatten);
+ light->setSpotExponent(0.f);
+ light->setSpotCutoff(180.f);
}
// Init GL state
glDisable(GL_LIGHTING);
- for (S32 gllight=GL_LIGHT0; gllight<=GL_LIGHT7; gllight++)
+ for (S32 i = 0; i < 8; ++i)
{
- glDisable(gllight);
+ gGL.getLight(i)->disable();
}
mLightMask = 0;
}
@@ -5029,15 +5030,16 @@ void LLPipeline::enableLights(U32 mask)
stop_glerror();
for (S32 i=0; i<8; i++)
{
+ LLLightState* light = gGL.getLight(i);
if (mask & (1<<i))
{
- glEnable(GL_LIGHT0 + i);
- glLightfv(GL_LIGHT0 + i, GL_DIFFUSE, mHWLightColors[i].mV);
+ light->enable();
+ light->setDiffuse(mHWLightColors[i]);
}
else
{
- glDisable(GL_LIGHT0 + i);
- glLightfv(GL_LIGHT0 + i, GL_DIFFUSE, LLColor4::black.mV);
+ light->disable();
+ light->setDiffuse(LLColor4::black);
}
}
stop_glerror();
@@ -5061,7 +5063,6 @@ void LLPipeline::enableLightsStatic()
if (mLightingDetail >= 2)
{
mask |= mLightMovingMask; // Hardware moving lights
- glColor4f(0.f, 0.f, 0.f, 1.0f); // no local lighting by default
}
else
{
@@ -5075,11 +5076,7 @@ void LLPipeline::enableLightsDynamic()
assertInitialized();
U32 mask = 0xff & (~2); // Local lights
enableLights(mask);
- if (mLightingDetail >= 2)
- {
- glColor4f(0.f, 0.f, 0.f, 1.f); // no local lighting by default
- }
-
+
if (isAgentAvatarValid() && getLightingDetail() <= 0)
{
if (gAgentAvatarp->mSpecialRenderMode == 0) // normal
@@ -5125,33 +5122,37 @@ void LLPipeline::enableLightsPreview()
dir2.normVec();
LLVector4 light_pos(dir0, 0.0f);
- glEnable(GL_LIGHT0);
- glLightfv(GL_LIGHT0, GL_POSITION, light_pos.mV);
- glLightfv(GL_LIGHT0, GL_DIFFUSE, diffuse0.mV);
- glLightfv(GL_LIGHT0, GL_AMBIENT, LLColor4::black.mV);
- glLightfv(GL_LIGHT0, GL_SPECULAR, specular0.mV);
- glLightf (GL_LIGHT0, GL_SPOT_EXPONENT, 0.0f);
- glLightf (GL_LIGHT0, GL_SPOT_CUTOFF, 180.0f);
- light_pos = LLVector4(dir1, 0.f);
- glEnable(GL_LIGHT1);
- glLightfv(GL_LIGHT1, GL_POSITION, light_pos.mV);
- glLightfv(GL_LIGHT1, GL_DIFFUSE, diffuse1.mV);
- glLightfv(GL_LIGHT1, GL_AMBIENT, LLColor4::black.mV);
- glLightfv(GL_LIGHT1, GL_SPECULAR, specular1.mV);
- glLightf (GL_LIGHT1, GL_SPOT_EXPONENT, 0.0f);
- glLightf (GL_LIGHT1, GL_SPOT_CUTOFF, 180.0f);
+ LLLightState* light = gGL.getLight(0);
- light_pos = LLVector4(dir2, 0.f);
- glEnable(GL_LIGHT2);
- glLightfv(GL_LIGHT2, GL_POSITION, light_pos.mV);
- glLightfv(GL_LIGHT2, GL_DIFFUSE, diffuse2.mV);
- glLightfv(GL_LIGHT2, GL_AMBIENT, LLColor4::black.mV);
- glLightfv(GL_LIGHT2, GL_SPECULAR, specular2.mV);
- glLightf (GL_LIGHT2, GL_SPOT_EXPONENT, 0.0f);
- glLightf (GL_LIGHT2, GL_SPOT_CUTOFF, 180.0f);
+ light->enable();
+ light->setPosition(light_pos);
+ light->setDiffuse(diffuse0);
+ light->setAmbient(LLColor4::black);
+ light->setSpecular(specular0);
+ light->setSpotExponent(0.f);
+ light->setSpotCutoff(180.f);
+ light_pos = LLVector4(dir1, 0.f);
+ light = gGL.getLight(1);
+ light->enable();
+ light->setPosition(light_pos);
+ light->setDiffuse(diffuse1);
+ light->setAmbient(LLColor4::black);
+ light->setSpecular(specular1);
+ light->setSpotExponent(0.f);
+ light->setSpotCutoff(180.f);
+
+ light_pos = LLVector4(dir2, 0.f);
+ light = gGL.getLight(2);
+ light->enable();
+ light->setPosition(light_pos);
+ light->setDiffuse(diffuse2);
+ light->setAmbient(LLColor4::black);
+ light->setSpecular(specular2);
+ light->setSpotExponent(0.f);
+ light->setSpotCutoff(180.f);
}
@@ -5171,16 +5172,11 @@ void LLPipeline::enableLightsFullbright(const LLColor4& color)
enableLights(mask);
glLightModelfv(GL_LIGHT_MODEL_AMBIENT,color.mV);
- /*if (mLightingDetail >= 2)
- {
- glColor4f(0.f, 0.f, 0.f, 1.f); // no local lighting by default
- }*/
}
void LLPipeline::disableLights()
{
enableLights(0); // no lighting (full bright)
- glColor4f(1.f, 1.f, 1.f, 1.f); // lighting color = white by default
}
//============================================================================
@@ -5800,6 +5796,8 @@ void LLPipeline::resetVertexBuffers()
sRenderBump = gSavedSettings.getBOOL("RenderObjectBump");
sUseTriStrips = gSavedSettings.getBOOL("RenderUseTriStrips");
LLVertexBuffer::sUseStreamDraw = gSavedSettings.getBOOL("RenderUseStreamVBO");
+ LLVertexBuffer::sPreferStreamDraw = gSavedSettings.getBOOL("RenderPreferStreamDraw");
+ LLVertexBuffer::sEnableVBOs = gSavedSettings.getBOOL("RenderVBOEnable");
sBakeSunlight = gSavedSettings.getBOOL("RenderBakeSunlight");
sNoAlpha = gSavedSettings.getBOOL("RenderNoAlpha");
@@ -5858,24 +5856,6 @@ void LLPipeline::renderObjects(U32 type, U32 mask, BOOL texture)
gGLLastMatrix = NULL;
}
-void LLPipeline::setUseVBO(BOOL use_vbo)
-{
- if (use_vbo != LLVertexBuffer::sEnableVBOs)
- {
- if (use_vbo)
- {
- llinfos << "Enabling VBO." << llendl;
- }
- else
- {
- llinfos << "Disabling VBO." << llendl;
- }
-
- resetVertexBuffers();
- LLVertexBuffer::initClass(use_vbo);
- }
-}
-
void apply_cube_face_rotation(U32 face)
{
switch (face)
@@ -5969,8 +5949,6 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield)
tc2 /= (F32) res_mod;
}
- gGL.setColorMask(true, true);
-
LLFastTimer ftm(FTM_RENDER_BLOOM);
gGL.color4f(1,1,1,1);
LLGLDepthTest depth(GL_FALSE);
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index 0eb020605e..32ac93388d 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -119,7 +119,6 @@ public:
void allocatePhysicsBuffer();
void resetVertexBuffers(LLDrawable* drawable);
- void setUseVBO(BOOL use_vbo);
void generateImpostor(LLVOAvatar* avatar);
void bindScreenToTexture();
void renderBloom(BOOL for_snapshot, F32 zoom_factor = 1.f, int subfield = 0);
diff --git a/indra/newview/skins/default/xui/en/floater_region_debug_console.xml b/indra/newview/skins/default/xui/en/floater_region_debug_console.xml
index cf95257b0a..7c7ee2df4c 100644
--- a/indra/newview/skins/default/xui/en/floater_region_debug_console.xml
+++ b/indra/newview/skins/default/xui/en/floater_region_debug_console.xml
@@ -2,6 +2,7 @@
<floater
name="region_debug_console"
title="Region Debug"
+ can_resize="true"
layout="topleft"
min_height="300"
min_width="300"
@@ -12,7 +13,7 @@
left="10"
type="string"
length="1"
- follows="left|top|right|bottom"
+ follows="left|right|bottom"
font="Monospace"
height="366"
width="576"
diff --git a/indra/newview/tests/test_llxmlrpc_peer.py b/indra/newview/tests/test_llxmlrpc_peer.py
index aeebb0cfd1..1c7204a6b6 100644
--- a/indra/newview/tests/test_llxmlrpc_peer.py
+++ b/indra/newview/tests/test_llxmlrpc_peer.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
"""\
@file test_llxmlrpc_peer.py
@author Nat Goodspeed
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index adf7e4af9b..1653a01b4a 100644
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -1,29 +1,31 @@
-#!/usr/bin/python
-# @file viewer_manifest.py
-# @author Ryan Williams
-# @brief Description of all installer viewer files, and methods for packaging
-# them into installers for all supported platforms.
-#
-# $LicenseInfo:firstyear=2006&license=viewerlgpl$
-# Second Life Viewer Source Code
-# Copyright (C) 2010, Linden Research, Inc.
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Lesser General Public
-# License as published by the Free Software Foundation;
-# version 2.1 of the License only.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public
-# License along with this library; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-#
-# Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
-# $/LicenseInfo$
+#!/usr/bin/env python
+"""\
+@file viewer_manifest.py
+@author Ryan Williams
+@brief Description of all installer viewer files, and methods for packaging
+ them into installers for all supported platforms.
+
+$LicenseInfo:firstyear=2006&license=viewerlgpl$
+Second Life Viewer Source Code
+Copyright (C) 2006-2011, Linden Research, Inc.
+
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation;
+version 2.1 of the License only.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+$/LicenseInfo$
+"""
import sys
import os.path
import re