| 21404 | // Initialization |
| 21405 | |
| 21406 | function initGL () { |
| 21407 | |
| 21408 | try { |
| 21409 | |
| 21410 | if ( ! ( _gl = _canvas.getContext( 'experimental-webgl', { alpha: _alpha, premultipliedAlpha: _premultipliedAlpha, antialias: _antialias, stencil: _stencil, preserveDrawingBuffer: _preserveDrawingBuffer } ) ) ) { |
| 21411 | |
| 21412 | throw 'Error creating WebGL context.'; |
| 21413 | |
| 21414 | } |
| 21415 | |
| 21416 | } catch ( error ) { |
| 21417 | |
| 21418 | console.error( error ); |
| 21419 | |
| 21420 | } |
| 21421 | |
| 21422 | _glExtensionTextureFloat = _gl.getExtension( 'OES_texture_float' ); |
| 21423 | _glExtensionStandardDerivatives = _gl.getExtension( 'OES_standard_derivatives' ); |
| 21424 | |
| 21425 | _glExtensionTextureFilterAnisotropic = _gl.getExtension( 'EXT_texture_filter_anisotropic' ) || |
| 21426 | _gl.getExtension( 'MOZ_EXT_texture_filter_anisotropic' ) || |
| 21427 | _gl.getExtension( 'WEBKIT_EXT_texture_filter_anisotropic' ); |
| 21428 | |
| 21429 | |
| 21430 | if ( ! _glExtensionTextureFloat ) { |
| 21431 | |
| 21432 | console.log( 'THREE.WebGLRenderer: Float textures not supported.' ); |
| 21433 | |
| 21434 | } |
| 21435 | |
| 21436 | if ( ! _glExtensionStandardDerivatives ) { |
| 21437 | |
| 21438 | console.log( 'THREE.WebGLRenderer: Standard derivatives not supported.' ); |
| 21439 | |
| 21440 | } |
| 21441 | |
| 21442 | if ( ! _glExtensionTextureFilterAnisotropic ) { |
| 21443 | |
| 21444 | console.log( 'THREE.WebGLRenderer: Anisotropic texture filtering not supported.' ); |
| 21445 | |
| 21446 | } |
| 21447 | |
| 21448 | }; |
| 21449 | |
| 21450 | function setDefaultGLState () { |
| 21451 | |