Skip to content
Merged
  •  
  •  
  •  
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,17 @@ jobs:
with:
node-version: 24
cache: 'npm'
- name: Install Vulkan drivers and xvfb
run: |
sudo apt-get update
sudo apt-get install -y mesa-vulkan-drivers xvfb
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build-module

- name: === E2E testing ===
run: npm run test-e2e
run: xvfb-run -a npm run test-e2e
- name: Upload output screenshots
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
if: always()
Expand Down
57 changes: 43 additions & 14 deletions build/three.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -37295,10 +37295,7 @@ function cloneUniforms( src ) {

const property = src[ u ][ p ];

if ( property && ( property.isColor ||
property.isMatrix3 || property.isMatrix4 ||
property.isVector2 || property.isVector3 || property.isVector4 ||
property.isTexture || property.isQuaternion ) ) {
if ( isThreeObject( property ) ) {

if ( property.isRenderTargetTexture ) {

Expand All @@ -37313,7 +37310,23 @@ function cloneUniforms( src ) {

} else if ( Array.isArray( property ) ) {

dst[ u ][ p ] = property.slice();
if ( isThreeObject( property[ 0 ] ) ) {

const clonedProperty = [];

for ( let i = 0, l = property.length; i < l; i ++ ) {

clonedProperty[ i ] = property[ i ].clone();

}

dst[ u ][ p ] = clonedProperty;

} else {

dst[ u ][ p ] = property.slice();

}

} else {

Expand Down Expand Up @@ -37357,6 +37370,15 @@ function mergeUniforms( uniforms ) {

}

function isThreeObject( property ) {

return ( property && ( property.isColor ||
property.isMatrix3 || property.isMatrix4 ||
property.isVector2 || property.isVector3 || property.isVector4 ||
property.isTexture || property.isQuaternion ) );

}

function cloneUniformsGroups( src ) {

const dst = [];
Expand Down Expand Up @@ -44051,7 +44073,6 @@ class FileLoader extends Loader {
* @param {function(any)} onLoad - Executed when the loading process has been finished.
* @param {onProgressCallback} [onProgress] - Executed while the loading is in progress.
* @param {onErrorCallback} [onError] - Executed when errors occur.
* @return {any|undefined} The cached resource if available.
*/
load( url, onLoad, onProgress, onError ) {

Expand All @@ -44075,7 +44096,7 @@ class FileLoader extends Loader {

}, 0 );

return cached;
return;

}

Expand Down Expand Up @@ -49525,6 +49546,9 @@ class ImageBitmapLoader extends Loader {
* Sets the given loader options. The structure of the object must match the `options` parameter of
* [createImageBitmap](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap).
*
* Note: When caching is enabled, the cache key is based on the URL only. Loading the same URL with
* different options will return the cached result of the first request.
*
* @param {Object} options - The loader options to set.
* @return {ImageBitmapLoader} A reference to this image bitmap loader.
*/
Expand All @@ -49543,7 +49567,6 @@ class ImageBitmapLoader extends Loader {
* @param {function(ImageBitmap)} onLoad - Executed when the loading process has been finished.
* @param {onProgressCallback} onProgress - Unsupported in this loader.
* @param {onErrorCallback} onError - Executed when errors occur.
* @return {ImageBitmap|undefined} The image bitmap.
*/
load( url, onLoad, onProgress, onError ) {

Expand Down Expand Up @@ -49581,8 +49604,6 @@ class ImageBitmapLoader extends Loader {

scope.manager.itemEnd( url );

return imageBitmap;

}

} );
Expand All @@ -49600,7 +49621,7 @@ class ImageBitmapLoader extends Loader {

}, 0 );

return cached;
return;

}

Expand All @@ -49625,8 +49646,6 @@ class ImageBitmapLoader extends Loader {

scope.manager.itemEnd( url );

return imageBitmap;

} ).catch( function ( e ) {

if ( onError ) onError( e );
Expand Down Expand Up @@ -49757,11 +49776,21 @@ class AudioLoader extends Loader {
const bufferCopy = buffer.slice( 0 );

const context = AudioContext.getContext();

const decodeUrl = url + '#decode';
scope.manager.itemStart( decodeUrl ); // prevent loading manager from completing too early, see #33378

context.decodeAudioData( bufferCopy, function ( audioBuffer ) {

onLoad( audioBuffer );
scope.manager.itemEnd( decodeUrl );

} ).catch( handleError );
} ).catch( function ( e ) {

handleError( e );
scope.manager.itemEnd( decodeUrl );

} );

} catch ( e ) {

Expand Down
57 changes: 43 additions & 14 deletions build/three.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -37315,10 +37315,7 @@ function cloneUniforms( src ) {

const property = src[ u ][ p ];

if ( property && ( property.isColor ||
property.isMatrix3 || property.isMatrix4 ||
property.isVector2 || property.isVector3 || property.isVector4 ||
property.isTexture || property.isQuaternion ) ) {
if ( isThreeObject( property ) ) {

if ( property.isRenderTargetTexture ) {

Expand All @@ -37333,7 +37330,23 @@ function cloneUniforms( src ) {

} else if ( Array.isArray( property ) ) {

dst[ u ][ p ] = property.slice();
if ( isThreeObject( property[ 0 ] ) ) {

const clonedProperty = [];

for ( let i = 0, l = property.length; i < l; i ++ ) {

clonedProperty[ i ] = property[ i ].clone();

}

dst[ u ][ p ] = clonedProperty;

} else {

dst[ u ][ p ] = property.slice();

}

} else {

Expand Down Expand Up @@ -37377,6 +37390,15 @@ function mergeUniforms( uniforms ) {

}

function isThreeObject( property ) {

return ( property && ( property.isColor ||
property.isMatrix3 || property.isMatrix4 ||
property.isVector2 || property.isVector3 || property.isVector4 ||
property.isTexture || property.isQuaternion ) );

}

function cloneUniformsGroups( src ) {

const dst = [];
Expand Down Expand Up @@ -44071,7 +44093,6 @@ class FileLoader extends Loader {
* @param {function(any)} onLoad - Executed when the loading process has been finished.
* @param {onProgressCallback} [onProgress] - Executed while the loading is in progress.
* @param {onErrorCallback} [onError] - Executed when errors occur.
* @return {any|undefined} The cached resource if available.
*/
load( url, onLoad, onProgress, onError ) {

Expand All @@ -44095,7 +44116,7 @@ class FileLoader extends Loader {

}, 0 );

return cached;
return;

}

Expand Down Expand Up @@ -49545,6 +49566,9 @@ class ImageBitmapLoader extends Loader {
* Sets the given loader options. The structure of the object must match the `options` parameter of
* [createImageBitmap](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap).
*
* Note: When caching is enabled, the cache key is based on the URL only. Loading the same URL with
* different options will return the cached result of the first request.
*
* @param {Object} options - The loader options to set.
* @return {ImageBitmapLoader} A reference to this image bitmap loader.
*/
Expand All @@ -49563,7 +49587,6 @@ class ImageBitmapLoader extends Loader {
* @param {function(ImageBitmap)} onLoad - Executed when the loading process has been finished.
* @param {onProgressCallback} onProgress - Unsupported in this loader.
* @param {onErrorCallback} onError - Executed when errors occur.
* @return {ImageBitmap|undefined} The image bitmap.
*/
load( url, onLoad, onProgress, onError ) {

Expand Down Expand Up @@ -49601,8 +49624,6 @@ class ImageBitmapLoader extends Loader {

scope.manager.itemEnd( url );

return imageBitmap;

}

} );
Expand All @@ -49620,7 +49641,7 @@ class ImageBitmapLoader extends Loader {

}, 0 );

return cached;
return;

}

Expand All @@ -49645,8 +49666,6 @@ class ImageBitmapLoader extends Loader {

scope.manager.itemEnd( url );

return imageBitmap;

} ).catch( function ( e ) {

if ( onError ) onError( e );
Expand Down Expand Up @@ -49777,11 +49796,21 @@ class AudioLoader extends Loader {
const bufferCopy = buffer.slice( 0 );

const context = AudioContext.getContext();

const decodeUrl = url + '#decode';
scope.manager.itemStart( decodeUrl ); // prevent loading manager from completing too early, see #33378

context.decodeAudioData( bufferCopy, function ( audioBuffer ) {

onLoad( audioBuffer );
scope.manager.itemEnd( decodeUrl );

} ).catch( handleError );
} ).catch( function ( e ) {

handleError( e );
scope.manager.itemEnd( decodeUrl );

} );

} catch ( e ) {

Expand Down
2 changes: 1 addition & 1 deletion build/three.core.min.js

Large diffs are not rendered by default.

Loading
Loading