소스 검색

Global: Move some WebGPU modules from core to addons. (#29511)

* Global: Move some WebGPU modules from core to addons.

* Examples: Fixing some imports.

* More fixes.

* More clean up.

* E2E: Add example to exception list.
Michael Herzog 1 년 전
부모
커밋
cd250e295b
48개의 변경된 파일85개의 추가작업 그리고 270개의 파일을 삭제
  1. 2 14
      examples/jsm/tsl/display/AfterImageNode.js
  2. 2 6
      examples/jsm/tsl/display/AnaglyphPassNode.js
  3. 2 14
      examples/jsm/tsl/display/AnamorphicNode.js
  4. 1 3
      examples/jsm/tsl/display/BleachBypass.js
  5. 2 19
      examples/jsm/tsl/display/BloomNode.js
  6. 2 14
      examples/jsm/tsl/display/DenoiseNode.js
  7. 1 7
      examples/jsm/tsl/display/DepthOfFieldNode.js
  8. 2 9
      examples/jsm/tsl/display/DotScreenNode.js
  9. 2 11
      examples/jsm/tsl/display/FXAANode.js
  10. 1 5
      examples/jsm/tsl/display/FilmNode.js
  11. 2 20
      examples/jsm/tsl/display/GTAONode.js
  12. 2 13
      examples/jsm/tsl/display/GaussianBlurNode.js
  13. 1 4
      examples/jsm/tsl/display/Lut3DNode.js
  14. 2 3
      examples/jsm/tsl/display/MotionBlur.js
  15. 1 5
      examples/jsm/tsl/display/ParallaxBarrierPassNode.js
  16. 2 14
      examples/jsm/tsl/display/PixelationPassNode.js
  17. 1 6
      examples/jsm/tsl/display/RGBShiftNode.js
  18. 2 10
      examples/jsm/tsl/display/SSAAPassNode.js
  19. 1 2
      examples/jsm/tsl/display/Sepia.js
  20. 2 10
      examples/jsm/tsl/display/SobelOperatorNode.js
  21. 2 8
      examples/jsm/tsl/display/StereoCompositePassNode.js
  22. 2 4
      examples/jsm/tsl/display/StereoPassNode.js
  23. 1 6
      examples/jsm/tsl/display/TransitionNode.js
  24. 2 1
      examples/misc_controls_fly.html
  25. 2 1
      examples/webgpu_backdrop_water.html
  26. 3 1
      examples/webgpu_display_stereo.html
  27. 2 1
      examples/webgpu_mrt_mask.html
  28. 3 1
      examples/webgpu_postprocessing.html
  29. 2 1
      examples/webgpu_postprocessing_3dlut.html
  30. 2 1
      examples/webgpu_postprocessing_afterimage.html
  31. 2 1
      examples/webgpu_postprocessing_anamorphic.html
  32. 3 1
      examples/webgpu_postprocessing_ao.html
  33. 2 1
      examples/webgpu_postprocessing_bloom.html
  34. 2 1
      examples/webgpu_postprocessing_bloom_emissive.html
  35. 2 1
      examples/webgpu_postprocessing_bloom_selective.html
  36. 2 1
      examples/webgpu_postprocessing_dof.html
  37. 2 1
      examples/webgpu_postprocessing_fxaa.html
  38. 2 1
      examples/webgpu_postprocessing_motion_blur.html
  39. 2 1
      examples/webgpu_postprocessing_pixel.html
  40. 2 1
      examples/webgpu_postprocessing_sobel.html
  41. 1 1
      examples/webgpu_postprocessing_ssaa.html
  42. 2 1
      examples/webgpu_postprocessing_transition.html
  43. 2 1
      examples/webgpu_procedural_texture.html
  44. 2 1
      examples/webgpu_reflection.html
  45. 2 1
      examples/webgpu_skinning_instancing.html
  46. 0 19
      src/nodes/Nodes.js
  47. 0 22
      src/nodes/TSL.js
  48. 1 0
      test/e2e/puppeteer.js

+ 2 - 14
src/nodes/display/AfterImageNode.js → examples/jsm/tsl/display/AfterImageNode.js

@@ -1,17 +1,5 @@
-import TempNode from '../core/TempNode.js';
-import { nodeObject, Fn, float, vec4 } from '../tsl/TSLBase.js';
-import { NodeUpdateType } from '../core/constants.js';
-import { uv } from '../accessors/UV.js';
-import { texture } from '../accessors/TextureNode.js';
-import { passTexture } from './PassNode.js';
-import { uniform } from '../core/UniformNode.js';
-import { sign, max } from '../math/MathNode.js';
-import { convertToTexture } from '../utils/RTTNode.js';
-import QuadMesh from '../../renderers/common/QuadMesh.js';
-import NodeMaterial from '../../materials/nodes/NodeMaterial.js';
-
-import { Vector2 } from '../../math/Vector2.js';
-import { RenderTarget } from '../../core/RenderTarget.js';
+import { RenderTarget, Vector2 } from 'three';
+import { TempNode, nodeObject, Fn, float, vec4, NodeUpdateType, uv, texture, passTexture, uniform, sign, max, convertToTexture, QuadMesh, NodeMaterial } from 'three/tsl';
 
 
 const _size = /*@__PURE__*/ new Vector2();
 const _size = /*@__PURE__*/ new Vector2();
 
 

+ 2 - 6
src/nodes/display/AnaglyphPassNode.js → examples/jsm/tsl/display/AnaglyphPassNode.js

@@ -1,10 +1,6 @@
-import { Fn, nodeObject, vec4 } from '../tsl/TSLBase.js';
-import { Matrix3 } from '../../math/Matrix3.js';
-import { uniform } from '../core/UniformNode.js';
-import { uv } from '../accessors/UV.js';
-import { clamp, max } from '../math/MathNode.js';
+import { Matrix3 } from 'three';
+import { clamp, nodeObject, Fn, vec4, uv, uniform, max, NodeMaterial } from 'three/tsl';
 import StereoCompositePassNode from './StereoCompositePassNode.js';
 import StereoCompositePassNode from './StereoCompositePassNode.js';
-import NodeMaterial from '../../materials/nodes/NodeMaterial.js';
 
 
 class AnaglyphPassNode extends StereoCompositePassNode {
 class AnaglyphPassNode extends StereoCompositePassNode {
 
 

+ 2 - 14
src/nodes/display/AnamorphicNode.js → examples/jsm/tsl/display/AnamorphicNode.js

@@ -1,17 +1,5 @@
-import TempNode from '../core/TempNode.js';
-import { nodeObject, Fn, float, vec2, vec3 } from '../tsl/TSLBase.js';
-import { Loop } from '../utils/LoopNode.js';
-import { uniform } from '../core/UniformNode.js';
-import { NodeUpdateType } from '../core/constants.js';
-import { threshold } from './ColorAdjustment.js';
-import { uv } from '../accessors/UV.js';
-import { passTexture } from './PassNode.js';
-import { convertToTexture } from '../utils/RTTNode.js';
-import QuadMesh from '../../renderers/common/QuadMesh.js';
-import NodeMaterial from '../../materials/nodes/NodeMaterial.js';
-
-import { Vector2 } from '../../math/Vector2.js';
-import { RenderTarget } from '../../core/RenderTarget.js';
+import { RenderTarget, Vector2 } from 'three';
+import { TempNode, nodeObject, Fn, float, NodeUpdateType, uv, passTexture, uniform, convertToTexture, QuadMesh, NodeMaterial, vec2, vec3, Loop, threshold } from 'three/tsl';
 
 
 const _quadMesh = /*@__PURE__*/ new QuadMesh();
 const _quadMesh = /*@__PURE__*/ new QuadMesh();
 
 

+ 1 - 3
src/nodes/display/BleachBypass.js → examples/jsm/tsl/display/BleachBypass.js

@@ -1,6 +1,4 @@
-import { float, Fn, vec3, vec4 } from '../tsl/TSLBase.js';
-import { min, max, mix } from '../math/MathNode.js';
-import { luminance } from './ColorAdjustment.js';
+import { float, Fn, vec3, vec4, min, max, mix, luminance } from 'three/tsl';
 
 
 export const bleach = /*@__PURE__*/ Fn( ( [ color, opacity = 1 ] ) => {
 export const bleach = /*@__PURE__*/ Fn( ( [ color, opacity = 1 ] ) => {
 
 

+ 2 - 19
src/nodes/display/BloomNode.js → examples/jsm/tsl/display/BloomNode.js

@@ -1,22 +1,5 @@
-import TempNode from '../core/TempNode.js';
-import { Fn, nodeObject, float, vec4, int } from '../tsl/TSLBase.js';
-import { mix, smoothstep } from '../math/MathNode.js';
-import { luminance } from './ColorAdjustment.js';
-import { uniform } from '../core/UniformNode.js';
-import { uniformArray } from '../accessors/UniformArrayNode.js';
-import { uv } from '../accessors/UV.js';
-import { Color } from '../../math/Color.js';
-import { passTexture } from './PassNode.js';
-import { RenderTarget } from '../../core/RenderTarget.js';
-import { HalfFloatType } from '../../constants.js';
-import { NodeUpdateType } from '../core/constants.js';
-import { Vector2 } from '../../math/Vector2.js';
-import { Loop } from '../utils/LoopNode.js';
-import { add } from '../math/OperatorNode.js';
-import QuadMesh from '../../renderers/common/QuadMesh.js';
-import { texture } from '../accessors/TextureNode.js';
-import { Vector3 } from '../../math/Vector3.js';
-import NodeMaterial from '../../materials/nodes/NodeMaterial.js';
+import { Color, HalfFloatType, RenderTarget, Vector2, Vector3 } from 'three';
+import { TempNode, nodeObject, Fn, float, NodeUpdateType, uv, passTexture, uniform, QuadMesh, NodeMaterial, Loop, texture, luminance, smoothstep, mix, vec4, uniformArray, add, int } from 'three/tsl';
 
 
 const _quadMesh = /*@__PURE__*/ new QuadMesh();
 const _quadMesh = /*@__PURE__*/ new QuadMesh();
 
 

+ 2 - 14
src/nodes/display/DenoiseNode.js → examples/jsm/tsl/display/DenoiseNode.js

@@ -1,17 +1,5 @@
-import TempNode from '../core/TempNode.js';
-import { uv } from '../accessors/UV.js';
-import { Fn, nodeObject, float, int, vec2, vec3, vec4, mat2, If } from '../tsl/TSLBase.js';
-import { NodeUpdateType } from '../core/constants.js';
-import { uniform } from '../core/UniformNode.js';
-import { uniformArray } from '../accessors/UniformArrayNode.js';
-import { abs, dot, sin, cos, PI, pow, max } from '../math/MathNode.js';
-import { Loop } from '../utils/LoopNode.js';
-import { luminance } from './ColorAdjustment.js';
-import { textureSize } from '../accessors/TextureSizeNode.js';
-import { convertToTexture } from '../utils/RTTNode.js';
-
-import { Vector2 } from '../../math/Vector2.js';
-import { Vector3 } from '../../math/Vector3.js';
+import { Vector2, Vector3 } from 'three';
+import { convertToTexture, TempNode, nodeObject, Fn, float, NodeUpdateType, uv, uniform, Loop, luminance, vec2, vec3, vec4, uniformArray, int, dot, max, pow, abs, If, textureSize, sin, cos, mat2, PI } from 'three/tsl';
 
 
 class DenoiseNode extends TempNode {
 class DenoiseNode extends TempNode {
 
 

+ 1 - 7
src/nodes/display/DepthOfFieldNode.js → examples/jsm/tsl/display/DepthOfFieldNode.js

@@ -1,10 +1,4 @@
-import TempNode from '../core/TempNode.js';
-import { uv } from '../accessors/UV.js';
-import { Fn, nodeObject, vec2, vec4 } from '../tsl/TSLBase.js';
-import { NodeUpdateType } from '../core/constants.js';
-import { uniform } from '../core/UniformNode.js';
-import { clamp } from '../math/MathNode.js';
-import { convertToTexture } from '../utils/RTTNode.js';
+import { convertToTexture, TempNode, nodeObject, Fn, NodeUpdateType, uv, uniform, vec2, vec4, clamp } from 'three/tsl';
 
 
 class DepthOfFieldNode extends TempNode {
 class DepthOfFieldNode extends TempNode {
 
 

+ 2 - 9
src/nodes/display/DotScreenNode.js → examples/jsm/tsl/display/DotScreenNode.js

@@ -1,12 +1,5 @@
-import TempNode from '../core/TempNode.js';
-import { nodeObject, Fn, vec2, vec3, vec4 } from '../tsl/TSLBase.js';
-import { uniform } from '../core/UniformNode.js';
-import { uv } from '../accessors/UV.js';
-import { sin, cos } from '../math/MathNode.js';
-import { add } from '../math/OperatorNode.js';
-import { screenSize } from './ScreenNode.js';
-
-import { Vector2 } from '../../math/Vector2.js';
+import { Vector2 } from 'three';
+import { TempNode, nodeObject, Fn, uv, uniform, vec2, vec3, sin, cos, add, vec4, screenSize } from 'three/tsl';
 
 
 class DotScreenNode extends TempNode {
 class DotScreenNode extends TempNode {
 
 

+ 2 - 11
src/nodes/display/FXAANode.js → examples/jsm/tsl/display/FXAANode.js

@@ -1,14 +1,5 @@
-import TempNode from '../core/TempNode.js';
-import { uv } from '../accessors/UV.js';
-import { Fn, nodeObject, float, vec2, vec4, int, If } from '../tsl/TSLBase.js';
-import { NodeUpdateType } from '../core/constants.js';
-import { uniform } from '../core/UniformNode.js';
-import { abs, max, min, mix, pow } from '../math/MathNode.js';
-import { sub } from '../math/OperatorNode.js';
-import { Loop, Break } from '../utils/LoopNode.js';
-import { convertToTexture } from '../utils/RTTNode.js';
-
-import { Vector2 } from '../../math/Vector2.js';
+import { Vector2 } from 'three';
+import { TempNode, nodeObject, Fn, float, NodeUpdateType, uv, uniform, convertToTexture, vec2, vec4, If, Loop, int, max, min, pow, mix, Break, abs, sub } from 'three/tsl';
 
 
 class FXAANode extends TempNode {
 class FXAANode extends TempNode {
 
 

+ 1 - 5
src/nodes/display/FilmNode.js → examples/jsm/tsl/display/FilmNode.js

@@ -1,8 +1,4 @@
-import TempNode from '../core/TempNode.js';
-import { uv } from '../accessors/UV.js';
-import { Fn, nodeProxy, vec4 } from '../tsl/TSLBase.js';
-import { mix, fract, clamp, rand } from '../math/MathNode.js';
-import { timerLocal } from '../utils/TimerNode.js';
+import { TempNode, rand, Fn, fract, timerLocal, uv, clamp, mix, vec4, nodeProxy } from 'three/tsl';
 
 
 class FilmNode extends TempNode {
 class FilmNode extends TempNode {
 
 

+ 2 - 20
src/nodes/display/GTAONode.js → examples/jsm/tsl/display/GTAONode.js

@@ -1,23 +1,5 @@
-import TempNode from '../core/TempNode.js';
-import { texture } from '../accessors/TextureNode.js';
-import { textureSize } from '../accessors/TextureSizeNode.js';
-import { uv } from '../accessors/UV.js';
-import { nodeObject, Fn, mat3, vec2, vec3, vec4, float, int, If } from '../tsl/TSLBase.js';
-import { NodeUpdateType } from '../core/constants.js';
-import { uniform } from '../core/UniformNode.js';
-import { DataTexture } from '../../textures/DataTexture.js';
-import { Vector2 } from '../../math/Vector2.js';
-import { Vector3 } from '../../math/Vector3.js';
-import { PI, cos, sin, pow, clamp, abs, max, mix, sqrt, acos, dot, normalize, cross } from '../math/MathNode.js';
-import { div, mul, add, sub } from '../math/OperatorNode.js';
-import { Loop } from '../utils/LoopNode.js';
-import { passTexture } from './PassNode.js';
-import { RepeatWrapping } from '../../constants.js';
-import QuadMesh from '../../renderers/common/QuadMesh.js';
-import NodeMaterial from '../../materials/nodes/NodeMaterial.js';
-
-import { RenderTarget } from '../../core/RenderTarget.js';
-import { Color } from '../../math/Color.js';
+import { Color, DataTexture, RenderTarget, RepeatWrapping, Vector2, Vector3 } from 'three';
+import { QuadMesh, TempNode, nodeObject, Fn, float, NodeUpdateType, uv, uniform, Loop, vec2, vec3, vec4, int, dot, max, pow, abs, If, textureSize, sin, cos, PI, texture, passTexture, mat3, add, normalize, mul, cross, div, mix, sqrt, sub, acos, clamp, NodeMaterial } from 'three/tsl';
 
 
 const _quadMesh = /*@__PURE__*/ new QuadMesh();
 const _quadMesh = /*@__PURE__*/ new QuadMesh();
 const _currentClearColor = /*@__PURE__*/ new Color();
 const _currentClearColor = /*@__PURE__*/ new Color();

+ 2 - 13
src/nodes/display/GaussianBlurNode.js → examples/jsm/tsl/display/GaussianBlurNode.js

@@ -1,16 +1,5 @@
-import TempNode from '../core/TempNode.js';
-import { nodeObject, Fn, float, vec2, vec4 } from '../tsl/TSLBase.js';
-import { NodeUpdateType } from '../core/constants.js';
-import { mul } from '../math/OperatorNode.js';
-import { uv } from '../accessors/UV.js';
-import { passTexture } from './PassNode.js';
-import { uniform } from '../core/UniformNode.js';
-import { convertToTexture } from '../utils/RTTNode.js';
-import QuadMesh from '../../renderers/common/QuadMesh.js';
-
-import { Vector2 } from '../../math/Vector2.js';
-import { RenderTarget } from '../../core/RenderTarget.js';
-import NodeMaterial from '../../materials/nodes/NodeMaterial.js';
+import { RenderTarget, Vector2 } from 'three';
+import { TempNode, nodeObject, Fn, float, NodeUpdateType, uv, uniform, convertToTexture, vec2, vec4, QuadMesh, passTexture, mul, NodeMaterial } from 'three/tsl';
 
 
 // WebGPU: The use of a single QuadMesh for both gaussian blur passes results in a single RenderObject with a SampledTexture binding that
 // WebGPU: The use of a single QuadMesh for both gaussian blur passes results in a single RenderObject with a SampledTexture binding that
 // alternates between source textures and triggers creation of new BindGroups and BindGroupLayouts every frame.
 // alternates between source textures and triggers creation of new BindGroups and BindGroupLayouts every frame.

+ 1 - 4
src/nodes/display/Lut3DNode.js → examples/jsm/tsl/display/Lut3DNode.js

@@ -1,7 +1,4 @@
-import TempNode from '../core/TempNode.js';
-import { Fn, nodeObject, vec3, vec4, float } from '../tsl/TSLBase.js';
-import { uniform } from '../core/UniformNode.js';
-import { mix } from '../math/MathNode.js';
+import { TempNode, nodeObject, Fn, float, uniform, vec3, vec4, mix } from 'three/tsl';
 
 
 class Lut3DNode extends TempNode {
 class Lut3DNode extends TempNode {
 
 

+ 2 - 3
src/nodes/display/MotionBlur.js → examples/jsm/tsl/display/MotionBlur.js

@@ -1,6 +1,5 @@
-import { float, int, Fn } from '../tsl/TSLBase.js';
-import { Loop } from '../utils/LoopNode.js';
-import { uv } from '../accessors/UV.js';
+
+import { Fn, float, uv, Loop, int } from 'three/tsl';
 
 
 export const motionBlur = /*@__PURE__*/ Fn( ( [ inputNode, velocity, numSamples = int( 16 ) ] ) => {
 export const motionBlur = /*@__PURE__*/ Fn( ( [ inputNode, velocity, numSamples = int( 16 ) ] ) => {
 
 

+ 1 - 5
src/nodes/display/ParallaxBarrierPassNode.js → examples/jsm/tsl/display/ParallaxBarrierPassNode.js

@@ -1,9 +1,5 @@
-import { Fn, If, nodeObject, vec4 } from '../tsl/TSLBase.js';
-import { uv } from '../accessors/UV.js';
-import { mod } from '../math/MathNode.js';
-import { screenCoordinate } from './ScreenNode.js';
+import { nodeObject, Fn, vec4, uv, NodeMaterial, If, mod, screenCoordinate } from 'three/tsl';
 import StereoCompositePassNode from './StereoCompositePassNode.js';
 import StereoCompositePassNode from './StereoCompositePassNode.js';
-import NodeMaterial from '../../materials/nodes/NodeMaterial.js';
 
 
 class ParallaxBarrierPassNode extends StereoCompositePassNode {
 class ParallaxBarrierPassNode extends StereoCompositePassNode {
 
 

+ 2 - 14
src/nodes/display/PixelationPassNode.js → examples/jsm/tsl/display/PixelationPassNode.js

@@ -1,17 +1,5 @@
-import TempNode from '../core/TempNode.js';
-import { uv } from '../accessors/UV.js';
-import { Fn, nodeObject, vec2, vec3, float, If } from '../tsl/TSLBase.js';
-import { NodeUpdateType } from '../core/constants.js';
-import { uniform } from '../core/UniformNode.js';
-import { dot, clamp, smoothstep, sign, step, floor } from '../math/MathNode.js';
-import { Vector4 } from '../../math/Vector4.js';
-import { output, property } from '../core/PropertyNode.js';
-import PassNode from './PassNode.js';
-import { mrt } from '../core/MRTNode.js';
-import { normalView } from '../accessors/Normal.js';
-import { convertToTexture } from '../utils/RTTNode.js';
-
-import { NearestFilter } from '../../constants.js';
+import { NearestFilter, Vector4 } from 'three';
+import { TempNode, nodeObject, Fn, float, NodeUpdateType, uv, uniform, convertToTexture, vec2, vec3, clamp, floor, dot, smoothstep, If, sign, step, mrt, output, normalView, PassNode, property } from 'three/tsl';
 
 
 class PixelationNode extends TempNode {
 class PixelationNode extends TempNode {
 
 

+ 1 - 6
src/nodes/display/RGBShiftNode.js → examples/jsm/tsl/display/RGBShiftNode.js

@@ -1,9 +1,4 @@
-import TempNode from '../core/TempNode.js';
-import { nodeObject, Fn, vec2, vec4 } from '../tsl/TSLBase.js';
-import { uniform } from '../core/UniformNode.js';
-import { uv } from '../accessors/UV.js';
-import { sin, cos } from '../math/MathNode.js';
-import { convertToTexture } from '../utils/RTTNode.js';
+import { TempNode, nodeObject, Fn, uv, uniform, vec2, sin, cos, vec4, convertToTexture } from 'three/tsl';
 
 
 class RGBShiftNode extends TempNode {
 class RGBShiftNode extends TempNode {
 
 

+ 2 - 10
src/nodes/display/SSAAPassNode.js → examples/jsm/tsl/display/SSAAPassNode.js

@@ -1,13 +1,5 @@
-import { nodeObject } from '../tsl/TSLBase.js';
-import PassNode from './PassNode.js';
-import { Color } from '../../math/Color.js';
-import { Vector2 } from '../../math/Vector2.js';
-import { AdditiveBlending } from '../../constants.js';
-import { uniform } from '../core/UniformNode.js';
-import QuadMesh from '../../renderers/common/QuadMesh.js';
-import { texture } from '../accessors/TextureNode.js';
-import { mrt, getTextureIndex } from '../core/MRTNode.js';
-import NodeMaterial from '../../materials/nodes/NodeMaterial.js';
+import { AdditiveBlending, Color, Vector2 } from 'three';
+import { nodeObject, uniform, mrt, PassNode, QuadMesh, texture, NodeMaterial, getTextureIndex } from 'three/tsl';
 
 
 const _size = /*@__PURE__*/ new Vector2();
 const _size = /*@__PURE__*/ new Vector2();
 
 

+ 1 - 2
src/nodes/display/Sepia.js → examples/jsm/tsl/display/Sepia.js

@@ -1,5 +1,4 @@
-import { Fn, vec3, vec4 } from '../tsl/TSLBase.js';
-import { dot } from '../math/MathNode.js';
+import { dot, Fn, vec3, vec4 } from 'three/tsl';
 
 
 export const sepia = /*@__PURE__*/ Fn( ( [ color ] ) => {
 export const sepia = /*@__PURE__*/ Fn( ( [ color ] ) => {
 
 

+ 2 - 10
src/nodes/display/SobelOperatorNode.js → examples/jsm/tsl/display/SobelOperatorNode.js

@@ -1,13 +1,5 @@
-import TempNode from '../core/TempNode.js';
-import { uv } from '../accessors/UV.js';
-import { luminance } from './ColorAdjustment.js';
-import { Fn, nodeObject, vec2, vec3, vec4, mat3 } from '../tsl/TSLBase.js';
-import { NodeUpdateType } from '../core/constants.js';
-import { uniform } from '../core/UniformNode.js';
-import { add } from '../math/OperatorNode.js';
-import { convertToTexture } from '../utils/RTTNode.js';
-
-import { Vector2 } from '../../math/Vector2.js';
+import { Vector2 } from 'three';
+import { TempNode, nodeObject, Fn, NodeUpdateType, uv, uniform, convertToTexture, vec2, vec3, vec4, mat3, luminance, add } from 'three/tsl';
 
 
 class SobelOperatorNode extends TempNode {
 class SobelOperatorNode extends TempNode {
 
 

+ 2 - 8
src/nodes/display/StereoCompositePassNode.js → examples/jsm/tsl/display/StereoCompositePassNode.js

@@ -1,11 +1,5 @@
-
-import PassNode from './PassNode.js';
-import { StereoCamera } from '../../cameras/StereoCamera.js';
-import { HalfFloatType, LinearFilter, NearestFilter } from '../../constants.js';
-import { RenderTarget } from '../../core/RenderTarget.js';
-import { texture } from '../accessors/TextureNode.js';
-import { Vector2 } from '../../math/Vector2.js';
-import QuadMesh from '../../renderers/common/QuadMesh.js';
+import { RenderTarget, StereoCamera, HalfFloatType, LinearFilter, NearestFilter, Vector2 } from 'three';
+import { PassNode, QuadMesh, texture } from 'three/tsl';
 
 
 const _size = /*@__PURE__*/ new Vector2();
 const _size = /*@__PURE__*/ new Vector2();
 const _quadMesh = /*@__PURE__*/ new QuadMesh();
 const _quadMesh = /*@__PURE__*/ new QuadMesh();

+ 2 - 4
src/nodes/display/StereoPassNode.js → examples/jsm/tsl/display/StereoPassNode.js

@@ -1,7 +1,5 @@
-import { nodeObject } from '../tsl/TSLBase.js';
-import PassNode from './PassNode.js';
-import { Vector2 } from '../../math/Vector2.js';
-import { StereoCamera } from '../../cameras/StereoCamera.js';
+import { StereoCamera, Vector2 } from 'three';
+import { PassNode, nodeObject } from 'three/tsl';
 
 
 const _size = /*@__PURE__*/ new Vector2();
 const _size = /*@__PURE__*/ new Vector2();
 
 

+ 1 - 6
src/nodes/display/TransitionNode.js → examples/jsm/tsl/display/TransitionNode.js

@@ -1,9 +1,4 @@
-import TempNode from '../core/TempNode.js';
-import { uv } from '../accessors/UV.js';
-import { Fn, nodeObject, float, int, vec4, If } from '../tsl/TSLBase.js';
-import { clamp, mix } from '../math/MathNode.js';
-import { sub } from '../math/OperatorNode.js';
-import { convertToTexture } from '../utils/RTTNode.js';
+import { TempNode, nodeObject, Fn, float, uv, convertToTexture, vec4, If, int, clamp, sub, mix } from 'three/tsl';
 
 
 class TransitionNode extends TempNode {
 class TransitionNode extends TempNode {
 
 

+ 2 - 1
examples/misc_controls_fly.html

@@ -40,7 +40,8 @@
 		<script type="module">
 		<script type="module">
 
 
 			import * as THREE from 'three';
 			import * as THREE from 'three';
-			import { pass, film } from 'three/tsl';
+			import { pass } from 'three/tsl';
+			import { film } from 'three/addons/tsl/display/FilmNode.js';
 
 
 			import Stats from 'three/addons/libs/stats.module.js';
 			import Stats from 'three/addons/libs/stats.module.js';
 			import { FlyControls } from 'three/addons/controls/FlyControls.js';
 			import { FlyControls } from 'three/addons/controls/FlyControls.js';

+ 2 - 1
examples/webgpu_backdrop_water.html

@@ -25,7 +25,8 @@
 		<script type="module">
 		<script type="module">
 
 
 			import * as THREE from 'three';
 			import * as THREE from 'three';
-			import { color, vec2, pass, linearDepth, normalWorld, gaussianBlur, triplanarTexture, texture, objectPosition, screenUV, viewportLinearDepth, viewportDepthTexture, viewportSharedTexture, mx_worley_noise_float, positionWorld, timerLocal } from 'three/tsl';
+			import { color, vec2, pass, linearDepth, normalWorld, triplanarTexture, texture, objectPosition, screenUV, viewportLinearDepth, viewportDepthTexture, viewportSharedTexture, mx_worley_noise_float, positionWorld, timerLocal } from 'three/tsl';
+			import { gaussianBlur } from 'three/addons/tsl/display/GaussianBlurNode.js';
 
 
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
 
 

+ 3 - 1
examples/webgpu_display_stereo.html

@@ -26,7 +26,9 @@
 
 
 			import * as THREE from 'three';
 			import * as THREE from 'three';
 
 
-			import { stereoPass, anaglyphPass, parallaxBarrierPass } from 'three/tsl';
+			import { stereoPass } from 'three/addons/tsl/display/StereoPassNode.js';
+			import { anaglyphPass } from 'three/addons/tsl/display/AnaglyphPassNode.js';
+			import { parallaxBarrierPass } from 'three/addons/tsl/display/ParallaxBarrierPassNode.js';
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 			import { Timer } from 'three/addons/misc/Timer.js';
 			import { Timer } from 'three/addons/misc/Timer.js';
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';

+ 2 - 1
examples/webgpu_mrt_mask.html

@@ -26,7 +26,8 @@
 		<script type="module">
 		<script type="module">
 
 
 			import * as THREE from 'three';
 			import * as THREE from 'three';
-			import { color, screenUV, mrt, output, gaussianBlur, pass, vec4 } from 'three/tsl';
+			import { color, screenUV, mrt, output, pass, vec4 } from 'three/tsl';
+			import { gaussianBlur } from 'three/addons/tsl/display/GaussianBlurNode.js';
 
 
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
 
 

+ 3 - 1
examples/webgpu_postprocessing.html

@@ -20,7 +20,9 @@
 		<script type="module">
 		<script type="module">
 
 
 			import * as THREE from 'three';
 			import * as THREE from 'three';
-			import { pass, dotScreen, rgbShift } from 'three/tsl';
+			import { pass } from 'three/tsl';
+			import { dotScreen } from 'three/addons/tsl/display/DotScreenNode.js';
+			import { rgbShift } from 'three/addons/tsl/display/RGBShiftNode.js';
 
 
 			let camera, renderer, postProcessing;
 			let camera, renderer, postProcessing;
 			let object;
 			let object;

+ 2 - 1
examples/webgpu_postprocessing_3dlut.html

@@ -29,7 +29,8 @@
 		<script type="module">
 		<script type="module">
 
 
 			import * as THREE from 'three';
 			import * as THREE from 'three';
-			import { pass, texture3D, uniform, lut3D, renderOutput } from 'three/tsl';
+			import { pass, texture3D, uniform, renderOutput } from 'three/tsl';
+			import { lut3D } from 'three/addons/tsl/display/Lut3DNode.js';
 
 
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';

+ 2 - 1
examples/webgpu_postprocessing_afterimage.html

@@ -20,7 +20,8 @@
 		<script type="module">
 		<script type="module">
 
 
 			import * as THREE from 'three';
 			import * as THREE from 'three';
-			import { pass, afterImage } from 'three/tsl';
+			import { pass } from 'three/tsl';
+			import { afterImage } from 'three/addons/tsl/display/AfterImageNode.js';
 
 
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
 
 

+ 2 - 1
examples/webgpu_postprocessing_anamorphic.html

@@ -27,7 +27,8 @@
 		<script type="module">
 		<script type="module">
 
 
 			import * as THREE from 'three';
 			import * as THREE from 'three';
-			import { pass, cubeTexture, screenUV, grayscale, uniform, anamorphic } from 'three/tsl';
+			import { pass, cubeTexture, screenUV, grayscale, uniform } from 'three/tsl';
+			import { anamorphic } from 'three/addons/tsl/display/AnamorphicNode.js';
 
 
 			import { RGBMLoader } from 'three/addons/loaders/RGBMLoader.js';
 			import { RGBMLoader } from 'three/addons/loaders/RGBMLoader.js';
 
 

+ 3 - 1
examples/webgpu_postprocessing_ao.html

@@ -20,7 +20,9 @@
 		<script type="module">
 		<script type="module">
 
 
 			import * as THREE from 'three';
 			import * as THREE from 'three';
-			import { pass, mrt, output, transformedNormalView, texture, ao, denoise } from 'three/tsl';
+			import { pass, mrt, output, transformedNormalView, texture } from 'three/tsl';
+			import { ao } from 'three/addons/tsl/display/GTAONode.js';
+			import { denoise } from 'three/addons/tsl/display/DenoiseNode.js';
 
 
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 			import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js';
 			import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js';

+ 2 - 1
examples/webgpu_postprocessing_bloom.html

@@ -37,7 +37,8 @@
 		<script type="module">
 		<script type="module">
 
 
 			import * as THREE from 'three';
 			import * as THREE from 'three';
-			import { pass, bloom } from 'three/tsl';
+			import { pass } from 'three/tsl';
+			import { bloom } from 'three/addons/tsl/display/BloomNode.js';
 
 
 			import Stats from 'three/addons/libs/stats.module.js';
 			import Stats from 'three/addons/libs/stats.module.js';
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';

+ 2 - 1
examples/webgpu_postprocessing_bloom_emissive.html

@@ -25,7 +25,8 @@
 		<script type="module">
 		<script type="module">
 
 
 			import * as THREE from 'three';
 			import * as THREE from 'three';
-			import { pass, mrt, output, bloom, emissive } from 'three/tsl';
+			import { pass, mrt, output, emissive } from 'three/tsl';
+			import { bloom } from 'three/addons/tsl/display/BloomNode.js';
 
 
 			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
 			import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
 
 

+ 2 - 1
examples/webgpu_postprocessing_bloom_selective.html

@@ -25,7 +25,8 @@
 		<script type="module">
 		<script type="module">
 
 
 			import * as THREE from 'three';
 			import * as THREE from 'three';
-			import { pass, mrt, output, float, bloom, uniform } from 'three/tsl';
+			import { pass, mrt, output, float, uniform } from 'three/tsl';
+			import { bloom } from 'three/addons/tsl/display/BloomNode.js';
 
 
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 
 

+ 2 - 1
examples/webgpu_postprocessing_dof.html

@@ -20,7 +20,8 @@
 		<script type="module">
 		<script type="module">
 
 
 			import * as THREE from 'three';
 			import * as THREE from 'three';
-			import { cubeTexture, positionWorld, oscSine, timerGlobal, pass, dof, uniform } from 'three/tsl';
+			import { cubeTexture, positionWorld, oscSine, timerGlobal, pass, uniform } from 'three/tsl';
+			import { dof } from 'three/addons/tsl/display/DepthOfFieldNode.js';
 
 
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
 
 

+ 2 - 1
examples/webgpu_postprocessing_fxaa.html

@@ -22,7 +22,8 @@
 		<script type="module">
 		<script type="module">
 
 
 			import * as THREE from 'three';
 			import * as THREE from 'three';
-			import { pass, fxaa, renderOutput } from 'three/tsl';
+			import { pass, renderOutput } from 'three/tsl';
+			import { fxaa } from 'three/addons/tsl/display/FXAANode.js';
 
 
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
 
 

+ 2 - 1
examples/webgpu_postprocessing_motion_blur.html

@@ -25,7 +25,8 @@
 		<script type="module">
 		<script type="module">
 
 
 			import * as THREE from 'three';
 			import * as THREE from 'three';
-			import { pass, texture, motionBlur, uniform, output, mrt, mix, velocity, uv, screenUV } from 'three/tsl';
+			import { pass, texture, uniform, output, mrt, mix, velocity, uv, screenUV } from 'three/tsl';
+			import { motionBlur } from 'three/addons/tsl/display/MotionBlur.js';
 
 
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
 
 

+ 2 - 1
examples/webgpu_postprocessing_pixel.html

@@ -33,7 +33,8 @@
 		import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 		import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 		import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
 		import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
 
 
-		import { uniform, pixelationPass } from 'three/tsl';
+		import { uniform } from 'three/tsl';
+		import { pixelationPass } from 'three/addons/tsl/display/PixelationPassNode.js';
 
 
 		let camera, scene, renderer, postProcessing, crystalMesh, clock;
 		let camera, scene, renderer, postProcessing, crystalMesh, clock;
 		let gui, effectController;
 		let gui, effectController;

+ 2 - 1
examples/webgpu_postprocessing_sobel.html

@@ -20,7 +20,8 @@
 		<script type="module">
 		<script type="module">
 
 
 			import * as THREE from 'three';
 			import * as THREE from 'three';
-			import { pass, sobel } from 'three/tsl';
+			import { pass } from 'three/tsl';
+			import { sobel } from 'three/addons/tsl/display/SobelOperatorNode.js';
 
 
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 			import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
 
 

+ 1 - 1
examples/webgpu_postprocessing_ssaa.html

@@ -24,7 +24,7 @@
 		<script type="module">
 		<script type="module">
 
 
 			import * as THREE from 'three';
 			import * as THREE from 'three';
-			import { ssaaPass } from 'three/tsl';
+			import { ssaaPass } from 'three/addons/tsl/display/SSAAPassNode.js';
 
 
 			import { Timer } from 'three/addons/misc/Timer.js';
 			import { Timer } from 'three/addons/misc/Timer.js';
 			import Stats from 'three/addons/libs/stats.module.js';
 			import Stats from 'three/addons/libs/stats.module.js';

+ 2 - 1
examples/webgpu_postprocessing_transition.html

@@ -29,7 +29,8 @@
 
 
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
 			import TWEEN from 'three/addons/libs/tween.module.js';
 			import TWEEN from 'three/addons/libs/tween.module.js';
-			import { uniform, transition, pass } from 'three/tsl';
+			import { uniform, pass } from 'three/tsl';
+			import { transition } from 'three/addons/tsl/display/TransitionNode.js';
 
 
 			let renderer, postProcessing, transitionController, transitionPass;
 			let renderer, postProcessing, transitionController, transitionPass;
 
 

+ 2 - 1
examples/webgpu_procedural_texture.html

@@ -24,7 +24,8 @@
 		<script type="module">
 		<script type="module">
 
 
 			import * as THREE from 'three';
 			import * as THREE from 'three';
-			import { checker, uv, uniform, gaussianBlur, convertToTexture } from 'three/tsl';
+			import { checker, uv, uniform, convertToTexture } from 'three/tsl';
+			import { gaussianBlur } from 'three/addons/tsl/display/GaussianBlurNode.js';
 
 
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
 			import { GUI } from 'three/addons/libs/lil-gui.module.min.js';
 
 

+ 2 - 1
examples/webgpu_reflection.html

@@ -25,7 +25,8 @@
 		<script type="module">
 		<script type="module">
 
 
 			import * as THREE from 'three';
 			import * as THREE from 'three';
-			import { color, pass, reflector, normalWorld, texture, uv, screenUV, gaussianBlur } from 'three/tsl';
+			import { color, pass, reflector, normalWorld, texture, uv, screenUV } from 'three/tsl';
+			import { gaussianBlur } from 'three/addons/tsl/display/GaussianBlurNode.js';
 
 
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
 
 

+ 2 - 1
examples/webgpu_skinning_instancing.html

@@ -25,7 +25,8 @@
 		<script type="module">
 		<script type="module">
 
 
 			import * as THREE from 'three';
 			import * as THREE from 'three';
-			import { pass, mix, range, color, oscSine, timerLocal, gaussianBlur } from 'three/tsl';
+			import { pass, mix, range, color, oscSine, timerLocal } from 'three/tsl';
+			import { gaussianBlur } from 'three/addons/tsl/display/GaussianBlurNode.js';
 
 
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
 			import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
 
 

+ 0 - 19
src/nodes/Nodes.js

@@ -93,26 +93,7 @@ export { default as ViewportTextureNode } from './display/ViewportTextureNode.js
 export { default as ViewportSharedTextureNode } from './display/ViewportSharedTextureNode.js';
 export { default as ViewportSharedTextureNode } from './display/ViewportSharedTextureNode.js';
 export { default as ViewportDepthTextureNode } from './display/ViewportDepthTextureNode.js';
 export { default as ViewportDepthTextureNode } from './display/ViewportDepthTextureNode.js';
 export { default as ViewportDepthNode } from './display/ViewportDepthNode.js';
 export { default as ViewportDepthNode } from './display/ViewportDepthNode.js';
-export { default as GaussianBlurNode } from './display/GaussianBlurNode.js';
-export { default as AfterImageNode } from './display/AfterImageNode.js';
-export { default as AnamorphicNode } from './display/AnamorphicNode.js';
-export { default as SobelOperatorNode } from './display/SobelOperatorNode.js';
-export { default as DepthOfFieldNode } from './display/DepthOfFieldNode.js';
-export { default as DotScreenNode } from './display/DotScreenNode.js';
-export { default as RGBShiftNode } from './display/RGBShiftNode.js';
-export { default as FilmNode } from './display/FilmNode.js';
-export { default as Lut3DNode } from './display/Lut3DNode.js';
-export { default as GTAONode } from './display/GTAONode.js';
-export { default as DenoiseNode } from './display/DenoiseNode.js';
-export { default as FXAANode } from './display/FXAANode.js';
-export { default as BloomNode } from './display/BloomNode.js';
-export { default as TransitionNode } from './display/TransitionNode.js';
 export { default as RenderOutputNode } from './display/RenderOutputNode.js';
 export { default as RenderOutputNode } from './display/RenderOutputNode.js';
-export { default as PixelationPassNode } from './display/PixelationPassNode.js';
-export { default as SSAAPassNode } from './display/SSAAPassNode.js';
-export { default as StereoPassNode } from './display/StereoPassNode.js';
-export { default as AnaglyphPassNode } from './display/AnaglyphPassNode.js';
-export { default as ParallaxBarrierPassNode } from './display/ParallaxBarrierPassNode.js';
 export { default as PassNode } from './display/PassNode.js';
 export { default as PassNode } from './display/PassNode.js';
 export { default as ToonOutlinePassNode } from './display/ToonOutlinePassNode.js';
 export { default as ToonOutlinePassNode } from './display/ToonOutlinePassNode.js';
 
 

+ 0 - 22
src/nodes/TSL.js

@@ -95,29 +95,7 @@ export * from './display/ViewportTextureNode.js';
 export * from './display/ViewportSharedTextureNode.js';
 export * from './display/ViewportSharedTextureNode.js';
 export * from './display/ViewportDepthTextureNode.js';
 export * from './display/ViewportDepthTextureNode.js';
 export * from './display/ViewportDepthNode.js';
 export * from './display/ViewportDepthNode.js';
-export * from './display/GaussianBlurNode.js';
-export * from './display/AfterImageNode.js';
-export * from './display/AnamorphicNode.js';
-export * from './display/SobelOperatorNode.js';
-export * from './display/DepthOfFieldNode.js';
-export * from './display/DotScreenNode.js';
-export * from './display/RGBShiftNode.js';
-export * from './display/FilmNode.js';
-export * from './display/Lut3DNode.js';
-export * from './display/MotionBlur.js';
-export * from './display/GTAONode.js';
-export * from './display/DenoiseNode.js';
-export * from './display/FXAANode.js';
-export * from './display/BloomNode.js';
-export * from './display/TransitionNode.js';
 export * from './display/RenderOutputNode.js';
 export * from './display/RenderOutputNode.js';
-export * from './display/PixelationPassNode.js';
-export * from './display/SSAAPassNode.js';
-export * from './display/StereoPassNode.js';
-export * from './display/AnaglyphPassNode.js';
-export * from './display/ParallaxBarrierPassNode.js';
-export * from './display/BleachBypass.js';
-export * from './display/Sepia.js';
 export * from './display/ToonOutlinePassNode.js';
 export * from './display/ToonOutlinePassNode.js';
 
 
 export * from './display/PassNode.js';
 export * from './display/PassNode.js';

+ 1 - 0
test/e2e/puppeteer.js

@@ -153,6 +153,7 @@ const exceptionList = [
 	'webgpu_tsl_vfx_linkedparticles',
 	'webgpu_tsl_vfx_linkedparticles',
 	'webgpu_tsl_vfx_tornado',
 	'webgpu_tsl_vfx_tornado',
 	'webgpu_textures_anisotropy',
 	'webgpu_textures_anisotropy',
+	'webgpu_backdrop_water',
 
 
 	// WebGPU idleTime and parseTime too low
 	// WebGPU idleTime and parseTime too low
 	'webgpu_compute_particles',
 	'webgpu_compute_particles',

粤ICP备19079148号