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

33
libs/etclib.h Normal file
View File

@@ -0,0 +1,33 @@
// Copyright 2009 Google Inc.
//
// Based on the code from Android ETC1Util.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef INCLUDED_ETCLIB_H
#define INCLUDED_ETCLIB_H
#include "bytebool.h"
#ifdef __cplusplus
extern "C"
{
#endif
void ETC_DecodeETC1Block( const byte* in, byte* out, bool outRGBA );
#ifdef __cplusplus
}
#endif
#endif