Kaynağa Gözat

Dropping support for reflection filtering on import

BearishSun 8 yıl önce
ebeveyn
işleme
602fa39878

+ 0 - 11
Source/BansheeCore/Include/BsTextureImportOptions.h

@@ -81,16 +81,6 @@ namespace bs
 		 */
 		CubemapSourceType getCubemapSourceType() const { return mCubemapSourceType; }
 
-		/**
-		 * Marks the cubemap as a reflection cubemap and perform special filtering on the cubemap mip-maps. Only relevant
-		 * when texture is imported as a cubemap. This will override texture mip levels to match the requirements
-		 * needed for reflection cubemaps.
-		 */
-		void setCubemapIsReflection(bool reflection) { mCubemapIsReflection = reflection; }
-
-		/** Checks is the specified cubemap used for reflections. See setCubemapIsReflection(). */
-		bool getCubemapIsReflection() const { return mCubemapIsReflection; }
-
 		/** Creates a new import options object that allows you to customize how are textures imported. */
 		static SPtr<TextureImportOptions> create();
 
@@ -110,7 +100,6 @@ namespace bs
 		bool mSRGB;
 		bool mCubemap;
 		CubemapSourceType mCubemapSourceType;
-		bool mCubemapIsReflection;
 	};
 
 	/** @} */

+ 0 - 1
Source/BansheeCore/Include/BsTextureImportOptionsRTTI.h

@@ -24,7 +24,6 @@ namespace bs
 			BS_RTTI_MEMBER_PLAIN(mSRGB, 4)
 			BS_RTTI_MEMBER_PLAIN(mCubemap, 5)
 			BS_RTTI_MEMBER_PLAIN(mCubemapSourceType, 6)
-			BS_RTTI_MEMBER_PLAIN(mCubemapIsReflection, 7)
 		BS_END_RTTI_MEMBERS
 
 	public:

+ 3 - 12
Source/BansheeFreeImgImporter/Source/BsFreeImgImporter.cpp

@@ -143,7 +143,6 @@ namespace bs
 		Vector<SPtr<PixelData>> faceData;
 
 		TextureType texType;
-		bool filterForReflections = false;
 		if(textureImportOptions->getIsCubemap())
 		{
 			texType = TEX_TYPE_CUBE_MAP;
@@ -152,7 +151,6 @@ namespace bs
 			if (generateCubemap(imgData, textureImportOptions->getCubemapSourceType(), cubemapFaces))
 			{
 				faceData.insert(faceData.begin(), cubemapFaces.begin(), cubemapFaces.end());
-				filterForReflections = textureImportOptions->getCubemapIsReflection();
 			}
 			else // Fall-back to 2D texture
 			{
@@ -167,13 +165,13 @@ namespace bs
 		}
 
 		UINT32 numMips = 0;
-		if ((textureImportOptions->getGenerateMipmaps() || filterForReflections) && 
+		if (textureImportOptions->getGenerateMipmaps() && 
 			Bitwise::isPow2(faceData[0]->getWidth()) && Bitwise::isPow2(faceData[0]->getHeight()))
 		{
 			UINT32 maxPossibleMip = PixelUtil::getMaxMipmaps(faceData[0]->getWidth(), faceData[0]->getHeight(), 
 				faceData[0]->getDepth(), faceData[0]->getFormat());
 
-			if (textureImportOptions->getMaxMip() == 0 || filterForReflections)
+			if (textureImportOptions->getMaxMip() == 0)
 				numMips = maxPossibleMip;
 			else
 				numMips = std::min(maxPossibleMip, textureImportOptions->getMaxMip());
@@ -200,7 +198,7 @@ namespace bs
 		for (UINT32 i = 0; i < numFaces; i++)
 		{
 			Vector<SPtr<PixelData>> mipLevels;
-			if (numMips > 0 && !filterForReflections)
+			if (numMips > 0)
 				mipLevels = PixelUtil::genMipmaps(*faceData[i], MipMapGenOptions());
 			else
 				mipLevels.push_back(faceData[i]);
@@ -216,13 +214,6 @@ namespace bs
 
 		fileData->close();
 
-		if(filterForReflections)
-		{
-			SPtr<ct::Texture> coreCubemap = newTexture->getCore();
-			gCoreThread().queueCommand(std::bind(&ct::ReflectionProbes::filterCubemapForSpecular, coreCubemap, nullptr));
-			gCoreThread().submit(true);
-		}
-
 		WString fileName = filePath.getWFilename(false);
 		newTexture->setName(fileName);
 

+ 0 - 5
Source/MBansheeEditor/Inspectors/Texture2DInspector.cs

@@ -23,7 +23,6 @@ namespace BansheeEditor
         private GUIToggleField isCubemapField = new GUIToggleField(new LocEdString("Cubemap"));
         private GUIEnumField cubemapSourceTypeField = 
             new GUIEnumField(typeof(CubemapSourceType), new LocEdString("Cubemap source"));
-        private GUIToggleField isReflectionCubemapField = new GUIToggleField(new LocEdString("Reflection cubemap"));
 
         private GUIButton reimportButton = new GUIButton(new LocEdString("Reimport"));
 
@@ -43,7 +42,6 @@ namespace BansheeEditor
                 cpuCachedField.OnChanged += x => importOptions.CPUCached = x;
                 isCubemapField.OnChanged += x => importOptions.IsCubemap = x;
                 cubemapSourceTypeField.OnSelectionChanged += x => importOptions.CubemapSourceType = (CubemapSourceType)x;
-                isReflectionCubemapField.OnChanged += x => importOptions.IsCubemapReflection = x;
                 reimportButton.OnClick += TriggerReimport;
 
                 Layout.AddElement(formatField);
@@ -53,7 +51,6 @@ namespace BansheeEditor
                 Layout.AddElement(cpuCachedField);
                 Layout.AddElement(isCubemapField);
                 Layout.AddElement(cubemapSourceTypeField);
-                Layout.AddElement(isReflectionCubemapField);
                 Layout.AddSpace(10);
 
                 GUILayout reimportButtonLayout = Layout.AddLayoutX();
@@ -74,10 +71,8 @@ namespace BansheeEditor
             cpuCachedField.Value = newImportOptions.CPUCached;
             isCubemapField.Value = newImportOptions.IsCubemap;
             cubemapSourceTypeField.Value = (ulong) newImportOptions.CubemapSourceType;
-            isReflectionCubemapField.Value = newImportOptions.IsCubemapReflection;
 
             cubemapSourceTypeField.Active = importOptions.IsCubemap;
-            isReflectionCubemapField.Active = importOptions.IsCubemap;
 
             importOptions = newImportOptions;
 

+ 0 - 17
Source/MBansheeEditor/Windows/Library/ImportOptions.cs

@@ -124,17 +124,6 @@ namespace BansheeEditor
             set { Internal_SetCubemapSourceType(mCachedPtr, value); }
         }
 
-        /// <summary>
-        /// If true makrs the cubemap as a reflection cubemap and perform special filtering on the cubemap mip-maps. Only
-        /// relevant when texture is imported as a cubemap. This will override texture mip levels to match the requirements
-        /// needed for reflection cubemaps.
-        /// </summary>
-        public bool IsCubemapReflection
-        {
-            get { return Internal_GetIsCubemapReflection(mCachedPtr); }
-            set { Internal_SetIsCubemapReflection(mCachedPtr, value); }
-        }
-
         [MethodImpl(MethodImplOptions.InternalCall)]
         private static extern void Internal_CreateInstance(TextureImportOptions instance);
 
@@ -179,12 +168,6 @@ namespace BansheeEditor
 
         [MethodImpl(MethodImplOptions.InternalCall)]
         private static extern void Internal_SetCubemapSourceType(IntPtr thisPtr, CubemapSourceType value);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern bool Internal_GetIsCubemapReflection(IntPtr thisPtr);
-
-        [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetIsCubemapReflection(IntPtr thisPtr, bool value);
     }
 
     /// <summary>

+ 0 - 2
Source/SBansheeEditor/Include/BsScriptImportOptions.h

@@ -80,8 +80,6 @@ namespace bs
 		static void internal_SetIsCubemap(ScriptTextureImportOptions* thisPtr, bool value);
 		static CubemapSourceType internal_GetCubemapSourceType(ScriptTextureImportOptions* thisPtr);
 		static void internal_SetCubemapSourceType(ScriptTextureImportOptions* thisPtr, CubemapSourceType value);
-		static bool internal_GetIsCubemapReflection(ScriptTextureImportOptions* thisPtr);
-		static void internal_SetIsCubemapReflection(ScriptTextureImportOptions* thisPtr, bool value);
 	};
 
 	/**	Interop class between C++ & CLR for MeshImportOptions. */

+ 0 - 12
Source/SBansheeEditor/Source/BsScriptImportOptions.cpp

@@ -85,8 +85,6 @@ namespace bs
 		metaData.scriptClass->addInternalCall("Internal_SetIsCubemap", &ScriptTextureImportOptions::internal_SetIsCubemap);
 		metaData.scriptClass->addInternalCall("Internal_GetCubemapSourceType", &ScriptTextureImportOptions::internal_GetCubemapSourceType);
 		metaData.scriptClass->addInternalCall("Internal_SetCubemapSourceType", &ScriptTextureImportOptions::internal_SetCubemapSourceType);
-		metaData.scriptClass->addInternalCall("Internal_GetIsCubemapReflection", &ScriptTextureImportOptions::internal_GetIsCubemapReflection);
-		metaData.scriptClass->addInternalCall("Internal_SetIsCubemapReflection", &ScriptTextureImportOptions::internal_SetIsCubemapReflection);
 	}
 
 	SPtr<TextureImportOptions> ScriptTextureImportOptions::getTexImportOptions()
@@ -184,16 +182,6 @@ namespace bs
 		thisPtr->getTexImportOptions()->setCubemapSourceType(value);
 	}
 
-	bool ScriptTextureImportOptions::internal_GetIsCubemapReflection(ScriptTextureImportOptions* thisPtr)
-	{
-		return thisPtr->getTexImportOptions()->getCubemapIsReflection();
-	}
-
-	void ScriptTextureImportOptions::internal_SetIsCubemapReflection(ScriptTextureImportOptions* thisPtr, bool value)
-	{
-		thisPtr->getTexImportOptions()->setCubemapIsReflection(value);
-	}
-
 	ScriptMeshImportOptions::ScriptMeshImportOptions(MonoObject* instance)
 		:ScriptObject(instance)
 	{