Browse Source

Bugfix: Fixing a flicker when irradiance volume is first created, caused by uninitialized SH coefficient data

BearishSun 8 years ago
parent
commit
2c07aa8733
1 changed files with 2 additions and 1 deletions
  1. 2 1
      Source/BansheeCore/Renderer/BsLightProbeVolume.cpp

+ 2 - 1
Source/BansheeCore/Renderer/BsLightProbeVolume.cpp

@@ -410,6 +410,8 @@ namespace bs
 		resizeCoefficientTexture(std::max(32U, numCoefficients));
 
 		SPtr<PixelData> coeffData = mCoefficients->getProperties().allocBuffer(0, 0);
+		coeffData->setColors(Color::ZERO);
+
 		UINT32 probesPerRow = coeffData->getWidth() / 9;
 		UINT32 probeIdx = 0;
 		for(UINT32 y = 0; y < coeffData->getHeight(); ++y)
@@ -664,7 +666,6 @@ namespace bs
 		desc.format = PF_RGBA32F;
 
 		SPtr<Texture> newTexture = Texture::create(desc);
-		newTexture->clear(Color::ZERO);
 
 		if (mCoefficients)
 			mCoefficients->copy(newTexture);