summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/cmake/run_build_test.py2
-rw-r--r--indra/copy_win_scripts/start-client.py24
-rwxr-xr-xindra/develop.py51
-rwxr-xr-xindra/lib/python/indra/util/llperformance.py26
-rw-r--r--indra/lib/python/indra/util/llversion.py57
-rwxr-xr-xindra/lib/python/indra/util/simperf_proc_interface.py2
-rw-r--r--indra/lib/python/indra/util/test_win32_manifest.py49
-rw-r--r--indra/llmath/m4math.h25
-rw-r--r--indra/llmessage/tests/test_llsdmessage_peer.py2
-rw-r--r--indra/llmessage/tests/testrunner.py2
-rw-r--r--indra/llrender/llglstates.h32
-rw-r--r--indra/llrender/llrender.cpp188
-rw-r--r--indra/llrender/llrender.h39
-rw-r--r--indra/llrender/llvertexbuffer.cpp2
-rw-r--r--indra/newview/generate_breakpad_symbols.py52
-rw-r--r--indra/newview/lldrawpoolavatar.cpp10
-rw-r--r--indra/newview/lldrawpoolwlsky.cpp2
-rw-r--r--indra/newview/llspatialpartition.h12
-rw-r--r--indra/newview/llviewerdisplay.cpp6
-rw-r--r--indra/newview/llviewerjointmesh.cpp2
-rw-r--r--indra/newview/llvoavatar.cpp38
-rw-r--r--indra/newview/llvovolume.cpp4
-rwxr-xr-xindra/newview/pipeline.cpp269
-rw-r--r--indra/newview/tests/test_llxmlrpc_peer.py2
-rw-r--r--indra/newview/viewer_manifest.py54
-rw-r--r--indra/test/test_llmanifest.py2
26 files changed, 588 insertions, 366 deletions
diff --git a/indra/cmake/run_build_test.py b/indra/cmake/run_build_test.py
index 37aa75e364..320a9be8ab 100644
--- a/indra/cmake/run_build_test.py
+++ b/indra/cmake/run_build_test.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
"""\
@file run_build_test.py
@author Nat Goodspeed
diff --git a/indra/copy_win_scripts/start-client.py b/indra/copy_win_scripts/start-client.py
index 5f7ff2f293..5699f5273f 100644
--- a/indra/copy_win_scripts/start-client.py
+++ b/indra/copy_win_scripts/start-client.py
@@ -1,4 +1,28 @@
#!/usr/bin/env python
+"""\
+@file start-client.py
+
+$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 sys, getopt
import os
import llstart
diff --git a/indra/develop.py b/indra/develop.py
index 36c947327a..d9a66352f3 100755
--- a/indra/develop.py
+++ b/indra/develop.py
@@ -1,29 +1,30 @@
#!/usr/bin/env python
-#
-# @file develop.py
-# @authors Bryan O'Sullivan, Mark Palange, Aaron Brashears
-# @brief Fire and forget script to appropriately configure cmake for SL.
-#
-# $LicenseInfo:firstyear=2007&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 develop.py
+@authors Bryan O'Sullivan, Mark Palange, Aaron Brashears
+@brief Fire and forget script to appropriately configure cmake for SL.
+
+$LicenseInfo:firstyear=2007&license=viewerlgpl$
+Second Life Viewer Source Code
+Copyright (C) 2007-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 errno
diff --git a/indra/lib/python/indra/util/llperformance.py b/indra/lib/python/indra/util/llperformance.py
index 7c52730b5e..57dd64de3f 100755
--- a/indra/lib/python/indra/util/llperformance.py
+++ b/indra/lib/python/indra/util/llperformance.py
@@ -1,4 +1,28 @@
-#!/usr/bin/python
+#!/usr/bin/env python
+"""\
+@file llperformance.py
+
+$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$
+"""
# ------------------------------------------------
# Sim metrics utility functions.
diff --git a/indra/lib/python/indra/util/llversion.py b/indra/lib/python/indra/util/llversion.py
index 2718a85f41..ba6f567b60 100644
--- a/indra/lib/python/indra/util/llversion.py
+++ b/indra/lib/python/indra/util/llversion.py
@@ -1,7 +1,9 @@
-"""@file llversion.py
-@brief Utility for parsing llcommon/llversion${server}.h
- for the version string and channel string
- Utility that parses hg or svn info for branch and revision
+#!/usr/bin/env python
+"""\
+@file llversion.py
+@brief Parses llcommon/llversionserver.h and llcommon/llversionviewer.h
+ for the version string and channel string.
+ Parses hg info for branch and revision.
$LicenseInfo:firstyear=2006&license=mit$
@@ -27,7 +29,7 @@ THE SOFTWARE.
$/LicenseInfo$
"""
-import re, sys, os, commands
+import re, sys, os, subprocess
# Methods for gathering version information from
# llversionviewer.h and llversionserver.h
@@ -73,29 +75,13 @@ def get_viewer_channel():
def get_server_channel():
return get_channel('server')
-# Methods for gathering subversion information
-def get_svn_status_matching(regular_expression):
- # Get the subversion info from the working source tree
- status, output = commands.getstatusoutput('svn info %s' % get_src_root())
- m = regular_expression.search(output)
- if not m:
- print >> sys.stderr, "Failed to parse svn info output, result follows:"
- print >> sys.stderr, output
- raise Exception, "No matching svn status in "+src_root
- return m.group(1)
-
-def get_svn_branch():
- branch_re = re.compile('URL: (\S+)')
- return get_svn_status_matching(branch_re)
-
-def get_svn_revision():
- last_rev_re = re.compile('Last Changed Rev: (\d+)')
- return get_svn_status_matching(last_rev_re)
-
+# Methods for gathering hg information
def get_hg_repo():
- status, output = commands.getstatusoutput('hg showconfig paths.default')
+ child = subprocess.Popen(["hg","showconfig","paths.default"], stdout=subprocess.PIPE)
+ output, error = child.communicate()
+ status = child.returncode
if status:
- print >> sys.stderr, output
+ print >> sys.stderr, error
sys.exit(1)
if not output:
print >> sys.stderr, 'ERROR: cannot find repo we cloned from'
@@ -103,24 +89,19 @@ def get_hg_repo():
return output
def get_hg_changeset():
- # The right thing to do:
- # status, output = commands.getstatusoutput('hg id -i')
- # if status:
- # print >> sys.stderr, output
- # sys.exit(1)
-
- # The temporary hack:
- status, output = commands.getstatusoutput('hg parents --template "{rev}"')
+ # The right thing to do would be to use the *global* revision id:
+ # "hg id -i"
+ # For the moment though, we use the parent revision:
+ child = subprocess.Popen(["hg","parents","--template","{rev}"], stdout=subprocess.PIPE)
+ output, error = child.communicate()
+ status = child.returncode
if status:
- print >> sys.stderr, output
+ print >> sys.stderr, error
sys.exit(1)
lines = output.splitlines()
if len(lines) > 1:
print >> sys.stderr, 'ERROR: working directory has %d parents' % len(lines)
return lines[0]
-def using_svn():
- return os.path.isdir(os.path.join(get_src_root(), '.svn'))
-
def using_hg():
return os.path.isdir(os.path.join(get_src_root(), '.hg'))
diff --git a/indra/lib/python/indra/util/simperf_proc_interface.py b/indra/lib/python/indra/util/simperf_proc_interface.py
index da6304a274..de061f68cc 100755
--- a/indra/lib/python/indra/util/simperf_proc_interface.py
+++ b/indra/lib/python/indra/util/simperf_proc_interface.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
"""\
@file simperf_proc_interface.py
@brief Utility to extract log messages from *.<pid>.llsd files containing performance statistics.
diff --git a/indra/lib/python/indra/util/test_win32_manifest.py b/indra/lib/python/indra/util/test_win32_manifest.py
index da8ee6c545..0532cb0065 100644
--- a/indra/lib/python/indra/util/test_win32_manifest.py
+++ b/indra/lib/python/indra/util/test_win32_manifest.py
@@ -1,28 +1,29 @@
#!/usr/bin/env python
-# @file test_win32_manifest.py
-# @brief Test an assembly binding version and uniqueness in a windows dll or exe.
-#
-# $LicenseInfo:firstyear=2009&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 test_win32_manifest.py
+@brief Test an assembly binding version and uniqueness in a windows dll or exe.
+
+$LicenseInfo:firstyear=2009&license=viewerlgpl$
+Second Life Viewer Source Code
+Copyright (C) 2009-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, os
import tempfile
from xml.dom.minidom import parse
diff --git a/indra/llmath/m4math.h b/indra/llmath/m4math.h
index 10c88464e5..3588f36758 100644
--- a/indra/llmath/m4math.h
+++ b/indra/llmath/m4math.h
@@ -132,6 +132,7 @@ public:
// various useful matrix functions
const LLMatrix4& setIdentity(); // Load identity matrix
+ bool isIdentity() const;
const LLMatrix4& setZero(); // Clears matrix to all zeros.
const LLMatrix4& initRotation(const F32 angle, const F32 x, const F32 y, const F32 z); // Calculate rotation matrix by rotating angle radians about (x, y, z)
@@ -262,6 +263,30 @@ inline const LLMatrix4& LLMatrix4::setIdentity()
return (*this);
}
+inline bool LLMatrix4::isIdentity() const
+{
+ return
+ mMatrix[0][0] == 1.f &&
+ mMatrix[0][1] == 0.f &&
+ mMatrix[0][2] == 0.f &&
+ mMatrix[0][3] == 0.f &&
+
+ mMatrix[1][0] == 0.f &&
+ mMatrix[1][1] == 1.f &&
+ mMatrix[1][2] == 0.f &&
+ mMatrix[1][3] == 0.f &&
+
+ mMatrix[2][0] == 0.f &&
+ mMatrix[2][1] == 0.f &&
+ mMatrix[2][2] == 1.f &&
+ mMatrix[2][3] == 0.f &&
+
+ mMatrix[3][0] == 0.f &&
+ mMatrix[3][1] == 0.f &&
+ mMatrix[3][2] == 0.f &&
+ mMatrix[3][3] == 1.f;
+}
+
/*
inline LLMatrix4 operator*(const LLMatrix4 &a, const LLMatrix4 &b)
diff --git a/indra/llmessage/tests/test_llsdmessage_peer.py b/indra/llmessage/tests/test_llsdmessage_peer.py
index 7eb198bb34..580ee7f8b4 100644
--- a/indra/llmessage/tests/test_llsdmessage_peer.py
+++ b/indra/llmessage/tests/test_llsdmessage_peer.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
"""\
@file test_llsdmessage_peer.py
@author Nat Goodspeed
diff --git a/indra/llmessage/tests/testrunner.py b/indra/llmessage/tests/testrunner.py
index 4d58ef7130..b70ce91ee7 100644
--- a/indra/llmessage/tests/testrunner.py
+++ b/indra/llmessage/tests/testrunner.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
"""\
@file testrunner.py
@author Nat Goodspeed
diff --git a/indra/llrender/llglstates.h b/indra/llrender/llglstates.h
index d5a29dcd0c..e26aead676 100644
--- a/indra/llrender/llglstates.h
+++ b/indra/llrender/llglstates.h
@@ -238,9 +238,11 @@ public:
class LLGLSSpecular
{
public:
+ F32 mShininess;
LLGLSSpecular(const LLColor4& color, F32 shininess)
{
- if (shininess > 0.0f)
+ mShininess = shininess;
+ if (mShininess > 0.0f)
{
glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, color.mV);
S32 shiny = (S32)(shininess*128.f);
@@ -250,32 +252,14 @@ public:
}
~LLGLSSpecular()
{
- glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, LLColor4(0.f,0.f,0.f,0.f).mV);
- glMateriali(GL_FRONT_AND_BACK, GL_SHININESS, 0);
+ if (mShininess > 0.f)
+ {
+ glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, LLColor4(0.f,0.f,0.f,0.f).mV);
+ glMateriali(GL_FRONT_AND_BACK, GL_SHININESS, 0);
+ }
}
};
//----------------------------------------------------------------------------
-
-class LLGLSBlendFunc : public LLGLSPipeline {
-protected:
- GLint mSavedSrc, mSavedDst;
- LLGLEnable mBlend;
-
-public:
- LLGLSBlendFunc(GLenum srcFunc, GLenum dstFunc) :
- mBlend(GL_BLEND)
- {
- glGetIntegerv(GL_BLEND_SRC, &mSavedSrc);
- glGetIntegerv(GL_BLEND_DST, &mSavedDst);
- glBlendFunc(srcFunc, dstFunc);
- }
-
- ~LLGLSBlendFunc(void) {
- glBlendFunc(mSavedSrc, mSavedDst);
- }
-};
-
-
#endif
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index fb2d0bc7a7..49e10c4790 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -47,6 +47,7 @@ U32 LLRender::sUICalls = 0;
U32 LLRender::sUIVerts = 0;
static const U32 LL_NUM_TEXTURE_LAYERS = 16;
+static const U32 LL_NUM_LIGHT_UNITS = 8;
static GLenum sGLTextureType[] =
{
@@ -747,6 +748,130 @@ void LLTexUnit::debugTextureUnit(void)
}
}
+LLLightState::LLLightState(S32 index)
+: mIndex(index),
+ mEnabled(false),
+ mConstantAtten(1.f),
+ mLinearAtten(0.f),
+ mQuadraticAtten(0.f),
+ mSpotExponent(0.f),
+ mSpotCutoff(180.f)
+{
+ if (mIndex == 0)
+ {
+ mDiffuse.set(1,1,1,1);
+ mSpecular.set(1,1,1,1);
+ }
+
+ mAmbient.set(0,0,0,1);
+ mPosition.set(0,0,1,0);
+ mSpotDirection.set(0,0,-1);
+
+}
+
+void LLLightState::enable()
+{
+ if (!mEnabled)
+ {
+ glEnable(GL_LIGHT0+mIndex);
+ mEnabled = true;
+ }
+}
+
+void LLLightState::disable()
+{
+ if (mEnabled)
+ {
+ glDisable(GL_LIGHT0+mIndex);
+ mEnabled = false;
+ }
+}
+
+void LLLightState::setDiffuse(const LLColor4& diffuse)
+{
+ if (mDiffuse != diffuse)
+ {
+ mDiffuse = diffuse;
+ glLightfv(GL_LIGHT0+mIndex, GL_DIFFUSE, mDiffuse.mV);
+ }
+}
+
+void LLLightState::setAmbient(const LLColor4& ambient)
+{
+ if (mAmbient != ambient)
+ {
+ mAmbient = ambient;
+ glLightfv(GL_LIGHT0+mIndex, GL_AMBIENT, mAmbient.mV);
+ }
+}
+
+void LLLightState::setSpecular(const LLColor4& specular)
+{
+ if (mSpecular != specular)
+ {
+ mSpecular = specular;
+ glLightfv(GL_LIGHT0+mIndex, GL_SPECULAR, mSpecular.mV);
+ }
+}
+
+void LLLightState::setPosition(const LLVector4& position)
+{
+ //always set position because modelview matrix may have changed
+ mPosition = position;
+ glLightfv(GL_LIGHT0+mIndex, GL_POSITION, mPosition.mV);
+}
+
+void LLLightState::setConstantAttenuation(const F32& atten)
+{
+ if (mConstantAtten != atten)
+ {
+ mConstantAtten = atten;
+ glLightf(GL_LIGHT0+mIndex, GL_CONSTANT_ATTENUATION, atten);
+ }
+}
+
+void LLLightState::setLinearAttenuation(const F32& atten)
+{
+ if (mLinearAtten != atten)
+ {
+ mLinearAtten = atten;
+ glLightf(GL_LIGHT0+mIndex, GL_LINEAR_ATTENUATION, atten);
+ }
+}
+
+void LLLightState::setQuadraticAttenuation(const F32& atten)
+{
+ if (mQuadraticAtten != atten)
+ {
+ mQuadraticAtten = atten;
+ glLightf(GL_LIGHT0+mIndex, GL_QUADRATIC_ATTENUATION, atten);
+ }
+}
+
+void LLLightState::setSpotExponent(const F32& exponent)
+{
+ if (mSpotExponent != exponent)
+ {
+ mSpotExponent = exponent;
+ glLightf(GL_LIGHT0+mIndex, GL_SPOT_EXPONENT, exponent);
+ }
+}
+
+void LLLightState::setSpotCutoff(const F32& cutoff)
+{
+ if (mSpotCutoff != cutoff)
+ {
+ mSpotCutoff = cutoff;
+ glLightf(GL_LIGHT0+mIndex, GL_SPOT_CUTOFF, cutoff);
+ }
+}
+
+void LLLightState::setSpotDirection(const LLVector3& direction)
+{
+ //always set direction because modelview matrix may have changed
+ mSpotDirection = direction;
+ glLightfv(GL_LIGHT0+mIndex, GL_SPOT_DIRECTION, direction.mV);
+}
LLRender::LLRender()
: mDirty(false),
@@ -768,6 +893,11 @@ LLRender::LLRender()
}
mDummyTexUnit = new LLTexUnit(-1);
+ for (U32 i = 0; i < LL_NUM_LIGHT_UNITS; ++i)
+ {
+ mLightState.push_back(new LLLightState(i));
+ }
+
for (U32 i = 0; i < 4; i++)
{
mCurrColorMask[i] = true;
@@ -795,6 +925,12 @@ void LLRender::shutdown()
mTexUnits.clear();
delete mDummyTexUnit;
mDummyTexUnit = NULL;
+
+ for (U32 i = 0; i < mLightState.size(); ++i)
+ {
+ delete mLightState[i];
+ }
+ mLightState.clear();
}
void LLRender::refreshState(void)
@@ -932,15 +1068,21 @@ void LLRender::setColorMask(bool writeColorR, bool writeColorG, bool writeColorB
{
flush();
- mCurrColorMask[0] = writeColorR;
- mCurrColorMask[1] = writeColorG;
- mCurrColorMask[2] = writeColorB;
- mCurrColorMask[3] = writeAlpha;
+ if (mCurrColorMask[0] != writeColorR ||
+ mCurrColorMask[1] != writeColorG ||
+ mCurrColorMask[2] != writeColorB ||
+ mCurrColorMask[3] != writeAlpha)
+ {
+ mCurrColorMask[0] = writeColorR;
+ mCurrColorMask[1] = writeColorG;
+ mCurrColorMask[2] = writeColorB;
+ mCurrColorMask[3] = writeAlpha;
- glColorMask(writeColorR ? GL_TRUE : GL_FALSE,
- writeColorG ? GL_TRUE : GL_FALSE,
- writeColorB ? GL_TRUE : GL_FALSE,
- writeAlpha ? GL_TRUE : GL_FALSE);
+ glColorMask(writeColorR ? GL_TRUE : GL_FALSE,
+ writeColorG ? GL_TRUE : GL_FALSE,
+ writeColorB ? GL_TRUE : GL_FALSE,
+ writeAlpha ? GL_TRUE : GL_FALSE);
+ }
}
void LLRender::setSceneBlendType(eBlendType type)
@@ -978,15 +1120,19 @@ void LLRender::setAlphaRejectSettings(eCompareFunc func, F32 value)
{
flush();
- mCurrAlphaFunc = func;
- mCurrAlphaFuncVal = value;
- if (func == CF_DEFAULT)
- {
- glAlphaFunc(GL_GREATER, 0.01f);
- }
- else
+ if (mCurrAlphaFunc != func ||
+ mCurrAlphaFuncVal != value)
{
- glAlphaFunc(sGLCompareFunc[func], value);
+ mCurrAlphaFunc = func;
+ mCurrAlphaFuncVal = value;
+ if (func == CF_DEFAULT)
+ {
+ glAlphaFunc(GL_GREATER, 0.01f);
+ }
+ else
+ {
+ glAlphaFunc(sGLCompareFunc[func], value);
+ }
}
}
@@ -1045,6 +1191,16 @@ LLTexUnit* LLRender::getTexUnit(U32 index)
}
}
+LLLightState* LLRender::getLight(U32 index)
+{
+ if (index < mLightState.size())
+ {
+ return mLightState[index];
+ }
+
+ return NULL;
+}
+
bool LLRender::verifyTexUnitActive(U32 unitToVerify)
{
if (mCurrTextureUnitIndex == unitToVerify)
diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h
index 2767aa64a8..7ba14f7b40 100644
--- a/indra/llrender/llrender.h
+++ b/indra/llrender/llrender.h
@@ -37,6 +37,7 @@
#include "v2math.h"
#include "v3math.h"
#include "v4coloru.h"
+#include "v4math.h"
#include "llstrider.h"
#include "llpointer.h"
#include "llglheaders.h"
@@ -212,6 +213,41 @@ protected:
void setTextureCombiner(eTextureBlendOp op, eTextureBlendSrc src1, eTextureBlendSrc src2, bool isAlpha = false);
};
+class LLLightState
+{
+public:
+ LLLightState(S32 index);
+
+ void enable();
+ void disable();
+ void setDiffuse(const LLColor4& diffuse);
+ void setAmbient(const LLColor4& ambient);
+ void setSpecular(const LLColor4& specular);
+ void setPosition(const LLVector4& position);
+ void setConstantAttenuation(const F32& atten);
+ void setLinearAttenuation(const F32& atten);
+ void setQuadraticAttenuation(const F32& atten);
+ void setSpotExponent(const F32& exponent);
+ void setSpotCutoff(const F32& cutoff);
+ void setSpotDirection(const LLVector3& direction);
+
+protected:
+ S32 mIndex;
+ bool mEnabled;
+ LLColor4 mDiffuse;
+ LLColor4 mAmbient;
+ LLColor4 mSpecular;
+ LLVector4 mPosition;
+ LLVector3 mSpotDirection;
+
+ F32 mConstantAtten;
+ F32 mLinearAtten;
+ F32 mQuadraticAtten;
+
+ F32 mSpotExponent;
+ F32 mSpotCutoff;
+};
+
class LLRender
{
friend class LLTexUnit;
@@ -327,6 +363,8 @@ public:
void blendFunc(eBlendFactor color_sfactor, eBlendFactor color_dfactor,
eBlendFactor alpha_sfactor, eBlendFactor alpha_dfactor);
+ LLLightState* getLight(U32 index);
+
LLTexUnit* getTexUnit(U32 index);
U32 getCurrentTexUnitIndex(void) const { return mCurrTextureUnitIndex; }
@@ -363,6 +401,7 @@ private:
LLStrider<LLColor4U> mColorsp;
std::vector<LLTexUnit*> mTexUnits;
LLTexUnit* mDummyTexUnit;
+ std::vector<LLLightState*> mLightState;
eBlendFactor mCurrBlendColorSFactor;
eBlendFactor mCurrBlendColorDFactor;
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp
index 07ec31dbd5..51870515f2 100644
--- a/indra/llrender/llvertexbuffer.cpp
+++ b/indra/llrender/llvertexbuffer.cpp
@@ -143,7 +143,7 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask)
}
else
{ //was disabled
- if (data_mask & mask[i])
+ if (data_mask & mask[i] && i > 0)
{ //needs to be enabled
glEnableClientState(array[i]);
}
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/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/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/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 1359312013..856c068a44 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -1332,32 +1332,7 @@ const LLVector3 LLVOAvatar::getRenderPosition() const
}
else if (isRoot())
{
- //Rebase the pelvis position if the avatar contains a pelvis offset
- if ( mHasPelvisOffset )
- {
- LLVector3 returnVec( mDrawable->getPositionAgent() );
- if ( mLastPelvisToFoot > mPelvisToFoot )
- {
- F32 diff = mLastPelvisToFoot - mPelvisToFoot;
- //1. Move the pelvis down by the difference of the old amount and the new pelvis to foot amount
- returnVec[VZ] -= (diff);
- //2. Now move the pelvis up by the new pelvis to foot amount
- returnVec[VZ] += mPelvisToFoot;
- }
- else
- {
- //1. Move the pelvis down by the old pelvis to foot amount
- returnVec[VZ] -= (mLastPelvisToFoot);
- //2. Now move the pelvis up by the new pelvis to foot amount
- returnVec[VZ] += mPelvisToFoot;
- }
- //Return the fixed up pelvis position
- return returnVec;
- }
- else
- {
- return mDrawable->getPositionAgent();
- }
+ return mDrawable->getPositionAgent();
}
else
{
@@ -3498,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/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 7e6f01bcf2..e3dea5c788 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -3818,6 +3818,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/pipeline.cpp b/indra/newview/pipeline.cpp
index 9d7af4aace..221960ba0f 100755
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -2079,33 +2079,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 +2942,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 +4611,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 +4654,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 +4856,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 +4924,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 +4940,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 +4966,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 +4987,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 +5029,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 +5062,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 +5075,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 +5121,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 +5171,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
}
//============================================================================
@@ -5969,8 +5964,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/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
diff --git a/indra/test/test_llmanifest.py b/indra/test/test_llmanifest.py
index 89c36f95dd..a97abbc6ee 100644
--- a/indra/test/test_llmanifest.py
+++ b/indra/test/test_llmanifest.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
"""
@file test_llmanifest.py
@author Ryan Williams