4
4
5
5
import { LinearFilter , NearestFilter , RGBFormat , RGBAFormat , DepthFormat , DepthStencilFormat , UnsignedShortType , UnsignedIntType , UnsignedInt248Type , FloatType , HalfFloatType , ClampToEdgeWrapping , NearestMipMapLinearFilter , NearestMipMapNearestFilter } from '../../constants' ;
6
6
import { _Math } from '../../math/Math' ;
7
- import { toGL } from './WebGLUtils' ;
7
+ import { WebGLUtils } from './WebGLUtils' ;
8
8
9
9
function WebGLTextures ( _gl , extensions , state , properties , capabilities , infoMemory ) {
10
10
@@ -265,8 +265,8 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, infoMe
265
265
266
266
var image = cubeImage [ 0 ] ,
267
267
isPowerOfTwoImage = isPowerOfTwo ( image ) ,
268
- glFormat = toGL ( texture . format ) ,
269
- glType = toGL ( texture . type ) ;
268
+ glFormat = WebGLUtils . toGL ( texture . format ) ,
269
+ glType = WebGLUtils . toGL ( texture . type ) ;
270
270
271
271
setTextureParameters ( _gl . TEXTURE_CUBE_MAP , texture , isPowerOfTwoImage ) ;
272
272
@@ -350,11 +350,11 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, infoMe
350
350
351
351
if ( isPowerOfTwoImage ) {
352
352
353
- _gl . texParameteri ( textureType , _gl . TEXTURE_WRAP_S , toGL ( texture . wrapS ) ) ;
354
- _gl . texParameteri ( textureType , _gl . TEXTURE_WRAP_T , toGL ( texture . wrapT ) ) ;
353
+ _gl . texParameteri ( textureType , _gl . TEXTURE_WRAP_S , WebGLUtils . toGL ( texture . wrapS ) ) ;
354
+ _gl . texParameteri ( textureType , _gl . TEXTURE_WRAP_T , WebGLUtils . toGL ( texture . wrapT ) ) ;
355
355
356
- _gl . texParameteri ( textureType , _gl . TEXTURE_MAG_FILTER , toGL ( texture . magFilter ) ) ;
357
- _gl . texParameteri ( textureType , _gl . TEXTURE_MIN_FILTER , toGL ( texture . minFilter ) ) ;
356
+ _gl . texParameteri ( textureType , _gl . TEXTURE_MAG_FILTER , WebGLUtils . toGL ( texture . magFilter ) ) ;
357
+ _gl . texParameteri ( textureType , _gl . TEXTURE_MIN_FILTER , WebGLUtils . toGL ( texture . minFilter ) ) ;
358
358
359
359
} else {
360
360
@@ -426,8 +426,8 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, infoMe
426
426
}
427
427
428
428
var isPowerOfTwoImage = isPowerOfTwo ( image ) ,
429
- glFormat = toGL ( texture . format ) ,
430
- glType = toGL ( texture . type ) ;
429
+ glFormat = WebGLUtils . toGL ( texture . format ) ,
430
+ glType = WebGLUtils . toGL ( texture . type ) ;
431
431
432
432
setTextureParameters ( _gl . TEXTURE_2D , texture , isPowerOfTwoImage ) ;
433
433
@@ -461,7 +461,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, infoMe
461
461
console . warn ( 'THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture.' ) ;
462
462
463
463
texture . type = UnsignedShortType ;
464
- glType = toGL ( texture . type ) ;
464
+ glType = WebGLUtils . toGL ( texture . type ) ;
465
465
466
466
}
467
467
@@ -481,7 +481,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, infoMe
481
481
console . warn ( 'THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture.' ) ;
482
482
483
483
texture . type = UnsignedInt248Type ;
484
- glType = toGL ( texture . type ) ;
484
+ glType = WebGLUtils . toGL ( texture . type ) ;
485
485
486
486
}
487
487
@@ -578,8 +578,8 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, infoMe
578
578
// Setup storage for target texture and bind it to correct framebuffer
579
579
function setupFrameBufferTexture ( framebuffer , renderTarget , attachment , textureTarget ) {
580
580
581
- var glFormat = toGL ( renderTarget . texture . format ) ;
582
- var glType = toGL ( renderTarget . texture . type ) ;
581
+ var glFormat = WebGLUtils . toGL ( renderTarget . texture . format ) ;
582
+ var glType = WebGLUtils . toGL ( renderTarget . texture . type ) ;
583
583
state . texImage2D ( textureTarget , 0 , glFormat , renderTarget . width , renderTarget . height , 0 , glFormat , glType , null ) ;
584
584
_gl . bindFramebuffer ( _gl . FRAMEBUFFER , framebuffer ) ;
585
585
_gl . framebufferTexture2D ( _gl . FRAMEBUFFER , attachment , textureTarget , properties . get ( renderTarget . texture ) . __webglTexture , 0 ) ;
0 commit comments