From 35ede26097161ec9ab02dd0228ae9c95fce941ee Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 17 Apr 2013 16:46:32 -0500 Subject: NORSPEC-128 Edit glossiness and environment as U8's from [0,255], as they are stored --- indra/newview/llpanelface.cpp | 8 ++++---- .../newview/skins/default/xui/en/panel_tools_texture.xml | 16 +++++++++------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp index be88cb6ab6..2d2a0d6d0c 100644 --- a/indra/newview/llpanelface.cpp +++ b/indra/newview/llpanelface.cpp @@ -1720,8 +1720,8 @@ void LLPanelFace::onMaterialLoaded(const LLMaterialID& material_id, const LLMate getChild("shinyOffsetV")->setValue(offset_y); getChild("shinycolorswatch")->setOriginal(material->getSpecularLightColor()); getChild("shinycolorswatch")->set(material->getSpecularLightColor(),TRUE); - getChild("glossiness")->setValue((F32)(material->getSpecularLightExponent())/255.0); - getChild("environment")->setValue((F32)(material->getEnvironmentIntensity())/255.0); + getChild("glossiness")->setValue(material->getSpecularLightExponent()); + getChild("environment")->setValue(material->getEnvironmentIntensity()); } updateShinyControls(combobox_shininess,this, true); @@ -1844,8 +1844,8 @@ void LLPanelFace::updateMaterial() if (!new_material) { mMaterial->setSpecularLightColor(getChild("shinycolorswatch")->get()); - mMaterial->setSpecularLightExponent((U8)(255*getChild("glossiness")->getValue().asReal())); - mMaterial->setEnvironmentIntensity((U8)(255*getChild("environment")->getValue().asReal())); + mMaterial->setSpecularLightExponent(getChild("glossiness")->getValue().asInteger()); + mMaterial->setEnvironmentIntensity(getChild("environment")->getValue().asInteger()); } } else diff --git a/indra/newview/skins/default/xui/en/panel_tools_texture.xml b/indra/newview/skins/default/xui/en/panel_tools_texture.xml index 5e2caa28a9..042134a8c6 100644 --- a/indra/newview/skins/default/xui/en/panel_tools_texture.xml +++ b/indra/newview/skins/default/xui/en/panel_tools_texture.xml @@ -392,12 +392,13 @@ Glossiness Date: Thu, 18 Apr 2013 00:15:18 -0500 Subject: NORSPEC-135 Fix for environment map not showing up if glossiness is zero. --- .../app_settings/shaders/class1/deferred/softenLightF.glsl | 12 ++++++++---- .../app_settings/shaders/class2/deferred/softenLightF.glsl | 8 ++++++-- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl index 63c819f941..4b4cb5c8ce 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl @@ -308,11 +308,13 @@ void main() col *= diffuse.rgb; + vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); + if (spec.a > 0.0) // specular reflection { // the old infinite-sky shiny reflection // - vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); + float sa = dot(refnormpersp, sun_dir.xyz); vec3 dumbshiny = vary_SunlitColor*(texture2D(lightFunc, vec2(sa, spec.a)).r); @@ -320,13 +322,15 @@ void main() vec3 spec_contrib = dumbshiny * spec.rgb; bloom = dot(spec_contrib, spec_contrib) / 6; col += spec_contrib; - - //add environmentmap + } + + if (envIntensity > 0.0) + { //add environmentmap vec3 env_vec = env_mat * refnormpersp; col = mix(col.rgb, textureCube(environmentMap, env_vec).rgb, max(envIntensity-diffuse.a*2.0, 0.0)); } - + col = atmosLighting(col); col = scaleSoftClip(col); diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 8e638c64eb..5fb22c7f4d 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -315,11 +315,13 @@ void main() col *= diffuse.rgb; + vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); + if (spec.a > 0.0) // specular reflection { // the old infinite-sky shiny reflection // - vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); + float sa = dot(refnormpersp, sun_dir.xyz); vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*(texture2D(lightFunc, vec2(sa, spec.a)).r); @@ -327,8 +329,10 @@ void main() vec3 spec_contrib = dumbshiny * spec.rgb; bloom = dot(spec_contrib, spec_contrib) / 6; col += spec_contrib; + } - //add environmentmap + if (envIntensity > 0.0) + { //add environmentmap vec3 env_vec = env_mat * refnormpersp; col = mix(col.rgb, textureCube(environmentMap, env_vec).rgb, max(envIntensity-diffuse.a*2.0, 0.0)); -- cgit v1.2.3