Просмотр исходного кода

Bugfix: Resolving issues with multiple refl. probes in scene

BearishSun 8 лет назад
Родитель
Сommit
d7003fe6f6
2 измененных файлов с 6 добавлено и 6 удалено
  1. 5 5
      Source/BansheeCore/Image/BsTexture.cpp
  2. 1 1
      Source/RenderBeast/BsRendererScene.cpp

+ 5 - 5
Source/BansheeCore/Image/BsTexture.cpp

@@ -420,21 +420,21 @@ namespace bs
 			return;
 		}
 
-		if (target->mProperties.getNumSamples() > 0 && mProperties.getNumSamples() != target->mProperties.getNumSamples())
+		if (target->mProperties.getNumSamples() > 1 && mProperties.getNumSamples() != target->mProperties.getNumSamples())
 		{
 			LOGERR("When copying to a multisampled texture, source texture must have the same number of samples.");
 			return;
 		}
 
-		if (desc.dstFace >= mProperties.getNumFaces())
+		if (desc.srcFace >= mProperties.getNumFaces())
 		{
-			LOGERR("Invalid destination face index.");
+			LOGERR("Invalid source face index.");
 			return;
 		}
 
-		if (desc.srcFace >= target->mProperties.getNumFaces())
+		if (desc.dstFace >= target->mProperties.getNumFaces())
 		{
-			LOGERR("Invalid source face index.");
+			LOGERR("Invalid destination face index.");
 			return;
 		}
 

+ 1 - 1
Source/RenderBeast/BsRendererScene.cpp

@@ -459,7 +459,7 @@ namespace bs {	namespace ct
 			std::swap(mInfo.reflProbes[probeId], mInfo.reflProbes[lastProbeId]);
 			std::swap(mInfo.reflProbeWorldBounds[probeId], mInfo.reflProbeWorldBounds[lastProbeId]);
 
-			probe->setRendererId(probeId);
+			lastProbe->setRendererId(probeId);
 		}
 
 		// Last element is the one we want to erase