@plastic-software/three 0.174.0 → 0.175.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 +10655 -1446
- package/build/three.core.js +9626 -1094
- package/build/three.core.min.js +1 -1
- package/build/three.module.js +834 -157
- 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 +1429 -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 +53 -0
- 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/UniformsLib.js +1 -4
- package/src/renderers/shaders/UniformsUtils.js +1 -3
- package/src/renderers/webgl/WebGLBackground.js +4 -2
- 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,5 +1,5 @@
|
|
|
1
1
|
import TempNode from '../core/TempNode.js';
|
|
2
|
-
import { sub, mul, div } from './OperatorNode.js';
|
|
2
|
+
import { sub, mul, div, mod, equal } from './OperatorNode.js';
|
|
3
3
|
import { addMethodChaining, nodeObject, nodeProxy, float, vec2, vec3, vec4, Fn } from '../tsl/TSLCore.js';
|
|
4
4
|
import { WebGLCoordinateSystem, WebGPUCoordinateSystem } from '../../constants.js';
|
|
5
5
|
|
|
@@ -33,6 +33,24 @@ class MathNode extends TempNode {
|
|
|
33
33
|
|
|
34
34
|
super();
|
|
35
35
|
|
|
36
|
+
// Allow the max() and min() functions to take an arbitrary number of arguments.
|
|
37
|
+
|
|
38
|
+
if ( ( method === MathNode.MAX || method === MathNode.MIN ) && arguments.length > 3 ) {
|
|
39
|
+
|
|
40
|
+
let finalOp = new MathNode( method, aNode, bNode );
|
|
41
|
+
|
|
42
|
+
for ( let i = 2; i < arguments.length - 1; i ++ ) {
|
|
43
|
+
|
|
44
|
+
finalOp = new MathNode( method, finalOp, arguments[ i ] );
|
|
45
|
+
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
aNode = finalOp;
|
|
49
|
+
bNode = arguments[ arguments.length - 1 ];
|
|
50
|
+
cNode = null;
|
|
51
|
+
|
|
52
|
+
}
|
|
53
|
+
|
|
36
54
|
/**
|
|
37
55
|
* The method name.
|
|
38
56
|
*
|
|
@@ -126,7 +144,7 @@ class MathNode extends TempNode {
|
|
|
126
144
|
|
|
127
145
|
return 'vec3';
|
|
128
146
|
|
|
129
|
-
} else if ( method === MathNode.ALL ) {
|
|
147
|
+
} else if ( method === MathNode.ALL || method === MathNode.ANY ) {
|
|
130
148
|
|
|
131
149
|
return 'bool';
|
|
132
150
|
|
|
@@ -134,10 +152,6 @@ class MathNode extends TempNode {
|
|
|
134
152
|
|
|
135
153
|
return builder.changeComponentType( this.aNode.getNodeType( builder ), 'bool' );
|
|
136
154
|
|
|
137
|
-
} else if ( method === MathNode.MOD ) {
|
|
138
|
-
|
|
139
|
-
return this.aNode.getNodeType( builder );
|
|
140
|
-
|
|
141
155
|
} else {
|
|
142
156
|
|
|
143
157
|
return this.getInputType( builder );
|
|
@@ -201,7 +215,7 @@ class MathNode extends TempNode {
|
|
|
201
215
|
|
|
202
216
|
const params = [];
|
|
203
217
|
|
|
204
|
-
if ( method === MathNode.CROSS
|
|
218
|
+
if ( method === MathNode.CROSS ) {
|
|
205
219
|
|
|
206
220
|
params.push(
|
|
207
221
|
a.build( builder, type ),
|
|
@@ -215,7 +229,7 @@ class MathNode extends TempNode {
|
|
|
215
229
|
b.build( builder, inputType )
|
|
216
230
|
);
|
|
217
231
|
|
|
218
|
-
} else if (
|
|
232
|
+
} else if ( coordinateSystem === WebGLCoordinateSystem && ( method === MathNode.MIN || method === MathNode.MAX ) ) {
|
|
219
233
|
|
|
220
234
|
params.push(
|
|
221
235
|
a.build( builder, inputType ),
|
|
@@ -318,7 +332,6 @@ MathNode.BITCAST = 'bitcast';
|
|
|
318
332
|
MathNode.EQUALS = 'equals';
|
|
319
333
|
MathNode.MIN = 'min';
|
|
320
334
|
MathNode.MAX = 'max';
|
|
321
|
-
MathNode.MOD = 'mod';
|
|
322
335
|
MathNode.STEP = 'step';
|
|
323
336
|
MathNode.REFLECT = 'reflect';
|
|
324
337
|
MathNode.DISTANCE = 'distance';
|
|
@@ -380,7 +393,7 @@ export const PI2 = /*@__PURE__*/ float( Math.PI * 2 );
|
|
|
380
393
|
* @param {Node | number} x - The parameter.
|
|
381
394
|
* @returns {Node<bool>}
|
|
382
395
|
*/
|
|
383
|
-
export const all = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ALL );
|
|
396
|
+
export const all = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ALL ).setParameterLength( 1 );
|
|
384
397
|
|
|
385
398
|
/**
|
|
386
399
|
* Returns `true` if any components of `x` are `true`.
|
|
@@ -390,7 +403,7 @@ export const all = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ALL );
|
|
|
390
403
|
* @param {Node | number} x - The parameter.
|
|
391
404
|
* @returns {Node<bool>}
|
|
392
405
|
*/
|
|
393
|
-
export const any = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ANY );
|
|
406
|
+
export const any = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ANY ).setParameterLength( 1 );
|
|
394
407
|
|
|
395
408
|
/**
|
|
396
409
|
* Converts a quantity in degrees to radians.
|
|
@@ -400,7 +413,7 @@ export const any = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ANY );
|
|
|
400
413
|
* @param {Node | number} x - The input in degrees.
|
|
401
414
|
* @returns {Node}
|
|
402
415
|
*/
|
|
403
|
-
export const radians = /*@__PURE__*/ nodeProxy( MathNode, MathNode.RADIANS );
|
|
416
|
+
export const radians = /*@__PURE__*/ nodeProxy( MathNode, MathNode.RADIANS ).setParameterLength( 1 );
|
|
404
417
|
|
|
405
418
|
/**
|
|
406
419
|
* Convert a quantity in radians to degrees.
|
|
@@ -410,7 +423,7 @@ export const radians = /*@__PURE__*/ nodeProxy( MathNode, MathNode.RADIANS );
|
|
|
410
423
|
* @param {Node | number} x - The input in radians.
|
|
411
424
|
* @returns {Node}
|
|
412
425
|
*/
|
|
413
|
-
export const degrees = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DEGREES );
|
|
426
|
+
export const degrees = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DEGREES ).setParameterLength( 1 );
|
|
414
427
|
|
|
415
428
|
/**
|
|
416
429
|
* Returns the natural exponentiation of the parameter.
|
|
@@ -420,7 +433,7 @@ export const degrees = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DEGREES );
|
|
|
420
433
|
* @param {Node | number} x - The parameter.
|
|
421
434
|
* @returns {Node}
|
|
422
435
|
*/
|
|
423
|
-
export const exp = /*@__PURE__*/ nodeProxy( MathNode, MathNode.EXP );
|
|
436
|
+
export const exp = /*@__PURE__*/ nodeProxy( MathNode, MathNode.EXP ).setParameterLength( 1 );
|
|
424
437
|
|
|
425
438
|
/**
|
|
426
439
|
* Returns 2 raised to the power of the parameter.
|
|
@@ -430,7 +443,7 @@ export const exp = /*@__PURE__*/ nodeProxy( MathNode, MathNode.EXP );
|
|
|
430
443
|
* @param {Node | number} x - The parameter.
|
|
431
444
|
* @returns {Node}
|
|
432
445
|
*/
|
|
433
|
-
export const exp2 = /*@__PURE__*/ nodeProxy( MathNode, MathNode.EXP2 );
|
|
446
|
+
export const exp2 = /*@__PURE__*/ nodeProxy( MathNode, MathNode.EXP2 ).setParameterLength( 1 );
|
|
434
447
|
|
|
435
448
|
/**
|
|
436
449
|
* Returns the natural logarithm of the parameter.
|
|
@@ -440,7 +453,7 @@ export const exp2 = /*@__PURE__*/ nodeProxy( MathNode, MathNode.EXP2 );
|
|
|
440
453
|
* @param {Node | number} x - The parameter.
|
|
441
454
|
* @returns {Node}
|
|
442
455
|
*/
|
|
443
|
-
export const log = /*@__PURE__*/ nodeProxy( MathNode, MathNode.LOG );
|
|
456
|
+
export const log = /*@__PURE__*/ nodeProxy( MathNode, MathNode.LOG ).setParameterLength( 1 );
|
|
444
457
|
|
|
445
458
|
/**
|
|
446
459
|
* Returns the base 2 logarithm of the parameter.
|
|
@@ -450,7 +463,7 @@ export const log = /*@__PURE__*/ nodeProxy( MathNode, MathNode.LOG );
|
|
|
450
463
|
* @param {Node | number} x - The parameter.
|
|
451
464
|
* @returns {Node}
|
|
452
465
|
*/
|
|
453
|
-
export const log2 = /*@__PURE__*/ nodeProxy( MathNode, MathNode.LOG2 );
|
|
466
|
+
export const log2 = /*@__PURE__*/ nodeProxy( MathNode, MathNode.LOG2 ).setParameterLength( 1 );
|
|
454
467
|
|
|
455
468
|
/**
|
|
456
469
|
* Returns the square root of the parameter.
|
|
@@ -460,7 +473,7 @@ export const log2 = /*@__PURE__*/ nodeProxy( MathNode, MathNode.LOG2 );
|
|
|
460
473
|
* @param {Node | number} x - The parameter.
|
|
461
474
|
* @returns {Node}
|
|
462
475
|
*/
|
|
463
|
-
export const sqrt = /*@__PURE__*/ nodeProxy( MathNode, MathNode.SQRT );
|
|
476
|
+
export const sqrt = /*@__PURE__*/ nodeProxy( MathNode, MathNode.SQRT ).setParameterLength( 1 );
|
|
464
477
|
|
|
465
478
|
/**
|
|
466
479
|
* Returns the inverse of the square root of the parameter.
|
|
@@ -470,7 +483,7 @@ export const sqrt = /*@__PURE__*/ nodeProxy( MathNode, MathNode.SQRT );
|
|
|
470
483
|
* @param {Node | number} x - The parameter.
|
|
471
484
|
* @returns {Node}
|
|
472
485
|
*/
|
|
473
|
-
export const inverseSqrt = /*@__PURE__*/ nodeProxy( MathNode, MathNode.INVERSE_SQRT );
|
|
486
|
+
export const inverseSqrt = /*@__PURE__*/ nodeProxy( MathNode, MathNode.INVERSE_SQRT ).setParameterLength( 1 );
|
|
474
487
|
|
|
475
488
|
/**
|
|
476
489
|
* Finds the nearest integer less than or equal to the parameter.
|
|
@@ -480,7 +493,7 @@ export const inverseSqrt = /*@__PURE__*/ nodeProxy( MathNode, MathNode.INVERSE_S
|
|
|
480
493
|
* @param {Node | number} x - The parameter.
|
|
481
494
|
* @returns {Node}
|
|
482
495
|
*/
|
|
483
|
-
export const floor = /*@__PURE__*/ nodeProxy( MathNode, MathNode.FLOOR );
|
|
496
|
+
export const floor = /*@__PURE__*/ nodeProxy( MathNode, MathNode.FLOOR ).setParameterLength( 1 );
|
|
484
497
|
|
|
485
498
|
/**
|
|
486
499
|
* Finds the nearest integer that is greater than or equal to the parameter.
|
|
@@ -490,7 +503,7 @@ export const floor = /*@__PURE__*/ nodeProxy( MathNode, MathNode.FLOOR );
|
|
|
490
503
|
* @param {Node | number} x - The parameter.
|
|
491
504
|
* @returns {Node}
|
|
492
505
|
*/
|
|
493
|
-
export const ceil = /*@__PURE__*/ nodeProxy( MathNode, MathNode.CEIL );
|
|
506
|
+
export const ceil = /*@__PURE__*/ nodeProxy( MathNode, MathNode.CEIL ).setParameterLength( 1 );
|
|
494
507
|
|
|
495
508
|
/**
|
|
496
509
|
* Calculates the unit vector in the same direction as the original vector.
|
|
@@ -500,7 +513,7 @@ export const ceil = /*@__PURE__*/ nodeProxy( MathNode, MathNode.CEIL );
|
|
|
500
513
|
* @param {Node} x - The input vector.
|
|
501
514
|
* @returns {Node}
|
|
502
515
|
*/
|
|
503
|
-
export const normalize = /*@__PURE__*/ nodeProxy( MathNode, MathNode.NORMALIZE );
|
|
516
|
+
export const normalize = /*@__PURE__*/ nodeProxy( MathNode, MathNode.NORMALIZE ).setParameterLength( 1 );
|
|
504
517
|
|
|
505
518
|
/**
|
|
506
519
|
* Computes the fractional part of the parameter.
|
|
@@ -510,7 +523,7 @@ export const normalize = /*@__PURE__*/ nodeProxy( MathNode, MathNode.NORMALIZE )
|
|
|
510
523
|
* @param {Node | number} x - The parameter.
|
|
511
524
|
* @returns {Node}
|
|
512
525
|
*/
|
|
513
|
-
export const fract = /*@__PURE__*/ nodeProxy( MathNode, MathNode.FRACT );
|
|
526
|
+
export const fract = /*@__PURE__*/ nodeProxy( MathNode, MathNode.FRACT ).setParameterLength( 1 );
|
|
514
527
|
|
|
515
528
|
/**
|
|
516
529
|
* Returns the sine of the parameter.
|
|
@@ -520,7 +533,7 @@ export const fract = /*@__PURE__*/ nodeProxy( MathNode, MathNode.FRACT );
|
|
|
520
533
|
* @param {Node | number} x - The parameter.
|
|
521
534
|
* @returns {Node}
|
|
522
535
|
*/
|
|
523
|
-
export const sin = /*@__PURE__*/ nodeProxy( MathNode, MathNode.SIN );
|
|
536
|
+
export const sin = /*@__PURE__*/ nodeProxy( MathNode, MathNode.SIN ).setParameterLength( 1 );
|
|
524
537
|
|
|
525
538
|
/**
|
|
526
539
|
* Returns the cosine of the parameter.
|
|
@@ -530,7 +543,7 @@ export const sin = /*@__PURE__*/ nodeProxy( MathNode, MathNode.SIN );
|
|
|
530
543
|
* @param {Node | number} x - The parameter.
|
|
531
544
|
* @returns {Node}
|
|
532
545
|
*/
|
|
533
|
-
export const cos = /*@__PURE__*/ nodeProxy( MathNode, MathNode.COS );
|
|
546
|
+
export const cos = /*@__PURE__*/ nodeProxy( MathNode, MathNode.COS ).setParameterLength( 1 );
|
|
534
547
|
|
|
535
548
|
/**
|
|
536
549
|
* Returns the tangent of the parameter.
|
|
@@ -540,7 +553,7 @@ export const cos = /*@__PURE__*/ nodeProxy( MathNode, MathNode.COS );
|
|
|
540
553
|
* @param {Node | number} x - The parameter.
|
|
541
554
|
* @returns {Node}
|
|
542
555
|
*/
|
|
543
|
-
export const tan = /*@__PURE__*/ nodeProxy( MathNode, MathNode.TAN );
|
|
556
|
+
export const tan = /*@__PURE__*/ nodeProxy( MathNode, MathNode.TAN ).setParameterLength( 1 );
|
|
544
557
|
|
|
545
558
|
/**
|
|
546
559
|
* Returns the arcsine of the parameter.
|
|
@@ -550,7 +563,7 @@ export const tan = /*@__PURE__*/ nodeProxy( MathNode, MathNode.TAN );
|
|
|
550
563
|
* @param {Node | number} x - The parameter.
|
|
551
564
|
* @returns {Node}
|
|
552
565
|
*/
|
|
553
|
-
export const asin = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ASIN );
|
|
566
|
+
export const asin = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ASIN ).setParameterLength( 1 );
|
|
554
567
|
|
|
555
568
|
/**
|
|
556
569
|
* Returns the arccosine of the parameter.
|
|
@@ -560,7 +573,7 @@ export const asin = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ASIN );
|
|
|
560
573
|
* @param {Node | number} x - The parameter.
|
|
561
574
|
* @returns {Node}
|
|
562
575
|
*/
|
|
563
|
-
export const acos = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ACOS );
|
|
576
|
+
export const acos = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ACOS ).setParameterLength( 1 );
|
|
564
577
|
|
|
565
578
|
/**
|
|
566
579
|
* Returns the arc-tangent of the parameter.
|
|
@@ -572,7 +585,7 @@ export const acos = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ACOS );
|
|
|
572
585
|
* @param {?(Node | number)} x - The x parameter.
|
|
573
586
|
* @returns {Node}
|
|
574
587
|
*/
|
|
575
|
-
export const atan = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ATAN );
|
|
588
|
+
export const atan = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ATAN ).setParameterLength( 1, 2 );
|
|
576
589
|
|
|
577
590
|
/**
|
|
578
591
|
* Returns the absolute value of the parameter.
|
|
@@ -582,7 +595,7 @@ export const atan = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ATAN );
|
|
|
582
595
|
* @param {Node | number} x - The parameter.
|
|
583
596
|
* @returns {Node}
|
|
584
597
|
*/
|
|
585
|
-
export const abs = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ABS );
|
|
598
|
+
export const abs = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ABS ).setParameterLength( 1 );
|
|
586
599
|
|
|
587
600
|
/**
|
|
588
601
|
* Extracts the sign of the parameter.
|
|
@@ -592,7 +605,7 @@ export const abs = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ABS );
|
|
|
592
605
|
* @param {Node | number} x - The parameter.
|
|
593
606
|
* @returns {Node}
|
|
594
607
|
*/
|
|
595
|
-
export const sign = /*@__PURE__*/ nodeProxy( MathNode, MathNode.SIGN );
|
|
608
|
+
export const sign = /*@__PURE__*/ nodeProxy( MathNode, MathNode.SIGN ).setParameterLength( 1 );
|
|
596
609
|
|
|
597
610
|
/**
|
|
598
611
|
* Calculates the length of a vector.
|
|
@@ -602,7 +615,7 @@ export const sign = /*@__PURE__*/ nodeProxy( MathNode, MathNode.SIGN );
|
|
|
602
615
|
* @param {Node} x - The parameter.
|
|
603
616
|
* @returns {Node<float>}
|
|
604
617
|
*/
|
|
605
|
-
export const length = /*@__PURE__*/ nodeProxy( MathNode, MathNode.LENGTH );
|
|
618
|
+
export const length = /*@__PURE__*/ nodeProxy( MathNode, MathNode.LENGTH ).setParameterLength( 1 );
|
|
606
619
|
|
|
607
620
|
/**
|
|
608
621
|
* Negates the value of the parameter (-x).
|
|
@@ -612,7 +625,7 @@ export const length = /*@__PURE__*/ nodeProxy( MathNode, MathNode.LENGTH );
|
|
|
612
625
|
* @param {Node | number} x - The parameter.
|
|
613
626
|
* @returns {Node}
|
|
614
627
|
*/
|
|
615
|
-
export const negate = /*@__PURE__*/ nodeProxy( MathNode, MathNode.NEGATE );
|
|
628
|
+
export const negate = /*@__PURE__*/ nodeProxy( MathNode, MathNode.NEGATE ).setParameterLength( 1 );
|
|
616
629
|
|
|
617
630
|
/**
|
|
618
631
|
* Return `1` minus the parameter.
|
|
@@ -622,7 +635,7 @@ export const negate = /*@__PURE__*/ nodeProxy( MathNode, MathNode.NEGATE );
|
|
|
622
635
|
* @param {Node | number} x - The parameter.
|
|
623
636
|
* @returns {Node}
|
|
624
637
|
*/
|
|
625
|
-
export const oneMinus = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ONE_MINUS );
|
|
638
|
+
export const oneMinus = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ONE_MINUS ).setParameterLength( 1 );
|
|
626
639
|
|
|
627
640
|
/**
|
|
628
641
|
* Returns the partial derivative of the parameter with respect to x.
|
|
@@ -632,7 +645,7 @@ export const oneMinus = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ONE_MINUS );
|
|
|
632
645
|
* @param {Node | number} x - The parameter.
|
|
633
646
|
* @returns {Node}
|
|
634
647
|
*/
|
|
635
|
-
export const dFdx = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DFDX );
|
|
648
|
+
export const dFdx = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DFDX ).setParameterLength( 1 );
|
|
636
649
|
|
|
637
650
|
/**
|
|
638
651
|
* Returns the partial derivative of the parameter with respect to y.
|
|
@@ -642,7 +655,7 @@ export const dFdx = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DFDX );
|
|
|
642
655
|
* @param {Node | number} x - The parameter.
|
|
643
656
|
* @returns {Node}
|
|
644
657
|
*/
|
|
645
|
-
export const dFdy = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DFDY );
|
|
658
|
+
export const dFdy = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DFDY ).setParameterLength( 1 );
|
|
646
659
|
|
|
647
660
|
/**
|
|
648
661
|
* Rounds the parameter to the nearest integer.
|
|
@@ -652,7 +665,7 @@ export const dFdy = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DFDY );
|
|
|
652
665
|
* @param {Node | number} x - The parameter.
|
|
653
666
|
* @returns {Node}
|
|
654
667
|
*/
|
|
655
|
-
export const round = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ROUND );
|
|
668
|
+
export const round = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ROUND ).setParameterLength( 1 );
|
|
656
669
|
|
|
657
670
|
/**
|
|
658
671
|
* Returns the reciprocal of the parameter `(1/x)`.
|
|
@@ -662,7 +675,7 @@ export const round = /*@__PURE__*/ nodeProxy( MathNode, MathNode.ROUND );
|
|
|
662
675
|
* @param {Node | number} x - The parameter.
|
|
663
676
|
* @returns {Node}
|
|
664
677
|
*/
|
|
665
|
-
export const reciprocal = /*@__PURE__*/ nodeProxy( MathNode, MathNode.RECIPROCAL );
|
|
678
|
+
export const reciprocal = /*@__PURE__*/ nodeProxy( MathNode, MathNode.RECIPROCAL ).setParameterLength( 1 );
|
|
666
679
|
|
|
667
680
|
/**
|
|
668
681
|
* Truncates the parameter, removing the fractional part.
|
|
@@ -672,7 +685,7 @@ export const reciprocal = /*@__PURE__*/ nodeProxy( MathNode, MathNode.RECIPROCAL
|
|
|
672
685
|
* @param {Node | number} x - The parameter.
|
|
673
686
|
* @returns {Node}
|
|
674
687
|
*/
|
|
675
|
-
export const trunc = /*@__PURE__*/ nodeProxy( MathNode, MathNode.TRUNC );
|
|
688
|
+
export const trunc = /*@__PURE__*/ nodeProxy( MathNode, MathNode.TRUNC ).setParameterLength( 1 );
|
|
676
689
|
|
|
677
690
|
/**
|
|
678
691
|
* Returns the sum of the absolute derivatives in x and y.
|
|
@@ -682,7 +695,7 @@ export const trunc = /*@__PURE__*/ nodeProxy( MathNode, MathNode.TRUNC );
|
|
|
682
695
|
* @param {Node | number} x - The parameter.
|
|
683
696
|
* @returns {Node}
|
|
684
697
|
*/
|
|
685
|
-
export const fwidth = /*@__PURE__*/ nodeProxy( MathNode, MathNode.FWIDTH );
|
|
698
|
+
export const fwidth = /*@__PURE__*/ nodeProxy( MathNode, MathNode.FWIDTH ).setParameterLength( 1 );
|
|
686
699
|
|
|
687
700
|
/**
|
|
688
701
|
* Returns the transpose of a matrix.
|
|
@@ -692,7 +705,7 @@ export const fwidth = /*@__PURE__*/ nodeProxy( MathNode, MathNode.FWIDTH );
|
|
|
692
705
|
* @param {Node<mat2|mat3|mat4>} x - The parameter.
|
|
693
706
|
* @returns {Node}
|
|
694
707
|
*/
|
|
695
|
-
export const transpose = /*@__PURE__*/ nodeProxy( MathNode, MathNode.TRANSPOSE );
|
|
708
|
+
export const transpose = /*@__PURE__*/ nodeProxy( MathNode, MathNode.TRANSPOSE ).setParameterLength( 1 );
|
|
696
709
|
|
|
697
710
|
// 2 inputs
|
|
698
711
|
|
|
@@ -705,7 +718,7 @@ export const transpose = /*@__PURE__*/ nodeProxy( MathNode, MathNode.TRANSPOSE )
|
|
|
705
718
|
* @param {string} y - The new type.
|
|
706
719
|
* @returns {Node}
|
|
707
720
|
*/
|
|
708
|
-
export const bitcast = /*@__PURE__*/ nodeProxy( MathNode, MathNode.BITCAST );
|
|
721
|
+
export const bitcast = /*@__PURE__*/ nodeProxy( MathNode, MathNode.BITCAST ).setParameterLength( 2 );
|
|
709
722
|
|
|
710
723
|
/**
|
|
711
724
|
* Returns `true` if `x` equals `y`.
|
|
@@ -714,42 +727,35 @@ export const bitcast = /*@__PURE__*/ nodeProxy( MathNode, MathNode.BITCAST );
|
|
|
714
727
|
* @function
|
|
715
728
|
* @param {Node | number} x - The first parameter.
|
|
716
729
|
* @param {Node | number} y - The second parameter.
|
|
730
|
+
* @deprecated since r175. Use {@link equal} instead.
|
|
717
731
|
* @returns {Node<bool>}
|
|
718
732
|
*/
|
|
719
|
-
export const equals =
|
|
733
|
+
export const equals = ( x, y ) => { // @deprecated, r172
|
|
720
734
|
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
* @function
|
|
726
|
-
* @param {Node | number} x - The y parameter.
|
|
727
|
-
* @param {Node | number} y - The x parameter.
|
|
728
|
-
* @returns {Node}
|
|
729
|
-
*/
|
|
730
|
-
export const min = /*@__PURE__*/ nodeProxy( MathNode, MathNode.MIN );
|
|
735
|
+
console.warn( 'THREE.TSL: "equals" is deprecated. Use "equal" inside a vector instead, like: "bvec*( equal( ... ) )"' );
|
|
736
|
+
return equal( x, y );
|
|
737
|
+
|
|
738
|
+
};
|
|
731
739
|
|
|
732
740
|
/**
|
|
733
|
-
* Returns the
|
|
741
|
+
* Returns the least of the given values.
|
|
734
742
|
*
|
|
735
743
|
* @tsl
|
|
736
744
|
* @function
|
|
737
|
-
* @param {Node | number}
|
|
738
|
-
* @param {Node | number} y - The x parameter.
|
|
745
|
+
* @param {...(Node | number)} values - The values to compare.
|
|
739
746
|
* @returns {Node}
|
|
740
747
|
*/
|
|
741
|
-
export const
|
|
748
|
+
export const min = /*@__PURE__*/ nodeProxy( MathNode, MathNode.MIN ).setParameterLength( 2, Infinity );
|
|
742
749
|
|
|
743
750
|
/**
|
|
744
|
-
*
|
|
751
|
+
* Returns the greatest of the given values.
|
|
745
752
|
*
|
|
746
753
|
* @tsl
|
|
747
754
|
* @function
|
|
748
|
-
* @param {Node | number}
|
|
749
|
-
* @param {Node | number} y - The x parameter.
|
|
755
|
+
* @param {...(Node | number)} values - The values to compare.
|
|
750
756
|
* @returns {Node}
|
|
751
757
|
*/
|
|
752
|
-
export const
|
|
758
|
+
export const max = /*@__PURE__*/ nodeProxy( MathNode, MathNode.MAX ).setParameterLength( 2, Infinity );
|
|
753
759
|
|
|
754
760
|
/**
|
|
755
761
|
* Generate a step function by comparing two values.
|
|
@@ -760,7 +766,7 @@ export const mod = /*@__PURE__*/ nodeProxy( MathNode, MathNode.MOD );
|
|
|
760
766
|
* @param {Node | number} y - The x parameter.
|
|
761
767
|
* @returns {Node}
|
|
762
768
|
*/
|
|
763
|
-
export const step = /*@__PURE__*/ nodeProxy( MathNode, MathNode.STEP );
|
|
769
|
+
export const step = /*@__PURE__*/ nodeProxy( MathNode, MathNode.STEP ).setParameterLength( 2 );
|
|
764
770
|
|
|
765
771
|
/**
|
|
766
772
|
* Calculates the reflection direction for an incident vector.
|
|
@@ -771,7 +777,7 @@ export const step = /*@__PURE__*/ nodeProxy( MathNode, MathNode.STEP );
|
|
|
771
777
|
* @param {Node<vec2|vec3|vec4>} N - The normal vector.
|
|
772
778
|
* @returns {Node<vec2|vec3|vec4>}
|
|
773
779
|
*/
|
|
774
|
-
export const reflect = /*@__PURE__*/ nodeProxy( MathNode, MathNode.REFLECT );
|
|
780
|
+
export const reflect = /*@__PURE__*/ nodeProxy( MathNode, MathNode.REFLECT ).setParameterLength( 2 );
|
|
775
781
|
|
|
776
782
|
/**
|
|
777
783
|
* Calculates the distance between two points.
|
|
@@ -782,7 +788,7 @@ export const reflect = /*@__PURE__*/ nodeProxy( MathNode, MathNode.REFLECT );
|
|
|
782
788
|
* @param {Node<vec2|vec3|vec4>} y - The second point.
|
|
783
789
|
* @returns {Node<float>}
|
|
784
790
|
*/
|
|
785
|
-
export const distance = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DISTANCE );
|
|
791
|
+
export const distance = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DISTANCE ).setParameterLength( 2 );
|
|
786
792
|
|
|
787
793
|
/**
|
|
788
794
|
* Calculates the absolute difference between two values.
|
|
@@ -793,7 +799,7 @@ export const distance = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DISTANCE );
|
|
|
793
799
|
* @param {Node | number} y - The second parameter.
|
|
794
800
|
* @returns {Node}
|
|
795
801
|
*/
|
|
796
|
-
export const difference = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DIFFERENCE );
|
|
802
|
+
export const difference = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DIFFERENCE ).setParameterLength( 2 );
|
|
797
803
|
|
|
798
804
|
/**
|
|
799
805
|
* Calculates the dot product of two vectors.
|
|
@@ -804,7 +810,7 @@ export const difference = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DIFFERENCE
|
|
|
804
810
|
* @param {Node<vec2|vec3|vec4>} y - The second vector.
|
|
805
811
|
* @returns {Node<float>}
|
|
806
812
|
*/
|
|
807
|
-
export const dot = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DOT );
|
|
813
|
+
export const dot = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DOT ).setParameterLength( 2 );
|
|
808
814
|
|
|
809
815
|
/**
|
|
810
816
|
* Calculates the cross product of two vectors.
|
|
@@ -815,7 +821,7 @@ export const dot = /*@__PURE__*/ nodeProxy( MathNode, MathNode.DOT );
|
|
|
815
821
|
* @param {Node<vec2|vec3|vec4>} y - The second vector.
|
|
816
822
|
* @returns {Node<vec2|vec3|vec4>}
|
|
817
823
|
*/
|
|
818
|
-
export const cross = /*@__PURE__*/ nodeProxy( MathNode, MathNode.CROSS );
|
|
824
|
+
export const cross = /*@__PURE__*/ nodeProxy( MathNode, MathNode.CROSS ).setParameterLength( 2 );
|
|
819
825
|
|
|
820
826
|
/**
|
|
821
827
|
* Return the value of the first parameter raised to the power of the second one.
|
|
@@ -826,7 +832,7 @@ export const cross = /*@__PURE__*/ nodeProxy( MathNode, MathNode.CROSS );
|
|
|
826
832
|
* @param {Node | number} y - The second parameter.
|
|
827
833
|
* @returns {Node}
|
|
828
834
|
*/
|
|
829
|
-
export const pow = /*@__PURE__*/ nodeProxy( MathNode, MathNode.POW );
|
|
835
|
+
export const pow = /*@__PURE__*/ nodeProxy( MathNode, MathNode.POW ).setParameterLength( 2 );
|
|
830
836
|
|
|
831
837
|
/**
|
|
832
838
|
* Returns the square of the parameter.
|
|
@@ -836,7 +842,7 @@ export const pow = /*@__PURE__*/ nodeProxy( MathNode, MathNode.POW );
|
|
|
836
842
|
* @param {Node | number} x - The first parameter.
|
|
837
843
|
* @returns {Node}
|
|
838
844
|
*/
|
|
839
|
-
export const pow2 = /*@__PURE__*/ nodeProxy( MathNode, MathNode.POW, 2 );
|
|
845
|
+
export const pow2 = /*@__PURE__*/ nodeProxy( MathNode, MathNode.POW, 2 ).setParameterLength( 1 );
|
|
840
846
|
|
|
841
847
|
/**
|
|
842
848
|
* Returns the cube of the parameter.
|
|
@@ -846,7 +852,7 @@ export const pow2 = /*@__PURE__*/ nodeProxy( MathNode, MathNode.POW, 2 );
|
|
|
846
852
|
* @param {Node | number} x - The first parameter.
|
|
847
853
|
* @returns {Node}
|
|
848
854
|
*/
|
|
849
|
-
export const pow3 = /*@__PURE__*/ nodeProxy( MathNode, MathNode.POW, 3 );
|
|
855
|
+
export const pow3 = /*@__PURE__*/ nodeProxy( MathNode, MathNode.POW, 3 ).setParameterLength( 1 );
|
|
850
856
|
|
|
851
857
|
/**
|
|
852
858
|
* Returns the fourth power of the parameter.
|
|
@@ -856,7 +862,7 @@ export const pow3 = /*@__PURE__*/ nodeProxy( MathNode, MathNode.POW, 3 );
|
|
|
856
862
|
* @param {Node | number} x - The first parameter.
|
|
857
863
|
* @returns {Node}
|
|
858
864
|
*/
|
|
859
|
-
export const pow4 = /*@__PURE__*/ nodeProxy( MathNode, MathNode.POW, 4 );
|
|
865
|
+
export const pow4 = /*@__PURE__*/ nodeProxy( MathNode, MathNode.POW, 4 ).setParameterLength( 1 );
|
|
860
866
|
|
|
861
867
|
/**
|
|
862
868
|
* Transforms the direction of a vector by a matrix and then normalizes the result.
|
|
@@ -867,7 +873,7 @@ export const pow4 = /*@__PURE__*/ nodeProxy( MathNode, MathNode.POW, 4 );
|
|
|
867
873
|
* @param {Node<mat2|mat3|mat4>} matrix - The transformation matrix.
|
|
868
874
|
* @returns {Node}
|
|
869
875
|
*/
|
|
870
|
-
export const transformDirection = /*@__PURE__*/ nodeProxy( MathNode, MathNode.TRANSFORM_DIRECTION );
|
|
876
|
+
export const transformDirection = /*@__PURE__*/ nodeProxy( MathNode, MathNode.TRANSFORM_DIRECTION ).setParameterLength( 2 );
|
|
871
877
|
|
|
872
878
|
/**
|
|
873
879
|
* Returns the cube root of a number.
|
|
@@ -899,7 +905,7 @@ export const lengthSq = ( a ) => dot( a, a );
|
|
|
899
905
|
* @param {Node | number} t - The interpolation value.
|
|
900
906
|
* @returns {Node}
|
|
901
907
|
*/
|
|
902
|
-
export const mix = /*@__PURE__*/ nodeProxy( MathNode, MathNode.MIX );
|
|
908
|
+
export const mix = /*@__PURE__*/ nodeProxy( MathNode, MathNode.MIX ).setParameterLength( 3 );
|
|
903
909
|
|
|
904
910
|
/**
|
|
905
911
|
* Constrains a value to lie between two further values.
|
|
@@ -930,10 +936,10 @@ export const saturate = ( value ) => clamp( value );
|
|
|
930
936
|
* @function
|
|
931
937
|
* @param {Node<vec2|vec3|vec4>} I - The incident vector.
|
|
932
938
|
* @param {Node<vec2|vec3|vec4>} N - The normal vector.
|
|
933
|
-
* @param {Node<float>} eta - The
|
|
939
|
+
* @param {Node<float>} eta - The ratio of indices of refraction.
|
|
934
940
|
* @returns {Node<vec2|vec3|vec4>}
|
|
935
941
|
*/
|
|
936
|
-
export const refract = /*@__PURE__*/ nodeProxy( MathNode, MathNode.REFRACT );
|
|
942
|
+
export const refract = /*@__PURE__*/ nodeProxy( MathNode, MathNode.REFRACT ).setParameterLength( 3 );
|
|
937
943
|
|
|
938
944
|
/**
|
|
939
945
|
* Performs a Hermite interpolation between two values.
|
|
@@ -945,7 +951,7 @@ export const refract = /*@__PURE__*/ nodeProxy( MathNode, MathNode.REFRACT );
|
|
|
945
951
|
* @param {Node | number} x - The source value for interpolation.
|
|
946
952
|
* @returns {Node}
|
|
947
953
|
*/
|
|
948
|
-
export const smoothstep = /*@__PURE__*/ nodeProxy( MathNode, MathNode.SMOOTHSTEP );
|
|
954
|
+
export const smoothstep = /*@__PURE__*/ nodeProxy( MathNode, MathNode.SMOOTHSTEP ).setParameterLength( 3 );
|
|
949
955
|
|
|
950
956
|
/**
|
|
951
957
|
* Returns a vector pointing in the same direction as another.
|
|
@@ -957,7 +963,7 @@ export const smoothstep = /*@__PURE__*/ nodeProxy( MathNode, MathNode.SMOOTHSTEP
|
|
|
957
963
|
* @param {Node<vec2|vec3|vec4>} Nref - The reference vector.
|
|
958
964
|
* @returns {Node<vec2|vec3|vec4>}
|
|
959
965
|
*/
|
|
960
|
-
export const faceForward = /*@__PURE__*/ nodeProxy( MathNode, MathNode.FACEFORWARD );
|
|
966
|
+
export const faceForward = /*@__PURE__*/ nodeProxy( MathNode, MathNode.FACEFORWARD ).setParameterLength( 3 );
|
|
961
967
|
|
|
962
968
|
/**
|
|
963
969
|
* Returns a random value for the given uv.
|
|
@@ -1062,7 +1068,6 @@ addMethodChaining( 'fwidth', fwidth );
|
|
|
1062
1068
|
addMethodChaining( 'atan2', atan2 );
|
|
1063
1069
|
addMethodChaining( 'min', min );
|
|
1064
1070
|
addMethodChaining( 'max', max );
|
|
1065
|
-
addMethodChaining( 'mod', mod );
|
|
1066
1071
|
addMethodChaining( 'step', step );
|
|
1067
1072
|
addMethodChaining( 'reflect', reflect );
|
|
1068
1073
|
addMethodChaining( 'distance', distance );
|