diff --git a/examples/jsm/Addons.js b/examples/jsm/Addons.js index 67c4f66382e585..91614d94ed73a5 100644 --- a/examples/jsm/Addons.js +++ b/examples/jsm/Addons.js @@ -104,7 +104,6 @@ export * from './loaders/LUT3dlLoader.js'; export * from './loaders/LUTCubeLoader.js'; export * from './loaders/LUTImageLoader.js'; export * from './loaders/LWOLoader.js'; -export * from './loaders/LottieLoader.js'; export * from './loaders/MD2Loader.js'; export * from './loaders/MDDLoader.js'; export * from './loaders/MTLLoader.js'; diff --git a/examples/jsm/loaders/LottieLoader.js b/examples/jsm/loaders/LottieLoader.js deleted file mode 100644 index 360fce2ef8a852..00000000000000 --- a/examples/jsm/loaders/LottieLoader.js +++ /dev/null @@ -1,130 +0,0 @@ -import { - FileLoader, - Loader, - CanvasTexture, - NearestFilter, - SRGBColorSpace -} from 'three'; - -import lottie from 'https://cdn.jsdelivr.net/npm/lottie-web@5.13.0/+esm'; - -/** - * A loader for the Lottie texture animation format. - * - * The loader returns an instance of {@link CanvasTexture} to represent - * the animated texture. Two additional properties are added to each texture: - * - `animation`: The return value of `lottie.loadAnimation()` which is an object - * with an API for controlling the animation's playback. - * - `image`: The image container. - * - * ```js - * const loader = new LottieLoader(); - * loader.setQuality( 2 ); - * const texture = await loader.loadAsync( 'textures/lottie/24017-lottie-logo-animation.json' ); - * - * const geometry = new THREE.BoxGeometry(); - * const material = new THREE.MeshBasicMaterial( { map: texture } ); - * const mesh = new THREE.Mesh( geometry, material ); - * scene.add( mesh ); - * ``` - * - * @augments Loader - * @three_import import { LottieLoader } from 'three/addons/loaders/LottieLoader.js'; - */ -class LottieLoader extends Loader { - - /** - * Constructs a new Lottie loader. - * - * @deprecated The loader has been deprecated and will be removed with r186. Use lottie-web instead and create your animated texture manually. - * @param {LoadingManager} [manager] - The loading manager. - */ - constructor( manager ) { - - super( manager ); - - console.warn( 'THREE.LottieLoader: The loader has been deprecated and will be removed with r186. Use lottie-web instead and create your animated texture manually.' ); - - } - - /** - * Sets the texture quality. - * - * @param {number} value - The texture quality. - */ - setQuality( value ) { - - this._quality = value; - - } - - /** - * Starts loading from the given URL and passes the loaded Lottie asset - * to the `onLoad()` callback. - * - * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI. - * @param {function(CanvasTexture)} 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. - * @returns {CanvasTexture} The Lottie texture. - */ - load( url, onLoad, onProgress, onError ) { - - const quality = this._quality || 1; - - const texture = new CanvasTexture(); - texture.minFilter = NearestFilter; - texture.generateMipmaps = false; - texture.colorSpace = SRGBColorSpace; - - const loader = new FileLoader( this.manager ); - loader.setPath( this.path ); - loader.setWithCredentials( this.withCredentials ); - - loader.load( url, function ( text ) { - - const data = JSON.parse( text ); - - // lottie uses container.offsetWidth and offsetHeight - // to define width/height - - const container = document.createElement( 'div' ); - container.style.width = data.w + 'px'; - container.style.height = data.h + 'px'; - document.body.appendChild( container ); - - const animation = lottie.loadAnimation( { - container: container, - animType: 'canvas', - loop: true, - autoplay: true, - animationData: data, - rendererSettings: { dpr: quality } - } ); - - texture.animation = animation; - texture.image = animation.container; - - animation.addEventListener( 'enterFrame', function () { - - texture.needsUpdate = true; - - } ); - - container.style.display = 'none'; - - if ( onLoad !== undefined ) { - - onLoad( texture ); - - } - - }, onProgress, onError ); - - return texture; - - } - -} - -export { LottieLoader }; diff --git a/src/nodes/pmrem/PMREMNode.js b/src/nodes/pmrem/PMREMNode.js index fc65e547aab918..8137920810cdbd 100644 --- a/src/nodes/pmrem/PMREMNode.js +++ b/src/nodes/pmrem/PMREMNode.js @@ -343,7 +343,7 @@ class PMREMNode extends TempNode { // PMREMGenerator renders into a render target with inverted Y, so its output needs the Y // flip on sampling. Externally authored PMREMs follow the standard convention and don't. - uvNode = this._pmrem.isRenderTargetTexture + uvNode = this._pmrem === null || this._pmrem.isRenderTargetTexture ? materialEnvRotation.mul( vec3( uvNode.x, uvNode.y.negate(), uvNode.z ) ) : materialEnvRotation.mul( uvNode ); diff --git a/src/nodes/tsl/TSLCore.js b/src/nodes/tsl/TSLCore.js index 291c84be4a781e..e2185a06546c85 100644 --- a/src/nodes/tsl/TSLCore.js +++ b/src/nodes/tsl/TSLCore.js @@ -1269,27 +1269,3 @@ export const split = ( node, channels ) => new SplitNode( nodeObject( node ), ch addMethodChaining( 'element', element ); addMethodChaining( 'convert', convert ); - -// deprecated - -/** - * @tsl - * @function - * @deprecated since r176. Use {@link Stack} instead. - * - * @param {Node} node - The node to add. - * @returns {Function} - */ -export const append = ( node ) => { // @deprecated, r176 - - warn( 'TSL: append() has been renamed to Stack().', new StackTrace() ); - return Stack( node ); - -}; - -addMethodChaining( 'append', ( node ) => { // @deprecated, r176 - - warn( 'TSL: .append() has been renamed to .toStack().', new StackTrace() ); - return Stack( node ); - -} );