@@ -181,11 +181,7 @@ class WebGLTextureUtils {
181181 if ( glType === gl . FLOAT ) internalFormat = gl . R32F ;
182182 if ( glType === gl . HALF_FLOAT ) internalFormat = gl . R16F ;
183183 if ( glType === gl . UNSIGNED_BYTE ) internalFormat = gl . R8 ;
184- if ( glType === gl . UNSIGNED_SHORT ) internalFormat = gl . R16 ;
185- if ( glType === gl . UNSIGNED_INT ) internalFormat = gl . R32UI ;
186- if ( glType === gl . BYTE ) internalFormat = gl . R8I ;
187- if ( glType === gl . SHORT ) internalFormat = gl . R16I ;
188- if ( glType === gl . INT ) internalFormat = gl . R32I ;
184+ if ( glType === gl . BYTE ) internalFormat = gl . R8_SNORM ;
189185
190186 }
191187
@@ -205,11 +201,7 @@ class WebGLTextureUtils {
205201 if ( glType === gl . FLOAT ) internalFormat = gl . RG32F ;
206202 if ( glType === gl . HALF_FLOAT ) internalFormat = gl . RG16F ;
207203 if ( glType === gl . UNSIGNED_BYTE ) internalFormat = gl . RG8 ;
208- if ( glType === gl . UNSIGNED_SHORT ) internalFormat = gl . RG16 ;
209- if ( glType === gl . UNSIGNED_INT ) internalFormat = gl . RG32UI ;
210- if ( glType === gl . BYTE ) internalFormat = gl . RG8I ;
211- if ( glType === gl . SHORT ) internalFormat = gl . RG16I ;
212- if ( glType === gl . INT ) internalFormat = gl . RG32I ;
204+ if ( glType === gl . BYTE ) internalFormat = gl . RG8_SNORM ;
213205
214206 }
215207
@@ -230,13 +222,8 @@ class WebGLTextureUtils {
230222
231223 if ( glType === gl . FLOAT ) internalFormat = gl . RGB32F ;
232224 if ( glType === gl . HALF_FLOAT ) internalFormat = gl . RGB16F ;
233- if ( glType === gl . UNSIGNED_BYTE ) internalFormat = gl . RGB8 ;
234- if ( glType === gl . UNSIGNED_SHORT ) internalFormat = gl . RGB16 ;
235- if ( glType === gl . UNSIGNED_INT ) internalFormat = gl . RGB32UI ;
236- if ( glType === gl . BYTE ) internalFormat = gl . RGB8I ;
237- if ( glType === gl . SHORT ) internalFormat = gl . RGB16I ;
238- if ( glType === gl . INT ) internalFormat = gl . RGB32I ;
239225 if ( glType === gl . UNSIGNED_BYTE ) internalFormat = ( transfer === SRGBTransfer ) ? gl . SRGB8 : gl . RGB8 ;
226+ if ( glType === gl . BYTE ) internalFormat = gl . RGB8_SNORM ;
240227 if ( glType === gl . UNSIGNED_SHORT_5_6_5 ) internalFormat = gl . RGB565 ;
241228 if ( glType === gl . UNSIGNED_SHORT_5_5_5_1 ) internalFormat = gl . RGB5_A1 ;
242229 if ( glType === gl . UNSIGNED_SHORT_4_4_4_4 ) internalFormat = gl . RGB4 ;
@@ -262,13 +249,8 @@ class WebGLTextureUtils {
262249
263250 if ( glType === gl . FLOAT ) internalFormat = gl . RGBA32F ;
264251 if ( glType === gl . HALF_FLOAT ) internalFormat = gl . RGBA16F ;
265- if ( glType === gl . UNSIGNED_BYTE ) internalFormat = gl . RGBA8 ;
266- if ( glType === gl . UNSIGNED_SHORT ) internalFormat = gl . RGBA16 ;
267- if ( glType === gl . UNSIGNED_INT ) internalFormat = gl . RGBA32UI ;
268- if ( glType === gl . BYTE ) internalFormat = gl . RGBA8I ;
269- if ( glType === gl . SHORT ) internalFormat = gl . RGBA16I ;
270- if ( glType === gl . INT ) internalFormat = gl . RGBA32I ;
271252 if ( glType === gl . UNSIGNED_BYTE ) internalFormat = ( transfer === SRGBTransfer ) ? gl . SRGB8_ALPHA8 : gl . RGBA8 ;
253+ if ( glType === gl . BYTE ) internalFormat = gl . RGBA8_SNORM ;
272254 if ( glType === gl . UNSIGNED_SHORT_4_4_4_4 ) internalFormat = gl . RGBA4 ;
273255 if ( glType === gl . UNSIGNED_SHORT_5_5_5_1 ) internalFormat = gl . RGB5_A1 ;
274256
0 commit comments