Explorar o código

ReflectionProbes renamed to IBLUtility to better reflect its usage

BearishSun %!s(int64=8) %!d(string=hai) anos
pai
achega
905362fbfb

+ 2 - 2
Source/BansheeEngine/CMakeSources.cmake

@@ -89,7 +89,7 @@ set(BS_BANSHEEENGINE_INC_RENDERER
 	"Include/BsRendererUtility.h"
 	"Include/BsRendererUtility.h"
 	"Include/BsStandardPostProcessSettings.h"	
 	"Include/BsStandardPostProcessSettings.h"	
 	"Include/BsLightProbeCache.h"
 	"Include/BsLightProbeCache.h"
-	"Include/BsReflectionProbes.h"
+	"Include/BsIBLUtility.h"
 )
 )
 
 
 set(BS_BANSHEEENGINE_SRC_RTTI
 set(BS_BANSHEEENGINE_SRC_RTTI
@@ -178,7 +178,7 @@ set(BS_BANSHEEENGINE_SRC_RENDERER
 	"Source/BsRendererUtility.cpp"
 	"Source/BsRendererUtility.cpp"
 	"Source/BsStandardPostProcessSettings.cpp"
 	"Source/BsStandardPostProcessSettings.cpp"
 	"Source/BsLightProbeCache.cpp"
 	"Source/BsLightProbeCache.cpp"
-	"Source/BsReflectionProbes.cpp"
+	"Source/BsIBLUtility.cpp"
 )
 )
 
 
 set(BS_BANSHEEENGINE_SRC_INPUT
 set(BS_BANSHEEENGINE_SRC_INPUT

+ 3 - 3
Source/BansheeEngine/Include/BsReflectionProbes.h → Source/BansheeEngine/Include/BsIBLUtility.h

@@ -183,8 +183,8 @@ namespace bs { namespace ct
 		GpuParamBuffer mInputBuffer;
 		GpuParamBuffer mInputBuffer;
 	};
 	};
 
 
-	/** Helper class that handles generation and processing of textures used for reflection probes. */
-	class BS_EXPORT ReflectionProbes
+	/** Helper class that handles generation and processing of textures used for image based lighting. */
+	class BS_EXPORT IBLUtility
 	{
 	{
 	public:
 	public:
 		/**
 		/**
@@ -219,7 +219,7 @@ namespace bs { namespace ct
 		static void scaleCubemap(const SPtr<Texture>& src, UINT32 srcMip, const SPtr<Texture>& dst, UINT32 dstMip);
 		static void scaleCubemap(const SPtr<Texture>& src, UINT32 srcMip, const SPtr<Texture>& dst, UINT32 dstMip);
 
 
 		static const UINT32 REFLECTION_CUBEMAP_SIZE;
 		static const UINT32 REFLECTION_CUBEMAP_SIZE;
-
+		static const UINT32 IRRADIANCE_CUBEMAP_SIZE;
 	private:
 	private:
 		/** 
 		/** 
 		 * Downsamples a cubemap using hardware bilinear filtering. 
 		 * Downsamples a cubemap using hardware bilinear filtering. 

+ 7 - 6
Source/BansheeEngine/Source/BsReflectionProbes.cpp → Source/BansheeEngine/Source/BsIBLUtility.cpp

@@ -1,6 +1,6 @@
 //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
 //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
 //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
 //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#include "BsReflectionProbes.h"
+#include "BsIBLUtility.h"
 #include "BsTexture.h"
 #include "BsTexture.h"
 #include "BsGpuParamsSet.h"
 #include "BsGpuParamsSet.h"
 #include "BsRendererUtility.h"
 #include "BsRendererUtility.h"
@@ -226,9 +226,10 @@ namespace bs { namespace ct
 		gRendererUtility().drawScreenQuad();
 		gRendererUtility().drawScreenQuad();
 	}
 	}
 
 
-	const UINT32 ReflectionProbes::REFLECTION_CUBEMAP_SIZE = 256;
+	const UINT32 IBLUtility::REFLECTION_CUBEMAP_SIZE = 256;
+	const UINT32 IBLUtility::IRRADIANCE_CUBEMAP_SIZE = 32;
 
 
-	void ReflectionProbes::filterCubemapForSpecular(const SPtr<Texture>& cubemap, const SPtr<Texture>& scratch)
+	void IBLUtility::filterCubemapForSpecular(const SPtr<Texture>& cubemap, const SPtr<Texture>& scratch)
 	{
 	{
 		static ReflectionCubeDownsampleMat downsampleMat;
 		static ReflectionCubeDownsampleMat downsampleMat;
 		static ReflectionCubeImportanceSampleMat importanceSampleMat;
 		static ReflectionCubeImportanceSampleMat importanceSampleMat;
@@ -292,7 +293,7 @@ namespace bs { namespace ct
 		rapi.setRenderTarget(nullptr);
 		rapi.setRenderTarget(nullptr);
 	}
 	}
 
 
-	void ReflectionProbes::filterCubemapForIrradiance(const SPtr<Texture>& cubemap, const SPtr<Texture>& output)
+	void IBLUtility::filterCubemapForIrradiance(const SPtr<Texture>& cubemap, const SPtr<Texture>& output)
 	{
 	{
 		static IrradianceComputeSHMat shCompute;
 		static IrradianceComputeSHMat shCompute;
 		static IrradianceReduceSHMat shReduce;
 		static IrradianceReduceSHMat shReduce;
@@ -319,7 +320,7 @@ namespace bs { namespace ct
 		}
 		}
 	}
 	}
 
 
-	void ReflectionProbes::scaleCubemap(const SPtr<Texture>& src, UINT32 srcMip, const SPtr<Texture>& dst, UINT32 dstMip)
+	void IBLUtility::scaleCubemap(const SPtr<Texture>& src, UINT32 srcMip, const SPtr<Texture>& dst, UINT32 dstMip)
 	{
 	{
 		static ReflectionCubeDownsampleMat downsampleMat;
 		static ReflectionCubeDownsampleMat downsampleMat;
 
 
@@ -366,7 +367,7 @@ namespace bs { namespace ct
 			downsampleCubemap(src, srcMip, dst, dstMip);
 			downsampleCubemap(src, srcMip, dst, dstMip);
 	}
 	}
 
 
-	void ReflectionProbes::downsampleCubemap(const SPtr<Texture>& src, UINT32 srcMip, const SPtr<Texture>& dst, UINT32 dstMip)
+	void IBLUtility::downsampleCubemap(const SPtr<Texture>& src, UINT32 srcMip, const SPtr<Texture>& dst, UINT32 dstMip)
 	{
 	{
 		static ReflectionCubeDownsampleMat downsampleMat;
 		static ReflectionCubeDownsampleMat downsampleMat;
 
 

+ 0 - 271
Source/BansheeEngine/Source/BsReflectionCubemapCache.cpp

@@ -1,271 +0,0 @@
-//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
-//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
-#include "BsLightProbeCache.h"
-#include "BsFileSystem.h"
-#include "BsIReflectable.h"
-#include "BsRTTIType.h"
-#include "BsFileSerializer.h"
-
-namespace bs { namespace ct
-{
-	struct CachedTextureData : IReflectable
-	{
-		TextureType type;
-		UINT32 numFaces;
-		UINT32 numMips;
-		Vector<SPtr<PixelData>> pixelData;
-
-		/************************************************************************/
-		/* 								RTTI		                     		*/
-		/************************************************************************/
-	public:
-		friend class CachedTextureDataRTTI;
-		static RTTITypeBase* getRTTIStatic();
-		RTTITypeBase* getRTTI() const override;
-	};
-
-	class CachedTextureDataRTTI : public RTTIType <CachedTextureData, IReflectable, CachedTextureDataRTTI>
-	{
-	private:
-		BS_BEGIN_RTTI_MEMBERS
-			BS_RTTI_MEMBER_PLAIN(type, 0)
-			BS_RTTI_MEMBER_PLAIN(numFaces, 1)
-			BS_RTTI_MEMBER_PLAIN(numMips, 2)
-			BS_RTTI_MEMBER_REFLPTR_ARRAY(pixelData, 3)
-		BS_END_RTTI_MEMBERS
-	public:
-		CachedTextureDataRTTI()
-			:mInitMembers(this)
-		{ }
-
-		const String& getRTTIName() override
-		{
-			static String name = "CachedTextureData";
-			return name;
-		}
-
-		UINT32 getRTTIId() override
-		{
-			return TID_CachedTextureData;
-		}
-
-		SPtr<IReflectable> newRTTIObject() override
-		{
-			return bs_shared_ptr_new<CachedTextureData>();
-		}
-	};
-
-	RTTITypeBase* CachedTextureData::getRTTIStatic()
-	{
-		return CachedTextureDataRTTI::instance();
-	}
-
-	RTTITypeBase* CachedTextureData::getRTTI() const
-	{
-		return getRTTIStatic();
-	}
-
-	LightProbeCache::~LightProbeCache()
-	{
-		for (auto& entry : mProbeInfos)
-		{
-			if(entry.second.radiance.needsSaving || entry.second.irradiance.needsSaving)
-			{
-				LOGWRN("Shutting down reflection cubemap cache manager but not all textures were saved on disk before "
-					   "shutdown.");
-				break;
-			}
-		}
-	}
-
-	void LightProbeCache::initCache(const Path& path)
-	{
-		mDataPath = path;
-
-		auto visitFile = [&](const Path& filePath) -> bool
-		{
-			String uuid = filePath.getFilename(false);
-			mProbeInfos.insert(std::make_pair(uuid, ProbeInfo()));
-
-			return true;
-		};
-
-		FileSystem::iterate(path, visitFile, nullptr, false);
-	}
-
-	void LightProbeCache::notifyDirty(const String& uuid)
-	{
-		auto iterFind = mProbeInfos.find(uuid);
-		if (iterFind != mProbeInfos.end())
-		{
-			iterFind->second.radiance.dirty = true;
-			iterFind->second.irradiance.dirty = true;
-		}
-	}
-
-	bool LightProbeCache::isRadianceDirty(const String& uuid) const
-	{
-		auto iterFind = mProbeInfos.find(uuid);
-		if (iterFind != mProbeInfos.end())
-			return iterFind->second.radiance.dirty;
-
-		return true;
-	}
-
-	bool LightProbeCache::isIrradianceDirty(const String& uuid) const
-	{
-		auto iterFind = mProbeInfos.find(uuid);
-		if (iterFind != mProbeInfos.end())
-			return iterFind->second.irradiance.dirty;
-
-		return true;
-	}
-
-	void LightProbeCache::setCachedRadianceTexture(const String& uuid, const SPtr<Texture>& texture)
-	{
-		ProbeInfo& probeInfo = mProbeInfos[uuid];
-		TextureInfo& texInfo = probeInfo.radiance;
-		texInfo.texture = texture;
-		texInfo.needsSaving = true;
-		texInfo.dirty = false;
-	}
-
-	void LightProbeCache::setCachedIrradianceTexture(const String& uuid, const SPtr<Texture>& texture)
-	{
-		ProbeInfo& probeInfo = mProbeInfos[uuid];
-		TextureInfo& texInfo = probeInfo.irradiance;
-		texInfo.texture = texture;
-		texInfo.needsSaving = true;
-		texInfo.dirty = false;
-	}
-
-	SPtr<Texture> LightProbeCache::getCachedRadianceTexture(const String& uuid) const
-	{
-		auto iterFind = mProbeInfos.find(uuid);
-		if (iterFind == mProbeInfos.end())
-			return nullptr;
-
-		TextureInfo& texInfo = iterFind->second.radiance;
-		if (texInfo.texture != nullptr)
-			return texInfo.texture;
-
-		Path filePath = mDataPath + "R_" + uuid + ".asset";
-		texInfo.texture = loadCachedTexture(filePath);
-		
-		return texInfo.texture;
-	}
-
-	SPtr<Texture> LightProbeCache::getCachedIrradianceTexture(const String& uuid) const
-	{
-		auto iterFind = mProbeInfos.find(uuid);
-		if (iterFind == mProbeInfos.end())
-			return nullptr;
-
-		TextureInfo& texInfo = iterFind->second.irradiance;
-		if (texInfo.texture != nullptr)
-			return texInfo.texture;
-
-		Path filePath = mDataPath + "IRR_" + uuid + ".asset";
-		texInfo.texture = loadCachedTexture(filePath);
-
-		return texInfo.texture;
-	}
-
-	void LightProbeCache::unloadCachedTexture(const String& uuid)
-	{
-		auto iterFind = mProbeInfos.find(uuid);
-		if (iterFind != mProbeInfos.end())
-		{
-			// Not allowed to unload if it requires saving (should only happen during development time)
-			if (!iterFind->second.radiance.needsSaving)
-				iterFind->second.radiance.texture = nullptr;
-
-			if (!iterFind->second.irradiance.needsSaving)
-				iterFind->second.irradiance.texture = nullptr;
-		}
-	}
-
-	void LightProbeCache::saveCache(const Path& path)
-	{
-		for(auto& entry : mProbeInfos)
-		{
-			ProbeInfo& probeInfo = entry.second;
-
-			Path radiancePath = path + "R_" + entry.first + ".asset";
-			saveCachedTexture(probeInfo.radiance, radiancePath);
-			probeInfo.radiance.needsSaving = false;
-
-			Path irradiancePath = path + "IRRR_" + entry.first + ".asset";
-			saveCachedTexture(probeInfo.irradiance, irradiancePath);
-			probeInfo.irradiance.needsSaving = false;
-		}
-	}
-
-	SPtr<Texture> LightProbeCache::loadCachedTexture(const Path& path) const
-	{
-		if (!FileSystem::exists(path))
-			return nullptr;
-
-		FileDecoder fd(path);
-		SPtr<CachedTextureData> textureData = std::static_pointer_cast<CachedTextureData>(fd.decode());
-
-		if (textureData == nullptr || textureData->pixelData.size() == 0 || textureData->pixelData[0] == nullptr)
-			return nullptr;
-
-		TEXTURE_DESC desc;
-		desc.type = textureData->type;
-		desc.format = textureData->pixelData[0]->getFormat();
-		desc.width = textureData->pixelData[0]->getWidth();
-		desc.height = textureData->pixelData[0]->getHeight();
-		desc.depth = textureData->pixelData[0]->getDepth();
-
-		if (desc.type == TEX_TYPE_CUBE_MAP)
-			desc.numArraySlices = textureData->numFaces / 6;
-		else
-			desc.numArraySlices = textureData->numFaces;
-
-		desc.numMips = textureData->numMips;
-
-		SPtr<Texture> texture = Texture::create(desc);
-		for (UINT32 face = 0; face < textureData->numFaces; face++)
-		{
-			for (UINT32 mip = 0; mip < textureData->numMips; mip++)
-			{
-				UINT32 srcIdx = face * textureData->numMips + mip;
-				if (srcIdx >= textureData->pixelData.size())
-					continue;
-
-				texture->writeData(*textureData->pixelData[srcIdx], mip, face, true);
-			}
-		}
-
-		return texture;
-	}
-
-	void LightProbeCache::saveCachedTexture(const TextureInfo& texInfo, const Path& path)
-	{
-		if (!texInfo.needsSaving)
-			return;
-
-		auto& texProps = texInfo.texture->getProperties();
-
-		SPtr<CachedTextureData> textureData = bs_shared_ptr_new<CachedTextureData>();
-		textureData->type = texProps.getTextureType();
-		textureData->numFaces = texProps.getNumFaces();
-		textureData->numMips = texProps.getNumMipmaps() + 1;
-
-		for (UINT32 face = 0; face < textureData->numFaces; face++)
-		{
-			for (UINT32 mip = 0; mip < textureData->numMips; mip++)
-			{
-				SPtr<PixelData> pixelData = texProps.allocBuffer(face, mip);
-				texInfo.texture->readData(*pixelData, mip, face);
-
-				textureData->pixelData.push_back(pixelData);
-			}
-		}
-;
-		FileEncoder fe(path);
-		fe.encode(textureData.get());
-	}
-}}

+ 0 - 1
Source/BansheeFreeImgImporter/Source/BsFreeImgImporter.cpp

@@ -16,7 +16,6 @@
 #include "FreeImage.h"
 #include "FreeImage.h"
 #include "BsBitwise.h"
 #include "BsBitwise.h"
 #include "BsRenderer.h"
 #include "BsRenderer.h"
-#include "BsReflectionProbes.h"
 
 
 using namespace std::placeholders;
 using namespace std::placeholders;
 
 

+ 2 - 2
Source/RenderBeast/Include/BsRenderBeast.h

@@ -212,8 +212,8 @@ namespace bs
 		/**	Destroys data used by the renderer on the core thread. */
 		/**	Destroys data used by the renderer on the core thread. */
 		void destroyCore();
 		void destroyCore();
 
 
-		/** Updates reflection probes, rendering ones that are dirty and updating the global probe cubemap array. */
-		void updateReflectionProbes(const FrameInfo& frameInfo);
+		/** Updates light probes, rendering & filtering ones that are dirty and updating the global probe cubemap array. */
+		void updateLightProbes(const FrameInfo& frameInfo);
 
 
 		/**
 		/**
 		 * Checks all sampler overrides in case material sampler states changed, and updates them.
 		 * Checks all sampler overrides in case material sampler states changed, and updates them.

+ 17 - 17
Source/RenderBeast/Source/BsRenderBeast.cpp

@@ -33,7 +33,7 @@
 #include "BsRendererExtension.h"
 #include "BsRendererExtension.h"
 #include "BsLightProbeCache.h"
 #include "BsLightProbeCache.h"
 #include "BsReflectionProbe.h"
 #include "BsReflectionProbe.h"
-#include "BsReflectionProbes.h"
+#include "BsIBLUtility.h"
 #include "BsMeshData.h"
 #include "BsMeshData.h"
 #include "BsLightGrid.h"
 #include "BsLightGrid.h"
 #include "BsSkybox.h"
 #include "BsSkybox.h"
@@ -803,7 +803,7 @@ namespace bs { namespace ct
 		FrameInfo frameInfo(delta, animData);
 		FrameInfo frameInfo(delta, animData);
 
 
 		// Update reflection probes
 		// Update reflection probes
-		updateReflectionProbes(frameInfo);
+		updateLightProbes(frameInfo);
 
 
 		// Gather all views
 		// Gather all views
 		Vector<RendererCamera*> views;
 		Vector<RendererCamera*> views;
@@ -1222,7 +1222,7 @@ namespace bs { namespace ct
 				element.morphVertexDeclaration);
 				element.morphVertexDeclaration);
 	}
 	}
 
 
-	void RenderBeast::updateReflectionProbes(const FrameInfo& frameInfo)
+	void RenderBeast::updateLightProbes(const FrameInfo& frameInfo)
 	{
 	{
 		UINT32 numProbes = (UINT32)mReflProbes.size();
 		UINT32 numProbes = (UINT32)mReflProbes.size();
 
 
@@ -1239,8 +1239,8 @@ namespace bs { namespace ct
 				TEXTURE_DESC cubeMapDesc;
 				TEXTURE_DESC cubeMapDesc;
 				cubeMapDesc.type = TEX_TYPE_CUBE_MAP;
 				cubeMapDesc.type = TEX_TYPE_CUBE_MAP;
 				cubeMapDesc.format = PF_FLOAT_R11G11B10;
 				cubeMapDesc.format = PF_FLOAT_R11G11B10;
-				cubeMapDesc.width = ReflectionProbes::REFLECTION_CUBEMAP_SIZE;
-				cubeMapDesc.height = ReflectionProbes::REFLECTION_CUBEMAP_SIZE;
+				cubeMapDesc.width = IBLUtility::REFLECTION_CUBEMAP_SIZE;
+				cubeMapDesc.height = IBLUtility::REFLECTION_CUBEMAP_SIZE;
 				cubeMapDesc.numMips = PixelUtil::getMaxMipmaps(cubeMapDesc.width, cubeMapDesc.height, 1, cubeMapDesc.format);
 				cubeMapDesc.numMips = PixelUtil::getMaxMipmaps(cubeMapDesc.width, cubeMapDesc.height, 1, cubeMapDesc.format);
 				cubeMapDesc.numArraySlices = std::min(MaxReflectionCubemaps, numProbes + 4); // Keep a few empty entries
 				cubeMapDesc.numArraySlices = std::min(MaxReflectionCubemaps, numProbes + 4); // Keep a few empty entries
 
 
@@ -1254,8 +1254,8 @@ namespace bs { namespace ct
 			TEXTURE_DESC cubemapDesc;
 			TEXTURE_DESC cubemapDesc;
 			cubemapDesc.type = TEX_TYPE_CUBE_MAP;
 			cubemapDesc.type = TEX_TYPE_CUBE_MAP;
 			cubemapDesc.format = PF_FLOAT_R11G11B10;
 			cubemapDesc.format = PF_FLOAT_R11G11B10;
-			cubemapDesc.width = ReflectionProbes::REFLECTION_CUBEMAP_SIZE;
-			cubemapDesc.height = ReflectionProbes::REFLECTION_CUBEMAP_SIZE;
+			cubemapDesc.width = IBLUtility::REFLECTION_CUBEMAP_SIZE;
+			cubemapDesc.height = IBLUtility::REFLECTION_CUBEMAP_SIZE;
 			cubemapDesc.numMips = PixelUtil::getMaxMipmaps(cubemapDesc.width, cubemapDesc.height, 1, cubemapDesc.format);
 			cubemapDesc.numMips = PixelUtil::getMaxMipmaps(cubemapDesc.width, cubemapDesc.height, 1, cubemapDesc.format);
 			cubemapDesc.usage = TU_STATIC | TU_RENDERTARGET;
 			cubemapDesc.usage = TU_STATIC | TU_RENDERTARGET;
 
 
@@ -1287,10 +1287,10 @@ namespace bs { namespace ct
 						else
 						else
 						{
 						{
 							SPtr<Texture> customTexture = probeInfo.probe->getCustomTexture();
 							SPtr<Texture> customTexture = probeInfo.probe->getCustomTexture();
-							ReflectionProbes::scaleCubemap(customTexture, 0, probeInfo.texture, 0);
+							IBLUtility::scaleCubemap(customTexture, 0, probeInfo.texture, 0);
 						}
 						}
 
 
-						ReflectionProbes::filterCubemapForSpecular(probeInfo.texture, scratchCubemap);
+						IBLUtility::filterCubemapForSpecular(probeInfo.texture, scratchCubemap);
 						LightProbeCache::instance().setCachedRadianceTexture(probeInfo.probe->getUUID(), probeInfo.texture);
 						LightProbeCache::instance().setCachedRadianceTexture(probeInfo.probe->getUUID(), probeInfo.texture);
 					}
 					}
 				}
 				}
@@ -1300,8 +1300,8 @@ namespace bs { namespace ct
 				if(probeInfo.probe->getType() != ReflectionProbeType::Plane && (probeInfo.arrayDirty || forceArrayUpdate))
 				if(probeInfo.probe->getType() != ReflectionProbeType::Plane && (probeInfo.arrayDirty || forceArrayUpdate))
 				{
 				{
 					auto& srcProps = probeInfo.texture->getProperties();
 					auto& srcProps = probeInfo.texture->getProperties();
-					bool isValid = srcProps.getWidth() == ReflectionProbes::REFLECTION_CUBEMAP_SIZE && 
-						srcProps.getHeight() == ReflectionProbes::REFLECTION_CUBEMAP_SIZE &&
+					bool isValid = srcProps.getWidth() == IBLUtility::REFLECTION_CUBEMAP_SIZE && 
+						srcProps.getHeight() == IBLUtility::REFLECTION_CUBEMAP_SIZE &&
 						srcProps.getNumMipmaps() == cubemapArrayProps.getNumMipmaps() &&
 						srcProps.getNumMipmaps() == cubemapArrayProps.getNumMipmaps() &&
 						srcProps.getTextureType() == TEX_TYPE_CUBE_MAP;
 						srcProps.getTextureType() == TEX_TYPE_CUBE_MAP;
 
 
@@ -1311,7 +1311,7 @@ namespace bs { namespace ct
 						{
 						{
 							String errMsg = StringUtil::format("Cubemap texture invalid to use as a reflection cubemap. " 
 							String errMsg = StringUtil::format("Cubemap texture invalid to use as a reflection cubemap. " 
 								"Check texture size (must be {0}x{0}) and mip-map count", 
 								"Check texture size (must be {0}x{0}) and mip-map count", 
-								ReflectionProbes::REFLECTION_CUBEMAP_SIZE);
+								IBLUtility::REFLECTION_CUBEMAP_SIZE);
 
 
 							LOGERR(errMsg);
 							LOGERR(errMsg);
 							probeInfo.errorFlagged = true;
 							probeInfo.errorFlagged = true;
@@ -1342,8 +1342,8 @@ namespace bs { namespace ct
 					{
 					{
 						mSkyboxFilteredReflections = Texture::create(cubemapDesc);
 						mSkyboxFilteredReflections = Texture::create(cubemapDesc);
 
 
-						ReflectionProbes::scaleCubemap(mSkyboxTexture, 0, mSkyboxFilteredReflections, 0);
-						ReflectionProbes::filterCubemapForSpecular(mSkyboxFilteredReflections, scratchCubemap);
+						IBLUtility::scaleCubemap(mSkyboxTexture, 0, mSkyboxFilteredReflections, 0);
+						IBLUtility::filterCubemapForSpecular(mSkyboxFilteredReflections, scratchCubemap);
 						LightProbeCache::instance().setCachedRadianceTexture(mSkybox->getUUID(), mSkyboxFilteredReflections);
 						LightProbeCache::instance().setCachedRadianceTexture(mSkybox->getUUID(), mSkyboxFilteredReflections);
 					}
 					}
 				}
 				}
@@ -1357,14 +1357,14 @@ namespace bs { namespace ct
 						TEXTURE_DESC irradianceCubemapDesc;
 						TEXTURE_DESC irradianceCubemapDesc;
 						irradianceCubemapDesc.type = TEX_TYPE_CUBE_MAP;
 						irradianceCubemapDesc.type = TEX_TYPE_CUBE_MAP;
 						irradianceCubemapDesc.format = PF_FLOAT_R11G11B10;
 						irradianceCubemapDesc.format = PF_FLOAT_R11G11B10;
-						irradianceCubemapDesc.width = 32;
-						irradianceCubemapDesc.height = 32;
+						irradianceCubemapDesc.width = IBLUtility::IRRADIANCE_CUBEMAP_SIZE;
+						irradianceCubemapDesc.height = IBLUtility::IRRADIANCE_CUBEMAP_SIZE;
 						irradianceCubemapDesc.numMips = 0;
 						irradianceCubemapDesc.numMips = 0;
 						irradianceCubemapDesc.usage = TU_STATIC | TU_RENDERTARGET;
 						irradianceCubemapDesc.usage = TU_STATIC | TU_RENDERTARGET;
 
 
 						mSkyboxIrradiance = Texture::create(irradianceCubemapDesc);
 						mSkyboxIrradiance = Texture::create(irradianceCubemapDesc);
 
 
-						ReflectionProbes::filterCubemapForIrradiance(mSkyboxFilteredReflections, mSkyboxIrradiance);
+						IBLUtility::filterCubemapForIrradiance(mSkyboxFilteredReflections, mSkyboxIrradiance);
 						LightProbeCache::instance().setCachedIrradianceTexture(mSkybox->getUUID(), mSkyboxFilteredReflections);
 						LightProbeCache::instance().setCachedIrradianceTexture(mSkybox->getUUID(), mSkyboxFilteredReflections);
 					}
 					}
 				}
 				}