diff options
| -rw-r--r-- | autobuild.xml | 16 | ||||
| -rw-r--r-- | indra/llrender/llatmosphere.cpp | 47 | ||||
| -rw-r--r-- | indra/llrender/llatmosphere.h | 4 | ||||
| -rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/starsF.glsl | 2 | ||||
| -rw-r--r-- | indra/newview/app_settings/shaders/class3/deferred/skyF.glsl | 8 | ||||
| -rw-r--r-- | indra/newview/llvosky.cpp | 8 | 
6 files changed, 65 insertions, 20 deletions
| diff --git a/autobuild.xml b/autobuild.xml index a1dc500c14..570b8366b3 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -64,9 +64,9 @@            <key>archive</key>            <map>              <key>hash</key> -            <string>b701ad7c573a79e4684345c3ad1e7b9b</string> +            <string>2679e9960e5a1c14e8c6a4e8baf70040</string>              <key>url</key> -            <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/16995/112878/libatmosphere-1.0.0.100-darwin-514680.tar.bz2</string> +            <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/21515/158137/libatmosphere-1.0.0.100-darwin-517661.tar.bz2</string>            </map>            <key>name</key>            <string>darwin</string> @@ -76,9 +76,9 @@              <key>archive</key>              <map>                <key>hash</key> -              <string>df40032b237843f1a9d46d0881961341</string> +              <string>3b509a8b85a05c53fa19f5f06f0e546b</string>                <key>url</key> -              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/16994/112877/libatmosphere-1.0.0.100-darwin64-514680.tar.bz2</string>               +              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/21514/158129/libatmosphere-1.0.0.100-darwin64-517661.tar.bz2</string>                            </map>              <key>name</key>              <string>darwin64</string> @@ -88,9 +88,9 @@              <key>archive</key>              <map>                <key>hash</key> -              <string>d3727abd5d423a64231706fafdfe771a</string> +              <string>b0f7b131d0a7d8d6a6404f27f2697872</string>                <key>url</key> -              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/16996/112886/libatmosphere-1.0.0.100-windows-514680.tar.bz2</string> +              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/21517/158147/libatmosphere-1.0.0.100-windows-517661.tar.bz2</string>              </map>              <key>name</key>              <string>windows</string> @@ -100,9 +100,9 @@              <key>archive</key>              <map>                <key>hash</key> -	            <string>03789c65de3d569a980d52a6c64b39cf</string> +	            <string>a50d05abaca0ae167640171ab814a3db</string>                <key>url</key> -	            <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/16997/112892/libatmosphere-1.0.0.100-windows64-514680.tar.bz2</string>               +	            <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/21516/158140/libatmosphere-1.0.0.100-windows64-517661.tar.bz2</string>                            </map>              <key>name</key>              <string>windows64</string> diff --git a/indra/llrender/llatmosphere.cpp b/indra/llrender/llatmosphere.cpp index 644e102a15..4edfd9efe9 100644 --- a/indra/llrender/llatmosphere.cpp +++ b/indra/llrender/llatmosphere.cpp @@ -132,6 +132,46 @@ AtmosphericModelSettings::AtmosphericModelSettings(  {  } +bool AtmosphericModelSettings::operator==(const AtmosphericModelSettings& rhs) const +{ +    if (m_skyBottomRadius != rhs.m_skyBottomRadius) +    { +        return false; +    } + +    if (m_skyTopRadius != rhs.m_skyTopRadius) +    { +        return false; +    } + +    if (m_sunArcRadians != rhs.m_sunArcRadians) +    { +        return false; +    } + +    if (m_mieAnisotropy != rhs.m_mieAnisotropy) +    { +        return false; +    } + +    if (m_rayleighProfile != rhs.m_rayleighProfile) +    { +        return false; +    } + +    if (m_mieProfile != rhs.m_mieProfile) +    { +        return false; +    } + +    if (m_absorptionProfile != rhs.m_absorptionProfile) +    { +        return false; +    } + +    return true; +} +  void LLAtmosphere::initClass()  {      if (!gAtmosphere) @@ -192,9 +232,10 @@ LLAtmosphere::~LLAtmosphere()  bool LLAtmosphere::configureAtmosphericModel(AtmosphericModelSettings& settings)  { -// Advanced Atmospherics TODO -// Make this store a hash of the precomputed data -// and avoid redundant calcs for identical settings +    if ((m_model != nullptr) && (settings == m_settings)) +    { +        return true; +    }      if (m_model)      { diff --git a/indra/llrender/llatmosphere.h b/indra/llrender/llatmosphere.h index 0d62a069ac..a010803595 100644 --- a/indra/llrender/llatmosphere.h +++ b/indra/llrender/llatmosphere.h @@ -52,6 +52,8 @@ public:          F32             sunArcRadians,          F32             mieAniso); +    bool operator==(const AtmosphericModelSettings& rhs) const; +      F32             m_skyBottomRadius;      F32             m_skyTopRadius;      DensityProfile  m_rayleighProfile; @@ -107,6 +109,8 @@ protected:      std::vector<double> m_mie_extinction;      std::vector<double> m_absorption_extinction;      std::vector<double> m_ground_albedo; + +    AtmosphericModelSettings m_settings;  };  extern LLAtmosphere* gAtmosphere; diff --git a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl index d6a1edbf42..d7f655709c 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl @@ -44,7 +44,7 @@ void main()  {  	vec4 col_a = texture2D(diffuseMap, vary_texcoord0.xy);  	vec4 col_b = texture2D(diffuseMap, vary_texcoord0.xy); -    vec4 col = mix(col_a, col_b, blend_factor); +    vec4 col = mix(col_b, col_a, blend_factor);      col.rgb *= vertex_color.rgb;      col.a *= custom_alpha;  	frag_color = col; diff --git a/indra/newview/app_settings/shaders/class3/deferred/skyF.glsl b/indra/newview/app_settings/shaders/class3/deferred/skyF.glsl index 0fb990611e..43c0505046 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/skyF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/skyF.glsl @@ -60,17 +60,17 @@ void main()      vec3 radiance_sun = GetSkyLuminance(camPos, view_direction, 0.0f, sun_direction, transmittance);      vec3 radiance2_sun = GetSunAndSkyIlluminance(camPos, view_direction, sun_direction, sky_illum); -    radiance *= transmittance; +    radiance_sun *= transmittance;      vec3 solar_luminance = transmittance * GetSolarLuminance();      // If the view ray intersects the Sun, add the Sun radiance.      if (dot(view_direction, sun_direction) >= sun_size)      { -        radiance = radiance + solar_luminance; +        radiance_sun = radiance_sun + solar_luminance;      } -    vec3 color = radiance; +    vec3 color = radiance_sun;      color = vec3(1.0) - exp(-color * 0.0001); @@ -79,7 +79,7 @@ void main()      frag_color.rgb = color;      //frag_color.rgb = vec3(dot(view_direction, sun_direction) > 0.95f ? 1.0 : 0.0, 0,0); -    frag_color.rgb = normalize(view_pos); +    //frag_color.rgb = normalize(view_pos);      frag_color.a = 1.0;  } diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index e099b410bf..1b1c167410 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -815,8 +815,8 @@ void LLVOSky::setMoonTextures(const LLUUID& moon_texture, const LLUUID& moon_tex      LLUUID moon_tex = moon_texture.isNull() ? psky->GetDefaultMoonTextureId() : moon_texture;      LLUUID moon_tex_next = moon_texture_next.isNull() ? (moon_texture.isNull() ? psky->GetDefaultMoonTextureId() : moon_texture) : moon_texture_next; -    mMoonTexturep[0] = LLViewerTextureManager::getFetchedTexture(moon_tex, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_UI); -    mMoonTexturep[1] = LLViewerTextureManager::getFetchedTexture(moon_tex_next, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_UI); +    mMoonTexturep[0] = moon_tex.isNull() ? nullptr : LLViewerTextureManager::getFetchedTexture(moon_tex, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_UI); +    mMoonTexturep[1] = moon_tex_next.isNull() ? nullptr : LLViewerTextureManager::getFetchedTexture(moon_tex_next, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_UI);      if (mFace[FACE_MOON])      { @@ -862,8 +862,8 @@ void LLVOSky::setBloomTextures(const LLUUID& bloom_texture, const LLUUID& bloom_      LLUUID bloom_tex = bloom_texture.isNull() ? psky->GetDefaultBloomTextureId() : bloom_texture;      LLUUID bloom_tex_next = bloom_texture_next.isNull() ? (bloom_texture.isNull() ? psky->GetDefaultBloomTextureId() : bloom_texture) : bloom_texture_next; -    mBloomTexturep[0] = LLViewerTextureManager::getFetchedTexture(bloom_tex, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_UI); -    mBloomTexturep[1] = LLViewerTextureManager::getFetchedTexture(bloom_tex_next, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_UI); +    mBloomTexturep[0] = bloom_tex.isNull() ? nullptr : LLViewerTextureManager::getFetchedTexture(bloom_tex, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_UI); +    mBloomTexturep[1] = bloom_tex_next.isNull() ? nullptr : LLViewerTextureManager::getFetchedTexture(bloom_tex_next, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_UI);      if (mBloomTexturep[0])      { | 
