Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions examples/jsm/loaders/KTX2Loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ import {
SRGBColorSpace,
UnsignedByteType,
UnsignedInt5999Type,
UnsignedInt101111Type
UnsignedInt101111Type,
UnsignedShortType
} from 'three';
import { WorkerPool } from '../utils/WorkerPool.js';
import {
Expand Down Expand Up @@ -83,6 +84,7 @@ import {
VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG,
VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG,
VK_FORMAT_R16G16B16A16_SFLOAT,
VK_FORMAT_R16G16B16A16_UNORM,
VK_FORMAT_R16G16_SFLOAT,
VK_FORMAT_R16_SFLOAT,
VK_FORMAT_R32G32B32A32_SFLOAT,
Expand Down Expand Up @@ -964,6 +966,8 @@ const FORMAT_MAP = {
[ VK_FORMAT_R16G16_SFLOAT ]: RGFormat,
[ VK_FORMAT_R16_SFLOAT ]: RedFormat,

[ VK_FORMAT_R16G16B16A16_UNORM ]: RGBAFormat,

[ VK_FORMAT_R8G8B8A8_SRGB ]: RGBAFormat,
[ VK_FORMAT_R8G8B8A8_UNORM ]: RGBAFormat,
[ VK_FORMAT_R8G8_SRGB ]: RGFormat,
Expand Down Expand Up @@ -1022,6 +1026,8 @@ const TYPE_MAP = {
[ VK_FORMAT_R16G16_SFLOAT ]: HalfFloatType,
[ VK_FORMAT_R16_SFLOAT ]: HalfFloatType,

[ VK_FORMAT_R16G16B16A16_UNORM ]: UnsignedShortType,

[ VK_FORMAT_R8G8B8A8_SRGB ]: UnsignedByteType,
[ VK_FORMAT_R8G8B8A8_UNORM ]: UnsignedByteType,
[ VK_FORMAT_R8G8_SRGB ]: UnsignedByteType,
Expand Down Expand Up @@ -1149,7 +1155,7 @@ async function createRawTexture( container ) {

);

} else if ( TYPE_MAP[ vkFormat ] === HalfFloatType ) {
} else if ( TYPE_MAP[ vkFormat ] === HalfFloatType || TYPE_MAP[ vkFormat ] === UnsignedShortType ) {

data = new Uint16Array(

Expand Down
Binary file not shown.
1 change: 1 addition & 0 deletions examples/webgl_loader_texture_ktx2.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
{ path: '2d_rgba8.ktx2' },
{ path: '2d_rgba8_linear.ktx2' },
{ path: '2d_rgba16_linear.ktx2' },
{ path: '2d_rgba16unorm_linear.ktx2' },
{ path: '2d_rgba32_linear.ktx2' },
{ path: '2d_rgb9e5_linear.ktx2' },
{ path: '2d_r11g11b10_linear.ktx2' },
Expand Down
Loading