super-three 0.171.0 → 0.173.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/LICENSE +1 -1
- package/README.md +1 -1
- package/build/three.cjs +594 -427
- package/build/three.core.js +515 -81
- package/build/three.core.min.js +2 -2
- package/build/three.module.js +79 -350
- package/build/three.module.min.js +2 -2
- package/build/three.tsl.js +20 -7
- package/build/three.tsl.min.js +2 -2
- package/build/three.webgpu.js +29362 -3427
- package/build/three.webgpu.min.js +2 -2
- package/build/three.webgpu.nodes.js +29361 -3427
- package/build/three.webgpu.nodes.min.js +2 -2
- package/examples/jsm/Addons.js +0 -5
- package/examples/jsm/animation/CCDIKSolver.js +9 -7
- package/examples/jsm/capabilities/WebGPU.js +1 -1
- package/examples/jsm/controls/ArcballControls.js +48 -37
- package/examples/jsm/controls/OrbitControls.js +5 -4
- package/examples/jsm/csm/CSMShadowNode.js +16 -11
- package/examples/jsm/curves/NURBSCurve.js +1 -1
- package/examples/jsm/curves/NURBSUtils.js +3 -0
- package/examples/jsm/effects/OutlineEffect.js +1 -1
- package/examples/jsm/exporters/GLTFExporter.js +34 -29
- package/examples/jsm/exporters/KTX2Exporter.js +1 -1
- package/examples/jsm/exporters/PLYExporter.js +2 -2
- package/examples/jsm/geometries/TextGeometry.js +1 -12
- package/examples/jsm/helpers/TextureHelperGPU.js +15 -5
- package/examples/jsm/helpers/VertexNormalsHelper.js +2 -0
- package/examples/jsm/interactive/InteractiveGroup.js +108 -51
- package/examples/jsm/libs/demuxer_mp4.js +109 -0
- package/examples/jsm/lights/LightProbeGenerator.js +3 -3
- package/examples/jsm/lines/webgpu/LineSegments2.js +15 -6
- package/examples/jsm/loaders/3MFLoader.js +6 -3
- package/examples/jsm/loaders/BVHLoader.js +1 -1
- package/examples/jsm/loaders/ColladaLoader.js +5 -5
- package/examples/jsm/loaders/DDSLoader.js +42 -0
- package/examples/jsm/loaders/GCodeLoader.js +4 -2
- package/examples/jsm/loaders/GLTFLoader.js +22 -4
- package/examples/jsm/loaders/KTX2Loader.js +6 -1
- package/examples/jsm/loaders/KTXLoader.js +4 -4
- package/examples/jsm/loaders/LDrawLoader.js +1 -1
- package/examples/jsm/loaders/LottieLoader.js +1 -1
- package/examples/jsm/loaders/MTLLoader.js +1 -0
- package/examples/jsm/loaders/NRRDLoader.js +1 -1
- package/examples/jsm/loaders/PLYLoader.js +7 -7
- package/examples/jsm/loaders/PVRLoader.js +1 -1
- package/examples/jsm/loaders/SVGLoader.js +2 -2
- package/examples/jsm/loaders/TDSLoader.js +1 -2
- package/examples/jsm/loaders/VRMLLoader.js +7 -7
- package/examples/jsm/loaders/lwo/IFFParser.js +4 -4
- package/examples/jsm/materials/LDrawConditionalLineNodeMaterial.js +1 -1
- package/examples/jsm/materials/MeshGouraudMaterial.js +2 -0
- package/examples/jsm/math/ConvexHull.js +1 -1
- package/examples/jsm/math/OBB.js +17 -0
- package/examples/jsm/misc/GPUComputationRenderer.js +6 -7
- package/examples/jsm/misc/ProgressiveLightMap.js +4 -3
- package/examples/jsm/misc/ProgressiveLightMapGPU.js +14 -13
- package/examples/jsm/misc/Volume.js +27 -17
- package/examples/jsm/misc/VolumeSlice.js +7 -5
- package/examples/jsm/modifiers/CurveModifier.js +10 -8
- package/examples/jsm/modifiers/CurveModifierGPU.js +9 -7
- package/examples/jsm/modifiers/SimplifyModifier.js +2 -2
- package/examples/jsm/objects/GroundedSkybox.js +4 -4
- package/examples/jsm/objects/Sky.js +2 -2
- package/examples/jsm/objects/SkyMesh.js +3 -3
- package/examples/jsm/objects/Water2.js +1 -1
- package/examples/jsm/objects/Water2Mesh.js +2 -2
- package/examples/jsm/objects/WaterMesh.js +29 -24
- package/examples/jsm/physics/JoltPhysics.js +7 -7
- package/examples/jsm/physics/RapierPhysics.js +4 -4
- package/examples/jsm/postprocessing/BloomPass.js +2 -2
- package/examples/jsm/postprocessing/EffectComposer.js +1 -2
- package/examples/jsm/postprocessing/OutlinePass.js +4 -4
- package/examples/jsm/postprocessing/OutputPass.js +2 -0
- package/examples/jsm/postprocessing/SAOPass.js +1 -2
- package/examples/jsm/postprocessing/SMAAPass.js +1 -3
- package/examples/jsm/postprocessing/SSAOPass.js +2 -4
- package/examples/jsm/postprocessing/SSRPass.js +2 -4
- package/examples/jsm/postprocessing/UnrealBloomPass.js +2 -2
- package/examples/jsm/renderers/SVGRenderer.js +6 -4
- package/examples/jsm/shaders/BokehShader2.js +1 -1
- package/examples/jsm/shaders/GodRaysShader.js +3 -3
- package/examples/jsm/shaders/OutputShader.js +5 -1
- package/examples/jsm/shaders/SobelOperatorShader.js +1 -1
- package/examples/jsm/transpiler/GLSLDecoder.js +2 -2
- package/examples/jsm/transpiler/TSLEncoder.js +2 -0
- package/examples/jsm/tsl/display/AfterImageNode.js +93 -4
- package/examples/jsm/tsl/display/AnaglyphPassNode.js +46 -2
- package/examples/jsm/tsl/display/AnamorphicNode.js +118 -5
- package/examples/jsm/tsl/display/BleachBypass.js +10 -0
- package/examples/jsm/tsl/display/BloomNode.js +233 -26
- package/examples/jsm/tsl/display/DenoiseNode.js +141 -25
- package/examples/jsm/tsl/display/DepthOfFieldNode.js +80 -1
- package/examples/jsm/tsl/display/DotScreenNode.js +50 -5
- package/examples/jsm/tsl/display/FXAANode.js +52 -3
- package/examples/jsm/tsl/display/FilmNode.js +47 -1
- package/examples/jsm/tsl/display/GTAONode.js +210 -14
- package/examples/jsm/tsl/display/GaussianBlurNode.js +152 -8
- package/examples/jsm/tsl/display/LensflareNode.js +131 -13
- package/examples/jsm/tsl/display/Lut3DNode.js +55 -1
- package/examples/jsm/tsl/display/MotionBlur.js +12 -2
- package/examples/jsm/tsl/display/OutlineNode.js +343 -26
- package/examples/jsm/tsl/display/ParallaxBarrierPassNode.js +36 -2
- package/examples/jsm/tsl/display/PixelationPassNode.js +142 -9
- package/examples/jsm/tsl/display/RGBShiftNode.js +49 -2
- package/examples/jsm/tsl/display/SMAANode.js +187 -46
- package/examples/jsm/tsl/display/SSAAPassNode.js +110 -25
- package/examples/jsm/tsl/display/SSRNode.js +194 -21
- package/examples/jsm/tsl/display/Sepia.js +9 -0
- package/examples/jsm/tsl/display/SobelOperatorNode.js +54 -4
- package/examples/jsm/tsl/display/StereoCompositePassNode.js +79 -3
- package/examples/jsm/tsl/display/StereoPassNode.js +41 -3
- package/examples/jsm/tsl/display/TRAAPassNode.js +116 -21
- package/examples/jsm/tsl/display/TransitionNode.js +71 -6
- package/examples/jsm/tsl/display/hashBlur.js +14 -3
- package/examples/jsm/tsl/lighting/TiledLightsNode.js +40 -34
- package/examples/jsm/utils/BufferGeometryUtils.js +1 -1
- package/examples/jsm/utils/CameraUtils.js +4 -1
- package/examples/jsm/utils/GeometryUtils.js +22 -19
- package/examples/jsm/utils/SceneUtils.js +2 -2
- package/examples/jsm/webxr/XRControllerModelFactory.js +6 -1
- package/examples/jsm/webxr/XREstimatedLight.js +1 -1
- package/package.json +8 -3
- package/src/Three.Core.js +4 -0
- package/src/Three.Legacy.js +0 -21
- package/src/Three.TSL.js +18 -5
- package/src/Three.WebGPU.Nodes.js +2 -2
- package/src/Three.WebGPU.js +2 -2
- package/src/animation/PropertyBinding.js +2 -2
- package/src/cameras/ArrayCamera.js +1 -0
- package/src/cameras/PerspectiveCamera.js +18 -2
- package/src/constants.js +6 -1
- package/src/core/BufferAttribute.js +4 -0
- package/src/core/EventDispatcher.js +8 -6
- package/src/core/RenderTarget.js +18 -0
- package/src/core/RenderTarget3D.js +22 -0
- package/src/core/RenderTargetArray.js +22 -0
- package/src/extras/Earcut.js +1 -1
- package/src/extras/ImageUtils.js +1 -11
- package/src/extras/PMREMGenerator.js +20 -0
- package/src/extras/TextureUtils.js +6 -0
- package/src/helpers/CameraHelper.js +16 -13
- package/src/loaders/nodes/NodeLoader.js +59 -0
- package/src/loaders/nodes/NodeMaterialLoader.js +45 -0
- package/src/loaders/nodes/NodeObjectLoader.js +61 -0
- package/src/materials/nodes/Line2NodeMaterial.js +128 -34
- package/src/materials/nodes/LineBasicNodeMaterial.js +17 -2
- package/src/materials/nodes/LineDashedNodeMaterial.js +78 -5
- package/src/materials/nodes/MeshBasicNodeMaterial.js +56 -0
- package/src/materials/nodes/MeshLambertNodeMaterial.js +35 -0
- package/src/materials/nodes/MeshMatcapNodeMaterial.js +22 -2
- package/src/materials/nodes/MeshNormalNodeMaterial.js +21 -2
- package/src/materials/nodes/MeshPhongNodeMaterial.js +64 -1
- package/src/materials/nodes/MeshPhysicalNodeMaterial.js +269 -0
- package/src/materials/nodes/MeshSSSNodeMaterial.js +97 -6
- package/src/materials/nodes/MeshStandardNodeMaterial.js +78 -0
- package/src/materials/nodes/MeshToonNodeMaterial.js +28 -0
- package/src/materials/nodes/NodeMaterial.js +476 -23
- package/src/materials/nodes/NodeMaterials.js +0 -1
- package/src/materials/nodes/PointsNodeMaterial.js +121 -10
- package/src/materials/nodes/ShadowNodeMaterial.js +29 -0
- package/src/materials/nodes/SpriteNodeMaterial.js +78 -20
- package/src/materials/nodes/VolumeNodeMaterial.js +80 -4
- package/src/materials/nodes/manager/NodeMaterialObserver.js +95 -0
- package/src/nodes/Nodes.js +5 -6
- package/src/nodes/TSL.js +6 -3
- package/src/nodes/accessors/AccessorsUtils.js +27 -0
- package/src/nodes/accessors/Arrays.js +47 -6
- package/src/nodes/accessors/BatchNode.js +42 -6
- package/src/nodes/accessors/Bitangent.js +37 -0
- package/src/nodes/accessors/BufferAttributeNode.js +178 -5
- package/src/nodes/accessors/BufferNode.js +63 -0
- package/src/nodes/accessors/BuiltinNode.js +38 -0
- package/src/nodes/accessors/Camera.js +113 -3
- package/src/nodes/accessors/ClippingNode.js +71 -2
- package/src/nodes/accessors/CubeTextureNode.js +64 -0
- package/src/nodes/accessors/InstanceNode.js +85 -2
- package/src/nodes/accessors/InstancedMeshNode.js +28 -3
- package/src/nodes/accessors/Lights.js +50 -1
- package/src/nodes/accessors/MaterialNode.js +306 -12
- package/src/nodes/accessors/MaterialProperties.js +7 -0
- package/src/nodes/accessors/MaterialReferenceNode.js +53 -13
- package/src/nodes/accessors/ModelNode.js +100 -5
- package/src/nodes/accessors/ModelViewProjectionNode.js +10 -38
- package/src/nodes/accessors/MorphNode.js +48 -4
- package/src/nodes/accessors/Normal.js +65 -5
- package/src/nodes/accessors/Object3DNode.js +101 -1
- package/src/nodes/accessors/PointUVNode.js +26 -0
- package/src/nodes/accessors/Position.js +56 -7
- package/src/nodes/accessors/ReferenceBaseNode.js +186 -0
- package/src/nodes/accessors/ReferenceNode.js +201 -2
- package/src/nodes/accessors/ReflectVector.js +24 -0
- package/src/nodes/accessors/RendererReferenceNode.js +46 -1
- package/src/nodes/accessors/SceneNode.js +54 -0
- package/src/nodes/accessors/SkinningNode.js +127 -1
- package/src/nodes/accessors/StorageBufferNode.js +209 -8
- package/src/nodes/accessors/StorageTextureNode.js +118 -0
- package/src/nodes/accessors/Tangent.js +38 -2
- package/src/nodes/accessors/Texture3DNode.js +91 -7
- package/src/nodes/accessors/TextureBicubic.js +12 -2
- package/src/nodes/accessors/TextureNode.js +316 -10
- package/src/nodes/accessors/TextureSizeNode.js +42 -0
- package/src/nodes/accessors/UV.js +10 -1
- package/src/nodes/accessors/UniformArrayNode.js +231 -25
- package/src/nodes/accessors/UserDataNode.js +46 -0
- package/src/nodes/accessors/VelocityNode.js +80 -0
- package/src/nodes/accessors/VertexColorNode.js +39 -2
- package/src/nodes/code/CodeNode.js +95 -1
- package/src/nodes/code/ExpressionNode.js +28 -0
- package/src/nodes/code/FunctionCallNode.js +37 -0
- package/src/nodes/code/FunctionNode.js +45 -0
- package/src/nodes/code/ScriptableNode.js +223 -1
- package/src/nodes/code/ScriptableValueNode.js +85 -1
- package/src/nodes/core/ArrayNode.js +125 -0
- package/src/nodes/core/AssignNode.js +48 -2
- package/src/nodes/core/AttributeNode.js +43 -0
- package/src/nodes/core/BypassNode.js +47 -2
- package/src/nodes/core/CacheNode.js +53 -2
- package/src/nodes/core/ConstNode.js +32 -0
- package/src/nodes/core/ContextNode.js +65 -0
- package/src/nodes/core/IndexNode.js +68 -7
- package/src/nodes/core/InputNode.js +48 -0
- package/src/nodes/core/LightingModel.js +60 -0
- package/src/nodes/core/MRTNode.js +66 -0
- package/src/nodes/core/Node.js +350 -12
- package/src/nodes/core/NodeAttribute.js +38 -0
- package/src/nodes/core/NodeBuilder.js +1166 -26
- package/src/nodes/core/NodeCache.js +41 -2
- package/src/nodes/core/NodeCode.js +31 -0
- package/src/nodes/core/NodeFrame.js +123 -2
- package/src/nodes/core/NodeFunction.js +46 -0
- package/src/nodes/core/NodeFunctionInput.js +44 -0
- package/src/nodes/core/NodeParser.js +11 -0
- package/src/nodes/core/NodeUniform.js +52 -0
- package/src/nodes/core/NodeUtils.js +152 -1
- package/src/nodes/core/NodeVar.js +47 -1
- package/src/nodes/core/NodeVarying.js +28 -0
- package/src/nodes/core/OutputStructNode.js +51 -10
- package/src/nodes/core/ParameterNode.js +28 -0
- package/src/nodes/core/PropertyNode.js +232 -0
- package/src/nodes/core/StackNode.js +98 -1
- package/src/nodes/core/StructNode.js +121 -0
- package/src/nodes/core/StructType.js +13 -0
- package/src/nodes/core/StructTypeNode.js +105 -6
- package/src/nodes/core/TempNode.js +31 -5
- package/src/nodes/core/UniformGroupNode.js +82 -7
- package/src/nodes/core/UniformNode.js +66 -0
- package/src/nodes/core/VarNode.js +146 -7
- package/src/nodes/core/VaryingNode.js +100 -3
- package/src/nodes/core/constants.js +36 -0
- package/src/nodes/display/BlendModes.js +88 -1
- package/src/nodes/display/BumpMapNode.js +37 -0
- package/src/nodes/display/ColorAdjustment.js +53 -11
- package/src/nodes/display/ColorSpaceFunctions.js +16 -0
- package/src/nodes/display/ColorSpaceNode.js +82 -0
- package/src/nodes/display/FrontFacingNode.js +29 -0
- package/src/nodes/display/NormalMapNode.js +43 -0
- package/src/nodes/display/PassNode.js +300 -7
- package/src/nodes/display/PosterizeNode.js +33 -0
- package/src/nodes/display/RenderOutputNode.js +66 -1
- package/src/nodes/display/ScreenNode.js +96 -0
- package/src/nodes/display/ToneMappingFunctions.js +58 -10
- package/src/nodes/display/ToneMappingNode.js +55 -2
- package/src/nodes/display/ToonOutlinePassNode.js +73 -0
- package/src/nodes/display/ViewportDepthNode.js +122 -8
- package/src/nodes/display/ViewportDepthTextureNode.js +23 -0
- package/src/nodes/display/ViewportSharedTextureNode.js +23 -0
- package/src/nodes/display/ViewportTextureNode.js +57 -0
- package/src/nodes/fog/Fog.js +110 -0
- package/src/nodes/functions/BasicLightingModel.js +24 -0
- package/src/nodes/functions/PhongLightingModel.js +34 -2
- package/src/nodes/functions/PhysicalLightingModel.js +167 -8
- package/src/nodes/functions/ShadowMaskModel.js +23 -0
- package/src/nodes/functions/ToonLightingModel.js +20 -0
- package/src/nodes/functions/material/getAlphaHashThreshold.js +1 -3
- package/src/nodes/functions/material/getParallaxCorrectNormal.js +16 -1
- package/src/nodes/geometry/RangeNode.js +54 -2
- package/src/nodes/gpgpu/AtomicFunctionNode.js +174 -2
- package/src/nodes/gpgpu/BarrierNode.js +47 -0
- package/src/nodes/gpgpu/ComputeBuiltinNode.js +134 -0
- package/src/nodes/gpgpu/ComputeNode.js +106 -2
- package/src/nodes/gpgpu/WorkgroupInfoNode.js +115 -6
- package/src/nodes/lighting/AONode.js +18 -0
- package/src/nodes/lighting/AmbientLightNode.js +10 -0
- package/src/nodes/lighting/AnalyticLightNode.js +97 -2
- package/src/nodes/lighting/BasicEnvironmentNode.js +19 -0
- package/src/nodes/lighting/BasicLightMapNode.js +17 -0
- package/src/nodes/lighting/DirectionalLightNode.js +10 -0
- package/src/nodes/lighting/EnvironmentNode.js +18 -0
- package/src/nodes/lighting/HemisphereLightNode.js +31 -0
- package/src/nodes/lighting/IESSpotLightNode.js +11 -0
- package/src/nodes/lighting/IrradianceNode.js +17 -0
- package/src/nodes/lighting/LightProbeNode.js +20 -0
- package/src/nodes/lighting/LightUtils.js +12 -0
- package/src/nodes/lighting/LightingContextNode.js +48 -0
- package/src/nodes/lighting/LightingNode.js +15 -6
- package/src/nodes/lighting/LightsNode.js +132 -1
- package/src/nodes/lighting/PointLightNode.js +32 -1
- package/src/nodes/lighting/PointShadowNode.js +54 -1
- package/src/nodes/lighting/RectAreaLightNode.js +44 -6
- package/src/nodes/lighting/ShadowBaseNode.js +93 -0
- package/src/nodes/lighting/ShadowNode.js +241 -35
- package/src/nodes/lighting/SpotLightNode.js +43 -0
- package/src/nodes/math/ConditionalNode.js +78 -4
- package/src/nodes/math/Hash.js +9 -0
- package/src/nodes/math/MathNode.js +627 -11
- package/src/nodes/math/MathUtils.js +45 -1
- package/src/nodes/math/OperatorNode.js +329 -18
- package/src/nodes/math/TriNoise3D.js +18 -7
- package/src/nodes/parsers/GLSLNodeFunction.js +16 -0
- package/src/nodes/parsers/GLSLNodeParser.js +11 -0
- package/src/nodes/pmrem/PMREMNode.js +133 -0
- package/src/nodes/pmrem/PMREMUtils.js +2 -2
- package/src/nodes/procedural/Checker.js +9 -0
- package/src/nodes/shapes/Shapes.js +33 -0
- package/src/nodes/tsl/TSLBase.js +3 -2
- package/src/nodes/tsl/TSLCore.js +22 -2
- package/src/nodes/utils/ArrayElementNode.js +39 -3
- package/src/nodes/utils/ConvertNode.js +31 -0
- package/src/nodes/utils/CubeMapNode.js +78 -0
- package/src/nodes/utils/Discard.js +16 -0
- package/src/nodes/utils/EquirectUVNode.js +31 -1
- package/src/nodes/utils/FlipNode.js +38 -0
- package/src/nodes/utils/FunctionOverloadingNode.js +53 -1
- package/src/nodes/utils/JoinNode.js +25 -0
- package/src/nodes/utils/LoopNode.js +82 -2
- package/src/nodes/utils/MatcapUVNode.js +17 -0
- package/src/nodes/utils/MaxMipLevelNode.js +49 -0
- package/src/nodes/utils/MemberNode.js +68 -0
- package/src/nodes/utils/Oscillators.js +33 -0
- package/src/nodes/utils/Packing.js +17 -0
- package/src/nodes/utils/PostProcessingUtils.js +28 -23
- package/src/nodes/utils/RTTNode.js +123 -2
- package/src/nodes/utils/ReflectorNode.js +174 -4
- package/src/nodes/utils/RemapNode.js +79 -0
- package/src/nodes/utils/RotateNode.js +41 -0
- package/src/nodes/utils/SetNode.js +44 -1
- package/src/nodes/utils/SplitNode.js +55 -3
- package/src/nodes/utils/SpriteSheetUVNode.js +46 -0
- package/src/nodes/utils/SpriteUtils.js +17 -0
- package/src/nodes/utils/StorageArrayElementNode.js +54 -0
- package/src/nodes/utils/Timer.js +40 -0
- package/src/nodes/utils/TriplanarTexturesNode.js +84 -0
- package/src/nodes/utils/UVUtils.js +20 -0
- package/src/nodes/utils/ViewportUtils.js +13 -0
- package/src/objects/BatchedMesh.js +2 -3
- package/src/objects/ClippingGroup.js +49 -0
- package/src/objects/Line.js +6 -6
- package/src/renderers/WebGLRenderer.js +30 -4
- package/src/renderers/common/Animation.js +85 -0
- package/src/renderers/common/Attributes.js +36 -0
- package/src/renderers/common/Backend.js +502 -44
- package/src/renderers/common/Background.js +48 -1
- package/src/renderers/common/BindGroup.js +43 -0
- package/src/renderers/common/Binding.js +35 -0
- package/src/renderers/common/Bindings.js +93 -1
- package/src/renderers/common/Buffer.js +49 -0
- package/src/renderers/common/BufferUtils.js +27 -0
- package/src/renderers/common/BundleGroup.js +57 -0
- package/src/renderers/common/ChainMap.js +45 -6
- package/src/renderers/common/ClippingContext.js +108 -15
- package/src/renderers/common/Color4.js +40 -0
- package/src/renderers/common/ComputePipeline.js +24 -0
- package/src/renderers/common/CubeRenderTarget.js +13 -0
- package/src/renderers/common/DataMap.js +37 -1
- package/src/renderers/common/Geometries.js +91 -14
- package/src/renderers/common/IndirectStorageBufferAttribute.js +25 -2
- package/src/renderers/common/Info.js +78 -35
- package/src/renderers/common/Lighting.js +34 -6
- package/src/renderers/common/Pipeline.js +22 -0
- package/src/renderers/common/Pipelines.js +148 -5
- package/src/renderers/common/PostProcessing.js +99 -11
- package/src/renderers/common/ProgrammableStage.js +60 -2
- package/src/renderers/common/QuadMesh.js +54 -5
- package/src/renderers/common/RenderBundle.js +14 -8
- package/src/renderers/common/RenderBundles.js +39 -10
- package/src/renderers/common/RenderContext.js +201 -2
- package/src/renderers/common/RenderContexts.js +59 -6
- package/src/renderers/common/RenderList.js +178 -0
- package/src/renderers/common/RenderLists.js +40 -3
- package/src/renderers/common/RenderObject.js +400 -17
- package/src/renderers/common/RenderObjects.js +103 -7
- package/src/renderers/common/RenderPipeline.js +24 -0
- package/src/renderers/common/Renderer.js +1170 -86
- package/src/renderers/common/RendererUtils.js +193 -0
- package/src/renderers/common/SampledTexture.js +120 -0
- package/src/renderers/common/Sampler.js +30 -0
- package/src/renderers/common/StorageBuffer.js +24 -0
- package/src/renderers/common/StorageBufferAttribute.js +31 -2
- package/src/renderers/common/StorageInstancedBufferAttribute.js +31 -2
- package/src/renderers/common/StorageTexture.js +38 -0
- package/src/renderers/common/Textures.js +97 -7
- package/src/renderers/common/TimestampQueryPool.js +39 -0
- package/src/renderers/common/Uniform.js +225 -3
- package/src/renderers/common/UniformBuffer.js +19 -0
- package/src/renderers/common/UniformsGroup.js +141 -2
- package/src/renderers/common/XRManager.js +1193 -0
- package/src/renderers/common/XRRenderTarget.js +74 -0
- package/src/renderers/common/extras/PMREMGenerator.js +76 -10
- package/src/renderers/common/nodes/NodeBuilderState.js +99 -5
- package/src/renderers/common/nodes/NodeLibrary.js +89 -0
- package/src/renderers/common/nodes/NodeSampledTexture.js +90 -2
- package/src/renderers/common/nodes/NodeSampler.js +28 -0
- package/src/renderers/common/nodes/NodeStorageBuffer.js +35 -0
- package/src/renderers/common/nodes/NodeUniform.js +243 -2
- package/src/renderers/common/nodes/NodeUniformBuffer.js +29 -0
- package/src/renderers/common/nodes/NodeUniformsGroup.js +31 -18
- package/src/renderers/common/nodes/Nodes.js +352 -78
- package/src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js +2 -2
- package/src/renderers/shaders/ShaderChunk/transmission_pars_fragment.glsl.js +7 -7
- package/src/renderers/webgl/WebGLBackground.js +4 -0
- package/src/renderers/webgl-fallback/WebGLBackend.js +819 -116
- package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +347 -18
- package/src/renderers/webgl-fallback/utils/WebGLAttributeUtils.js +58 -1
- package/src/renderers/webgl-fallback/utils/WebGLCapabilities.js +28 -0
- package/src/renderers/webgl-fallback/utils/WebGLExtensions.js +45 -0
- package/src/renderers/webgl-fallback/utils/WebGLState.js +323 -11
- package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +168 -22
- package/src/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.js +359 -0
- package/src/renderers/webgl-fallback/utils/WebGLUtils.js +43 -0
- package/src/renderers/webgpu/WebGPUBackend.js +578 -164
- package/src/renderers/webgpu/WebGPURenderer.Nodes.js +36 -0
- package/src/renderers/webgpu/WebGPURenderer.js +36 -0
- package/src/renderers/webgpu/nodes/BasicNodeLibrary.js +20 -8
- package/src/renderers/webgpu/nodes/StandardNodeLibrary.js +21 -8
- package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +674 -52
- package/src/renderers/webgpu/nodes/WGSLNodeFunction.js +17 -0
- package/src/renderers/webgpu/nodes/WGSLNodeParser.js +11 -0
- package/src/renderers/webgpu/utils/WebGPUAttributeUtils.js +95 -14
- package/src/renderers/webgpu/utils/WebGPUBindingUtils.js +94 -1
- package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +102 -3
- package/src/renderers/webgpu/utils/WebGPUTexturePassUtils.js +98 -1
- package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +262 -18
- package/src/renderers/webgpu/utils/WebGPUTimestampQueryPool.js +274 -0
- package/src/renderers/webgpu/utils/WebGPUUtils.js +116 -4
- package/src/renderers/webxr/WebXRDepthSensing.js +1 -1
- package/src/renderers/webxr/WebXRManager.js +19 -2
- package/src/textures/Data3DTexture.js +2 -2
- package/src/textures/Texture.js +4 -0
- package/src/textures/VideoFrameTexture.js +35 -0
- package/examples/jsm/animation/MMDAnimationHelper.js +0 -1209
- package/examples/jsm/animation/MMDPhysics.js +0 -1408
- package/examples/jsm/exporters/MMDExporter.js +0 -223
- package/examples/jsm/geometries/InstancedPointsGeometry.js +0 -176
- package/examples/jsm/libs/mmdparser.module.js +0 -11530
- package/examples/jsm/loaders/MMDLoader.js +0 -2298
- package/examples/jsm/objects/InstancedPoints.js +0 -19
- package/examples/jsm/shaders/MMDToonShader.js +0 -134
- package/src/materials/nodes/InstancedPointsNodeMaterial.js +0 -156
- package/src/nodes/accessors/InstancedPointsMaterialNode.js +0 -24
- package/src/nodes/core/UniformGroup.js +0 -13
- package/src/nodes/fog/FogExp2Node.js +0 -35
- package/src/nodes/fog/FogNode.js +0 -50
- package/src/nodes/fog/FogRangeNode.js +0 -36
- package/src/renderers/common/PostProcessingUtils.js +0 -86
|
@@ -52,30 +52,36 @@ class TiledLightsNode extends LightsNode {
|
|
|
52
52
|
this.maxLights = maxLights;
|
|
53
53
|
this.tileSize = tileSize;
|
|
54
54
|
|
|
55
|
-
this.
|
|
56
|
-
this.
|
|
57
|
-
this.
|
|
58
|
-
this.
|
|
59
|
-
this.
|
|
60
|
-
|
|
61
|
-
this.
|
|
62
|
-
this.
|
|
63
|
-
this.
|
|
64
|
-
this.
|
|
65
|
-
this.
|
|
55
|
+
this._bufferSize = null;
|
|
56
|
+
this._lightIndexes = null;
|
|
57
|
+
this._screenTileIndex = null;
|
|
58
|
+
this._compute = null;
|
|
59
|
+
this._lightsTexture = null;
|
|
60
|
+
|
|
61
|
+
this._lightsCount = uniform( 0, 'int' );
|
|
62
|
+
this._tileLightCount = 8;
|
|
63
|
+
this._screenSize = uniform( new Vector2() );
|
|
64
|
+
this._cameraProjectionMatrix = uniform( 'mat4' );
|
|
65
|
+
this._cameraViewMatrix = uniform( 'mat4' );
|
|
66
66
|
|
|
67
67
|
this.updateBeforeType = NodeUpdateType.RENDER;
|
|
68
68
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
customCacheKey() {
|
|
72
|
+
|
|
73
|
+
return this._compute.getCacheKey() + super.customCacheKey();
|
|
74
|
+
|
|
75
|
+
}
|
|
76
|
+
|
|
71
77
|
updateLightsTexture() {
|
|
72
78
|
|
|
73
|
-
const { lightsTexture, tiledLights } = this;
|
|
79
|
+
const { _lightsTexture: lightsTexture, tiledLights } = this;
|
|
74
80
|
|
|
75
81
|
const data = lightsTexture.image.data;
|
|
76
82
|
const lineSize = lightsTexture.image.width * 4;
|
|
77
83
|
|
|
78
|
-
this.
|
|
84
|
+
this._lightsCount.value = tiledLights.length;
|
|
79
85
|
|
|
80
86
|
for ( let i = 0; i < tiledLights.length; i ++ ) {
|
|
81
87
|
|
|
@@ -113,13 +119,13 @@ class TiledLightsNode extends LightsNode {
|
|
|
113
119
|
|
|
114
120
|
this.updateLightsTexture( camera );
|
|
115
121
|
|
|
116
|
-
this.
|
|
117
|
-
this.
|
|
122
|
+
this._cameraProjectionMatrix.value = camera.projectionMatrix;
|
|
123
|
+
this._cameraViewMatrix.value = camera.matrixWorldInverse;
|
|
118
124
|
|
|
119
125
|
renderer.getDrawingBufferSize( _size );
|
|
120
|
-
this.
|
|
126
|
+
this._screenSize.value.copy( _size );
|
|
121
127
|
|
|
122
|
-
renderer.compute( this.
|
|
128
|
+
renderer.compute( this._compute );
|
|
123
129
|
|
|
124
130
|
}
|
|
125
131
|
|
|
@@ -153,7 +159,7 @@ class TiledLightsNode extends LightsNode {
|
|
|
153
159
|
|
|
154
160
|
getBlock( block = 0 ) {
|
|
155
161
|
|
|
156
|
-
return this.
|
|
162
|
+
return this._lightIndexes.element( this._screenTileIndex.mul( int( 2 ).add( int( block ) ) ) );
|
|
157
163
|
|
|
158
164
|
}
|
|
159
165
|
|
|
@@ -163,9 +169,9 @@ class TiledLightsNode extends LightsNode {
|
|
|
163
169
|
|
|
164
170
|
const stride = int( 4 );
|
|
165
171
|
const tileOffset = element.div( stride );
|
|
166
|
-
const tileIndex = this.
|
|
172
|
+
const tileIndex = this._screenTileIndex.mul( int( 2 ) ).add( tileOffset );
|
|
167
173
|
|
|
168
|
-
return this.
|
|
174
|
+
return this._lightIndexes.element( tileIndex ).element( element.modInt( stride ) );
|
|
169
175
|
|
|
170
176
|
}
|
|
171
177
|
|
|
@@ -173,11 +179,11 @@ class TiledLightsNode extends LightsNode {
|
|
|
173
179
|
|
|
174
180
|
index = int( index );
|
|
175
181
|
|
|
176
|
-
const dataA = textureLoad( this.
|
|
177
|
-
const dataB = textureLoad( this.
|
|
182
|
+
const dataA = textureLoad( this._lightsTexture, ivec2( index, 0 ) );
|
|
183
|
+
const dataB = textureLoad( this._lightsTexture, ivec2( index, 1 ) );
|
|
178
184
|
|
|
179
185
|
const position = dataA.xyz;
|
|
180
|
-
const viewPosition = this.
|
|
186
|
+
const viewPosition = this._cameraViewMatrix.mul( position );
|
|
181
187
|
const distance = dataA.w;
|
|
182
188
|
const color = dataB.rgb;
|
|
183
189
|
const decay = dataB.w;
|
|
@@ -208,7 +214,7 @@ class TiledLightsNode extends LightsNode {
|
|
|
208
214
|
|
|
209
215
|
Fn( () => {
|
|
210
216
|
|
|
211
|
-
Loop( this.
|
|
217
|
+
Loop( this._tileLightCount, ( { i } ) => {
|
|
212
218
|
|
|
213
219
|
const lightIndex = this.getTile( i );
|
|
214
220
|
|
|
@@ -246,7 +252,7 @@ class TiledLightsNode extends LightsNode {
|
|
|
246
252
|
width = this.getBufferFitSize( width );
|
|
247
253
|
height = this.getBufferFitSize( height );
|
|
248
254
|
|
|
249
|
-
if ( ! this.
|
|
255
|
+
if ( ! this._bufferSize || this._bufferSize.width !== width || this._bufferSize.height !== height ) {
|
|
250
256
|
|
|
251
257
|
this.create( width, height );
|
|
252
258
|
|
|
@@ -263,11 +269,11 @@ class TiledLightsNode extends LightsNode {
|
|
|
263
269
|
const width = this.getBufferFitSize( _size.width );
|
|
264
270
|
const height = this.getBufferFitSize( _size.height );
|
|
265
271
|
|
|
266
|
-
if ( this.
|
|
272
|
+
if ( this._bufferSize === null ) {
|
|
267
273
|
|
|
268
274
|
this.create( width, height );
|
|
269
275
|
|
|
270
|
-
} else if ( this.
|
|
276
|
+
} else if ( this._bufferSize.width !== width || this._bufferSize.height !== height ) {
|
|
271
277
|
|
|
272
278
|
this.create( width, height );
|
|
273
279
|
|
|
@@ -315,7 +321,7 @@ class TiledLightsNode extends LightsNode {
|
|
|
315
321
|
|
|
316
322
|
const compute = Fn( () => {
|
|
317
323
|
|
|
318
|
-
const { cameraProjectionMatrix, bufferSize, screenSize } = this;
|
|
324
|
+
const { _cameraProjectionMatrix: cameraProjectionMatrix, _bufferSize: bufferSize, _screenSize: screenSize } = this;
|
|
319
325
|
|
|
320
326
|
const tiledBufferSize = bufferSize.clone().divideScalar( tileSize ).floor();
|
|
321
327
|
|
|
@@ -335,7 +341,7 @@ class TiledLightsNode extends LightsNode {
|
|
|
335
341
|
|
|
336
342
|
Loop( this.maxLights, ( { i } ) => {
|
|
337
343
|
|
|
338
|
-
If( index.greaterThanEqual( this.
|
|
344
|
+
If( index.greaterThanEqual( this._tileLightCount ).or( int( i ).greaterThanEqual( int( this._lightsCount ) ) ), () => {
|
|
339
345
|
|
|
340
346
|
Return();
|
|
341
347
|
|
|
@@ -368,11 +374,11 @@ class TiledLightsNode extends LightsNode {
|
|
|
368
374
|
|
|
369
375
|
// assigns
|
|
370
376
|
|
|
371
|
-
this.
|
|
372
|
-
this.
|
|
373
|
-
this.
|
|
374
|
-
this.
|
|
375
|
-
this.
|
|
377
|
+
this._bufferSize = bufferSize;
|
|
378
|
+
this._lightIndexes = lightIndexes;
|
|
379
|
+
this._screenTileIndex = screenTileIndex;
|
|
380
|
+
this._compute = compute;
|
|
381
|
+
this._lightsTexture = lightsTexture;
|
|
376
382
|
|
|
377
383
|
}
|
|
378
384
|
|
|
@@ -18,10 +18,13 @@ const _va = /*@__PURE__*/ new Vector3(), // from pe to pa
|
|
|
18
18
|
* to exactly frame the corners of an arbitrary rectangle.
|
|
19
19
|
* NOTE: This function ignores the standard parameters;
|
|
20
20
|
* do not call updateProjectionMatrix() after this!
|
|
21
|
+
*
|
|
22
|
+
* @param {PerspectiveCamera} camera
|
|
21
23
|
* @param {Vector3} bottomLeftCorner
|
|
22
24
|
* @param {Vector3} bottomRightCorner
|
|
23
25
|
* @param {Vector3} topLeftCorner
|
|
24
|
-
* @param {boolean} estimateViewFrustum
|
|
26
|
+
* @param {boolean} [estimateViewFrustum=false]
|
|
27
|
+
*/
|
|
25
28
|
function frameCorners( camera, bottomLeftCorner, bottomRightCorner, topLeftCorner, estimateViewFrustum = false ) {
|
|
26
29
|
|
|
27
30
|
const pa = bottomLeftCorner, pb = bottomRightCorner, pc = topLeftCorner;
|
|
@@ -7,13 +7,14 @@ import { Vector3 } from 'three';
|
|
|
7
7
|
* Based on work by:
|
|
8
8
|
* @link http://www.openprocessing.org/sketch/15493
|
|
9
9
|
*
|
|
10
|
-
* @param center
|
|
11
|
-
* @param size
|
|
12
|
-
* @param iterations Number of subdivisions.
|
|
13
|
-
* @param v0
|
|
14
|
-
* @param v1
|
|
15
|
-
* @param v2
|
|
16
|
-
* @param v3
|
|
10
|
+
* @param {Vector3} center - Center of Hilbert curve.
|
|
11
|
+
* @param {number} [size=10] - Total width of Hilbert curve.
|
|
12
|
+
* @param {number} [iterations=10] - Number of subdivisions.
|
|
13
|
+
* @param {number} [v0=0] - Corner index -X, -Z.
|
|
14
|
+
* @param {number} [v1=1] - Corner index -X, +Z.
|
|
15
|
+
* @param {number} [v2=2] - Corner index +X, +Z.
|
|
16
|
+
* @param {number} [v3=3] - Corner index +X, -Z.
|
|
17
|
+
* @returns {Array<Array<number>>} The Hilbert curve points.
|
|
17
18
|
*/
|
|
18
19
|
function hilbert2D( center = new Vector3( 0, 0, 0 ), size = 10, iterations = 1, v0 = 0, v1 = 1, v2 = 2, v3 = 3 ) {
|
|
19
20
|
|
|
@@ -56,17 +57,18 @@ function hilbert2D( center = new Vector3( 0, 0, 0 ), size = 10, iterations = 1,
|
|
|
56
57
|
* Based on work by:
|
|
57
58
|
* @link https://openprocessing.org/user/5654
|
|
58
59
|
*
|
|
59
|
-
* @param center
|
|
60
|
-
* @param size
|
|
61
|
-
* @param iterations Number of subdivisions.
|
|
62
|
-
* @param v0
|
|
63
|
-
* @param v1
|
|
64
|
-
* @param v2
|
|
65
|
-
* @param v3
|
|
66
|
-
* @param v4
|
|
67
|
-
* @param v5
|
|
68
|
-
* @param v6
|
|
69
|
-
* @param v7
|
|
60
|
+
* @param {Vector3} [center=new Vector3( 0, 0, 0 )] - Center of Hilbert curve.
|
|
61
|
+
* @param {number} [size=10] - Total width of Hilbert curve.
|
|
62
|
+
* @param {number} [iterations=1] - Number of subdivisions.
|
|
63
|
+
* @param {number} [v0=0] - Corner index -X, +Y, -Z.
|
|
64
|
+
* @param {number} [v1=1] - Corner index -X, +Y, +Z.
|
|
65
|
+
* @param {number} [v2=2] - Corner index -X, -Y, +Z.
|
|
66
|
+
* @param {number} [v3=3] - Corner index -X, -Y, -Z.
|
|
67
|
+
* @param {number} [v4=4] - Corner index +X, -Y, -Z.
|
|
68
|
+
* @param {number} [v5=5] - Corner index +X, -Y, +Z.
|
|
69
|
+
* @param {number} [v6=6] - Corner index +X, +Y, +Z.
|
|
70
|
+
* @param {number} [v7=7] - Corner index +X, +Y, -Z.
|
|
71
|
+
* @returns {Array<Array<number>>} - The Hilbert curve points.
|
|
70
72
|
*/
|
|
71
73
|
function hilbert3D( center = new Vector3( 0, 0, 0 ), size = 10, iterations = 1, v0 = 0, v1 = 1, v2 = 2, v3 = 3, v4 = 4, v5 = 5, v6 = 6, v7 = 7 ) {
|
|
72
74
|
|
|
@@ -121,7 +123,8 @@ function hilbert3D( center = new Vector3( 0, 0, 0 ), size = 10, iterations = 1,
|
|
|
121
123
|
*
|
|
122
124
|
* https://gist.github.com/nitaku/6521802
|
|
123
125
|
*
|
|
124
|
-
* @param size The size of a single gosper island.
|
|
126
|
+
* @param {number} [size=1] - The size of a single gosper island.
|
|
127
|
+
* @return {Array<[number, number, number]>} The gosper island points.
|
|
125
128
|
*/
|
|
126
129
|
function gosper( size = 1 ) {
|
|
127
130
|
|
|
@@ -174,8 +174,8 @@ function reduceVertices( object, func, initialValue ) {
|
|
|
174
174
|
}
|
|
175
175
|
|
|
176
176
|
/**
|
|
177
|
-
* @param {InstancedMesh}
|
|
178
|
-
* @param {function(int, int):int}
|
|
177
|
+
* @param {InstancedMesh} mesh
|
|
178
|
+
* @param {function(int, int):int} compareFn
|
|
179
179
|
*/
|
|
180
180
|
function sortInstancedMesh( mesh, compareFn ) {
|
|
181
181
|
|
|
@@ -54,6 +54,8 @@ class XRControllerModel extends Object3D {
|
|
|
54
54
|
/**
|
|
55
55
|
* Polls data from the XRInputSource and updates the model's components to match
|
|
56
56
|
* the real world data
|
|
57
|
+
*
|
|
58
|
+
* @param {Boolean} force
|
|
57
59
|
*/
|
|
58
60
|
updateMatrixWorld( force ) {
|
|
59
61
|
|
|
@@ -107,8 +109,11 @@ class XRControllerModel extends Object3D {
|
|
|
107
109
|
|
|
108
110
|
/**
|
|
109
111
|
* Walks the model's tree to find the nodes needed to animate the components and
|
|
110
|
-
* saves them to the
|
|
112
|
+
* saves them to the motionController components for use in the frame loop. When
|
|
111
113
|
* touchpads are found, attaches a touch dot to them.
|
|
114
|
+
*
|
|
115
|
+
* @param {MotionController} motionController
|
|
116
|
+
* @param {Object3D} scene
|
|
112
117
|
*/
|
|
113
118
|
function findNodes( motionController, scene ) {
|
|
114
119
|
|
|
@@ -79,7 +79,7 @@ class SessionLightProbe {
|
|
|
79
79
|
|
|
80
80
|
onXRFrame( time, xrFrame ) {
|
|
81
81
|
|
|
82
|
-
// If either this
|
|
82
|
+
// If either this object or the XREstimatedLight has been destroyed, stop
|
|
83
83
|
// running the frame loop.
|
|
84
84
|
if ( ! this.xrLight ) {
|
|
85
85
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "super-three",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.173.0",
|
|
4
4
|
"description": "JavaScript 3D library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./build/three.cjs",
|
|
@@ -22,7 +22,9 @@
|
|
|
22
22
|
"type": "git",
|
|
23
23
|
"url": "supermedium/three.js"
|
|
24
24
|
},
|
|
25
|
-
"sideEffects": [
|
|
25
|
+
"sideEffects": [
|
|
26
|
+
"./src/nodes/**/*"
|
|
27
|
+
],
|
|
26
28
|
"files": [
|
|
27
29
|
"build",
|
|
28
30
|
"examples/jsm",
|
|
@@ -45,6 +47,7 @@
|
|
|
45
47
|
"test": "npm run lint && npm run test-unit && npm run test-unit-addons",
|
|
46
48
|
"build": "rollup -c utils/build/rollup.config.js",
|
|
47
49
|
"build-module": "rollup -c utils/build/rollup.config.js --configOnlyModule",
|
|
50
|
+
"build-docs": "jsdoc -c utils/docs/jsdoc.config.json",
|
|
48
51
|
"dev": "concurrently --names \"ROLLUP,HTTP\" -c \"bgBlue.bold,bgGreen.bold\" \"rollup -c utils/build/rollup.config.js -w -m inline\" \"servez -p 8080\"",
|
|
49
52
|
"dev-ssl": "concurrently --names \"ROLLUP,HTTPS\" -c \"bgBlue.bold,bgGreen.bold\" \"rollup -c utils/build/rollup.config.js -w -m inline\" \"servez -p 8080 --ssl\"",
|
|
50
53
|
"lint-core": "eslint src",
|
|
@@ -90,9 +93,10 @@
|
|
|
90
93
|
},
|
|
91
94
|
"homepage": "https://threejs.org/",
|
|
92
95
|
"devDependencies": {
|
|
93
|
-
"@rollup/plugin-node-resolve": "^
|
|
96
|
+
"@rollup/plugin-node-resolve": "^16.0.0",
|
|
94
97
|
"@rollup/plugin-terser": "^0.4.0",
|
|
95
98
|
"chalk": "^5.2.0",
|
|
99
|
+
"clean-jsdoc-theme": "^4.3.0",
|
|
96
100
|
"concurrently": "^9.0.0",
|
|
97
101
|
"dpdm": "^3.14.0",
|
|
98
102
|
"eslint": "^8.37.0",
|
|
@@ -102,6 +106,7 @@
|
|
|
102
106
|
"eslint-plugin-import": "^2.27.5",
|
|
103
107
|
"failonlyreporter": "^1.0.0",
|
|
104
108
|
"jimp": "^1.6.0",
|
|
109
|
+
"jsdoc": "^4.0.4",
|
|
105
110
|
"magic-string": "^0.30.0",
|
|
106
111
|
"pixelmatch": "^6.0.0",
|
|
107
112
|
"puppeteer": "^22.0.0",
|
package/src/Three.Core.js
CHANGED
|
@@ -4,6 +4,7 @@ export { WebGLArrayRenderTarget } from './renderers/WebGLArrayRenderTarget.js';
|
|
|
4
4
|
export { WebGL3DRenderTarget } from './renderers/WebGL3DRenderTarget.js';
|
|
5
5
|
export { WebGLCubeRenderTarget } from './renderers/WebGLCubeRenderTarget.js';
|
|
6
6
|
export { WebGLRenderTarget } from './renderers/WebGLRenderTarget.js';
|
|
7
|
+
export { WebXRController } from './renderers/webxr/WebXRController.js';
|
|
7
8
|
export { FogExp2 } from './scenes/FogExp2.js';
|
|
8
9
|
export { Fog } from './scenes/Fog.js';
|
|
9
10
|
export { Scene } from './scenes/Scene.js';
|
|
@@ -21,6 +22,7 @@ export { Line } from './objects/Line.js';
|
|
|
21
22
|
export { Points } from './objects/Points.js';
|
|
22
23
|
export { Group } from './objects/Group.js';
|
|
23
24
|
export { VideoTexture } from './textures/VideoTexture.js';
|
|
25
|
+
export { VideoFrameTexture } from './textures/VideoFrameTexture.js';
|
|
24
26
|
export { FramebufferTexture } from './textures/FramebufferTexture.js';
|
|
25
27
|
export { Source } from './textures/Source.js';
|
|
26
28
|
export { DataTexture } from './textures/DataTexture.js';
|
|
@@ -85,6 +87,8 @@ export { AnimationMixer } from './animation/AnimationMixer.js';
|
|
|
85
87
|
export { AnimationClip } from './animation/AnimationClip.js';
|
|
86
88
|
export { AnimationAction } from './animation/AnimationAction.js';
|
|
87
89
|
export { RenderTarget } from './core/RenderTarget.js';
|
|
90
|
+
export { RenderTarget3D } from './core/RenderTarget3D.js';
|
|
91
|
+
export { RenderTargetArray } from './core/RenderTargetArray.js';
|
|
88
92
|
export { Uniform } from './core/Uniform.js';
|
|
89
93
|
export { UniformsGroup } from './core/UniformsGroup.js';
|
|
90
94
|
export { InstancedBufferGeometry } from './core/InstancedBufferGeometry.js';
|
package/src/Three.Legacy.js
CHANGED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { WebGLRenderTarget } from './renderers/WebGLRenderTarget.js';
|
|
2
|
-
|
|
3
|
-
export class WebGLMultipleRenderTargets extends WebGLRenderTarget { // @deprecated, r162
|
|
4
|
-
|
|
5
|
-
constructor( width = 1, height = 1, count = 1, options = {} ) {
|
|
6
|
-
|
|
7
|
-
console.warn( 'THREE.WebGLMultipleRenderTargets has been deprecated and will be removed in r172. Use THREE.WebGLRenderTarget and set the "count" parameter to enable MRT.' );
|
|
8
|
-
|
|
9
|
-
super( width, height, { ...options, count } );
|
|
10
|
-
|
|
11
|
-
this.isWebGLMultipleRenderTargets = true;
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
get texture() {
|
|
16
|
-
|
|
17
|
-
return this.textures;
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
}
|
package/src/Three.TSL.js
CHANGED
|
@@ -33,7 +33,6 @@ export const abs = TSL.abs;
|
|
|
33
33
|
export const acesFilmicToneMapping = TSL.acesFilmicToneMapping;
|
|
34
34
|
export const acos = TSL.acos;
|
|
35
35
|
export const add = TSL.add;
|
|
36
|
-
export const addMethodChaining = TSL.addMethodChaining;
|
|
37
36
|
export const addNodeElement = TSL.addNodeElement;
|
|
38
37
|
export const agxToneMapping = TSL.agxToneMapping;
|
|
39
38
|
export const all = TSL.all;
|
|
@@ -44,6 +43,7 @@ export const anisotropyB = TSL.anisotropyB;
|
|
|
44
43
|
export const anisotropyT = TSL.anisotropyT;
|
|
45
44
|
export const any = TSL.any;
|
|
46
45
|
export const append = TSL.append;
|
|
46
|
+
export const array = TSL.array;
|
|
47
47
|
export const arrayBuffer = TSL.arrayBuffer;
|
|
48
48
|
export const asin = TSL.asin;
|
|
49
49
|
export const assign = TSL.assign;
|
|
@@ -58,6 +58,7 @@ export const atomicOr = TSL.atomicOr;
|
|
|
58
58
|
export const atomicStore = TSL.atomicStore;
|
|
59
59
|
export const atomicSub = TSL.atomicSub;
|
|
60
60
|
export const atomicXor = TSL.atomicXor;
|
|
61
|
+
export const atomicLoad = TSL.atomicLoad;
|
|
61
62
|
export const attenuationColor = TSL.attenuationColor;
|
|
62
63
|
export const attenuationDistance = TSL.attenuationDistance;
|
|
63
64
|
export const attribute = TSL.attribute;
|
|
@@ -94,6 +95,7 @@ export const bypass = TSL.bypass;
|
|
|
94
95
|
export const cache = TSL.cache;
|
|
95
96
|
export const call = TSL.call;
|
|
96
97
|
export const cameraFar = TSL.cameraFar;
|
|
98
|
+
export const cameraIndex = TSL.cameraIndex;
|
|
97
99
|
export const cameraNear = TSL.cameraNear;
|
|
98
100
|
export const cameraNormalMatrix = TSL.cameraNormalMatrix;
|
|
99
101
|
export const cameraPosition = TSL.cameraPosition;
|
|
@@ -115,6 +117,7 @@ export const colorSpaceToWorking = TSL.colorSpaceToWorking;
|
|
|
115
117
|
export const colorToDirection = TSL.colorToDirection;
|
|
116
118
|
export const compute = TSL.compute;
|
|
117
119
|
export const cond = TSL.cond;
|
|
120
|
+
export const Const = TSL.Const;
|
|
118
121
|
export const context = TSL.context;
|
|
119
122
|
export const convert = TSL.convert;
|
|
120
123
|
export const convertColorSpace = TSL.convertColorSpace;
|
|
@@ -131,6 +134,7 @@ export const defined = TSL.defined;
|
|
|
131
134
|
export const degrees = TSL.degrees;
|
|
132
135
|
export const deltaTime = TSL.deltaTime;
|
|
133
136
|
export const densityFog = TSL.densityFog;
|
|
137
|
+
export const densityFogFactor = TSL.densityFogFactor;
|
|
134
138
|
export const depth = TSL.depth;
|
|
135
139
|
export const depthPass = TSL.depthPass;
|
|
136
140
|
export const difference = TSL.difference;
|
|
@@ -154,6 +158,7 @@ export const exp2 = TSL.exp2;
|
|
|
154
158
|
export const expression = TSL.expression;
|
|
155
159
|
export const faceDirection = TSL.faceDirection;
|
|
156
160
|
export const faceForward = TSL.faceForward;
|
|
161
|
+
export const faceforward = TSL.faceforward;
|
|
157
162
|
export const float = TSL.float;
|
|
158
163
|
export const floor = TSL.floor;
|
|
159
164
|
export const fog = TSL.fog;
|
|
@@ -182,8 +187,8 @@ export const grayscale = TSL.grayscale;
|
|
|
182
187
|
export const greaterThan = TSL.greaterThan;
|
|
183
188
|
export const greaterThanEqual = TSL.greaterThanEqual;
|
|
184
189
|
export const hash = TSL.hash;
|
|
185
|
-
export const
|
|
186
|
-
export const
|
|
190
|
+
export const highpModelNormalViewMatrix = TSL.highpModelNormalViewMatrix;
|
|
191
|
+
export const highpModelViewMatrix = TSL.highpModelViewMatrix;
|
|
187
192
|
export const hue = TSL.hue;
|
|
188
193
|
export const instance = TSL.instance;
|
|
189
194
|
export const instanceIndex = TSL.instanceIndex;
|
|
@@ -193,6 +198,7 @@ export const instancedDynamicBufferAttribute = TSL.instancedDynamicBufferAttribu
|
|
|
193
198
|
export const instancedMesh = TSL.instancedMesh;
|
|
194
199
|
export const int = TSL.int;
|
|
195
200
|
export const inverseSqrt = TSL.inverseSqrt;
|
|
201
|
+
export const inversesqrt = TSL.inversesqrt;
|
|
196
202
|
export const invocationLocalIndex = TSL.invocationLocalIndex;
|
|
197
203
|
export const invocationSubgroupIndex = TSL.invocationSubgroupIndex;
|
|
198
204
|
export const ior = TSL.ior;
|
|
@@ -217,16 +223,18 @@ export const lights = TSL.lights;
|
|
|
217
223
|
export const linearDepth = TSL.linearDepth;
|
|
218
224
|
export const linearToneMapping = TSL.linearToneMapping;
|
|
219
225
|
export const localId = TSL.localId;
|
|
226
|
+
export const globalId = TSL.globalId;
|
|
220
227
|
export const log = TSL.log;
|
|
221
228
|
export const log2 = TSL.log2;
|
|
222
229
|
export const logarithmicDepthToViewZ = TSL.logarithmicDepthToViewZ;
|
|
223
230
|
export const loop = TSL.loop;
|
|
224
231
|
export const luminance = TSL.luminance;
|
|
232
|
+
export const mediumpModelViewMatrix = TSL.mediumpModelViewMatrix;
|
|
225
233
|
export const mat2 = TSL.mat2;
|
|
226
234
|
export const mat3 = TSL.mat3;
|
|
227
235
|
export const mat4 = TSL.mat4;
|
|
228
236
|
export const matcapUV = TSL.matcapUV;
|
|
229
|
-
export const
|
|
237
|
+
export const materialAO = TSL.materialAO;
|
|
230
238
|
export const materialAlphaTest = TSL.materialAlphaTest;
|
|
231
239
|
export const materialAnisotropy = TSL.materialAnisotropy;
|
|
232
240
|
export const materialAnisotropyVector = TSL.materialAnisotropyVector;
|
|
@@ -251,7 +259,7 @@ export const materialLineWidth = TSL.materialLineWidth;
|
|
|
251
259
|
export const materialMetalness = TSL.materialMetalness;
|
|
252
260
|
export const materialNormal = TSL.materialNormal;
|
|
253
261
|
export const materialOpacity = TSL.materialOpacity;
|
|
254
|
-
export const
|
|
262
|
+
export const materialPointSize = TSL.materialPointSize;
|
|
255
263
|
export const materialReference = TSL.materialReference;
|
|
256
264
|
export const materialReflectivity = TSL.materialReflectivity;
|
|
257
265
|
export const materialRefractionRatio = TSL.materialRefractionRatio;
|
|
@@ -370,6 +378,7 @@ export const radians = TSL.radians;
|
|
|
370
378
|
export const rand = TSL.rand;
|
|
371
379
|
export const range = TSL.range;
|
|
372
380
|
export const rangeFog = TSL.rangeFog;
|
|
381
|
+
export const rangeFogFactor = TSL.rangeFogFactor;
|
|
373
382
|
export const reciprocal = TSL.reciprocal;
|
|
374
383
|
export const reference = TSL.reference;
|
|
375
384
|
export const referenceBuffer = TSL.referenceBuffer;
|
|
@@ -407,7 +416,9 @@ export const select = TSL.select;
|
|
|
407
416
|
export const setCurrentStack = TSL.setCurrentStack;
|
|
408
417
|
export const shaderStages = TSL.shaderStages;
|
|
409
418
|
export const shadow = TSL.shadow;
|
|
419
|
+
export const shadowPositionWorld = TSL.shadowPositionWorld;
|
|
410
420
|
export const sharedUniformGroup = TSL.sharedUniformGroup;
|
|
421
|
+
export const shapeCircle = TSL.shapeCircle;
|
|
411
422
|
export const sheen = TSL.sheen;
|
|
412
423
|
export const sheenRoughness = TSL.sheenRoughness;
|
|
413
424
|
export const shiftLeft = TSL.shiftLeft;
|
|
@@ -433,6 +444,7 @@ export const storageBarrier = TSL.storageBarrier;
|
|
|
433
444
|
export const storageObject = TSL.storageObject;
|
|
434
445
|
export const storageTexture = TSL.storageTexture;
|
|
435
446
|
export const string = TSL.string;
|
|
447
|
+
export const struct = TSL.struct;
|
|
436
448
|
export const sub = TSL.sub;
|
|
437
449
|
export const subgroupIndex = TSL.subgroupIndex;
|
|
438
450
|
export const subgroupSize = TSL.subgroupSize;
|
|
@@ -491,6 +503,7 @@ export const uv = TSL.uv;
|
|
|
491
503
|
export const uvec2 = TSL.uvec2;
|
|
492
504
|
export const uvec3 = TSL.uvec3;
|
|
493
505
|
export const uvec4 = TSL.uvec4;
|
|
506
|
+
export const Var = TSL.Var;
|
|
494
507
|
export const varying = TSL.varying;
|
|
495
508
|
export const varyingProperty = TSL.varyingProperty;
|
|
496
509
|
export const vec2 = TSL.vec2;
|
|
@@ -7,8 +7,8 @@ export { default as BundleGroup } from './renderers/common/BundleGroup.js';
|
|
|
7
7
|
export { default as QuadMesh } from './renderers/common/QuadMesh.js';
|
|
8
8
|
export { default as PMREMGenerator } from './renderers/common/extras/PMREMGenerator.js';
|
|
9
9
|
export { default as PostProcessing } from './renderers/common/PostProcessing.js';
|
|
10
|
-
import * as
|
|
11
|
-
export {
|
|
10
|
+
import * as RendererUtils from './renderers/common/RendererUtils.js';
|
|
11
|
+
export { RendererUtils };
|
|
12
12
|
export { default as StorageTexture } from './renderers/common/StorageTexture.js';
|
|
13
13
|
export { default as StorageBufferAttribute } from './renderers/common/StorageBufferAttribute.js';
|
|
14
14
|
export { default as StorageInstancedBufferAttribute } from './renderers/common/StorageInstancedBufferAttribute.js';
|
package/src/Three.WebGPU.js
CHANGED
|
@@ -7,8 +7,8 @@ export { default as BundleGroup } from './renderers/common/BundleGroup.js';
|
|
|
7
7
|
export { default as QuadMesh } from './renderers/common/QuadMesh.js';
|
|
8
8
|
export { default as PMREMGenerator } from './renderers/common/extras/PMREMGenerator.js';
|
|
9
9
|
export { default as PostProcessing } from './renderers/common/PostProcessing.js';
|
|
10
|
-
import * as
|
|
11
|
-
export {
|
|
10
|
+
import * as RendererUtils from './renderers/common/RendererUtils.js';
|
|
11
|
+
export { RendererUtils };
|
|
12
12
|
export { default as StorageTexture } from './renderers/common/StorageTexture.js';
|
|
13
13
|
export { default as StorageBufferAttribute } from './renderers/common/StorageBufferAttribute.js';
|
|
14
14
|
export { default as StorageInstancedBufferAttribute } from './renderers/common/StorageInstancedBufferAttribute.js';
|
|
@@ -569,11 +569,11 @@ class PropertyBinding {
|
|
|
569
569
|
|
|
570
570
|
this.targetObject = targetObject;
|
|
571
571
|
|
|
572
|
-
if ( targetObject.
|
|
572
|
+
if ( targetObject.isMaterial === true ) {
|
|
573
573
|
|
|
574
574
|
versioning = this.Versioning.NeedsUpdate;
|
|
575
575
|
|
|
576
|
-
} else if ( targetObject.
|
|
576
|
+
} else if ( targetObject.isObject3D === true ) {
|
|
577
577
|
|
|
578
578
|
versioning = this.Versioning.MatrixWorldNeedsUpdate;
|
|
579
579
|
|
|
@@ -62,7 +62,7 @@ class PerspectiveCamera extends Camera {
|
|
|
62
62
|
* The default film gauge is 35, so that the focal length can be specified for
|
|
63
63
|
* a 35mm (full frame) camera.
|
|
64
64
|
*
|
|
65
|
-
* Values for focal length and film gauge must have the same unit.
|
|
65
|
+
* @param {number} focalLength - Values for focal length and film gauge must have the same unit.
|
|
66
66
|
*/
|
|
67
67
|
setFocalLength( focalLength ) {
|
|
68
68
|
|
|
@@ -76,6 +76,8 @@ class PerspectiveCamera extends Camera {
|
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
78
|
* Calculates the focal length from the current .fov and .filmGauge.
|
|
79
|
+
*
|
|
80
|
+
* @returns {number}
|
|
79
81
|
*/
|
|
80
82
|
getFocalLength() {
|
|
81
83
|
|
|
@@ -109,6 +111,10 @@ class PerspectiveCamera extends Camera {
|
|
|
109
111
|
/**
|
|
110
112
|
* Computes the 2D bounds of the camera's viewable rectangle at a given distance along the viewing direction.
|
|
111
113
|
* Sets minTarget and maxTarget to the coordinates of the lower-left and upper-right corners of the view rectangle.
|
|
114
|
+
*
|
|
115
|
+
* @param {number} distance
|
|
116
|
+
* @param {Vector2} minTarget
|
|
117
|
+
* @param {Vector2} maxTarget
|
|
112
118
|
*/
|
|
113
119
|
getViewBounds( distance, minTarget, maxTarget ) {
|
|
114
120
|
|
|
@@ -124,7 +130,10 @@ class PerspectiveCamera extends Camera {
|
|
|
124
130
|
|
|
125
131
|
/**
|
|
126
132
|
* Computes the width and height of the camera's viewable rectangle at a given distance along the viewing direction.
|
|
127
|
-
*
|
|
133
|
+
*
|
|
134
|
+
* @param {number} distance
|
|
135
|
+
* @param {Vector2} target - Vector2 target used to store result where x is width and y is height.
|
|
136
|
+
* @returns {Vector2}
|
|
128
137
|
*/
|
|
129
138
|
getViewSize( distance, target ) {
|
|
130
139
|
|
|
@@ -168,6 +177,13 @@ class PerspectiveCamera extends Camera {
|
|
|
168
177
|
* camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h );
|
|
169
178
|
*
|
|
170
179
|
* Note there is no reason monitors have to be the same size or in a grid.
|
|
180
|
+
*
|
|
181
|
+
* @param {number} fullWidth
|
|
182
|
+
* @param {number} fullHeight
|
|
183
|
+
* @param {number} x
|
|
184
|
+
* @param {number} y
|
|
185
|
+
* @param {number} width
|
|
186
|
+
* @param {number} height
|
|
171
187
|
*/
|
|
172
188
|
setViewOffset( fullWidth, fullHeight, x, y, width, height ) {
|
|
173
189
|
|
package/src/constants.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const REVISION = '
|
|
1
|
+
export const REVISION = '173';
|
|
2
2
|
|
|
3
3
|
export const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
|
|
4
4
|
export const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
|
|
@@ -209,3 +209,8 @@ export const GLSL3 = '300 es';
|
|
|
209
209
|
|
|
210
210
|
export const WebGLCoordinateSystem = 2000;
|
|
211
211
|
export const WebGPUCoordinateSystem = 2001;
|
|
212
|
+
|
|
213
|
+
export const TimestampQuery = {
|
|
214
|
+
COMPUTE: 'compute',
|
|
215
|
+
RENDER: 'render'
|
|
216
|
+
};
|
|
@@ -7,6 +7,8 @@ import { fromHalfFloat, toHalfFloat } from '../extras/DataUtils.js';
|
|
|
7
7
|
const _vector = /*@__PURE__*/ new Vector3();
|
|
8
8
|
const _vector2 = /*@__PURE__*/ new Vector2();
|
|
9
9
|
|
|
10
|
+
let _id = 0;
|
|
11
|
+
|
|
10
12
|
class BufferAttribute {
|
|
11
13
|
|
|
12
14
|
constructor( array, itemSize, normalized = false ) {
|
|
@@ -19,6 +21,8 @@ class BufferAttribute {
|
|
|
19
21
|
|
|
20
22
|
this.isBufferAttribute = true;
|
|
21
23
|
|
|
24
|
+
Object.defineProperty( this, 'id', { value: _id ++ } );
|
|
25
|
+
|
|
22
26
|
this.name = '';
|
|
23
27
|
|
|
24
28
|
this.array = array;
|