super-three 0.170.1 → 0.172.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/README.md +1 -1
- package/build/three.cjs +157 -49
- package/build/three.core.js +104 -42
- package/build/three.core.min.js +1 -1
- package/build/three.module.js +53 -8
- package/build/three.module.min.js +1 -1
- package/build/three.tsl.js +10 -5
- package/build/three.tsl.min.js +1 -1
- package/build/three.webgpu.js +21191 -1008
- package/build/three.webgpu.min.js +1 -1
- package/build/three.webgpu.nodes.js +21189 -1008
- package/build/three.webgpu.nodes.min.js +1 -1
- package/examples/jsm/Addons.js +0 -5
- package/examples/jsm/animation/CCDIKSolver.js +3 -2
- package/examples/jsm/controls/ArcballControls.js +28 -19
- 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 +11 -7
- package/examples/jsm/exporters/KTX2Exporter.js +1 -1
- package/examples/jsm/exporters/PLYExporter.js +2 -2
- package/examples/jsm/helpers/TextureHelperGPU.js +15 -5
- package/examples/jsm/helpers/VertexNormalsHelper.js +2 -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 +1 -1
- package/examples/jsm/loaders/GLTFLoader.js +22 -2
- 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 -1
- 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/math/ConvexHull.js +1 -1
- package/examples/jsm/math/OBB.js +17 -0
- package/examples/jsm/misc/ProgressiveLightMapGPU.js +10 -10
- package/examples/jsm/misc/Volume.js +20 -12
- package/examples/jsm/misc/VolumeSlice.js +2 -2
- 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 +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/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/SobelOperatorShader.js +1 -1
- 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 +2 -0
- package/src/Three.Legacy.js +0 -21
- package/src/Three.TSL.js +9 -4
- 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/PerspectiveCamera.js +18 -2
- package/src/constants.js +1 -1
- 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/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/InstancedPointsNodeMaterial.js +72 -19
- 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 +474 -21
- package/src/materials/nodes/PointsNodeMaterial.js +22 -13
- package/src/materials/nodes/ShadowNodeMaterial.js +29 -0
- package/src/materials/nodes/SpriteNodeMaterial.js +77 -19
- package/src/materials/nodes/VolumeNodeMaterial.js +80 -4
- package/src/materials/nodes/manager/NodeMaterialObserver.js +87 -0
- package/src/nodes/Nodes.js +1 -6
- package/src/nodes/TSL.js +2 -3
- package/src/nodes/accessors/AccessorsUtils.js +27 -0
- package/src/nodes/accessors/Arrays.js +24 -5
- package/src/nodes/accessors/BatchNode.js +39 -3
- 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 +49 -0
- 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/InstancedPointsMaterialNode.js +13 -0
- package/src/nodes/accessors/Lights.js +50 -1
- package/src/nodes/accessors/MaterialNode.js +302 -8
- 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 +59 -3
- package/src/nodes/accessors/Object3DNode.js +102 -1
- package/src/nodes/accessors/PointUVNode.js +26 -0
- package/src/nodes/accessors/Position.js +53 -4
- package/src/nodes/accessors/ReferenceBaseNode.js +188 -0
- package/src/nodes/accessors/ReferenceNode.js +202 -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 +168 -4
- package/src/nodes/accessors/StorageTextureNode.js +118 -0
- package/src/nodes/accessors/Tangent.js +36 -0
- package/src/nodes/accessors/Texture3DNode.js +89 -5
- package/src/nodes/accessors/TextureBicubic.js +12 -2
- package/src/nodes/accessors/TextureNode.js +309 -10
- package/src/nodes/accessors/TextureSizeNode.js +42 -0
- package/src/nodes/accessors/UV.js +10 -1
- package/src/nodes/accessors/UniformArrayNode.js +223 -23
- package/src/nodes/accessors/UserDataNode.js +46 -0
- package/src/nodes/accessors/VelocityNode.js +82 -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/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 +24 -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 +337 -12
- package/src/nodes/core/NodeAttribute.js +38 -0
- package/src/nodes/core/NodeBuilder.js +945 -15
- 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 +141 -0
- package/src/nodes/core/NodeVar.js +30 -0
- package/src/nodes/core/NodeVarying.js +28 -0
- package/src/nodes/core/OutputStructNode.js +33 -2
- package/src/nodes/core/ParameterNode.js +28 -0
- package/src/nodes/core/PropertyNode.js +232 -0
- package/src/nodes/core/StackNode.js +78 -0
- package/src/nodes/core/StructTypeNode.js +39 -1
- package/src/nodes/core/TempNode.js +30 -4
- package/src/nodes/core/UniformGroupNode.js +82 -7
- package/src/nodes/core/UniformNode.js +66 -0
- package/src/nodes/core/VarNode.js +52 -0
- package/src/nodes/core/VaryingNode.js +83 -2
- package/src/nodes/core/constants.js +36 -0
- 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 +298 -7
- package/src/nodes/display/PosterizeNode.js +33 -0
- package/src/nodes/display/RenderOutputNode.js +66 -1
- package/src/nodes/display/ScreenNode.js +87 -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 +93 -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 +157 -1
- package/src/nodes/gpgpu/BarrierNode.js +47 -0
- package/src/nodes/gpgpu/ComputeBuiltinNode.js +126 -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 +240 -34
- package/src/nodes/lighting/SpotLightNode.js +43 -0
- package/src/nodes/math/ConditionalNode.js +70 -3
- package/src/nodes/math/Hash.js +9 -0
- package/src/nodes/math/MathNode.js +614 -11
- package/src/nodes/math/MathUtils.js +45 -1
- package/src/nodes/math/OperatorNode.js +233 -0
- 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 +1 -1
- package/src/nodes/procedural/Checker.js +9 -0
- package/src/nodes/tsl/TSLBase.js +2 -2
- package/src/nodes/utils/ArrayElementNode.js +38 -2
- 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 +74 -1
- package/src/nodes/utils/MatcapUVNode.js +17 -0
- package/src/nodes/utils/MaxMipLevelNode.js +49 -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 +40 -0
- package/src/nodes/utils/Timer.js +19 -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 +1 -2
- package/src/objects/ClippingGroup.js +49 -0
- package/src/renderers/WebGLRenderer.js +23 -4
- package/src/renderers/common/Animation.js +63 -0
- package/src/renderers/common/Attributes.js +36 -0
- package/src/renderers/common/Backend.js +467 -52
- package/src/renderers/common/Background.js +34 -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 +38 -1
- package/src/renderers/common/ClippingContext.js +107 -14
- package/src/renderers/common/Color4.js +36 -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 +98 -0
- package/src/renderers/common/IndirectStorageBufferAttribute.js +25 -2
- package/src/renderers/common/Info.js +87 -0
- package/src/renderers/common/Lighting.js +26 -0
- package/src/renderers/common/Pipeline.js +22 -0
- package/src/renderers/common/Pipelines.js +148 -5
- package/src/renderers/common/PostProcessing.js +75 -3
- 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 +33 -10
- package/src/renderers/common/RenderContext.js +169 -4
- package/src/renderers/common/RenderContexts.js +42 -2
- package/src/renderers/common/RenderList.js +178 -0
- package/src/renderers/common/RenderLists.js +31 -0
- package/src/renderers/common/RenderObject.js +328 -4
- package/src/renderers/common/RenderObjects.js +101 -7
- package/src/renderers/common/RenderPipeline.js +24 -0
- package/src/renderers/common/Renderer.js +1096 -31
- package/src/renderers/common/RendererUtils.js +193 -0
- package/src/renderers/common/SampledTexture.js +121 -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 +83 -0
- package/src/renderers/common/Uniform.js +188 -2
- package/src/renderers/common/UniformBuffer.js +19 -0
- package/src/renderers/common/UniformsGroup.js +139 -2
- package/src/renderers/common/extras/PMREMGenerator.js +24 -3
- package/src/renderers/common/nodes/NodeBuilderState.js +95 -1
- package/src/renderers/common/nodes/NodeLibrary.js +89 -0
- package/src/renderers/common/nodes/NodeSampledTexture.js +91 -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 +189 -0
- 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 +327 -60
- 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-fallback/WebGLBackend.js +547 -29
- package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +0 -1
- package/src/renderers/webgl-fallback/utils/WebGLAttributeUtils.js +1 -1
- package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +1 -1
- package/src/renderers/webgpu/WebGPUBackend.js +480 -49
- package/src/renderers/webgpu/WebGPURenderer.Nodes.js +34 -0
- package/src/renderers/webgpu/WebGPURenderer.js +35 -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 +59 -11
- 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 +10 -8
- package/src/renderers/webgpu/utils/WebGPUBindingUtils.js +9 -1
- package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +5 -9
- package/src/renderers/webgpu/utils/WebGPUUtils.js +30 -0
- package/src/renderers/webxr/WebXRDepthSensing.js +1 -1
- package/src/renderers/webxr/WebXRManager.js +7 -1
- package/src/textures/Data3DTexture.js +2 -2
- package/src/textures/Texture.js +4 -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/libs/mmdparser.module.js +0 -11530
- package/examples/jsm/loaders/MMDLoader.js +0 -2298
- package/examples/jsm/shaders/MMDToonShader.js +0 -134
- 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.172.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
|
@@ -85,6 +85,8 @@ export { AnimationMixer } from './animation/AnimationMixer.js';
|
|
|
85
85
|
export { AnimationClip } from './animation/AnimationClip.js';
|
|
86
86
|
export { AnimationAction } from './animation/AnimationAction.js';
|
|
87
87
|
export { RenderTarget } from './core/RenderTarget.js';
|
|
88
|
+
export { RenderTarget3D } from './core/RenderTarget3D.js';
|
|
89
|
+
export { RenderTargetArray } from './core/RenderTargetArray.js';
|
|
88
90
|
export { Uniform } from './core/Uniform.js';
|
|
89
91
|
export { UniformsGroup } from './core/UniformsGroup.js';
|
|
90
92
|
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;
|
|
@@ -131,6 +130,7 @@ export const defined = TSL.defined;
|
|
|
131
130
|
export const degrees = TSL.degrees;
|
|
132
131
|
export const deltaTime = TSL.deltaTime;
|
|
133
132
|
export const densityFog = TSL.densityFog;
|
|
133
|
+
export const densityFogFactor = TSL.densityFogFactor;
|
|
134
134
|
export const depth = TSL.depth;
|
|
135
135
|
export const depthPass = TSL.depthPass;
|
|
136
136
|
export const difference = TSL.difference;
|
|
@@ -154,6 +154,7 @@ export const exp2 = TSL.exp2;
|
|
|
154
154
|
export const expression = TSL.expression;
|
|
155
155
|
export const faceDirection = TSL.faceDirection;
|
|
156
156
|
export const faceForward = TSL.faceForward;
|
|
157
|
+
export const faceforward = TSL.faceforward;
|
|
157
158
|
export const float = TSL.float;
|
|
158
159
|
export const floor = TSL.floor;
|
|
159
160
|
export const fog = TSL.fog;
|
|
@@ -182,8 +183,8 @@ export const grayscale = TSL.grayscale;
|
|
|
182
183
|
export const greaterThan = TSL.greaterThan;
|
|
183
184
|
export const greaterThanEqual = TSL.greaterThanEqual;
|
|
184
185
|
export const hash = TSL.hash;
|
|
185
|
-
export const
|
|
186
|
-
export const
|
|
186
|
+
export const highpModelNormalViewMatrix = TSL.highpModelNormalViewMatrix;
|
|
187
|
+
export const highpModelViewMatrix = TSL.highpModelViewMatrix;
|
|
187
188
|
export const hue = TSL.hue;
|
|
188
189
|
export const instance = TSL.instance;
|
|
189
190
|
export const instanceIndex = TSL.instanceIndex;
|
|
@@ -193,6 +194,7 @@ export const instancedDynamicBufferAttribute = TSL.instancedDynamicBufferAttribu
|
|
|
193
194
|
export const instancedMesh = TSL.instancedMesh;
|
|
194
195
|
export const int = TSL.int;
|
|
195
196
|
export const inverseSqrt = TSL.inverseSqrt;
|
|
197
|
+
export const inversesqrt = TSL.inversesqrt;
|
|
196
198
|
export const invocationLocalIndex = TSL.invocationLocalIndex;
|
|
197
199
|
export const invocationSubgroupIndex = TSL.invocationSubgroupIndex;
|
|
198
200
|
export const ior = TSL.ior;
|
|
@@ -222,11 +224,12 @@ export const log2 = TSL.log2;
|
|
|
222
224
|
export const logarithmicDepthToViewZ = TSL.logarithmicDepthToViewZ;
|
|
223
225
|
export const loop = TSL.loop;
|
|
224
226
|
export const luminance = TSL.luminance;
|
|
227
|
+
export const mediumpModelViewMatrix = TSL.mediumpModelViewMatrix;
|
|
225
228
|
export const mat2 = TSL.mat2;
|
|
226
229
|
export const mat3 = TSL.mat3;
|
|
227
230
|
export const mat4 = TSL.mat4;
|
|
228
231
|
export const matcapUV = TSL.matcapUV;
|
|
229
|
-
export const
|
|
232
|
+
export const materialAO = TSL.materialAO;
|
|
230
233
|
export const materialAlphaTest = TSL.materialAlphaTest;
|
|
231
234
|
export const materialAnisotropy = TSL.materialAnisotropy;
|
|
232
235
|
export const materialAnisotropyVector = TSL.materialAnisotropyVector;
|
|
@@ -370,6 +373,7 @@ export const radians = TSL.radians;
|
|
|
370
373
|
export const rand = TSL.rand;
|
|
371
374
|
export const range = TSL.range;
|
|
372
375
|
export const rangeFog = TSL.rangeFog;
|
|
376
|
+
export const rangeFogFactor = TSL.rangeFogFactor;
|
|
373
377
|
export const reciprocal = TSL.reciprocal;
|
|
374
378
|
export const reference = TSL.reference;
|
|
375
379
|
export const referenceBuffer = TSL.referenceBuffer;
|
|
@@ -407,6 +411,7 @@ export const select = TSL.select;
|
|
|
407
411
|
export const setCurrentStack = TSL.setCurrentStack;
|
|
408
412
|
export const shaderStages = TSL.shaderStages;
|
|
409
413
|
export const shadow = TSL.shadow;
|
|
414
|
+
export const shadowPositionWorld = TSL.shadowPositionWorld;
|
|
410
415
|
export const sharedUniformGroup = TSL.sharedUniformGroup;
|
|
411
416
|
export const sheen = TSL.sheen;
|
|
412
417
|
export const sheenRoughness = TSL.sheenRoughness;
|
|
@@ -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
package/src/core/RenderTarget.js
CHANGED
|
@@ -54,6 +54,7 @@ class RenderTarget extends EventDispatcher {
|
|
|
54
54
|
|
|
55
55
|
this.textures[ i ] = texture.clone();
|
|
56
56
|
this.textures[ i ].isRenderTargetTexture = true;
|
|
57
|
+
this.textures[ i ].renderTarget = this;
|
|
57
58
|
|
|
58
59
|
}
|
|
59
60
|
|
|
@@ -63,6 +64,7 @@ class RenderTarget extends EventDispatcher {
|
|
|
63
64
|
this.resolveDepthBuffer = options.resolveDepthBuffer;
|
|
64
65
|
this.resolveStencilBuffer = options.resolveStencilBuffer;
|
|
65
66
|
|
|
67
|
+
this._depthTexture = null;
|
|
66
68
|
this.depthTexture = options.depthTexture;
|
|
67
69
|
|
|
68
70
|
this.samples = options.samples;
|
|
@@ -81,6 +83,21 @@ class RenderTarget extends EventDispatcher {
|
|
|
81
83
|
|
|
82
84
|
}
|
|
83
85
|
|
|
86
|
+
set depthTexture( current ) {
|
|
87
|
+
|
|
88
|
+
if ( this._depthTexture !== null ) this._depthTexture.renderTarget = null;
|
|
89
|
+
if ( current !== null ) current.renderTarget = this;
|
|
90
|
+
|
|
91
|
+
this._depthTexture = current;
|
|
92
|
+
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
get depthTexture() {
|
|
96
|
+
|
|
97
|
+
return this._depthTexture;
|
|
98
|
+
|
|
99
|
+
}
|
|
100
|
+
|
|
84
101
|
setSize( width, height, depth = 1 ) {
|
|
85
102
|
|
|
86
103
|
if ( this.width !== width || this.height !== height || this.depth !== depth ) {
|
|
@@ -129,6 +146,7 @@ class RenderTarget extends EventDispatcher {
|
|
|
129
146
|
|
|
130
147
|
this.textures[ i ] = source.textures[ i ].clone();
|
|
131
148
|
this.textures[ i ].isRenderTargetTexture = true;
|
|
149
|
+
this.textures[ i ].renderTarget = this;
|
|
132
150
|
|
|
133
151
|
}
|
|
134
152
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { RenderTarget } from './RenderTarget.js';
|
|
2
|
+
import { Data3DTexture } from '../textures/Data3DTexture.js';
|
|
3
|
+
|
|
4
|
+
class RenderTarget3D extends RenderTarget {
|
|
5
|
+
|
|
6
|
+
constructor( width = 1, height = 1, depth = 1, options = {} ) {
|
|
7
|
+
|
|
8
|
+
super( width, height, options );
|
|
9
|
+
|
|
10
|
+
this.isRenderTarget3D = true;
|
|
11
|
+
|
|
12
|
+
this.depth = depth;
|
|
13
|
+
|
|
14
|
+
this.texture = new Data3DTexture( null, width, height, depth );
|
|
15
|
+
|
|
16
|
+
this.texture.isRenderTargetTexture = true;
|
|
17
|
+
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { RenderTarget3D };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { RenderTarget } from './RenderTarget.js';
|
|
2
|
+
import { DataArrayTexture } from '../textures/DataArrayTexture.js';
|
|
3
|
+
|
|
4
|
+
class RenderTargetArray extends RenderTarget {
|
|
5
|
+
|
|
6
|
+
constructor( width = 1, height = 1, depth = 1, options = {} ) {
|
|
7
|
+
|
|
8
|
+
super( width, height, options );
|
|
9
|
+
|
|
10
|
+
this.isRenderTargetArray = true;
|
|
11
|
+
|
|
12
|
+
this.depth = depth;
|
|
13
|
+
|
|
14
|
+
this.texture = new DataArrayTexture( null, width, height, depth );
|
|
15
|
+
|
|
16
|
+
this.texture.isRenderTargetTexture = true;
|
|
17
|
+
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export { RenderTargetArray };
|
package/src/extras/Earcut.js
CHANGED
|
@@ -591,7 +591,7 @@ function pointInTriangle( ax, ay, bx, by, cx, cy, px, py ) {
|
|
|
591
591
|
// check if a diagonal between two polygon nodes is valid (lies in polygon interior)
|
|
592
592
|
function isValidDiagonal( a, b ) {
|
|
593
593
|
|
|
594
|
-
return a.next.i !== b.i && a.prev.i !== b.i && ! intersectsPolygon( a, b ) && //
|
|
594
|
+
return a.next.i !== b.i && a.prev.i !== b.i && ! intersectsPolygon( a, b ) && // doesn't intersect other edges
|
|
595
595
|
( locallyInside( a, b ) && locallyInside( b, a ) && middleInside( a, b ) && // locally visible
|
|
596
596
|
( area( a.prev, a, b.prev ) || area( a, b.prev, b ) ) || // does not create opposite-facing sectors
|
|
597
597
|
equals( a, b ) && area( a.prev, a, a.next ) > 0 && area( b.prev, b, b.next ) > 0 ); // special zero-length case
|