super-three 0.167.0 → 0.169.0
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 +532 -173
- package/build/three.module.js +532 -174
- package/build/three.module.min.js +1 -1
- package/build/three.webgpu.js +18173 -14266
- 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 -4
- package/examples/jsm/animation/AnimationClipCreator.js +1 -1
- package/examples/jsm/capabilities/WebGL.js +27 -21
- package/examples/jsm/controls/ArcballControls.js +174 -158
- package/examples/jsm/controls/DragControls.js +260 -132
- package/examples/jsm/controls/FirstPersonControls.js +175 -163
- package/examples/jsm/controls/FlyControls.js +194 -188
- package/examples/jsm/controls/OrbitControls.js +777 -786
- package/examples/jsm/controls/PointerLockControls.js +24 -15
- package/examples/jsm/controls/TrackballControls.js +469 -448
- package/examples/jsm/controls/TransformControls.js +97 -62
- package/examples/jsm/effects/AnaglyphEffect.js +6 -13
- package/examples/jsm/effects/ParallaxBarrierEffect.js +17 -11
- package/examples/jsm/effects/StereoEffect.js +6 -1
- package/examples/jsm/environments/RoomEnvironment.js +1 -1
- package/examples/jsm/exporters/DRACOExporter.js +4 -2
- package/examples/jsm/exporters/EXRExporter.js +19 -11
- package/examples/jsm/exporters/GLTFExporter.js +6 -1
- 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/exporters/USDZExporter.js +29 -8
- package/examples/jsm/geometries/DecalGeometry.js +4 -1
- package/examples/jsm/geometries/InstancedPointsGeometry.js +1 -1
- package/examples/jsm/helpers/LightProbeHelper.js +43 -44
- 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 +27 -12
- package/examples/jsm/loaders/MTLLoader.js +4 -3
- package/examples/jsm/loaders/MaterialXLoader.js +40 -14
- package/examples/jsm/loaders/OBJLoader.js +5 -3
- package/examples/jsm/loaders/PCDLoader.js +14 -13
- 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 +187 -0
- package/examples/jsm/objects/Water2Mesh.js +158 -0
- package/examples/jsm/objects/WaterMesh.js +101 -0
- package/examples/jsm/physics/JoltPhysics.js +1 -1
- package/examples/jsm/physics/RapierPhysics.js +21 -1
- package/examples/jsm/postprocessing/OutlinePass.js +31 -46
- package/examples/jsm/postprocessing/SSAARenderPass.js +3 -1
- package/examples/jsm/shaders/BleachBypassShader.js +1 -2
- package/examples/jsm/shaders/OutputShader.js +1 -1
- package/examples/jsm/transpiler/GLSLDecoder.js +1 -1
- package/examples/jsm/transpiler/ShaderToyDecoder.js +2 -2
- package/examples/jsm/transpiler/TSLEncoder.js +8 -8
- 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 +2 -1
- package/examples/jsm/utils/TextureUtilsGPU.js +63 -0
- package/examples/jsm/webxr/XRControllerModelFactory.js +1 -1
- package/package.json +3 -2
- package/src/Three.WebGPU.Nodes.js +200 -0
- package/src/Three.WebGPU.js +7 -0
- package/src/Three.js +1 -0
- 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 +32 -0
- package/src/geometries/CylinderGeometry.js +11 -4
- package/src/loaders/MaterialLoader.js +7 -1
- package/src/loaders/ObjectLoader.js +3 -3
- package/src/{nodes/loaders → loaders/nodes}/NodeLoader.js +25 -5
- package/src/{nodes/loaders → loaders/nodes}/NodeMaterialLoader.js +21 -18
- package/src/{nodes/loaders → loaders/nodes}/NodeObjectLoader.js +19 -0
- package/src/materials/Material.js +4 -7
- package/src/materials/nodes/InstancedPointsNodeMaterial.js +156 -0
- package/src/{nodes/materials → materials/nodes}/Line2NodeMaterial.js +56 -59
- package/src/{nodes/materials → materials/nodes}/LineBasicNodeMaterial.js +8 -5
- package/src/{nodes/materials → materials/nodes}/LineDashedNodeMaterial.js +12 -10
- package/src/{nodes/materials → materials/nodes}/MeshBasicNodeMaterial.js +16 -12
- package/src/{nodes/materials → materials/nodes}/MeshLambertNodeMaterial.js +10 -6
- package/src/{nodes/materials → materials/nodes}/MeshMatcapNodeMaterial.js +13 -9
- package/src/{nodes/materials → materials/nodes}/MeshNormalNodeMaterial.js +13 -9
- package/src/{nodes/materials → materials/nodes}/MeshPhongNodeMaterial.js +14 -9
- package/src/{nodes/materials → materials/nodes}/MeshPhysicalNodeMaterial.js +22 -18
- package/src/{nodes/materials → materials/nodes}/MeshSSSNodeMaterial.js +10 -7
- package/src/{nodes/materials → materials/nodes}/MeshStandardNodeMaterial.js +22 -12
- package/src/{nodes/materials → materials/nodes}/MeshToonNodeMaterial.js +9 -5
- package/src/{nodes/materials → materials/nodes}/NodeMaterial.js +71 -115
- package/src/{nodes/materials/Materials.js → materials/nodes/NodeMaterials.js} +3 -1
- package/src/{nodes/materials → materials/nodes}/PointsNodeMaterial.js +8 -5
- package/src/{nodes/materials → materials/nodes}/ShadowNodeMaterial.js +9 -5
- package/src/{nodes/materials → materials/nodes}/SpriteNodeMaterial.js +47 -14
- package/src/{nodes/materials → materials/nodes}/VolumeNodeMaterial.js +24 -22
- package/src/materials/nodes/manager/NodeMaterialObserver.js +302 -0
- package/src/math/Triangle.js +24 -0
- package/src/nodes/Nodes.js +103 -159
- package/src/nodes/TSL.js +179 -0
- package/src/nodes/accessors/AccessorsUtils.js +8 -8
- package/src/nodes/accessors/BatchNode.js +53 -21
- package/src/nodes/accessors/{BitangentNode.js → Bitangent.js} +9 -9
- package/src/nodes/accessors/BufferAttributeNode.js +8 -5
- package/src/nodes/accessors/BufferNode.js +7 -4
- package/src/nodes/accessors/Camera.js +13 -0
- package/src/nodes/accessors/ClippingNode.js +19 -13
- package/src/nodes/accessors/CubeTextureNode.js +9 -8
- package/src/nodes/accessors/InstanceNode.js +19 -15
- package/src/nodes/accessors/InstancedPointsMaterialNode.js +8 -5
- package/src/nodes/accessors/Lights.js +51 -0
- package/src/nodes/accessors/MaterialNode.js +56 -55
- package/src/nodes/accessors/MaterialProperties.js +3 -0
- package/src/nodes/accessors/MaterialReferenceNode.js +9 -4
- package/src/nodes/accessors/ModelNode.js +47 -12
- package/src/nodes/accessors/ModelViewProjectionNode.js +12 -9
- package/src/nodes/accessors/MorphNode.js +17 -13
- package/src/nodes/accessors/Normal.js +88 -0
- package/src/nodes/accessors/Object3DNode.js +17 -33
- package/src/nodes/accessors/PointUVNode.js +9 -5
- package/src/nodes/accessors/Position.js +10 -0
- package/src/nodes/accessors/ReferenceBaseNode.js +171 -0
- package/src/nodes/accessors/ReferenceNode.js +50 -7
- package/src/nodes/accessors/ReflectVector.js +10 -0
- package/src/nodes/accessors/RendererReferenceNode.js +12 -6
- package/src/nodes/accessors/SceneNode.js +9 -6
- package/src/nodes/accessors/SkinningNode.js +88 -21
- package/src/nodes/accessors/StorageBufferNode.js +22 -5
- package/src/nodes/accessors/StorageTextureNode.js +9 -6
- package/src/nodes/accessors/Tangent.js +22 -0
- package/src/nodes/accessors/Texture3DNode.js +16 -13
- package/src/nodes/accessors/{TextureBicubicNode.js → TextureBicubic.js} +3 -32
- package/src/nodes/accessors/TextureNode.js +29 -23
- package/src/nodes/accessors/TextureSizeNode.js +10 -9
- package/src/nodes/accessors/{UniformsNode.js → UniformArrayNode.js} +26 -14
- package/src/nodes/accessors/UserDataNode.js +10 -7
- package/src/nodes/accessors/VelocityNode.js +134 -0
- package/src/nodes/accessors/VertexColorNode.js +7 -4
- package/src/nodes/code/CodeNode.js +9 -5
- package/src/nodes/code/ExpressionNode.js +10 -6
- package/src/nodes/code/FunctionCallNode.js +8 -5
- package/src/nodes/code/FunctionNode.js +8 -23
- package/src/nodes/code/ScriptableNode.js +13 -10
- package/src/nodes/code/ScriptableValueNode.js +9 -7
- package/src/nodes/core/AssignNode.js +12 -9
- package/src/nodes/core/AttributeNode.js +12 -21
- package/src/nodes/core/BypassNode.js +11 -7
- package/src/nodes/core/CacheNode.js +10 -6
- package/src/nodes/core/ConstNode.js +6 -3
- package/src/nodes/core/ContextNode.js +21 -11
- package/src/nodes/core/IndexNode.js +35 -8
- package/src/nodes/core/InputNode.js +7 -3
- package/src/nodes/core/MRTNode.js +16 -7
- package/src/nodes/core/Node.js +19 -40
- package/src/nodes/core/NodeBuilder.js +117 -38
- package/src/nodes/core/NodeUtils.js +49 -6
- package/src/nodes/core/OutputStructNode.js +10 -6
- package/src/nodes/core/ParameterNode.js +7 -4
- package/src/nodes/core/PropertyNode.js +36 -32
- package/src/nodes/core/StackNode.js +31 -11
- package/src/nodes/core/StructTypeNode.js +7 -3
- package/src/nodes/core/TempNode.js +8 -4
- package/src/nodes/core/UniformGroupNode.js +14 -11
- package/src/nodes/core/UniformNode.js +7 -4
- package/src/nodes/core/VarNode.js +12 -8
- package/src/nodes/core/VaryingNode.js +10 -6
- package/src/nodes/display/AfterImageNode.js +15 -9
- package/src/nodes/display/AnaglyphPassNode.js +67 -0
- package/src/nodes/display/AnamorphicNode.js +17 -11
- package/src/nodes/display/BleachBypass.js +26 -0
- package/src/nodes/display/BlendMode.js +54 -0
- package/src/nodes/display/BloomNode.js +27 -19
- package/src/nodes/display/BumpMapNode.js +13 -12
- package/src/nodes/display/ColorAdjustment.js +46 -0
- package/src/nodes/display/ColorSpaceFunctions.js +38 -0
- package/src/nodes/display/ColorSpaceNode.js +67 -61
- package/src/nodes/display/DenoiseNode.js +23 -17
- package/src/nodes/display/DepthOfFieldNode.js +12 -7
- package/src/nodes/display/DotScreenNode.js +13 -22
- package/src/nodes/display/FXAANode.js +21 -16
- package/src/nodes/display/FilmNode.js +11 -7
- package/src/nodes/display/FrontFacingNode.js +10 -6
- package/src/nodes/display/GTAONode.js +22 -15
- package/src/nodes/display/GaussianBlurNode.js +14 -8
- package/src/nodes/display/Lut3DNode.js +10 -6
- package/src/nodes/display/MotionBlur.js +25 -0
- package/src/nodes/display/NormalMapNode.js +13 -13
- package/src/nodes/display/ParallaxBarrierPassNode.js +58 -0
- package/src/nodes/display/PassNode.js +95 -8
- package/src/nodes/display/PixelationPassNode.js +20 -8
- package/src/nodes/display/PosterizeNode.js +8 -7
- package/src/nodes/display/RGBShiftNode.js +11 -7
- package/src/nodes/display/RenderOutputNode.js +15 -11
- package/src/nodes/display/SSAAPassNode.js +287 -0
- package/src/nodes/display/ScreenNode.js +181 -0
- package/src/nodes/display/Sepia.js +17 -0
- package/src/nodes/display/SobelOperatorNode.js +13 -8
- package/src/nodes/display/StereoCompositePassNode.js +110 -0
- package/src/nodes/display/StereoPassNode.js +83 -0
- package/src/nodes/display/ToneMappingFunctions.js +190 -0
- package/src/nodes/display/ToneMappingNode.js +15 -175
- package/src/nodes/display/ToonOutlinePassNode.js +111 -0
- package/src/nodes/display/TransitionNode.js +12 -8
- package/src/nodes/display/ViewportDepthNode.js +34 -29
- package/src/nodes/display/ViewportDepthTextureNode.js +10 -9
- package/src/nodes/display/ViewportSharedTextureNode.js +10 -9
- package/src/nodes/display/ViewportTextureNode.js +11 -11
- package/src/nodes/fog/FogExp2Node.js +8 -7
- package/src/nodes/fog/FogNode.js +10 -8
- package/src/nodes/fog/FogRangeNode.js +8 -7
- package/src/nodes/functions/BSDF/BRDF_GGX.js +4 -4
- package/src/nodes/functions/BSDF/BRDF_Lambert.js +2 -2
- package/src/nodes/functions/BSDF/BRDF_Sheen.js +6 -6
- package/src/nodes/functions/BSDF/DFGApprox.js +2 -2
- package/src/nodes/functions/BSDF/D_GGX.js +2 -2
- package/src/nodes/functions/BSDF/D_GGX_Anisotropic.js +3 -3
- package/src/nodes/functions/BSDF/EnvironmentBRDF.js +2 -2
- package/src/nodes/functions/BSDF/F_Schlick.js +2 -2
- package/src/nodes/functions/BSDF/LTC.js +6 -6
- package/src/nodes/functions/BSDF/Schlick_to_F0.js +2 -2
- package/src/nodes/functions/BSDF/V_GGX_SmithCorrelated.js +2 -2
- package/src/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.js +2 -2
- package/src/nodes/functions/BasicLightingModel.js +1 -1
- package/src/nodes/functions/PhongLightingModel.js +5 -5
- package/src/nodes/functions/PhysicalLightingModel.js +34 -33
- package/src/nodes/functions/ShadowMaskModel.js +1 -1
- package/src/nodes/functions/ToonLightingModel.js +3 -3
- package/src/nodes/functions/material/getGeometryRoughness.js +4 -4
- package/src/nodes/functions/material/getRoughness.js +2 -2
- package/src/nodes/functions/material/getShIrradianceAt.js +28 -0
- package/src/nodes/geometry/RangeNode.js +9 -5
- 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 +10 -6
- package/src/nodes/gpgpu/WorkgroupInfoNode.js +100 -0
- package/src/nodes/lighting/AONode.js +6 -3
- package/src/nodes/lighting/AmbientLightNode.js +6 -8
- package/src/nodes/lighting/AnalyticLightNode.js +225 -36
- package/src/nodes/lighting/BasicEnvironmentNode.js +8 -4
- package/src/nodes/lighting/BasicLightMapNode.js +7 -4
- package/src/nodes/lighting/DirectionalLightNode.js +7 -9
- package/src/nodes/lighting/EnvironmentNode.js +23 -19
- package/src/nodes/lighting/HemisphereLightNode.js +11 -11
- package/src/nodes/lighting/IESSpotLightNode.js +7 -9
- package/src/nodes/lighting/IrradianceNode.js +6 -3
- package/src/nodes/lighting/LightProbeNode.js +53 -0
- package/src/nodes/lighting/LightUtils.js +3 -3
- package/src/nodes/lighting/LightingContextNode.js +19 -18
- package/src/nodes/lighting/LightingNode.js +7 -3
- package/src/nodes/lighting/LightsNode.js +112 -75
- package/src/nodes/lighting/PointLightNode.js +12 -13
- package/src/nodes/lighting/RectAreaLightNode.js +11 -11
- package/src/nodes/lighting/SpotLightNode.js +14 -16
- package/src/nodes/materialx/MaterialXNodes.js +2 -2
- package/src/nodes/materialx/lib/mx_hsv.js +36 -31
- package/src/nodes/materialx/lib/mx_noise.js +96 -96
- package/src/nodes/materialx/lib/mx_transform_color.js +2 -2
- package/src/nodes/math/{CondNode.js → ConditionalNode.js} +38 -10
- package/src/nodes/math/Hash.js +13 -0
- package/src/nodes/math/MathNode.js +127 -124
- package/src/nodes/math/MathUtils.js +0 -7
- package/src/nodes/math/OperatorNode.js +97 -52
- package/src/nodes/math/TriNoise3D.js +19 -29
- package/src/nodes/pmrem/PMREMNode.js +61 -15
- package/src/nodes/pmrem/PMREMUtils.js +46 -46
- package/src/nodes/procedural/Checker.js +14 -0
- package/src/nodes/tsl/TSLBase.js +30 -0
- package/src/nodes/{shadernode/ShaderNode.js → tsl/TSLCore.js} +105 -97
- package/src/nodes/utils/ArrayElementNode.js +8 -4
- package/src/nodes/utils/ConvertNode.js +7 -3
- package/src/nodes/utils/CubeMapNode.js +160 -0
- package/src/nodes/utils/Discard.js +8 -0
- package/src/nodes/utils/EquirectUVNode.js +9 -6
- package/src/nodes/utils/FlipNode.js +68 -0
- package/src/nodes/utils/FunctionOverloadingNode.js +9 -5
- package/src/nodes/utils/JoinNode.js +6 -3
- package/src/nodes/utils/LoopNode.js +16 -6
- package/src/nodes/utils/MatcapUVNode.js +10 -7
- package/src/nodes/utils/MaxMipLevelNode.js +8 -5
- package/src/nodes/utils/OscNode.js +12 -8
- package/src/nodes/utils/Packing.js +4 -0
- package/src/nodes/utils/RTTNode.js +11 -8
- package/src/nodes/utils/ReflectorNode.js +12 -4
- package/src/nodes/utils/RemapNode.js +12 -8
- package/src/nodes/utils/RotateNode.js +8 -13
- package/src/nodes/utils/SetNode.js +7 -4
- package/src/nodes/utils/SplitNode.js +7 -3
- package/src/nodes/utils/SpriteSheetUVNode.js +10 -6
- package/src/nodes/utils/SpriteUtils.js +47 -0
- package/src/nodes/utils/StorageArrayElementNode.js +11 -12
- package/src/nodes/utils/TimerNode.js +8 -5
- package/src/nodes/utils/TriplanarTexturesNode.js +11 -9
- package/src/nodes/utils/UVUtils.js +19 -0
- package/src/nodes/utils/ViewportUtils.js +14 -0
- package/src/objects/BatchedMesh.js +78 -13
- 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 +88 -41
- package/src/renderers/common/Backend.js +2 -2
- package/src/renderers/common/Background.js +3 -1
- package/src/renderers/common/BindGroup.js +3 -1
- package/src/renderers/common/Bindings.js +13 -15
- package/src/renderers/common/BundleGroup.js +26 -0
- package/src/renderers/common/ClippingContext.js +15 -5
- package/src/renderers/common/CubeRenderTarget.js +9 -3
- package/src/renderers/common/PostProcessing.js +4 -1
- package/src/renderers/common/QuadMesh.js +2 -0
- package/src/renderers/common/RenderContext.js +23 -0
- package/src/renderers/common/RenderList.js +1 -1
- package/src/renderers/common/RenderObject.js +117 -6
- package/src/renderers/common/RenderObjects.js +8 -1
- package/src/renderers/common/Renderer.js +128 -94
- package/src/renderers/common/SampledTexture.js +12 -3
- package/src/renderers/common/Textures.js +8 -12
- package/src/renderers/common/extras/PMREMGenerator.js +19 -22
- package/src/renderers/common/nodes/NodeBuilderState.js +4 -4
- package/src/renderers/common/nodes/NodeLibrary.js +118 -0
- package/src/renderers/common/nodes/NodeSampledTexture.js +2 -2
- package/src/renderers/common/nodes/Nodes.js +65 -19
- package/src/renderers/shaders/ShaderChunk/tonemapping_pars_fragment.glsl.js +2 -2
- 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 +3 -1
- package/src/renderers/webgl/WebGLPrograms.js +21 -17
- package/src/renderers/webgl/WebGLProperties.js +7 -0
- package/src/renderers/webgl/WebGLState.js +21 -0
- package/src/renderers/webgl/WebGLTextures.js +83 -4
- package/src/renderers/webgl-fallback/WebGLBackend.js +135 -110
- package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +60 -12
- package/src/renderers/webgl-fallback/utils/WebGLAttributeUtils.js +6 -0
- package/src/renderers/webgl-fallback/utils/WebGLState.js +20 -2
- package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +89 -37
- package/src/renderers/webgpu/WebGPUBackend.js +112 -86
- package/src/renderers/webgpu/WebGPURenderer.Nodes.js +42 -0
- package/src/renderers/webgpu/WebGPURenderer.js +9 -6
- package/src/renderers/webgpu/nodes/BasicNodeLibrary.js +59 -0
- package/src/renderers/webgpu/nodes/StandardNodeLibrary.js +105 -0
- package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +189 -73
- package/src/renderers/webgpu/utils/WebGPUAttributeUtils.js +6 -16
- package/src/renderers/webgpu/utils/WebGPUBindingUtils.js +45 -21
- package/src/renderers/webgpu/utils/WebGPUConstants.js +2 -1
- package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +7 -16
- package/src/renderers/webgpu/utils/WebGPUTexturePassUtils.js +62 -5
- package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +43 -26
- package/src/renderers/webgpu/utils/WebGPUUtils.js +19 -2
- package/src/renderers/webxr/WebXRManager.js +32 -25
- package/src/utils.js +33 -1
- package/examples/jsm/geometries/SDFGeometryGenerator.js +0 -144
- package/examples/jsm/loaders/LogLuvLoader.js +0 -606
- 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/accessors/CameraNode.js +0 -19
- package/src/nodes/accessors/NormalNode.js +0 -14
- package/src/nodes/accessors/PositionNode.js +0 -10
- package/src/nodes/accessors/ReflectVectorNode.js +0 -10
- package/src/nodes/accessors/TangentNode.js +0 -23
- package/src/nodes/core/NodeKeywords.js +0 -80
- package/src/nodes/display/BlendModeNode.js +0 -128
- package/src/nodes/display/ColorAdjustmentNode.js +0 -104
- package/src/nodes/display/ViewportNode.js +0 -137
- package/src/nodes/lighting/LightNode.js +0 -57
- package/src/nodes/materials/InstancedPointsNodeMaterial.js +0 -162
- package/src/nodes/math/HashNode.js +0 -34
- package/src/nodes/procedural/CheckerNode.js +0 -42
- package/src/nodes/utils/DiscardNode.js +0 -28
- package/src/nodes/utils/PackingNode.js +0 -55
- package/src/nodes/utils/RotateUVNode.js +0 -35
- /package/src/nodes/accessors/{UVNode.js → UV.js} +0 -0
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import { addNodeClass } from '../core/Node.js';
|
|
2
1
|
import TempNode from '../core/TempNode.js';
|
|
3
|
-
import {
|
|
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
|
-
export const assign = nodeProxy( AssignNode );
|
|
125
|
-
|
|
126
|
-
addNodeClass( 'AssignNode', AssignNode );
|
|
129
|
+
export const assign = /*@__PURE__*/ nodeProxy( AssignNode );
|
|
127
130
|
|
|
128
|
-
|
|
131
|
+
addMethodChaining( 'assign', assign );
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import Node
|
|
2
|
-
import { varying } from '
|
|
3
|
-
import { nodeObject } from '../shadernode/ShaderNode.js';
|
|
1
|
+
import Node from './Node.js';
|
|
2
|
+
import { nodeObject, varying } from '../tsl/TSLBase.js';
|
|
4
3
|
|
|
5
4
|
class AttributeNode extends Node {
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
static get type() {
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
return 'AttributeNode';
|
|
9
|
+
|
|
10
|
+
}
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
constructor( attributeName, nodeType = null ) {
|
|
13
|
+
|
|
14
|
+
super( nodeType );
|
|
12
15
|
|
|
13
16
|
this.global = true;
|
|
14
17
|
|
|
@@ -24,7 +27,7 @@ class AttributeNode extends Node {
|
|
|
24
27
|
|
|
25
28
|
getNodeType( builder ) {
|
|
26
29
|
|
|
27
|
-
let nodeType =
|
|
30
|
+
let nodeType = this.nodeType;
|
|
28
31
|
|
|
29
32
|
if ( nodeType === null ) {
|
|
30
33
|
|
|
@@ -91,17 +94,7 @@ class AttributeNode extends Node {
|
|
|
91
94
|
|
|
92
95
|
console.warn( `AttributeNode: Vertex attribute "${ attributeName }" not found on geometry.` );
|
|
93
96
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
if ( defaultNode !== null ) {
|
|
97
|
-
|
|
98
|
-
return defaultNode.build( builder, nodeType );
|
|
99
|
-
|
|
100
|
-
} else {
|
|
101
|
-
|
|
102
|
-
return builder.generateConst( nodeType );
|
|
103
|
-
|
|
104
|
-
}
|
|
97
|
+
return builder.generateConst( nodeType );
|
|
105
98
|
|
|
106
99
|
}
|
|
107
100
|
|
|
@@ -129,6 +122,4 @@ class AttributeNode extends Node {
|
|
|
129
122
|
|
|
130
123
|
export default AttributeNode;
|
|
131
124
|
|
|
132
|
-
export const attribute = ( name, nodeType
|
|
133
|
-
|
|
134
|
-
addNodeClass( 'AttributeNode', AttributeNode );
|
|
125
|
+
export const attribute = ( name, nodeType ) => nodeObject( new AttributeNode( name, nodeType ) );
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import Node
|
|
2
|
-
import {
|
|
1
|
+
import Node from './Node.js';
|
|
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
|
-
export const bypass = nodeProxy( BypassNode );
|
|
42
|
-
|
|
43
|
-
addNodeElement( 'bypass', bypass );
|
|
47
|
+
export const bypass = /*@__PURE__*/ nodeProxy( BypassNode );
|
|
44
48
|
|
|
45
|
-
|
|
49
|
+
addMethodChaining( 'bypass', bypass );
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import Node
|
|
2
|
-
import {
|
|
1
|
+
import Node from './Node.js';
|
|
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
|
|
|
@@ -41,6 +47,4 @@ export default CacheNode;
|
|
|
41
47
|
|
|
42
48
|
export const cache = ( node, ...params ) => nodeObject( new CacheNode( nodeObject( node ), ...params ) );
|
|
43
49
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
addNodeClass( 'CacheNode', CacheNode );
|
|
50
|
+
addMethodChaining( 'cache', cache );
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import InputNode from './InputNode.js';
|
|
2
|
-
import { addNodeClass } from './Node.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
|
-
addNodeClass( 'ConstNode', ConstNode );
|
|
@@ -1,16 +1,28 @@
|
|
|
1
|
-
import Node
|
|
2
|
-
import {
|
|
1
|
+
import Node from './Node.js';
|
|
2
|
+
import { addMethodChaining, nodeProxy } from '../tsl/TSLCore.js';
|
|
3
3
|
|
|
4
4
|
class ContextNode extends Node {
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
static get type() {
|
|
7
|
+
|
|
8
|
+
return 'ContextNode';
|
|
9
|
+
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
constructor( node, value = {} ) {
|
|
7
13
|
|
|
8
14
|
super();
|
|
9
15
|
|
|
10
16
|
this.isContextNode = true;
|
|
11
17
|
|
|
12
18
|
this.node = node;
|
|
13
|
-
this.
|
|
19
|
+
this.value = value;
|
|
20
|
+
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
getScope() {
|
|
24
|
+
|
|
25
|
+
return this.node.getScope();
|
|
14
26
|
|
|
15
27
|
}
|
|
16
28
|
|
|
@@ -30,7 +42,7 @@ class ContextNode extends Node {
|
|
|
30
42
|
|
|
31
43
|
const previousContext = builder.getContext();
|
|
32
44
|
|
|
33
|
-
builder.setContext( { ...builder.context, ...this.
|
|
45
|
+
builder.setContext( { ...builder.context, ...this.value } );
|
|
34
46
|
|
|
35
47
|
const node = this.node.build( builder );
|
|
36
48
|
|
|
@@ -44,7 +56,7 @@ class ContextNode extends Node {
|
|
|
44
56
|
|
|
45
57
|
const previousContext = builder.getContext();
|
|
46
58
|
|
|
47
|
-
builder.setContext( { ...builder.context, ...this.
|
|
59
|
+
builder.setContext( { ...builder.context, ...this.value } );
|
|
48
60
|
|
|
49
61
|
const snippet = this.node.build( builder, output );
|
|
50
62
|
|
|
@@ -58,10 +70,8 @@ class ContextNode extends Node {
|
|
|
58
70
|
|
|
59
71
|
export default ContextNode;
|
|
60
72
|
|
|
61
|
-
export const context = nodeProxy( ContextNode );
|
|
73
|
+
export const context = /*@__PURE__*/ nodeProxy( ContextNode );
|
|
62
74
|
export const label = ( node, name ) => context( node, { label: name } );
|
|
63
75
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
addNodeClass( 'ContextNode', ContextNode );
|
|
76
|
+
addMethodChaining( 'context', context );
|
|
77
|
+
addMethodChaining( 'label', label );
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
-
import Node
|
|
2
|
-
import { varying } from '
|
|
3
|
-
import { nodeImmutable } from '../shadernode/ShaderNode.js';
|
|
1
|
+
import Node from './Node.js';
|
|
2
|
+
import { nodeImmutable, varying } from '../tsl/TSLBase.js';
|
|
4
3
|
|
|
5
4
|
class IndexNode extends Node {
|
|
6
5
|
|
|
6
|
+
static get type() {
|
|
7
|
+
|
|
8
|
+
return 'IndexNode';
|
|
9
|
+
|
|
10
|
+
}
|
|
11
|
+
|
|
7
12
|
constructor( scope ) {
|
|
8
13
|
|
|
9
14
|
super( 'uint' );
|
|
@@ -23,16 +28,34 @@ class IndexNode extends Node {
|
|
|
23
28
|
|
|
24
29
|
if ( scope === IndexNode.VERTEX ) {
|
|
25
30
|
|
|
31
|
+
// The index of a vertex within a mesh.
|
|
26
32
|
propertyName = builder.getVertexIndex();
|
|
27
33
|
|
|
28
34
|
} else if ( scope === IndexNode.INSTANCE ) {
|
|
29
35
|
|
|
36
|
+
// The index of either a mesh instance or an invocation of a compute shader.
|
|
30
37
|
propertyName = builder.getInstanceIndex();
|
|
31
38
|
|
|
32
39
|
} else if ( scope === IndexNode.DRAW ) {
|
|
33
40
|
|
|
41
|
+
// The index of a draw call.
|
|
34
42
|
propertyName = builder.getDrawIndex();
|
|
35
43
|
|
|
44
|
+
} else if ( scope === IndexNode.INVOCATION_LOCAL ) {
|
|
45
|
+
|
|
46
|
+
// The index of a compute invocation within the scope of a workgroup load.
|
|
47
|
+
propertyName = builder.getInvocationLocalIndex();
|
|
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
|
+
|
|
36
59
|
} else {
|
|
37
60
|
|
|
38
61
|
throw new Error( 'THREE.IndexNode: Unknown scope: ' + scope );
|
|
@@ -61,12 +84,16 @@ class IndexNode extends Node {
|
|
|
61
84
|
|
|
62
85
|
IndexNode.VERTEX = 'vertex';
|
|
63
86
|
IndexNode.INSTANCE = 'instance';
|
|
87
|
+
IndexNode.SUBGROUP = 'subgroup';
|
|
88
|
+
IndexNode.INVOCATION_LOCAL = 'invocationLocal';
|
|
89
|
+
IndexNode.INVOCATION_SUBGROUP = 'invocationSubgroup';
|
|
64
90
|
IndexNode.DRAW = 'draw';
|
|
65
91
|
|
|
66
92
|
export default IndexNode;
|
|
67
93
|
|
|
68
|
-
export const vertexIndex = nodeImmutable( IndexNode, IndexNode.VERTEX );
|
|
69
|
-
export const instanceIndex = nodeImmutable( IndexNode, IndexNode.INSTANCE );
|
|
70
|
-
export const
|
|
71
|
-
|
|
72
|
-
|
|
94
|
+
export const vertexIndex = /*@__PURE__*/ nodeImmutable( IndexNode, IndexNode.VERTEX );
|
|
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 );
|
|
98
|
+
export const invocationLocalIndex = /*@__PURE__*/ nodeImmutable( IndexNode, IndexNode.INVOCATION_LOCAL );
|
|
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
|
-
addNodeClass( 'InputNode', InputNode );
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { addNodeClass } from './Node.js';
|
|
2
1
|
import OutputStructNode from './OutputStructNode.js';
|
|
3
|
-
import { nodeProxy, vec4 } from '../
|
|
2
|
+
import { nodeProxy, vec4 } from '../tsl/TSLBase.js';
|
|
4
3
|
|
|
5
|
-
function getTextureIndex( textures, name ) {
|
|
4
|
+
export function getTextureIndex( textures, name ) {
|
|
6
5
|
|
|
7
6
|
for ( let i = 0; i < textures.length; i ++ ) {
|
|
8
7
|
|
|
@@ -20,6 +19,12 @@ 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();
|
|
@@ -30,7 +35,13 @@ class MRTNode extends OutputStructNode {
|
|
|
30
35
|
|
|
31
36
|
}
|
|
32
37
|
|
|
33
|
-
|
|
38
|
+
has( name ) {
|
|
39
|
+
|
|
40
|
+
return this.outputNodes[ name ] !== undefined;
|
|
41
|
+
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
get( name ) {
|
|
34
45
|
|
|
35
46
|
return this.outputNodes[ name ];
|
|
36
47
|
|
|
@@ -71,6 +82,4 @@ class MRTNode extends OutputStructNode {
|
|
|
71
82
|
|
|
72
83
|
export default MRTNode;
|
|
73
84
|
|
|
74
|
-
export const mrt = nodeProxy( MRTNode );
|
|
75
|
-
|
|
76
|
-
addNodeClass( 'MRTNode', MRTNode );
|
|
85
|
+
export const mrt = /*@__PURE__*/ nodeProxy( MRTNode );
|
package/src/nodes/core/Node.js
CHANGED
|
@@ -4,12 +4,16 @@ import { getNodeChildren, getCacheKey } from './NodeUtils.js';
|
|
|
4
4
|
import { EventDispatcher } from '../../core/EventDispatcher.js';
|
|
5
5
|
import { MathUtils } from '../../math/MathUtils.js';
|
|
6
6
|
|
|
7
|
-
const NodeClasses = new Map();
|
|
8
|
-
|
|
9
7
|
let _nodeId = 0;
|
|
10
8
|
|
|
11
9
|
class Node extends EventDispatcher {
|
|
12
10
|
|
|
11
|
+
static get type() {
|
|
12
|
+
|
|
13
|
+
return 'Node';
|
|
14
|
+
|
|
15
|
+
}
|
|
16
|
+
|
|
13
17
|
constructor( nodeType = null ) {
|
|
14
18
|
|
|
15
19
|
super();
|
|
@@ -149,6 +153,12 @@ class Node extends EventDispatcher {
|
|
|
149
153
|
|
|
150
154
|
}
|
|
151
155
|
|
|
156
|
+
getScope() {
|
|
157
|
+
|
|
158
|
+
return this;
|
|
159
|
+
|
|
160
|
+
}
|
|
161
|
+
|
|
152
162
|
getHash( /*builder*/ ) {
|
|
153
163
|
|
|
154
164
|
return this.uuid;
|
|
@@ -222,18 +232,9 @@ class Node extends EventDispatcher {
|
|
|
222
232
|
|
|
223
233
|
}
|
|
224
234
|
|
|
225
|
-
increaseUsage( builder ) {
|
|
226
|
-
|
|
227
|
-
const nodeData = builder.getDataFromNode( this );
|
|
228
|
-
nodeData.usageCount = nodeData.usageCount === undefined ? 1 : nodeData.usageCount + 1;
|
|
229
|
-
|
|
230
|
-
return nodeData.usageCount;
|
|
231
|
-
|
|
232
|
-
}
|
|
233
|
-
|
|
234
235
|
analyze( builder ) {
|
|
235
236
|
|
|
236
|
-
const usageCount =
|
|
237
|
+
const usageCount = builder.increaseUsage( this );
|
|
237
238
|
|
|
238
239
|
if ( usageCount === 1 ) {
|
|
239
240
|
|
|
@@ -322,7 +323,8 @@ class Node extends EventDispatcher {
|
|
|
322
323
|
|
|
323
324
|
if ( properties.outputNode !== null && builder.stack.nodes.length !== stackNodesBeforeSetup ) {
|
|
324
325
|
|
|
325
|
-
|
|
326
|
+
// !! no outputNode !!
|
|
327
|
+
//properties.outputNode = builder.stack;
|
|
326
328
|
|
|
327
329
|
}
|
|
328
330
|
|
|
@@ -359,6 +361,10 @@ class Node extends EventDispatcher {
|
|
|
359
361
|
|
|
360
362
|
nodeData.snippet = result;
|
|
361
363
|
|
|
364
|
+
} else if ( nodeData.flowCodes !== undefined && builder.context.nodeBlock !== undefined ) {
|
|
365
|
+
|
|
366
|
+
builder.addFlowCodeHierarchy( this, builder.context.nodeBlock );
|
|
367
|
+
|
|
362
368
|
}
|
|
363
369
|
|
|
364
370
|
result = builder.format( result, type, output );
|
|
@@ -542,30 +548,3 @@ class Node extends EventDispatcher {
|
|
|
542
548
|
}
|
|
543
549
|
|
|
544
550
|
export default Node;
|
|
545
|
-
|
|
546
|
-
export function addNodeClass( type, nodeClass ) {
|
|
547
|
-
|
|
548
|
-
if ( typeof nodeClass !== 'function' || ! type ) throw new Error( `Node class ${ type } is not a class` );
|
|
549
|
-
if ( NodeClasses.has( type ) ) {
|
|
550
|
-
|
|
551
|
-
console.warn( `Redefinition of node class ${ type }` );
|
|
552
|
-
return;
|
|
553
|
-
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
NodeClasses.set( type, nodeClass );
|
|
557
|
-
nodeClass.type = type;
|
|
558
|
-
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
export function createNodeFromType( type ) {
|
|
562
|
-
|
|
563
|
-
const Class = NodeClasses.get( type );
|
|
564
|
-
|
|
565
|
-
if ( Class !== undefined ) {
|
|
566
|
-
|
|
567
|
-
return new Class();
|
|
568
|
-
|
|
569
|
-
}
|
|
570
|
-
|
|
571
|
-
}
|