super-three 0.168.0 → 0.169.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/three.cjs +384 -700
- package/build/three.module.js +384 -700
- package/build/three.module.min.js +1 -1
- package/build/three.webgpu.js +24644 -22406
- package/build/three.webgpu.min.js +1 -1
- package/build/three.webgpu.nodes.js +79941 -0
- package/build/three.webgpu.nodes.min.js +6 -0
- package/examples/jsm/Addons.js +0 -6
- package/examples/jsm/controls/TrackballControls.js +32 -12
- package/examples/jsm/controls/TransformControls.js +97 -62
- package/examples/jsm/exporters/DRACOExporter.js +4 -2
- package/examples/jsm/exporters/EXRExporter.js +19 -11
- package/examples/jsm/exporters/KTX2Exporter.js +21 -13
- package/examples/jsm/exporters/OBJExporter.js +5 -1
- package/examples/jsm/exporters/PLYExporter.js +9 -7
- package/examples/jsm/geometries/DecalGeometry.js +4 -1
- package/examples/jsm/geometries/InstancedPointsGeometry.js +1 -1
- package/examples/jsm/helpers/LightProbeHelper.js +1 -1
- package/examples/jsm/helpers/LightProbeHelperGPU.js +65 -0
- package/examples/jsm/libs/basis/basis_transcoder.js +8 -10
- package/examples/jsm/libs/basis/basis_transcoder.wasm +0 -0
- package/examples/jsm/libs/ktx-parse.module.js +1 -1
- package/examples/jsm/lights/LightProbeGenerator.js +24 -10
- package/examples/jsm/loaders/ColladaLoader.js +9 -6
- package/examples/jsm/loaders/DRACOLoader.js +3 -1
- package/examples/jsm/loaders/FBXLoader.js +30 -20
- package/examples/jsm/loaders/GLTFLoader.js +5 -10
- package/examples/jsm/loaders/KTX2Loader.js +10 -7
- package/examples/jsm/loaders/MTLLoader.js +4 -3
- package/examples/jsm/loaders/MaterialXLoader.js +29 -10
- package/examples/jsm/loaders/OBJLoader.js +5 -3
- package/examples/jsm/loaders/PCDLoader.js +5 -4
- package/examples/jsm/loaders/PDBLoader.js +3 -2
- package/examples/jsm/loaders/PLYLoader.js +8 -5
- package/examples/jsm/loaders/STLLoader.js +3 -2
- package/examples/jsm/loaders/VRMLLoader.js +10 -10
- package/examples/jsm/loaders/VTKLoader.js +4 -3
- package/examples/jsm/loaders/XYZLoader.js +3 -2
- package/examples/jsm/misc/Timer.js +1 -1
- package/examples/jsm/modifiers/CurveModifierGPU.js +233 -0
- package/examples/jsm/objects/LensflareMesh.js +322 -0
- package/examples/jsm/objects/SkyMesh.js +1 -2
- package/examples/jsm/objects/Water2Mesh.js +2 -3
- package/examples/jsm/objects/WaterMesh.js +1 -2
- package/examples/jsm/physics/JoltPhysics.js +1 -1
- package/examples/jsm/physics/RapierPhysics.js +1 -1
- package/examples/jsm/transpiler/GLSLDecoder.js +1 -1
- package/examples/jsm/transpiler/ShaderToyDecoder.js +2 -2
- package/examples/jsm/utils/GeometryCompressionUtils.js +37 -122
- package/examples/jsm/utils/ShadowMapViewer.js +3 -8
- package/examples/jsm/utils/ShadowMapViewerGPU.js +201 -0
- package/examples/jsm/utils/SkeletonUtils.js +84 -66
- package/examples/jsm/utils/TextureUtils.js +1 -0
- package/examples/jsm/utils/TextureUtilsGPU.js +63 -0
- package/examples/jsm/webxr/XRControllerModelFactory.js +1 -1
- package/package.json +2 -2
- package/src/Three.WebGPU.Nodes.js +200 -0
- package/src/Three.WebGPU.js +2 -1
- package/src/audio/Audio.js +2 -2
- package/src/constants.js +1 -1
- package/src/core/BufferAttribute.js +0 -9
- package/src/core/Clock.js +1 -1
- package/src/core/InterleavedBuffer.js +0 -9
- package/src/extras/Controls.js +1 -1
- package/src/geometries/CylinderGeometry.js +11 -4
- package/src/loaders/MaterialLoader.js +7 -1
- package/src/loaders/nodes/NodeLoader.js +24 -4
- package/src/loaders/nodes/NodeMaterialLoader.js +21 -17
- package/src/loaders/nodes/NodeObjectLoader.js +19 -0
- package/src/materials/nodes/InstancedPointsNodeMaterial.js +19 -34
- package/src/materials/nodes/Line2NodeMaterial.js +26 -26
- package/src/materials/nodes/LineBasicNodeMaterial.js +7 -3
- package/src/materials/nodes/LineDashedNodeMaterial.js +7 -3
- package/src/materials/nodes/MeshBasicNodeMaterial.js +7 -3
- package/src/materials/nodes/MeshLambertNodeMaterial.js +7 -3
- package/src/materials/nodes/MeshMatcapNodeMaterial.js +7 -3
- package/src/materials/nodes/MeshNormalNodeMaterial.js +7 -3
- package/src/materials/nodes/MeshPhongNodeMaterial.js +7 -3
- package/src/materials/nodes/MeshPhysicalNodeMaterial.js +6 -3
- package/src/materials/nodes/MeshSSSNodeMaterial.js +6 -3
- package/src/materials/nodes/MeshStandardNodeMaterial.js +7 -3
- package/src/materials/nodes/MeshToonNodeMaterial.js +7 -3
- package/src/materials/nodes/NodeMaterial.js +20 -45
- package/src/materials/nodes/NodeMaterials.js +2 -0
- package/src/materials/nodes/PointsNodeMaterial.js +7 -3
- package/src/materials/nodes/ShadowNodeMaterial.js +7 -3
- package/src/materials/nodes/SpriteNodeMaterial.js +39 -6
- package/src/materials/nodes/VolumeNodeMaterial.js +13 -9
- package/src/materials/nodes/manager/NodeMaterialObserver.js +302 -0
- package/src/math/Triangle.js +24 -0
- package/src/nodes/Nodes.js +3 -3
- package/src/nodes/TSL.js +96 -93
- package/src/nodes/accessors/BatchNode.js +7 -3
- package/src/nodes/accessors/BufferAttributeNode.js +6 -3
- package/src/nodes/accessors/BufferNode.js +6 -3
- package/src/nodes/accessors/Camera.js +10 -16
- package/src/nodes/accessors/ClippingNode.js +7 -3
- package/src/nodes/accessors/CubeTextureNode.js +6 -3
- package/src/nodes/accessors/InstanceNode.js +11 -11
- package/src/nodes/accessors/InstancedPointsMaterialNode.js +6 -3
- package/src/nodes/accessors/Lights.js +51 -0
- package/src/nodes/accessors/MaterialNode.js +8 -4
- package/src/nodes/accessors/MaterialReferenceNode.js +6 -3
- package/src/nodes/accessors/ModelNode.js +42 -7
- package/src/nodes/accessors/ModelViewProjectionNode.js +9 -5
- package/src/nodes/accessors/MorphNode.js +7 -3
- package/src/nodes/accessors/Normal.js +32 -6
- package/src/nodes/accessors/Object3DNode.js +11 -27
- package/src/nodes/accessors/PointUVNode.js +7 -3
- package/src/nodes/accessors/ReferenceBaseNode.js +32 -4
- package/src/nodes/accessors/ReferenceNode.js +40 -3
- package/src/nodes/accessors/RendererReferenceNode.js +9 -3
- package/src/nodes/accessors/SceneNode.js +7 -3
- package/src/nodes/accessors/SkinningNode.js +7 -3
- package/src/nodes/accessors/StorageBufferNode.js +21 -3
- package/src/nodes/accessors/StorageTextureNode.js +7 -4
- package/src/nodes/accessors/Texture3DNode.js +7 -4
- package/src/nodes/accessors/TextureNode.js +19 -8
- package/src/nodes/accessors/TextureSizeNode.js +8 -5
- package/src/nodes/accessors/UniformArrayNode.js +12 -9
- package/src/nodes/accessors/UserDataNode.js +9 -6
- package/src/nodes/accessors/VelocityNode.js +74 -23
- package/src/nodes/accessors/VertexColorNode.js +6 -3
- package/src/nodes/code/CodeNode.js +7 -3
- package/src/nodes/code/ExpressionNode.js +8 -4
- package/src/nodes/code/FunctionCallNode.js +6 -3
- package/src/nodes/code/FunctionNode.js +6 -3
- package/src/nodes/code/ScriptableNode.js +11 -6
- package/src/nodes/code/ScriptableValueNode.js +7 -3
- package/src/nodes/core/AssignNode.js +9 -6
- package/src/nodes/core/AttributeNode.js +7 -3
- package/src/nodes/core/BypassNode.js +8 -4
- package/src/nodes/core/CacheNode.js +8 -4
- package/src/nodes/core/ConstNode.js +6 -3
- package/src/nodes/core/ContextNode.js +7 -3
- package/src/nodes/core/IndexNode.js +25 -3
- package/src/nodes/core/InputNode.js +7 -3
- package/src/nodes/core/MRTNode.js +6 -3
- package/src/nodes/core/Node.js +10 -51
- package/src/nodes/core/NodeBuilder.js +71 -5
- package/src/nodes/core/NodeUtils.js +48 -6
- package/src/nodes/core/OutputStructNode.js +8 -4
- package/src/nodes/core/ParameterNode.js +6 -3
- package/src/nodes/core/PropertyNode.js +7 -3
- package/src/nodes/core/StackNode.js +7 -3
- package/src/nodes/core/StructTypeNode.js +7 -3
- package/src/nodes/core/TempNode.js +8 -4
- package/src/nodes/core/UniformGroupNode.js +10 -6
- package/src/nodes/core/UniformNode.js +6 -3
- package/src/nodes/core/VarNode.js +8 -4
- package/src/nodes/core/VaryingNode.js +7 -3
- package/src/nodes/display/AfterImageNode.js +6 -0
- package/src/nodes/display/AnaglyphPassNode.js +6 -0
- package/src/nodes/display/AnamorphicNode.js +6 -0
- package/src/nodes/display/BloomNode.js +6 -0
- package/src/nodes/display/BumpMapNode.js +6 -0
- package/src/nodes/display/ColorSpaceFunctions.js +4 -4
- package/src/nodes/display/ColorSpaceNode.js +43 -14
- package/src/nodes/display/DenoiseNode.js +6 -3
- package/src/nodes/display/DepthOfFieldNode.js +6 -3
- package/src/nodes/display/DotScreenNode.js +8 -5
- package/src/nodes/display/FXAANode.js +6 -3
- package/src/nodes/display/FilmNode.js +6 -3
- package/src/nodes/display/FrontFacingNode.js +7 -3
- package/src/nodes/display/GTAONode.js +6 -3
- package/src/nodes/display/GaussianBlurNode.js +6 -3
- package/src/nodes/display/Lut3DNode.js +6 -3
- package/src/nodes/display/NormalMapNode.js +8 -6
- package/src/nodes/display/ParallaxBarrierPassNode.js +8 -5
- package/src/nodes/display/PassNode.js +18 -7
- package/src/nodes/display/PixelationPassNode.js +12 -5
- package/src/nodes/display/PosterizeNode.js +6 -3
- package/src/nodes/display/RGBShiftNode.js +6 -3
- package/src/nodes/display/RenderOutputNode.js +12 -8
- package/src/nodes/display/SSAAPassNode.js +6 -3
- package/src/nodes/display/ScreenNode.js +181 -0
- package/src/nodes/display/SobelOperatorNode.js +6 -3
- package/src/nodes/display/StereoCompositePassNode.js +6 -3
- package/src/nodes/display/StereoPassNode.js +6 -3
- package/src/nodes/display/ToneMappingFunctions.js +12 -12
- package/src/nodes/display/ToneMappingNode.js +8 -7
- package/src/nodes/display/ToonOutlinePassNode.js +111 -0
- package/src/nodes/display/TransitionNode.js +6 -3
- package/src/nodes/display/ViewportDepthNode.js +7 -3
- package/src/nodes/display/ViewportDepthTextureNode.js +8 -5
- package/src/nodes/display/ViewportSharedTextureNode.js +8 -5
- package/src/nodes/display/ViewportTextureNode.js +8 -5
- package/src/nodes/fog/FogExp2Node.js +6 -3
- package/src/nodes/fog/FogNode.js +7 -3
- package/src/nodes/fog/FogRangeNode.js +6 -3
- package/src/nodes/functions/PhysicalLightingModel.js +2 -2
- package/src/nodes/functions/material/getShIrradianceAt.js +28 -0
- package/src/nodes/geometry/RangeNode.js +7 -3
- package/src/nodes/gpgpu/AtomicFunctionNode.js +99 -0
- package/src/nodes/gpgpu/BarrierNode.js +40 -0
- package/src/nodes/gpgpu/ComputeBuiltinNode.js +98 -0
- package/src/nodes/gpgpu/ComputeNode.js +8 -4
- package/src/nodes/gpgpu/WorkgroupInfoNode.js +100 -0
- package/src/nodes/lighting/AONode.js +6 -3
- package/src/nodes/lighting/AmbientLightNode.js +6 -3
- package/src/nodes/lighting/AnalyticLightNode.js +198 -30
- package/src/nodes/lighting/BasicEnvironmentNode.js +6 -3
- package/src/nodes/lighting/BasicLightMapNode.js +6 -3
- package/src/nodes/lighting/DirectionalLightNode.js +7 -4
- package/src/nodes/lighting/EnvironmentNode.js +6 -3
- package/src/nodes/lighting/HemisphereLightNode.js +10 -6
- package/src/nodes/lighting/IESSpotLightNode.js +6 -3
- package/src/nodes/lighting/IrradianceNode.js +6 -3
- package/src/nodes/lighting/LightProbeNode.js +8 -31
- package/src/nodes/lighting/LightingContextNode.js +6 -3
- package/src/nodes/lighting/LightingNode.js +7 -3
- package/src/nodes/lighting/LightsNode.js +24 -5
- package/src/nodes/lighting/PointLightNode.js +11 -7
- package/src/nodes/lighting/RectAreaLightNode.js +11 -7
- package/src/nodes/lighting/SpotLightNode.js +13 -10
- package/src/nodes/math/ConditionalNode.js +23 -6
- package/src/nodes/math/MathNode.js +6 -3
- package/src/nodes/math/OperatorNode.js +6 -3
- package/src/nodes/pmrem/PMREMNode.js +6 -3
- package/src/nodes/utils/ArrayElementNode.js +8 -4
- package/src/nodes/utils/ConvertNode.js +7 -3
- package/src/nodes/utils/CubeMapNode.js +6 -3
- package/src/nodes/utils/EquirectUVNode.js +6 -3
- package/src/nodes/utils/FlipNode.js +7 -4
- package/src/nodes/utils/FunctionOverloadingNode.js +7 -3
- package/src/nodes/utils/JoinNode.js +6 -3
- package/src/nodes/utils/LoopNode.js +7 -3
- package/src/nodes/utils/MatcapUVNode.js +6 -3
- package/src/nodes/utils/MaxMipLevelNode.js +6 -3
- package/src/nodes/utils/OscNode.js +7 -3
- package/src/nodes/utils/RTTNode.js +6 -3
- package/src/nodes/utils/ReflectorNode.js +8 -5
- package/src/nodes/utils/RemapNode.js +7 -3
- package/src/nodes/utils/RotateNode.js +6 -3
- package/src/nodes/utils/SetNode.js +7 -4
- package/src/nodes/utils/SplitNode.js +7 -3
- package/src/nodes/utils/SpriteSheetUVNode.js +7 -3
- package/src/nodes/utils/StorageArrayElementNode.js +9 -8
- package/src/nodes/utils/TimerNode.js +6 -3
- package/src/nodes/utils/TriplanarTexturesNode.js +7 -3
- package/src/nodes/utils/ViewportUtils.js +2 -2
- package/src/objects/BatchedMesh.js +76 -10
- package/src/objects/LOD.js +21 -0
- package/src/objects/Line.js +1 -0
- package/src/objects/Mesh.js +7 -23
- package/src/objects/Points.js +2 -0
- package/src/renderers/WebGLRenderer.js +65 -50
- package/src/renderers/common/BundleGroup.js +26 -0
- package/src/renderers/common/ClippingContext.js +4 -3
- package/src/renderers/common/RenderContext.js +4 -5
- package/src/renderers/common/RenderObject.js +116 -5
- package/src/renderers/common/RenderObjects.js +8 -1
- package/src/renderers/common/Renderer.js +57 -49
- package/src/renderers/common/extras/PMREMGenerator.js +7 -9
- package/src/renderers/common/nodes/NodeBuilderState.js +3 -3
- package/src/renderers/common/nodes/Nodes.js +33 -14
- package/src/renderers/shaders/ShaderLib/sprite.glsl.js +2 -4
- package/src/renderers/webgl/WebGLAttributes.js +45 -14
- package/src/renderers/webgl/WebGLCapabilities.js +9 -0
- package/src/renderers/webgl/WebGLProgram.js +2 -0
- package/src/renderers/webgl/WebGLPrograms.js +21 -17
- package/src/renderers/webgl/WebGLState.js +21 -0
- package/src/renderers/webgl/WebGLTextures.js +22 -0
- package/src/renderers/webgl-fallback/WebGLBackend.js +50 -45
- package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +4 -4
- package/src/renderers/webgl-fallback/utils/WebGLAttributeUtils.js +6 -0
- package/src/renderers/webgl-fallback/utils/WebGLState.js +1 -4
- package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +61 -16
- package/src/renderers/webgpu/WebGPUBackend.js +33 -25
- package/src/renderers/webgpu/WebGPURenderer.Nodes.js +42 -0
- package/src/renderers/webgpu/WebGPURenderer.js +5 -2
- package/src/renderers/webgpu/nodes/BasicNodeLibrary.js +59 -0
- package/src/renderers/{common → webgpu}/nodes/StandardNodeLibrary.js +11 -11
- package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +91 -11
- package/src/renderers/webgpu/utils/WebGPUAttributeUtils.js +6 -16
- package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +1 -1
- package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +7 -5
- package/src/renderers/webgpu/utils/WebGPUUtils.js +1 -1
- package/src/utils.js +33 -1
- package/examples/jsm/geometries/SDFGeometryGenerator.js +0 -144
- package/examples/jsm/loaders/TiltLoader.js +0 -520
- package/examples/jsm/utils/GPUStatsPanel.js +0 -95
- package/examples/jsm/utils/PackedPhongMaterial.js +0 -178
- package/src/nodes/display/ViewportNode.js +0 -138
- package/src/nodes/lighting/LightNode.js +0 -57
- package/src/renderers/common/StandardRenderer.js +0 -18
- package/src/renderers/webvr/WebVRManager.js +0 -495
- package/src/renderers/webvr/WebVRUtils.js +0 -66
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { registerNode } from '../core/Node.js';
|
|
2
1
|
import TempNode from '../core/TempNode.js';
|
|
3
2
|
import { modelViewMatrix } from './ModelNode.js';
|
|
4
3
|
import { positionLocal, positionPrevious } from './Position.js';
|
|
@@ -8,11 +7,18 @@ import { Matrix4 } from '../../math/Matrix4.js';
|
|
|
8
7
|
import { uniform } from '../core/UniformNode.js';
|
|
9
8
|
import { sub } from '../math/OperatorNode.js';
|
|
10
9
|
import { cameraProjectionMatrix } from './Camera.js';
|
|
10
|
+
import { renderGroup } from '../core/UniformGroupNode.js';
|
|
11
11
|
|
|
12
|
-
const
|
|
12
|
+
const _objectData = new WeakMap();
|
|
13
13
|
|
|
14
14
|
class VelocityNode extends TempNode {
|
|
15
15
|
|
|
16
|
+
static get type() {
|
|
17
|
+
|
|
18
|
+
return 'VelocityNode';
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
|
|
16
22
|
constructor() {
|
|
17
23
|
|
|
18
24
|
super( 'vec2' );
|
|
@@ -20,35 +26,66 @@ class VelocityNode extends TempNode {
|
|
|
20
26
|
this.updateType = NodeUpdateType.OBJECT;
|
|
21
27
|
this.updateAfterType = NodeUpdateType.OBJECT;
|
|
22
28
|
|
|
23
|
-
this.
|
|
24
|
-
this.
|
|
29
|
+
this.previousModelWorldMatrix = uniform( new Matrix4() );
|
|
30
|
+
this.previousProjectionMatrix = uniform( new Matrix4() ).setGroup( renderGroup );
|
|
31
|
+
this.previousCameraViewMatrix = uniform( new Matrix4() );
|
|
25
32
|
|
|
26
33
|
}
|
|
27
34
|
|
|
28
|
-
update( { camera, object } ) {
|
|
35
|
+
update( { frameId, camera, object } ) {
|
|
29
36
|
|
|
30
37
|
const previousModelMatrix = getPreviousMatrix( object );
|
|
31
|
-
const previousCameraMatrix = getPreviousMatrix( camera );
|
|
32
38
|
|
|
33
|
-
this.
|
|
34
|
-
this.previousProjectionMatrix.value.copy( previousCameraMatrix );
|
|
39
|
+
this.previousModelWorldMatrix.value.copy( previousModelMatrix );
|
|
35
40
|
|
|
36
|
-
|
|
41
|
+
//
|
|
37
42
|
|
|
38
|
-
|
|
43
|
+
const cameraData = getData( camera );
|
|
39
44
|
|
|
40
|
-
|
|
41
|
-
|
|
45
|
+
if ( cameraData.frameId !== frameId ) {
|
|
46
|
+
|
|
47
|
+
cameraData.frameId = frameId;
|
|
48
|
+
|
|
49
|
+
if ( cameraData.previousProjectionMatrix === undefined ) {
|
|
50
|
+
|
|
51
|
+
cameraData.previousProjectionMatrix = new Matrix4();
|
|
52
|
+
cameraData.previousCameraViewMatrix = new Matrix4();
|
|
53
|
+
|
|
54
|
+
cameraData.currentProjectionMatrix = new Matrix4();
|
|
55
|
+
cameraData.currentCameraViewMatrix = new Matrix4();
|
|
56
|
+
|
|
57
|
+
cameraData.previousProjectionMatrix.copy( camera.projectionMatrix );
|
|
58
|
+
cameraData.previousCameraViewMatrix.copy( camera.matrixWorldInverse );
|
|
59
|
+
|
|
60
|
+
} else {
|
|
61
|
+
|
|
62
|
+
cameraData.previousProjectionMatrix.copy( cameraData.currentProjectionMatrix );
|
|
63
|
+
cameraData.previousCameraViewMatrix.copy( cameraData.currentCameraViewMatrix );
|
|
64
|
+
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
cameraData.currentProjectionMatrix.copy( camera.projectionMatrix );
|
|
68
|
+
cameraData.currentCameraViewMatrix.copy( camera.matrixWorldInverse );
|
|
69
|
+
|
|
70
|
+
this.previousProjectionMatrix.value.copy( cameraData.previousProjectionMatrix );
|
|
71
|
+
this.previousCameraViewMatrix.value.copy( cameraData.previousCameraViewMatrix );
|
|
42
72
|
|
|
43
|
-
|
|
44
|
-
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
updateAfter( { object } ) {
|
|
78
|
+
|
|
79
|
+
getPreviousMatrix( object ).copy( object.matrixWorld );
|
|
45
80
|
|
|
46
81
|
}
|
|
47
82
|
|
|
48
83
|
setup( /*builder*/ ) {
|
|
49
84
|
|
|
85
|
+
const previousModelViewMatrix = this.previousCameraViewMatrix.mul( this.previousModelWorldMatrix );
|
|
86
|
+
|
|
50
87
|
const clipPositionCurrent = cameraProjectionMatrix.mul( modelViewMatrix ).mul( positionLocal );
|
|
51
|
-
const clipPositionPrevious = this.previousProjectionMatrix.mul(
|
|
88
|
+
const clipPositionPrevious = this.previousProjectionMatrix.mul( previousModelViewMatrix ).mul( positionPrevious );
|
|
52
89
|
|
|
53
90
|
const ndcPositionCurrent = clipPositionCurrent.xy.div( clipPositionCurrent.w );
|
|
54
91
|
const ndcPositionPrevious = clipPositionPrevious.xy.div( clipPositionPrevious.w );
|
|
@@ -61,23 +98,37 @@ class VelocityNode extends TempNode {
|
|
|
61
98
|
|
|
62
99
|
}
|
|
63
100
|
|
|
64
|
-
function
|
|
101
|
+
function getData( object ) {
|
|
65
102
|
|
|
66
|
-
let
|
|
103
|
+
let objectData = _objectData.get( object );
|
|
67
104
|
|
|
68
|
-
if (
|
|
105
|
+
if ( objectData === undefined ) {
|
|
69
106
|
|
|
70
|
-
|
|
71
|
-
|
|
107
|
+
objectData = {};
|
|
108
|
+
_objectData.set( object, objectData );
|
|
72
109
|
|
|
73
110
|
}
|
|
74
111
|
|
|
75
|
-
return
|
|
112
|
+
return objectData;
|
|
76
113
|
|
|
77
114
|
}
|
|
78
115
|
|
|
79
|
-
|
|
116
|
+
function getPreviousMatrix( object, index = 0 ) {
|
|
117
|
+
|
|
118
|
+
const objectData = getData( object );
|
|
119
|
+
|
|
120
|
+
let matrix = objectData[ index ];
|
|
80
121
|
|
|
81
|
-
|
|
122
|
+
if ( matrix === undefined ) {
|
|
123
|
+
|
|
124
|
+
objectData[ index ] = matrix = new Matrix4();
|
|
125
|
+
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return matrix;
|
|
129
|
+
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export default VelocityNode;
|
|
82
133
|
|
|
83
134
|
export const velocity = /*@__PURE__*/ nodeImmutable( VelocityNode );
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { registerNode } from '../core/Node.js';
|
|
2
1
|
import AttributeNode from '../core/AttributeNode.js';
|
|
3
2
|
import { nodeObject } from '../tsl/TSLBase.js';
|
|
4
3
|
|
|
@@ -6,6 +5,12 @@ import { Vector4 } from '../../math/Vector4.js';
|
|
|
6
5
|
|
|
7
6
|
class VertexColorNode extends AttributeNode {
|
|
8
7
|
|
|
8
|
+
static get type() {
|
|
9
|
+
|
|
10
|
+
return 'VertexColorNode';
|
|
11
|
+
|
|
12
|
+
}
|
|
13
|
+
|
|
9
14
|
constructor( index = 0 ) {
|
|
10
15
|
|
|
11
16
|
super( null, 'vec4' );
|
|
@@ -66,6 +71,4 @@ class VertexColorNode extends AttributeNode {
|
|
|
66
71
|
|
|
67
72
|
export default VertexColorNode;
|
|
68
73
|
|
|
69
|
-
VertexColorNode.type = /*@__PURE__*/ registerNode( 'VertexColor', VertexColorNode );
|
|
70
|
-
|
|
71
74
|
export const vertexColor = ( ...params ) => nodeObject( new VertexColorNode( ...params ) );
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import Node
|
|
1
|
+
import Node from '../core/Node.js';
|
|
2
2
|
import { nodeProxy } from '../tsl/TSLBase.js';
|
|
3
3
|
|
|
4
4
|
class CodeNode extends Node {
|
|
5
5
|
|
|
6
|
+
static get type() {
|
|
7
|
+
|
|
8
|
+
return 'CodeNode';
|
|
9
|
+
|
|
10
|
+
}
|
|
11
|
+
|
|
6
12
|
constructor( code = '', includes = [], language = '' ) {
|
|
7
13
|
|
|
8
14
|
super( 'code' );
|
|
@@ -75,8 +81,6 @@ class CodeNode extends Node {
|
|
|
75
81
|
|
|
76
82
|
export default CodeNode;
|
|
77
83
|
|
|
78
|
-
CodeNode.type = /*@__PURE__*/ registerNode( 'Code', CodeNode );
|
|
79
|
-
|
|
80
84
|
export const code = /*@__PURE__*/ nodeProxy( CodeNode );
|
|
81
85
|
|
|
82
86
|
export const js = ( src, includes ) => code( src, includes, 'js' );
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import Node
|
|
1
|
+
import Node from '../core/Node.js';
|
|
2
2
|
import { nodeProxy } from '../tsl/TSLCore.js';
|
|
3
3
|
|
|
4
4
|
class ExpressionNode extends Node {
|
|
5
5
|
|
|
6
|
+
static get type() {
|
|
7
|
+
|
|
8
|
+
return 'ExpressionNode';
|
|
9
|
+
|
|
10
|
+
}
|
|
11
|
+
|
|
6
12
|
constructor( snippet = '', nodeType = 'void' ) {
|
|
7
13
|
|
|
8
14
|
super( nodeType );
|
|
@@ -18,7 +24,7 @@ class ExpressionNode extends Node {
|
|
|
18
24
|
|
|
19
25
|
if ( type === 'void' ) {
|
|
20
26
|
|
|
21
|
-
builder.addLineFlowCode( snippet );
|
|
27
|
+
builder.addLineFlowCode( snippet, this );
|
|
22
28
|
|
|
23
29
|
} else {
|
|
24
30
|
|
|
@@ -32,6 +38,4 @@ class ExpressionNode extends Node {
|
|
|
32
38
|
|
|
33
39
|
export default ExpressionNode;
|
|
34
40
|
|
|
35
|
-
ExpressionNode.type = /*@__PURE__*/ registerNode( 'Expression', ExpressionNode );
|
|
36
|
-
|
|
37
41
|
export const expression = /*@__PURE__*/ nodeProxy( ExpressionNode );
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import { registerNode } from '../core/Node.js';
|
|
2
1
|
import TempNode from '../core/TempNode.js';
|
|
3
2
|
import { addMethodChaining, nodeArray, nodeObject, nodeObjects } from '../tsl/TSLCore.js';
|
|
4
3
|
|
|
5
4
|
class FunctionCallNode extends TempNode {
|
|
6
5
|
|
|
6
|
+
static get type() {
|
|
7
|
+
|
|
8
|
+
return 'FunctionCallNode';
|
|
9
|
+
|
|
10
|
+
}
|
|
11
|
+
|
|
7
12
|
constructor( functionNode = null, parameters = {} ) {
|
|
8
13
|
|
|
9
14
|
super();
|
|
@@ -83,8 +88,6 @@ class FunctionCallNode extends TempNode {
|
|
|
83
88
|
|
|
84
89
|
export default FunctionCallNode;
|
|
85
90
|
|
|
86
|
-
FunctionCallNode.type = /*@__PURE__*/ registerNode( 'FunctionCall', FunctionCallNode );
|
|
87
|
-
|
|
88
91
|
export const call = ( func, ...params ) => {
|
|
89
92
|
|
|
90
93
|
params = params.length > 1 || ( params[ 0 ] && params[ 0 ].isNode === true ) ? nodeArray( params ) : nodeObjects( params[ 0 ] );
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import { registerNode } from '../core/Node.js';
|
|
2
1
|
import CodeNode from './CodeNode.js';
|
|
3
2
|
import { nodeObject } from '../tsl/TSLBase.js';
|
|
4
3
|
|
|
5
4
|
class FunctionNode extends CodeNode {
|
|
6
5
|
|
|
6
|
+
static get type() {
|
|
7
|
+
|
|
8
|
+
return 'FunctionNode';
|
|
9
|
+
|
|
10
|
+
}
|
|
11
|
+
|
|
7
12
|
constructor( code = '', includes = [], language = '' ) {
|
|
8
13
|
|
|
9
14
|
super( code, includes, language );
|
|
@@ -81,8 +86,6 @@ class FunctionNode extends CodeNode {
|
|
|
81
86
|
|
|
82
87
|
export default FunctionNode;
|
|
83
88
|
|
|
84
|
-
FunctionNode.type = /*@__PURE__*/ registerNode( 'Function', FunctionNode );
|
|
85
|
-
|
|
86
89
|
const nativeFn = ( code, includes = [], language = '' ) => {
|
|
87
90
|
|
|
88
91
|
for ( let i = 0; i < includes.length; i ++ ) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import Node
|
|
1
|
+
import Node from '../core/Node.js';
|
|
2
2
|
import { scriptableValue } from './ScriptableValueNode.js';
|
|
3
3
|
import { nodeProxy, float } from '../tsl/TSLBase.js';
|
|
4
|
+
import { hashArray, hashString } from '../core/NodeUtils.js';
|
|
4
5
|
|
|
5
6
|
class Resources extends Map {
|
|
6
7
|
|
|
@@ -61,6 +62,12 @@ export const global = new Resources();
|
|
|
61
62
|
|
|
62
63
|
class ScriptableNode extends Node {
|
|
63
64
|
|
|
65
|
+
static get type() {
|
|
66
|
+
|
|
67
|
+
return 'ScriptableNode';
|
|
68
|
+
|
|
69
|
+
}
|
|
70
|
+
|
|
64
71
|
constructor( codeNode = null, parameters = {} ) {
|
|
65
72
|
|
|
66
73
|
super();
|
|
@@ -439,15 +446,15 @@ class ScriptableNode extends Node {
|
|
|
439
446
|
|
|
440
447
|
getCacheKey( force ) {
|
|
441
448
|
|
|
442
|
-
const
|
|
449
|
+
const values = [ hashString( this.source ), this.getDefaultOutputNode().getCacheKey( force ) ];
|
|
443
450
|
|
|
444
451
|
for ( const param in this.parameters ) {
|
|
445
452
|
|
|
446
|
-
|
|
453
|
+
values.push( this.parameters[ param ].getCacheKey( force ) );
|
|
447
454
|
|
|
448
455
|
}
|
|
449
456
|
|
|
450
|
-
return
|
|
457
|
+
return hashArray( values );
|
|
451
458
|
|
|
452
459
|
}
|
|
453
460
|
|
|
@@ -495,6 +502,4 @@ class ScriptableNode extends Node {
|
|
|
495
502
|
|
|
496
503
|
export default ScriptableNode;
|
|
497
504
|
|
|
498
|
-
ScriptableNode.type = /*@__PURE__*/ registerNode( 'Scriptable', ScriptableNode );
|
|
499
|
-
|
|
500
505
|
export const scriptable = /*@__PURE__*/ nodeProxy( ScriptableNode );
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Node
|
|
1
|
+
import Node from '../core/Node.js';
|
|
2
2
|
import { arrayBufferToBase64, base64ToArrayBuffer } from '../core/NodeUtils.js';
|
|
3
3
|
import { nodeProxy, float } from '../tsl/TSLBase.js';
|
|
4
4
|
|
|
@@ -6,6 +6,12 @@ import { EventDispatcher } from '../../core/EventDispatcher.js';
|
|
|
6
6
|
|
|
7
7
|
class ScriptableValueNode extends Node {
|
|
8
8
|
|
|
9
|
+
static get type() {
|
|
10
|
+
|
|
11
|
+
return 'ScriptableValueNode';
|
|
12
|
+
|
|
13
|
+
}
|
|
14
|
+
|
|
9
15
|
constructor( value = null ) {
|
|
10
16
|
|
|
11
17
|
super();
|
|
@@ -161,6 +167,4 @@ class ScriptableValueNode extends Node {
|
|
|
161
167
|
|
|
162
168
|
export default ScriptableValueNode;
|
|
163
169
|
|
|
164
|
-
ScriptableValueNode.type = /*@__PURE__*/ registerNode( 'ScriptableValue', ScriptableValueNode );
|
|
165
|
-
|
|
166
170
|
export const scriptableValue = /*@__PURE__*/ nodeProxy( ScriptableValueNode );
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import { registerNode } from '../core/Node.js';
|
|
2
1
|
import TempNode from '../core/TempNode.js';
|
|
3
2
|
import { addMethodChaining, nodeProxy } from '../tsl/TSLCore.js';
|
|
4
3
|
import { vectorComponents } from '../core/constants.js';
|
|
5
4
|
|
|
6
5
|
class AssignNode extends TempNode {
|
|
7
6
|
|
|
7
|
+
static get type() {
|
|
8
|
+
|
|
9
|
+
return 'AssignNode';
|
|
10
|
+
|
|
11
|
+
}
|
|
12
|
+
|
|
8
13
|
constructor( targetNode, sourceNode ) {
|
|
9
14
|
|
|
10
15
|
super();
|
|
@@ -75,7 +80,7 @@ class AssignNode extends TempNode {
|
|
|
75
80
|
const sourceVar = builder.getVarFromNode( this, null, targetType );
|
|
76
81
|
const sourceProperty = builder.getPropertyName( sourceVar );
|
|
77
82
|
|
|
78
|
-
builder.addLineFlowCode( `${ sourceProperty } = ${ source }
|
|
83
|
+
builder.addLineFlowCode( `${ sourceProperty } = ${ source }`, this );
|
|
79
84
|
|
|
80
85
|
const targetRoot = targetNode.node.context( { assign: true } ).build( builder );
|
|
81
86
|
|
|
@@ -83,7 +88,7 @@ class AssignNode extends TempNode {
|
|
|
83
88
|
|
|
84
89
|
const component = targetNode.components[ i ];
|
|
85
90
|
|
|
86
|
-
builder.addLineFlowCode( `${ targetRoot }.${ component } = ${ sourceProperty }[ ${ i } ]
|
|
91
|
+
builder.addLineFlowCode( `${ targetRoot }.${ component } = ${ sourceProperty }[ ${ i } ]`, this );
|
|
87
92
|
|
|
88
93
|
}
|
|
89
94
|
|
|
@@ -99,7 +104,7 @@ class AssignNode extends TempNode {
|
|
|
99
104
|
|
|
100
105
|
if ( output === 'void' || sourceType === 'void' ) {
|
|
101
106
|
|
|
102
|
-
builder.addLineFlowCode( snippet );
|
|
107
|
+
builder.addLineFlowCode( snippet, this );
|
|
103
108
|
|
|
104
109
|
if ( output !== 'void' ) {
|
|
105
110
|
|
|
@@ -121,8 +126,6 @@ class AssignNode extends TempNode {
|
|
|
121
126
|
|
|
122
127
|
export default AssignNode;
|
|
123
128
|
|
|
124
|
-
AssignNode.type = /*@__PURE__*/ registerNode( 'Assign', AssignNode );
|
|
125
|
-
|
|
126
129
|
export const assign = /*@__PURE__*/ nodeProxy( AssignNode );
|
|
127
130
|
|
|
128
131
|
addMethodChaining( 'assign', assign );
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import Node
|
|
1
|
+
import Node from './Node.js';
|
|
2
2
|
import { nodeObject, varying } from '../tsl/TSLBase.js';
|
|
3
3
|
|
|
4
4
|
class AttributeNode extends Node {
|
|
5
5
|
|
|
6
|
+
static get type() {
|
|
7
|
+
|
|
8
|
+
return 'AttributeNode';
|
|
9
|
+
|
|
10
|
+
}
|
|
11
|
+
|
|
6
12
|
constructor( attributeName, nodeType = null ) {
|
|
7
13
|
|
|
8
14
|
super( nodeType );
|
|
@@ -116,6 +122,4 @@ class AttributeNode extends Node {
|
|
|
116
122
|
|
|
117
123
|
export default AttributeNode;
|
|
118
124
|
|
|
119
|
-
AttributeNode.type = /*@__PURE__*/ registerNode( 'Attribute', AttributeNode );
|
|
120
|
-
|
|
121
125
|
export const attribute = ( name, nodeType ) => nodeObject( new AttributeNode( name, nodeType ) );
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import Node
|
|
1
|
+
import Node from './Node.js';
|
|
2
2
|
import { addMethodChaining, nodeProxy } from '../tsl/TSLCore.js';
|
|
3
3
|
|
|
4
4
|
class BypassNode extends Node {
|
|
5
5
|
|
|
6
|
+
static get type() {
|
|
7
|
+
|
|
8
|
+
return 'BypassNode';
|
|
9
|
+
|
|
10
|
+
}
|
|
11
|
+
|
|
6
12
|
constructor( returnNode, callNode ) {
|
|
7
13
|
|
|
8
14
|
super();
|
|
@@ -26,7 +32,7 @@ class BypassNode extends Node {
|
|
|
26
32
|
|
|
27
33
|
if ( snippet !== '' ) {
|
|
28
34
|
|
|
29
|
-
builder.addLineFlowCode( snippet );
|
|
35
|
+
builder.addLineFlowCode( snippet, this );
|
|
30
36
|
|
|
31
37
|
}
|
|
32
38
|
|
|
@@ -38,8 +44,6 @@ class BypassNode extends Node {
|
|
|
38
44
|
|
|
39
45
|
export default BypassNode;
|
|
40
46
|
|
|
41
|
-
BypassNode.type = /*@__PURE__*/ registerNode( 'Bypass', BypassNode );
|
|
42
|
-
|
|
43
47
|
export const bypass = /*@__PURE__*/ nodeProxy( BypassNode );
|
|
44
48
|
|
|
45
49
|
addMethodChaining( 'bypass', bypass );
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import Node
|
|
1
|
+
import Node from './Node.js';
|
|
2
2
|
import { addMethodChaining, nodeObject } from '../tsl/TSLCore.js';
|
|
3
3
|
|
|
4
4
|
class CacheNode extends Node {
|
|
5
5
|
|
|
6
|
+
static get type() {
|
|
7
|
+
|
|
8
|
+
return 'CacheNode';
|
|
9
|
+
|
|
10
|
+
}
|
|
11
|
+
|
|
6
12
|
constructor( node, parent = true ) {
|
|
7
13
|
|
|
8
14
|
super();
|
|
@@ -23,7 +29,7 @@ class CacheNode extends Node {
|
|
|
23
29
|
build( builder, ...params ) {
|
|
24
30
|
|
|
25
31
|
const previousCache = builder.getCache();
|
|
26
|
-
const cache = builder.getCacheFromNode( this, parent );
|
|
32
|
+
const cache = builder.getCacheFromNode( this, this.parent );
|
|
27
33
|
|
|
28
34
|
builder.setCache( cache );
|
|
29
35
|
|
|
@@ -39,8 +45,6 @@ class CacheNode extends Node {
|
|
|
39
45
|
|
|
40
46
|
export default CacheNode;
|
|
41
47
|
|
|
42
|
-
CacheNode.type = /*@__PURE__*/ registerNode( 'Cache', CacheNode );
|
|
43
|
-
|
|
44
48
|
export const cache = ( node, ...params ) => nodeObject( new CacheNode( nodeObject( node ), ...params ) );
|
|
45
49
|
|
|
46
50
|
addMethodChaining( 'cache', cache );
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import { registerNode } from './Node.js';
|
|
2
1
|
import InputNode from './InputNode.js';
|
|
3
2
|
|
|
4
3
|
class ConstNode extends InputNode {
|
|
5
4
|
|
|
5
|
+
static get type() {
|
|
6
|
+
|
|
7
|
+
return 'ConstNode';
|
|
8
|
+
|
|
9
|
+
}
|
|
10
|
+
|
|
6
11
|
constructor( value, nodeType = null ) {
|
|
7
12
|
|
|
8
13
|
super( value, nodeType );
|
|
@@ -28,5 +33,3 @@ class ConstNode extends InputNode {
|
|
|
28
33
|
}
|
|
29
34
|
|
|
30
35
|
export default ConstNode;
|
|
31
|
-
|
|
32
|
-
ConstNode.type = /*@__PURE__*/ registerNode( 'Const', ConstNode );
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import Node
|
|
1
|
+
import Node from './Node.js';
|
|
2
2
|
import { addMethodChaining, nodeProxy } from '../tsl/TSLCore.js';
|
|
3
3
|
|
|
4
4
|
class ContextNode extends Node {
|
|
5
5
|
|
|
6
|
+
static get type() {
|
|
7
|
+
|
|
8
|
+
return 'ContextNode';
|
|
9
|
+
|
|
10
|
+
}
|
|
11
|
+
|
|
6
12
|
constructor( node, value = {} ) {
|
|
7
13
|
|
|
8
14
|
super();
|
|
@@ -64,8 +70,6 @@ class ContextNode extends Node {
|
|
|
64
70
|
|
|
65
71
|
export default ContextNode;
|
|
66
72
|
|
|
67
|
-
ContextNode.type = /*@__PURE__*/ registerNode( 'Context', ContextNode );
|
|
68
|
-
|
|
69
73
|
export const context = /*@__PURE__*/ nodeProxy( ContextNode );
|
|
70
74
|
export const label = ( node, name ) => context( node, { label: name } );
|
|
71
75
|
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import Node
|
|
1
|
+
import Node from './Node.js';
|
|
2
2
|
import { nodeImmutable, varying } from '../tsl/TSLBase.js';
|
|
3
3
|
|
|
4
4
|
class IndexNode extends Node {
|
|
5
5
|
|
|
6
|
+
static get type() {
|
|
7
|
+
|
|
8
|
+
return 'IndexNode';
|
|
9
|
+
|
|
10
|
+
}
|
|
11
|
+
|
|
6
12
|
constructor( scope ) {
|
|
7
13
|
|
|
8
14
|
super( 'uint' );
|
|
@@ -22,20 +28,34 @@ class IndexNode extends Node {
|
|
|
22
28
|
|
|
23
29
|
if ( scope === IndexNode.VERTEX ) {
|
|
24
30
|
|
|
31
|
+
// The index of a vertex within a mesh.
|
|
25
32
|
propertyName = builder.getVertexIndex();
|
|
26
33
|
|
|
27
34
|
} else if ( scope === IndexNode.INSTANCE ) {
|
|
28
35
|
|
|
36
|
+
// The index of either a mesh instance or an invocation of a compute shader.
|
|
29
37
|
propertyName = builder.getInstanceIndex();
|
|
30
38
|
|
|
31
39
|
} else if ( scope === IndexNode.DRAW ) {
|
|
32
40
|
|
|
41
|
+
// The index of a draw call.
|
|
33
42
|
propertyName = builder.getDrawIndex();
|
|
34
43
|
|
|
35
44
|
} else if ( scope === IndexNode.INVOCATION_LOCAL ) {
|
|
36
45
|
|
|
46
|
+
// The index of a compute invocation within the scope of a workgroup load.
|
|
37
47
|
propertyName = builder.getInvocationLocalIndex();
|
|
38
48
|
|
|
49
|
+
} else if ( scope === IndexNode.INVOCATION_SUBGROUP ) {
|
|
50
|
+
|
|
51
|
+
// The index of a compute invocation within the scope of a subgroup.
|
|
52
|
+
propertyName = builder.getInvocationSubgroupIndex();
|
|
53
|
+
|
|
54
|
+
} else if ( scope === IndexNode.SUBGROUP ) {
|
|
55
|
+
|
|
56
|
+
// The index of the subgroup the current compute invocation belongs to.
|
|
57
|
+
propertyName = builder.getSubgroupIndex();
|
|
58
|
+
|
|
39
59
|
} else {
|
|
40
60
|
|
|
41
61
|
throw new Error( 'THREE.IndexNode: Unknown scope: ' + scope );
|
|
@@ -64,14 +84,16 @@ class IndexNode extends Node {
|
|
|
64
84
|
|
|
65
85
|
IndexNode.VERTEX = 'vertex';
|
|
66
86
|
IndexNode.INSTANCE = 'instance';
|
|
87
|
+
IndexNode.SUBGROUP = 'subgroup';
|
|
67
88
|
IndexNode.INVOCATION_LOCAL = 'invocationLocal';
|
|
89
|
+
IndexNode.INVOCATION_SUBGROUP = 'invocationSubgroup';
|
|
68
90
|
IndexNode.DRAW = 'draw';
|
|
69
91
|
|
|
70
92
|
export default IndexNode;
|
|
71
93
|
|
|
72
|
-
IndexNode.type = /*@__PURE__*/ registerNode( 'Index', IndexNode );
|
|
73
|
-
|
|
74
94
|
export const vertexIndex = /*@__PURE__*/ nodeImmutable( IndexNode, IndexNode.VERTEX );
|
|
75
95
|
export const instanceIndex = /*@__PURE__*/ nodeImmutable( IndexNode, IndexNode.INSTANCE );
|
|
96
|
+
export const subgroupIndex = /*@__PURE__*/ nodeImmutable( IndexNode, IndexNode.SUBGROUP );
|
|
97
|
+
export const invocationSubgroupIndex = /*@__PURE__*/ nodeImmutable( IndexNode, IndexNode.INVOCATION_SUBGROUP );
|
|
76
98
|
export const invocationLocalIndex = /*@__PURE__*/ nodeImmutable( IndexNode, IndexNode.INVOCATION_LOCAL );
|
|
77
99
|
export const drawIndex = /*@__PURE__*/ nodeImmutable( IndexNode, IndexNode.DRAW );
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import Node
|
|
1
|
+
import Node from './Node.js';
|
|
2
2
|
import { getValueType, getValueFromType, arrayBufferToBase64 } from './NodeUtils.js';
|
|
3
3
|
|
|
4
4
|
class InputNode extends Node {
|
|
5
5
|
|
|
6
|
+
static get type() {
|
|
7
|
+
|
|
8
|
+
return 'InputNode';
|
|
9
|
+
|
|
10
|
+
}
|
|
11
|
+
|
|
6
12
|
constructor( value, nodeType = null ) {
|
|
7
13
|
|
|
8
14
|
super( nodeType );
|
|
@@ -79,5 +85,3 @@ class InputNode extends Node {
|
|
|
79
85
|
}
|
|
80
86
|
|
|
81
87
|
export default InputNode;
|
|
82
|
-
|
|
83
|
-
InputNode.type = /*@__PURE__*/ registerNode( 'Input', InputNode );
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { registerNode } from './Node.js';
|
|
2
1
|
import OutputStructNode from './OutputStructNode.js';
|
|
3
2
|
import { nodeProxy, vec4 } from '../tsl/TSLBase.js';
|
|
4
3
|
|
|
@@ -20,6 +19,12 @@ export function getTextureIndex( textures, name ) {
|
|
|
20
19
|
|
|
21
20
|
class MRTNode extends OutputStructNode {
|
|
22
21
|
|
|
22
|
+
static get type() {
|
|
23
|
+
|
|
24
|
+
return 'MRTNode';
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
|
|
23
28
|
constructor( outputNodes ) {
|
|
24
29
|
|
|
25
30
|
super();
|
|
@@ -77,6 +82,4 @@ class MRTNode extends OutputStructNode {
|
|
|
77
82
|
|
|
78
83
|
export default MRTNode;
|
|
79
84
|
|
|
80
|
-
MRTNode.type = /*@__PURE__*/ registerNode( 'MRT', MRTNode );
|
|
81
|
-
|
|
82
85
|
export const mrt = /*@__PURE__*/ nodeProxy( MRTNode );
|