summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llrender/llgl.cpp6
-rw-r--r--indra/llrender/llrender.cpp20
-rw-r--r--indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl5
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/environment/terrainV.glsl3
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl7
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl6
-rw-r--r--indra/newview/lldrawpoolterrain.cpp5
-rw-r--r--indra/newview/lldrawpoolterrain.h3
-rwxr-xr-xindra/newview/llfloaterpreference.cpp25
-rwxr-xr-x[-rw-r--r--]indra/newview/lltranslate.cpp39
-rwxr-xr-x[-rw-r--r--]indra/newview/lltranslate.h39
-rwxr-xr-x[-rw-r--r--]indra/newview/llviewermessage.cpp2
-rw-r--r--indra/newview/llviewershadermgr.cpp9
-rw-r--r--indra/newview/llvosurfacepatch.cpp24
-rw-r--r--indra/newview/llvosurfacepatch.h7
-rw-r--r--indra/newview/pipeline.cpp1
-rw-r--r--indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml14
20 files changed, 128 insertions, 107 deletions
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index c0d15fe6f3..20ca189e7f 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -553,7 +553,7 @@ bool LLGLManager::initGL()
&mDriverVersionVendorString );
mGLVersion = mDriverVersionMajor + mDriverVersionMinor * .1f;
-
+
// Trailing space necessary to keep "nVidia Corpor_ati_on" cards
// from being recognized as ATI.
if (mGLVendor.substr(0,4) == "ATI ")
@@ -1767,7 +1767,7 @@ void LLGLState::checkClientArrays(const std::string& msg, U32 data_mask)
error = TRUE;
}
- glGetIntegerv(GL_ACTIVE_TEXTURE_ARB, &active_texture);
+ /*glGetIntegerv(GL_ACTIVE_TEXTURE_ARB, &active_texture);
if (active_texture != GL_TEXTURE0_ARB)
{
llwarns << "Active texture corrupted: " << active_texture << llendl;
@@ -1776,7 +1776,7 @@ void LLGLState::checkClientArrays(const std::string& msg, U32 data_mask)
gFailLog << "Active texture corrupted: " << active_texture << std::endl;
}
error = TRUE;
- }
+ }*/
static const char* label[] =
{
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index afb19fce55..97aeae548a 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -1142,16 +1142,6 @@ void LLRender::syncMatrices()
{
stop_glerror();
- GLenum mode[] =
- {
- GL_MODELVIEW,
- GL_PROJECTION,
- GL_TEXTURE,
- GL_TEXTURE,
- GL_TEXTURE,
- GL_TEXTURE,
- };
-
U32 name[] =
{
LLShaderMgr::MODELVIEW_MATRIX,
@@ -1272,6 +1262,16 @@ void LLRender::syncMatrices()
}
else if (!LLGLSLShader::sNoFixedFunction)
{
+ GLenum mode[] =
+ {
+ GL_MODELVIEW,
+ GL_PROJECTION,
+ GL_TEXTURE,
+ GL_TEXTURE,
+ GL_TEXTURE,
+ GL_TEXTURE,
+ };
+
for (U32 i = 0; i < 2; ++i)
{
if (mMatHash[i] != mCurMatHash[i])
diff --git a/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl b/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl
index 2901e18db8..19203ab670 100644
--- a/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl
@@ -32,6 +32,7 @@ ATTRIBUTE vec2 texcoord0;
VARYING vec4 vertex_color;
VARYING vec2 vary_texcoord0;
+uniform vec4 color;
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
mat4 getSkinnedTransform();
@@ -61,8 +62,8 @@ void main()
calcAtmospherics(pos.xyz);
- vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0,0,0,0));
- vertex_color = color;
+ vec4 col = calcLighting(pos.xyz, norm, color, vec4(0,0,0,0));
+ vertex_color = col;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
index acbc3f7e15..d7b90978ba 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
@@ -52,6 +52,8 @@ VARYING vec2 vary_texcoord0;
uniform float near_clip;
+uniform vec4 color;
+
uniform vec4 light_position[8];
uniform vec3 light_direction[8];
uniform vec3 light_attenuation[8];
@@ -123,17 +125,17 @@ void main()
col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].y, light_attenuation[6].z);
col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].y, light_attenuation[7].z);
- vary_pointlight_col = col.rgb;
+ vary_pointlight_col = col.rgb*color.rgb;
col.rgb = vec3(0,0,0);
// Add windlight lights
col.rgb = atmosAmbient(vec3(0.));
- vary_ambient = col.rgb;
- vary_directional = atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), 0.0));
+ vary_ambient = col.rgb*color.rgb;
+ vary_directional = color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), 0.0));
- col.rgb = min(col.rgb, 1.0);
+ col.rgb = col.rgb * color.rgb;
vertex_color = col;
diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl
index f183b885d1..d09c5f9247 100644
--- a/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl
@@ -33,7 +33,6 @@ uniform vec4 object_plane_s;
ATTRIBUTE vec3 position;
ATTRIBUTE vec3 normal;
-ATTRIBUTE vec4 diffuse_color;
ATTRIBUTE vec2 texcoord0;
ATTRIBUTE vec2 texcoord1;
@@ -72,7 +71,7 @@ void main()
/// Potentially better without it for water.
pos /= pos.w;
- vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0));
+ vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0));
vertex_color = color;
diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl
index 706627e175..0be52a52af 100644
--- a/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/simpleNoColorV.glsl
@@ -28,6 +28,8 @@ uniform mat4 texture_matrix0;
uniform mat4 modelview_matrix;
uniform mat4 modelview_projection_matrix;
+uniform vec4 color;
+
ATTRIBUTE vec3 position;
ATTRIBUTE vec3 normal;
ATTRIBUTE vec2 texcoord0;
@@ -50,8 +52,8 @@ void main()
calcAtmospherics(pos.xyz);
- vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0.));
- vertex_color = color;
+ vec4 col = calcLighting(pos.xyz, norm, color, vec4(0.));
+ vertex_color = col;
}
diff --git a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
index 63c7a6b13d..9c7a332417 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
@@ -49,6 +49,7 @@ VARYING vec3 vary_pointlight_col;
VARYING vec4 vertex_color;
VARYING vec2 vary_texcoord0;
+uniform vec4 color;
uniform float near_clip;
uniform float shadow_offset;
@@ -125,17 +126,17 @@ void main()
col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].y, light_attenuation[6].z);
col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].y, light_attenuation[7].z);
- vary_pointlight_col = col.rgb;
+ vary_pointlight_col = col.rgb*color.rgb;
col.rgb = vec3(0,0,0);
// Add windlight lights
col.rgb = atmosAmbient(vec3(0.));
- vary_ambient = col.rgb;
+ vary_ambient = col.rgb*color.rgb;
vary_directional = atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), 0.0));
- col.rgb = min(col.rgb, 1.0);
+ col.rgb = col.rgb*color.rgb;
vertex_color = col;
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl
index 01605e5b25..ba2ed6b1ce 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl
@@ -27,6 +27,7 @@
VARYING vec3 vary_AdditiveColor;
VARYING float vary_AtmosAttenuation;
+vec3 additive_color;
vec3 atmos_attenuation;
vec3 sunlit_color;
vec3 amblit_color;
@@ -43,7 +44,7 @@ vec3 getAmblitColor()
vec3 getAdditiveColor()
{
- return vary_AdditiveColor;
+ return additive_color;
}
vec3 getAtmosAttenuation()
{
@@ -72,6 +73,7 @@ void setAmblitColor(vec3 v)
void setAdditiveColor(vec3 v)
{
+ additive_color = v;
vary_AdditiveColor = v;
}
diff --git a/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl b/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl
index 7fb3cb6552..721054b5ad 100644
--- a/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl
+++ b/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl
@@ -37,6 +37,8 @@ vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
mat4 getSkinnedTransform();
void calcAtmospherics(vec3 inPositionEye);
+uniform vec4 color;
+
uniform vec4 gWindDir;
uniform vec4 gSinWaveParams;
uniform vec4 gGravity;
@@ -125,8 +127,8 @@ void main()
calcAtmospherics(pos.xyz);
- vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0.0));
- vertex_color = color;
+ vec4 col = calcLighting(pos.xyz, norm, color, vec4(0.0));
+ vertex_color = col;
gl_Position = projection_matrix * pos;
}
diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp
index ce601325c8..d61df9c048 100644
--- a/indra/newview/lldrawpoolterrain.cpp
+++ b/indra/newview/lldrawpoolterrain.cpp
@@ -189,6 +189,8 @@ void LLDrawPoolTerrain::render(S32 pass)
compp->mDetailTextures[i]->addTextureStats(1024.f*1024.f); // assume large pixel area
}
+ LLOverrideFaceColor override(this, 1.f, 1.f, 1.f, 1.f);
+
if (!gGLManager.mHasMultitexture)
{
// No multitexture, render simple land.
@@ -203,8 +205,7 @@ void LLDrawPoolTerrain::render(S32 pass)
}
LLGLSPipeline gls;
- LLOverrideFaceColor override(this, 1.f, 1.f, 1.f, 1.f);
-
+
if (mVertexShaderLevel > 1 && sShader->mShaderLevel > 0)
{
gPipeline.enableLightsDynamic();
diff --git a/indra/newview/lldrawpoolterrain.h b/indra/newview/lldrawpoolterrain.h
index 3056da44d5..283ed87f1a 100644
--- a/indra/newview/lldrawpoolterrain.h
+++ b/indra/newview/lldrawpoolterrain.h
@@ -40,8 +40,7 @@ public:
LLVertexBuffer::MAP_TEXCOORD0 |
LLVertexBuffer::MAP_TEXCOORD1 |
LLVertexBuffer::MAP_TEXCOORD2 |
- LLVertexBuffer::MAP_TEXCOORD3 |
- LLVertexBuffer::MAP_COLOR
+ LLVertexBuffer::MAP_TEXCOORD3
};
virtual U32 getVertexDataMask();
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 92c4214fdb..5fdeb46daa 100755
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -1034,19 +1034,30 @@ void LLFloaterPreference::refreshEnabledState()
}
// Vertex Shaders
+ // Global Shader Enable
+ LLCheckBoxCtrl* ctrl_shader_enable = getChild<LLCheckBoxCtrl>("BasicShaders");
// radio set for terrain detail mode
LLRadioGroup* mRadioTerrainDetail = getChild<LLRadioGroup>("TerrainDetailRadio"); // can be linked with control var
- BOOL shaders = gGLManager.mGLVersion >= 2.f;
-
- mRadioTerrainDetail->setEnabled(TRUE);
-
+ ctrl_shader_enable->setEnabled(LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable"));
+
+ BOOL shaders = ctrl_shader_enable->get();
+ if (shaders)
+ {
+ mRadioTerrainDetail->setValue(1);
+ mRadioTerrainDetail->setEnabled(FALSE);
+ }
+ else
+ {
+ mRadioTerrainDetail->setEnabled(TRUE);
+ }
+
// WindLight
LLCheckBoxCtrl* ctrl_wind_light = getChild<LLCheckBoxCtrl>("WindLightUseAtmosShaders");
// *HACK just checks to see if we can use shaders...
// maybe some cards that use shaders, but don't support windlight
- ctrl_wind_light->setEnabled(shaders);
+ ctrl_wind_light->setEnabled(ctrl_shader_enable->getEnabled() && shaders);
//Deferred/SSAO/Shadows
LLCheckBoxCtrl* ctrl_deferred = getChild<LLCheckBoxCtrl>("UseLightShaders");
@@ -1084,6 +1095,7 @@ void LLFloaterPreference::disableUnavailableSettings()
LLComboBox* ctrl_reflections = getChild<LLComboBox>("Reflections");
LLCheckBoxCtrl* ctrl_avatar_vp = getChild<LLCheckBoxCtrl>("AvatarVertexProgram");
LLCheckBoxCtrl* ctrl_avatar_cloth = getChild<LLCheckBoxCtrl>("AvatarCloth");
+ LLCheckBoxCtrl* ctrl_shader_enable = getChild<LLCheckBoxCtrl>("BasicShaders");
LLCheckBoxCtrl* ctrl_wind_light = getChild<LLCheckBoxCtrl>("WindLightUseAtmosShaders");
LLCheckBoxCtrl* ctrl_avatar_impostors = getChild<LLCheckBoxCtrl>("AvatarImpostors");
LLCheckBoxCtrl* ctrl_deferred = getChild<LLCheckBoxCtrl>("UseLightShaders");
@@ -1094,6 +1106,9 @@ void LLFloaterPreference::disableUnavailableSettings()
// if vertex shaders off, disable all shader related products
if (!LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable"))
{
+ ctrl_shader_enable->setEnabled(FALSE);
+ ctrl_shader_enable->setValue(FALSE);
+
ctrl_wind_light->setEnabled(FALSE);
ctrl_wind_light->setValue(FALSE);
diff --git a/indra/newview/lltranslate.cpp b/indra/newview/lltranslate.cpp
index 2f60b6b90b..3692f67a8d 100644..100755
--- a/indra/newview/lltranslate.cpp
+++ b/indra/newview/lltranslate.cpp
@@ -53,6 +53,45 @@ const char* LLTranslate::m_GoogleData = "responseData";
const char* LLTranslate::m_GoogleTranslation = "translatedText";
const char* LLTranslate::m_GoogleLanguage = "detectedSourceLanguage";
+// virtual
+void LLTranslate::TranslationReceiver::completedRaw( U32 status,
+ const std::string& reason,
+ const LLChannelDescriptors& channels,
+ const LLIOPipe::buffer_ptr_t& buffer)
+{
+ if (200 <= status && status < 300)
+ {
+ LLBufferStream istr(channels, buffer.get());
+ std::stringstream strstrm;
+ strstrm << istr.rdbuf();
+
+ const std::string result = strstrm.str();
+ std::string translation;
+ std::string detected_language;
+
+ if (!parseGoogleTranslate(result, translation, detected_language))
+ {
+ handleFailure();
+ return;
+ }
+
+ // Fix up the response
+ LLStringUtil::replaceString(translation, "&lt;", "<");
+ LLStringUtil::replaceString(translation, "&gt;",">");
+ LLStringUtil::replaceString(translation, "&quot;","\"");
+ LLStringUtil::replaceString(translation, "&#39;","'");
+ LLStringUtil::replaceString(translation, "&amp;","&");
+ LLStringUtil::replaceString(translation, "&apos;","'");
+
+ handleResponse(translation, detected_language);
+ }
+ else
+ {
+ LL_WARNS("Translate") << "HTTP request for Google Translate failed with status " << status << ", reason: " << reason << LL_ENDL;
+ handleFailure();
+ }
+}
+
//static
void LLTranslate::translateMessage(LLHTTPClient::ResponderPtr &result, const std::string &from_lang, const std::string &to_lang, const std::string &mesg)
{
diff --git a/indra/newview/lltranslate.h b/indra/newview/lltranslate.h
index e85a42e878..c7d6eac33f 100644..100755
--- a/indra/newview/lltranslate.h
+++ b/indra/newview/lltranslate.h
@@ -43,8 +43,8 @@ public :
{
}
- virtual void handleResponse(const std::string &translation, const std::string &recognized_lang) {};
- virtual void handleFailure() {};
+ virtual void handleResponse(const std::string &translation, const std::string &recognized_lang) = 0;
+ virtual void handleFailure() = 0;
public:
~TranslationReceiver()
@@ -54,40 +54,7 @@ public :
virtual void completedRaw( U32 status,
const std::string& reason,
const LLChannelDescriptors& channels,
- const LLIOPipe::buffer_ptr_t& buffer)
- {
- if (200 <= status && status < 300)
- {
- LLBufferStream istr(channels, buffer.get());
- std::stringstream strstrm;
- strstrm << istr.rdbuf();
-
- const std::string result = strstrm.str();
- std::string translation;
- std::string detected_language;
-
- if (!parseGoogleTranslate(result, translation, detected_language))
- {
- handleFailure();
- return;
- }
-
- // Fix up the response
- LLStringUtil::replaceString(translation, "&lt;", "<");
- LLStringUtil::replaceString(translation, "&gt;",">");
- LLStringUtil::replaceString(translation, "&quot;","\"");
- LLStringUtil::replaceString(translation, "&#39;","'");
- LLStringUtil::replaceString(translation, "&amp;","&");
- LLStringUtil::replaceString(translation, "&apos;","'");
-
- handleResponse(translation, detected_language);
- }
- else
- {
- LL_WARNS("Translate") << "HTTP request for Google Translate failed with status " << status << ", reason: " << reason << LL_ENDL;
- handleFailure();
- }
- }
+ const LLIOPipe::buffer_ptr_t& buffer);
protected:
const std::string m_toLang;
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index f0d53668d4..65b569a190 100644..100755
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -3132,7 +3132,7 @@ protected:
void handleFailure()
{
- LLTranslate::TranslationReceiver::handleFailure();
+ llwarns << "translation failed for mesg " << m_origMesg << " toLang " << m_toLang << " fromLang " << m_fromLang << llendl;
m_chat.mText += " (?)";
LLNotificationsUI::LLNotificationManager::instance().onChat(m_chat, m_toastArgs);
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index e50625af60..108f008f58 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -363,8 +363,8 @@ void LLViewerShaderMgr::setShaders()
reentrance = true;
- if (LLRender::sGLCoreProfile || gGLManager.mGLVersion >= 2.f)
- { //ALWAYS use shaders where available
+ if (LLRender::sGLCoreProfile)
+ {
if (!gSavedSettings.getBOOL("VertexShaderEnable"))
{ //vertex shaders MUST be enabled to use core profile
gSavedSettings.setBOOL("VertexShaderEnable", TRUE);
@@ -584,7 +584,6 @@ void LLViewerShaderMgr::setShaders()
if (gViewerWindow)
{
gViewerWindow->setCursor(UI_CURSOR_ARROW);
- gViewerWindow->getWindow()->restore();
}
gPipeline.createGLBuffers();
@@ -828,6 +827,8 @@ BOOL LLViewerShaderMgr::loadShadersEnvironment()
gTerrainProgram.mFeatures.calculatesLighting = true;
gTerrainProgram.mFeatures.calculatesAtmospherics = true;
gTerrainProgram.mFeatures.hasAtmospherics = true;
+ gTerrainProgram.mFeatures.mIndexedTextureChannels = 0;
+ gTerrainProgram.mFeatures.disableTextureIndex = true;
gTerrainProgram.mFeatures.hasGamma = true;
gTerrainProgram.mShaderFiles.clear();
gTerrainProgram.mShaderFiles.push_back(make_pair("environment/terrainV.glsl", GL_VERTEX_SHADER_ARB));
@@ -896,6 +897,8 @@ BOOL LLViewerShaderMgr::loadShadersWater()
gTerrainWaterProgram.mFeatures.calculatesAtmospherics = true;
gTerrainWaterProgram.mFeatures.hasAtmospherics = true;
gTerrainWaterProgram.mFeatures.hasWaterFog = true;
+ gTerrainWaterProgram.mFeatures.mIndexedTextureChannels = 0;
+ gTerrainWaterProgram.mFeatures.disableTextureIndex = true;
gTerrainWaterProgram.mShaderFiles.clear();
gTerrainWaterProgram.mShaderFiles.push_back(make_pair("environment/terrainV.glsl", GL_VERTEX_SHADER_ARB));
gTerrainWaterProgram.mShaderFiles.push_back(make_pair("environment/terrainWaterF.glsl", GL_FRAGMENT_SHADER_ARB));
diff --git a/indra/newview/llvosurfacepatch.cpp b/indra/newview/llvosurfacepatch.cpp
index bc82b0df13..0108690538 100644
--- a/indra/newview/llvosurfacepatch.cpp
+++ b/indra/newview/llvosurfacepatch.cpp
@@ -317,7 +317,6 @@ BOOL LLVOSurfacePatch::updateLOD()
void LLVOSurfacePatch::getGeometry(LLStrider<LLVector3> &verticesp,
LLStrider<LLVector3> &normalsp,
- LLStrider<LLColor4U> &colorsp,
LLStrider<LLVector2> &texCoords0p,
LLStrider<LLVector2> &texCoords1p,
LLStrider<U16> &indicesp)
@@ -329,7 +328,6 @@ void LLVOSurfacePatch::getGeometry(LLStrider<LLVector3> &verticesp,
updateMainGeometry(facep,
verticesp,
normalsp,
- colorsp,
texCoords0p,
texCoords1p,
indicesp,
@@ -337,7 +335,6 @@ void LLVOSurfacePatch::getGeometry(LLStrider<LLVector3> &verticesp,
updateNorthGeometry(facep,
verticesp,
normalsp,
- colorsp,
texCoords0p,
texCoords1p,
indicesp,
@@ -345,7 +342,6 @@ void LLVOSurfacePatch::getGeometry(LLStrider<LLVector3> &verticesp,
updateEastGeometry(facep,
verticesp,
normalsp,
- colorsp,
texCoords0p,
texCoords1p,
indicesp,
@@ -355,7 +351,6 @@ void LLVOSurfacePatch::getGeometry(LLStrider<LLVector3> &verticesp,
void LLVOSurfacePatch::updateMainGeometry(LLFace *facep,
LLStrider<LLVector3> &verticesp,
LLStrider<LLVector3> &normalsp,
- LLStrider<LLColor4U> &colorsp,
LLStrider<LLVector2> &texCoords0p,
LLStrider<LLVector2> &texCoords1p,
LLStrider<U16> &indicesp,
@@ -396,7 +391,6 @@ void LLVOSurfacePatch::updateMainGeometry(LLFace *facep,
x = i * render_stride;
y = j * render_stride;
mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get());
- *colorsp++ = LLColor4U::white;
verticesp++;
normalsp++;
texCoords0p++;
@@ -461,7 +455,6 @@ void LLVOSurfacePatch::updateMainGeometry(LLFace *facep,
void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
LLStrider<LLVector3> &verticesp,
LLStrider<LLVector3> &normalsp,
- LLStrider<LLColor4U> &colorsp,
LLStrider<LLVector2> &texCoords0p,
LLStrider<LLVector2> &texCoords1p,
LLStrider<U16> &indicesp,
@@ -499,7 +492,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
y = 16 - render_stride;
mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get());
- *colorsp++ = LLColor4U::white;
verticesp++;
normalsp++;
texCoords0p++;
@@ -515,7 +507,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get());
verticesp++;
normalsp++;
- *colorsp++ = LLColor4U::white;
texCoords0p++;
texCoords1p++;
vertex_count++;
@@ -554,7 +545,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get());
verticesp++;
normalsp++;
- *colorsp++ = LLColor4U::white;
texCoords0p++;
texCoords1p++;
vertex_count++;
@@ -569,7 +559,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get());
verticesp++;
normalsp++;
- *colorsp++ = LLColor4U::white;
texCoords0p++;
texCoords1p++;
vertex_count++;
@@ -613,7 +602,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
y = 16 - render_stride;
mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get());
- *colorsp++ = LLColor4U::white;
verticesp++;
normalsp++;
texCoords0p++;
@@ -630,7 +618,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get());
verticesp++;
normalsp++;
- *colorsp++ = LLColor4U::white;
texCoords0p++;
texCoords1p++;
vertex_count++;
@@ -668,7 +655,6 @@ void LLVOSurfacePatch::updateNorthGeometry(LLFace *facep,
void LLVOSurfacePatch::updateEastGeometry(LLFace *facep,
LLStrider<LLVector3> &verticesp,
LLStrider<LLVector3> &normalsp,
- LLStrider<LLColor4U> &colorsp,
LLStrider<LLVector2> &texCoords0p,
LLStrider<LLVector2> &texCoords1p,
LLStrider<U16> &indicesp,
@@ -702,7 +688,6 @@ void LLVOSurfacePatch::updateEastGeometry(LLFace *facep,
mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get());
verticesp++;
normalsp++;
- *colorsp++ = LLColor4U::white;
texCoords0p++;
texCoords1p++;
}
@@ -715,7 +700,6 @@ void LLVOSurfacePatch::updateEastGeometry(LLFace *facep,
mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get());
verticesp++;
normalsp++;
- *colorsp++ = LLColor4U::white;
texCoords0p++;
texCoords1p++;
}
@@ -753,7 +737,6 @@ void LLVOSurfacePatch::updateEastGeometry(LLFace *facep,
mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get());
verticesp++;
normalsp++;
- *colorsp++ = LLColor4U::white;
texCoords0p++;
texCoords1p++;
}
@@ -766,7 +749,6 @@ void LLVOSurfacePatch::updateEastGeometry(LLFace *facep,
mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get());
verticesp++;
normalsp++;
- *colorsp++ = LLColor4U::white;
texCoords0p++;
texCoords1p++;
}
@@ -810,7 +792,6 @@ void LLVOSurfacePatch::updateEastGeometry(LLFace *facep,
mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get());
verticesp++;
normalsp++;
- *colorsp++ = LLColor4U::white;
texCoords0p++;
texCoords1p++;
}
@@ -823,7 +804,6 @@ void LLVOSurfacePatch::updateEastGeometry(LLFace *facep,
mPatchp->eval(x, y, render_stride, verticesp.get(), normalsp.get(), texCoords0p.get(), texCoords1p.get());
verticesp++;
normalsp++;
- *colorsp++ = LLColor4U::white;
texCoords0p++;
texCoords1p++;
}
@@ -1094,14 +1074,12 @@ void LLTerrainPartition::getGeometry(LLSpatialGroup* group)
LLStrider<LLVector3> normals;
LLStrider<LLVector2> texcoords2;
LLStrider<LLVector2> texcoords;
- LLStrider<LLColor4U> colors;
LLStrider<U16> indices;
llassert_always(buffer->getVertexStrider(vertices));
llassert_always(buffer->getNormalStrider(normals));
llassert_always(buffer->getTexCoord0Strider(texcoords));
llassert_always(buffer->getTexCoord1Strider(texcoords2));
- llassert_always(buffer->getColorStrider(colors));
llassert_always(buffer->getIndexStrider(indices));
U32 indices_index = 0;
@@ -1116,7 +1094,7 @@ void LLTerrainPartition::getGeometry(LLSpatialGroup* group)
facep->setVertexBuffer(buffer);
LLVOSurfacePatch* patchp = (LLVOSurfacePatch*) facep->getViewerObject();
- patchp->getGeometry(vertices, normals, colors, texcoords, texcoords2, indices);
+ patchp->getGeometry(vertices, normals, texcoords, texcoords2, indices);
indices_index += facep->getIndicesCount();
index_offset += facep->getGeomCount();
diff --git a/indra/newview/llvosurfacepatch.h b/indra/newview/llvosurfacepatch.h
index 8e75ff2e6e..a15878368e 100644
--- a/indra/newview/llvosurfacepatch.h
+++ b/indra/newview/llvosurfacepatch.h
@@ -44,8 +44,7 @@ public:
VERTEX_DATA_MASK = (1 << LLVertexBuffer::TYPE_VERTEX) |
(1 << LLVertexBuffer::TYPE_NORMAL) |
(1 << LLVertexBuffer::TYPE_TEXCOORD0) |
- (1 << LLVertexBuffer::TYPE_TEXCOORD1) |
- (1 << LLVertexBuffer::TYPE_COLOR)
+ (1 << LLVertexBuffer::TYPE_TEXCOORD1)
};
LLVOSurfacePatch(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp);
@@ -64,7 +63,6 @@ public:
/*virtual*/ void updateFaceSize(S32 idx);
void getGeometry(LLStrider<LLVector3> &verticesp,
LLStrider<LLVector3> &normalsp,
- LLStrider<LLColor4U> &colorsp,
LLStrider<LLVector2> &texCoords0p,
LLStrider<LLVector2> &texCoords1p,
LLStrider<U16> &indicesp);
@@ -116,7 +114,6 @@ protected:
void updateMainGeometry(LLFace *facep,
LLStrider<LLVector3> &verticesp,
LLStrider<LLVector3> &normalsp,
- LLStrider<LLColor4U> &colorsp,
LLStrider<LLVector2> &texCoords0p,
LLStrider<LLVector2> &texCoords1p,
LLStrider<U16> &indicesp,
@@ -124,7 +121,6 @@ protected:
void updateNorthGeometry(LLFace *facep,
LLStrider<LLVector3> &verticesp,
LLStrider<LLVector3> &normalsp,
- LLStrider<LLColor4U> &colorsp,
LLStrider<LLVector2> &texCoords0p,
LLStrider<LLVector2> &texCoords1p,
LLStrider<U16> &indicesp,
@@ -132,7 +128,6 @@ protected:
void updateEastGeometry(LLFace *facep,
LLStrider<LLVector3> &verticesp,
LLStrider<LLVector3> &normalsp,
- LLStrider<LLColor4U> &colorsp,
LLStrider<LLVector2> &texCoords0p,
LLStrider<LLVector2> &texCoords1p,
LLStrider<U16> &indicesp,
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 04edc90be9..76ad7fd83e 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -1196,6 +1196,7 @@ S32 LLPipeline::getMaxLightingDetail() const
S32 LLPipeline::setLightingDetail(S32 level)
{
LLMemType mt_ld(LLMemType::MTYPE_PIPELINE_LIGHTING_DETAIL);
+ refreshCachedSettings();
if (level < 0)
{
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
index c25c1f23f5..f7666bdc4c 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
@@ -204,6 +204,20 @@
name="LocalLights"
top_pad="1"
width="256" />
+ <check_box
+ control_name="VertexShaderEnable"
+ height="16"
+ initial_value="true"
+ label="Basic shaders"
+ layout="topleft"
+ left_delta="0"
+ name="BasicShaders"
+ tool_tip="Disabling this option may prevent some graphics card drivers from crashing"
+ top_pad="1"
+ width="315">
+ <check_box.commit_callback
+ function="Pref.VertexShaderEnable" />
+ </check_box>
<check_box
control_name="WindLightUseAtmosShaders"
height="16"