Skip to content

Commit a3d3041

Browse files
committedMar 19, 2025·
Updated builds.
1 parent 58d5c51 commit a3d3041

9 files changed

+106
-38
lines changed
 

‎build/three.cjs

+50-6
Original file line numberDiff line numberDiff line change
@@ -4292,9 +4292,10 @@ class ImageUtils {
42924292
* Returns a data URI containing a representation of the given image.
42934293
*
42944294
* @param {(HTMLImageElement|HTMLCanvasElement)} image - The image object.
4295+
* @param {string} [type='image/png'] - Indicates the image format.
42954296
* @return {string} The data URI.
42964297
*/
4297-
static getDataURL( image ) {
4298+
static getDataURL( image, type = 'image/png' ) {
42984299

42994300
if ( /^data:/i.test( image.src ) ) {
43004301

@@ -4337,7 +4338,7 @@ class ImageUtils {
43374338

43384339
}
43394340

4340-
return canvas.toDataURL( 'image/png' );
4341+
return canvas.toDataURL( type );
43414342

43424343
}
43434344

@@ -16389,6 +16390,14 @@ class Material extends EventDispatcher {
1638916390
*/
1639016391
this.forceSinglePass = false;
1639116392

16393+
/**
16394+
* Whether it's possible to override the material with {@link Scene#overrideMaterial} or not.
16395+
*
16396+
* @type {boolean}
16397+
* @default true
16398+
*/
16399+
this.allowOverride = true;
16400+
1639216401
/**
1639316402
* Defines whether 3D objects using this material are visible.
1639416403
*
@@ -22786,7 +22795,8 @@ class Scene extends Object3D {
2278622795
this.environmentRotation = new Euler();
2278722796

2278822797
/**
22789-
* Forces everything in the scene to be rendered with the defined material.
22798+
* Forces everything in the scene to be rendered with the defined material. It is possible
22799+
* to exclude materials from override by setting {@link Material#allowOverride} to `false`.
2279022800
*
2279122801
* @type {?Material}
2279222802
* @default null
@@ -33703,6 +33713,10 @@ class Shape extends Path {
3370333713

3370433714
}
3370533715

33716+
/* eslint-disable */
33717+
// copy of mapbox/earcut version 3.0.1
33718+
// https://github.com/mapbox/earcut/tree/v3.0.1
33719+
3370633720
function earcut(data, holeIndices, dim = 2) {
3370733721

3370833722
const hasHoles = holeIndices && holeIndices.length;
@@ -57261,6 +57275,28 @@ class TextureUtils {
5726157275

5726257276
}
5726357277

57278+
if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {
57279+
57280+
__THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'register', { detail: {
57281+
revision: REVISION,
57282+
} } ) );
57283+
57284+
}
57285+
57286+
if ( typeof window !== 'undefined' ) {
57287+
57288+
if ( window.__THREE__ ) {
57289+
57290+
console.warn( 'WARNING: Multiple instances of Three.js being imported.' );
57291+
57292+
} else {
57293+
57294+
window.__THREE__ = REVISION;
57295+
57296+
}
57297+
57298+
}
57299+
5726457300
function WebGLAnimation() {
5726557301

5726657302
let context = null;
@@ -58639,7 +58675,8 @@ function WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha,
5863958675
side: BackSide,
5864058676
depthTest: false,
5864158677
depthWrite: false,
58642-
fog: false
58678+
fog: false,
58679+
allowOverride: false
5864358680
} )
5864458681
);
5864558682

@@ -58718,7 +58755,8 @@ function WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha,
5871858755
side: FrontSide,
5871958756
depthTest: false,
5872058757
depthWrite: false,
58721-
fog: false
58758+
fog: false,
58759+
allowOverride: false
5872258760
} )
5872358761
);
5872458762

@@ -73815,8 +73853,14 @@ class WebGLRenderer {
7381573853

7381673854
const object = renderItem.object;
7381773855
const geometry = renderItem.geometry;
73818-
const material = overrideMaterial === null ? renderItem.material : overrideMaterial;
7381973856
const group = renderItem.group;
73857+
let material = renderItem.material;
73858+
73859+
if ( material.allowOverride === true && overrideMaterial !== null ) {
73860+
73861+
material = overrideMaterial;
73862+
73863+
}
7382073864

7382173865
if ( object.layers.test( camera.layers ) ) {
7382273866

‎build/three.core.js

+17-3
Original file line numberDiff line numberDiff line change
@@ -4290,9 +4290,10 @@ class ImageUtils {
42904290
* Returns a data URI containing a representation of the given image.
42914291
*
42924292
* @param {(HTMLImageElement|HTMLCanvasElement)} image - The image object.
4293+
* @param {string} [type='image/png'] - Indicates the image format.
42934294
* @return {string} The data URI.
42944295
*/
4295-
static getDataURL( image ) {
4296+
static getDataURL( image, type = 'image/png' ) {
42964297

42974298
if ( /^data:/i.test( image.src ) ) {
42984299

@@ -4335,7 +4336,7 @@ class ImageUtils {
43354336

43364337
}
43374338

4338-
return canvas.toDataURL( 'image/png' );
4339+
return canvas.toDataURL( type );
43394340

43404341
}
43414342

@@ -16387,6 +16388,14 @@ class Material extends EventDispatcher {
1638716388
*/
1638816389
this.forceSinglePass = false;
1638916390

16391+
/**
16392+
* Whether it's possible to override the material with {@link Scene#overrideMaterial} or not.
16393+
*
16394+
* @type {boolean}
16395+
* @default true
16396+
*/
16397+
this.allowOverride = true;
16398+
1639016399
/**
1639116400
* Defines whether 3D objects using this material are visible.
1639216401
*
@@ -22784,7 +22793,8 @@ class Scene extends Object3D {
2278422793
this.environmentRotation = new Euler();
2278522794

2278622795
/**
22787-
* Forces everything in the scene to be rendered with the defined material.
22796+
* Forces everything in the scene to be rendered with the defined material. It is possible
22797+
* to exclude materials from override by setting {@link Material#allowOverride} to `false`.
2278822798
*
2278922799
* @type {?Material}
2279022800
* @default null
@@ -33701,6 +33711,10 @@ class Shape extends Path {
3370133711

3370233712
}
3370333713

33714+
/* eslint-disable */
33715+
// copy of mapbox/earcut version 3.0.1
33716+
// https://github.com/mapbox/earcut/tree/v3.0.1
33717+
3370433718
function earcut(data, holeIndices, dim = 2) {
3370533719

3370633720
const hasHoles = holeIndices && holeIndices.length;

‎build/three.core.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎build/three.module.js

+11-3
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,8 @@ function WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha,
13841384
side: BackSide,
13851385
depthTest: false,
13861386
depthWrite: false,
1387-
fog: false
1387+
fog: false,
1388+
allowOverride: false
13881389
} )
13891390
);
13901391

@@ -1463,7 +1464,8 @@ function WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha,
14631464
side: FrontSide,
14641465
depthTest: false,
14651466
depthWrite: false,
1466-
fog: false
1467+
fog: false,
1468+
allowOverride: false
14671469
} )
14681470
);
14691471

@@ -16560,8 +16562,14 @@ class WebGLRenderer {
1656016562

1656116563
const object = renderItem.object;
1656216564
const geometry = renderItem.geometry;
16563-
const material = overrideMaterial === null ? renderItem.material : overrideMaterial;
1656416565
const group = renderItem.group;
16566+
let material = renderItem.material;
16567+
16568+
if ( material.allowOverride === true && overrideMaterial !== null ) {
16569+
16570+
material = overrideMaterial;
16571+
16572+
}
1656516573

1656616574
if ( object.layers.test( camera.layers ) ) {
1656716575

‎build/three.module.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎build/three.webgpu.js

+12-11
Original file line numberDiff line numberDiff line change
@@ -3438,7 +3438,7 @@ const Fn = ( jsFunc, nodeType ) => {
34383438
* @function
34393439
* @deprecated since r168. Use {@link Fn} instead.
34403440
*
3441-
* @param {...any} params
3441+
* @param {...any} params
34423442
* @returns {Function}
34433443
*/
34443444
const tslFn = ( ...params ) => { // @deprecated, r168
@@ -5275,7 +5275,7 @@ addMethodChaining( 'shiftRight', shiftRight );
52755275
* @function
52765276
* @deprecated since r168. Use {@link modInt} instead.
52775277
*
5278-
* @param {...any} params
5278+
* @param {...any} params
52795279
* @returns {Function}
52805280
*/
52815281
const remainder = ( ...params ) => { // @deprecated, r168
@@ -6579,7 +6579,7 @@ addMethodChaining( 'select', select );
65796579
* @function
65806580
* @deprecated since r168. Use {@link select} instead.
65816581
*
6582-
* @param {...any} params
6582+
* @param {...any} params
65836583
* @returns {ConditionalNode}
65846584
*/
65856585
const cond = ( ...params ) => { // @deprecated, r168
@@ -14353,7 +14353,7 @@ const Break = () => expression( 'break' ).append();
1435314353
* @function
1435414354
* @deprecated since r168. Use {@link Loop} instead.
1435514355
*
14356-
* @param {...any} params
14356+
* @param {...any} params
1435714357
* @returns {LoopNode}
1435814358
*/
1435914359
const loop = ( ...params ) => { // @deprecated, r168
@@ -28432,7 +28432,7 @@ class StackNode extends Node {
2843228432
* @function
2843328433
* @deprecated since r168. Use {@link StackNode#Else} instead.
2843428434
*
28435-
* @param {...any} params
28435+
* @param {...any} params
2843628436
* @returns {StackNode}
2843728437
*/
2843828438
else( ...params ) { // @deprecated, r168
@@ -28445,7 +28445,7 @@ class StackNode extends Node {
2844528445
/**
2844628446
* @deprecated since r168. Use {@link StackNode#ElseIf} instead.
2844728447
*
28448-
* @param {...any} params
28448+
* @param {...any} params
2844928449
* @returns {StackNode}
2845028450
*/
2845128451
elseif( ...params ) { // @deprecated, r168
@@ -32419,7 +32419,7 @@ const blendColor = /*@__PURE__*/ Fn( ( [ base, blend ] ) => {
3241932419
* @function
3242032420
* @deprecated since r171. Use {@link blendBurn} instead.
3242132421
*
32422-
* @param {...any} params
32422+
* @param {...any} params
3242332423
* @returns {Function}
3242432424
*/
3242532425
const burn = ( ...params ) => { // @deprecated, r171
@@ -32434,7 +32434,7 @@ const burn = ( ...params ) => { // @deprecated, r171
3243432434
* @function
3243532435
* @deprecated since r171. Use {@link blendDodge} instead.
3243632436
*
32437-
* @param {...any} params
32437+
* @param {...any} params
3243832438
* @returns {Function}
3243932439
*/
3244032440
const dodge = ( ...params ) => { // @deprecated, r171
@@ -32449,7 +32449,7 @@ const dodge = ( ...params ) => { // @deprecated, r171
3244932449
* @function
3245032450
* @deprecated since r171. Use {@link blendScreen} instead.
3245132451
*
32452-
* @param {...any} params
32452+
* @param {...any} params
3245332453
* @returns {Function}
3245432454
*/
3245532455
const screen = ( ...params ) => { // @deprecated, r171
@@ -32464,7 +32464,7 @@ const screen = ( ...params ) => { // @deprecated, r171
3246432464
* @function
3246532465
* @deprecated since r171. Use {@link blendOverlay} instead.
3246632466
*
32467-
* @param {...any} params
32467+
* @param {...any} params
3246832468
* @returns {Function}
3246932469
*/
3247032470
const overlay = ( ...params ) => { // @deprecated, r171
@@ -40730,6 +40730,7 @@ class Background extends DataMap {
4073040730
nodeMaterial.side = BackSide;
4073140731
nodeMaterial.depthTest = false;
4073240732
nodeMaterial.depthWrite = false;
40733+
nodeMaterial.allowOverride = false;
4073340734
nodeMaterial.fog = false;
4073440735
nodeMaterial.lights = false;
4073540736
nodeMaterial.vertexNode = viewProj;
@@ -51612,7 +51613,7 @@ class Renderer {
5161251613

5161351614
//
5161451615

51615-
if ( scene.overrideMaterial !== null ) {
51616+
if ( material.allowOverride === true && scene.overrideMaterial !== null ) {
5161651617

5161751618
const overrideMaterial = scene.overrideMaterial;
5161851619

‎build/three.webgpu.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
Please sign in to comment.