summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/CMakeLists.txt1
-rwxr-xr-xindra/newview/app_settings/shaders/class1/deferred/alphaF.glsl5
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/materialF.glsl15
-rwxr-xr-xindra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl12
-rwxr-xr-xindra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl8
-rwxr-xr-xindra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl24
-rwxr-xr-xindra/newview/app_settings/shaders/class2/deferred/alphaF.glsl3
-rwxr-xr-xindra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl9
-rwxr-xr-xindra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl8
-rwxr-xr-xindra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl17
-rwxr-xr-xindra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl12
-rwxr-xr-xindra/newview/llpanelface.cpp16
-rwxr-xr-xindra/newview/llviewerobject.cpp25
-rwxr-xr-xindra/newview/skins/default/xui/en/strings.xml2
14 files changed, 84 insertions, 73 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index b9e19389d7..0836b1de8c 100755
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -754,6 +754,7 @@ set(viewer_HEADER_FILES
lldrawpoolalpha.h
lldrawpoolavatar.h
lldrawpoolbump.h
+ lldrawpoolmaterials.h
lldrawpoolground.h
lldrawpoolsimple.h
lldrawpoolsky.h
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
index 9f1fdb4385..737c658126 100755
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
@@ -121,7 +121,7 @@ void main()
vec3 normal = vary_norm;
vec3 l = light_position[0].xyz;
- vec3 dlight = calcDirectionalLight(normal, l);
+ vec3 dlight = calcDirectionalLight(normal, l) * 2.6;
dlight = dlight * vary_directional.rgb * vary_pointlight_col;
vec4 col = vec4(vary_ambient + dlight, vertex_color_alpha);
@@ -132,8 +132,7 @@ void main()
color.rgb = scaleSoftClip(color.rgb);
col = vec4(0,0,0,0);
- #define LIGHT_LOOP(i) \
- col.rgb += light_diffuse[i].rgb * calcPointLightOrSpotLight(pos.xyz, normal, light_position[i], light_direction[i].xyz, light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z);
+ #define LIGHT_LOOP(i) col.rgb += light_diffuse[i].rgb * calcPointLightOrSpotLight(pos.xyz, normal, light_position[i], light_direction[i].xyz, light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z);
LIGHT_LOOP(1)
LIGHT_LOOP(2)
diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
index b3c1a067ee..a4eaac8483 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
@@ -326,9 +326,9 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) {
+ tmpAmbient)));
//brightness of surface both sunlight and ambient
- setSunlitColor(vec3(sunlight * .5));
- setAmblitColor(vec3(tmpAmbient * .25));
- setAdditiveColor(getAdditiveColor() * vec3(1.0 - temp1));
+ setSunlitColor(pow(vec3(sunlight * .5), vec3(2.2)) * 2.2);
+ setAmblitColor(pow(vec3(tmpAmbient * .25), vec3(2.2)) * 2.2);
+ setAdditiveColor(pow(getAdditiveColor() * vec3(1.0 - temp1), vec3(2.2)) * 2.2);
}
vec3 atmosLighting(vec3 light)
@@ -567,13 +567,13 @@ void main()
vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
float da =dot(norm.xyz, sun_dir.xyz);
- float final_da = pow(da, 0.7f);
+ float final_da = da;
final_da = min(final_da, shadow);
final_da = max(final_da, diffuse.a);
final_da = max(final_da, 0.0f);
col.rgb = atmosAmbient(col);
- col.rgb = col.rgb + atmosAffectDirectionalLight(final_da);
+ col.rgb = col.rgb + atmosAffectDirectionalLight(final_da * 2.6);
col.rgb *= diffuse.rgb;
@@ -595,7 +595,7 @@ void main()
{
//add environmentmap
vec3 env_vec = env_mat * refnormpersp;
- col = mix(col.rgb, textureCube(environmentMap, env_vec).rgb,
+ col = mix(col.rgb, pow(textureCube(environmentMap, env_vec).rgb, vec3(2.2)) * 2.2,
max(envIntensity-diffuse.a*2.0, 0.0));
}
@@ -604,8 +604,7 @@ void main()
vec3 npos = normalize(-pos.xyz);
- #define LIGHT_LOOP(i) \
- col.rgb = col.rgb + calcPointLightOrSpotLight(light_diffuse[i].rgb, npos, diffuse.rgb, final_specular, pos.xyz, norm.xyz, light_position[i], light_direction[i].xyz, light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z);
+ #define LIGHT_LOOP(i) col.rgb = col.rgb + calcPointLightOrSpotLight(light_diffuse[i].rgb, npos, diffuse.rgb, final_specular, pos.xyz, norm.xyz, light_position[i], light_direction[i].xyz, light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z);
LIGHT_LOOP(1)
LIGHT_LOOP(2)
diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
index 50938d3ef9..97ccc77ca8 100755
--- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
@@ -184,6 +184,7 @@ void main()
vec3 col = vec3(0,0,0);
vec3 diff_tex = texture2DRect(diffuseRect, frag.xy).rgb;
+ vec3 dlit = vec3(0, 0, 0);
float noise = texture2D(noiseMap, frag.xy/128.0).b;
if (proj_tc.z > 0.0 &&
@@ -202,14 +203,13 @@ void main()
vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod);
- vec3 lcol = color.rgb * plcol.rgb * plcol.a;
+ dlit = color.rgb * plcol.rgb * plcol.a;
lit = da * dist_atten * noise;
- col = lcol*lit*diff_tex;
+ col = dlit*lit*diff_tex;
amb_da += (da*0.5)*proj_ambiance;
}
-
//float diff = clamp((proj_range-proj_focus)/proj_range, 0.0, 1.0);
vec4 amb_plcol = texture2DLodAmbient(projectionMap, proj_tc.xy, proj_lod);
@@ -218,8 +218,7 @@ void main()
amb_da *= dist_atten * noise;
amb_da = min(amb_da, 1.0-lit);
-
- col += amb_da*color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a;
+ col += amb_da*color.rgb*diff_tex*amb_plcol.rgb*amb_plcol.a;
}
@@ -227,7 +226,6 @@ void main()
if (spec.a > 0.0)
{
- float lit = da * dist_atten * noise;
vec3 npos = -normalize(pos);
//vec3 ref = dot(pos+lv, norm);
@@ -244,7 +242,7 @@ void main()
if (nh > 0.0)
{
float scol = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt/(nh*da);
- col += lit*scol*color.rgb*spec.rgb;
+ col += dlit*scol*spec.rgb;
//col += spec.rgb;
}
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
index 90cf085524..5d936233fe 100755
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
@@ -231,9 +231,9 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) {
+ tmpAmbient)));
//brightness of surface both sunlight and ambient
- setSunlitColor(pow(vec3(sunlight * .5), vec3(global_gamma)) * 3.3);
- setAmblitColor(pow(vec3(tmpAmbient * .25), vec3(global_gamma)) * 3.3);
- setAdditiveColor(pow(getAdditiveColor() * vec3(1.0 - temp1), vec3(global_gamma)) * 3.3);
+ setSunlitColor(pow(vec3(sunlight * .5), vec3(global_gamma)) * 2.2);
+ setAmblitColor(pow(vec3(tmpAmbient * .25), vec3(global_gamma)) * 2.2);
+ setAdditiveColor(pow(getAdditiveColor() * vec3(1.0 - temp1), vec3(global_gamma)) * 2.2);
}
vec3 atmosLighting(vec3 light)
@@ -301,7 +301,7 @@ void main()
calcAtmospherics(pos.xyz, 1.0);
col = atmosAmbient(vec3(0));
- col += atmosAffectDirectionalLight(max(min(da, 1.0), diffuse.a));
+ col += atmosAffectDirectionalLight(max(min(da, 1.0) * 2.6, diffuse.a));
col *= diffuse.rgb;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
index 8d2a4f2dd6..35d4f314af 100755
--- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
@@ -76,9 +76,15 @@ vec3 decode_normal (vec2 enc)
return n;
}
+vec4 correctWithGamma(vec4 col)
+{
+ return vec4(pow(col.rgb, vec3(2.2)), col.a);
+}
+
vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod)
{
vec4 ret = texture2DLod(projectionMap, tc, lod);
+ ret = correctWithGamma(ret);
vec2 dist = tc-vec2(0.5);
@@ -94,6 +100,7 @@ vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod)
vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod)
{
vec4 ret = texture2DLod(projectionMap, tc, lod);
+ ret = correctWithGamma(ret);
vec2 dist = vec2(0.5) - abs(tc-vec2(0.5));
@@ -111,6 +118,7 @@ vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod)
vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod)
{
vec4 ret = texture2DLod(projectionMap, tc, lod);
+ ret = correctWithGamma(ret);
vec2 dist = tc-vec2(0.5);
@@ -188,6 +196,8 @@ void main()
float noise = texture2D(noiseMap, frag.xy/128.0).b;
+ vec3 dlit = vec3(0, 0, 0);
+
if (proj_tc.z > 0.0 &&
proj_tc.x < 1.0 &&
proj_tc.y < 1.0 &&
@@ -205,13 +215,12 @@ void main()
float lod = diff * proj_lod;
vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod);
+ dlit = color.rgb * plcol.rgb * plcol.a;
- vec3 lcol = color.rgb * plcol.rgb * plcol.a;
-
- col = lcol*lit*diff_tex;
+ col = dlit*lit*diff_tex;
//amb_da += (da*0.5)*(1.0-shadow)*proj_ambiance;
}
-
+
//float diff = clamp((proj_range-proj_focus)/proj_range, 0.0, 1.0);
vec4 amb_plcol = texture2DLodAmbient(projectionMap, proj_tc.xy, proj_lod);
@@ -220,14 +229,12 @@ void main()
amb_da *= dist_atten * noise;
amb_da = min(amb_da, 1.0-lit);
-
- col += amb_da*color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a;
+ col += amb_da*color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a*diff_tex.rgb;
}
if (spec.a > 0.0)
{
- float lit = da * dist_atten * noise;
vec3 npos = -normalize(pos);
//vec3 ref = dot(pos+lv, norm);
@@ -243,8 +250,9 @@ void main()
if (nh > 0.0)
{
+
float scol = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt/(nh*da);
- col += lit*scol*color.rgb*spec.rgb;
+ col += dlit*scol*spec.rgb;
//col += spec.rgb;
}
}
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
index 73c85c0419..13b629a6c8 100755
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
@@ -223,8 +223,7 @@ void main()
col = vec4(0.0f,0.0f,0.0f,0.0f);
- #define LIGHT_LOOP(i) \
- col.rgb += light_diffuse[i].rgb * calcPointLightOrSpotLight(pos.xyz, normal, light_position[i], light_direction[i].xyz, light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z);
+ #define LIGHT_LOOP(i) col.rgb += light_diffuse[i].rgb * calcPointLightOrSpotLight(pos.xyz, normal, light_position[i], light_direction[i].xyz, light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z);
LIGHT_LOOP(1)
LIGHT_LOOP(2)
diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
index 76da91094c..9ddbb6da6a 100755
--- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
@@ -200,7 +200,7 @@ void main()
vec4 spec = texture2DRect(specularRect, frag.xy);
-
+ vec3 dlit = vec3(0, 0, 0);
float noise = texture2D(noiseMap, frag.xy/128.0).b;
if (proj_tc.z > 0.0 &&
@@ -221,9 +221,9 @@ void main()
vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod);
- vec3 lcol = color.rgb * plcol.rgb * plcol.a;
+ dlit = color.rgb * plcol.rgb * plcol.a;
- col = lcol*lit*diff_tex*shadow;
+ col = dlit*lit*diff_tex*shadow;
amb_da += (da*0.5)*(1.0-shadow)*proj_ambiance;
}
@@ -242,7 +242,6 @@ void main()
if (spec.a > 0.0)
{
- float lit = da * dist_atten * noise;
vec3 npos = -normalize(pos);
//vec3 ref = dot(pos+lv, norm);
@@ -259,7 +258,7 @@ void main()
if (nh > 0.0)
{
float scol = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt/(nh*da);
- col += lit*scol*color.rgb*spec.rgb*shadow;
+ col += dlit*scol*spec.rgb*shadow;
//col += spec.rgb;
}
}
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
index 466714c108..15584548cc 100755
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
@@ -234,9 +234,9 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) {
+ tmpAmbient)));
//brightness of surface both sunlight and ambient
- setSunlitColor(pow(vec3(sunlight * .5), vec3(global_gamma)) * 3.3);
- setAmblitColor(pow(vec3(tmpAmbient * .25), vec3(global_gamma)) * 3.3);
- setAdditiveColor(pow(getAdditiveColor() * vec3(1.0 - temp1), vec3(global_gamma)) * 3.3);
+ setSunlitColor(pow(vec3(sunlight * .5), vec3(global_gamma)) * global_gamma);
+ setAmblitColor(pow(vec3(tmpAmbient * .25), vec3(global_gamma)) * global_gamma);
+ setAdditiveColor(pow(getAdditiveColor() * vec3(1.0 - temp1), vec3(global_gamma)) * global_gamma);
}
vec3 atmosLighting(vec3 light)
@@ -310,7 +310,7 @@ void main()
calcAtmospherics(pos.xyz, ambocc);
col = atmosAmbient(vec3(0));
- col += atmosAffectDirectionalLight(max(min(da, scol), diffuse.a));
+ col += atmosAffectDirectionalLight(max(min(da, scol) * 2.6, diffuse.a));
col *= diffuse.rgb;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
index 2cc563ff67..aa964fa0a3 100755
--- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
@@ -79,9 +79,15 @@ vec3 decode_normal (vec2 enc)
return n;
}
+vec4 correctWithGamma(vec4 col)
+{
+ return vec4(pow(col.rgb, vec3(2.2)), col.a);
+}
+
vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod)
{
vec4 ret = texture2DLod(projectionMap, tc, lod);
+ ret = correctWithGamma(ret);
vec2 dist = tc-vec2(0.5);
@@ -97,6 +103,7 @@ vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod)
vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod)
{
vec4 ret = texture2DLod(projectionMap, tc, lod);
+ ret = correctWithGamma(ret);
vec2 dist = vec2(0.5) - abs(tc-vec2(0.5));
@@ -114,6 +121,7 @@ vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod)
vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod)
{
vec4 ret = texture2DLod(projectionMap, tc, lod);
+ ret = correctWithGamma(ret);
vec2 dist = tc-vec2(0.5);
@@ -198,7 +206,7 @@ void main()
vec4 spec = texture2DRect(specularRect, frag.xy);
-
+ vec3 dlit = vec3(0, 0, 0);
float noise = texture2D(noiseMap, frag.xy/128.0).b;
if (proj_tc.z > 0.0 &&
@@ -219,9 +227,9 @@ void main()
vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod);
- vec3 lcol = color.rgb * plcol.rgb * plcol.a;
+ dlit = color.rgb * plcol.rgb * plcol.a;
- col = lcol*lit*diff_tex*shadow;
+ col = dlit*lit*diff_tex*shadow;
amb_da += (da*0.5)*(1.0-shadow)*proj_ambiance;
}
@@ -240,7 +248,6 @@ void main()
if (spec.a > 0.0)
{
- float lit = da * dist_atten * noise;
vec3 npos = -normalize(pos);
//vec3 ref = dot(pos+lv, norm);
@@ -257,7 +264,7 @@ void main()
if (nh > 0.0)
{
float scol = fres*texture2D(lightFunc, vec2(nh, spec.a)).r*gt/(nh*da);
- col += lit*scol*color.rgb*spec.rgb*shadow;
+ col += dlit*scol*spec.rgb*shadow;
//col += spec.rgb;
}
}
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl
index d543479b85..8fd06c7e2f 100755
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl
@@ -131,16 +131,10 @@ void calcAtmospherics(vec3 inPositionEye) {
+ (haze_horizon * haze_weight) * (sunlight*(1.-cloud_shadow) * temp2.x
+ tmpAmbient)));
- float gammaScale = 1.0;
- if (global_gamma > 1.0)
- {
- gammaScale = global_gamma / 2 + global_gamma;
- }
-
//brightness of surface both sunlight and ambient
- setSunlitColor(pow(vec3(sunlight * .5), vec3(global_gamma)) * gammaScale);
- setAmblitColor(pow(vec3(tmpAmbient * .25), vec3(global_gamma)) * gammaScale);
- setAdditiveColor(pow(getAdditiveColor() * vec3(1.0 - temp1), vec3(global_gamma)) * gammaScale);
+ setSunlitColor(pow(vec3(sunlight * .5), vec3(global_gamma)) * global_gamma);
+ setAmblitColor(pow(vec3(tmpAmbient * .25), vec3(global_gamma)) * global_gamma);
+ setAdditiveColor(pow(getAdditiveColor() * vec3(1.0 - temp1), vec3(global_gamma)) * global_gamma);
// vary_SunlitColor = vec3(0);
// vary_AmblitColor = vec3(0);
diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index d106de3d73..be1561d9a0 100755
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -812,7 +812,7 @@ void LLPanelFace::getState()
updateAlphaControls(getChild<LLComboBox>("combobox alphamode"),this);
}
- if(texture_ctrl)
+ if(texture_ctrl && !texture_ctrl->isPickerShown())
{
if (identical_diffuse)
{
@@ -848,7 +848,7 @@ void LLPanelFace::getState()
}
}
- if (shinytexture_ctrl)
+ if (shinytexture_ctrl && !shinytexture_ctrl->isPickerShown())
{
if (identical_spec)
{
@@ -870,7 +870,7 @@ void LLPanelFace::getState()
}
}
- if (bumpytexture_ctrl)
+ if (bumpytexture_ctrl && !bumpytexture_ctrl->isPickerShown())
{
if (identical_norm)
{
@@ -1655,12 +1655,13 @@ void LLPanelFace::getState()
void LLPanelFace::refresh()
{
+ LL_DEBUGS("Materials") << LL_ENDL;
getState();
}
void LLPanelFace::onMaterialLoaded(const LLMaterialID& material_id, const LLMaterialPtr material)
{ //laying out UI based on material parameters (calls setVisible on various components)
- LL_DEBUGS("Materials") << "Loaded material " << material_id.asString() << material->asLLSD() << LL_ENDL;
+ LL_DEBUGS("Materials") << "material id " << material_id.asString() << " data " << material->asLLSD() << LL_ENDL;
//make a local copy of the material for editing
// (prevents local edits from overwriting client state on shared materials)
@@ -1940,7 +1941,7 @@ void LLPanelFace::onCommitMaterialsMedia(LLUICtrl* ctrl, void* userdata)
LLComboBox* combo_bumpiness = self->getChild<LLComboBox>("combobox bumpiness");
if (!combo_mattype || !combo_matmedia || !combo_shininess || !combo_bumpiness)
{
- llwarns << "Combo box not found...exiting." << llendl;
+ LL_WARNS("Materials") << "Combo box not found...exiting." << LL_ENDL;
return;
}
U32 materials_media = combo_matmedia->getCurrentIndex();
@@ -2126,7 +2127,7 @@ void LLPanelFace::updateBumpyControls(LLUICtrl* ctrl, void* userdata, bool mess_
LLPanelFace* self = (LLPanelFace*) userdata;
LLTextureCtrl* texture_ctrl = self->getChild<LLTextureCtrl>("bumpytexture control");
LLUUID bumpy_texture_ID = texture_ctrl->getImageAssetID();
- LL_DEBUGS("Materials") << "Bumpy texture selected: " << bumpy_texture_ID << LL_ENDL;
+ LL_DEBUGS("Materials") << "texture: " << bumpy_texture_ID << (mess_with_combobox ? "" : " do not") << " update combobox" << LL_ENDL;
LLComboBox* comboBumpy = self->getChild<LLComboBox>("combobox bumpiness");
if (!comboBumpy)
{
@@ -2452,6 +2453,7 @@ void LLPanelFace::onCommitPlanarAlign(LLUICtrl* ctrl, void* userdata)
void LLPanelFace::onTextureSelectionChanged(LLInventoryItem* itemp)
{
+ LL_DEBUGS("Materials") << "item asset " << itemp->getAssetUUID() << LL_ENDL;
LLComboBox* combo_mattype = getChild<LLComboBox>("combobox mattype");
if (!combo_mattype)
{
@@ -2469,7 +2471,7 @@ void LLPanelFace::onTextureSelectionChanged(LLInventoryItem* itemp)
break;
// no default needed
}
-
+ LL_DEBUGS("Materials") << "control " << which_control << LL_ENDL;
LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>(which_control);
if (texture_ctrl)
{
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index 8dc13fd0ae..7543e8fabd 100755
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -4086,47 +4086,50 @@ S32 LLViewerObject::setTETextureCore(const U8 te, LLViewerTexture *image)
S32 LLViewerObject::setTENormalMapCore(const U8 te, LLViewerTexture *image)
{
- S32 retval = 0;
+ llassert(image);
+ S32 retval = TEM_CHANGE_TEXTURE;
const LLUUID& uuid = image->getID();
- if (uuid != getTE(te)->getMaterialParams()->getNormalID())
+ if (uuid != getTE(te)->getID() ||
+ uuid == LLUUID::null)
{
- retval = TEM_CHANGE_TEXTURE;
LLTextureEntry* tep = getTE(te);
- LLMaterial* mat = tep->getMaterialParams();
+ LLMaterial* mat = tep ? tep->getMaterialParams() : NULL;
if (mat)
{
mat->setNormalID(uuid);
}
- mTENormalMaps[te] = image;
+
setChanged(TEXTURE);
if (mDrawable.notNull())
{
gPipeline.markTextured(mDrawable);
}
}
+ mTENormalMaps[te] = image;
return retval;
}
S32 LLViewerObject::setTESpecularMapCore(const U8 te, LLViewerTexture *image)
{
- S32 retval = 0;
+ llassert(image);
+ S32 retval = TEM_CHANGE_TEXTURE;
const LLUUID& uuid = image->getID();
- if (uuid != getTE(te)->getMaterialParams()->getSpecularID())
+ if (uuid != getTE(te)->getID() ||
+ uuid == LLUUID::null)
{
- retval = TEM_CHANGE_TEXTURE;
LLTextureEntry* tep = getTE(te);
- LLMaterial* mat = tep->getMaterialParams();
+ LLMaterial* mat = tep ? tep->getMaterialParams() : NULL;
if (mat)
{
mat->setSpecularID(uuid);
- }
- mTESpecularMaps[te] = image;
+ }
setChanged(TEXTURE);
if (mDrawable.notNull())
{
gPipeline.markTextured(mDrawable);
}
}
+ mTESpecularMaps[te] = image;
return retval;
}
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index 7c08aef65e..b6fd14e033 100755
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -372,6 +372,8 @@ Please try logging in again in a minute.</string>
<!-- build floater -->
<string name="multiple_textures">Multiple</string>
+<string name="use_texture">Use texture</string>
+
<!-- world map -->
<string name="texture_loading">Loading...</string>
<string name="worldmap_offline">Offline</string>