Przeglądaj źródła

Bumped nvtt version to 2.1.0:
- Added compression support for BC6 and BC7 formats
- Added mip map generation support for floating point formats

BearishSun 8 lat temu
rodzic
commit
acdd04d696

+ 170 - 173
Documentation/GitHub/dependencies.md

@@ -2,212 +2,209 @@
 To compile/retrieve dependencies manually follow the guides provided by each individual library. Below you will find a list of all the libraries, links to their download and outputs expected by Banshee.
 
 Rename and place the compiled/retrieved outputs into proper folders depending on their type:
-  - Static libraries (.lib, .a): 
-   - Place outputs in (BansheeSource)/Dependencies/(LibName)/lib/(Platform)
-  - Dynamic libraries (.dll, .so, .dylib)
-   - Place outputs in (BansheeSource)/bin/(Platform)/(Configuration)
-  - Includes
-   - Place outputs in (BansheeSource)/Dependencies/(LibName)/include
-  - Tools (executables)
-   - Place outputs in (BansheeSource)/Dependencies/tools/(LibName)  
+- Static libraries (.lib, .a): 
+ - Place outputs in (BansheeSource)/Dependencies/(LibName)/lib/(Platform)
+- Dynamic libraries (.dll, .so, .dylib)
+ - Place outputs in (BansheeSource)/bin/(Platform)/(Configuration)
+- Includes
+ - Place outputs in (BansheeSource)/Dependencies/(LibName)/include
+- Tools (executables)
+ - Place outputs in (BansheeSource)/Dependencies/tools/(LibName)  
    
 Each library below lists a set of outputs required by Banshee. After you compile/retrieve the library rename the outputs to what Banshee expects and place them relative to the above paths, depending on their type. Depending on which platform you're compiling for you will need to compile 32-bit or 64-bit versions of the libraries (or both).
    
 Legend:
-  - (BansheeSource) - root directory of Banshee's source code
-  - (LibName) - name of the library (title of the each library shown below)
-  - (Platform) - x86 for 32-bit builds, x64 for 64-bit builds
-  - (Configuration) - Debug, OptimizedDebug or Release
+- (BansheeSource) - root directory of Banshee's source code
+- (LibName) - name of the library (title of the each library shown below)
+- (Platform) - x86 for 32-bit builds, x64 for 64-bit builds
+- (Configuration) - Debug, OptimizedDebug or Release
    
 If the library structure still isn't clear, download one of the pre-compiled dependency packages to see an example.   
       
 ## Library list 
 	  
 **nvtt**
- - NVIDIA Texture Tools 2.0.8
- - https://code.google.com/p/nvidia-texture-tools/
- - Compilation notes:
-  - Compile using the "no-cuda" configurations
-  - Minor tweaks to compile with newer compilers might be required, see Documentation/NVTTCompilationGuide.txt
- - Required by BansheeCore
- - Outputs: 
-   - Windows (Dynamic library):
-     - /Debug/nvtt.lib (Debug configuration)
-	 - /Release/nvtt.lib (Release configuration)
-	 - nvtt.dll (All configurations)
+- NVIDIA Texture Tools 2.1.0 (commit e85d851cd9502d77c6e20769d8c21baa3a94ac18)
+- https://github.com/castano/nvidia-texture-tools
+- Compilation notes:
+ - Compile using the "no-cuda" configurations
+- Required by BansheeCore
+- Outputs: 
+ - Windows (Dynamic library):
+  - /Debug/nvtt.lib (Debug configuration)
+  - /Release/nvtt.lib (Release configuration)
+  - nvtt.dll (All configurations)
  
 **FBXSDK**
- - FBX SDK 2016.1
- - http://usa.autodesk.com/fbx
- - Compilation notes:
-  - No compilation required, libraries are provided pre-compiled
- - Required by BansheeFBXImporter
- - Outputs:  
-  - Windows (Static library):
-    - /Debug/libfbxsdk-md.lib (Debug configuration)
-	- /Release/libfbxsdk-md.lib (Release configuration)
+- FBX SDK 2016.1
+- http://usa.autodesk.com/fbx
+- Compilation notes:
+ - No compilation required, libraries are provided pre-compiled
+- Required by BansheeFBXImporter
+- Outputs:  
+ - Windows (Static library):
+  - /Debug/libfbxsdk-md.lib (Debug configuration)
+  - /Release/libfbxsdk-md.lib (Release configuration)
  
 **freetype**
- - Freetype 2.3.5
- - http://www.freetype.org
- - Compilation notes:
-  - Make sure to define FREETYPE2_STATIC as it might not be defined by default
- - Required by BansheeFontImporter
- - Outputs:
-  - Windows (Static library):
-    - /Debug/freetype.lib (Debug configuration)
-    - /Release/freetype.lib (Release configuration)
+- Freetype 2.3.5
+- http://www.freetype.org
+- Compilation notes:
+ - Make sure to define FREETYPE2_STATIC as it might not be defined by default
+- Required by BansheeFontImporter
+- Outputs:
+ - Windows (Static library):
+  - /Debug/freetype.lib (Debug configuration)
+  - /Release/freetype.lib (Release configuration)
    
 **freeimg**
- - FreeImage 3.13.1
- - http://freeimage.sourceforge.net
- - Required by BansheeFreeImgImporter
- - Outputs:
-  - Windows (Static library):
-    - /Debug/FreeImage.lib (Debug configuration)
-    - /Release/FreeImage.lib (Release configuration)
+- FreeImage 3.13.1
+- http://freeimage.sourceforge.net
+- Required by BansheeFreeImgImporter
+- Outputs:
+ - Windows (Static library):
+  - /Debug/FreeImage.lib (Debug configuration)
+  - /Release/FreeImage.lib (Release configuration)
    
 **OIS**
- - BansheeOIS - Slightly modified version of OIS 1.3
- - Source code included in the dependencies package
- - Required by BansheeOISInput
- - Outputs:
-  - Windows (Dynamic library):
-    - /Debug/BansheeOIS.lib (Debug configuration)
-    - /Release/BansheeOIS.lib (Release configuration)
-    - BansheeOIS.dll (All configurations)
+- BansheeOIS - Slightly modified version of OIS 1.3
+- Source code included in the dependencies package
+- Required by BansheeOISInput
+- Outputs:
+ - Windows (Dynamic library):
+  - /Debug/BansheeOIS.lib (Debug configuration)
+  - /Release/BansheeOIS.lib (Release configuration)
+  - BansheeOIS.dll (All configurations)
    
 **mono**
- - Mono 4.4.0
- - http://www.mono-project.com/
- - Compilation notes:
-  - See Mono-4.4.0-IntegrationGuide.txt
- - Required by BansheeMono
- - Outputs:
-  - Windows (Dynamic library):
-    - /Debug/mono-2.0.lib (Debug configuration)
-    - /Release/mono-2.0.lib (Release configuration)
-    - mono-2.0.dll (All configurations)
+- Mono 4.4.0
+- http://www.mono-project.com/
+- Compilation notes:
+ - See Mono-4.4.0-IntegrationGuide.txt
+- Required by BansheeMono
+- Outputs:
+ - Windows (Dynamic library):
+  - /Debug/mono-2.0.lib (Debug configuration)
+  - /Release/mono-2.0.lib (Release configuration)
+  - mono-2.0.dll (All configurations)
    
 **PhysX**
- - PhysX 3.3
- - https://github.com/NVIDIAGameWorks/PhysX-3.3
- - Required by BansheePhysX
- - Outputs:
-  - Windows (Dynamic library):
-    - x64
-      - /Debug/PhysX3CharacterKinematicCHECKED_x64.lib (Compile using "checked" configuration)
-	  - /Debug/PhysX3CHECKED_x64.lib (Compile using "checked" configuration)
-	  - /Debug/PhysX3CommonCHECKED_x64.lib (Compile using "checked" configuration)
-	  - /Debug/PhysX3CookingCHECKED_x64.lib (Compile using "checked" configuration)
-	  - /Debug/PhysX3ExtensionsCHECKED.lib (Compile using "checked" configuration)
-      - /Release/PhysX3CharacterKinematic_x64.lib (Compile using "release" configuration)
-	  - /Release/PhysX3_x64.lib (Compile using "release" configuration)
-	  - /Release/PhysX3Common_x64.lib (Compile using "release" configuration)
-	  - /Release/PhysX3Cooking_x64.lib (Compile using "release" configuration)
-	  - /Release/PhysX3Extensions.lib (Compile using "release" configuration)
-      - PhysX3CharacterKinematicCHECKED_x64.dll (For Debug configuration)
-	  - PhysX3CHECKED_x64.dll (For Debug configuration)
-	  - PhysX3CommonCHECKED_x64.dll (For Debug configuration)
-	  - PhysX3CookingCHECKED_x64.dll (For Debug configuration)
-      - PhysX3CharacterKinematic_x64.dll (For Release/OptimizedDebug configuration)
-	  - PhysX3_x64.dll (For Release/OptimizedDebug configuration)
-	  - PhysX3Common_x64.dll (For Release/OptimizedDebug configuration)
-	  - PhysX3Cooking_x64.dll (For Release/OptimizedDebug configuration)
-    - x86
-      - /Debug/PhysX3CharacterKinematicCHECKED_x86.lib (Compile using "checked" configuration)
-	  - /Debug/PhysX3CHECKED_x86.lib (Compile using "checked" configuration)
-	  - /Debug/PhysX3CommonCHECKED_x86.lib (Compile using "checked" configuration)
-	  - /Debug/PhysX3CookingCHECKED_x86.lib (Compile using "checked" configuration)
-	  - /Debug/PhysX3ExtensionsCHECKED.lib (Compile using "checked" configuration)
-      - /Release/PhysX3CharacterKinematic_x86.lib (Compile using "release" configuration)
-	  - /Release/PhysX3_x86.lib (Compile using "release" configuration)
-	  - /Release/PhysX3Common_x86.lib (Compile using "release" configuration)
-	  - /Release/PhysX3Cooking_x86.lib (Compile using "release" configuration)
-	  - /Release/PhysX3Extensions.lib (Compile using "release" configuration)
-      - PhysX3CharacterKinematicCHECKED_x86.dll (For Debug configuration)
-	  - PhysX3CHECKED_x86.dll (For Debug configuration)
-	  - PhysX3CommonCHECKED_x86.dll (For Debug configuration)
-	  - PhysX3CookingCHECKED_x86.dll (For Debug configuration)
-      - PhysX3CharacterKinematic_x86.dll (For Release/OptimizedDebug configuration)
-	  - PhysX3_x86.dll (For Release/OptimizedDebug configuration)
-	  - PhysX3Common_x86.dll (For Release/OptimizedDebug configuration)
-	  - PhysX3Cooking_x86.dll (For Release/OptimizedDebug configuration)	
+- PhysX 3.3
+- https://github.com/NVIDIAGameWorks/PhysX-3.3
+- Required by BansheePhysX
+- Outputs:
+ - Windows (Dynamic library):
+  - x64
+   - /Debug/PhysX3CharacterKinematicCHECKED_x64.lib (Compile using "checked" configuration)
+   - /Debug/PhysX3CHECKED_x64.lib (Compile using "checked" configuration)
+   - /Debug/PhysX3CommonCHECKED_x64.lib (Compile using "checked" configuration)
+   - /Debug/PhysX3CookingCHECKED_x64.lib (Compile using "checked" configuration)
+   - /Debug/PhysX3ExtensionsCHECKED.lib (Compile using "checked" configuration)
+   - /Release/PhysX3CharacterKinematic_x64.lib (Compile using "release" configuration)
+   - /Release/PhysX3_x64.lib (Compile using "release" configuration)
+   - /Release/PhysX3Common_x64.lib (Compile using "release" configuration)
+   - /Release/PhysX3Cooking_x64.lib (Compile using "release" configuration)
+   - /Release/PhysX3Extensions.lib (Compile using "release" configuration)
+   - PhysX3CharacterKinematicCHECKED_x64.dll (For Debug configuration)
+   - PhysX3CHECKED_x64.dll (For Debug configuration)
+   - PhysX3CommonCHECKED_x64.dll (For Debug configuration)
+   - PhysX3CookingCHECKED_x64.dll (For Debug configuration)
+   - PhysX3CharacterKinematic_x64.dll (For Release/OptimizedDebug configuration)
+   - PhysX3_x64.dll (For Release/OptimizedDebug configuration)
+   - PhysX3Common_x64.dll (For Release/OptimizedDebug configuration)
+   - PhysX3Cooking_x64.dll (For Release/OptimizedDebug configuration)
+  - x86
+   - /Debug/PhysX3CharacterKinematicCHECKED_x86.lib (Compile using "checked" configuration)
+   - /Debug/PhysX3CHECKED_x86.lib (Compile using "checked" configuration)
+   - /Debug/PhysX3CommonCHECKED_x86.lib (Compile using "checked" configuration)
+   - /Debug/PhysX3CookingCHECKED_x86.lib (Compile using "checked" configuration)
+   - /Debug/PhysX3ExtensionsCHECKED.lib (Compile using "checked" configuration)
+   - /Release/PhysX3CharacterKinematic_x86.lib (Compile using "release" configuration)
+   - /Release/PhysX3_x86.lib (Compile using "release" configuration)
+   - /Release/PhysX3Common_x86.lib (Compile using "release" configuration)
+   - /Release/PhysX3Cooking_x86.lib (Compile using "release" configuration)
+   - /Release/PhysX3Extensions.lib (Compile using "release" configuration)
+   - PhysX3CharacterKinematicCHECKED_x86.dll (For Debug configuration)
+   - PhysX3CHECKED_x86.dll (For Debug configuration)
+   - PhysX3CommonCHECKED_x86.dll (For Debug configuration)
+   - PhysX3CookingCHECKED_x86.dll (For Debug configuration)
+   - PhysX3CharacterKinematic_x86.dll (For Release/OptimizedDebug configuration)
+   - PhysX3_x86.dll (For Release/OptimizedDebug configuration)
+   - PhysX3Common_x86.dll (For Release/OptimizedDebug configuration)
+   - PhysX3Cooking_x86.dll (For Release/OptimizedDebug configuration)	
 	
 **OpenAL**
- - OpenAL Soft 1.17.2
- - https://github.com/kcat/openal-soft
- - Required by BansheeOpenAudio
- - Outputs:
-  - Windows (Dynamic library):
-    - OpenAL32.lib (Compile using "release" configuration)
-    - OpenAL32.dll (All configurations)
+- OpenAL Soft 1.17.2
+- https://github.com/kcat/openal-soft
+- Required by BansheeOpenAudio
+- Outputs:
+ - Windows (Dynamic library):
+  - OpenAL32.lib (Compile using "release" configuration)
+  - OpenAL32.dll (All configurations)
    
 **libogg**
- - libogg v1.3.2
- - https://xiph.org/downloads/
- - Compilation notes:
-  - Switch runtime library to dynamic to avoid linker warnings when adding it to Banshee
-  - This is also required when compiling libvorbis and libflac (below). See readme files included with those libraries.
- - Required by BansheeOpenAudio and BansheeFMOD
- - Outputs:
-  - Windows (Static library):
-    - Debug/libogg.lib (Debug configuration)
-    - Release/libogg.lib (Release configuration)
+- libogg v1.3.2
+- https://xiph.org/downloads/
+- Compilation notes:
+ - Switch runtime library to dynamic to avoid linker warnings when adding it to Banshee
+ - This is also required when compiling libvorbis and libflac (below). See readme files included with those libraries.
+- Required by BansheeOpenAudio and BansheeFMOD
+- Outputs:
+ - Windows (Static library):
+  - Debug/libogg.lib (Debug configuration)
+  - Release/libogg.lib (Release configuration)
    
 **libvorbis**
- - libvorbis commit:5bbe49dc947ea9f1532273644348c53054ca214a
- - https://git.xiph.org/?p=vorbis.git
- - Compilation notes:
-  - Requires libogg, as described in its readme file.
- - Required by BansheeOpenAudio and BansheeFMOD
- - Outputs:
-  - Windows (Dynamic library):
-    - libvorbis.lib (Compile using "release" configuration)
-    - libvorbisfile.lib (Compile using "release" configuration)
-    - libvorbis.dll (All configurations)
-    - libvorbisfile.dll (All configurations)
+- libvorbis commit:5bbe49dc947ea9f1532273644348c53054ca214a
+- https://git.xiph.org/?p=vorbis.git
+- Compilation notes:
+ - Requires libogg, as described in its readme file.
+- Required by BansheeOpenAudio and BansheeFMOD
+- Outputs:
+ - Windows (Dynamic library):
+  - libvorbis.lib (Compile using "release" configuration)
+  - libvorbisfile.lib (Compile using "release" configuration)
+  - libvorbis.dll (All configurations)
+  - libvorbisfile.dll (All configurations)
    
 **libFLAC**
- - libflac commit: 94a61241b02064c7d9fe508f72a742f2a90b8492
- - https://git.xiph.org/?p=flac.git
- - Compilation notes:
-  - Requires libogg, as described in its readme file.
- - Required by BansheeOpenAudio
- - Outputs:
-  - Windows (Dynamic library):
-    - libFLAC.lib (Compile using "release" configuration)
-    - libFLAC_dynamic.dll (All configurations)
+- libflac commit: 94a61241b02064c7d9fe508f72a742f2a90b8492
+- https://git.xiph.org/?p=flac.git
+- Compilation notes:
+ - Requires libogg, as described in its readme file.
+- Required by BansheeOpenAudio
+- Outputs:
+ - Windows (Dynamic library):
+  - libFLAC.lib (Compile using "release" configuration)
+  - libFLAC_dynamic.dll (All configurations)
    
 **glslang**
- - glslang commit: 19bdf90eba71390f04bb85226337517df65d73e2
- - https://github.com/KhronosGroup/glslang
- - Compilation notes:
-  - Read the glslangCompilationGuide.txt before compiling
- - Required by BansheeVulkanRenderAPI
- - Outputs:
-  - Windows (Static library):
-    - glslang.lib (Compile using "release" configuration)
-	- glslangd.lib (Compile using "debug" configuration)
-	- HLSL.lib (Compile using "release" configuration)
-	- HLSLd.lib (Compile using "debug" configuration)
-	- OGLCompiler.lib (Compile using "release" configuration)
-	- OGLCompilerd.lib (Compile using "debug" configuration)
-	- OSDependent.lib (Compile using "release" configuration)
-	- OSDependentd.lib (Compile using "debug" configuration)
+- glslang commit: 19bdf90eba71390f04bb85226337517df65d73e2
+- https://github.com/KhronosGroup/glslang
+- Required by BansheeVulkanRenderAPI
+- Outputs:
+ - Windows (Static library):
+  - glslang.lib (Compile using "release" configuration)
+  - glslangd.lib (Compile using "debug" configuration)
+  - HLSL.lib (Compile using "release" configuration)
+  - HLSLd.lib (Compile using "debug" configuration)
+  - OGLCompiler.lib (Compile using "release" configuration)
+  - OGLCompilerd.lib (Compile using "debug" configuration)
+  - OSDependent.lib (Compile using "release" configuration)
+  - OSDependentd.lib (Compile using "debug" configuration)
    
 **bison**
- - Bison 2.7
- - http://sourceforge.net/projects/winflexbison/files/
- - Required by BansheeSL
- - Outputs:
-  - Windows (tool):
-    - bison/bison.exe (Including all other installation files)
+- Bison 2.7
+- http://sourceforge.net/projects/winflexbison/files/
+- Required by BansheeSL
+- Outputs:
+ - Windows (tool):
+  - bison/bison.exe (Including all other installation files)
    
 **flex**
- - Flex 2.5.37
- - http://sourceforge.net/projects/winflexbison/files/
- - Required by BansheeSL
-  - Outputs:
-   - Windows (tool):
-     - flex/flex.exe (Including all other installation files)
+- Flex 2.5.37
+- http://sourceforge.net/projects/winflexbison/files/
+- Required by BansheeSL
+ - Outputs:
+  - Windows (tool):
+   - flex/flex.exe (Including all other installation files)

+ 0 - 8
Documentation/NVTTCompilationGuide.txt

@@ -1,8 +0,0 @@
-You might need to make some tweaks to get nvtt to compile on Visual Studio 2013. If you are using the Banshee provided source you do not have to do anything but if you want to compile a newever version of nvtt you might need to perform these steps:
-
-- Make sure to compile using the (no cuda) configurations.
-- In nvmath.h remove sqrt_asset, sqrtf_assert, acos_assert, acosf_assert, asin_assert, asinf_assert (and replace anything that complains about those missing with normal sqrt/sqrtf/acos/acosf/asin/asinf) methods.
-- Remove nvtt.rc resource file from nvtt project.
-- Remove libpng.lib;jpeg.lib;tiff.lib; input libraries from nvtt project
-- Remove ImageIO.h & ImageIO.cpp from nvimage project
-- Remove Image::load method from Image.h/Image.cpp in nvimage project

+ 0 - 4
Documentation/glslangCompilationGuide.txt

@@ -1,4 +0,0 @@
-Certain Banshee specific modification is required before compiling glslang:
- - Add getAttributeTType to TProgram's public interface:
-  - Method signature: const TType* getAttributeTType(int index) const;
-  - Method implementation: const TType* TProgram::getAttributeTType(int index) const	 { return reflection->getAttribute(index).getType(); }

+ 48 - 20
Source/BansheeCore/Source/BsPixelUtil.cpp

@@ -763,10 +763,10 @@ namespace bs
 			:buffer(buffer), bufferWritePos(buffer), bufferEnd(buffer + sizeBytes)
 		{ }
 
-		virtual void beginImage(int size, int width, int height, int depth, int face, int miplevel) override
+		void beginImage(int size, int width, int height, int depth, int face, int miplevel) override
 		{ }
 
-		virtual bool writeData(const void* data, int size) override
+		bool writeData(const void* data, int size) override
 		{
 			assert((bufferWritePos + size) <= bufferEnd);
 			memcpy(bufferWritePos, data, size);
@@ -775,6 +775,9 @@ namespace bs
 			return true;
 		}
 
+		void endImage() override
+		{ }
+
 		UINT8* buffer;
 		UINT8* bufferWritePos;
 		UINT8* bufferEnd;
@@ -807,6 +810,9 @@ namespace bs
 			return true;
 		}
 
+		void endImage() override
+		{ }
+
 		Vector<SPtr<PixelData>> buffers;
 		SPtr<PixelData> activeBuffer;
 
@@ -830,6 +836,10 @@ namespace bs
 			return nvtt::Format_BC4;
 		case PF_BC5:
 			return nvtt::Format_BC5;
+		case PF_BC6H:
+			return nvtt::Format_BC6;
+		case PF_BC7:
+			return nvtt::Format_BC7;
 		default: // Unsupported format
 			return nvtt::Format_BC3;
 		}
@@ -1828,13 +1838,6 @@ namespace bs
 			return;
 		}
 
-		// Note: NVTT site has implementations for these two formats for when I decide to add them
-		if (options.format == PF_BC6H || options.format == PF_BC7)
-		{
-			LOGERR("Compression failed. BC6H and BC7 formats are currently not supported.")
-			return;
-		}
-
 		if (src.getDepth() != 1)
 		{
 			LOGERR("Compression failed. 3D texture compression not supported.")
@@ -1847,26 +1850,34 @@ namespace bs
 			return;
 		}
 
-		PixelData bgraData(src.getWidth(), src.getHeight(), 1, PF_R8G8B8A8);
+		PixelFormat interimFormat = options.format == PF_BC6H ? PF_FLOAT32_RGBA : PF_R8G8B8A8;
+
+		PixelData bgraData(src.getWidth(), src.getHeight(), 1, interimFormat);
 		bgraData.allocateInternalBuffer();
 		bulkPixelConversion(src, bgraData);
 
 		nvtt::InputOptions io;
 		io.setTextureLayout(nvtt::TextureType_2D, src.getWidth(), src.getHeight());
-		io.setMipmapData(bgraData.getData(), src.getWidth(), src.getHeight());
 		io.setMipmapGeneration(false);
 		io.setAlphaMode(toNVTTAlphaMode(options.alphaMode));
 		io.setNormalMap(options.isNormalMap);
 
+		if (interimFormat == PF_FLOAT32_RGBA)
+			io.setFormat(nvtt::InputFormat_RGBA_32F);
+		else
+			io.setFormat(nvtt::InputFormat_BGRA_8UB);
+
 		if (options.isSRGB)
 			io.setGamma(2.2f, 2.2f);
 		else
 			io.setGamma(1.0f, 1.0f);
 
+		io.setMipmapData(bgraData.getData(), src.getWidth(), src.getHeight());
+
 		nvtt::CompressionOptions co;
 		co.setFormat(toNVTTFormat(options.format));
 		co.setQuality(toNVTTQuality(options.quality));
-		
+
 		NVTTCompressOutputHandler outputHandler(dst.getData(), dst.getConsecutiveSize());
 
 		nvtt::OutputOptions oo;
@@ -1891,11 +1902,9 @@ namespace bs
 			return outputMipBuffers;
 		}
 
-		// Note: Add support for floating point mips, no reason they shouldn't be supported other than
-		// nvtt doesn't support them natively
-		if (isCompressed(src.getFormat()) || isFloatingPoint(src.getFormat()))
+		if (isCompressed(src.getFormat()))
 		{
-			LOGERR("Mipmap generation failed. Source data cannot be compressed or in floating point format.")
+			LOGERR("Mipmap generation failed. Source data cannot be compressed.")
 			return outputMipBuffers;
 		}
 
@@ -1905,21 +1914,40 @@ namespace bs
 			return outputMipBuffers;
 		}
 
-		PixelData rgbaData(src.getWidth(), src.getHeight(), 1, PF_R8G8B8A8);
+		PixelFormat interimFormat = isFloatingPoint(src.getFormat()) ? PF_FLOAT32_RGBA : PF_R8G8B8A8;
+
+		PixelData rgbaData(src.getWidth(), src.getHeight(), 1, interimFormat);
 		rgbaData.allocateInternalBuffer();
 		bulkPixelConversion(src, rgbaData);
 
 		nvtt::InputOptions io;
 		io.setTextureLayout(nvtt::TextureType_2D, src.getWidth(), src.getHeight());
-		io.setMipmapData(rgbaData.getData(), src.getWidth(), src.getHeight());
 		io.setMipmapGeneration(true);
 		io.setNormalMap(options.isNormalMap);
 		io.setNormalizeMipmaps(options.normalizeMipmaps);
 		io.setWrapMode(toNVTTWrapMode(options.wrapMode));
 
+		if (interimFormat == PF_FLOAT32_RGBA)
+			io.setFormat(nvtt::InputFormat_RGBA_32F);
+		else
+			io.setFormat(nvtt::InputFormat_BGRA_8UB);
+
+		io.setMipmapData(rgbaData.getData(), src.getWidth(), src.getHeight());
+
 		nvtt::CompressionOptions co;
 		co.setFormat(nvtt::Format_RGBA);
 		
+		if (interimFormat == PF_FLOAT32_RGBA)
+		{
+			co.setPixelType(nvtt::PixelType_Float);
+			co.setPixelFormat(32, 32, 32, 32);
+		}
+		else
+		{
+			co.setPixelType(nvtt::PixelType_UnsignedNorm);
+			co.setPixelFormat(8, 8, 8, 8);
+		}
+
 		UINT32 numMips = getMaxMipmaps(src.getWidth(), src.getHeight(), 1, src.getFormat());
 
 		Vector<SPtr<PixelData>> rgbaMipBuffers;
@@ -1931,7 +1959,7 @@ namespace bs
 		UINT32 curHeight = src.getHeight();
 		for (UINT32 i = 0; i < numMips; i++)
 		{
-			rgbaMipBuffers.push_back(bs_shared_ptr_new<PixelData>(curWidth, curHeight, 1, PF_R8G8B8A8));
+			rgbaMipBuffers.push_back(bs_shared_ptr_new<PixelData>(curWidth, curHeight, 1, interimFormat));
 			rgbaMipBuffers.back()->allocateInternalBuffer();
 
 			if (curWidth > 1) 
@@ -1941,7 +1969,7 @@ namespace bs
 				curHeight = curHeight / 2;
 		}
 
-		rgbaMipBuffers.push_back(bs_shared_ptr_new<PixelData>(curWidth, curHeight, 1, PF_R8G8B8A8));
+		rgbaMipBuffers.push_back(bs_shared_ptr_new<PixelData>(curWidth, curHeight, 1, interimFormat));
 		rgbaMipBuffers.back()->allocateInternalBuffer();
 
 		NVTTMipmapOutputHandler outputHandler(rgbaMipBuffers);