Skip to content

Commit 8a64178

Browse files
dmtaubgreggman
authored andcommitted
Adding entry for EXT_sRGB's unsized RGBA type
This type is now the default for certain textures in three.js's webgl1 fallback
1 parent a60c431 commit 8a64178

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/texture-utils.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ const RED_INTEGER = 0x8D94;
9090
const RGB_INTEGER = 0x8D98;
9191
const RGBA_INTEGER = 0x8D99;
9292

93+
const SRGB_ALPHA_EXT = 0x8C42;
94+
95+
9396
const formatInfo = {};
9497
{
9598
// NOTE: this is named `numColorComponents` vs `numComponents` so we can let Uglify mangle
@@ -133,6 +136,7 @@ function getTextureInternalFormatInfo(internalFormat) {
133136
t[LUMINANCE_ALPHA] = { bytesPerElement: [2, 4, 4, 8], type: [UNSIGNED_BYTE, HALF_FLOAT, HALF_FLOAT_OES, FLOAT], };
134137
t[RGB] = { bytesPerElement: [3, 6, 6, 12, 2], type: [UNSIGNED_BYTE, HALF_FLOAT, HALF_FLOAT_OES, FLOAT, UNSIGNED_SHORT_5_6_5], };
135138
t[RGBA] = { bytesPerElement: [4, 8, 8, 16, 2, 2], type: [UNSIGNED_BYTE, HALF_FLOAT, HALF_FLOAT_OES, FLOAT, UNSIGNED_SHORT_4_4_4_4, UNSIGNED_SHORT_5_5_5_1], };
139+
t[SRGB_ALPHA_EXT] = { bytesPerElement: [4, 8, 8, 16, 2, 2], type: [UNSIGNED_BYTE, HALF_FLOAT, HALF_FLOAT_OES, FLOAT, UNSIGNED_SHORT_4_4_4_4, UNSIGNED_SHORT_5_5_5_1], };
136140
t[DEPTH_COMPONENT] = { bytesPerElement: [2, 4], type: [UNSIGNED_INT, UNSIGNED_SHORT], };
137141
t[DEPTH_STENCIL] = { bytesPerElement: [4], };
138142

@@ -380,4 +384,4 @@ function getBytesForMipUncompressed(internalFormat, width, height, depth, type)
380384
export function getBytesForMip(internalFormat, width, height, depth, type) {
381385
const fn = compressedTextureFunctions.get(internalFormat);
382386
return fn ? fn(width, height, depth) : getBytesForMipUncompressed(internalFormat, width, height, depth, type);
383-
};
387+
};

0 commit comments

Comments
 (0)