Skip to content
Snippets Groups Projects
Commit cf5ff54a authored by Xiaohong Bao's avatar Xiaohong Bao
Browse files
parents 36a05ebd f8f0fa04
Branches
Tags
No related merge requests found
...@@ -60,13 +60,24 @@ LLDrawPoolWLSky::LLDrawPoolWLSky(void) : ...@@ -60,13 +60,24 @@ LLDrawPoolWLSky::LLDrawPoolWLSky(void) :
llerrs << "Error: Failed to load cloud noise image " << cloudNoiseFilename << llendl; llerrs << "Error: Failed to load cloud noise image " << cloudNoiseFilename << llendl;
} }
cloudNoiseFile->load(cloudNoiseFilename); if(cloudNoiseFile->load(cloudNoiseFilename))
{
sCloudNoiseRawImage = new LLImageRaw(); sCloudNoiseRawImage = new LLImageRaw();
cloudNoiseFile->decode(sCloudNoiseRawImage, 0.0f); if(cloudNoiseFile->decode(sCloudNoiseRawImage, 0.0f))
{
//debug use
llinfos << "cloud noise raw image width: " << sCloudNoiseRawImage->getWidth() << " : height: " << sCloudNoiseRawImage->getHeight() << " : components: " <<
(S32)sCloudNoiseRawImage->getComponents() << " : data size: " << sCloudNoiseRawImage->getDataSize() << llendl ;
llassert_always(sCloudNoiseRawImage->getData()) ;
sCloudNoiseTexture = LLViewerTextureManager::getLocalTexture(sCloudNoiseRawImage.get(), TRUE); sCloudNoiseTexture = LLViewerTextureManager::getLocalTexture(sCloudNoiseRawImage.get(), TRUE);
}
else
{
sCloudNoiseRawImage = NULL ;
}
}
LLWLParamManager::instance()->propagateParameters(); LLWLParamManager::instance()->propagateParameters();
} }
...@@ -201,7 +212,7 @@ void LLDrawPoolWLSky::renderStars(void) const ...@@ -201,7 +212,7 @@ void LLDrawPoolWLSky::renderStars(void) const
void LLDrawPoolWLSky::renderSkyClouds(F32 camHeightLocal) const void LLDrawPoolWLSky::renderSkyClouds(F32 camHeightLocal) const
{ {
if (gPipeline.canUseWindLightShaders() && gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS)) if (gPipeline.canUseWindLightShaders() && gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS) && sCloudNoiseTexture.notNull())
{ {
LLGLEnable blend(GL_BLEND); LLGLEnable blend(GL_BLEND);
gGL.setSceneBlendType(LLRender::BT_ALPHA); gGL.setSceneBlendType(LLRender::BT_ALPHA);
...@@ -372,6 +383,9 @@ void LLDrawPoolWLSky::cleanupGL() ...@@ -372,6 +383,9 @@ void LLDrawPoolWLSky::cleanupGL()
//static //static
void LLDrawPoolWLSky::restoreGL() void LLDrawPoolWLSky::restoreGL()
{
if(sCloudNoiseRawImage.notNull())
{ {
sCloudNoiseTexture = LLViewerTextureManager::getLocalTexture(sCloudNoiseRawImage.get(), TRUE); sCloudNoiseTexture = LLViewerTextureManager::getLocalTexture(sCloudNoiseRawImage.get(), TRUE);
} }
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment