From 5bb15cfd636a12225ad1f99402926474e529f8bf Mon Sep 17 00:00:00 2001 From: sunag Date: Tue, 17 Feb 2026 10:34:19 -0300 Subject: [PATCH 1/2] Nodes: Removing unnecessary `nodesObject` (#33014) --- examples/jsm/tsl/display/AfterImageNode.js | 2 +- examples/jsm/tsl/display/AnaglyphPassNode.js | 4 ++-- examples/jsm/tsl/display/AnamorphicNode.js | 2 +- examples/jsm/tsl/display/BilateralBlurNode.js | 4 ++-- examples/jsm/tsl/display/BloomNode.js | 2 +- examples/jsm/tsl/display/DenoiseNode.js | 2 +- examples/jsm/tsl/display/DepthOfFieldNode.js | 2 +- examples/jsm/tsl/display/DotScreenNode.js | 2 +- examples/jsm/tsl/display/FXAANode.js | 4 ++-- examples/jsm/tsl/display/GodraysNode.js | 4 ++-- examples/jsm/tsl/display/LensflareNode.js | 2 +- examples/jsm/tsl/display/Lut3DNode.js | 2 +- examples/jsm/tsl/display/OutlineNode.js | 2 +- examples/jsm/tsl/display/ParallaxBarrierPassNode.js | 4 ++-- examples/jsm/tsl/display/PixelationPassNode.js | 4 ++-- examples/jsm/tsl/display/RGBShiftNode.js | 4 ++-- examples/jsm/tsl/display/SMAANode.js | 4 ++-- examples/jsm/tsl/display/SSAAPassNode.js | 4 ++-- examples/jsm/tsl/display/SSGINode.js | 4 ++-- examples/jsm/tsl/display/SSRNode.js | 2 +- examples/jsm/tsl/display/SSSNode.js | 4 ++-- examples/jsm/tsl/display/SobelOperatorNode.js | 4 ++-- examples/jsm/tsl/display/StereoPassNode.js | 3 +-- examples/jsm/tsl/display/TRAANode.js | 4 ++-- examples/jsm/tsl/display/TransitionNode.js | 2 +- examples/webgpu_occlusion.html | 4 ++-- src/nodes/core/SubBuildNode.js | 2 +- src/nodes/display/ColorSpaceNode.js | 6 +++--- src/nodes/display/RenderOutputNode.js | 2 +- src/nodes/display/ToneMappingNode.js | 2 +- src/nodes/display/ToonOutlinePassNode.js | 2 +- src/nodes/gpgpu/ComputeNode.js | 2 +- src/nodes/math/MathNode.js | 2 +- src/nodes/tsl/TSLCore.js | 4 ++-- src/nodes/utils/DebugNode.js | 2 +- src/nodes/utils/ReflectorNode.js | 5 ++--- 36 files changed, 54 insertions(+), 56 deletions(-) diff --git a/examples/jsm/tsl/display/AfterImageNode.js b/examples/jsm/tsl/display/AfterImageNode.js index 56e493ba8ab75c..dcccac4a6e16de 100644 --- a/examples/jsm/tsl/display/AfterImageNode.js +++ b/examples/jsm/tsl/display/AfterImageNode.js @@ -239,6 +239,6 @@ class AfterImageNode extends TempNode { * @param {(Node|number)} [damp=0.96] - The damping intensity. A higher value means a stronger after image effect. * @returns {AfterImageNode} */ -export const afterImage = ( node, damp ) => nodeObject( new AfterImageNode( convertToTexture( node ), nodeObject( damp ) ) ); +export const afterImage = ( node, damp ) => new AfterImageNode( convertToTexture( node ), nodeObject( damp ) ); export default AfterImageNode; diff --git a/examples/jsm/tsl/display/AnaglyphPassNode.js b/examples/jsm/tsl/display/AnaglyphPassNode.js index 80c38be194b44d..4bb3b0149c03f9 100644 --- a/examples/jsm/tsl/display/AnaglyphPassNode.js +++ b/examples/jsm/tsl/display/AnaglyphPassNode.js @@ -1,5 +1,5 @@ import { Matrix3, NodeMaterial, Vector3 } from 'three/webgpu'; -import { clamp, nodeObject, Fn, vec4, uv, uniform, max } from 'three/tsl'; +import { clamp, Fn, vec4, uv, uniform, max } from 'three/tsl'; import StereoCompositePassNode from './StereoCompositePassNode.js'; import { frameCorners } from '../../utils/CameraUtils.js'; @@ -546,4 +546,4 @@ export { AnaglyphAlgorithm, AnaglyphColorMode }; * @param {Camera} camera - The camera to render the scene with. * @returns {AnaglyphPassNode} */ -export const anaglyphPass = ( scene, camera ) => nodeObject( new AnaglyphPassNode( scene, camera ) ); +export const anaglyphPass = ( scene, camera ) => new AnaglyphPassNode( scene, camera ); diff --git a/examples/jsm/tsl/display/AnamorphicNode.js b/examples/jsm/tsl/display/AnamorphicNode.js index 96a4b26bb76a32..bc965a816cdd76 100644 --- a/examples/jsm/tsl/display/AnamorphicNode.js +++ b/examples/jsm/tsl/display/AnamorphicNode.js @@ -277,6 +277,6 @@ class AnamorphicNode extends TempNode { * @param {number} [samples=32] - More samples result in larger flares and a more expensive runtime behavior. * @returns {AnamorphicNode} */ -export const anamorphic = ( node, threshold = .9, scale = 3, samples = 32 ) => nodeObject( new AnamorphicNode( convertToTexture( node ), nodeObject( threshold ), nodeObject( scale ), samples ) ); +export const anamorphic = ( node, threshold = .9, scale = 3, samples = 32 ) => new AnamorphicNode( convertToTexture( node ), nodeObject( threshold ), nodeObject( scale ), samples ); export default AnamorphicNode; diff --git a/examples/jsm/tsl/display/BilateralBlurNode.js b/examples/jsm/tsl/display/BilateralBlurNode.js index aa0a9fc72c6e6e..8e1b407574dd5b 100644 --- a/examples/jsm/tsl/display/BilateralBlurNode.js +++ b/examples/jsm/tsl/display/BilateralBlurNode.js @@ -1,5 +1,5 @@ import { RenderTarget, Vector2, NodeMaterial, RendererUtils, QuadMesh, TempNode, NodeUpdateType } from 'three/webgpu'; -import { nodeObject, Fn, float, uv, uniform, convertToTexture, vec2, vec4, passTexture, luminance, abs, exp, max } from 'three/tsl'; +import { Fn, float, uv, uniform, convertToTexture, vec2, vec4, passTexture, luminance, abs, exp, max } from 'three/tsl'; const _quadMesh = /*@__PURE__*/ new QuadMesh(); @@ -361,4 +361,4 @@ export default BilateralBlurNode; * @param {number} sigmaColor - Controls the intensity kernel. Higher values allow more color difference to be blurred together. * @returns {BilateralBlurNode} */ -export const bilateralBlur = ( node, directionNode, sigma, sigmaColor ) => nodeObject( new BilateralBlurNode( convertToTexture( node ), directionNode, sigma, sigmaColor ) ); +export const bilateralBlur = ( node, directionNode, sigma, sigmaColor ) => new BilateralBlurNode( convertToTexture( node ), directionNode, sigma, sigmaColor ); diff --git a/examples/jsm/tsl/display/BloomNode.js b/examples/jsm/tsl/display/BloomNode.js index b3cacc7bcd1c98..eeb12261d94cc5 100644 --- a/examples/jsm/tsl/display/BloomNode.js +++ b/examples/jsm/tsl/display/BloomNode.js @@ -529,6 +529,6 @@ class BloomNode extends TempNode { * @param {number} [threshold=0] - The luminance threshold limits which bright areas contribute to the bloom effect. * @returns {BloomNode} */ -export const bloom = ( node, strength, radius, threshold ) => nodeObject( new BloomNode( nodeObject( node ), strength, radius, threshold ) ); +export const bloom = ( node, strength, radius, threshold ) => new BloomNode( nodeObject( node ), strength, radius, threshold ); export default BloomNode; diff --git a/examples/jsm/tsl/display/DenoiseNode.js b/examples/jsm/tsl/display/DenoiseNode.js index 58bbe97b191f1f..42e65d0bc940a9 100644 --- a/examples/jsm/tsl/display/DenoiseNode.js +++ b/examples/jsm/tsl/display/DenoiseNode.js @@ -331,4 +331,4 @@ function generateDefaultNoise( size = 64 ) { * @param {Camera} camera - The camera the scene is rendered with. * @returns {DenoiseNode} */ -export const denoise = ( node, depthNode, normalNode, camera ) => nodeObject( new DenoiseNode( convertToTexture( node ), nodeObject( depthNode ), nodeObject( normalNode ), camera ) ); +export const denoise = ( node, depthNode, normalNode, camera ) => new DenoiseNode( convertToTexture( node ), nodeObject( depthNode ), nodeObject( normalNode ), camera ); diff --git a/examples/jsm/tsl/display/DepthOfFieldNode.js b/examples/jsm/tsl/display/DepthOfFieldNode.js index 9a460d93631e02..66e1f7f913f824 100644 --- a/examples/jsm/tsl/display/DepthOfFieldNode.js +++ b/examples/jsm/tsl/display/DepthOfFieldNode.js @@ -551,4 +551,4 @@ export default DepthOfFieldNode; * @param {Node | number} bokehScale - A unitless value for artistic purposes to adjust the size of the bokeh. * @returns {DepthOfFieldNode} */ -export const dof = ( node, viewZNode, focusDistance = 1, focalLength = 1, bokehScale = 1 ) => nodeObject( new DepthOfFieldNode( convertToTexture( node ), nodeObject( viewZNode ), nodeObject( focusDistance ), nodeObject( focalLength ), nodeObject( bokehScale ) ) ); +export const dof = ( node, viewZNode, focusDistance = 1, focalLength = 1, bokehScale = 1 ) => new DepthOfFieldNode( convertToTexture( node ), nodeObject( viewZNode ), nodeObject( focusDistance ), nodeObject( focalLength ), nodeObject( bokehScale ) ); diff --git a/examples/jsm/tsl/display/DotScreenNode.js b/examples/jsm/tsl/display/DotScreenNode.js index 35939efe3e0edc..0cac19ec10a6f2 100644 --- a/examples/jsm/tsl/display/DotScreenNode.js +++ b/examples/jsm/tsl/display/DotScreenNode.js @@ -101,4 +101,4 @@ export default DotScreenNode; * @param {number} [scale=1] - The scale of the effect. A higher value means smaller dots. * @returns {DotScreenNode} */ -export const dotScreen = ( node, angle, scale ) => nodeObject( new DotScreenNode( nodeObject( node ), angle, scale ) ); +export const dotScreen = ( node, angle, scale ) => new DotScreenNode( nodeObject( node ), angle, scale ); diff --git a/examples/jsm/tsl/display/FXAANode.js b/examples/jsm/tsl/display/FXAANode.js index f90b6fcff2f6be..4b3fb7eb78a947 100644 --- a/examples/jsm/tsl/display/FXAANode.js +++ b/examples/jsm/tsl/display/FXAANode.js @@ -1,5 +1,5 @@ import { Vector2, TempNode } from 'three/webgpu'; -import { nodeObject, Fn, uniformArray, select, float, NodeUpdateType, uv, dot, clamp, uniform, convertToTexture, smoothstep, bool, vec2, vec3, If, Loop, max, min, Break, abs } from 'three/tsl'; +import { Fn, uniformArray, select, float, NodeUpdateType, uv, dot, clamp, uniform, convertToTexture, smoothstep, bool, vec2, vec3, If, Loop, max, min, Break, abs } from 'three/tsl'; /** * Post processing node for applying FXAA. This node requires sRGB input @@ -362,4 +362,4 @@ export default FXAANode; * @param {Node} node - The node that represents the input of the effect. * @returns {FXAANode} */ -export const fxaa = ( node ) => nodeObject( new FXAANode( convertToTexture( node ) ) ); +export const fxaa = ( node ) => new FXAANode( convertToTexture( node ) ); diff --git a/examples/jsm/tsl/display/GodraysNode.js b/examples/jsm/tsl/display/GodraysNode.js index 8ae571fd78dc27..71f0239ac8a210 100644 --- a/examples/jsm/tsl/display/GodraysNode.js +++ b/examples/jsm/tsl/display/GodraysNode.js @@ -1,5 +1,5 @@ import { Frustum, Matrix4, RenderTarget, Vector2, RendererUtils, QuadMesh, TempNode, NodeMaterial, NodeUpdateType, Vector3, Plane, WebGPUCoordinateSystem } from 'three/webgpu'; -import { cubeTexture, clamp, viewZToPerspectiveDepth, logarithmicDepthToViewZ, float, Loop, max, nodeObject, Fn, passTexture, uv, dot, uniformArray, If, getViewPosition, uniform, vec4, add, interleavedGradientNoise, screenCoordinate, round, mul, uint, mix, exp, vec3, distance, pow, reference, lightPosition, vec2, bool, texture, perspectiveDepthToViewZ, lightShadowMatrix } from 'three/tsl'; +import { cubeTexture, clamp, viewZToPerspectiveDepth, logarithmicDepthToViewZ, float, Loop, max, Fn, passTexture, uv, dot, uniformArray, If, getViewPosition, uniform, vec4, add, interleavedGradientNoise, screenCoordinate, round, mul, uint, mix, exp, vec3, distance, pow, reference, lightPosition, vec2, bool, texture, perspectiveDepthToViewZ, lightShadowMatrix } from 'three/tsl'; const _quadMesh = /*@__PURE__*/ new QuadMesh(); const _size = /*@__PURE__*/ new Vector2(); @@ -621,4 +621,4 @@ export default GodraysNode; * @param {(DirectionalLight|PointLight)} light - The light the godrays are rendered for. * @returns {GodraysNode} */ -export const godrays = ( depthNode, camera, light ) => nodeObject( new GodraysNode( depthNode, camera, light ) ); +export const godrays = ( depthNode, camera, light ) => new GodraysNode( depthNode, camera, light ); diff --git a/examples/jsm/tsl/display/LensflareNode.js b/examples/jsm/tsl/display/LensflareNode.js index 9654ace92348bd..05fedec18f2bdc 100644 --- a/examples/jsm/tsl/display/LensflareNode.js +++ b/examples/jsm/tsl/display/LensflareNode.js @@ -276,4 +276,4 @@ export default LensflareNode; * @param {number} [params.downSampleRatio=4] - Defines how downsampling since the effect is usually not rendered at full resolution. * @returns {LensflareNode} */ -export const lensflare = ( node, params ) => nodeObject( new LensflareNode( convertToTexture( node ), params ) ); +export const lensflare = ( node, params ) => new LensflareNode( convertToTexture( node ), params ); diff --git a/examples/jsm/tsl/display/Lut3DNode.js b/examples/jsm/tsl/display/Lut3DNode.js index 3b588f637fb343..30f01ed5530fa2 100644 --- a/examples/jsm/tsl/display/Lut3DNode.js +++ b/examples/jsm/tsl/display/Lut3DNode.js @@ -106,4 +106,4 @@ export default Lut3DNode; * @param {Node | number} intensity - Controls the intensity of the effect. * @returns {Lut3DNode} */ -export const lut3D = ( node, lut, size, intensity ) => nodeObject( new Lut3DNode( nodeObject( node ), nodeObject( lut ), size, nodeObject( intensity ) ) ); +export const lut3D = ( node, lut, size, intensity ) => new Lut3DNode( nodeObject( node ), nodeObject( lut ), size, nodeObject( intensity ) ); diff --git a/examples/jsm/tsl/display/OutlineNode.js b/examples/jsm/tsl/display/OutlineNode.js index 17f373c5f9c53e..a4f5512ac82379 100644 --- a/examples/jsm/tsl/display/OutlineNode.js +++ b/examples/jsm/tsl/display/OutlineNode.js @@ -759,4 +759,4 @@ export default OutlineNode; * @param {number} [params.downSampleRatio=2] - The downsample ratio. * @returns {OutlineNode} */ -export const outline = ( scene, camera, params ) => nodeObject( new OutlineNode( scene, camera, params ) ); +export const outline = ( scene, camera, params ) => new OutlineNode( scene, camera, params ); diff --git a/examples/jsm/tsl/display/ParallaxBarrierPassNode.js b/examples/jsm/tsl/display/ParallaxBarrierPassNode.js index 8403e2b19bf149..ae1baab0956e1f 100644 --- a/examples/jsm/tsl/display/ParallaxBarrierPassNode.js +++ b/examples/jsm/tsl/display/ParallaxBarrierPassNode.js @@ -1,5 +1,5 @@ import { NodeMaterial } from 'three/webgpu'; -import { nodeObject, Fn, vec4, uv, If, mod, screenCoordinate } from 'three/tsl'; +import { Fn, vec4, uv, If, mod, screenCoordinate } from 'three/tsl'; import StereoCompositePassNode from './StereoCompositePassNode.js'; /** @@ -86,4 +86,4 @@ export default ParallaxBarrierPassNode; * @param {Camera} camera - The camera to render the scene with. * @returns {ParallaxBarrierPassNode} */ -export const parallaxBarrierPass = ( scene, camera ) => nodeObject( new ParallaxBarrierPassNode( scene, camera ) ); +export const parallaxBarrierPass = ( scene, camera ) => new ParallaxBarrierPassNode( scene, camera ); diff --git a/examples/jsm/tsl/display/PixelationPassNode.js b/examples/jsm/tsl/display/PixelationPassNode.js index 94d1da3b327bec..3a1ba7e49ae407 100644 --- a/examples/jsm/tsl/display/PixelationPassNode.js +++ b/examples/jsm/tsl/display/PixelationPassNode.js @@ -214,7 +214,7 @@ class PixelationNode extends TempNode { } -const pixelation = ( node, depthNode, normalNode, pixelSize = 6, normalEdgeStrength = 0.3, depthEdgeStrength = 0.4 ) => nodeObject( new PixelationNode( convertToTexture( node ), convertToTexture( depthNode ), convertToTexture( normalNode ), nodeObject( pixelSize ), nodeObject( normalEdgeStrength ), nodeObject( depthEdgeStrength ) ) ); +const pixelation = ( node, depthNode, normalNode, pixelSize = 6, normalEdgeStrength = 0.3, depthEdgeStrength = 0.4 ) => new PixelationNode( convertToTexture( node ), convertToTexture( depthNode ), convertToTexture( normalNode ), nodeObject( pixelSize ), nodeObject( normalEdgeStrength ), nodeObject( depthEdgeStrength ) ); /** * A special render pass node that renders the scene with a pixelation effect. @@ -330,6 +330,6 @@ class PixelationPassNode extends PassNode { * @param {Node | number} [depthEdgeStrength=0.4] - The depth edge strength. * @returns {PixelationPassNode} */ -export const pixelationPass = ( scene, camera, pixelSize, normalEdgeStrength, depthEdgeStrength ) => nodeObject( new PixelationPassNode( scene, camera, pixelSize, normalEdgeStrength, depthEdgeStrength ) ); +export const pixelationPass = ( scene, camera, pixelSize, normalEdgeStrength, depthEdgeStrength ) => new PixelationPassNode( scene, camera, pixelSize, normalEdgeStrength, depthEdgeStrength ); export default PixelationPassNode; diff --git a/examples/jsm/tsl/display/RGBShiftNode.js b/examples/jsm/tsl/display/RGBShiftNode.js index c615737c1ab41a..a1423c037d3670 100644 --- a/examples/jsm/tsl/display/RGBShiftNode.js +++ b/examples/jsm/tsl/display/RGBShiftNode.js @@ -1,5 +1,5 @@ import { TempNode } from 'three/webgpu'; -import { nodeObject, Fn, uv, uniform, vec2, sin, cos, vec4, convertToTexture } from 'three/tsl'; +import { Fn, uv, uniform, vec2, sin, cos, vec4, convertToTexture } from 'three/tsl'; /** * Post processing node for shifting/splitting RGB color channels. The effect @@ -93,4 +93,4 @@ export default RGBShiftNode; * @param {number} [angle=0] - Defines in which direction colors are shifted. * @returns {RGBShiftNode} */ -export const rgbShift = ( node, amount, angle ) => nodeObject( new RGBShiftNode( convertToTexture( node ), amount, angle ) ); +export const rgbShift = ( node, amount, angle ) => new RGBShiftNode( convertToTexture( node ), amount, angle ); diff --git a/examples/jsm/tsl/display/SMAANode.js b/examples/jsm/tsl/display/SMAANode.js index bf907e1f0f7a17..7b550223936eed 100644 --- a/examples/jsm/tsl/display/SMAANode.js +++ b/examples/jsm/tsl/display/SMAANode.js @@ -1,5 +1,5 @@ import { HalfFloatType, LinearFilter, NearestFilter, RenderTarget, Texture, Vector2, QuadMesh, NodeMaterial, TempNode, RendererUtils } from 'three/webgpu'; -import { abs, nodeObject, Fn, NodeUpdateType, uv, uniform, convertToTexture, varyingProperty, vec2, vec4, modelViewProjection, passTexture, max, step, dot, float, texture, If, Loop, int, Break, sqrt, sign, mix } from 'three/tsl'; +import { abs, Fn, NodeUpdateType, uv, uniform, convertToTexture, varyingProperty, vec2, vec4, modelViewProjection, passTexture, max, step, dot, float, texture, If, Loop, int, Break, sqrt, sign, mix } from 'three/tsl'; const _quadMesh = /*@__PURE__*/ new QuadMesh(); const _size = /*@__PURE__*/ new Vector2(); @@ -765,4 +765,4 @@ export default SMAANode; * @param {Node} node - The node that represents the input of the effect. * @returns {SMAANode} */ -export const smaa = ( node ) => nodeObject( new SMAANode( convertToTexture( node ) ) ); +export const smaa = ( node ) => new SMAANode( convertToTexture( node ) ); diff --git a/examples/jsm/tsl/display/SSAAPassNode.js b/examples/jsm/tsl/display/SSAAPassNode.js index 88d2426b473b20..4d461f590a83e7 100644 --- a/examples/jsm/tsl/display/SSAAPassNode.js +++ b/examples/jsm/tsl/display/SSAAPassNode.js @@ -1,5 +1,5 @@ import { AdditiveBlending, Color, Vector2, RendererUtils, PassNode, QuadMesh, NodeMaterial } from 'three/webgpu'; -import { nodeObject, uniform, mrt, texture, getTextureIndex, unpremultiplyAlpha } from 'three/tsl'; +import { uniform, mrt, texture, getTextureIndex, unpremultiplyAlpha } from 'three/tsl'; const _size = /*@__PURE__*/ new Vector2(); @@ -355,4 +355,4 @@ const _JitterVectors = [ * @param {Camera} camera - The camera to render the scene with. * @returns {SSAAPassNode} */ -export const ssaaPass = ( scene, camera ) => nodeObject( new SSAAPassNode( scene, camera ) ); +export const ssaaPass = ( scene, camera ) => new SSAAPassNode( scene, camera ); diff --git a/examples/jsm/tsl/display/SSGINode.js b/examples/jsm/tsl/display/SSGINode.js index 7731ce8f89251f..7c1068cff7f5ee 100644 --- a/examples/jsm/tsl/display/SSGINode.js +++ b/examples/jsm/tsl/display/SSGINode.js @@ -1,5 +1,5 @@ import { RenderTarget, Vector2, TempNode, QuadMesh, NodeMaterial, RendererUtils, MathUtils } from 'three/webgpu'; -import { clamp, normalize, reference, nodeObject, Fn, NodeUpdateType, uniform, vec4, passTexture, uv, logarithmicDepthToViewZ, viewZToPerspectiveDepth, getViewPosition, screenCoordinate, float, sub, fract, dot, vec2, rand, vec3, Loop, mul, PI, cos, sin, uint, cross, acos, sign, pow, luminance, If, max, abs, Break, sqrt, HALF_PI, div, ceil, shiftRight, convertToTexture, bool, getNormalFromDepth, countOneBits, interleavedGradientNoise } from 'three/tsl'; +import { clamp, normalize, reference, Fn, NodeUpdateType, uniform, vec4, passTexture, uv, logarithmicDepthToViewZ, viewZToPerspectiveDepth, getViewPosition, screenCoordinate, float, sub, fract, dot, vec2, rand, vec3, Loop, mul, PI, cos, sin, uint, cross, acos, sign, pow, luminance, If, max, abs, Break, sqrt, HALF_PI, div, ceil, shiftRight, convertToTexture, bool, getNormalFromDepth, countOneBits, interleavedGradientNoise } from 'three/tsl'; const _quadMesh = /*@__PURE__*/ new QuadMesh(); const _size = /*@__PURE__*/ new Vector2(); @@ -639,4 +639,4 @@ export default SSGINode; * @param {Camera} camera - The camera the scene is rendered with. * @returns {SSGINode} */ -export const ssgi = ( beautyNode, depthNode, normalNode, camera ) => nodeObject( new SSGINode( convertToTexture( beautyNode ), depthNode, normalNode, camera ) ); +export const ssgi = ( beautyNode, depthNode, normalNode, camera ) => new SSGINode( convertToTexture( beautyNode ), depthNode, normalNode, camera ); diff --git a/examples/jsm/tsl/display/SSRNode.js b/examples/jsm/tsl/display/SSRNode.js index 172a05dc144b41..0129374213bae1 100644 --- a/examples/jsm/tsl/display/SSRNode.js +++ b/examples/jsm/tsl/display/SSRNode.js @@ -653,4 +653,4 @@ export default SSRNode; * @param {?Camera} [camera=null] - The camera the scene is rendered with. * @returns {SSRNode} */ -export const ssr = ( colorNode, depthNode, normalNode, metalnessNode, roughnessNode = null, camera = null ) => nodeObject( new SSRNode( nodeObject( colorNode ), nodeObject( depthNode ), nodeObject( normalNode ), nodeObject( metalnessNode ), nodeObject( roughnessNode ), camera ) ); \ No newline at end of file +export const ssr = ( colorNode, depthNode, normalNode, metalnessNode, roughnessNode = null, camera = null ) => new SSRNode( nodeObject( colorNode ), nodeObject( depthNode ), nodeObject( normalNode ), nodeObject( metalnessNode ), nodeObject( roughnessNode ), camera ); diff --git a/examples/jsm/tsl/display/SSSNode.js b/examples/jsm/tsl/display/SSSNode.js index e7a999dd99f5cd..41f66c577a589c 100644 --- a/examples/jsm/tsl/display/SSSNode.js +++ b/examples/jsm/tsl/display/SSSNode.js @@ -1,5 +1,5 @@ import { RedFormat, RenderTarget, Vector2, RendererUtils, QuadMesh, TempNode, NodeMaterial, NodeUpdateType, UnsignedByteType } from 'three/webgpu'; -import { reference, viewZToPerspectiveDepth, logarithmicDepthToViewZ, getScreenPosition, getViewPosition, float, Break, Loop, int, max, abs, If, interleavedGradientNoise, screenCoordinate, nodeObject, Fn, passTexture, uv, uniform, perspectiveDepthToViewZ, orthographicDepthToViewZ, vec2, lightPosition, lightTargetPosition, fract, rand, mix } from 'three/tsl'; +import { reference, viewZToPerspectiveDepth, logarithmicDepthToViewZ, getScreenPosition, getViewPosition, float, Break, Loop, int, max, abs, If, interleavedGradientNoise, screenCoordinate, Fn, passTexture, uv, uniform, perspectiveDepthToViewZ, orthographicDepthToViewZ, vec2, lightPosition, lightTargetPosition, fract, rand, mix } from 'three/tsl'; const _quadMesh = /*@__PURE__*/ new QuadMesh(); const _size = /*@__PURE__*/ new Vector2(); @@ -487,4 +487,4 @@ export default SSSNode; * @param {DirectionalLight} mainLight - The main directional light of the scene. * @returns {SSSNode} */ -export const sss = ( depthNode, camera, mainLight ) => nodeObject( new SSSNode( depthNode, camera, mainLight ) ); +export const sss = ( depthNode, camera, mainLight ) => new SSSNode( depthNode, camera, mainLight ); diff --git a/examples/jsm/tsl/display/SobelOperatorNode.js b/examples/jsm/tsl/display/SobelOperatorNode.js index 14762dd60d0223..f8fa2298ea75d7 100644 --- a/examples/jsm/tsl/display/SobelOperatorNode.js +++ b/examples/jsm/tsl/display/SobelOperatorNode.js @@ -1,5 +1,5 @@ import { Vector2, TempNode, NodeUpdateType } from 'three/webgpu'; -import { nodeObject, Fn, uv, uniform, convertToTexture, vec2, vec3, vec4, mat3, luminance, add } from 'three/tsl'; +import { Fn, uv, uniform, convertToTexture, vec2, vec3, vec4, mat3, luminance, add } from 'three/tsl'; /** * Post processing node for detecting edges with a sobel filter. @@ -165,4 +165,4 @@ export default SobelOperatorNode; * @param {Node} node - The node that represents the input of the effect. * @returns {SobelOperatorNode} */ -export const sobel = ( node ) => nodeObject( new SobelOperatorNode( convertToTexture( node ) ) ); +export const sobel = ( node ) => new SobelOperatorNode( convertToTexture( node ) ); diff --git a/examples/jsm/tsl/display/StereoPassNode.js b/examples/jsm/tsl/display/StereoPassNode.js index 7dd442963bc7df..261c3429cbd097 100644 --- a/examples/jsm/tsl/display/StereoPassNode.js +++ b/examples/jsm/tsl/display/StereoPassNode.js @@ -1,5 +1,4 @@ import { StereoCamera, Vector2, PassNode, RendererUtils } from 'three/webgpu'; -import { nodeObject } from 'three/tsl'; const _size = /*@__PURE__*/ new Vector2(); @@ -117,4 +116,4 @@ export default StereoPassNode; * @param {Camera} camera - The camera to render the scene with. * @returns {StereoPassNode} */ -export const stereoPass = ( scene, camera ) => nodeObject( new StereoPassNode( scene, camera ) ); +export const stereoPass = ( scene, camera ) => new StereoPassNode( scene, camera ); diff --git a/examples/jsm/tsl/display/TRAANode.js b/examples/jsm/tsl/display/TRAANode.js index 691c5771d58f0c..fbd0d55dfce403 100644 --- a/examples/jsm/tsl/display/TRAANode.js +++ b/examples/jsm/tsl/display/TRAANode.js @@ -1,5 +1,5 @@ import { HalfFloatType, Vector2, RenderTarget, RendererUtils, QuadMesh, NodeMaterial, TempNode, NodeUpdateType, Matrix4, DepthTexture } from 'three/webgpu'; -import { add, float, If, Fn, max, nodeObject, texture, uniform, uv, vec2, vec4, luminance, convertToTexture, passTexture, velocity, getViewPosition, viewZToPerspectiveDepth, struct, ivec2, mix } from 'three/tsl'; +import { add, float, If, Fn, max, texture, uniform, uv, vec2, vec4, luminance, convertToTexture, passTexture, velocity, getViewPosition, viewZToPerspectiveDepth, struct, ivec2, mix } from 'three/tsl'; const _quadMesh = /*@__PURE__*/ new QuadMesh(); const _size = /*@__PURE__*/ new Vector2(); @@ -723,4 +723,4 @@ const _haltonOffsets = /*@__PURE__*/ Array.from( * @param {Camera} camera - The camera the scene is rendered with. * @returns {TRAANode} */ -export const traa = ( beautyNode, depthNode, velocityNode, camera ) => nodeObject( new TRAANode( convertToTexture( beautyNode ), depthNode, velocityNode, camera ) ); +export const traa = ( beautyNode, depthNode, velocityNode, camera ) => new TRAANode( convertToTexture( beautyNode ), depthNode, velocityNode, camera ); diff --git a/examples/jsm/tsl/display/TransitionNode.js b/examples/jsm/tsl/display/TransitionNode.js index d2d745d34a95b4..f5537fc4628059 100644 --- a/examples/jsm/tsl/display/TransitionNode.js +++ b/examples/jsm/tsl/display/TransitionNode.js @@ -138,4 +138,4 @@ export default TransitionNode; * @param {Node | number} useTexture - Whether `mixTextureNode` should influence the transition or not. * @returns {TransitionNode} */ -export const transition = ( nodeA, nodeB, mixTextureNode, mixRatio, threshold, useTexture ) => nodeObject( new TransitionNode( convertToTexture( nodeA ), convertToTexture( nodeB ), convertToTexture( mixTextureNode ), nodeObject( mixRatio ), nodeObject( threshold ), nodeObject( useTexture ) ) ); +export const transition = ( nodeA, nodeB, mixTextureNode, mixRatio, threshold, useTexture ) => new TransitionNode( convertToTexture( nodeA ), convertToTexture( nodeB ), convertToTexture( mixTextureNode ), nodeObject( mixRatio ), nodeObject( threshold ), nodeObject( useTexture ) ); diff --git a/examples/webgpu_occlusion.html b/examples/webgpu_occlusion.html index dd41d99e4f9eea..b3d2daaad5cd2c 100644 --- a/examples/webgpu_occlusion.html +++ b/examples/webgpu_occlusion.html @@ -34,7 +34,7 @@