diff options
author | Graham Linden <graham@lindenlab.com> | 2018-11-01 18:26:24 +0100 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2018-11-01 18:26:24 +0100 |
commit | fb335cc243581925bb772a1f10112ec493db8552 (patch) | |
tree | dab643628fe9ef60162a7ce2db4b9c6963c51650 | |
parent | d292ec7ee065c50e415c0ef06664ab6d428a022b (diff) |
SL-10000 fix storing of ambient value when converting legacy settings
-rw-r--r-- | indra/llinventory/llsettingssky.cpp | 16 | ||||
-rw-r--r-- | indra/llrender/llglslshader.cpp | 8 | ||||
-rw-r--r-- | indra/llrender/llshadermgr.cpp | 38 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl | 4 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/materialF.glsl | 4 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class2/windlight/transportF.glsl | 16 | ||||
-rw-r--r-- | indra/newview/llsettingsvo.cpp | 4 |
7 files changed, 30 insertions, 60 deletions
diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp index cf6bc45080..aff8bec1cd 100644 --- a/indra/llinventory/llsettingssky.cpp +++ b/indra/llinventory/llsettingssky.cpp @@ -169,13 +169,13 @@ LLSettingsSky::validation_list_t legacyHazeValidationList() LLSD(LLSDArray(0.0f)(0.0f)(0.0f)("*")), LLSD(LLSDArray(3.0f)(3.0f)(3.0f)("*"))))); legacyHazeValidation.push_back(LLSettingsBase::Validator(LLSettingsSky::SETTING_HAZE_DENSITY, false, LLSD::TypeReal, - boost::bind(&LLSettingsBase::Validator::verifyFloatRange, _1, LLSD(LLSDArray(0.0f)(4.0f))))); + boost::bind(&LLSettingsBase::Validator::verifyFloatRange, _1, LLSD(LLSDArray(0.0f)(5.0f))))); legacyHazeValidation.push_back(LLSettingsBase::Validator(LLSettingsSky::SETTING_HAZE_HORIZON, false, LLSD::TypeReal, - boost::bind(&LLSettingsBase::Validator::verifyFloatRange, _1, LLSD(LLSDArray(0.0f)(1.0f))))); + boost::bind(&LLSettingsBase::Validator::verifyFloatRange, _1, LLSD(LLSDArray(0.0f)(5.0f))))); legacyHazeValidation.push_back(LLSettingsBase::Validator(LLSettingsSky::SETTING_DENSITY_MULTIPLIER, false, LLSD::TypeReal, - boost::bind(&LLSettingsBase::Validator::verifyFloatRange, _1, LLSD(LLSDArray(0.0001f)(0.9f))))); + boost::bind(&LLSettingsBase::Validator::verifyFloatRange, _1, LLSD(LLSDArray(0.0001f)(2.0f))))); legacyHazeValidation.push_back(LLSettingsBase::Validator(LLSettingsSky::SETTING_DISTANCE_MULTIPLIER, false, LLSD::TypeReal, - boost::bind(&LLSettingsBase::Validator::verifyFloatRange, _1, LLSD(LLSDArray(0.0f)(100.0f))))); + boost::bind(&LLSettingsBase::Validator::verifyFloatRange, _1, LLSD(LLSDArray(0.0001f)(1000.0f))))); } return legacyHazeValidation; } @@ -724,6 +724,10 @@ LLSD LLSettingsSky::translateLegacyHazeSettings(const LLSD& legacy) // AdvancedAtmospherics TODO // These need to be translated into density profile info in the new settings format... // LEGACY_ATMOSPHERICS + if (legacy.has(SETTING_AMBIENT)) + { + legacyhazesettings[SETTING_AMBIENT] = LLColor3(legacy[SETTING_AMBIENT]).getValue(); + } if (legacy.has(SETTING_BLUE_DENSITY)) { legacyhazesettings[SETTING_BLUE_DENSITY] = LLColor3(legacy[SETTING_BLUE_DENSITY]).getValue(); @@ -765,10 +769,6 @@ LLSD LLSettingsSky::translateLegacySettings(const LLSD& legacy) newsettings[SETTING_LEGACY_HAZE] = legacyhazesettings; } - if (legacy.has(SETTING_AMBIENT)) - { - newsettings[SETTING_AMBIENT] = LLColor3(legacy[SETTING_AMBIENT]).getValue(); - } if (legacy.has(SETTING_CLOUD_COLOR)) { newsettings[SETTING_CLOUD_COLOR] = LLColor3(legacy[SETTING_CLOUD_COLOR]).getValue(); diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index f0cc9acc06..de15d1d75b 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -487,18 +487,18 @@ BOOL LLGLSLShader::createShader(std::vector<LLStaticHashedString> * attributes, return success; } -BOOL LLGLSLShader::attachObject(std::string object) +BOOL LLGLSLShader::attachObject(std::string object_path) { - if (LLShaderMgr::instance()->mShaderObjects.count(object) > 0) + if (LLShaderMgr::instance()->mShaderObjects.count(object_path) > 0) { stop_glerror(); - glAttachObjectARB(mProgramObject, LLShaderMgr::instance()->mShaderObjects[object]); + glAttachObjectARB(mProgramObject, LLShaderMgr::instance()->mShaderObjects[object_path]); stop_glerror(); return TRUE; } else { - LL_SHADER_LOADING_WARNS() << "Attempting to attach shader object that hasn't been compiled: " << object << LL_ENDL; + LL_SHADER_LOADING_WARNS() << "Attempting to attach shader object: '" << object_path << "' that hasn't been compiled." << LL_ENDL; return FALSE; } } diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 9da705bb2d..d6fe35e2ca 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -628,7 +628,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade if (file == NULL) { - LL_SHADER_LOADING_WARNS() << "GLSL Shader file not found: " << filename << LL_ENDL; + LL_SHADER_LOADING_WARNS() << "GLSL Shader file not found: " << open_file_name << LL_ENDL; return 0; } @@ -958,38 +958,8 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade { //an error occured, print log LL_WARNS("ShaderLoading") << "GLSL Compilation Error:" << LL_ENDL; - dumpObjectLog(ret, TRUE, filename); -#if LL_WINDOWS - std::stringstream ostr; - //dump shader source for debugging - for (GLuint i = 0; i < shader_code_count; i++) - { - ostr << i << ": " << shader_code_text[i]; - - if (i % 128 == 0) - { //dump every 128 lines - - LL_WARNS("ShaderLoading") << "\n" << ostr.str() << LL_ENDL; - ostr = std::stringstream(); - } - - } - - LL_WARNS("ShaderLoading") << "\n" << ostr.str() << LL_ENDL; -#else - std::string str; - - for (GLuint i = 0; i < shader_code_count; i++) { - str.append(shader_code_text[i]); - - if (i % 128 == 0) - { - LL_WARNS("ShaderLoading") << str << LL_ENDL; - str = ""; - } - } -#endif - + dumpObjectLog(ret, TRUE, open_file_name); + dumpShaderSource(shader_code_count, shader_code_text); ret = 0; } } @@ -1018,7 +988,7 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade if (shader_level > 1) { shader_level--; - return loadShaderFile(filename,shader_level,type, defines, texture_index_channels); + return loadShaderFile(filename, shader_level, type, defines, texture_index_channels); } LL_WARNS("ShaderLoading") << "Failed to load " << filename << LL_ENDL; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index 7f2c5add16..1cfc19267c 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -88,7 +88,7 @@ vec3 linear_to_srgb(vec3 cl); vec2 encode_normal (vec3 n); vec3 decode_normal (vec2 enc); -vec3 scaleFragSoftClip(vec3 l); +vec3 scaleSoftClipFrag(vec3 l); vec3 atmosFragAmbient(vec3 light, vec3 sunlit); vec3 atmosFragLighting(vec3 light, vec3 additive, vec3 atten); vec3 atmosFragAffectDirectionalLight(float light, vec3 sunlit); @@ -312,7 +312,7 @@ void main() //color.rgb = mix(diff.rgb, color.rgb, final_alpha); color.rgb = atmosFragLighting(color.rgb, additive, atten); - color.rgb = scaleFragSoftClip(color.rgb); + color.rgb = scaleSoftClipFrag(color.rgb); vec4 light = vec4(0,0,0,0); diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl index 6e06453a5b..9f52e72313 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl @@ -42,7 +42,7 @@ vec3 linear_to_srgb(vec3 cl); vec3 atmosFragAmbient(vec3 l, vec3 ambient); vec3 atmosFragLighting(vec3 l, vec3 additive, vec3 atten); -vec3 scaleFragSoftClip(vec3 l); +vec3 scaleSoftClipFrag(vec3 l); vec3 atmosFragAffectDirectionalLight(float intensity, vec3 sunlit); void calcFragAtmospherics(vec3 inPositionEye, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, out vec3 atten); @@ -455,7 +455,7 @@ void main() //col = mix(scaleSoftClip(col), fullbrightScaleSoftClip(col), diffuse.a); col = atmosFragLighting(col, additive, atten); - col = scaleFragSoftClip(col); + col = scaleSoftClipFrag(col); //convert to linear space before adding local lights col = srgb_to_linear(col); diff --git a/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl b/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl index 976e5066dc..7f874e0ccf 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/transportF.glsl @@ -32,7 +32,7 @@ vec3 getAtmosAttenuation(); uniform int no_atmo; -vec3 atmosFragTransport(vec3 light, vec3 atten, vec3 additive) { +vec3 atmosTransportFrag(vec3 light, vec3 additive, vec3 atten) { if (no_atmo == 0) { light *= atten.r; @@ -41,32 +41,32 @@ vec3 atmosFragTransport(vec3 light, vec3 atten, vec3 additive) { return light; } -vec3 fullbrightFragAtmosTransport(vec3 light, vec3 atten, vec3 additive) { +vec3 fullbrightAtmosTransportFrag(vec3 light, vec3 additive, vec3 atten) { if (no_atmo == 1) { return light; } float brightness = dot(light.rgb, vec3(0.33333)); - return mix(atmosFragTransport(light.rgb, atten, additive), light.rgb + additive.rgb, brightness * brightness); + return mix(atmosTransportFrag(light.rgb, additive, atten), light.rgb + additive.rgb, brightness * brightness); } -vec3 fullbrightFragShinyAtmosTransport(vec3 light, vec3 atten, vec3 additive) { +vec3 fullbrightShinyAtmosTransportFrag(vec3 light, vec3 additive, vec3 atten) { if (no_atmo == 1) { return light; } float brightness = dot(light.rgb, vec3(0.33333)); - return mix(atmosFragTransport(light.rgb, atten, additive), (light.rgb + additive.rgb) * (2.0 - brightness), brightness * brightness); + return mix(atmosTransportFrag(light.rgb, additive, atten), (light.rgb + additive.rgb) * (2.0 - brightness), brightness * brightness); } vec3 atmosTransport(vec3 light) { - return (no_atmo == 1) ? light : atmosFragTransport(light, getAtmosAttenuation(), getAdditiveColor()); + return (no_atmo == 1) ? light : atmosTransportFrag(light, getAtmosAttenuation(), getAdditiveColor()); } vec3 fullbrightAtmosTransport(vec3 light) { - return (no_atmo == 1) ? light : fullbrightFragAtmosTransport(light, getAtmosAttenuation(), getAdditiveColor()); + return (no_atmo == 1) ? light : fullbrightAtmosTransportFrag(light, getAtmosAttenuation(), getAdditiveColor()); } vec3 fullbrightShinyAtmosTransport(vec3 light) { - return (no_atmo == 1) ? light : fullbrightFragShinyAtmosTransport(light, getAtmosAttenuation(), getAdditiveColor()); + return (no_atmo == 1) ? light : fullbrightShinyAtmosTransportFrag(light, getAtmosAttenuation(), getAdditiveColor()); } diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index 2696ad4df5..3925f37703 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -695,7 +695,7 @@ LLSettingsSky::parammapping_t LLSettingsVOSky::getParameterMap() const param_map[SETTING_DISTANCE_MULTIPLIER] = DefaultParam(LLShaderMgr::DISTANCE_MULTIPLIER, LLSD(0.8f)); // Following values are always present, so we can just zero these ones, but used values from defaults() - LLSD& sky_defaults = LLSettingsSky::defaults(); + LLSD sky_defaults = LLSettingsSky::defaults(); param_map[SETTING_CLOUD_COLOR] = DefaultParam(LLShaderMgr::CLOUD_COLOR, sky_defaults[SETTING_CLOUD_COLOR]); param_map[SETTING_CLOUD_POS_DENSITY2] = DefaultParam(LLShaderMgr::CLOUD_POS_DENSITY2, sky_defaults[SETTING_CLOUD_POS_DENSITY2]); param_map[SETTING_CLOUD_SCALE] = DefaultParam(LLShaderMgr::CLOUD_SCALE, sky_defaults[SETTING_CLOUD_SCALE]); @@ -916,7 +916,7 @@ LLSettingsWater::parammapping_t LLSettingsVOWater::getParameterMap() const if (param_map.empty()) { - LLSD &water_defaults = LLSettingsWater::defaults(); + LLSD water_defaults = LLSettingsWater::defaults(); param_map[SETTING_FOG_COLOR] = DefaultParam(LLShaderMgr::WATER_FOGCOLOR, water_defaults[SETTING_FOG_COLOR]); param_map[SETTING_FOG_DENSITY] = DefaultParam(LLShaderMgr::WATER_FOGDENSITY, water_defaults[SETTING_FOG_DENSITY]); } |