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