提交 d4e87ec0 编写于 作者: M Mr.doob

Updated builds.

上级 6630a2b5
......@@ -19341,15 +19341,19 @@ THREE.WebGLRenderer = function ( parameters ) {
return function () {
if ( value !== undefined ) {
if ( value !== undefined ) return value;
return value;
var extension = extensions.get( 'EXT_texture_filter_anisotropic' );
}
if ( extension !== null ) {
var extension = extensions.get( 'EXT_texture_filter_anisotropic' );
value = _gl.getParameter( extension.MAX_TEXTURE_MAX_ANISOTROPY_EXT );
} else {
value = 0;
value = extension !== null ? _gl.getParameter( extension.MAX_TEXTURE_MAX_ANISOTROPY_EXT ) : 0;
}
return value;
......@@ -22122,7 +22126,7 @@ THREE.WebGLRenderer = function ( parameters ) {
for ( var i = 0, il = mipmaps.length; i < il; i ++ ) {
mipmap = mipmaps[ i ];
_gl.texImage2D( _gl.TEXTURE_2D, i, glFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data );
state.texImage2D( _gl.TEXTURE_2D, i, glFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data );
}
......@@ -22130,7 +22134,7 @@ THREE.WebGLRenderer = function ( parameters ) {
} else {
_gl.texImage2D( _gl.TEXTURE_2D, 0, glFormat, image.width, image.height, 0, glFormat, glType, image.data );
state.texImage2D( _gl.TEXTURE_2D, 0, glFormat, image.width, image.height, 0, glFormat, glType, image.data );
}
......@@ -22144,7 +22148,7 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( getCompressedTextureFormats().indexOf( glFormat ) > -1 ) {
_gl.compressedTexImage2D( _gl.TEXTURE_2D, i, glFormat, mipmap.width, mipmap.height, 0, mipmap.data );
state.compressedTexImage2D( _gl.TEXTURE_2D, i, glFormat, mipmap.width, mipmap.height, 0, mipmap.data );
} else {
......@@ -22154,7 +22158,7 @@ THREE.WebGLRenderer = function ( parameters ) {
} else {
_gl.texImage2D( _gl.TEXTURE_2D, i, glFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data );
state.texImage2D( _gl.TEXTURE_2D, i, glFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data );
}
......@@ -22171,7 +22175,7 @@ THREE.WebGLRenderer = function ( parameters ) {
for ( var i = 0, il = mipmaps.length; i < il; i ++ ) {
mipmap = mipmaps[ i ];
_gl.texImage2D( _gl.TEXTURE_2D, i, glFormat, glFormat, glType, mipmap );
state.texImage2D( _gl.TEXTURE_2D, i, glFormat, glFormat, glType, mipmap );
}
......@@ -22179,7 +22183,7 @@ THREE.WebGLRenderer = function ( parameters ) {
} else {
_gl.texImage2D( _gl.TEXTURE_2D, 0, glFormat, glFormat, glType, texture.image );
state.texImage2D( _gl.TEXTURE_2D, 0, glFormat, glFormat, glType, texture.image );
}
......@@ -22302,11 +22306,11 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( isDataTexture ) {
_gl.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glFormat, cubeImage[ i ].width, cubeImage[ i ].height, 0, glFormat, glType, cubeImage[ i ].data );
state.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glFormat, cubeImage[ i ].width, cubeImage[ i ].height, 0, glFormat, glType, cubeImage[ i ].data );
} else {
_gl.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glFormat, glFormat, glType, cubeImage[ i ] );
state.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glFormat, glFormat, glType, cubeImage[ i ] );
}
......@@ -22322,7 +22326,7 @@ THREE.WebGLRenderer = function ( parameters ) {
if ( getCompressedTextureFormats().indexOf( glFormat ) > -1 ) {
_gl.compressedTexImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glFormat, mipmap.width, mipmap.height, 0, mipmap.data );
state.compressedTexImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glFormat, mipmap.width, mipmap.height, 0, mipmap.data );
} else {
......@@ -22332,7 +22336,7 @@ THREE.WebGLRenderer = function ( parameters ) {
} else {
_gl.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data );
state.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, glFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data );
}
......@@ -22442,7 +22446,7 @@ THREE.WebGLRenderer = function ( parameters ) {
renderTarget.__webglFramebuffer[ i ] = _gl.createFramebuffer();
renderTarget.__webglRenderbuffer[ i ] = _gl.createRenderbuffer();
_gl.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glFormat, renderTarget.width, renderTarget.height, 0, glFormat, glType, null );
state.texImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, glFormat, renderTarget.width, renderTarget.height, 0, glFormat, glType, null );
setupFrameBuffer( renderTarget.__webglFramebuffer[ i ], renderTarget, _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i );
setupRenderBuffer( renderTarget.__webglRenderbuffer[ i ], renderTarget );
......@@ -22468,7 +22472,7 @@ THREE.WebGLRenderer = function ( parameters ) {
state.bindTexture( _gl.TEXTURE_2D, renderTarget.__webglTexture );
setTextureParameters( _gl.TEXTURE_2D, renderTarget, isTargetPowerOfTwo );
_gl.texImage2D( _gl.TEXTURE_2D, 0, glFormat, renderTarget.width, renderTarget.height, 0, glFormat, glType, null );
state.texImage2D( _gl.TEXTURE_2D, 0, glFormat, renderTarget.width, renderTarget.height, 0, glFormat, glType, null );
setupFrameBuffer( renderTarget.__webglFramebuffer, renderTarget, _gl.TEXTURE_2D );
......@@ -24171,7 +24175,7 @@ THREE.WebGLShadowMap = function ( _renderer, _lights, _objects ) {
_renderList.length = 0;
projectObject( scene, scene, shadowCamera );
projectObject( scene, shadowCamera );
// render regular objects
......@@ -24258,13 +24262,13 @@ THREE.WebGLShadowMap = function ( _renderer, _lights, _objects ) {
};
function projectObject( scene, object, shadowCamera ) {
function projectObject( object, shadowCamera ) {
if ( object.visible ) {
if ( object.visible === true ) {
var webglObject = _objects.objects[ object.id ];
if ( webglObject && object.castShadow && (object.frustumCulled === false || _frustum.intersectsObject( object ) === true) ) {
if ( webglObject && object.castShadow && ( object.frustumCulled === false || _frustum.intersectsObject( object ) === true ) ) {
object._modelViewMatrix.multiplyMatrices( shadowCamera.matrixWorldInverse, object.matrixWorld );
_renderList.push( webglObject );
......@@ -24273,7 +24277,7 @@ THREE.WebGLShadowMap = function ( _renderer, _lights, _objects ) {
for ( var i = 0, l = object.children.length; i < l; i ++ ) {
projectObject( scene, object.children[ i ], shadowCamera );
projectObject( object.children[ i ], shadowCamera );
}
......@@ -24775,6 +24779,8 @@ THREE.WebGLState = function ( gl, paramThreeToGL ) {
};
// texture
this.activeTexture = function ( webglSlot ) {
if ( webglSlot === undefined ) webglSlot = gl.TEXTURE0 + maxTextures - 1;
......@@ -24814,7 +24820,37 @@ THREE.WebGLState = function ( gl, paramThreeToGL ) {
}
}
};
this.compressedTexImage2D = function () {
try {
gl.compressedTexImage2D.apply( gl, arguments );
} catch ( error ) {
console.error( error );
}
};
this.texImage2D = function () {
try {
gl.texImage2D.apply( gl, arguments );
} catch ( error ) {
console.error( error );
}
};
//
this.reset = function () {
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册