|
@@ -26,10 +26,12 @@ import {
|
|
|
RGB_ETC2_Format,
|
|
RGB_ETC2_Format,
|
|
|
RGB_PVRTC_4BPPV1_Format,
|
|
RGB_PVRTC_4BPPV1_Format,
|
|
|
RGB_S3TC_DXT1_Format,
|
|
RGB_S3TC_DXT1_Format,
|
|
|
|
|
+ RGBFormat,
|
|
|
RGFormat,
|
|
RGFormat,
|
|
|
RedFormat,
|
|
RedFormat,
|
|
|
SRGBColorSpace,
|
|
SRGBColorSpace,
|
|
|
- UnsignedByteType
|
|
|
|
|
|
|
+ UnsignedByteType,
|
|
|
|
|
+ UnsignedInt5999Type
|
|
|
} from 'three';
|
|
} from 'three';
|
|
|
import { WorkerPool } from '../utils/WorkerPool.js';
|
|
import { WorkerPool } from '../utils/WorkerPool.js';
|
|
|
import {
|
|
import {
|
|
@@ -70,6 +72,7 @@ import {
|
|
|
VK_FORMAT_R8G8_UNORM,
|
|
VK_FORMAT_R8G8_UNORM,
|
|
|
VK_FORMAT_R8_SRGB,
|
|
VK_FORMAT_R8_SRGB,
|
|
|
VK_FORMAT_R8_UNORM,
|
|
VK_FORMAT_R8_UNORM,
|
|
|
|
|
+ VK_FORMAT_E5B9G9R9_UFLOAT_PACK32,
|
|
|
VK_FORMAT_UNDEFINED
|
|
VK_FORMAT_UNDEFINED
|
|
|
} from '../libs/ktx-parse.module.js';
|
|
} from '../libs/ktx-parse.module.js';
|
|
|
import { ZSTDDecoder } from '../libs/zstddec.module.js';
|
|
import { ZSTDDecoder } from '../libs/zstddec.module.js';
|
|
@@ -918,7 +921,7 @@ KTX2Loader.BasisWorker = function () {
|
|
|
// Parsing for non-Basis textures. These textures may have supercompression
|
|
// Parsing for non-Basis textures. These textures may have supercompression
|
|
|
// like Zstd, but they do not require transcoding.
|
|
// like Zstd, but they do not require transcoding.
|
|
|
|
|
|
|
|
-const UNCOMPRESSED_FORMATS = new Set( [ RGBAFormat, RGFormat, RedFormat ] );
|
|
|
|
|
|
|
+const UNCOMPRESSED_FORMATS = new Set( [ RGBAFormat, RGBFormat, RGFormat, RedFormat ] );
|
|
|
|
|
|
|
|
const FORMAT_MAP = {
|
|
const FORMAT_MAP = {
|
|
|
|
|
|
|
@@ -937,6 +940,8 @@ const FORMAT_MAP = {
|
|
|
[ VK_FORMAT_R8_SRGB ]: RedFormat,
|
|
[ VK_FORMAT_R8_SRGB ]: RedFormat,
|
|
|
[ VK_FORMAT_R8_UNORM ]: RedFormat,
|
|
[ VK_FORMAT_R8_UNORM ]: RedFormat,
|
|
|
|
|
|
|
|
|
|
+ [ VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 ]: RGBFormat,
|
|
|
|
|
+
|
|
|
[ VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK ]: RGB_ETC2_Format,
|
|
[ VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK ]: RGB_ETC2_Format,
|
|
|
[ VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK ]: RGBA_ETC2_EAC_Format,
|
|
[ VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK ]: RGBA_ETC2_EAC_Format,
|
|
|
|
|
|
|
@@ -979,6 +984,8 @@ const TYPE_MAP = {
|
|
|
[ VK_FORMAT_R8_SRGB ]: UnsignedByteType,
|
|
[ VK_FORMAT_R8_SRGB ]: UnsignedByteType,
|
|
|
[ VK_FORMAT_R8_UNORM ]: UnsignedByteType,
|
|
[ VK_FORMAT_R8_UNORM ]: UnsignedByteType,
|
|
|
|
|
|
|
|
|
|
+ [ VK_FORMAT_E5B9G9R9_UFLOAT_PACK32 ]: UnsignedInt5999Type,
|
|
|
|
|
+
|
|
|
[ VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK ]: UnsignedByteType,
|
|
[ VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK ]: UnsignedByteType,
|
|
|
[ VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK ]: UnsignedByteType,
|
|
[ VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK ]: UnsignedByteType,
|
|
|
|
|
|
|
@@ -1071,6 +1078,16 @@ async function createRawTexture( container ) {
|
|
|
|
|
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
|
|
+ } else if ( TYPE_MAP[ vkFormat ] === UnsignedInt5999Type ) {
|
|
|
|
|
+
|
|
|
|
|
+ data = new Uint32Array(
|
|
|
|
|
+
|
|
|
|
|
+ levelData.buffer,
|
|
|
|
|
+ levelData.byteOffset,
|
|
|
|
|
+ levelData.byteLength / Uint32Array.BYTES_PER_ELEMENT
|
|
|
|
|
+
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
} else {
|
|
} else {
|
|
|
|
|
|
|
|
data = levelData;
|
|
data = levelData;
|