From 1044f868a987cede3a6cff5b12dd0cdeb72270ee Mon Sep 17 00:00:00 2001 From: Michael Herzog Date: Tue, 16 Dec 2025 22:23:05 +0100 Subject: [PATCH] Global: Remove deprecated code. (#32569) --- src/nodes/accessors/StorageBufferNode.js | 19 ------- src/nodes/accessors/TextureNode.js | 15 ------ src/nodes/display/BlendModes.js | 64 ------------------------ src/nodes/fog/Fog.js | 36 ------------- src/nodes/lighting/ShadowNode.js | 7 --- src/nodes/math/MathNode.js | 39 +-------------- src/renderers/WebGLRenderer.js | 22 +------- 7 files changed, 3 insertions(+), 199 deletions(-) diff --git a/src/nodes/accessors/StorageBufferNode.js b/src/nodes/accessors/StorageBufferNode.js index 6c3d9b56e0fe34..7179df66a62fcf 100644 --- a/src/nodes/accessors/StorageBufferNode.js +++ b/src/nodes/accessors/StorageBufferNode.js @@ -4,7 +4,6 @@ import { varying } from '../tsl/TSLBase.js'; import { storageElement } from '../utils/StorageArrayElementNode.js'; import { NodeAccess } from '../core/constants.js'; import { getTypeFromLength } from '../core/NodeUtils.js'; -import { warn } from '../../utils.js'; /** * This node is used in context of compute shaders and allows to define a @@ -398,21 +397,3 @@ export default StorageBufferNode; * @returns {StorageBufferNode} */ export const storage = ( value, type = null, count = 0 ) => new StorageBufferNode( value, type, count ); - -/** - * @tsl - * @function - * @deprecated since r171. Use `storage().setPBO( true )` instead. - * - * @param {StorageBufferAttribute|StorageInstancedBufferAttribute|BufferAttribute} value - The buffer data. - * @param {?string} type - The buffer type (e.g. `'vec3'`). - * @param {number} count - The buffer count. - * @returns {StorageBufferNode} - */ -export const storageObject = ( value, type, count ) => { // @deprecated, r171 - - warn( 'TSL: "storageObject()" is deprecated. Use "storage().setPBO( true )" instead.' ); - - return storage( value, type, count ).setPBO( true ); - -}; diff --git a/src/nodes/accessors/TextureNode.js b/src/nodes/accessors/TextureNode.js index a57ccf4a13240d..d075c4aedf4385 100644 --- a/src/nodes/accessors/TextureNode.js +++ b/src/nodes/accessors/TextureNode.js @@ -605,21 +605,6 @@ class TextureNode extends UniformNode { // @TODO: Move to TSL - /** - * @function - * @deprecated since r172. Use {@link TextureNode#sample} instead. - * - * @param {Node} uvNode - The uv node. - * @return {TextureNode} A texture node representing the texture sample. - */ - uv( uvNode ) { // @deprecated, r172 - - warn( 'TextureNode: .uv() has been renamed. Use .sample() instead.' ); - - return this.sample( uvNode ); - - } - /** * Samples the texture with the given uv node. * diff --git a/src/nodes/display/BlendModes.js b/src/nodes/display/BlendModes.js index 238e62b66a2691..5fa4870a12d930 100644 --- a/src/nodes/display/BlendModes.js +++ b/src/nodes/display/BlendModes.js @@ -1,6 +1,5 @@ import { Fn, If, vec4 } from '../tsl/TSLBase.js'; import { mix, min, step } from '../math/MathNode.js'; -import { warn } from '../../utils.js'; /** * Represents a "Color Burn" blend mode. @@ -170,66 +169,3 @@ export const unpremultiplyAlpha = /*@__PURE__*/ Fn( ( [ color ] ) => { return vec4( color.rgb.div( color.a ), color.a ); }, { color: 'vec4', return: 'vec4' } ); - - -// Deprecated - -/** - * @tsl - * @function - * @deprecated since r171. Use {@link blendBurn} instead. - * - * @param {...any} params - * @returns {Function} - */ -export const burn = ( ...params ) => { // @deprecated, r171 - - warn( 'TSL: "burn" has been renamed. Use "blendBurn" instead.' ); - return blendBurn( params ); - -}; - -/** - * @tsl - * @function - * @deprecated since r171. Use {@link blendDodge} instead. - * - * @param {...any} params - * @returns {Function} - */ -export const dodge = ( ...params ) => { // @deprecated, r171 - - warn( 'TSL: "dodge" has been renamed. Use "blendDodge" instead.' ); - return blendDodge( params ); - -}; - -/** - * @tsl - * @function - * @deprecated since r171. Use {@link blendScreen} instead. - * - * @param {...any} params - * @returns {Function} - */ -export const screen = ( ...params ) => { // @deprecated, r171 - - warn( 'TSL: "screen" has been renamed. Use "blendScreen" instead.' ); - return blendScreen( params ); - -}; - -/** - * @tsl - * @function - * @deprecated since r171. Use {@link blendOverlay} instead. - * - * @param {...any} params - * @returns {Function} - */ -export const overlay = ( ...params ) => { // @deprecated, r171 - - warn( 'TSL: "overlay" has been renamed. Use "blendOverlay" instead.' ); - return blendOverlay( params ); - -}; diff --git a/src/nodes/fog/Fog.js b/src/nodes/fog/Fog.js index f6ac2373eb9769..e84383f184f677 100644 --- a/src/nodes/fog/Fog.js +++ b/src/nodes/fog/Fog.js @@ -1,7 +1,6 @@ import { positionView } from '../accessors/Position.js'; import { smoothstep } from '../math/MathNode.js'; import { Fn, output, vec4 } from '../tsl/TSLBase.js'; -import { warn } from '../../utils.js'; /** * Returns a node that represents the `z` coordinate in view space @@ -77,38 +76,3 @@ export const fog = Fn( ( [ color, factor ] ) => { return vec4( factor.toFloat().mix( output.rgb, color.toVec3() ), output.a ); } ); - -// Deprecated - -/** - * @tsl - * @function - * @deprecated since r171. Use `fog( color, rangeFogFactor( near, far ) )` instead. - * - * @param {Node} color - * @param {Node} near - * @param {Node} far - * @returns {Function} - */ -export function rangeFog( color, near, far ) { // @deprecated, r171 - - warn( 'TSL: "rangeFog( color, near, far )" is deprecated. Use "fog( color, rangeFogFactor( near, far ) )" instead.' ); - return fog( color, rangeFogFactor( near, far ) ); - -} - -/** - * @tsl - * @function - * @deprecated since r171. Use `fog( color, densityFogFactor( density ) )` instead. - * - * @param {Node} color - * @param {Node} density - * @returns {Function} - */ -export function densityFog( color, density ) { // @deprecated, r171 - - warn( 'TSL: "densityFog( color, density )" is deprecated. Use "fog( color, densityFogFactor( density ) )" instead.' ); - return fog( color, densityFogFactor( density ) ); - -} diff --git a/src/nodes/lighting/ShadowNode.js b/src/nodes/lighting/ShadowNode.js index 57ced0e75b3fc1..171eee030841d5 100644 --- a/src/nodes/lighting/ShadowNode.js +++ b/src/nodes/lighting/ShadowNode.js @@ -19,7 +19,6 @@ import { resetRendererAndSceneState, restoreRendererAndSceneState } from '../../ import { getDataFromObject } from '../core/NodeUtils.js'; import { getShadowMaterial, disposeShadowMaterial, BasicShadowFilter, PCFShadowFilter, PCFSoftShadowFilter, VSMShadowFilter } from './ShadowFilterNode.js'; import ChainMap from '../../renderers/common/ChainMap.js'; -import { warn } from '../../utils.js'; import { textureSize } from '../accessors/TextureSizeNode.js'; import { uv } from '../accessors/UV.js'; @@ -604,12 +603,6 @@ class ShadowNode extends ShadowBaseNode { } - if ( builder.material.shadowNode ) { // @deprecated, r171 - - warn( 'NodeMaterial: ".shadowNode" is deprecated. Use ".castShadowNode" instead.' ); - - } - if ( builder.material.receivedShadowNode ) { node = builder.material.receivedShadowNode( node ); diff --git a/src/nodes/math/MathNode.js b/src/nodes/math/MathNode.js index 8271477e82f6ec..f982faab35faef 100644 --- a/src/nodes/math/MathNode.js +++ b/src/nodes/math/MathNode.js @@ -1,5 +1,5 @@ import TempNode from '../core/TempNode.js'; -import { sub, mul, div, mod, equal } from './OperatorNode.js'; +import { sub, mul, div, mod } from './OperatorNode.js'; import { addMethodChaining, nodeObject, nodeProxyIntent, float, vec2, vec3, vec4, Fn } from '../tsl/TSLCore.js'; import { WebGLCoordinateSystem, WebGPUCoordinateSystem } from '../../constants.js'; import { warn } from '../../utils.js'; @@ -784,23 +784,6 @@ export const inverse = /*@__PURE__*/ nodeProxyIntent( MathNode, MathNode.INVERSE // 2 inputs -/** - * Returns `true` if `x` equals `y`. - * - * @tsl - * @function - * @param {Node | number} x - The first parameter. - * @param {Node | number} y - The second parameter. - * @deprecated since r175. Use {@link equal} instead. - * @returns {Node} - */ -export const equals = ( x, y ) => { // @deprecated, r172 - - warn( 'TSL: "equals" is deprecated. Use "equal" inside a vector instead, like: "bvec*( equal( ... ) )"' ); - return equal( x, y ); - -}; - /** * Returns the least of the given values. * @@ -1081,24 +1064,6 @@ export const smoothstepElement = ( x, low, high ) => smoothstep( low, high, x ); */ export const stepElement = ( x, edge ) => step( edge, x ); -/** - * Returns the arc-tangent of the quotient of its parameters. - * - * @tsl - * @function - * @deprecated since r172. Use {@link atan} instead. - * - * @param {Node | number} y - The y parameter. - * @param {Node | number} x - The x parameter. - * @returns {Node} - */ -export const atan2 = ( y, x ) => { // @deprecated, r172 - - warn( 'TSL: "atan2" is overloaded. Use "atan" instead.' ); - return atan( y, x ); - -}; - // GLSL alias function export const faceforward = faceForward; @@ -1108,7 +1073,6 @@ export const inversesqrt = inverseSqrt; addMethodChaining( 'all', all ); addMethodChaining( 'any', any ); -addMethodChaining( 'equals', equals ); addMethodChaining( 'radians', radians ); addMethodChaining( 'degrees', degrees ); @@ -1140,7 +1104,6 @@ addMethodChaining( 'round', round ); addMethodChaining( 'reciprocal', reciprocal ); addMethodChaining( 'trunc', trunc ); addMethodChaining( 'fwidth', fwidth ); -addMethodChaining( 'atan2', atan2 ); addMethodChaining( 'min', min ); addMethodChaining( 'max', max ); addMethodChaining( 'step', stepElement ); diff --git a/src/renderers/WebGLRenderer.js b/src/renderers/WebGLRenderer.js index 625f890c0daa28..850e766dcba240 100644 --- a/src/renderers/WebGLRenderer.js +++ b/src/renderers/WebGLRenderer.js @@ -3172,27 +3172,9 @@ class WebGLRenderer { * @param {?(Box2|Box3)} [srcRegion=null] - A bounding box which describes the source region. Can be two or three-dimensional. * @param {?(Vector2|Vector3)} [dstPosition=null] - A vector that represents the origin of the destination region. Can be two or three-dimensional. * @param {number} [srcLevel=0] - The source mipmap level to copy. - * @param {?number} [dstLevel=null] - The destination mipmap level. + * @param {?number} [dstLevel=0] - The destination mipmap level. */ - this.copyTextureToTexture = function ( srcTexture, dstTexture, srcRegion = null, dstPosition = null, srcLevel = 0, dstLevel = null ) { - - // support the previous signature with just a single dst mipmap level - if ( dstLevel === null ) { - - if ( srcLevel !== 0 ) { - - // @deprecated, r171 - warnOnce( 'WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels.' ); - dstLevel = srcLevel; - srcLevel = 0; - - } else { - - dstLevel = 0; - - } - - } + this.copyTextureToTexture = function ( srcTexture, dstTexture, srcRegion = null, dstPosition = null, srcLevel = 0, dstLevel = 0 ) { // gather the necessary dimensions to copy let width, height, depth, minX, minY, minZ;