Skip to content

Commit 696ecee

Browse files
committed
Updated builds.
1 parent 75cffe9 commit 696ecee

File tree

3 files changed

+754
-660
lines changed

3 files changed

+754
-660
lines changed

build/three.js

Lines changed: 88 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -4781,9 +4781,6 @@
47814781

47824782
WebGLRenderTarget.call( this, width, height, options );
47834783

4784-
this.activeCubeFace = 0; // PX 0, NX 1, PY 2, NY 3, PZ 4, NZ 5
4785-
this.activeMipMapLevel = 0;
4786-
47874784
}
47884785

47894786
WebGLRenderTargetCube.prototype = Object.create( WebGLRenderTarget.prototype );
@@ -12162,17 +12159,15 @@
1216212159

1216312160
}
1216412161

12165-
data.data = { attributes: {}, morphAttributes: {} };
12162+
data.data = { attributes: {} };
1216612163

1216712164
var index = this.index;
1216812165

1216912166
if ( index !== null ) {
1217012167

12171-
var array = Array.prototype.slice.call( index.array );
12172-
1217312168
data.data.index = {
1217412169
type: index.array.constructor.name,
12175-
array: array
12170+
array: Array.prototype.slice.call( index.array )
1217612171
};
1217712172

1217812173
}
@@ -12183,20 +12178,23 @@
1218312178

1218412179
var attribute = attributes[ key ];
1218512180

12186-
var array = Array.prototype.slice.call( attribute.array );
12187-
12188-
data.data.attributes[ key ] = {
12181+
var attributeData = {
1218912182
itemSize: attribute.itemSize,
1219012183
type: attribute.array.constructor.name,
12191-
array: array,
12184+
array: Array.prototype.slice.call( attribute.array ),
1219212185
normalized: attribute.normalized
1219312186
};
1219412187

12188+
if ( attribute.name !== '' ) attributeData.name = attribute.name;
12189+
12190+
data.data.attributes[ key ] = attributeData;
12191+
1219512192
}
1219612193

12197-
var morphAttributes = this.morphAttributes;
12194+
var morphAttributes = {};
12195+
var hasMorphAttributes = false;
1219812196

12199-
for ( var key in morphAttributes ) {
12197+
for ( var key in this.morphAttributes ) {
1220012198

1220112199
var attributeArray = this.morphAttributes[ key ];
1220212200

@@ -12206,20 +12204,31 @@
1220612204

1220712205
var attribute = attributeArray[ i ];
1220812206

12209-
array.push( {
12210-
name: attribute.name,
12207+
var attributeData = {
1221112208
itemSize: attribute.itemSize,
1221212209
type: attribute.array.constructor.name,
1221312210
array: Array.prototype.slice.call( attribute.array ),
1221412211
normalized: attribute.normalized
12215-
} );
12212+
};
12213+
12214+
if ( attribute.name !== '' ) attributeData.name = attribute.name;
12215+
12216+
array.push( attributeData );
1221612217

1221712218
}
1221812219

12219-
data.data.morphAttributes[ key ] = array;
12220+
if ( array.length > 0 ) {
12221+
12222+
morphAttributes[ key ] = array;
12223+
12224+
hasMorphAttributes = true;
12225+
12226+
}
1222012227

1222112228
}
1222212229

12230+
if ( hasMorphAttributes ) data.data.morphAttributes = morphAttributes;
12231+
1222312232
var groups = this.groups;
1222412233

1222512234
if ( groups.length > 0 ) {
@@ -22849,7 +22858,16 @@
2284922858

2285022859
this.setScissor = function ( x, y, width, height ) {
2285122860

22852-
_scissor.set( x, y, width, height );
22861+
if ( x.isVector4 ) {
22862+
22863+
_scissor.set( x.x, x.y, x.z, x.w );
22864+
22865+
} else {
22866+
22867+
_scissor.set( x, y, width, height );
22868+
22869+
}
22870+
2285322871
state.scissor( _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ) );
2285422872

2285522873
};
@@ -24914,7 +24932,7 @@
2491424932

2491524933
};
2491624934

24917-
this.setRenderTarget = function ( renderTarget ) {
24935+
this.setRenderTarget = function ( renderTarget, activeCubeFace, activeMipMapLevel ) {
2491824936

2491924937
_currentRenderTarget = renderTarget;
2492024938

@@ -24933,7 +24951,7 @@
2493324951

2493424952
if ( renderTarget.isWebGLRenderTargetCube ) {
2493524953

24936-
framebuffer = __webglFramebuffer[ renderTarget.activeCubeFace ];
24954+
framebuffer = __webglFramebuffer[ activeCubeFace || 0 ];
2493724955
isCube = true;
2493824956

2493924957
} else if ( renderTarget.isWebGLMultisampleRenderTarget ) {
@@ -24972,7 +24990,7 @@
2497224990
if ( isCube ) {
2497324991

2497424992
var textureProperties = properties.get( renderTarget.texture );
24975-
_gl.framebufferTexture2D( 36160, 36064, 34069 + renderTarget.activeCubeFace, textureProperties.__webglTexture, renderTarget.activeMipMapLevel );
24993+
_gl.framebufferTexture2D( 36160, 36064, 34069 + activeCubeFace || 0, textureProperties.__webglTexture, activeMipMapLevel || 0 );
2497624994

2497724995
}
2497824996

@@ -28002,6 +28020,16 @@
2800228020
TubeBufferGeometry.prototype = Object.create( BufferGeometry.prototype );
2800328021
TubeBufferGeometry.prototype.constructor = TubeBufferGeometry;
2800428022

28023+
TubeBufferGeometry.prototype.toJSON = function () {
28024+
28025+
var data = BufferGeometry.prototype.toJSON.call( this );
28026+
28027+
data.path = this.parameters.path.toJSON();
28028+
28029+
return data;
28030+
28031+
};
28032+
2800528033
/**
2800628034
* @author oosmoxiecode
2800728035
* @author Mugen87 / https://github.com/Mugen87
@@ -37936,30 +37964,36 @@
3793637964
var attribute = attributes[ key ];
3793737965
var typedArray = new TYPED_ARRAYS[ attribute.type ]( attribute.array );
3793837966

37939-
geometry.addAttribute( key, new BufferAttribute( typedArray, attribute.itemSize, attribute.normalized ) );
37967+
var bufferAttribute = new BufferAttribute( typedArray, attribute.itemSize, attribute.normalized );
37968+
if ( attribute.name !== undefined ) bufferAttribute.name = attribute.name;
37969+
geometry.addAttribute( key, bufferAttribute );
3794037970

3794137971
}
3794237972

3794337973
var morphAttributes = json.data.morphAttributes;
3794437974

37945-
for ( var key in morphAttributes ) {
37975+
if ( morphAttributes ) {
3794637976

37947-
var attributeArray = morphAttributes[ key ];
37977+
for ( var key in morphAttributes ) {
3794837978

37949-
var array = [];
37979+
var attributeArray = morphAttributes[ key ];
3795037980

37951-
for ( var i = 0, il = attributeArray.length; i < il; i ++ ) {
37981+
var array = [];
3795237982

37953-
var attribute = attributeArray[ i ];
37954-
var typedArray = new TYPED_ARRAYS[ attribute.type ]( attribute.array );
37983+
for ( var i = 0, il = attributeArray.length; i < il; i ++ ) {
3795537984

37956-
var bufferAttribute = new BufferAttribute( typedArray, attribute.itemSize, attribute.normalized );
37957-
if ( attribute.name !== undefined ) bufferAttribute.name = attribute.name;
37958-
array.push( bufferAttribute );
37985+
var attribute = attributeArray[ i ];
37986+
var typedArray = new TYPED_ARRAYS[ attribute.type ]( attribute.array );
3795937987

37960-
}
37988+
var bufferAttribute = new BufferAttribute( typedArray, attribute.itemSize, attribute.normalized );
37989+
if ( attribute.name !== undefined ) bufferAttribute.name = attribute.name;
37990+
array.push( bufferAttribute );
37991+
37992+
}
3796137993

37962-
geometry.morphAttributes[ key ] = array;
37994+
geometry.morphAttributes[ key ] = array;
37995+
37996+
}
3796337997

3796437998
}
3796537999

@@ -38309,6 +38343,21 @@
3830938343

3831038344
break;
3831138345

38346+
case 'TubeGeometry':
38347+
case 'TubeBufferGeometry':
38348+
38349+
// This only works for built-in curves (e.g. CatmullRomCurve3).
38350+
// User defined curves or instances of CurvePath will not be deserialized.
38351+
geometry = new Geometries[ data.type ](
38352+
new Curves[ data.path.type ]().fromJSON( data.path ),
38353+
data.tubularSegments,
38354+
data.radius,
38355+
data.radialSegments,
38356+
data.closed
38357+
);
38358+
38359+
break;
38360+
3831238361
case 'LatheGeometry':
3831338362
case 'LatheBufferGeometry':
3831438363

@@ -40100,26 +40149,24 @@
4010040149

4010140150
renderTarget.texture.generateMipmaps = false;
4010240151

40103-
renderTarget.activeCubeFace = 0;
40104-
renderer.setRenderTarget( renderTarget );
40105-
40152+
renderer.setRenderTarget( renderTarget, 0 );
4010640153
renderer.render( scene, cameraPX );
4010740154

40108-
renderTarget.activeCubeFace = 1;
40155+
renderer.setRenderTarget( renderTarget, 1 );
4010940156
renderer.render( scene, cameraNX );
4011040157

40111-
renderTarget.activeCubeFace = 2;
40158+
renderer.setRenderTarget( renderTarget, 2 );
4011240159
renderer.render( scene, cameraPY );
4011340160

40114-
renderTarget.activeCubeFace = 3;
40161+
renderer.setRenderTarget( renderTarget, 3 );
4011540162
renderer.render( scene, cameraNY );
4011640163

40117-
renderTarget.activeCubeFace = 4;
40164+
renderer.setRenderTarget( renderTarget, 4 );
4011840165
renderer.render( scene, cameraPZ );
4011940166

4012040167
renderTarget.texture.generateMipmaps = generateMipmaps;
4012140168

40122-
renderTarget.activeCubeFace = 5;
40169+
renderer.setRenderTarget( renderTarget, 5 );
4012340170
renderer.render( scene, cameraNZ );
4012440171

4012540172
renderer.setRenderTarget( currentRenderTarget );

0 commit comments

Comments
 (0)