Skip to content

Commit 703631e

Browse files
committed
Updated builds.
1 parent 76572cb commit 703631e

7 files changed

+239
-79
lines changed

build/three.cjs

Lines changed: 90 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7343,6 +7343,54 @@ class Texture extends EventDispatcher {
73437343

73447344
}
73457345

7346+
/**
7347+
* Sets this texture's properties based on `values`.
7348+
* @param {Object} values - A container with texture parameters.
7349+
*/
7350+
setValues( values ) {
7351+
7352+
for ( const key in values ) {
7353+
7354+
const newValue = values[ key ];
7355+
7356+
if ( newValue === undefined ) {
7357+
7358+
console.warn( `THREE.Texture.setValues(): parameter '${ key }' has value of undefined.` );
7359+
continue;
7360+
7361+
}
7362+
7363+
const currentValue = this[ key ];
7364+
7365+
if ( currentValue === undefined ) {
7366+
7367+
console.warn( `THREE.Texture.setValues(): property '${ key }' does not exist.` );
7368+
continue;
7369+
7370+
}
7371+
7372+
if ( ( currentValue && newValue ) && ( currentValue.isVector2 && newValue.isVector2 ) ) {
7373+
7374+
currentValue.copy( newValue );
7375+
7376+
} else if ( ( currentValue && newValue ) && ( currentValue.isVector3 && newValue.isVector3 ) ) {
7377+
7378+
currentValue.copy( newValue );
7379+
7380+
} else if ( ( currentValue && newValue ) && ( currentValue.isMatrix3 && newValue.isMatrix3 ) ) {
7381+
7382+
currentValue.copy( newValue );
7383+
7384+
} else {
7385+
7386+
this[ key ] = newValue;
7387+
7388+
}
7389+
7390+
}
7391+
7392+
}
7393+
73467394
/**
73477395
* Serializes the texture into JSON.
73487396
*
@@ -8765,11 +8813,7 @@ class RenderTarget extends EventDispatcher {
87658813

87668814
const image = { width: width, height: height, depth: options.depth };
87678815

8768-
const texture = new Texture( image, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.colorSpace );
8769-
8770-
texture.flipY = false;
8771-
texture.generateMipmaps = options.generateMipmaps;
8772-
texture.internalFormat = options.internalFormat;
8816+
const texture = new Texture( image );
87738817

87748818
/**
87758819
* An array of textures. Each color attachment is represented as a separate texture.
@@ -8788,6 +8832,8 @@ class RenderTarget extends EventDispatcher {
87888832

87898833
}
87908834

8835+
this._setTextureOptions( options );
8836+
87918837
/**
87928838
* Whether to allocate a depth buffer or not.
87938839
*
@@ -8843,6 +8889,38 @@ class RenderTarget extends EventDispatcher {
88438889

88448890
}
88458891

8892+
_setTextureOptions( options = {} ) {
8893+
8894+
const values = {
8895+
minFilter: LinearFilter,
8896+
generateMipmaps: false,
8897+
flipY: false,
8898+
internalFormat: null
8899+
};
8900+
8901+
if ( options.mapping !== undefined ) values.mapping = options.mapping;
8902+
if ( options.wrapS !== undefined ) values.wrapS = options.wrapS;
8903+
if ( options.wrapT !== undefined ) values.wrapT = options.wrapT;
8904+
if ( options.wrapR !== undefined ) values.wrapR = options.wrapR;
8905+
if ( options.magFilter !== undefined ) values.magFilter = options.magFilter;
8906+
if ( options.minFilter !== undefined ) values.minFilter = options.minFilter;
8907+
if ( options.format !== undefined ) values.format = options.format;
8908+
if ( options.type !== undefined ) values.type = options.type;
8909+
if ( options.anisotropy !== undefined ) values.anisotropy = options.anisotropy;
8910+
if ( options.colorSpace !== undefined ) values.colorSpace = options.colorSpace;
8911+
if ( options.flipY !== undefined ) values.flipY = options.flipY;
8912+
if ( options.generateMipmaps !== undefined ) values.generateMipmaps = options.generateMipmaps;
8913+
if ( options.internalFormat !== undefined ) values.internalFormat = options.internalFormat;
8914+
8915+
for ( let i = 0; i < this.textures.length; i ++ ) {
8916+
8917+
const texture = this.textures[ i ];
8918+
texture.setValues( values );
8919+
8920+
}
8921+
8922+
}
8923+
88468924
/**
88478925
* The texture representing the default color attachment.
88488926
*
@@ -8903,12 +8981,7 @@ class RenderTarget extends EventDispatcher {
89038981
this.textures[ i ].image.width = width;
89048982
this.textures[ i ].image.height = height;
89058983
this.textures[ i ].image.depth = depth;
8906-
8907-
if ( this.textures[ i ].image.depth > 1 ) {
8908-
8909-
this.textures[ i ].isArrayTexture = true;
8910-
8911-
}
8984+
this.textures[ i ].isArrayTexture = this.textures[ i ].image.depth > 1;
89128985

89138986
}
89148987

@@ -9191,6 +9264,7 @@ class WebGLArrayRenderTarget extends WebGLRenderTarget {
91919264
* @type {DataArrayTexture}
91929265
*/
91939266
this.texture = new DataArrayTexture( null, width, height, depth );
9267+
this._setTextureOptions( options );
91949268

91959269
this.texture.isRenderTargetTexture = true;
91969270

@@ -9342,6 +9416,7 @@ class WebGL3DRenderTarget extends WebGLRenderTarget {
93429416
* @type {Data3DTexture}
93439417
*/
93449418
this.texture = new Data3DTexture( null, width, height, depth );
9419+
this._setTextureOptions( options );
93459420

93469421
this.texture.isRenderTargetTexture = true;
93479422

@@ -22106,7 +22181,8 @@ class WebGLCubeRenderTarget extends WebGLRenderTarget {
2210622181
*
2210722182
* @type {DataArrayTexture}
2210822183
*/
22109-
this.texture = new CubeTexture( images, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.colorSpace );
22184+
this.texture = new CubeTexture( images );
22185+
this._setTextureOptions( options );
2211022186

2211122187
// By convention -- likely based on the RenderMan spec from the 1990's -- cube maps are specified by WebGL (and three.js)
2211222188
// in a coordinate system in which positive-x is to the right when looking up the positive-z axis -- in other words,
@@ -22118,9 +22194,6 @@ class WebGLCubeRenderTarget extends WebGLRenderTarget {
2211822194

2211922195
this.texture.isRenderTargetTexture = true;
2212022196

22121-
this.texture.generateMipmaps = options.generateMipmaps !== undefined ? options.generateMipmaps : false;
22122-
this.texture.minFilter = options.minFilter !== undefined ? options.minFilter : LinearFilter;
22123-
2212422197
}
2212522198

2212622199
/**
@@ -53807,6 +53880,7 @@ class RenderTarget3D extends RenderTarget {
5380753880
* @type {Data3DTexture}
5380853881
*/
5380953882
this.texture = new Data3DTexture( null, width, height, depth );
53883+
this._setTextureOptions( options );
5381053884

5381153885
this.texture.isRenderTargetTexture = true;
5381253886

@@ -55708,7 +55782,7 @@ class SkeletonHelper extends LineSegments {
5570855782
this.root = object;
5570955783

5571055784
/**
55711-
* he list of bones that the helper visualizes.
55785+
* The list of bones that the helper visualizes.
5571255786
*
5571355787
* @type {Array<Bone>}
5571455788
*/

build/three.core.js

Lines changed: 90 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7341,6 +7341,54 @@ class Texture extends EventDispatcher {
73417341

73427342
}
73437343

7344+
/**
7345+
* Sets this texture's properties based on `values`.
7346+
* @param {Object} values - A container with texture parameters.
7347+
*/
7348+
setValues( values ) {
7349+
7350+
for ( const key in values ) {
7351+
7352+
const newValue = values[ key ];
7353+
7354+
if ( newValue === undefined ) {
7355+
7356+
console.warn( `THREE.Texture.setValues(): parameter '${ key }' has value of undefined.` );
7357+
continue;
7358+
7359+
}
7360+
7361+
const currentValue = this[ key ];
7362+
7363+
if ( currentValue === undefined ) {
7364+
7365+
console.warn( `THREE.Texture.setValues(): property '${ key }' does not exist.` );
7366+
continue;
7367+
7368+
}
7369+
7370+
if ( ( currentValue && newValue ) && ( currentValue.isVector2 && newValue.isVector2 ) ) {
7371+
7372+
currentValue.copy( newValue );
7373+
7374+
} else if ( ( currentValue && newValue ) && ( currentValue.isVector3 && newValue.isVector3 ) ) {
7375+
7376+
currentValue.copy( newValue );
7377+
7378+
} else if ( ( currentValue && newValue ) && ( currentValue.isMatrix3 && newValue.isMatrix3 ) ) {
7379+
7380+
currentValue.copy( newValue );
7381+
7382+
} else {
7383+
7384+
this[ key ] = newValue;
7385+
7386+
}
7387+
7388+
}
7389+
7390+
}
7391+
73447392
/**
73457393
* Serializes the texture into JSON.
73467394
*
@@ -8763,11 +8811,7 @@ class RenderTarget extends EventDispatcher {
87638811

87648812
const image = { width: width, height: height, depth: options.depth };
87658813

8766-
const texture = new Texture( image, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.colorSpace );
8767-
8768-
texture.flipY = false;
8769-
texture.generateMipmaps = options.generateMipmaps;
8770-
texture.internalFormat = options.internalFormat;
8814+
const texture = new Texture( image );
87718815

87728816
/**
87738817
* An array of textures. Each color attachment is represented as a separate texture.
@@ -8786,6 +8830,8 @@ class RenderTarget extends EventDispatcher {
87868830

87878831
}
87888832

8833+
this._setTextureOptions( options );
8834+
87898835
/**
87908836
* Whether to allocate a depth buffer or not.
87918837
*
@@ -8841,6 +8887,38 @@ class RenderTarget extends EventDispatcher {
88418887

88428888
}
88438889

8890+
_setTextureOptions( options = {} ) {
8891+
8892+
const values = {
8893+
minFilter: LinearFilter,
8894+
generateMipmaps: false,
8895+
flipY: false,
8896+
internalFormat: null
8897+
};
8898+
8899+
if ( options.mapping !== undefined ) values.mapping = options.mapping;
8900+
if ( options.wrapS !== undefined ) values.wrapS = options.wrapS;
8901+
if ( options.wrapT !== undefined ) values.wrapT = options.wrapT;
8902+
if ( options.wrapR !== undefined ) values.wrapR = options.wrapR;
8903+
if ( options.magFilter !== undefined ) values.magFilter = options.magFilter;
8904+
if ( options.minFilter !== undefined ) values.minFilter = options.minFilter;
8905+
if ( options.format !== undefined ) values.format = options.format;
8906+
if ( options.type !== undefined ) values.type = options.type;
8907+
if ( options.anisotropy !== undefined ) values.anisotropy = options.anisotropy;
8908+
if ( options.colorSpace !== undefined ) values.colorSpace = options.colorSpace;
8909+
if ( options.flipY !== undefined ) values.flipY = options.flipY;
8910+
if ( options.generateMipmaps !== undefined ) values.generateMipmaps = options.generateMipmaps;
8911+
if ( options.internalFormat !== undefined ) values.internalFormat = options.internalFormat;
8912+
8913+
for ( let i = 0; i < this.textures.length; i ++ ) {
8914+
8915+
const texture = this.textures[ i ];
8916+
texture.setValues( values );
8917+
8918+
}
8919+
8920+
}
8921+
88448922
/**
88458923
* The texture representing the default color attachment.
88468924
*
@@ -8901,12 +8979,7 @@ class RenderTarget extends EventDispatcher {
89018979
this.textures[ i ].image.width = width;
89028980
this.textures[ i ].image.height = height;
89038981
this.textures[ i ].image.depth = depth;
8904-
8905-
if ( this.textures[ i ].image.depth > 1 ) {
8906-
8907-
this.textures[ i ].isArrayTexture = true;
8908-
8909-
}
8982+
this.textures[ i ].isArrayTexture = this.textures[ i ].image.depth > 1;
89108983

89118984
}
89128985

@@ -9189,6 +9262,7 @@ class WebGLArrayRenderTarget extends WebGLRenderTarget {
91899262
* @type {DataArrayTexture}
91909263
*/
91919264
this.texture = new DataArrayTexture( null, width, height, depth );
9265+
this._setTextureOptions( options );
91929266

91939267
this.texture.isRenderTargetTexture = true;
91949268

@@ -9340,6 +9414,7 @@ class WebGL3DRenderTarget extends WebGLRenderTarget {
93409414
* @type {Data3DTexture}
93419415
*/
93429416
this.texture = new Data3DTexture( null, width, height, depth );
9417+
this._setTextureOptions( options );
93439418

93449419
this.texture.isRenderTargetTexture = true;
93459420

@@ -22104,7 +22179,8 @@ class WebGLCubeRenderTarget extends WebGLRenderTarget {
2210422179
*
2210522180
* @type {DataArrayTexture}
2210622181
*/
22107-
this.texture = new CubeTexture( images, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.colorSpace );
22182+
this.texture = new CubeTexture( images );
22183+
this._setTextureOptions( options );
2210822184

2210922185
// By convention -- likely based on the RenderMan spec from the 1990's -- cube maps are specified by WebGL (and three.js)
2211022186
// in a coordinate system in which positive-x is to the right when looking up the positive-z axis -- in other words,
@@ -22116,9 +22192,6 @@ class WebGLCubeRenderTarget extends WebGLRenderTarget {
2211622192

2211722193
this.texture.isRenderTargetTexture = true;
2211822194

22119-
this.texture.generateMipmaps = options.generateMipmaps !== undefined ? options.generateMipmaps : false;
22120-
this.texture.minFilter = options.minFilter !== undefined ? options.minFilter : LinearFilter;
22121-
2212222195
}
2212322196

2212422197
/**
@@ -53805,6 +53878,7 @@ class RenderTarget3D extends RenderTarget {
5380553878
* @type {Data3DTexture}
5380653879
*/
5380753880
this.texture = new Data3DTexture( null, width, height, depth );
53881+
this._setTextureOptions( options );
5380853882

5380953883
this.texture.isRenderTargetTexture = true;
5381053884

@@ -55706,7 +55780,7 @@ class SkeletonHelper extends LineSegments {
5570655780
this.root = object;
5570755781

5570855782
/**
55709-
* he list of bones that the helper visualizes.
55783+
* The list of bones that the helper visualizes.
5571055784
*
5571155785
* @type {Array<Bone>}
5571255786
*/

build/three.core.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)