Add KTX and ETC1 texture support by @Triang3l

https://github.com/xonotic/netradiant/pull/1
https://gitlab.com/xonotic/netradiant/-/issues/5

This pull request adds support for Khronos Textures to NetRadiant and Q3Map2, with OpenGL ES 2.0 formats, Ericsson Texture Compression version 1, and BGR/BGRA.

The patent-free Ericsson Texture Compression format will be used in the next version of Warsow to significantly reduce VRAM usage on mobile GPUs and the integrated GPU of Intel Broadwell.
This commit is contained in:
Garux
2021-07-18 16:18:49 +03:00
parent d1c3c838c8
commit 44907db895
10 changed files with 967 additions and 0 deletions

View File

@@ -29,6 +29,7 @@
#include "bmp.h"
#include "pcx.h"
#include "dds.h"
#include "ktx.h"
#include "modulesystem/singletonmodule.h"
@@ -137,6 +138,26 @@ typedef SingletonModule<ImageDDSAPI, ImageDependencies> ImageDDSModule;
ImageDDSModule g_ImageDDSModule;
class ImageKTXAPI
{
_QERPlugImageTable m_imagektx;
public:
typedef _QERPlugImageTable Type;
STRING_CONSTANT( Name, "ktx" );
ImageKTXAPI(){
m_imagektx.loadImage = LoadKTX;
}
_QERPlugImageTable* getTable(){
return &m_imagektx;
}
};
typedef SingletonModule<ImageKTXAPI, ImageDependencies> ImageKTXModule;
ImageKTXModule g_ImageKTXModule;
extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules( ModuleServer& server ){
initialiseModule( server );
@@ -145,4 +166,5 @@ extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules( ModuleServer& server
g_ImageBMPModule.selfRegister();
g_ImagePCXModule.selfRegister();
g_ImageDDSModule.selfRegister();
g_ImageKTXModule.selfRegister();
}