@plastic-software/three 0.174.0 → 0.175.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 +10744 -1476
- package/build/three.core.js +9633 -1096
- package/build/three.core.min.js +1 -1
- package/build/three.module.js +918 -189
- package/build/three.module.min.js +1 -1
- package/build/three.tsl.js +4 -2
- package/build/three.tsl.min.js +1 -1
- package/build/three.webgpu.js +2658 -1697
- package/build/three.webgpu.min.js +1 -1
- package/build/three.webgpu.nodes.js +2654 -1709
- package/build/three.webgpu.nodes.min.js +1 -1
- package/examples/jsm/Addons.js +1 -1
- package/examples/jsm/animation/AnimationClipCreator.js +57 -6
- package/examples/jsm/animation/CCDIKSolver.js +93 -39
- package/examples/jsm/capabilities/WebGL.js +28 -3
- package/examples/jsm/capabilities/WebGPU.js +16 -6
- package/examples/jsm/controls/ArcballControls.js +424 -154
- package/examples/jsm/controls/DragControls.js +93 -2
- package/examples/jsm/controls/FirstPersonControls.js +113 -4
- package/examples/jsm/controls/FlyControls.js +49 -2
- package/examples/jsm/controls/MapControls.js +42 -9
- package/examples/jsm/controls/OrbitControls.js +345 -42
- package/examples/jsm/controls/PointerLockControls.js +111 -9
- package/examples/jsm/controls/TrackballControls.js +159 -8
- package/examples/jsm/controls/TransformControls.js +252 -6
- package/examples/jsm/csm/CSM.js +226 -15
- package/examples/jsm/csm/CSMFrustum.js +52 -0
- package/examples/jsm/csm/CSMHelper.js +47 -0
- package/examples/jsm/csm/CSMShader.js +10 -1
- package/examples/jsm/csm/CSMShadowNode.js +156 -13
- package/examples/jsm/curves/CurveExtras.js +289 -31
- package/examples/jsm/curves/NURBSCurve.js +57 -14
- package/examples/jsm/curves/NURBSSurface.js +50 -6
- package/examples/jsm/curves/NURBSUtils.js +96 -112
- package/examples/jsm/curves/NURBSVolume.js +22 -4
- package/examples/jsm/effects/AnaglyphEffect.js +30 -0
- package/examples/jsm/effects/AsciiEffect.js +60 -15
- package/examples/jsm/effects/OutlineEffect.js +59 -111
- package/examples/jsm/effects/ParallaxBarrierEffect.js +28 -0
- package/examples/jsm/effects/PeppersGhostEffect.js +21 -2
- package/examples/jsm/effects/StereoEffect.js +29 -0
- package/examples/jsm/environments/DebugEnvironment.js +49 -0
- package/examples/jsm/environments/RoomEnvironment.js +23 -4
- package/examples/jsm/exporters/DRACOExporter.js +53 -13
- package/examples/jsm/exporters/EXRExporter.js +37 -8
- package/examples/jsm/exporters/GLTFExporter.js +171 -48
- package/examples/jsm/exporters/KTX2Exporter.js +20 -0
- package/examples/jsm/exporters/OBJExporter.js +18 -0
- package/examples/jsm/exporters/PLYExporter.js +39 -9
- package/examples/jsm/exporters/STLExporter.js +25 -5
- package/examples/jsm/exporters/USDZExporter.js +70 -3
- package/examples/jsm/geometries/BoxLineGeometry.js +22 -0
- package/examples/jsm/geometries/ConvexGeometry.js +18 -0
- package/examples/jsm/geometries/DecalGeometry.js +20 -9
- package/examples/jsm/geometries/ParametricFunctions.js +97 -0
- package/examples/jsm/geometries/ParametricGeometry.js +37 -5
- package/examples/jsm/geometries/RoundedBoxGeometry.js +21 -0
- package/examples/jsm/geometries/TeapotGeometry.js +22 -38
- package/examples/jsm/geometries/TextGeometry.js +44 -16
- package/examples/jsm/helpers/LightProbeHelper.js +35 -0
- package/examples/jsm/helpers/LightProbeHelperGPU.js +36 -0
- package/examples/jsm/helpers/OctreeHelper.js +35 -0
- package/examples/jsm/helpers/PositionalAudioHelper.js +59 -0
- package/examples/jsm/helpers/RectAreaLightHelper.js +35 -3
- package/examples/jsm/helpers/TextureHelper.js +27 -0
- package/examples/jsm/helpers/TextureHelperGPU.js +28 -0
- package/examples/jsm/helpers/VertexNormalsHelper.js +58 -2
- package/examples/jsm/helpers/VertexTangentsHelper.js +46 -2
- package/examples/jsm/helpers/ViewHelper.js +75 -1
- package/examples/jsm/interactive/HTMLMesh.js +25 -0
- package/examples/jsm/interactive/InteractiveGroup.js +65 -5
- package/examples/jsm/interactive/SelectionBox.js +74 -9
- package/examples/jsm/interactive/SelectionHelper.js +71 -29
- package/examples/jsm/libs/motion-controllers.module.js +1 -1
- package/examples/jsm/lighting/TiledLighting.js +23 -0
- package/examples/jsm/lights/LightProbeGenerator.js +26 -1
- package/examples/jsm/lights/RectAreaLightTexturesLib.js +48 -13
- package/examples/jsm/lights/RectAreaLightUniformsLib.js +15 -0
- package/examples/jsm/lines/Line2.js +36 -0
- package/examples/jsm/lines/LineGeometry.js +52 -0
- package/examples/jsm/lines/LineMaterial.js +95 -0
- package/examples/jsm/lines/LineSegments2.js +51 -2
- package/examples/jsm/lines/LineSegmentsGeometry.js +62 -8
- package/examples/jsm/lines/Wireframe.js +38 -2
- package/examples/jsm/lines/WireframeGeometry2.js +24 -0
- package/examples/jsm/lines/webgpu/Line2.js +25 -1
- package/examples/jsm/lines/webgpu/LineSegments2.js +44 -6
- package/examples/jsm/lines/webgpu/Wireframe.js +30 -2
- package/examples/jsm/loaders/3DMLoader.js +71 -2
- package/examples/jsm/loaders/3MFLoader.js +41 -3
- package/examples/jsm/loaders/AMFLoader.js +31 -12
- package/examples/jsm/loaders/BVHLoader.js +57 -11
- package/examples/jsm/loaders/ColladaLoader.js +35 -0
- package/examples/jsm/loaders/DDSLoader.js +24 -0
- package/examples/jsm/loaders/DRACOLoader.js +73 -1
- package/examples/jsm/loaders/EXRLoader.js +40 -8
- package/examples/jsm/loaders/FBXLoader.js +42 -14
- package/examples/jsm/loaders/FontLoader.js +60 -2
- package/examples/jsm/loaders/GCodeLoader.js +33 -5
- package/examples/jsm/loaders/GLTFLoader.js +218 -5
- package/examples/jsm/loaders/HDRCubeTextureLoader.js +48 -0
- package/examples/jsm/loaders/IESLoader.js +41 -0
- package/examples/jsm/loaders/KMZLoader.js +32 -0
- package/examples/jsm/loaders/KTX2Loader.js +86 -18
- package/examples/jsm/loaders/KTXLoader.js +26 -6
- package/examples/jsm/loaders/LDrawLoader.js +115 -5
- package/examples/jsm/loaders/LUT3dlLoader.js +46 -10
- package/examples/jsm/loaders/LUTCubeLoader.js +45 -9
- package/examples/jsm/loaders/LUTImageLoader.js +78 -38
- package/examples/jsm/loaders/LWOLoader.js +46 -7
- package/examples/jsm/loaders/LottieLoader.js +37 -0
- package/examples/jsm/loaders/MD2Loader.js +36 -1
- package/examples/jsm/loaders/MDDLoader.js +56 -12
- package/examples/jsm/loaders/MTLLoader.js +38 -33
- package/examples/jsm/loaders/MaterialXLoader.js +33 -0
- package/examples/jsm/loaders/NRRDLoader.js +36 -5
- package/examples/jsm/loaders/OBJLoader.js +48 -1
- package/examples/jsm/loaders/PCDLoader.js +47 -0
- package/examples/jsm/loaders/PDBLoader.js +40 -2
- package/examples/jsm/loaders/PLYLoader.js +62 -32
- package/examples/jsm/loaders/PVRLoader.js +23 -5
- package/examples/jsm/loaders/RGBELoader.js +38 -5
- package/examples/jsm/loaders/RGBMLoader.js +67 -1
- package/examples/jsm/loaders/STLLoader.js +47 -38
- package/examples/jsm/loaders/SVGLoader.js +113 -20
- package/examples/jsm/loaders/TDSLoader.js +81 -61
- package/examples/jsm/loaders/TGALoader.js +22 -0
- package/examples/jsm/loaders/TIFFLoader.js +22 -0
- package/examples/jsm/loaders/TTFLoader.js +36 -2
- package/examples/jsm/loaders/USDZLoader.js +34 -1
- package/examples/jsm/loaders/UltraHDRLoader.js +58 -12
- package/examples/jsm/loaders/VOXLoader.js +57 -0
- package/examples/jsm/loaders/VRMLLoader.js +32 -1
- package/examples/jsm/loaders/VTKLoader.js +38 -0
- package/examples/jsm/loaders/XYZLoader.js +35 -0
- package/examples/jsm/materials/LDrawConditionalLineMaterial.js +39 -0
- package/examples/jsm/materials/LDrawConditionalLineNodeMaterial.js +39 -0
- package/examples/jsm/materials/MeshPostProcessingMaterial.js +24 -2
- package/examples/jsm/math/Capsule.js +89 -14
- package/examples/jsm/math/ColorConverter.js +21 -0
- package/examples/jsm/math/ColorSpaces.js +53 -0
- package/examples/jsm/math/ConvexHull.js +514 -92
- package/examples/jsm/math/ImprovedNoise.js +14 -2
- package/examples/jsm/math/Lut.js +111 -0
- package/examples/jsm/math/MeshSurfaceSampler.js +76 -13
- package/examples/jsm/math/OBB.js +139 -46
- package/examples/jsm/math/Octree.js +132 -5
- package/examples/jsm/math/SimplexNoise.js +66 -42
- package/examples/jsm/misc/ConvexObjectBreaker.js +43 -25
- package/examples/jsm/misc/GPUComputationRenderer.js +92 -17
- package/examples/jsm/misc/Gyroscope.js +11 -0
- package/examples/jsm/misc/MD2Character.js +115 -2
- package/examples/jsm/misc/MD2CharacterComplex.js +170 -8
- package/examples/jsm/misc/MorphAnimMesh.js +43 -0
- package/examples/jsm/misc/MorphBlendMesh.js +102 -0
- package/examples/jsm/misc/ProgressiveLightMap.js +40 -15
- package/examples/jsm/misc/ProgressiveLightMapGPU.js +33 -13
- package/examples/jsm/misc/RollerCoaster.js +52 -0
- package/examples/jsm/misc/Timer.js +79 -2
- package/examples/jsm/misc/TubePainter.js +53 -0
- package/examples/jsm/misc/Volume.js +108 -72
- package/examples/jsm/misc/VolumeSlice.js +88 -45
- package/examples/jsm/modifiers/CurveModifier.js +57 -34
- package/examples/jsm/modifiers/CurveModifierGPU.js +36 -17
- package/examples/jsm/modifiers/EdgeSplitModifier.js +18 -0
- package/examples/jsm/modifiers/SimplifyModifier.js +20 -8
- package/examples/jsm/modifiers/TessellateModifier.js +33 -2
- package/examples/jsm/objects/GroundedSkybox.js +23 -5
- package/examples/jsm/objects/Lensflare.js +91 -2
- package/examples/jsm/objects/LensflareMesh.js +53 -2
- package/examples/jsm/objects/MarchingCubes.js +88 -5
- package/examples/jsm/objects/Reflector.js +70 -0
- package/examples/jsm/objects/ReflectorForSSRPass.js +39 -0
- package/examples/jsm/objects/Refractor.js +61 -0
- package/examples/jsm/objects/ShadowMesh.js +53 -4
- package/examples/jsm/objects/Sky.js +26 -9
- package/examples/jsm/objects/SkyMesh.js +60 -9
- package/examples/jsm/objects/Water.js +44 -5
- package/examples/jsm/objects/Water2.js +42 -3
- package/examples/jsm/objects/Water2Mesh.js +38 -3
- package/examples/jsm/objects/WaterMesh.js +94 -7
- package/examples/jsm/physics/AmmoPhysics.js +47 -0
- package/examples/jsm/physics/JoltPhysics.js +48 -0
- package/examples/jsm/physics/RapierPhysics.js +56 -0
- package/examples/jsm/postprocessing/AfterimagePass.js +90 -38
- package/examples/jsm/postprocessing/BloomPass.js +125 -24
- package/examples/jsm/postprocessing/BokehPass.js +98 -22
- package/examples/jsm/postprocessing/ClearPass.js +53 -3
- package/examples/jsm/postprocessing/CubeTexturePass.js +81 -21
- package/examples/jsm/postprocessing/DotScreenPass.js +58 -10
- package/examples/jsm/postprocessing/EffectComposer.js +131 -0
- package/examples/jsm/postprocessing/FilmPass.js +53 -5
- package/examples/jsm/postprocessing/GTAOPass.js +191 -48
- package/examples/jsm/postprocessing/GlitchPass.js +84 -33
- package/examples/jsm/postprocessing/HalftonePass.js +64 -10
- package/examples/jsm/postprocessing/LUTPass.js +37 -8
- package/examples/jsm/postprocessing/MaskPass.js +90 -0
- package/examples/jsm/postprocessing/OutlinePass.js +266 -133
- package/examples/jsm/postprocessing/OutputPass.js +53 -14
- package/examples/jsm/postprocessing/Pass.js +98 -4
- package/examples/jsm/postprocessing/RenderPass.js +83 -0
- package/examples/jsm/postprocessing/RenderPixelatedPass.js +123 -45
- package/examples/jsm/postprocessing/RenderTransitionPass.js +119 -21
- package/examples/jsm/postprocessing/SAOPass.js +126 -53
- package/examples/jsm/postprocessing/SMAAPass.js +103 -71
- package/examples/jsm/postprocessing/SSAARenderPass.js +117 -35
- package/examples/jsm/postprocessing/SSAOPass.js +160 -47
- package/examples/jsm/postprocessing/SSRPass.js +230 -49
- package/examples/jsm/postprocessing/SavePass.js +68 -16
- package/examples/jsm/postprocessing/ShaderPass.js +64 -7
- package/examples/jsm/postprocessing/TAARenderPass.js +78 -24
- package/examples/jsm/postprocessing/TexturePass.js +71 -8
- package/examples/jsm/postprocessing/UnrealBloomPass.js +113 -37
- package/examples/jsm/renderers/CSS2DRenderer.js +77 -1
- package/examples/jsm/renderers/CSS3DRenderer.js +99 -3
- package/examples/jsm/renderers/Projector.js +18 -2
- package/examples/jsm/renderers/SVGRenderer.js +124 -0
- package/examples/jsm/shaders/ACESFilmicToneMappingShader.js +9 -5
- package/examples/jsm/shaders/AfterimageShader.js +6 -4
- package/examples/jsm/shaders/BasicShader.js +6 -2
- package/examples/jsm/shaders/BleachBypassShader.js +8 -4
- package/examples/jsm/shaders/BlendShader.js +6 -2
- package/examples/jsm/shaders/BokehShader.js +7 -4
- package/examples/jsm/shaders/BokehShader2.js +7 -3
- package/examples/jsm/shaders/BrightnessContrastShader.js +8 -5
- package/examples/jsm/shaders/ColorCorrectionShader.js +6 -2
- package/examples/jsm/shaders/ColorifyShader.js +6 -2
- package/examples/jsm/shaders/ConvolutionShader.js +7 -39
- package/examples/jsm/shaders/CopyShader.js +6 -2
- package/examples/jsm/shaders/DOFMipMapShader.js +8 -4
- package/examples/jsm/shaders/DepthLimitedBlurShader.js +7 -1
- package/examples/jsm/shaders/DigitalGlitch.js +7 -7
- package/examples/jsm/shaders/DotScreenShader.js +6 -4
- package/examples/jsm/shaders/ExposureShader.js +6 -2
- package/examples/jsm/shaders/FXAAShader.js +15 -7
- package/examples/jsm/shaders/FilmShader.js +10 -0
- package/examples/jsm/shaders/FocusShader.js +6 -4
- package/examples/jsm/shaders/FreiChenShader.js +7 -3
- package/examples/jsm/shaders/GTAOShader.js +33 -39
- package/examples/jsm/shaders/GammaCorrectionShader.js +8 -2
- package/examples/jsm/shaders/GodRaysShader.js +14 -5
- package/examples/jsm/shaders/HalftoneShader.js +11 -5
- package/examples/jsm/shaders/HorizontalBlurShader.js +9 -3
- package/examples/jsm/shaders/HorizontalTiltShiftShader.js +6 -2
- package/examples/jsm/shaders/HueSaturationShader.js +7 -3
- package/examples/jsm/shaders/KaleidoShader.js +8 -4
- package/examples/jsm/shaders/LuminosityHighPassShader.js +6 -5
- package/examples/jsm/shaders/LuminosityShader.js +6 -3
- package/examples/jsm/shaders/MirrorShader.js +7 -4
- package/examples/jsm/shaders/NormalMapShader.js +5 -3
- package/examples/jsm/shaders/OutputShader.js +11 -0
- package/examples/jsm/shaders/PoissonDenoiseShader.js +21 -15
- package/examples/jsm/shaders/RGBShiftShader.js +5 -1
- package/examples/jsm/shaders/SAOShader.js +8 -2
- package/examples/jsm/shaders/SMAAShader.js +23 -1
- package/examples/jsm/shaders/SSAOShader.js +23 -5
- package/examples/jsm/shaders/SSRShader.js +25 -1
- package/examples/jsm/shaders/SepiaShader.js +6 -4
- package/examples/jsm/shaders/SobelOperatorShader.js +5 -2
- package/examples/jsm/shaders/SubsurfaceScatteringShader.js +10 -8
- package/examples/jsm/shaders/TechnicolorShader.js +7 -4
- package/examples/jsm/shaders/ToonShader.js +29 -7
- package/examples/jsm/shaders/TriangleBlurShader.js +6 -4
- package/examples/jsm/shaders/UnpackDepthRGBAShader.js +6 -3
- package/examples/jsm/shaders/VelocityShader.js +6 -2
- package/examples/jsm/shaders/VerticalBlurShader.js +6 -2
- package/examples/jsm/shaders/VerticalTiltShiftShader.js +5 -1
- package/examples/jsm/shaders/VignetteShader.js +6 -4
- package/examples/jsm/shaders/VolumeShader.js +7 -1
- package/examples/jsm/shaders/WaterRefractionShader.js +8 -0
- package/examples/jsm/textures/FlakesTexture.js +12 -0
- package/examples/jsm/transpiler/Transpiler.js +31 -0
- package/examples/jsm/tsl/display/AfterImageNode.js +1 -1
- package/examples/jsm/tsl/display/BloomNode.js +1 -1
- package/examples/jsm/tsl/display/PixelationPassNode.js +4 -4
- package/examples/jsm/tsl/display/SSRNode.js +1 -1
- package/examples/jsm/tsl/lighting/TiledLightsNode.js +29 -3
- package/examples/jsm/tsl/math/Bayer.js +14 -1
- package/examples/jsm/tsl/utils/Raymarching.js +4 -2
- package/examples/jsm/utils/BufferGeometryUtils.js +88 -29
- package/examples/jsm/utils/CameraUtils.js +10 -7
- package/examples/jsm/utils/GeometryCompressionUtils.js +20 -30
- package/examples/jsm/utils/GeometryUtils.js +12 -13
- package/examples/jsm/utils/LDrawUtils.js +11 -4
- package/examples/jsm/utils/SceneOptimizer.js +66 -20
- package/examples/jsm/utils/SceneUtils.js +50 -3
- package/examples/jsm/utils/ShadowMapViewer.js +47 -24
- package/examples/jsm/utils/ShadowMapViewerGPU.js +47 -24
- package/examples/jsm/utils/SkeletonUtils.js +45 -0
- package/examples/jsm/utils/SortUtils.js +14 -5
- package/examples/jsm/utils/UVsDebug.js +9 -4
- package/examples/jsm/utils/WebGLTextureUtils.js +13 -0
- package/examples/jsm/utils/WebGPUTextureUtils.js +14 -0
- package/examples/jsm/utils/WorkerPool.js +65 -2
- package/examples/jsm/webxr/ARButton.js +18 -0
- package/examples/jsm/webxr/OculusHandModel.js +83 -0
- package/examples/jsm/webxr/OculusHandPointerModel.js +125 -0
- package/examples/jsm/webxr/Text2D.js +11 -0
- package/examples/jsm/webxr/VRButton.js +30 -0
- package/examples/jsm/webxr/XRButton.js +22 -0
- package/examples/jsm/webxr/XRControllerModelFactory.js +87 -3
- package/examples/jsm/webxr/XREstimatedLight.js +33 -3
- package/examples/jsm/webxr/XRHandMeshModel.js +35 -0
- package/examples/jsm/webxr/XRHandModelFactory.js +92 -0
- package/examples/jsm/webxr/XRHandPrimitiveModel.js +42 -0
- package/examples/jsm/webxr/XRPlanes.js +17 -0
- package/package.json +1 -1
- package/src/Three.TSL.js +3 -1
- package/src/animation/AnimationAction.js +262 -30
- package/src/animation/AnimationClip.js +141 -2
- package/src/animation/AnimationMixer.js +99 -15
- package/src/animation/AnimationObjectGroup.js +41 -18
- package/src/animation/AnimationUtils.js +168 -18
- package/src/animation/KeyframeTrack.js +144 -10
- package/src/animation/PropertyBinding.js +77 -3
- package/src/animation/PropertyMixer.js +72 -5
- package/src/animation/tracks/BooleanKeyframeTrack.js +33 -6
- package/src/animation/tracks/ColorKeyframeTrack.js +26 -5
- package/src/animation/tracks/NumberKeyframeTrack.js +26 -2
- package/src/animation/tracks/QuaternionKeyframeTrack.js +30 -1
- package/src/animation/tracks/StringKeyframeTrack.js +33 -2
- package/src/animation/tracks/VectorKeyframeTrack.js +26 -2
- package/src/audio/AudioAnalyser.js +1 -1
- package/src/audio/AudioListener.js +2 -2
- package/src/audio/PositionalAudio.js +5 -5
- package/src/constants.js +1432 -5
- package/src/core/BufferAttribute.js +413 -3
- package/src/core/BufferGeometry.js +337 -1
- package/src/core/Clock.js +60 -0
- package/src/core/GLBufferAttribute.js +99 -0
- package/src/core/InstancedBufferAttribute.js +29 -0
- package/src/core/InstancedBufferGeometry.js +20 -0
- package/src/core/InstancedInterleavedBuffer.js +26 -0
- package/src/core/InterleavedBuffer.js +137 -3
- package/src/core/InterleavedBufferAttribute.js +197 -0
- package/src/core/Layers.js +71 -10
- package/src/core/Object3D.js +23 -0
- package/src/core/Raycaster.js +134 -1
- package/src/core/RenderTarget.js +166 -7
- package/src/core/RenderTarget3D.js +25 -0
- package/src/core/RenderTargetArray.js +18 -0
- package/src/core/Uniform.js +29 -0
- package/src/core/UniformsGroup.js +84 -2
- package/src/extras/Controls.js +16 -1
- package/src/extras/Earcut.js +3 -781
- package/src/extras/ImageUtils.js +3 -2
- package/src/extras/PMREMGenerator.js +22 -17
- package/src/extras/core/Curve.js +1 -1
- package/src/extras/core/Path.js +1 -1
- package/src/extras/lib/earcut.js +685 -0
- package/src/geometries/ConeGeometry.js +2 -2
- package/src/geometries/CylinderGeometry.js +2 -2
- package/src/geometries/ExtrudeGeometry.js +71 -39
- package/src/geometries/LatheGeometry.js +1 -1
- package/src/lights/LightShadow.js +1 -1
- package/src/lights/webgpu/IESSpotLight.js +1 -1
- package/src/loaders/AnimationLoader.js +31 -0
- package/src/loaders/AudioLoader.js +31 -0
- package/src/loaders/BufferGeometryLoader.js +34 -0
- package/src/loaders/Cache.js +45 -0
- package/src/loaders/CompressedTextureLoader.js +36 -3
- package/src/loaders/CubeTextureLoader.js +45 -0
- package/src/loaders/DataTextureLoader.js +44 -3
- package/src/loaders/FileLoader.js +57 -1
- package/src/loaders/ImageBitmapLoader.js +57 -0
- package/src/loaders/ImageLoader.js +30 -0
- package/src/loaders/Loader.js +4 -6
- package/src/loaders/LoaderUtils.js +18 -36
- package/src/loaders/LoadingManager.js +142 -0
- package/src/loaders/MaterialLoader.js +57 -0
- package/src/loaders/ObjectLoader.js +58 -1
- package/src/loaders/TextureLoader.js +33 -0
- package/src/loaders/nodes/NodeLoader.js +6 -2
- package/src/loaders/nodes/NodeMaterialLoader.js +1 -1
- package/src/loaders/nodes/NodeObjectLoader.js +3 -3
- package/src/materials/LineBasicMaterial.js +74 -1
- package/src/materials/LineDashedMaterial.js +52 -0
- package/src/materials/Material.js +18 -3
- package/src/materials/MeshBasicMaterial.js +165 -0
- package/src/materials/MeshDepthMaterial.js +93 -0
- package/src/materials/MeshDistanceMaterial.js +76 -0
- package/src/materials/MeshLambertMaterial.js +273 -0
- package/src/materials/MeshMatcapMaterial.js +142 -0
- package/src/materials/MeshNormalMaterial.js +113 -0
- package/src/materials/MeshPhongMaterial.js +288 -0
- package/src/materials/MeshPhysicalMaterial.js +292 -1
- package/src/materials/MeshStandardMaterial.js +297 -0
- package/src/materials/MeshToonMaterial.js +218 -0
- package/src/materials/PointsMaterial.js +89 -0
- package/src/materials/RawShaderMaterial.js +25 -0
- package/src/materials/ShaderMaterial.js +215 -6
- package/src/materials/ShadowMaterial.js +54 -0
- package/src/materials/SpriteMaterial.js +82 -0
- package/src/materials/nodes/Line2NodeMaterial.js +1 -1
- package/src/materials/nodes/LineBasicNodeMaterial.js +2 -2
- package/src/materials/nodes/LineDashedNodeMaterial.js +2 -2
- package/src/materials/nodes/MeshBasicNodeMaterial.js +2 -2
- package/src/materials/nodes/MeshLambertNodeMaterial.js +2 -2
- package/src/materials/nodes/MeshMatcapNodeMaterial.js +2 -2
- package/src/materials/nodes/MeshNormalNodeMaterial.js +2 -2
- package/src/materials/nodes/MeshPhongNodeMaterial.js +2 -2
- package/src/materials/nodes/MeshPhysicalNodeMaterial.js +2 -2
- package/src/materials/nodes/MeshSSSNodeMaterial.js +1 -1
- package/src/materials/nodes/MeshStandardNodeMaterial.js +2 -2
- package/src/materials/nodes/MeshToonNodeMaterial.js +2 -2
- package/src/materials/nodes/NodeMaterial.js +7 -3
- package/src/materials/nodes/PointsNodeMaterial.js +1 -1
- package/src/materials/nodes/ShadowNodeMaterial.js +11 -2
- package/src/materials/nodes/SpriteNodeMaterial.js +1 -1
- package/src/materials/nodes/VolumeNodeMaterial.js +10 -1
- package/src/math/Color.js +1 -1
- package/src/math/MathUtils.js +223 -0
- package/src/nodes/Nodes.js +1 -0
- package/src/nodes/accessors/BatchNode.js +8 -8
- package/src/nodes/accessors/BuiltinNode.js +1 -1
- package/src/nodes/accessors/CubeTextureNode.js +1 -1
- package/src/nodes/accessors/InstanceNode.js +5 -5
- package/src/nodes/accessors/InstancedMeshNode.js +1 -1
- package/src/nodes/accessors/MorphNode.js +27 -23
- package/src/nodes/accessors/Normal.js +1 -1
- package/src/nodes/accessors/Object3DNode.js +12 -12
- package/src/nodes/accessors/ReferenceBaseNode.js +2 -2
- package/src/nodes/accessors/ReferenceNode.js +1 -1
- package/src/nodes/accessors/SkinningNode.js +46 -37
- package/src/nodes/accessors/StorageBufferNode.js +1 -1
- package/src/nodes/accessors/StorageTextureNode.js +3 -3
- package/src/nodes/accessors/Texture3DNode.js +1 -1
- package/src/nodes/accessors/TextureNode.js +25 -5
- package/src/nodes/accessors/TextureSizeNode.js +1 -1
- package/src/nodes/accessors/UniformArrayNode.js +2 -2
- package/src/nodes/code/CodeNode.js +4 -4
- package/src/nodes/code/ExpressionNode.js +4 -4
- package/src/nodes/code/FunctionCallNode.js +23 -3
- package/src/nodes/code/ScriptableNode.js +4 -4
- package/src/nodes/code/ScriptableValueNode.js +2 -2
- package/src/nodes/core/AssignNode.js +1 -1
- package/src/nodes/core/AttributeNode.js +1 -1
- package/src/nodes/core/BypassNode.js +1 -1
- package/src/nodes/core/CacheNode.js +1 -1
- package/src/nodes/core/ContextNode.js +1 -1
- package/src/nodes/core/InputNode.js +2 -2
- package/src/nodes/core/Node.js +14 -2
- package/src/nodes/core/NodeBuilder.js +86 -14
- package/src/nodes/core/StackNode.js +5 -5
- package/src/nodes/core/StructNode.js +1 -1
- package/src/nodes/core/StructTypeNode.js +2 -2
- package/src/nodes/core/VarNode.js +2 -8
- package/src/nodes/core/VaryingNode.js +3 -3
- package/src/nodes/display/BlendModes.js +4 -4
- package/src/nodes/display/BumpMapNode.js +1 -1
- package/src/nodes/display/NormalMapNode.js +1 -1
- package/src/nodes/display/PosterizeNode.js +1 -1
- package/src/nodes/display/ScreenNode.js +3 -3
- package/src/nodes/display/ViewportDepthNode.js +2 -2
- package/src/nodes/display/ViewportDepthTextureNode.js +2 -2
- package/src/nodes/display/ViewportSharedTextureNode.js +2 -2
- package/src/nodes/display/ViewportTextureNode.js +4 -4
- package/src/nodes/functions/ShadowMaskModel.js +4 -4
- package/src/nodes/functions/material/getParallaxCorrectNormal.js +6 -6
- package/src/nodes/geometry/RangeNode.js +1 -1
- package/src/nodes/gpgpu/AtomicFunctionNode.js +16 -40
- package/src/nodes/gpgpu/ComputeBuiltinNode.js +1 -1
- package/src/nodes/gpgpu/ComputeNode.js +30 -2
- package/src/nodes/lighting/AnalyticLightNode.js +9 -1
- package/src/nodes/lighting/LightsNode.js +3 -3
- package/src/nodes/lighting/ShadowNode.js +1 -1
- package/src/nodes/math/ConditionalNode.js +20 -3
- package/src/nodes/math/MathNode.js +83 -78
- package/src/nodes/math/OperatorNode.js +171 -82
- package/src/nodes/pmrem/PMREMNode.js +4 -4
- package/src/nodes/pmrem/PMREMUtils.js +2 -2
- package/src/nodes/tsl/TSLBase.js +2 -1
- package/src/nodes/tsl/TSLCore.js +115 -12
- package/src/nodes/utils/ArrayElementNode.js +3 -1
- package/src/nodes/utils/CubeMapNode.js +3 -3
- package/src/nodes/utils/DebugNode.js +70 -0
- package/src/nodes/utils/EquirectUVNode.js +2 -2
- package/src/nodes/utils/JoinNode.js +27 -2
- package/src/nodes/utils/LoopNode.js +58 -28
- package/src/nodes/utils/MaxMipLevelNode.js +1 -1
- package/src/nodes/utils/ReflectorNode.js +2 -2
- package/src/nodes/utils/RemapNode.js +6 -6
- package/src/nodes/utils/RotateNode.js +1 -1
- package/src/nodes/utils/SpriteSheetUVNode.js +3 -3
- package/src/nodes/utils/StorageArrayElementNode.js +1 -1
- package/src/nodes/utils/TriplanarTexturesNode.js +3 -3
- package/src/objects/BatchedMesh.js +4 -4
- package/src/objects/InstancedMesh.js +2 -2
- package/src/objects/LOD.js +1 -1
- package/src/objects/Skeleton.js +1 -1
- package/src/renderers/WebGL3DRenderTarget.js +25 -0
- package/src/renderers/WebGLArrayRenderTarget.js +25 -0
- package/src/renderers/WebGLCubeRenderTarget.js +39 -1
- package/src/renderers/WebGLRenderTarget.js +19 -0
- package/src/renderers/WebGLRenderer.js +617 -79
- package/src/renderers/common/Animation.js +2 -2
- package/src/renderers/common/Attributes.js +2 -2
- package/src/renderers/common/Backend.js +12 -3
- package/src/renderers/common/Background.js +1 -0
- package/src/renderers/common/Color4.js +1 -1
- package/src/renderers/common/CubeRenderTarget.js +13 -0
- package/src/renderers/common/PostProcessing.js +2 -0
- package/src/renderers/common/QuadMesh.js +2 -0
- package/src/renderers/common/RenderList.js +2 -2
- package/src/renderers/common/RenderObject.js +1 -1
- package/src/renderers/common/RenderObjects.js +2 -2
- package/src/renderers/common/Renderer.js +52 -31
- package/src/renderers/common/XRManager.js +333 -10
- package/src/renderers/common/extras/PMREMGenerator.js +6 -0
- package/src/renderers/common/nodes/NodeBuilderState.js +3 -3
- package/src/renderers/shaders/ShaderChunk/alphamap_fragment.glsl.js +10 -1
- package/src/renderers/shaders/ShaderChunk/aomap_fragment.glsl.js +8 -1
- package/src/renderers/shaders/ShaderChunk/clearcoat_normal_fragment_maps.glsl.js +5 -1
- package/src/renderers/shaders/ShaderChunk/common.glsl.js +82 -0
- package/src/renderers/shaders/ShaderChunk/defaultnormal_vertex.glsl.js +22 -2
- package/src/renderers/shaders/ShaderChunk/map_fragment.glsl.js +12 -1
- package/src/renderers/shaders/ShaderChunk/metalnessmap_fragment.glsl.js +8 -2
- package/src/renderers/shaders/ShaderChunk/normal_fragment_begin.glsl.js +31 -11
- package/src/renderers/shaders/ShaderChunk/normal_fragment_maps.glsl.js +5 -1
- package/src/renderers/shaders/ShaderChunk/normal_pars_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/normal_pars_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/normalmap_pars_fragment.glsl.js +2 -1
- package/src/renderers/shaders/ShaderChunk/roughnessmap_fragment.glsl.js +12 -1
- package/src/renderers/shaders/ShaderChunk/triplanar_fragment.glsl.js +20 -0
- package/src/renderers/shaders/ShaderChunk/uv_pars_fragment.glsl.js +52 -7
- package/src/renderers/shaders/ShaderChunk/uv_pars_vertex.glsl.js +25 -6
- package/src/renderers/shaders/ShaderChunk/uv_vertex.glsl.js +19 -7
- package/src/renderers/shaders/ShaderChunk.js +2 -0
- package/src/renderers/shaders/ShaderLib/linedashed.glsl.js +2 -0
- package/src/renderers/shaders/ShaderLib/meshphysical.glsl.js +1 -0
- package/src/renderers/shaders/UniformsLib.js +6 -5
- package/src/renderers/shaders/UniformsUtils.js +1 -3
- package/src/renderers/webgl/WebGLBackground.js +4 -2
- package/src/renderers/webgl/WebGLMaterials.js +12 -0
- package/src/renderers/webgl/WebGLProgram.js +25 -5
- package/src/renderers/webgl/WebGLPrograms.js +21 -7
- package/src/renderers/webgl/WebGLState.js +9 -9
- package/src/renderers/webgl-fallback/WebGLBackend.js +25 -26
- package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +3 -12
- package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +67 -19
- package/src/renderers/webgl-fallback/utils/WebGLUtils.js +1 -1
- package/src/renderers/webgpu/WebGPUBackend.js +128 -87
- package/src/renderers/webgpu/WebGPURenderer.Nodes.js +1 -11
- package/src/renderers/webgpu/WebGPURenderer.js +17 -11
- package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +4 -4
- package/src/renderers/webgpu/utils/WebGPUAttributeUtils.js +5 -3
- package/src/renderers/webgpu/utils/WebGPUConstants.js +1 -1
- package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +1 -1
- package/src/renderers/webxr/WebXRController.js +87 -2
- package/src/renderers/webxr/WebXRDepthSensing.js +49 -0
- package/src/renderers/webxr/WebXRManager.js +173 -1
- package/src/scenes/Scene.js +2 -1
- package/src/textures/CanvasTexture.js +28 -0
- package/src/textures/CompressedArrayTexture.js +57 -0
- package/src/textures/CompressedCubeTexture.js +29 -0
- package/src/textures/CompressedTexture.js +64 -6
- package/src/textures/CubeTexture.js +52 -4
- package/src/textures/Data3DTexture.js +77 -0
- package/src/textures/DataArrayTexture.js +93 -0
- package/src/textures/DataTexture.js +65 -0
- package/src/textures/DepthTexture.js +59 -9
- package/src/textures/FramebufferTexture.js +62 -0
- package/src/textures/Source.js +69 -0
- package/src/textures/Texture.js +5 -5
- package/src/textures/VideoFrameTexture.js +43 -6
- package/src/textures/VideoTexture.js +49 -4
- package/examples/jsm/geometries/ParametricGeometries.js +0 -254
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Node from '../core/Node.js';
|
|
2
2
|
import { NodeUpdateType } from '../core/constants.js';
|
|
3
|
-
import { float, nodeProxy, Fn, ivec2, int } from '../tsl/TSLBase.js';
|
|
3
|
+
import { float, nodeProxy, Fn, ivec2, int, If } from '../tsl/TSLBase.js';
|
|
4
4
|
import { uniform } from '../core/UniformNode.js';
|
|
5
5
|
import { reference } from './ReferenceNode.js';
|
|
6
6
|
import { positionLocal } from './Position.js';
|
|
@@ -24,7 +24,7 @@ const getMorph = /*@__PURE__*/ Fn( ( { bufferMap, influence, stride, width, dept
|
|
|
24
24
|
const y = texelIndex.div( width );
|
|
25
25
|
const x = texelIndex.sub( y.mul( width ) );
|
|
26
26
|
|
|
27
|
-
const bufferAttrib = textureLoad( bufferMap, ivec2( x, y ) ).depth( depth );
|
|
27
|
+
const bufferAttrib = textureLoad( bufferMap, ivec2( x, y ) ).depth( depth ).xyz;
|
|
28
28
|
|
|
29
29
|
return bufferAttrib.mul( influence );
|
|
30
30
|
|
|
@@ -240,31 +240,35 @@ class MorphNode extends Node {
|
|
|
240
240
|
|
|
241
241
|
}
|
|
242
242
|
|
|
243
|
-
|
|
243
|
+
If( influence.notEqual( 0 ), () => {
|
|
244
244
|
|
|
245
|
-
|
|
246
|
-
bufferMap,
|
|
247
|
-
influence,
|
|
248
|
-
stride,
|
|
249
|
-
width,
|
|
250
|
-
depth: i,
|
|
251
|
-
offset: int( 0 )
|
|
252
|
-
} ) );
|
|
245
|
+
if ( hasMorphPosition === true ) {
|
|
253
246
|
|
|
254
|
-
|
|
247
|
+
positionLocal.addAssign( getMorph( {
|
|
248
|
+
bufferMap,
|
|
249
|
+
influence,
|
|
250
|
+
stride,
|
|
251
|
+
width,
|
|
252
|
+
depth: i,
|
|
253
|
+
offset: int( 0 )
|
|
254
|
+
} ) );
|
|
255
|
+
|
|
256
|
+
}
|
|
255
257
|
|
|
256
|
-
|
|
258
|
+
if ( hasMorphNormals === true ) {
|
|
257
259
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
260
|
+
normalLocal.addAssign( getMorph( {
|
|
261
|
+
bufferMap,
|
|
262
|
+
influence,
|
|
263
|
+
stride,
|
|
264
|
+
width,
|
|
265
|
+
depth: i,
|
|
266
|
+
offset: int( 1 )
|
|
267
|
+
} ) );
|
|
266
268
|
|
|
267
|
-
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
} );
|
|
268
272
|
|
|
269
273
|
} );
|
|
270
274
|
|
|
@@ -303,4 +307,4 @@ export default MorphNode;
|
|
|
303
307
|
* @param {Mesh} mesh - The mesh holding the morph targets.
|
|
304
308
|
* @returns {MorphNode}
|
|
305
309
|
*/
|
|
306
|
-
export const morphReference = /*@__PURE__*/ nodeProxy( MorphNode );
|
|
310
|
+
export const morphReference = /*@__PURE__*/ nodeProxy( MorphNode ).setParameterLength( 1 );
|
|
@@ -23,7 +23,7 @@ export const normalLocal = /*@__PURE__*/ ( Fn( ( builder ) => {
|
|
|
23
23
|
|
|
24
24
|
if ( builder.geometry.hasAttribute( 'normal' ) === false ) {
|
|
25
25
|
|
|
26
|
-
console.warn( 'TSL
|
|
26
|
+
console.warn( 'THREE.TSL: Vertex attribute "normal" not found on geometry.' );
|
|
27
27
|
|
|
28
28
|
return vec3( 0, 1, 0 );
|
|
29
29
|
|
|
@@ -213,57 +213,57 @@ export default Object3DNode;
|
|
|
213
213
|
*
|
|
214
214
|
* @tsl
|
|
215
215
|
* @function
|
|
216
|
-
* @param {?Object3D} [object3d
|
|
216
|
+
* @param {?Object3D} [object3d] - The 3D object.
|
|
217
217
|
* @returns {Object3DNode<vec3>}
|
|
218
218
|
*/
|
|
219
|
-
export const objectDirection = /*@__PURE__*/ nodeProxy( Object3DNode, Object3DNode.DIRECTION );
|
|
219
|
+
export const objectDirection = /*@__PURE__*/ nodeProxy( Object3DNode, Object3DNode.DIRECTION ).setParameterLength( 1 );
|
|
220
220
|
|
|
221
221
|
/**
|
|
222
222
|
* TSL function for creating an object 3D node that represents the object's world matrix.
|
|
223
223
|
*
|
|
224
224
|
* @tsl
|
|
225
225
|
* @function
|
|
226
|
-
* @param {?Object3D} [object3d
|
|
226
|
+
* @param {?Object3D} [object3d] - The 3D object.
|
|
227
227
|
* @returns {Object3DNode<mat4>}
|
|
228
228
|
*/
|
|
229
|
-
export const objectWorldMatrix = /*@__PURE__*/ nodeProxy( Object3DNode, Object3DNode.WORLD_MATRIX );
|
|
229
|
+
export const objectWorldMatrix = /*@__PURE__*/ nodeProxy( Object3DNode, Object3DNode.WORLD_MATRIX ).setParameterLength( 1 );
|
|
230
230
|
|
|
231
231
|
/**
|
|
232
232
|
* TSL function for creating an object 3D node that represents the object's position in world space.
|
|
233
233
|
*
|
|
234
234
|
* @tsl
|
|
235
235
|
* @function
|
|
236
|
-
* @param {?Object3D} [object3d
|
|
236
|
+
* @param {?Object3D} [object3d] - The 3D object.
|
|
237
237
|
* @returns {Object3DNode<vec3>}
|
|
238
238
|
*/
|
|
239
|
-
export const objectPosition = /*@__PURE__*/ nodeProxy( Object3DNode, Object3DNode.POSITION );
|
|
239
|
+
export const objectPosition = /*@__PURE__*/ nodeProxy( Object3DNode, Object3DNode.POSITION ).setParameterLength( 1 );
|
|
240
240
|
|
|
241
241
|
/**
|
|
242
242
|
* TSL function for creating an object 3D node that represents the object's scale in world space.
|
|
243
243
|
*
|
|
244
244
|
* @tsl
|
|
245
245
|
* @function
|
|
246
|
-
* @param {?Object3D} [object3d
|
|
246
|
+
* @param {?Object3D} [object3d] - The 3D object.
|
|
247
247
|
* @returns {Object3DNode<vec3>}
|
|
248
248
|
*/
|
|
249
|
-
export const objectScale = /*@__PURE__*/ nodeProxy( Object3DNode, Object3DNode.SCALE );
|
|
249
|
+
export const objectScale = /*@__PURE__*/ nodeProxy( Object3DNode, Object3DNode.SCALE ).setParameterLength( 1 );
|
|
250
250
|
|
|
251
251
|
/**
|
|
252
252
|
* TSL function for creating an object 3D node that represents the object's position in view/camera space.
|
|
253
253
|
*
|
|
254
254
|
* @tsl
|
|
255
255
|
* @function
|
|
256
|
-
* @param {?Object3D} [object3d
|
|
256
|
+
* @param {?Object3D} [object3d] - The 3D object.
|
|
257
257
|
* @returns {Object3DNode<vec3>}
|
|
258
258
|
*/
|
|
259
|
-
export const objectViewPosition = /*@__PURE__*/ nodeProxy( Object3DNode, Object3DNode.VIEW_POSITION );
|
|
259
|
+
export const objectViewPosition = /*@__PURE__*/ nodeProxy( Object3DNode, Object3DNode.VIEW_POSITION ).setParameterLength( 1 );
|
|
260
260
|
|
|
261
261
|
/**
|
|
262
262
|
* TSL function for creating an object 3D node that represents the object's radius.
|
|
263
263
|
*
|
|
264
264
|
* @tsl
|
|
265
265
|
* @function
|
|
266
|
-
* @param {?Object3D} [object3d
|
|
266
|
+
* @param {?Object3D} [object3d] - The 3D object.
|
|
267
267
|
* @returns {Object3DNode<vec3>}
|
|
268
268
|
*/
|
|
269
|
-
export const objectRadius = /*@__PURE__*/ nodeProxy( Object3DNode, Object3DNode.RADIUS );
|
|
269
|
+
export const objectRadius = /*@__PURE__*/ nodeProxy( Object3DNode, Object3DNode.RADIUS ).setParameterLength( 1 );
|
|
@@ -24,7 +24,7 @@ class ReferenceElementNode extends ArrayElementNode {
|
|
|
24
24
|
/**
|
|
25
25
|
* Constructs a new reference element node.
|
|
26
26
|
*
|
|
27
|
-
* @param {
|
|
27
|
+
* @param {ReferenceBaseNode} referenceNode - The reference node.
|
|
28
28
|
* @param {Node} indexNode - The index node that defines the element access.
|
|
29
29
|
*/
|
|
30
30
|
constructor( referenceNode, indexNode ) {
|
|
@@ -351,7 +351,7 @@ export const reference = ( name, type, object ) => nodeObject( new ReferenceBase
|
|
|
351
351
|
* @param {string} name - The name of the property the node refers to.
|
|
352
352
|
* @param {string} type - The uniform type that should be used to represent the property value.
|
|
353
353
|
* @param {number} count - The number of value inside the array-like object.
|
|
354
|
-
* @param {Object} object - An array-like object the property belongs to.
|
|
354
|
+
* @param {Object} [object] - An array-like object the property belongs to.
|
|
355
355
|
* @returns {ReferenceBaseNode}
|
|
356
356
|
*/
|
|
357
357
|
export const referenceBuffer = ( name, type, count, object ) => nodeObject( new ReferenceBaseNode( name, type, object, count ) );
|
|
@@ -388,7 +388,7 @@ export default ReferenceNode;
|
|
|
388
388
|
* @function
|
|
389
389
|
* @param {string} name - The name of the property the node refers to.
|
|
390
390
|
* @param {string} type - The uniform type that should be used to represent the property value.
|
|
391
|
-
* @param {?Object} object - The object the property belongs to.
|
|
391
|
+
* @param {?Object} [object] - The object the property belongs to.
|
|
392
392
|
* @returns {ReferenceNode}
|
|
393
393
|
*/
|
|
394
394
|
export const reference = ( name, type, object ) => nodeObject( new ReferenceNode( name, type, object ) );
|
|
@@ -10,6 +10,9 @@ import { tangentLocal } from './Tangent.js';
|
|
|
10
10
|
import { uniform } from '../core/UniformNode.js';
|
|
11
11
|
import { buffer } from './BufferNode.js';
|
|
12
12
|
import { getDataFromObject } from '../core/NodeUtils.js';
|
|
13
|
+
import { storage } from './StorageBufferNode.js';
|
|
14
|
+
import { InstancedBufferAttribute } from '../../core/InstancedBufferAttribute.js';
|
|
15
|
+
import { instanceIndex } from '../core/IndexNode.js';
|
|
13
16
|
|
|
14
17
|
const _frameId = new WeakMap();
|
|
15
18
|
|
|
@@ -31,9 +34,8 @@ class SkinningNode extends Node {
|
|
|
31
34
|
* Constructs a new skinning node.
|
|
32
35
|
*
|
|
33
36
|
* @param {SkinnedMesh} skinnedMesh - The skinned mesh.
|
|
34
|
-
* @param {boolean} [useReference=false] - Whether to use reference nodes for internal skinned mesh related data or not.
|
|
35
37
|
*/
|
|
36
|
-
constructor( skinnedMesh
|
|
38
|
+
constructor( skinnedMesh ) {
|
|
37
39
|
|
|
38
40
|
super( 'void' );
|
|
39
41
|
|
|
@@ -44,14 +46,6 @@ class SkinningNode extends Node {
|
|
|
44
46
|
*/
|
|
45
47
|
this.skinnedMesh = skinnedMesh;
|
|
46
48
|
|
|
47
|
-
/**
|
|
48
|
-
* Whether to use reference nodes for internal skinned mesh related data or not.
|
|
49
|
-
* TODO: Explain the purpose of the property.
|
|
50
|
-
*
|
|
51
|
-
* @type {boolean}
|
|
52
|
-
*/
|
|
53
|
-
this.useReference = useReference;
|
|
54
|
-
|
|
55
49
|
/**
|
|
56
50
|
* The update type overwritten since skinning nodes are updated per object.
|
|
57
51
|
*
|
|
@@ -75,42 +69,40 @@ class SkinningNode extends Node {
|
|
|
75
69
|
*/
|
|
76
70
|
this.skinWeightNode = attribute( 'skinWeight', 'vec4' );
|
|
77
71
|
|
|
78
|
-
let bindMatrixNode, bindMatrixInverseNode, boneMatricesNode;
|
|
79
|
-
|
|
80
|
-
if ( useReference ) {
|
|
81
|
-
|
|
82
|
-
bindMatrixNode = reference( 'bindMatrix', 'mat4' );
|
|
83
|
-
bindMatrixInverseNode = reference( 'bindMatrixInverse', 'mat4' );
|
|
84
|
-
boneMatricesNode = referenceBuffer( 'skeleton.boneMatrices', 'mat4', skinnedMesh.skeleton.bones.length );
|
|
85
|
-
|
|
86
|
-
} else {
|
|
87
|
-
|
|
88
|
-
bindMatrixNode = uniform( skinnedMesh.bindMatrix, 'mat4' );
|
|
89
|
-
bindMatrixInverseNode = uniform( skinnedMesh.bindMatrixInverse, 'mat4' );
|
|
90
|
-
boneMatricesNode = buffer( skinnedMesh.skeleton.boneMatrices, 'mat4', skinnedMesh.skeleton.bones.length );
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
|
|
94
72
|
/**
|
|
95
73
|
* The bind matrix node.
|
|
96
74
|
*
|
|
97
75
|
* @type {Node<mat4>}
|
|
98
76
|
*/
|
|
99
|
-
this.bindMatrixNode =
|
|
77
|
+
this.bindMatrixNode = reference( 'bindMatrix', 'mat4' );
|
|
100
78
|
|
|
101
79
|
/**
|
|
102
80
|
* The bind matrix inverse node.
|
|
103
81
|
*
|
|
104
82
|
* @type {Node<mat4>}
|
|
105
83
|
*/
|
|
106
|
-
this.bindMatrixInverseNode =
|
|
84
|
+
this.bindMatrixInverseNode = reference( 'bindMatrixInverse', 'mat4' );
|
|
107
85
|
|
|
108
86
|
/**
|
|
109
87
|
* The bind matrices as a uniform buffer node.
|
|
110
88
|
*
|
|
111
89
|
* @type {Node}
|
|
112
90
|
*/
|
|
113
|
-
this.boneMatricesNode =
|
|
91
|
+
this.boneMatricesNode = referenceBuffer( 'skeleton.boneMatrices', 'mat4', skinnedMesh.skeleton.bones.length );
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* The current vertex position in local space.
|
|
95
|
+
*
|
|
96
|
+
* @type {Node<vec3>}
|
|
97
|
+
*/
|
|
98
|
+
this.positionNode = positionLocal;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* The result of vertex position in local space.
|
|
102
|
+
*
|
|
103
|
+
* @type {Node<vec3>}
|
|
104
|
+
*/
|
|
105
|
+
this.toPositionNode = positionLocal;
|
|
114
106
|
|
|
115
107
|
/**
|
|
116
108
|
* The previous bind matrices as a uniform buffer node.
|
|
@@ -127,10 +119,10 @@ class SkinningNode extends Node {
|
|
|
127
119
|
* Transforms the given vertex position via skinning.
|
|
128
120
|
*
|
|
129
121
|
* @param {Node} [boneMatrices=this.boneMatricesNode] - The bone matrices
|
|
130
|
-
* @param {Node<vec3>} [position=
|
|
122
|
+
* @param {Node<vec3>} [position=this.positionNode] - The vertex position in local space.
|
|
131
123
|
* @return {Node<vec3>} The transformed vertex position.
|
|
132
124
|
*/
|
|
133
|
-
getSkinnedPosition( boneMatrices = this.boneMatricesNode, position =
|
|
125
|
+
getSkinnedPosition( boneMatrices = this.boneMatricesNode, position = this.positionNode ) {
|
|
134
126
|
|
|
135
127
|
const { skinIndexNode, skinWeightNode, bindMatrixNode, bindMatrixInverseNode } = this;
|
|
136
128
|
|
|
@@ -225,6 +217,7 @@ class SkinningNode extends Node {
|
|
|
225
217
|
* Setups the skinning node by assigning the transformed vertex data to predefined node variables.
|
|
226
218
|
*
|
|
227
219
|
* @param {NodeBuilder} builder - The current node builder.
|
|
220
|
+
* @return {Node<vec3>} The transformed vertex position.
|
|
228
221
|
*/
|
|
229
222
|
setup( builder ) {
|
|
230
223
|
|
|
@@ -236,8 +229,9 @@ class SkinningNode extends Node {
|
|
|
236
229
|
|
|
237
230
|
const skinPosition = this.getSkinnedPosition();
|
|
238
231
|
|
|
232
|
+
if ( this.toPositionNode ) this.toPositionNode.assign( skinPosition );
|
|
239
233
|
|
|
240
|
-
|
|
234
|
+
//
|
|
241
235
|
|
|
242
236
|
if ( builder.hasGeometryAttribute( 'normal' ) ) {
|
|
243
237
|
|
|
@@ -253,6 +247,8 @@ class SkinningNode extends Node {
|
|
|
253
247
|
|
|
254
248
|
}
|
|
255
249
|
|
|
250
|
+
return skinPosition;
|
|
251
|
+
|
|
256
252
|
}
|
|
257
253
|
|
|
258
254
|
/**
|
|
@@ -266,7 +262,7 @@ class SkinningNode extends Node {
|
|
|
266
262
|
|
|
267
263
|
if ( output !== 'void' ) {
|
|
268
264
|
|
|
269
|
-
return
|
|
265
|
+
return super.generate( builder, output );
|
|
270
266
|
|
|
271
267
|
}
|
|
272
268
|
|
|
@@ -279,8 +275,7 @@ class SkinningNode extends Node {
|
|
|
279
275
|
*/
|
|
280
276
|
update( frame ) {
|
|
281
277
|
|
|
282
|
-
const
|
|
283
|
-
const skeleton = object.skeleton;
|
|
278
|
+
const skeleton = frame.object && frame.object.skeleton ? frame.object.skeleton : this.skinnedMesh.skeleton;
|
|
284
279
|
|
|
285
280
|
if ( _frameId.get( skeleton ) === frame.frameId ) return;
|
|
286
281
|
|
|
@@ -307,11 +302,25 @@ export default SkinningNode;
|
|
|
307
302
|
export const skinning = ( skinnedMesh ) => nodeObject( new SkinningNode( skinnedMesh ) );
|
|
308
303
|
|
|
309
304
|
/**
|
|
310
|
-
* TSL function for
|
|
305
|
+
* TSL function for computing skinning.
|
|
311
306
|
*
|
|
312
307
|
* @tsl
|
|
313
308
|
* @function
|
|
314
309
|
* @param {SkinnedMesh} skinnedMesh - The skinned mesh.
|
|
310
|
+
* @param {Node<vec3>} [toPosition=null] - The target position.
|
|
315
311
|
* @returns {SkinningNode}
|
|
316
312
|
*/
|
|
317
|
-
export const
|
|
313
|
+
export const computeSkinning = ( skinnedMesh, toPosition = null ) => {
|
|
314
|
+
|
|
315
|
+
const node = new SkinningNode( skinnedMesh );
|
|
316
|
+
node.positionNode = storage( new InstancedBufferAttribute( skinnedMesh.geometry.getAttribute( 'position' ).array, 3 ), 'vec3' ).setPBO( true ).toReadOnly().element( instanceIndex ).toVar();
|
|
317
|
+
node.skinIndexNode = storage( new InstancedBufferAttribute( new Uint32Array( skinnedMesh.geometry.getAttribute( 'skinIndex' ).array ), 4 ), 'uvec4' ).setPBO( true ).toReadOnly().element( instanceIndex ).toVar();
|
|
318
|
+
node.skinWeightNode = storage( new InstancedBufferAttribute( skinnedMesh.geometry.getAttribute( 'skinWeight' ).array, 4 ), 'vec4' ).setPBO( true ).toReadOnly().element( instanceIndex ).toVar();
|
|
319
|
+
node.bindMatrixNode = uniform( skinnedMesh.bindMatrix, 'mat4' );
|
|
320
|
+
node.bindMatrixInverseNode = uniform( skinnedMesh.bindMatrixInverse, 'mat4' );
|
|
321
|
+
node.boneMatricesNode = buffer( skinnedMesh.skeleton.boneMatrices, 'mat4', skinnedMesh.skeleton.bones.length );
|
|
322
|
+
node.toPositionNode = toPosition;
|
|
323
|
+
|
|
324
|
+
return nodeObject( node );
|
|
325
|
+
|
|
326
|
+
};
|
|
@@ -11,7 +11,7 @@ import { NodeAccess } from '../core/constants.js';
|
|
|
11
11
|
*
|
|
12
12
|
* const computeTexture = Fn( ( { storageTexture } ) => {
|
|
13
13
|
*
|
|
14
|
-
* const posX = instanceIndex.
|
|
14
|
+
* const posX = instanceIndex.mod( width );
|
|
15
15
|
* const posY = instanceIndex.div( width );
|
|
16
16
|
* const indexUV = uvec2( posX, posY );
|
|
17
17
|
*
|
|
@@ -203,11 +203,11 @@ export default StorageTextureNode;
|
|
|
203
203
|
* @tsl
|
|
204
204
|
* @function
|
|
205
205
|
* @param {StorageTexture} value - The storage texture.
|
|
206
|
-
* @param {Node<vec2|vec3>} uvNode - The uv node.
|
|
206
|
+
* @param {?Node<vec2|vec3>} uvNode - The uv node.
|
|
207
207
|
* @param {?Node} [storeNode=null] - The value node that should be stored in the texture.
|
|
208
208
|
* @returns {StorageTextureNode}
|
|
209
209
|
*/
|
|
210
|
-
export const storageTexture = /*@__PURE__*/ nodeProxy( StorageTextureNode );
|
|
210
|
+
export const storageTexture = /*@__PURE__*/ nodeProxy( StorageTextureNode ).setParameterLength( 1, 3 );
|
|
211
211
|
|
|
212
212
|
|
|
213
213
|
/**
|
|
@@ -183,4 +183,4 @@ export default Texture3DNode;
|
|
|
183
183
|
* @param {?Node<int>} [levelNode=null] - The level node.
|
|
184
184
|
* @returns {Texture3DNode}
|
|
185
185
|
*/
|
|
186
|
-
export const texture3D = /*@__PURE__*/ nodeProxy( Texture3DNode );
|
|
186
|
+
export const texture3D = /*@__PURE__*/ nodeProxy( Texture3DNode ).setParameterLength( 1, 3 );
|
|
@@ -7,7 +7,7 @@ import { maxMipLevel } from '../utils/MaxMipLevelNode.js';
|
|
|
7
7
|
import { nodeProxy, vec3, nodeObject, int } from '../tsl/TSLBase.js';
|
|
8
8
|
import { NodeUpdateType } from '../core/constants.js';
|
|
9
9
|
|
|
10
|
-
import { IntType, UnsignedIntType } from '../../constants.js';
|
|
10
|
+
import { IntType, NearestFilter, UnsignedIntType } from '../../constants.js';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* This type of uniform node represents a 2D texture.
|
|
@@ -439,7 +439,7 @@ class TextureNode extends UniformNode {
|
|
|
439
439
|
const properties = builder.getNodeProperties( this );
|
|
440
440
|
const textureProperty = super.generate( builder, 'property' );
|
|
441
441
|
|
|
442
|
-
if ( output
|
|
442
|
+
if ( /^sampler/.test( output ) ) {
|
|
443
443
|
|
|
444
444
|
return textureProperty + '_sampler';
|
|
445
445
|
|
|
@@ -562,6 +562,16 @@ class TextureNode extends UniformNode {
|
|
|
562
562
|
textureNode.biasNode = nodeObject( amountNode ).mul( maxMipLevel( textureNode ) );
|
|
563
563
|
textureNode.referenceNode = this.getSelf();
|
|
564
564
|
|
|
565
|
+
const map = textureNode.value;
|
|
566
|
+
|
|
567
|
+
if ( map && map.generateMipmaps === false || map.minFilter === NearestFilter || map.magFilter === NearestFilter ) {
|
|
568
|
+
|
|
569
|
+
console.warn( 'THREE.TSL: texture().blur() requires mipmaps and sampling. Use .generateMipmaps=true and .minFilter/.magFilter=THREE.LinearFilter in the Texture.' );
|
|
570
|
+
|
|
571
|
+
textureNode.biasNode = null;
|
|
572
|
+
|
|
573
|
+
}
|
|
574
|
+
|
|
565
575
|
return nodeObject( textureNode );
|
|
566
576
|
|
|
567
577
|
}
|
|
@@ -730,7 +740,7 @@ export default TextureNode;
|
|
|
730
740
|
* @param {?Node<float>} [biasNode=null] - The bias node.
|
|
731
741
|
* @returns {TextureNode}
|
|
732
742
|
*/
|
|
733
|
-
export const texture = /*@__PURE__*/ nodeProxy( TextureNode );
|
|
743
|
+
export const texture = /*@__PURE__*/ nodeProxy( TextureNode ).setParameterLength( 1, 4 );
|
|
734
744
|
|
|
735
745
|
/**
|
|
736
746
|
* TSL function for creating a texture node that fetches/loads texels without interpolation.
|
|
@@ -752,7 +762,17 @@ export const textureLoad = ( ...params ) => texture( ...params ).setSampler( fal
|
|
|
752
762
|
*
|
|
753
763
|
* @tsl
|
|
754
764
|
* @function
|
|
755
|
-
* @param {TextureNode|Texture}
|
|
765
|
+
* @param {TextureNode|Texture} value - The texture or texture node to convert.
|
|
766
|
+
* @returns {Node}
|
|
767
|
+
*/
|
|
768
|
+
export const sampler = ( value ) => ( value.isNode === true ? value : texture( value ) ).convert( 'sampler' );
|
|
769
|
+
|
|
770
|
+
/**
|
|
771
|
+
* Converts a texture or texture node to a sampler comparison.
|
|
772
|
+
*
|
|
773
|
+
* @tsl
|
|
774
|
+
* @function
|
|
775
|
+
* @param {TextureNode|Texture} value - The texture or texture node to convert.
|
|
756
776
|
* @returns {Node}
|
|
757
777
|
*/
|
|
758
|
-
export const
|
|
778
|
+
export const samplerComparison = ( value ) => ( value.isNode === true ? value : texture( value ) ).convert( 'samplerComparison' );
|
|
@@ -74,4 +74,4 @@ export default TextureSizeNode;
|
|
|
74
74
|
* @param {?Node<int>} [levelNode=null] - A level node which defines the requested mip.
|
|
75
75
|
* @returns {TextureSizeNode}
|
|
76
76
|
*/
|
|
77
|
-
export const textureSize = /*@__PURE__*/ nodeProxy( TextureSizeNode );
|
|
77
|
+
export const textureSize = /*@__PURE__*/ nodeProxy( TextureSizeNode ).setParameterLength( 1, 2 );
|
|
@@ -342,7 +342,7 @@ export default UniformArrayNode;
|
|
|
342
342
|
* @tsl
|
|
343
343
|
* @function
|
|
344
344
|
* @param {Array<any>} values - Array-like data.
|
|
345
|
-
* @param {?string} nodeType - The data type of the array elements.
|
|
345
|
+
* @param {?string} [nodeType] - The data type of the array elements.
|
|
346
346
|
* @returns {UniformArrayNode}
|
|
347
347
|
*/
|
|
348
348
|
export const uniformArray = ( values, nodeType ) => nodeObject( new UniformArrayNode( values, nodeType ) );
|
|
@@ -358,7 +358,7 @@ export const uniformArray = ( values, nodeType ) => nodeObject( new UniformArray
|
|
|
358
358
|
*/
|
|
359
359
|
export const uniforms = ( values, nodeType ) => { // @deprecated, r168
|
|
360
360
|
|
|
361
|
-
console.warn( 'TSL
|
|
361
|
+
console.warn( 'THREE.TSL: uniforms() has been renamed to uniformArray().' );
|
|
362
362
|
return nodeObject( new UniformArrayNode( values, nodeType ) );
|
|
363
363
|
|
|
364
364
|
};
|
|
@@ -143,12 +143,12 @@ export default CodeNode;
|
|
|
143
143
|
*
|
|
144
144
|
* @tsl
|
|
145
145
|
* @function
|
|
146
|
-
* @param {string} [code
|
|
147
|
-
* @param {Array<Node>} [includes=[]] - An array of includes.
|
|
148
|
-
* @param {('js'|'wgsl'|'glsl')} [language=''] - The used language.
|
|
146
|
+
* @param {string} [code] - The native code.
|
|
147
|
+
* @param {?Array<Node>} [includes=[]] - An array of includes.
|
|
148
|
+
* @param {?('js'|'wgsl'|'glsl')} [language=''] - The used language.
|
|
149
149
|
* @returns {CodeNode}
|
|
150
150
|
*/
|
|
151
|
-
export const code = /*@__PURE__*/ nodeProxy( CodeNode );
|
|
151
|
+
export const code = /*@__PURE__*/ nodeProxy( CodeNode ).setParameterLength( 1, 3 );
|
|
152
152
|
|
|
153
153
|
/**
|
|
154
154
|
* TSL function for creating a JS code node.
|
|
@@ -46,7 +46,7 @@ class ExpressionNode extends Node {
|
|
|
46
46
|
|
|
47
47
|
} else {
|
|
48
48
|
|
|
49
|
-
return builder.format(
|
|
49
|
+
return builder.format( snippet, type, output );
|
|
50
50
|
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -61,8 +61,8 @@ export default ExpressionNode;
|
|
|
61
61
|
*
|
|
62
62
|
* @tsl
|
|
63
63
|
* @function
|
|
64
|
-
* @param {string} [snippet
|
|
65
|
-
* @param {string} [nodeType='void'] - The node type.
|
|
64
|
+
* @param {string} [snippet] - The native code snippet.
|
|
65
|
+
* @param {?string} [nodeType='void'] - The node type.
|
|
66
66
|
* @returns {ExpressionNode}
|
|
67
67
|
*/
|
|
68
|
-
export const expression = /*@__PURE__*/ nodeProxy( ExpressionNode );
|
|
68
|
+
export const expression = /*@__PURE__*/ nodeProxy( ExpressionNode ).setParameterLength( 1, 2 );
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import TempNode from '../core/TempNode.js';
|
|
2
|
-
import { addMethodChaining, nodeArray, nodeObject, nodeObjects } from '../tsl/TSLCore.js';
|
|
2
|
+
import { addMethodChaining, nodeArray, nodeObject, nodeObjects, float } from '../tsl/TSLCore.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* This module represents the call of a {@link FunctionNode}. Developers are usually not confronted
|
|
@@ -100,6 +100,24 @@ class FunctionCallNode extends TempNode {
|
|
|
100
100
|
|
|
101
101
|
if ( Array.isArray( parameters ) ) {
|
|
102
102
|
|
|
103
|
+
if ( parameters.length > inputs.length ) {
|
|
104
|
+
|
|
105
|
+
console.error( 'THREE.TSL: The number of provided parameters exceeds the expected number of inputs in \'Fn()\'.' );
|
|
106
|
+
|
|
107
|
+
parameters.length = inputs.length;
|
|
108
|
+
|
|
109
|
+
} else if ( parameters.length < inputs.length ) {
|
|
110
|
+
|
|
111
|
+
console.error( 'THREE.TSL: The number of provided parameters is less than the expected number of inputs in \'Fn()\'.' );
|
|
112
|
+
|
|
113
|
+
while ( parameters.length < inputs.length ) {
|
|
114
|
+
|
|
115
|
+
parameters.push( float( 0 ) );
|
|
116
|
+
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
}
|
|
120
|
+
|
|
103
121
|
for ( let i = 0; i < parameters.length; i ++ ) {
|
|
104
122
|
|
|
105
123
|
params.push( generateInput( parameters[ i ], inputs[ i ] ) );
|
|
@@ -118,7 +136,9 @@ class FunctionCallNode extends TempNode {
|
|
|
118
136
|
|
|
119
137
|
} else {
|
|
120
138
|
|
|
121
|
-
|
|
139
|
+
console.error( `THREE.TSL: Input '${ inputNode.name }' not found in \'Fn()\'.` );
|
|
140
|
+
|
|
141
|
+
params.push( generateInput( float( 0 ), inputNode ) );
|
|
122
142
|
|
|
123
143
|
}
|
|
124
144
|
|
|
@@ -128,7 +148,7 @@ class FunctionCallNode extends TempNode {
|
|
|
128
148
|
|
|
129
149
|
const functionName = functionNode.build( builder, 'property' );
|
|
130
150
|
|
|
131
|
-
return `${functionName}( ${params.join( ', ' )} )`;
|
|
151
|
+
return `${ functionName }( ${ params.join( ', ' ) } )`;
|
|
132
152
|
|
|
133
153
|
}
|
|
134
154
|
|
|
@@ -141,7 +141,7 @@ class ScriptableNode extends Node {
|
|
|
141
141
|
this.parameters = parameters;
|
|
142
142
|
|
|
143
143
|
this._local = new Resources();
|
|
144
|
-
this._output = scriptableValue();
|
|
144
|
+
this._output = scriptableValue( null );
|
|
145
145
|
this._outputs = {};
|
|
146
146
|
this._source = this.source;
|
|
147
147
|
this._method = null;
|
|
@@ -719,8 +719,8 @@ export default ScriptableNode;
|
|
|
719
719
|
*
|
|
720
720
|
* @tsl
|
|
721
721
|
* @function
|
|
722
|
-
* @param {
|
|
723
|
-
* @param {Object} [parameters={}] - The parameters definition.
|
|
722
|
+
* @param {CodeNode} [codeNode] - The code node.
|
|
723
|
+
* @param {?Object} [parameters={}] - The parameters definition.
|
|
724
724
|
* @returns {ScriptableNode}
|
|
725
725
|
*/
|
|
726
|
-
export const scriptable = /*@__PURE__*/ nodeProxy( ScriptableNode );
|
|
726
|
+
export const scriptable = /*@__PURE__*/ nodeProxy( ScriptableNode ).setParameterLength( 1, 2 );
|
|
@@ -247,7 +247,7 @@ export default ScriptableValueNode;
|
|
|
247
247
|
*
|
|
248
248
|
* @tsl
|
|
249
249
|
* @function
|
|
250
|
-
* @param {any} [value
|
|
250
|
+
* @param {any} [value] - The value.
|
|
251
251
|
* @returns {ScriptableValueNode}
|
|
252
252
|
*/
|
|
253
|
-
export const scriptableValue = /*@__PURE__*/ nodeProxy( ScriptableValueNode );
|
|
253
|
+
export const scriptableValue = /*@__PURE__*/ nodeProxy( ScriptableValueNode ).setParameterLength( 1 );
|
|
@@ -171,6 +171,6 @@ export default AssignNode;
|
|
|
171
171
|
* @param {Node} sourceNode - The source type.
|
|
172
172
|
* @returns {AssignNode}
|
|
173
173
|
*/
|
|
174
|
-
export const assign = /*@__PURE__*/ nodeProxy( AssignNode );
|
|
174
|
+
export const assign = /*@__PURE__*/ nodeProxy( AssignNode ).setParameterLength( 2 );
|
|
175
175
|
|
|
176
176
|
addMethodChaining( 'assign', assign );
|
|
@@ -161,7 +161,7 @@ export default AttributeNode;
|
|
|
161
161
|
* @tsl
|
|
162
162
|
* @function
|
|
163
163
|
* @param {string} name - The name of the attribute.
|
|
164
|
-
* @param {
|
|
164
|
+
* @param {string} [nodeType] - The node type.
|
|
165
165
|
* @returns {AttributeNode}
|
|
166
166
|
*/
|
|
167
167
|
export const attribute = ( name, nodeType ) => nodeObject( new AttributeNode( name, nodeType ) );
|
|
@@ -88,6 +88,6 @@ export default BypassNode;
|
|
|
88
88
|
* @param {Node} callNode - The call node.
|
|
89
89
|
* @returns {BypassNode}
|
|
90
90
|
*/
|
|
91
|
-
export const bypass = /*@__PURE__*/ nodeProxy( BypassNode );
|
|
91
|
+
export const bypass = /*@__PURE__*/ nodeProxy( BypassNode ).setParameterLength( 2 );
|
|
92
92
|
|
|
93
93
|
addMethodChaining( 'bypass', bypass );
|
|
@@ -92,7 +92,7 @@ export default CacheNode;
|
|
|
92
92
|
* @tsl
|
|
93
93
|
* @function
|
|
94
94
|
* @param {Node} node - The node that should be cached.
|
|
95
|
-
* @param {boolean} parent - Whether this node refers to a shared parent cache or not.
|
|
95
|
+
* @param {boolean} [parent] - Whether this node refers to a shared parent cache or not.
|
|
96
96
|
* @returns {CacheNode}
|
|
97
97
|
*/
|
|
98
98
|
export const cache = ( node, parent ) => nodeObject( new CacheNode( nodeObject( node ), parent ) );
|