@gnsx/three 0.184.20 → 0.185.3
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 +1261 -926
- package/build/three.core.js +1104 -829
- package/build/three.core.min.js +1 -1
- package/build/three.module.js +157 -97
- package/build/three.module.min.js +1 -1
- package/build/three.tsl.js +11 -4
- package/build/three.tsl.min.js +1 -1
- package/build/three.webgpu.js +7542 -3371
- package/build/three.webgpu.min.js +1 -1
- package/build/three.webgpu.nodes.js +7542 -3370
- package/build/three.webgpu.nodes.min.js +1 -1
- package/examples/jsm/Addons.js +3 -0
- package/examples/jsm/controls/ArcballControls.js +6 -2
- package/examples/jsm/controls/FirstPersonControls.js +79 -42
- package/examples/jsm/controls/TransformControls.js +68 -15
- package/examples/jsm/csm/CSMFrustum.js +31 -6
- package/examples/jsm/csm/CSMShadowNode.js +4 -1
- package/examples/jsm/effects/AsciiEffect.js +14 -1
- package/examples/jsm/exporters/DRACOExporter.js +27 -6
- package/examples/jsm/exporters/GLTFExporter.js +114 -12
- package/examples/jsm/exporters/PLYExporter.js +286 -73
- package/examples/jsm/exporters/USDZExporter.js +347 -112
- package/examples/jsm/generators/CityGenerator.js +346 -0
- package/examples/jsm/generators/ForestGenerator.js +347 -0
- package/examples/jsm/generators/TerrainGenerator.js +504 -0
- package/examples/jsm/generators/TreeGenerator.js +377 -0
- package/examples/jsm/generators/city/SidewalkGenerator.js +253 -0
- package/examples/jsm/generators/city/SkyscraperGenerator.js +1357 -0
- package/examples/jsm/geometries/LoftGeometry.js +355 -0
- package/examples/jsm/helpers/LightProbeGridHelper.js +1 -1
- package/examples/jsm/helpers/LightProbeHelper.js +5 -4
- package/examples/jsm/helpers/ViewHelper.js +16 -6
- package/examples/jsm/inspector/Inspector.js +67 -58
- package/examples/jsm/inspector/RendererInspector.js +152 -36
- package/examples/jsm/inspector/extensions/tsl-graph/TSLGraphEditor.js +1 -1
- package/examples/jsm/inspector/extensions/tsl-graph/TSLGraphLoader.js +1 -1
- package/examples/jsm/inspector/tabs/Console.js +200 -18
- package/examples/jsm/inspector/tabs/Memory.js +8 -0
- package/examples/jsm/inspector/tabs/Parameters.js +64 -4
- package/examples/jsm/inspector/tabs/Performance.js +21 -6
- package/examples/jsm/inspector/tabs/Settings.js +51 -9
- package/examples/jsm/inspector/tabs/Timeline.js +178 -93
- package/examples/jsm/inspector/tabs/Viewer.js +628 -16
- package/examples/jsm/inspector/ui/Graph.js +162 -25
- package/examples/jsm/inspector/ui/Item.js +92 -13
- package/examples/jsm/inspector/ui/List.js +1 -1
- package/examples/jsm/inspector/ui/Profiler.js +90 -45
- package/examples/jsm/inspector/ui/Style.js +1788 -1401
- package/examples/jsm/inspector/ui/Tab.js +5 -3
- package/examples/jsm/inspector/ui/Values.js +71 -6
- package/examples/jsm/inspector/ui/utils.js +130 -10
- package/examples/jsm/libs/basis/README.md +0 -1
- package/examples/jsm/libs/demuxer_mp4.js +3 -3
- package/examples/jsm/libs/draco/README.md +0 -1
- package/examples/jsm/libs/meshopt_clusterizer.module.js +421 -0
- package/examples/jsm/libs/meshopt_simplifier.module.js +627 -0
- package/examples/jsm/libs/mikktspace.module.js +34 -9
- package/examples/jsm/lighting/ClusteredLighting.js +55 -0
- package/examples/jsm/lighting/LightProbeGrid.js +124 -91
- package/examples/jsm/lines/LineMaterial.js +38 -15
- package/examples/jsm/lines/LineSegments2.js +8 -0
- package/examples/jsm/lines/webgpu/LineSegments2.js +8 -0
- package/examples/jsm/loaders/3DMLoader.js +1 -1
- package/examples/jsm/loaders/DRACOLoader.js +46 -13
- package/examples/jsm/loaders/EXRLoader.js +27 -55
- package/examples/jsm/loaders/HDRLoader.js +6 -28
- package/examples/jsm/loaders/KTX2Loader.js +31 -12
- package/examples/jsm/loaders/LDrawLoader.js +8 -8
- package/examples/jsm/loaders/LUT3dlLoader.js +2 -2
- package/examples/jsm/loaders/LUTCubeLoader.js +2 -2
- package/examples/jsm/loaders/LWOLoader.js +4 -0
- package/examples/jsm/loaders/LottieLoader.js +1 -1
- package/examples/jsm/loaders/MaterialXLoader.js +31 -9
- package/examples/jsm/loaders/NRRDLoader.js +3 -3
- package/examples/jsm/loaders/PCDLoader.js +7 -7
- package/examples/jsm/loaders/PLYLoader.js +218 -55
- package/examples/jsm/loaders/SVGLoader.js +547 -495
- package/examples/jsm/loaders/TTFLoader.js +1 -1
- package/examples/jsm/loaders/USDLoader.js +33 -9
- package/examples/jsm/loaders/VRMLLoader.js +1 -1
- package/examples/jsm/loaders/usd/USDAParser.js +93 -20
- package/examples/jsm/loaders/usd/USDCParser.js +1 -1
- package/examples/jsm/loaders/usd/USDComposer.js +52 -19
- package/examples/jsm/misc/TileCreasedNormalsPlugin.js +270 -0
- package/examples/jsm/misc/Volume.js +2 -2
- package/examples/jsm/objects/GroundedSkybox.js +1 -1
- package/examples/jsm/objects/Reflector.js +2 -3
- package/examples/jsm/objects/Water2Mesh.js +1 -1
- package/examples/jsm/physics/AmmoPhysics.js +15 -8
- package/examples/jsm/physics/RapierPhysics.js +27 -2
- package/examples/jsm/shaders/VolumeShader.js +31 -44
- package/examples/jsm/transpiler/GLSLDecoder.js +6 -6
- package/examples/jsm/transpiler/Linker.js +1 -1
- package/examples/jsm/tsl/display/BloomNode.js +59 -19
- package/examples/jsm/tsl/display/DepthOfFieldNode.js +2 -2
- package/examples/jsm/tsl/display/FXAANode.js +11 -12
- package/examples/jsm/tsl/display/GTAONode.js +34 -13
- package/examples/jsm/tsl/display/GodraysNode.js +1 -1
- package/examples/jsm/tsl/display/ImportanceSampledEnvironment.js +560 -0
- package/examples/jsm/tsl/display/PixelationPassNode.js +2 -2
- package/examples/jsm/tsl/display/RecurrentDenoiseNode.js +912 -0
- package/examples/jsm/tsl/display/SSAAPassNode.js +13 -25
- package/examples/jsm/tsl/display/SSGINode.js +89 -39
- package/examples/jsm/tsl/display/SSRNode.js +829 -132
- package/examples/jsm/tsl/display/SSSNode.js +2 -2
- package/examples/jsm/tsl/display/TemporalReprojectNode.js +1023 -0
- package/examples/jsm/tsl/lighting/ClusteredLightsNode.js +622 -0
- package/examples/jsm/tsl/lighting/DynamicLightsNode.js +1 -1
- package/examples/jsm/tsl/math/curlNoise.js +107 -0
- package/examples/jsm/tsl/shadows/TileShadowNode.js +1 -1
- package/examples/jsm/tsl/shadows/TileShadowNodeHelper.js +3 -3
- package/examples/jsm/tsl/utils/GroundedSkybox.js +62 -0
- package/examples/jsm/tsl/utils/RNoise.js +51 -0
- package/examples/jsm/tsl/utils/SpecularHelpers.js +325 -0
- package/examples/jsm/utils/BufferGeometryUtils.js +126 -59
- package/examples/jsm/utils/GeometryCompressionUtils.js +1 -1
- package/examples/jsm/utils/SceneOptimizer.js +1 -1
- package/examples/jsm/webxr/ARButton.js +1 -1
- package/examples/jsm/webxr/WebGLXRFallback.js +89 -0
- package/examples/jsm/webxr/XRControllerModelFactory.js +2 -2
- package/package.json +7 -7
- package/src/Three.TSL.js +10 -3
- package/src/Three.WebGPU.js +4 -0
- package/src/animation/AnimationAction.js +15 -11
- package/src/animation/AnimationClip.js +0 -139
- package/src/animation/KeyframeTrack.js +2 -2
- package/src/animation/PropertyBinding.js +2 -2
- package/src/cameras/Camera.js +2 -2
- package/src/cameras/StereoCamera.js +5 -2
- package/src/constants.js +1 -1
- package/src/core/BufferGeometry.js +29 -7
- package/src/core/Object3D.js +17 -7
- package/src/core/Raycaster.js +1 -1
- package/src/core/RenderTarget.js +15 -2
- package/src/extras/PMREMGenerator.js +6 -4
- package/src/extras/TextureUtils.js +1 -1
- package/src/extras/core/ShapePath.js +149 -160
- package/src/geometries/SphereGeometry.js +8 -3
- package/src/helpers/DirectionalLightHelper.js +2 -0
- package/src/helpers/HemisphereLightHelper.js +2 -0
- package/src/helpers/PointLightHelper.js +2 -0
- package/src/helpers/SpotLightHelper.js +1 -1
- package/src/loaders/DataTextureLoader.js +69 -38
- package/src/loaders/LoadingManager.js +5 -0
- package/src/loaders/MaterialLoader.js +36 -266
- package/src/loaders/ObjectLoader.js +3 -1
- package/src/materials/LineBasicMaterial.js +4 -0
- package/src/materials/Material.js +196 -1
- package/src/materials/MeshBasicMaterial.js +24 -0
- package/src/materials/MeshDepthMaterial.js +10 -0
- package/src/materials/MeshDistanceMaterial.js +10 -0
- package/src/materials/MeshLambertMaterial.js +40 -1
- package/src/materials/MeshMatcapMaterial.js +25 -1
- package/src/materials/MeshNormalMaterial.js +9 -1
- package/src/materials/MeshPhongMaterial.js +40 -1
- package/src/materials/MeshPhysicalMaterial.js +38 -0
- package/src/materials/MeshStandardMaterial.js +42 -1
- package/src/materials/MeshToonMaterial.js +34 -1
- package/src/materials/PointsMaterial.js +7 -0
- package/src/materials/ShaderMaterial.js +86 -0
- package/src/materials/SpriteMaterial.js +7 -0
- package/src/materials/nodes/Line2NodeMaterial.js +378 -322
- package/src/materials/nodes/MeshBasicNodeMaterial.js +2 -2
- package/src/materials/nodes/MeshNormalNodeMaterial.js +2 -2
- package/src/materials/nodes/MeshPhongNodeMaterial.js +0 -9
- package/src/materials/nodes/MeshPhysicalNodeMaterial.js +0 -30
- package/src/materials/nodes/MeshSSSNodeMaterial.js +0 -13
- package/src/materials/nodes/MeshStandardNodeMaterial.js +0 -11
- package/src/materials/nodes/NodeMaterial.js +115 -74
- package/src/materials/nodes/SpriteNodeMaterial.js +0 -10
- package/src/materials/nodes/manager/NodeMaterialObserver.js +49 -20
- package/src/math/Box3.js +5 -0
- package/src/math/FrustumArray.js +103 -133
- package/src/math/Interpolant.js +1 -1
- package/src/math/MathUtils.js +2 -2
- package/src/math/Matrix3.js +11 -0
- package/src/math/Matrix4.js +28 -3
- package/src/math/Vector2.js +2 -2
- package/src/math/Vector3.js +2 -2
- package/src/math/Vector4.js +2 -2
- package/src/math/interpolants/BezierInterpolant.js +4 -6
- package/src/nodes/Nodes.js +2 -5
- package/src/nodes/TSL.js +8 -6
- package/src/nodes/accessors/Arrays.js +4 -4
- package/src/nodes/accessors/Batch.js +108 -0
- package/src/nodes/accessors/Bitangent.js +2 -2
- package/src/nodes/accessors/BufferAttributeNode.js +13 -2
- package/src/nodes/accessors/Camera.js +7 -7
- package/src/nodes/accessors/ClippingNode.js +1 -1
- package/src/nodes/accessors/Instance.js +264 -0
- package/src/nodes/accessors/MaterialNode.js +18 -2
- package/src/nodes/accessors/MaterialProperties.js +4 -3
- package/src/nodes/accessors/{MorphNode.js → Morph.js} +99 -112
- package/src/nodes/accessors/Normal.js +13 -13
- package/src/nodes/accessors/Position.js +5 -1
- package/src/nodes/accessors/ReferenceNode.js +1 -0
- package/src/nodes/accessors/ReflectVector.js +3 -3
- package/src/nodes/accessors/SceneProperties.js +1 -1
- package/src/nodes/accessors/Skinning.js +263 -0
- package/src/nodes/accessors/StorageBufferNode.js +2 -2
- package/src/nodes/accessors/StorageTexture3DNode.js +100 -0
- package/src/nodes/accessors/StorageTextureNode.js +39 -7
- package/src/nodes/accessors/Tangent.js +4 -4
- package/src/nodes/accessors/TextureNode.js +60 -5
- package/src/nodes/code/FunctionNode.js +2 -16
- package/src/nodes/core/MRTNode.js +7 -2
- package/src/nodes/core/Node.js +39 -2
- package/src/nodes/core/NodeBuilder.js +201 -41
- package/src/nodes/core/NodeUtils.js +13 -13
- package/src/nodes/core/OutputStructNode.js +1 -1
- package/src/nodes/core/OverrideContextNode.js +153 -0
- package/src/nodes/core/PropertyNode.js +51 -5
- package/src/nodes/core/StackNode.js +56 -34
- package/src/nodes/core/StructNode.js +4 -6
- package/src/nodes/core/StructTypeNode.js +6 -6
- package/src/nodes/core/VarNode.js +8 -0
- package/src/nodes/core/VaryingNode.js +12 -2
- package/src/nodes/display/BlendModes.js +1 -41
- package/src/nodes/display/BumpMapNode.js +6 -1
- package/src/nodes/display/ColorAdjustment.js +10 -9
- package/src/nodes/display/FrontFacingNode.js +38 -9
- package/src/nodes/display/NormalMapNode.js +2 -2
- package/src/nodes/display/PassNode.js +35 -43
- package/src/nodes/display/PremultiplyAlphaFunctions.js +39 -0
- package/src/nodes/display/RenderOutputNode.js +12 -3
- package/src/nodes/functions/VolumetricLightingModel.js +40 -7
- package/src/nodes/gpgpu/WorkgroupInfoNode.js +1 -1
- package/src/nodes/lighting/EnvironmentNode.js +2 -2
- package/src/nodes/lighting/IESSpotLightNode.js +40 -2
- package/src/nodes/lighting/LightingContextNode.js +10 -2
- package/src/nodes/lighting/LightsNode.js +92 -37
- package/src/nodes/lighting/PointShadowNode.js +7 -1
- package/src/nodes/lighting/ShadowFilterNode.js +21 -52
- package/src/nodes/lighting/ShadowNode.js +34 -14
- package/src/nodes/materialx/lib/mx_noise.js +2 -2
- package/src/nodes/math/ConditionalNode.js +3 -3
- package/src/nodes/math/MathNode.js +39 -11
- package/src/nodes/math/OperatorNode.js +23 -23
- package/src/nodes/parsers/GLSLNodeFunction.js +1 -1
- package/src/nodes/pmrem/PMREMNode.js +33 -2
- package/src/nodes/tsl/TSLCore.js +63 -18
- package/src/nodes/utils/EquirectUV.js +30 -5
- package/src/nodes/utils/FunctionOverloadingNode.js +1 -1
- package/src/nodes/utils/Packing.js +35 -4
- package/src/nodes/utils/RTTNode.js +40 -24
- package/src/nodes/utils/ReflectorNode.js +1 -0
- package/src/nodes/utils/StorageArrayElementNode.js +1 -1
- package/src/objects/BatchedMesh.js +22 -14
- package/src/objects/InstancedMesh.js +0 -11
- package/src/objects/Skeleton.js +0 -9
- package/src/renderers/WebGLRenderer.js +21 -15
- package/src/renderers/common/Backend.js +49 -5
- package/src/renderers/common/Bindings.js +114 -45
- package/src/renderers/common/Buffer.js +9 -0
- package/src/renderers/common/ClippingContext.js +10 -2
- package/src/renderers/common/Info.js +63 -22
- package/src/renderers/common/Lighting.js +53 -5
- package/src/renderers/common/RenderList.js +42 -4
- package/src/renderers/common/RenderObject.js +73 -13
- package/src/renderers/common/Renderer.js +282 -109
- package/src/renderers/common/Sampler.js +16 -48
- package/src/renderers/common/Textures.js +32 -5
- package/src/renderers/common/TimestampQueryPool.js +1 -1
- package/src/renderers/common/UniformsGroup.js +31 -9
- package/src/renderers/common/XRManager.js +340 -22
- package/src/renderers/common/extras/PMREMGenerator.js +15 -38
- package/src/renderers/common/nodes/NodeBuilderState.js +9 -1
- package/src/renderers/common/nodes/NodeLibrary.js +4 -4
- package/src/renderers/common/nodes/NodeManager.js +63 -14
- package/src/renderers/common/nodes/NodeUniformBuffer.js +13 -0
- package/src/renderers/shaders/ShaderChunk/common.glsl.js +13 -4
- package/src/renderers/shaders/ShaderChunk/defaultnormal_vertex.glsl.js +0 -6
- package/src/renderers/shaders/ShaderChunk/envmap_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/envmap_physical_pars_fragment.glsl.js +2 -2
- package/src/renderers/shaders/ShaderChunk/envmap_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/lights_fragment_begin.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/lights_pars_begin.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/normal_fragment_begin.glsl.js +2 -2
- package/src/renderers/shaders/ShaderChunk/normal_vertex.glsl.js +6 -0
- package/src/renderers/shaders/ShaderChunk/shadowmap_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/transmission_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderLib/distance.glsl.js +1 -1
- package/src/renderers/webgl/WebGLOutput.js +2 -1
- package/src/renderers/webgl/WebGLProgram.js +5 -4
- package/src/renderers/webgl/WebGLPrograms.js +11 -4
- package/src/renderers/webgl/WebGLRenderLists.js +9 -1
- package/src/renderers/webgl/WebGLShaderCache.js +5 -11
- package/src/renderers/webgl/WebGLTextures.js +20 -7
- package/src/renderers/webgl/WebGLUniformsGroups.js +66 -38
- package/src/renderers/webgl-fallback/WebGLBackend.js +84 -25
- package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +138 -8
- package/src/renderers/webgl-fallback/utils/WebGLAttributeUtils.js +1 -1
- package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +52 -22
- package/src/renderers/webgl-fallback/utils/WebGLUtils.js +4 -2
- package/src/renderers/webgpu/WebGPUBackend.js +480 -169
- package/src/renderers/webgpu/descriptors/GPUBindGroupDescriptor.js +48 -0
- package/src/renderers/webgpu/descriptors/GPUBufferDescriptor.js +57 -0
- package/src/renderers/webgpu/descriptors/GPUCommandEncoderDescriptor.js +30 -0
- package/src/renderers/webgpu/descriptors/GPUComputePassDescriptor.js +38 -0
- package/src/renderers/webgpu/descriptors/GPUComputePipelineDescriptor.js +48 -0
- package/src/renderers/webgpu/descriptors/GPUCopyExternalImageDestInfo.js +47 -0
- package/src/renderers/webgpu/descriptors/GPUCopyExternalImageSourceInfo.js +50 -0
- package/src/renderers/webgpu/descriptors/GPUExtent3D.js +51 -0
- package/src/renderers/webgpu/descriptors/GPUPipelineLayoutDescriptor.js +39 -0
- package/src/renderers/webgpu/descriptors/GPUQuerySetDescriptor.js +47 -0
- package/src/renderers/webgpu/descriptors/GPURenderBundleEncoderDescriptor.js +74 -0
- package/src/renderers/webgpu/descriptors/GPURenderPassColorAttachment.js +72 -0
- package/src/renderers/webgpu/descriptors/GPURenderPassDepthStencilAttachment.js +99 -0
- package/src/renderers/webgpu/descriptors/GPURenderPassDescriptor.js +72 -0
- package/src/renderers/webgpu/descriptors/GPURenderPassTimestampWrites.js +49 -0
- package/src/renderers/webgpu/descriptors/GPURenderPipelineDescriptor.js +130 -0
- package/src/renderers/webgpu/descriptors/GPUSamplerDescriptor.js +119 -0
- package/src/renderers/webgpu/descriptors/GPUShaderModuleDescriptor.js +46 -0
- package/src/renderers/webgpu/descriptors/GPUTexelCopyBufferInfo.js +57 -0
- package/src/renderers/webgpu/descriptors/GPUTexelCopyBufferLayout.js +48 -0
- package/src/renderers/webgpu/descriptors/GPUTexelCopyTextureInfo.js +61 -0
- package/src/renderers/webgpu/descriptors/GPUTextureDescriptor.js +99 -0
- package/src/renderers/webgpu/descriptors/GPUTextureViewDescriptor.js +108 -0
- package/src/renderers/webgpu/nodes/StandardNodeLibrary.js +0 -1
- package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +164 -7
- package/src/renderers/webgpu/nodes/WGSLNodeFunction.js +1 -1
- package/src/renderers/webgpu/utils/WebGPUAttributeUtils.js +98 -38
- package/src/renderers/webgpu/utils/WebGPUBindingUtils.js +72 -68
- package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +164 -69
- package/src/renderers/webgpu/utils/WebGPUTexturePassUtils.js +158 -95
- package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +297 -141
- package/src/renderers/webgpu/utils/WebGPUTimestampQueryPool.js +33 -18
- package/src/renderers/webgpu/utils/WebGPUUtils.js +38 -3
- package/src/textures/DepthTexture.js +1 -1
- package/src/textures/ExternalTexture.js +0 -3
- package/examples/fonts/LICENSE +0 -13
- package/examples/fonts/MPLUSRounded1c/MPLUSRounded1c-Regular.typeface.json.zip +0 -0
- package/examples/fonts/MPLUSRounded1c/OFL.txt +0 -91
- package/examples/fonts/README.md +0 -11
- package/examples/fonts/droid/NOTICE +0 -190
- package/examples/fonts/droid/README.txt +0 -18
- package/examples/fonts/droid/droid_sans_bold.typeface.json +0 -1
- package/examples/fonts/droid/droid_sans_mono_regular.typeface.json +0 -1
- package/examples/fonts/droid/droid_sans_regular.typeface.json +0 -1
- package/examples/fonts/droid/droid_serif_bold.typeface.json +0 -1
- package/examples/fonts/droid/droid_serif_regular.typeface.json +0 -1
- package/examples/fonts/gentilis_bold.typeface.json +0 -1
- package/examples/fonts/gentilis_regular.typeface.json +0 -1
- package/examples/fonts/helvetiker_bold.typeface.json +0 -1
- package/examples/fonts/helvetiker_regular.typeface.json +0 -1
- package/examples/fonts/optimer_bold.typeface.json +0 -1
- package/examples/fonts/optimer_regular.typeface.json +0 -1
- package/examples/fonts/ttf/README.md +0 -9
- package/examples/fonts/ttf/kenpixel.ttf +0 -0
- package/examples/jsm/inspector/extensions/extensions.json +0 -6
- package/examples/jsm/libs/ammo.wasm.js +0 -822
- package/examples/jsm/libs/ammo.wasm.wasm +0 -0
- package/examples/jsm/libs/draco/draco_encoder.js +0 -33
- package/examples/jsm/libs/draco/gltf/draco_encoder.js +0 -33
- package/examples/jsm/libs/lottie_canvas.module.js +0 -14849
- package/examples/jsm/libs/opentype.module.js +0 -14506
- package/examples/jsm/libs/rhino3dm/rhino3dm.js +0 -21
- package/examples/jsm/libs/rhino3dm/rhino3dm.module.js +0 -16
- package/examples/jsm/libs/rhino3dm/rhino3dm.wasm +0 -0
- package/examples/jsm/lighting/TiledLighting.js +0 -42
- package/examples/jsm/tsl/display/AnamorphicNode.js +0 -293
- package/examples/jsm/tsl/lighting/TiledLightsNode.js +0 -442
- package/src/nodes/accessors/BatchNode.js +0 -163
- package/src/nodes/accessors/InstanceNode.js +0 -349
- package/src/nodes/accessors/InstancedMeshNode.js +0 -50
- package/src/nodes/accessors/SkinningNode.js +0 -328
|
@@ -39,13 +39,13 @@ function computeMikkTSpaceTangents( geometry, MikkTSpace, negateSign = true ) {
|
|
|
39
39
|
|
|
40
40
|
if ( ! MikkTSpace || ! MikkTSpace.isReady ) {
|
|
41
41
|
|
|
42
|
-
throw new Error( 'BufferGeometryUtils: Initialized MikkTSpace library required.' );
|
|
42
|
+
throw new Error( 'THREE.BufferGeometryUtils: Initialized MikkTSpace library required.' );
|
|
43
43
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
if ( ! geometry.hasAttribute( 'position' ) || ! geometry.hasAttribute( 'normal' ) || ! geometry.hasAttribute( 'uv' ) ) {
|
|
47
47
|
|
|
48
|
-
throw new Error( 'BufferGeometryUtils: Tangents require "position", "normal", and "uv" attributes.' );
|
|
48
|
+
throw new Error( 'THREE.BufferGeometryUtils: Tangents require "position", "normal", and "uv" attributes.' );
|
|
49
49
|
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -1314,105 +1314,172 @@ function mergeGroups( geometry ) {
|
|
|
1314
1314
|
*/
|
|
1315
1315
|
function toCreasedNormals( geometry, creaseAngle = Math.PI / 3 /* 60 degrees */ ) {
|
|
1316
1316
|
|
|
1317
|
+
// BufferGeometry.toNonIndexed() warns if the geometry is non-indexed
|
|
1318
|
+
// and returns the original geometry
|
|
1319
|
+
const resultGeometry = geometry.index ? geometry.toNonIndexed() : geometry;
|
|
1320
|
+
const posAttr = resultGeometry.attributes.position;
|
|
1321
|
+
const vertexCount = posAttr.count;
|
|
1322
|
+
|
|
1323
|
+
let positions;
|
|
1324
|
+
|
|
1325
|
+
if ( posAttr.isBufferAttribute === true && posAttr.itemSize === 3 && posAttr.normalized === false ) {
|
|
1326
|
+
|
|
1327
|
+
positions = posAttr.array;
|
|
1328
|
+
|
|
1329
|
+
} else {
|
|
1330
|
+
|
|
1331
|
+
// flatten the position buffer so the math below operates on plain numbers
|
|
1332
|
+
positions = new Float64Array( vertexCount * 3 );
|
|
1333
|
+
|
|
1334
|
+
for ( let i = 0; i < vertexCount; i ++ ) {
|
|
1335
|
+
|
|
1336
|
+
positions[ 3 * i + 0 ] = posAttr.getX( i );
|
|
1337
|
+
positions[ 3 * i + 1 ] = posAttr.getY( i );
|
|
1338
|
+
positions[ 3 * i + 2 ] = posAttr.getZ( i );
|
|
1339
|
+
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1317
1344
|
const creaseDot = Math.cos( creaseAngle );
|
|
1318
1345
|
const hashMultiplier = ( 1 + 1e-10 ) * 1e2;
|
|
1346
|
+
const faceCount = vertexCount / 3;
|
|
1347
|
+
|
|
1348
|
+
// compute the normal of each face
|
|
1349
|
+
const faceNormals = new Float64Array( faceCount * 3 );
|
|
1350
|
+
for ( let f = 0; f < faceCount; f ++ ) {
|
|
1351
|
+
|
|
1352
|
+
const f9 = 9 * f;
|
|
1353
|
+
const ax = positions[ f9 + 0 ], ay = positions[ f9 + 1 ], az = positions[ f9 + 2 ];
|
|
1354
|
+
const bx = positions[ f9 + 3 ], by = positions[ f9 + 4 ], bz = positions[ f9 + 5 ];
|
|
1355
|
+
const cx = positions[ f9 + 6 ], cy = positions[ f9 + 7 ], cz = positions[ f9 + 8 ];
|
|
1319
1356
|
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
const tempVec1 = new Vector3();
|
|
1323
|
-
const tempVec2 = new Vector3();
|
|
1324
|
-
const tempNorm = new Vector3();
|
|
1325
|
-
const tempNorm2 = new Vector3();
|
|
1357
|
+
const v1x = cx - bx, v1y = cy - by, v1z = cz - bz;
|
|
1358
|
+
const v2x = ax - bx, v2y = ay - by, v2z = az - bz;
|
|
1326
1359
|
|
|
1327
|
-
|
|
1328
|
-
|
|
1360
|
+
const nx = v1y * v2z - v1z * v2y;
|
|
1361
|
+
const ny = v1z * v2x - v1x * v2z;
|
|
1362
|
+
const nz = v1x * v2y - v1y * v2x;
|
|
1329
1363
|
|
|
1330
|
-
const
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1364
|
+
const invLength = 1 / ( Math.sqrt( nx * nx + ny * ny + nz * nz ) || 1 );
|
|
1365
|
+
faceNormals[ 3 * f + 0 ] = nx * invLength;
|
|
1366
|
+
faceNormals[ 3 * f + 1 ] = ny * invLength;
|
|
1367
|
+
faceNormals[ 3 * f + 2 ] = nz * invLength;
|
|
1334
1368
|
|
|
1335
1369
|
}
|
|
1336
1370
|
|
|
1337
|
-
//
|
|
1338
|
-
//
|
|
1339
|
-
const
|
|
1340
|
-
const
|
|
1341
|
-
const vertexMap = {};
|
|
1371
|
+
// assign an id to each vertex, sharing the id between vertices with the same
|
|
1372
|
+
// quantized position via an open-addressed hash table (slots hold id + 1, 0 means empty)
|
|
1373
|
+
const vertexIds = new Int32Array( vertexCount );
|
|
1374
|
+
const quantized = new Int32Array( vertexCount * 3 );
|
|
1342
1375
|
|
|
1343
|
-
|
|
1344
|
-
|
|
1376
|
+
let tableSize = 1;
|
|
1377
|
+
while ( tableSize < vertexCount * 2 ) tableSize <<= 1;
|
|
1378
|
+
const tableMask = tableSize - 1;
|
|
1379
|
+
const table = new Int32Array( tableSize );
|
|
1380
|
+
|
|
1381
|
+
let uniqueCount = 0;
|
|
1382
|
+
for ( let i = 0; i < vertexCount; i ++ ) {
|
|
1345
1383
|
|
|
1346
1384
|
const i3 = 3 * i;
|
|
1347
|
-
const
|
|
1348
|
-
const
|
|
1349
|
-
const
|
|
1385
|
+
const qx = ~ ~ ( positions[ i3 + 0 ] * hashMultiplier );
|
|
1386
|
+
const qy = ~ ~ ( positions[ i3 + 1 ] * hashMultiplier );
|
|
1387
|
+
const qz = ~ ~ ( positions[ i3 + 2 ] * hashMultiplier );
|
|
1350
1388
|
|
|
1351
|
-
|
|
1352
|
-
tempVec2.subVectors( a, b );
|
|
1389
|
+
let slot = ( Math.imul( qx, 73856093 ) ^ Math.imul( qy, 19349663 ) ^ Math.imul( qz, 83492791 ) ) & tableMask;
|
|
1353
1390
|
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1391
|
+
while ( true ) {
|
|
1392
|
+
|
|
1393
|
+
const id = table[ slot ];
|
|
1394
|
+
|
|
1395
|
+
if ( id === 0 ) {
|
|
1396
|
+
|
|
1397
|
+
const q3 = 3 * uniqueCount;
|
|
1398
|
+
quantized[ q3 + 0 ] = qx;
|
|
1399
|
+
quantized[ q3 + 1 ] = qy;
|
|
1400
|
+
quantized[ q3 + 2 ] = qz;
|
|
1401
|
+
|
|
1402
|
+
table[ slot ] = uniqueCount + 1;
|
|
1403
|
+
vertexIds[ i ] = uniqueCount ++;
|
|
1404
|
+
break;
|
|
1405
|
+
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
const q3 = 3 * ( id - 1 );
|
|
1357
1409
|
|
|
1358
|
-
|
|
1359
|
-
const hash = hashVertex( vert );
|
|
1360
|
-
if ( ! ( hash in vertexMap ) ) {
|
|
1410
|
+
if ( quantized[ q3 + 0 ] === qx && quantized[ q3 + 1 ] === qy && quantized[ q3 + 2 ] === qz ) {
|
|
1361
1411
|
|
|
1362
|
-
|
|
1412
|
+
vertexIds[ i ] = id - 1;
|
|
1413
|
+
break;
|
|
1363
1414
|
|
|
1364
1415
|
}
|
|
1365
1416
|
|
|
1366
|
-
|
|
1417
|
+
slot = ( slot + 1 ) & tableMask;
|
|
1367
1418
|
|
|
1368
1419
|
}
|
|
1369
1420
|
|
|
1370
1421
|
}
|
|
1371
1422
|
|
|
1372
|
-
//
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
for ( let i = 0, l = posAttr.count / 3; i < l; i ++ ) {
|
|
1423
|
+
// bucket the faces surrounding each unique vertex position
|
|
1424
|
+
const bucketOffsets = new Int32Array( uniqueCount + 1 );
|
|
1425
|
+
for ( let i = 0; i < vertexCount; i ++ ) bucketOffsets[ vertexIds[ i ] + 1 ] ++;
|
|
1426
|
+
for ( let i = 0; i < uniqueCount; i ++ ) bucketOffsets[ i + 1 ] += bucketOffsets[ i ];
|
|
1377
1427
|
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
const
|
|
1428
|
+
const bucketFaces = new Int32Array( vertexCount );
|
|
1429
|
+
const bucketCursors = bucketOffsets.slice( 0, uniqueCount );
|
|
1430
|
+
for ( let f = 0; f < faceCount; f ++ ) {
|
|
1431
|
+
|
|
1432
|
+
const f3 = 3 * f;
|
|
1433
|
+
bucketFaces[ bucketCursors[ vertexIds[ f3 + 0 ] ] ++ ] = f;
|
|
1434
|
+
bucketFaces[ bucketCursors[ vertexIds[ f3 + 1 ] ] ++ ] = f;
|
|
1435
|
+
bucketFaces[ bucketCursors[ vertexIds[ f3 + 2 ] ] ++ ] = f;
|
|
1383
1436
|
|
|
1384
|
-
|
|
1385
|
-
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
// average the normals of the faces surrounding each vertex if they are within the
|
|
1440
|
+
// provided crease threshold
|
|
1441
|
+
const normalArray = new Float32Array( vertexCount * 3 );
|
|
1442
|
+
for ( let f = 0; f < faceCount; f ++ ) {
|
|
1386
1443
|
|
|
1387
|
-
|
|
1444
|
+
const f3 = 3 * f;
|
|
1445
|
+
const nx = faceNormals[ f3 + 0 ];
|
|
1446
|
+
const ny = faceNormals[ f3 + 1 ];
|
|
1447
|
+
const nz = faceNormals[ f3 + 2 ];
|
|
1388
1448
|
|
|
1389
|
-
// average all normals that meet the threshold and set the normal value
|
|
1390
1449
|
for ( let n = 0; n < 3; n ++ ) {
|
|
1391
1450
|
|
|
1392
|
-
const
|
|
1393
|
-
const
|
|
1394
|
-
|
|
1395
|
-
|
|
1451
|
+
const i = f3 + n;
|
|
1452
|
+
const id = vertexIds[ i ];
|
|
1453
|
+
|
|
1454
|
+
let sumX = 0, sumY = 0, sumZ = 0;
|
|
1455
|
+
|
|
1456
|
+
for ( let k = bucketOffsets[ id ], end = bucketOffsets[ id + 1 ]; k < end; k ++ ) {
|
|
1396
1457
|
|
|
1397
|
-
|
|
1458
|
+
const o3 = 3 * bucketFaces[ k ];
|
|
1459
|
+
const ox = faceNormals[ o3 + 0 ];
|
|
1460
|
+
const oy = faceNormals[ o3 + 1 ];
|
|
1461
|
+
const oz = faceNormals[ o3 + 2 ];
|
|
1398
1462
|
|
|
1399
|
-
|
|
1400
|
-
if ( tempNorm.dot( otherNorm ) > creaseDot ) {
|
|
1463
|
+
if ( nx * ox + ny * oy + nz * oz > creaseDot ) {
|
|
1401
1464
|
|
|
1402
|
-
|
|
1465
|
+
sumX += ox;
|
|
1466
|
+
sumY += oy;
|
|
1467
|
+
sumZ += oz;
|
|
1403
1468
|
|
|
1404
1469
|
}
|
|
1405
1470
|
|
|
1406
1471
|
}
|
|
1407
1472
|
|
|
1408
|
-
|
|
1409
|
-
|
|
1473
|
+
const invLength = 1 / ( Math.sqrt( sumX * sumX + sumY * sumY + sumZ * sumZ ) || 1 );
|
|
1474
|
+
normalArray[ 3 * i + 0 ] = sumX * invLength;
|
|
1475
|
+
normalArray[ 3 * i + 1 ] = sumY * invLength;
|
|
1476
|
+
normalArray[ 3 * i + 2 ] = sumZ * invLength;
|
|
1410
1477
|
|
|
1411
1478
|
}
|
|
1412
1479
|
|
|
1413
1480
|
}
|
|
1414
1481
|
|
|
1415
|
-
resultGeometry.setAttribute( 'normal',
|
|
1482
|
+
resultGeometry.setAttribute( 'normal', new BufferAttribute( normalArray, 3, false ) );
|
|
1416
1483
|
return resultGeometry;
|
|
1417
1484
|
|
|
1418
1485
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A utility class for creating a button that allows to initiate
|
|
3
3
|
* immersive AR sessions based on WebXR. The button can be created
|
|
4
|
-
* with a factory method and then appended
|
|
4
|
+
* with a factory method and then appended to the website's DOM.
|
|
5
5
|
*
|
|
6
6
|
* ```js
|
|
7
7
|
* document.body.appendChild( ARButton.createButton( renderer ) );
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sets up a construction-time WebGL fallback for WebGPU XR examples.
|
|
3
|
+
*
|
|
4
|
+
* @param {WebGPURenderer} renderer - The initial renderer.
|
|
5
|
+
* @param {Function} createFallbackRenderer - A function that returns a new renderer with a WebGL backend.
|
|
6
|
+
* @param {Function} onFallback - A function that installs the new renderer in the app.
|
|
7
|
+
*/
|
|
8
|
+
function setupWebGLXRFallback( renderer, createFallbackRenderer, onFallback = () => {} ) {
|
|
9
|
+
|
|
10
|
+
let currentRenderer = renderer;
|
|
11
|
+
const patchedRenderers = new WeakSet();
|
|
12
|
+
|
|
13
|
+
function patchRenderer( renderer ) {
|
|
14
|
+
|
|
15
|
+
if ( patchedRenderers.has( renderer ) ) return;
|
|
16
|
+
|
|
17
|
+
patchedRenderers.add( renderer );
|
|
18
|
+
|
|
19
|
+
const setSession = renderer.xr.setSession.bind( renderer.xr );
|
|
20
|
+
|
|
21
|
+
renderer.xr.setSession = async function ( session ) {
|
|
22
|
+
|
|
23
|
+
if ( renderer !== currentRenderer ) {
|
|
24
|
+
|
|
25
|
+
return currentRenderer.xr.setSession( session );
|
|
26
|
+
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if ( session !== null && renderer.backend.isWebGPUBackend === true && session.enabledFeatures.includes( 'webgpu' ) === false ) {
|
|
30
|
+
|
|
31
|
+
return switchToFallbackRenderer( session, renderer );
|
|
32
|
+
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
try {
|
|
36
|
+
|
|
37
|
+
return await setSession( session );
|
|
38
|
+
|
|
39
|
+
} catch ( error ) {
|
|
40
|
+
|
|
41
|
+
if ( session === null || renderer.backend.isWebGPUBackend !== true ) {
|
|
42
|
+
|
|
43
|
+
throw error;
|
|
44
|
+
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return switchToFallbackRenderer( session, renderer );
|
|
48
|
+
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async function switchToFallbackRenderer( session, renderer ) {
|
|
56
|
+
|
|
57
|
+
if ( renderer.initialized === false ) await renderer.init();
|
|
58
|
+
|
|
59
|
+
const fallbackRenderer = createFallbackRenderer( renderer );
|
|
60
|
+
|
|
61
|
+
if ( fallbackRenderer.backend.isWebGLBackend !== true ) {
|
|
62
|
+
|
|
63
|
+
throw new Error( 'THREE.WebGLXRFallback: createFallbackRenderer() must return a renderer with a WebGL backend.' );
|
|
64
|
+
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const animationLoop = renderer.getAnimationLoop();
|
|
68
|
+
|
|
69
|
+
fallbackRenderer.xr.enabled = renderer.xr.enabled;
|
|
70
|
+
fallbackRenderer.xr.cameraAutoUpdate = renderer.xr.cameraAutoUpdate;
|
|
71
|
+
fallbackRenderer.xr.setFramebufferScaleFactor( renderer.xr.getFramebufferScaleFactor() );
|
|
72
|
+
fallbackRenderer.xr.setReferenceSpaceType( renderer.xr.getReferenceSpaceType() );
|
|
73
|
+
|
|
74
|
+
if ( animationLoop !== null ) await fallbackRenderer.setAnimationLoop( animationLoop );
|
|
75
|
+
|
|
76
|
+
await onFallback( fallbackRenderer, renderer );
|
|
77
|
+
|
|
78
|
+
currentRenderer = fallbackRenderer;
|
|
79
|
+
patchRenderer( fallbackRenderer );
|
|
80
|
+
|
|
81
|
+
return fallbackRenderer.xr.setSession( session );
|
|
82
|
+
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
patchRenderer( renderer );
|
|
86
|
+
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export { setupWebGLXRFallback };
|
|
@@ -353,7 +353,7 @@ class XRControllerModelFactory {
|
|
|
353
353
|
|
|
354
354
|
if ( ! this.gltfLoader ) {
|
|
355
355
|
|
|
356
|
-
throw new Error( 'GLTFLoader not set.' );
|
|
356
|
+
throw new Error( 'THREE.XRControllerModelFactory: GLTFLoader not set.' );
|
|
357
357
|
|
|
358
358
|
}
|
|
359
359
|
|
|
@@ -372,7 +372,7 @@ class XRControllerModelFactory {
|
|
|
372
372
|
null,
|
|
373
373
|
() => {
|
|
374
374
|
|
|
375
|
-
throw new Error( `Asset ${controllerModel.motionController.assetUrl} missing or malformed.` );
|
|
375
|
+
throw new Error( `THREE.XRControllerModelFactory: Asset ${controllerModel.motionController.assetUrl} missing or malformed.` );
|
|
376
376
|
|
|
377
377
|
} );
|
|
378
378
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gnsx/three",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.185.3",
|
|
4
4
|
"description": "JavaScript 3D library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./build/three.cjs",
|
|
@@ -28,7 +28,6 @@
|
|
|
28
28
|
"files": [
|
|
29
29
|
"build",
|
|
30
30
|
"examples/jsm",
|
|
31
|
-
"examples/fonts",
|
|
32
31
|
"LICENSE",
|
|
33
32
|
"package.json",
|
|
34
33
|
"README.md",
|
|
@@ -60,8 +59,10 @@
|
|
|
60
59
|
"lint-utils": "eslint utils",
|
|
61
60
|
"lint": "npm run lint-core",
|
|
62
61
|
"lint-fix": "npm run lint-core -- --fix && npm run lint-addons -- --fix && npm run lint-examples -- --fix && npm run lint-editor -- --fix && npm run lint-manual -- --fix && npm run lint-test -- --fix && npm run lint-utils -- --fix",
|
|
63
|
-
"test-unit": "
|
|
64
|
-
"test-unit-
|
|
62
|
+
"test-unit": "node test/unit/puppeteer.unit.js --testPage=UnitTests.html --mode=headless",
|
|
63
|
+
"test-unit-headful": "node test/unit/puppeteer.unit.js --testPage=UnitTests.html --mode=headful",
|
|
64
|
+
"test-unit-addons": "node test/unit/puppeteer.unit.js --testPage=UnitTestsAddons.html --mode=headless",
|
|
65
|
+
"test-unit-addons-headful": "node test/unit/puppeteer.unit.js --testPage=UnitTestsAddons.html --mode=headful",
|
|
65
66
|
"test-e2e": "node test/e2e/puppeteer.js",
|
|
66
67
|
"test-e2e-cov": "node test/e2e/check-coverage.js",
|
|
67
68
|
"test-e2e-webgpu": "node test/e2e/puppeteer.js --webgpu",
|
|
@@ -102,14 +103,13 @@
|
|
|
102
103
|
"eslint-config-mdcs": "^5.0.0",
|
|
103
104
|
"eslint-plugin-compat": "^7.0.0",
|
|
104
105
|
"eslint-plugin-html": "^8.1.3",
|
|
105
|
-
"eslint-plugin-jsdoc": "^
|
|
106
|
+
"eslint-plugin-jsdoc": "^63.0.0",
|
|
106
107
|
"globals": "^17.0.0",
|
|
107
108
|
"jpeg-js": "^0.4.4",
|
|
108
109
|
"jsdoc": "^4.0.5",
|
|
109
110
|
"magic-string": "^0.30.0",
|
|
110
111
|
"pngjs": "^7.0.0",
|
|
111
|
-
"puppeteer": "^25.
|
|
112
|
-
"qunit": "^2.19.4",
|
|
112
|
+
"puppeteer": "^25.0.0",
|
|
113
113
|
"rollup": "^4.6.0",
|
|
114
114
|
"three": "file:.",
|
|
115
115
|
"turndown": "^7.2.2"
|
package/src/Three.TSL.js
CHANGED
|
@@ -47,6 +47,7 @@ export const addNodeElement = TSL.addNodeElement;
|
|
|
47
47
|
export const agxToneMapping = TSL.agxToneMapping;
|
|
48
48
|
export const all = TSL.all;
|
|
49
49
|
export const alphaT = TSL.alphaT;
|
|
50
|
+
export const ambientOcclusion = TSL.ambientOcclusion;
|
|
50
51
|
export const and = TSL.and;
|
|
51
52
|
export const anisotropy = TSL.anisotropy;
|
|
52
53
|
export const anisotropyB = TSL.anisotropyB;
|
|
@@ -54,7 +55,6 @@ export const anisotropyT = TSL.anisotropyT;
|
|
|
54
55
|
export const any = TSL.any;
|
|
55
56
|
export const append = TSL.append;
|
|
56
57
|
export const array = TSL.array;
|
|
57
|
-
export const arrayBuffer = TSL.arrayBuffer;
|
|
58
58
|
export const asin = TSL.asin;
|
|
59
59
|
export const asinh = TSL.asinh;
|
|
60
60
|
export const assign = TSL.assign;
|
|
@@ -177,6 +177,7 @@ export const dynamicBufferAttribute = TSL.dynamicBufferAttribute;
|
|
|
177
177
|
export const element = TSL.element;
|
|
178
178
|
export const emissive = TSL.emissive;
|
|
179
179
|
export const equal = TSL.equal;
|
|
180
|
+
export const equirectDirection = TSL.equirectDirection;
|
|
180
181
|
export const equirectUV = TSL.equirectUV;
|
|
181
182
|
export const exp = TSL.exp;
|
|
182
183
|
export const exp2 = TSL.exp2;
|
|
@@ -324,7 +325,6 @@ export const min = TSL.min;
|
|
|
324
325
|
export const mix = TSL.mix;
|
|
325
326
|
export const mixElement = TSL.mixElement;
|
|
326
327
|
export const mod = TSL.mod;
|
|
327
|
-
export const modInt = TSL.modInt;
|
|
328
328
|
export const modelDirection = TSL.modelDirection;
|
|
329
329
|
export const modelNormalMatrix = TSL.modelNormalMatrix;
|
|
330
330
|
export const modelPosition = TSL.modelPosition;
|
|
@@ -382,6 +382,7 @@ export const mx_worley_noise_float = TSL.mx_worley_noise_float;
|
|
|
382
382
|
export const mx_worley_noise_vec2 = TSL.mx_worley_noise_vec2;
|
|
383
383
|
export const mx_worley_noise_vec3 = TSL.mx_worley_noise_vec3;
|
|
384
384
|
export const negate = TSL.negate;
|
|
385
|
+
export const negateOnBackSide = TSL.negateOnBackSide;
|
|
385
386
|
export const neutralToneMapping = TSL.neutralToneMapping;
|
|
386
387
|
export const nodeArray = TSL.nodeArray;
|
|
387
388
|
export const nodeImmutable = TSL.nodeImmutable;
|
|
@@ -423,9 +424,12 @@ export const oscTriangle = TSL.oscTriangle;
|
|
|
423
424
|
export const output = TSL.output;
|
|
424
425
|
export const outputStruct = TSL.outputStruct;
|
|
425
426
|
export const overloadingFn = TSL.overloadingFn;
|
|
427
|
+
export const overrideNode = TSL.overrideNode;
|
|
428
|
+
export const overrideNodes = TSL.overrideNodes;
|
|
426
429
|
export const packHalf2x16 = TSL.packHalf2x16;
|
|
427
430
|
export const packSnorm2x16 = TSL.packSnorm2x16;
|
|
428
431
|
export const packUnorm2x16 = TSL.packUnorm2x16;
|
|
432
|
+
export const packNormalToRGB = TSL.packNormalToRGB;
|
|
429
433
|
export const parabola = TSL.parabola;
|
|
430
434
|
export const parallaxDirection = TSL.parallaxDirection;
|
|
431
435
|
export const parallaxUV = TSL.parallaxUV;
|
|
@@ -523,7 +527,7 @@ export const stepElement = TSL.stepElement;
|
|
|
523
527
|
export const storage = TSL.storage;
|
|
524
528
|
export const storageBarrier = TSL.storageBarrier;
|
|
525
529
|
export const storageTexture = TSL.storageTexture;
|
|
526
|
-
export const
|
|
530
|
+
export const storageTexture3D = TSL.storageTexture3D;
|
|
527
531
|
export const struct = TSL.struct;
|
|
528
532
|
export const sub = TSL.sub;
|
|
529
533
|
export const subgroupAdd = TSL.subgroupAdd;
|
|
@@ -573,6 +577,8 @@ export const toneMappingExposure = TSL.toneMappingExposure;
|
|
|
573
577
|
export const toonOutlinePass = TSL.toonOutlinePass;
|
|
574
578
|
export const transformDirection = TSL.transformDirection;
|
|
575
579
|
export const transformNormal = TSL.transformNormal;
|
|
580
|
+
export const transformNormalByInverseViewMatrix = TSL.transformNormalByInverseViewMatrix;
|
|
581
|
+
export const transformNormalByViewMatrix = TSL.transformNormalByViewMatrix;
|
|
576
582
|
export const transformNormalToView = TSL.transformNormalToView;
|
|
577
583
|
export const transformedClearcoatNormalView = TSL.transformedClearcoatNormalView;
|
|
578
584
|
export const transformedNormalView = TSL.transformedNormalView;
|
|
@@ -594,6 +600,7 @@ export const uniformTexture = TSL.uniformTexture;
|
|
|
594
600
|
export const unpackHalf2x16 = TSL.unpackHalf2x16;
|
|
595
601
|
export const unpackSnorm2x16 = TSL.unpackSnorm2x16;
|
|
596
602
|
export const unpackUnorm2x16 = TSL.unpackUnorm2x16;
|
|
603
|
+
export const unpackRGBToNormal = TSL.unpackRGBToNormal;
|
|
597
604
|
export const unpremultiplyAlpha = TSL.unpremultiplyAlpha;
|
|
598
605
|
export const userData = TSL.userData;
|
|
599
606
|
export const uv = TSL.uv;
|
package/src/Three.WebGPU.js
CHANGED
|
@@ -4,6 +4,8 @@ export * from './materials/nodes/NodeMaterials.js';
|
|
|
4
4
|
export { default as WebGPURenderer } from './renderers/webgpu/WebGPURenderer.js';
|
|
5
5
|
export { default as WebGPUBackend } from './renderers/webgpu/WebGPUBackend.js';
|
|
6
6
|
export { default as WebGLBackend } from './renderers/webgl-fallback/WebGLBackend.js';
|
|
7
|
+
export { default as Renderer } from './renderers/common/Renderer.js';
|
|
8
|
+
export { default as Backend } from './renderers/common/Backend.js';
|
|
7
9
|
export { default as WebGLCapabilities } from './renderers/webgl-fallback/utils/WebGLCapabilities.js';
|
|
8
10
|
export { default as Lighting } from './renderers/common/Lighting.js';
|
|
9
11
|
export { default as BundleGroup } from './renderers/common/BundleGroup.js';
|
|
@@ -31,6 +33,8 @@ export { default as CanvasTarget } from './renderers/common/CanvasTarget.js';
|
|
|
31
33
|
export { default as BlendMode } from './renderers/common/BlendMode.js';
|
|
32
34
|
export { default as GLSLNodeBuilder } from './renderers/webgl-fallback/nodes/GLSLNodeBuilder.js';
|
|
33
35
|
export { default as BasicNodeLibrary } from './renderers/webgpu/nodes/BasicNodeLibrary.js';
|
|
36
|
+
export { default as StandardNodeLibrary } from './renderers/webgpu/nodes/StandardNodeLibrary.js';
|
|
37
|
+
export { default as WGSLNodeBuilder } from './renderers/webgpu/nodes/WGSLNodeBuilder.js';
|
|
34
38
|
export { ClippingGroup } from './objects/ClippingGroup.js';
|
|
35
39
|
export * from './nodes/Nodes.js';
|
|
36
40
|
import * as TSL from './nodes/TSL.js';
|
|
@@ -41,15 +41,6 @@ class AnimationAction {
|
|
|
41
41
|
|
|
42
42
|
const interpolant = tracks[ i ].createInterpolant( null );
|
|
43
43
|
interpolants[ i ] = interpolant;
|
|
44
|
-
|
|
45
|
-
// preserve interpolant settings (like tangent data from BezierInterpolant)
|
|
46
|
-
|
|
47
|
-
if ( interpolant.settings ) {
|
|
48
|
-
|
|
49
|
-
Object.assign( interpolantSettings, interpolant.settings );
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
44
|
interpolant.settings = interpolantSettings;
|
|
54
45
|
|
|
55
46
|
}
|
|
@@ -65,6 +56,7 @@ class AnimationAction {
|
|
|
65
56
|
this._byClipCacheIndex = null; // for the memory manager
|
|
66
57
|
|
|
67
58
|
this._timeScaleInterpolant = null;
|
|
59
|
+
this._restoreTimeScale = null;
|
|
68
60
|
this._weightInterpolant = null;
|
|
69
61
|
|
|
70
62
|
/**
|
|
@@ -352,6 +344,10 @@ class AnimationAction {
|
|
|
352
344
|
startEndRatio = fadeOutDuration / fadeInDuration,
|
|
353
345
|
endStartRatio = fadeInDuration / fadeOutDuration;
|
|
354
346
|
|
|
347
|
+
|
|
348
|
+
fadeOutAction._restoreTimeScale = fadeOutAction.timeScale;
|
|
349
|
+
this._restoreTimeScale = this.timeScale;
|
|
350
|
+
|
|
355
351
|
fadeOutAction.warp( 1.0, startEndRatio, duration );
|
|
356
352
|
this.warp( endStartRatio, 1.0, duration );
|
|
357
353
|
|
|
@@ -520,6 +516,8 @@ class AnimationAction {
|
|
|
520
516
|
|
|
521
517
|
}
|
|
522
518
|
|
|
519
|
+
this._restoreTimeScale = null;
|
|
520
|
+
|
|
523
521
|
return this;
|
|
524
522
|
|
|
525
523
|
}
|
|
@@ -692,8 +690,6 @@ class AnimationAction {
|
|
|
692
690
|
|
|
693
691
|
if ( time > interpolant.parameterPositions[ 1 ] ) {
|
|
694
692
|
|
|
695
|
-
this.stopWarping();
|
|
696
|
-
|
|
697
693
|
if ( timeScale === 0 ) {
|
|
698
694
|
|
|
699
695
|
// motion has halted, pause
|
|
@@ -701,11 +697,19 @@ class AnimationAction {
|
|
|
701
697
|
|
|
702
698
|
} else {
|
|
703
699
|
|
|
700
|
+
if ( this._restoreTimeScale !== null ) {
|
|
701
|
+
|
|
702
|
+
timeScale = this._restoreTimeScale;
|
|
703
|
+
|
|
704
|
+
}
|
|
705
|
+
|
|
704
706
|
// warp done - apply final time scale
|
|
705
707
|
this.timeScale = timeScale;
|
|
706
708
|
|
|
707
709
|
}
|
|
708
710
|
|
|
711
|
+
this.stopWarping();
|
|
712
|
+
|
|
709
713
|
}
|
|
710
714
|
|
|
711
715
|
}
|