2
2
* @author mrdoob / http://mrdoob.com/
3
3
*/
4
4
5
- < << << << HEAD
6
5
import { LinearFilter , NearestFilter , RGBFormat , RGBAFormat , DepthFormat , DepthStencilFormat , UnsignedShortType , UnsignedIntType , UnsignedInt248Type , FloatType , HalfFloatType , ClampToEdgeWrapping , NearestMipMapLinearFilter , NearestMipMapNearestFilter } from '../../constants.js' ;
7
6
import { _Math } from '../../math/Math.js' ;
8
- = === ===
9
- import { LinearFilter , NearestFilter , RGBFormat , RGBAFormat , DepthFormat , DepthStencilFormat , UnsignedShortType , UnsignedIntType , UnsignedInt248Type , FloatType , HalfFloatType , ClampToEdgeWrapping , NearestMipMapLinearFilter , NearestMipMapNearestFilter } from '../../constants' ;
10
- import { _Math } from '../../math/Math' ;
11
- import { toGL } from './WebGLUtils' ;
12
- > >>> >>> Replaced WebGLUtils . convert with toGL
7
+ import { WebGLUtils } from './WebGLUtils' ;
13
8
14
9
function WebGLTextures ( _gl , extensions , state , properties , capabilities , infoMemory ) {
15
10
@@ -270,8 +265,8 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, infoMe
270
265
271
266
var image = cubeImage [ 0 ] ,
272
267
isPowerOfTwoImage = isPowerOfTwo ( image ) ,
273
- glFormat = toGL ( texture . format ) ,
274
- glType = toGL ( texture . type ) ;
268
+ glFormat = WebGLUtils . toGL ( texture . format ) ,
269
+ glType = WebGLUtils . toGL ( texture . type ) ;
275
270
276
271
setTextureParameters ( _gl . TEXTURE_CUBE_MAP , texture , isPowerOfTwoImage ) ;
277
272
@@ -355,11 +350,11 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, infoMe
355
350
356
351
if ( isPowerOfTwoImage ) {
357
352
358
- _gl . texParameteri ( textureType , _gl . TEXTURE_WRAP_S , toGL ( texture . wrapS ) ) ;
359
- _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 ) ) ;
360
355
361
- _gl . texParameteri ( textureType , _gl . TEXTURE_MAG_FILTER , toGL ( texture . magFilter ) ) ;
362
- _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 ) ) ;
363
358
364
359
} else {
365
360
@@ -431,8 +426,8 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, infoMe
431
426
}
432
427
433
428
var isPowerOfTwoImage = isPowerOfTwo ( image ) ,
434
- glFormat = toGL ( texture . format ) ,
435
- glType = toGL ( texture . type ) ;
429
+ glFormat = WebGLUtils . toGL ( texture . format ) ,
430
+ glType = WebGLUtils . toGL ( texture . type ) ;
436
431
437
432
setTextureParameters ( _gl . TEXTURE_2D , texture , isPowerOfTwoImage ) ;
438
433
@@ -466,7 +461,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, infoMe
466
461
console . warn ( 'THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture.' ) ;
467
462
468
463
texture . type = UnsignedShortType ;
469
- glType = toGL ( texture . type ) ;
464
+ glType = WebGLUtils . toGL ( texture . type ) ;
470
465
471
466
}
472
467
@@ -486,7 +481,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, infoMe
486
481
console . warn ( 'THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture.' ) ;
487
482
488
483
texture . type = UnsignedInt248Type ;
489
- glType = toGL ( texture . type ) ;
484
+ glType = WebGLUtils . toGL ( texture . type ) ;
490
485
491
486
}
492
487
@@ -583,8 +578,8 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, infoMe
583
578
// Setup storage for target texture and bind it to correct framebuffer
584
579
function setupFrameBufferTexture ( framebuffer , renderTarget , attachment , textureTarget ) {
585
580
586
- var glFormat = toGL ( renderTarget . texture . format ) ;
587
- var glType = toGL ( renderTarget . texture . type ) ;
581
+ var glFormat = WebGLUtils . toGL ( renderTarget . texture . format ) ;
582
+ var glType = WebGLUtils . toGL ( renderTarget . texture . type ) ;
588
583
state . texImage2D ( textureTarget , 0 , glFormat , renderTarget . width , renderTarget . height , 0 , glFormat , glType , null ) ;
589
584
_gl . bindFramebuffer ( _gl . FRAMEBUFFER , framebuffer ) ;
590
585
_gl . framebufferTexture2D ( _gl . FRAMEBUFFER , attachment , textureTarget , properties . get ( renderTarget . texture ) . __webglTexture , 0 ) ;
0 commit comments