diff options
author | Graham Linden <graham@lindenlab.com> | 2018-06-11 22:39:57 +0100 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2018-06-11 22:39:57 +0100 |
commit | fc8d0de673da0e02915556008a365aca67472eba (patch) | |
tree | dab865b50ca106152cae92174995fb8dbe5935e1 /indra/newview/llvosky.cpp | |
parent | 0f608cb764856ae8586a9d9631842a782cb70a23 (diff) |
Make cloud rendering use textures defined in sky settings and add code to shaders to lerp between current and next cloud texture.
Diffstat (limited to 'indra/newview/llvosky.cpp')
-rw-r--r-- | indra/newview/llvosky.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index 359415b185..e8ca286074 100644 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -816,6 +816,27 @@ void LLVOSky::setMoonTextures(const LLUUID& moon_texture, const LLUUID& moon_tex } } +void LLVOSky::setCloudNoiseTextures(const LLUUID& cloud_noise_texture, const LLUUID& cloud_noise_texture_next) +{ + LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky(); + + LLUUID cloud_noise_tex = cloud_noise_texture.isNull() ? psky->GetDefaultCloudNoiseTextureId() : cloud_noise_texture; + LLUUID cloud_noise_tex_next = cloud_noise_texture_next.isNull() ? (cloud_noise_texture.isNull() ? psky->GetDefaultCloudNoiseTextureId() : cloud_noise_texture) : cloud_noise_texture_next; + + mCloudNoiseTexturep[0] = LLViewerTextureManager::getFetchedTexture(cloud_noise_tex, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_UI); + mCloudNoiseTexturep[1] = LLViewerTextureManager::getFetchedTexture(cloud_noise_tex_next, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_UI); + + if (mCloudNoiseTexturep[0]) + { + mCloudNoiseTexturep[0]->setAddressMode(LLTexUnit::TAM_WRAP); + } + + if (mCloudNoiseTexturep[1]) + { + mCloudNoiseTexturep[1]->setAddressMode(LLTexUnit::TAM_WRAP); + } +} + static LLTrace::BlockTimerStatHandle FTM_GEO_SKY("Sky Geometry"); BOOL LLVOSky::updateGeometry(LLDrawable *drawable) |