Skip to content

Commit

Permalink
Updated builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Jun 8, 2017
1 parent fd13fb4 commit 2cd1575
Show file tree
Hide file tree
Showing 3 changed files with 699 additions and 686 deletions.
22 changes: 14 additions & 8 deletions build/three.js
Original file line number Diff line number Diff line change
Expand Up @@ -17875,6 +17875,13 @@

}

function textureNeedsGenerateMipmaps( texture, isPowerOfTwo ) {

return texture.generateMipmaps && isPowerOfTwo &&
texture.minFilter !== NearestFilter && texture.minFilter !== LinearFilter;

}

// Fallback filters for non-power-of-2 textures

function filterFallback( f ) {
Expand Down Expand Up @@ -18112,7 +18119,7 @@

}

if ( texture.generateMipmaps && isPowerOfTwoImage ) {
if ( textureNeedsGenerateMipmaps( texture, isPowerOfTwoImage ) ) {

_gl.generateMipmap( _gl.TEXTURE_CUBE_MAP );

Expand Down Expand Up @@ -18361,7 +18368,7 @@

}

if ( texture.generateMipmaps && isPowerOfTwoImage ) _gl.generateMipmap( _gl.TEXTURE_2D );
if ( textureNeedsGenerateMipmaps( texture, isPowerOfTwoImage ) ) _gl.generateMipmap( _gl.TEXTURE_2D );

textureProperties.__version = texture.version;

Expand Down Expand Up @@ -18539,7 +18546,7 @@

}

if ( renderTarget.texture.generateMipmaps && isTargetPowerOfTwo ) _gl.generateMipmap( _gl.TEXTURE_CUBE_MAP );
if ( textureNeedsGenerateMipmaps( renderTarget.texture, isTargetPowerOfTwo ) ) _gl.generateMipmap( _gl.TEXTURE_CUBE_MAP );
state.bindTexture( _gl.TEXTURE_CUBE_MAP, null );

} else {
Expand All @@ -18548,7 +18555,7 @@
setTextureParameters( _gl.TEXTURE_2D, renderTarget.texture, isTargetPowerOfTwo );
setupFrameBufferTexture( renderTargetProperties.__webglFramebuffer, renderTarget, _gl.COLOR_ATTACHMENT0, _gl.TEXTURE_2D );

if ( renderTarget.texture.generateMipmaps && isTargetPowerOfTwo ) _gl.generateMipmap( _gl.TEXTURE_2D );
if ( textureNeedsGenerateMipmaps( renderTarget.texture, isTargetPowerOfTwo ) ) _gl.generateMipmap( _gl.TEXTURE_2D );
state.bindTexture( _gl.TEXTURE_2D, null );

}
Expand All @@ -18566,12 +18573,11 @@
function updateRenderTargetMipmap( renderTarget ) {

var texture = renderTarget.texture;
var isTargetPowerOfTwo = isPowerOfTwo( renderTarget );

if ( texture.generateMipmaps && isPowerOfTwo( renderTarget ) &&
texture.minFilter !== NearestFilter &&
texture.minFilter !== LinearFilter ) {
if ( textureNeedsGenerateMipmaps( texture, isTargetPowerOfTwo ) ) {

var target = (renderTarget && renderTarget.isWebGLRenderTargetCube) ? _gl.TEXTURE_CUBE_MAP : _gl.TEXTURE_2D;
var target = renderTarget.isWebGLRenderTargetCube ? _gl.TEXTURE_CUBE_MAP : _gl.TEXTURE_2D;
var webglTexture = properties.get( texture ).__webglTexture;

state.bindTexture( target, webglTexture );
Expand Down
Loading

0 comments on commit 2cd1575

Please sign in to comment.