@plastic-software/three 0.182.0 → 0.183.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/build/three.cjs +11521 -10878
- package/build/three.core.js +11732 -11340
- package/build/three.core.min.js +2 -2
- package/build/three.module.js +510 -263
- package/build/three.module.min.js +2 -2
- package/build/three.tsl.js +7 -11
- package/build/three.tsl.min.js +2 -2
- package/build/three.webgpu.js +3072 -2607
- package/build/three.webgpu.min.js +2 -2
- package/build/three.webgpu.nodes.js +3071 -2607
- package/build/three.webgpu.nodes.min.js +2 -2
- package/examples/jsm/Addons.js +0 -3
- package/examples/jsm/animation/CCDIKSolver.js +2 -2
- package/examples/jsm/controls/ArcballControls.js +3 -3
- package/examples/jsm/controls/OrbitControls.js +103 -0
- package/examples/jsm/effects/AnaglyphEffect.js +102 -7
- package/examples/jsm/environments/ColorEnvironment.js +59 -0
- package/examples/jsm/environments/RoomEnvironment.js +1 -0
- package/examples/jsm/exporters/EXRExporter.js +1 -1
- package/examples/jsm/exporters/GLTFExporter.js +131 -4
- package/examples/jsm/exporters/USDZExporter.js +22 -3
- package/examples/jsm/helpers/AnimationPathHelper.js +302 -0
- package/examples/jsm/helpers/ViewHelper.js +67 -8
- package/examples/jsm/inspector/Inspector.js +21 -5
- package/examples/jsm/inspector/tabs/Console.js +39 -5
- package/examples/jsm/inspector/tabs/Parameters.js +16 -0
- package/examples/jsm/inspector/ui/Style.js +25 -1
- package/examples/jsm/libs/meshopt_decoder.module.js +6 -5
- package/examples/jsm/lines/LineMaterial.js +6 -0
- package/examples/jsm/loaders/3MFLoader.js +2 -2
- package/examples/jsm/loaders/AMFLoader.js +2 -2
- package/examples/jsm/loaders/ColladaLoader.js +24 -4026
- package/examples/jsm/loaders/EXRLoader.js +5 -5
- package/examples/jsm/loaders/FBXLoader.js +2 -2
- package/examples/jsm/loaders/GCodeLoader.js +34 -8
- package/examples/jsm/loaders/GLTFLoader.js +122 -171
- package/examples/jsm/loaders/KMZLoader.js +5 -5
- package/examples/jsm/loaders/KTX2Loader.js +5 -5
- package/examples/jsm/loaders/LWOLoader.js +7 -39
- package/examples/jsm/loaders/NRRDLoader.js +2 -2
- package/examples/jsm/loaders/PCDLoader.js +3 -2
- package/examples/jsm/loaders/USDLoader.js +100 -40
- package/examples/jsm/loaders/UltraHDRLoader.js +182 -30
- package/examples/jsm/loaders/VRMLLoader.js +77 -0
- package/examples/jsm/loaders/VTKLoader.js +37 -24
- package/examples/jsm/loaders/collada/ColladaComposer.js +2950 -0
- package/examples/jsm/loaders/collada/ColladaParser.js +1962 -0
- package/examples/jsm/loaders/usd/USDAParser.js +447 -366
- package/examples/jsm/loaders/usd/USDCParser.js +1841 -6
- package/examples/jsm/loaders/usd/USDComposer.js +4041 -0
- package/examples/jsm/materials/LDrawConditionalLineNodeMaterial.js +2 -2
- package/examples/jsm/objects/LensflareMesh.js +1 -1
- package/examples/jsm/objects/Sky.js +76 -4
- package/examples/jsm/objects/SkyMesh.js +114 -7
- package/examples/jsm/objects/Water.js +4 -3
- package/examples/jsm/objects/Water2.js +5 -3
- package/examples/jsm/objects/WaterMesh.js +5 -7
- package/examples/jsm/physics/JoltPhysics.js +7 -5
- package/examples/jsm/physics/RapierPhysics.js +6 -4
- package/examples/jsm/postprocessing/EffectComposer.js +7 -5
- package/examples/jsm/postprocessing/RenderTransitionPass.js +1 -1
- package/examples/jsm/renderers/CSS3DRenderer.js +1 -1
- package/examples/jsm/renderers/SVGRenderer.js +2 -2
- package/examples/jsm/shaders/GTAOShader.js +19 -6
- package/examples/jsm/shaders/HalftoneShader.js +12 -1
- package/examples/jsm/shaders/PoissonDenoiseShader.js +6 -2
- package/examples/jsm/shaders/SAOShader.js +17 -4
- package/examples/jsm/shaders/SSAOShader.js +11 -1
- package/examples/jsm/shaders/SSRShader.js +6 -5
- package/examples/jsm/shaders/VignetteShader.js +1 -1
- package/examples/jsm/tsl/display/AfterImageNode.js +1 -1
- package/examples/jsm/tsl/display/AnaglyphPassNode.js +456 -16
- package/examples/jsm/tsl/display/AnamorphicNode.js +1 -1
- package/examples/jsm/tsl/display/BilateralBlurNode.js +364 -0
- package/examples/jsm/tsl/display/BloomNode.js +5 -5
- package/examples/jsm/tsl/display/CRT.js +150 -0
- package/examples/jsm/tsl/display/DenoiseNode.js +1 -1
- package/examples/jsm/tsl/display/DepthOfFieldNode.js +1 -1
- package/examples/jsm/tsl/display/DotScreenNode.js +1 -1
- package/examples/jsm/tsl/display/FXAANode.js +2 -2
- package/examples/jsm/tsl/display/GTAONode.js +2 -2
- package/examples/jsm/tsl/display/GaussianBlurNode.js +11 -2
- package/examples/jsm/tsl/display/GodraysNode.js +624 -0
- package/examples/jsm/tsl/display/LensflareNode.js +1 -1
- package/examples/jsm/tsl/display/Lut3DNode.js +1 -1
- package/examples/jsm/tsl/display/OutlineNode.js +3 -3
- package/examples/jsm/tsl/display/ParallaxBarrierPassNode.js +2 -2
- package/examples/jsm/tsl/display/PixelationPassNode.js +5 -5
- package/examples/jsm/tsl/display/RGBShiftNode.js +2 -2
- package/examples/jsm/tsl/display/RetroPassNode.js +263 -0
- package/examples/jsm/tsl/display/SMAANode.js +2 -2
- package/examples/jsm/tsl/display/SSAAPassNode.js +2 -2
- package/examples/jsm/tsl/display/SSGINode.js +2 -2
- package/examples/jsm/tsl/display/SSRNode.js +7 -7
- package/examples/jsm/tsl/display/SSSNode.js +2 -2
- package/examples/jsm/tsl/display/Shape.js +29 -0
- package/examples/jsm/tsl/display/SobelOperatorNode.js +2 -2
- package/examples/jsm/tsl/display/StereoPassNode.js +1 -2
- package/examples/jsm/tsl/display/TRAANode.js +9 -12
- package/examples/jsm/tsl/display/TransitionNode.js +1 -1
- package/examples/jsm/tsl/display/depthAwareBlend.js +80 -0
- package/examples/jsm/tsl/math/Bayer.js +40 -1
- package/examples/jsm/utils/LDrawUtils.js +1 -1
- package/package.json +11 -19
- package/src/Three.Core.js +1 -1
- package/src/Three.TSL.js +5 -9
- package/src/Three.WebGPU.Nodes.js +2 -0
- package/src/Three.WebGPU.js +3 -0
- package/src/Three.js +1 -0
- package/src/animation/AnimationAction.js +1 -1
- package/src/animation/AnimationClip.js +1 -1
- package/src/animation/AnimationMixer.js +6 -0
- package/src/animation/KeyframeTrack.js +46 -7
- package/src/animation/PropertyMixer.js +4 -4
- package/src/audio/Audio.js +1 -1
- package/src/audio/AudioListener.js +5 -3
- package/src/cameras/Camera.js +32 -2
- package/src/cameras/CubeCamera.js +20 -0
- package/src/constants.js +30 -1
- package/src/core/Clock.js +7 -0
- package/src/core/Object3D.js +56 -4
- package/src/core/RenderTarget.js +3 -4
- package/src/extras/PMREMGenerator.js +4 -8
- package/src/geometries/TorusGeometry.js +8 -3
- package/src/helpers/CameraHelper.js +3 -0
- package/src/helpers/DirectionalLightHelper.js +4 -1
- package/src/helpers/HemisphereLightHelper.js +3 -0
- package/src/helpers/PointLightHelper.js +0 -24
- package/src/helpers/SpotLightHelper.js +3 -0
- package/src/lights/LightShadow.js +15 -3
- package/src/lights/webgpu/IESSpotLight.js +2 -1
- package/src/loaders/Cache.js +28 -0
- package/src/loaders/FileLoader.js +1 -1
- package/src/loaders/ImageBitmapLoader.js +8 -3
- package/src/loaders/Loader.js +6 -0
- package/src/loaders/ObjectLoader.js +18 -1
- package/src/materials/MeshLambertMaterial.js +9 -0
- package/src/materials/MeshPhongMaterial.js +9 -0
- package/src/materials/nodes/Line2NodeMaterial.js +5 -5
- package/src/materials/nodes/MeshPhysicalNodeMaterial.js +2 -0
- package/src/materials/nodes/NodeMaterial.js +15 -24
- package/src/materials/nodes/manager/NodeMaterialObserver.js +9 -3
- package/src/math/Line3.js +3 -5
- package/src/math/MathUtils.js +10 -10
- package/src/math/Matrix4.js +35 -26
- package/src/math/Quaternion.js +3 -29
- package/src/math/Vector3.js +3 -3
- package/src/math/interpolants/BezierInterpolant.js +108 -0
- package/src/nodes/Nodes.js +87 -68
- package/src/nodes/TSL.js +2 -5
- package/src/nodes/accessors/Arrays.js +1 -1
- package/src/nodes/accessors/Bitangent.js +5 -5
- package/src/nodes/accessors/BufferAttributeNode.js +1 -1
- package/src/nodes/accessors/Camera.js +149 -28
- package/src/nodes/accessors/InstanceNode.js +105 -40
- package/src/nodes/accessors/Normal.js +9 -9
- package/src/nodes/accessors/Position.js +34 -2
- package/src/nodes/accessors/SceneProperties.js +53 -0
- package/src/nodes/accessors/SkinningNode.js +12 -24
- package/src/nodes/accessors/StorageBufferNode.js +0 -19
- package/src/nodes/accessors/StorageTextureNode.js +37 -1
- package/src/nodes/accessors/Tangent.js +3 -3
- package/src/nodes/accessors/Texture3DNode.js +6 -34
- package/src/nodes/accessors/TextureNode.js +58 -22
- package/src/nodes/accessors/UniformArrayNode.js +2 -0
- package/src/nodes/core/MRTNode.js +48 -2
- package/src/nodes/core/Node.js +29 -3
- package/src/nodes/core/NodeBuilder.js +115 -40
- package/src/nodes/core/NodeError.js +28 -0
- package/src/nodes/core/NodeUtils.js +5 -3
- package/src/nodes/core/OutputStructNode.js +12 -10
- package/src/nodes/core/ParameterNode.js +2 -1
- package/src/nodes/core/StackNode.js +9 -8
- package/src/nodes/core/StackTrace.js +139 -0
- package/src/nodes/core/StructNode.js +15 -0
- package/src/nodes/core/SubBuildNode.js +1 -1
- package/src/nodes/core/UniformNode.js +2 -1
- package/src/nodes/core/VarNode.js +1 -1
- package/src/nodes/core/VaryingNode.js +1 -18
- package/src/nodes/display/BlendModes.js +0 -64
- package/src/nodes/display/ColorAdjustment.js +17 -0
- package/src/nodes/display/ColorSpaceNode.js +3 -3
- package/src/nodes/display/NormalMapNode.js +2 -2
- package/src/nodes/display/PassNode.js +21 -2
- package/src/nodes/display/RenderOutputNode.js +3 -3
- package/src/nodes/display/ScreenNode.js +2 -1
- package/src/nodes/display/ToneMappingNode.js +1 -1
- package/src/nodes/display/ToonOutlinePassNode.js +2 -2
- package/src/nodes/display/ViewportDepthNode.js +52 -4
- package/src/nodes/display/ViewportTextureNode.js +21 -4
- package/src/nodes/fog/Fog.js +18 -35
- package/src/nodes/functions/PhysicalLightingModel.js +25 -3
- package/src/nodes/geometry/RangeNode.js +4 -2
- package/src/nodes/gpgpu/ComputeNode.js +5 -4
- package/src/nodes/gpgpu/WorkgroupInfoNode.js +2 -1
- package/src/nodes/lighting/EnvironmentNode.js +28 -3
- package/src/nodes/lighting/PointShadowNode.js +24 -12
- package/src/nodes/lighting/ShadowFilterNode.js +15 -43
- package/src/nodes/lighting/ShadowNode.js +54 -32
- package/src/nodes/math/ConditionalNode.js +2 -2
- package/src/nodes/math/MathNode.js +3 -40
- package/src/nodes/math/OperatorNode.js +2 -1
- package/src/nodes/pmrem/PMREMUtils.js +9 -15
- package/src/nodes/tsl/TSLCore.js +13 -10
- package/src/nodes/utils/DebugNode.js +11 -11
- package/src/nodes/utils/JoinNode.js +2 -2
- package/src/nodes/utils/LoopNode.js +1 -1
- package/src/nodes/utils/MemberNode.js +1 -1
- package/src/nodes/utils/RTTNode.js +1 -1
- package/src/nodes/utils/ReflectorNode.js +2 -3
- package/src/nodes/utils/SpriteSheetUV.js +35 -0
- package/src/nodes/utils/UVUtils.js +4 -2
- package/src/objects/BatchedMesh.js +22 -12
- package/src/objects/InstancedMesh.js +11 -0
- package/src/renderers/WebGLRenderer.js +34 -60
- package/src/renderers/common/Backend.js +21 -0
- package/src/renderers/common/Background.js +7 -4
- package/src/renderers/common/BindGroup.js +1 -9
- package/src/renderers/common/Bindings.js +20 -5
- package/src/renderers/common/BlendMode.js +143 -0
- package/src/renderers/common/BundleGroup.js +1 -1
- package/src/renderers/common/CubeRenderTarget.js +50 -6
- package/src/renderers/common/Geometries.js +17 -3
- package/src/renderers/common/Lighting.js +5 -21
- package/src/renderers/common/Pipelines.js +4 -4
- package/src/renderers/common/PostProcessing.js +8 -206
- package/src/renderers/common/RenderBundles.js +2 -1
- package/src/renderers/common/RenderContext.js +16 -0
- package/src/renderers/common/RenderContexts.js +33 -56
- package/src/renderers/common/RenderLists.js +2 -1
- package/src/renderers/common/RenderObject.js +2 -3
- package/src/renderers/common/RenderObjectPipeline.js +40 -0
- package/src/renderers/common/RenderObjects.js +18 -2
- package/src/renderers/common/RenderPipeline.js +203 -17
- package/src/renderers/common/Renderer.js +207 -40
- package/src/renderers/common/Sampler.js +4 -4
- package/src/renderers/common/StorageBuffer.js +13 -1
- package/src/renderers/common/Textures.js +16 -0
- package/src/renderers/common/TimestampQueryPool.js +5 -3
- package/src/renderers/common/Uniform.js +8 -0
- package/src/renderers/common/UniformsGroup.js +60 -0
- package/src/renderers/common/XRManager.js +2 -2
- package/src/renderers/common/nodes/NodeBuilderState.js +1 -1
- package/src/renderers/common/nodes/{Nodes.js → NodeManager.js} +18 -6
- package/src/renderers/common/nodes/NodeStorageBuffer.js +13 -2
- package/src/renderers/shaders/ShaderChunk/batching_pars_vertex.glsl.js +2 -2
- package/src/renderers/shaders/ShaderChunk/color_fragment.glsl.js +1 -5
- package/src/renderers/shaders/ShaderChunk/color_pars_fragment.glsl.js +1 -5
- package/src/renderers/shaders/ShaderChunk/color_pars_vertex.glsl.js +1 -5
- package/src/renderers/shaders/ShaderChunk/color_vertex.glsl.js +8 -10
- package/src/renderers/shaders/ShaderChunk/cube_uv_reflection_fragment.glsl.js +4 -4
- package/src/renderers/shaders/ShaderChunk/envmap_fragment.glsl.js +7 -11
- package/src/renderers/shaders/ShaderChunk/lights_fragment_end.glsl.js +6 -0
- package/src/renderers/shaders/ShaderChunk/lights_fragment_maps.glsl.js +6 -2
- package/src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js +23 -1
- package/src/renderers/shaders/ShaderChunk/packing.glsl.js +20 -4
- package/src/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl.js +55 -24
- package/src/renderers/shaders/ShaderLib/meshlambert.glsl.js +2 -0
- package/src/renderers/shaders/ShaderLib/meshphong.glsl.js +2 -0
- package/src/renderers/shaders/ShaderLib/shadow.glsl.js +1 -0
- package/src/renderers/shaders/ShaderLib.js +4 -2
- package/src/renderers/shaders/UniformsLib.js +0 -3
- package/src/renderers/webgl/WebGLBackground.js +2 -2
- package/src/renderers/webgl/WebGLBindingStates.js +99 -27
- package/src/renderers/webgl/WebGLEnvironments.js +228 -0
- package/src/renderers/webgl/WebGLGeometries.js +10 -7
- package/src/renderers/webgl/WebGLMaterials.js +12 -0
- package/src/renderers/webgl/WebGLObjects.js +3 -1
- package/src/renderers/webgl/WebGLProgram.js +2 -2
- package/src/renderers/webgl/WebGLPrograms.js +10 -4
- package/src/renderers/webgl/WebGLRenderLists.js +15 -0
- package/src/renderers/webgl/WebGLShadowMap.js +5 -4
- package/src/renderers/webgl/WebGLState.js +12 -17
- package/src/renderers/webgl-fallback/WebGLBackend.js +71 -7
- package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +98 -29
- package/src/renderers/webgl-fallback/utils/WebGLState.js +168 -7
- package/src/renderers/webgpu/WebGPUBackend.js +58 -9
- package/src/renderers/webgpu/WebGPURenderer.js +1 -0
- package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +257 -45
- package/src/renderers/webgpu/utils/WebGPUBindingUtils.js +8 -19
- package/src/renderers/webgpu/utils/WebGPUConstants.js +1 -1
- package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +56 -31
- package/src/renderers/webgpu/utils/WebGPUTexturePassUtils.js +152 -200
- package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +25 -25
- package/src/renderers/webgpu/utils/WebGPUUtils.js +10 -6
- package/src/renderers/webxr/WebXRManager.js +2 -2
- package/src/textures/Texture.js +2 -2
- package/src/utils.js +246 -3
- package/examples/jsm/materials/MeshGouraudMaterial.js +0 -433
- package/examples/jsm/materials/MeshPostProcessingMaterial.js +0 -167
- package/examples/jsm/shaders/GodRaysShader.js +0 -333
- package/src/nodes/accessors/SceneNode.js +0 -145
- package/src/nodes/code/ScriptableNode.js +0 -726
- package/src/nodes/code/ScriptableValueNode.js +0 -253
- package/src/nodes/display/PosterizeNode.js +0 -65
- package/src/nodes/utils/SpriteSheetUVNode.js +0 -90
- package/src/renderers/webgl/WebGLCubeMaps.js +0 -99
- package/src/renderers/webgl/WebGLCubeUVMaps.js +0 -134
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plastic-software/three",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.183.1",
|
|
4
4
|
"description": "JavaScript 3D library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./build/three.cjs",
|
|
@@ -46,22 +46,20 @@
|
|
|
46
46
|
"start": "npm run dev",
|
|
47
47
|
"test": "npm run lint && npm run test-unit && npm run test-unit-addons",
|
|
48
48
|
"build": "rollup -c utils/build/rollup.config.js",
|
|
49
|
+
"build-docs": "jsdoc -c utils/docs/jsdoc.config.json && npm run build-llms",
|
|
50
|
+
"build-llms": "node utils/llms/build.js",
|
|
49
51
|
"build-module": "rollup -c utils/build/rollup.config.js --configOnlyModule",
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"dev-ssl": "node utils/build/dev.js && servez -p 8080 --ssl",
|
|
53
|
-
"preview": "concurrently --names \"ROLLUP,HTTP\" -c \"bgBlue.bold,bgGreen.bold\" \"rollup -c utils/build/rollup.config.js -w -m inline\" \"servez -p 8080\"",
|
|
54
|
-
"preview-ssl": "concurrently --names \"ROLLUP,HTTPS\" -c \"bgBlue.bold,bgGreen.bold\" \"rollup -c utils/build/rollup.config.js -w -m inline\" \"servez -p 8080 --ssl\"",
|
|
52
|
+
"dev": "node utils/build/dev.js && node utils/server.js -p 8080",
|
|
53
|
+
"preview": "node utils/build/preview.js",
|
|
55
54
|
"lint-core": "eslint src",
|
|
56
55
|
"lint-addons": "eslint examples/jsm",
|
|
57
56
|
"lint-examples": "eslint examples",
|
|
58
57
|
"lint-editor": "eslint editor",
|
|
59
|
-
"lint-playground": "eslint playground",
|
|
60
58
|
"lint-manual": "eslint manual",
|
|
61
59
|
"lint-test": "eslint test",
|
|
62
60
|
"lint-utils": "eslint utils",
|
|
63
61
|
"lint": "npm run lint-core",
|
|
64
|
-
"lint-fix": "npm run lint-core -- --fix && npm run lint-addons -- --fix && npm run lint-examples -- --fix && npm run lint-
|
|
62
|
+
"lint-fix": "npm run lint-core -- --fix && npm run lint-addons -- --fix && npm run lint-examples -- --fix && npm run lint-editor -- --fix && npm run lint-manual -- --fix && npm run lint-test -- --fix && npm run lint-utils -- --fix",
|
|
65
63
|
"test-unit": "qunit test/unit/three.source.unit.js",
|
|
66
64
|
"test-unit-addons": "qunit test/unit/three.addons.unit.js",
|
|
67
65
|
"test-e2e": "node test/e2e/puppeteer.js",
|
|
@@ -96,26 +94,20 @@
|
|
|
96
94
|
"@eslint/js": "^9.0.0",
|
|
97
95
|
"@rollup/plugin-node-resolve": "^16.0.0",
|
|
98
96
|
"@rollup/plugin-terser": "^0.4.0",
|
|
99
|
-
"concurrently": "^9.0.0",
|
|
100
97
|
"eslint": "^9.0.0",
|
|
101
98
|
"eslint-config-mdcs": "^5.0.0",
|
|
102
99
|
"eslint-plugin-compat": "^6.0.0",
|
|
103
100
|
"eslint-plugin-html": "^8.1.3",
|
|
104
|
-
"eslint-plugin-
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"jimp": "^1.6.0",
|
|
101
|
+
"eslint-plugin-jsdoc": "^62.0.0",
|
|
102
|
+
"globals": "^17.0.0",
|
|
103
|
+
"jpeg-js": "^0.4.4",
|
|
108
104
|
"jsdoc": "^4.0.5",
|
|
109
105
|
"magic-string": "^0.30.0",
|
|
110
|
-
"
|
|
106
|
+
"pngjs": "^7.0.0",
|
|
111
107
|
"puppeteer": "^24.25.0",
|
|
112
108
|
"qunit": "^2.19.4",
|
|
113
109
|
"rollup": "^4.6.0",
|
|
114
|
-
"
|
|
115
|
-
"servez": "^2.2.4"
|
|
116
|
-
},
|
|
117
|
-
"overrides": {
|
|
118
|
-
"jpeg-js": "^0.4.4"
|
|
110
|
+
"turndown": "^7.2.2"
|
|
119
111
|
},
|
|
120
112
|
"jspm": {
|
|
121
113
|
"files": [
|
package/src/Three.Core.js
CHANGED
|
@@ -3,7 +3,6 @@ import { warn } from './utils.js';
|
|
|
3
3
|
|
|
4
4
|
export { WebGLArrayRenderTarget } from './renderers/WebGLArrayRenderTarget.js';
|
|
5
5
|
export { WebGL3DRenderTarget } from './renderers/WebGL3DRenderTarget.js';
|
|
6
|
-
export { WebGLCubeRenderTarget } from './renderers/WebGLCubeRenderTarget.js';
|
|
7
6
|
export { WebGLRenderTarget } from './renderers/WebGLRenderTarget.js';
|
|
8
7
|
export { WebXRController } from './renderers/webxr/WebXRController.js';
|
|
9
8
|
export { FogExp2 } from './scenes/FogExp2.js';
|
|
@@ -111,6 +110,7 @@ export { QuaternionLinearInterpolant } from './math/interpolants/QuaternionLinea
|
|
|
111
110
|
export { LinearInterpolant } from './math/interpolants/LinearInterpolant.js';
|
|
112
111
|
export { DiscreteInterpolant } from './math/interpolants/DiscreteInterpolant.js';
|
|
113
112
|
export { CubicInterpolant } from './math/interpolants/CubicInterpolant.js';
|
|
113
|
+
export { BezierInterpolant } from './math/interpolants/BezierInterpolant.js';
|
|
114
114
|
export { Interpolant } from './math/Interpolant.js';
|
|
115
115
|
export { Triangle } from './math/Triangle.js';
|
|
116
116
|
export { MathUtils } from './math/MathUtils.js';
|
package/src/Three.TSL.js
CHANGED
|
@@ -29,7 +29,6 @@ export const HALF_PI = TSL.HALF_PI;
|
|
|
29
29
|
export const PointShadowFilter = TSL.PointShadowFilter;
|
|
30
30
|
export const Return = TSL.Return;
|
|
31
31
|
export const Schlick_to_F0 = TSL.Schlick_to_F0;
|
|
32
|
-
export const ScriptableNodeResources = TSL.ScriptableNodeResources;
|
|
33
32
|
export const ShaderNode = TSL.ShaderNode;
|
|
34
33
|
export const Stack = TSL.Stack;
|
|
35
34
|
export const Switch = TSL.Switch;
|
|
@@ -58,7 +57,6 @@ export const arrayBuffer = TSL.arrayBuffer;
|
|
|
58
57
|
export const asin = TSL.asin;
|
|
59
58
|
export const assign = TSL.assign;
|
|
60
59
|
export const atan = TSL.atan;
|
|
61
|
-
export const atan2 = TSL.atan2;
|
|
62
60
|
export const atomicAdd = TSL.atomicAdd;
|
|
63
61
|
export const atomicAnd = TSL.atomicAnd;
|
|
64
62
|
export const atomicFunc = TSL.atomicFunc;
|
|
@@ -98,7 +96,6 @@ export const bool = TSL.bool;
|
|
|
98
96
|
export const buffer = TSL.buffer;
|
|
99
97
|
export const bufferAttribute = TSL.bufferAttribute;
|
|
100
98
|
export const bumpMap = TSL.bumpMap;
|
|
101
|
-
export const burn = TSL.burn;
|
|
102
99
|
export const builtin = TSL.builtin;
|
|
103
100
|
export const builtinAOContext = TSL.builtinAOContext;
|
|
104
101
|
export const builtinShadowContext = TSL.builtinShadowContext;
|
|
@@ -127,6 +124,7 @@ export const clamp = TSL.clamp;
|
|
|
127
124
|
export const clearcoat = TSL.clearcoat;
|
|
128
125
|
export const clearcoatNormalView = TSL.clearcoatNormalView;
|
|
129
126
|
export const clearcoatRoughness = TSL.clearcoatRoughness;
|
|
127
|
+
export const clipSpace = TSL.clipSpace;
|
|
130
128
|
export const code = TSL.code;
|
|
131
129
|
export const color = TSL.color;
|
|
132
130
|
export const colorSpaceToWorking = TSL.colorSpaceToWorking;
|
|
@@ -169,17 +167,16 @@ export const directionToFaceDirection = TSL.directionToFaceDirection;
|
|
|
169
167
|
export const dispersion = TSL.dispersion;
|
|
170
168
|
export const distance = TSL.distance;
|
|
171
169
|
export const div = TSL.div;
|
|
172
|
-
export const dodge = TSL.dodge;
|
|
173
170
|
export const dot = TSL.dot;
|
|
174
171
|
export const drawIndex = TSL.drawIndex;
|
|
175
172
|
export const dynamicBufferAttribute = TSL.dynamicBufferAttribute;
|
|
176
173
|
export const element = TSL.element;
|
|
177
174
|
export const emissive = TSL.emissive;
|
|
178
175
|
export const equal = TSL.equal;
|
|
179
|
-
export const equals = TSL.equals;
|
|
180
176
|
export const equirectUV = TSL.equirectUV;
|
|
181
177
|
export const exp = TSL.exp;
|
|
182
178
|
export const exp2 = TSL.exp2;
|
|
179
|
+
export const exponentialHeightFogFactor = TSL.exponentialHeightFogFactor;
|
|
183
180
|
export const expression = TSL.expression;
|
|
184
181
|
export const faceDirection = TSL.faceDirection;
|
|
185
182
|
export const faceForward = TSL.faceForward;
|
|
@@ -417,7 +414,6 @@ export const oscSquare = TSL.oscSquare;
|
|
|
417
414
|
export const oscTriangle = TSL.oscTriangle;
|
|
418
415
|
export const output = TSL.output;
|
|
419
416
|
export const outputStruct = TSL.outputStruct;
|
|
420
|
-
export const overlay = TSL.overlay;
|
|
421
417
|
export const overloadingFn = TSL.overloadingFn;
|
|
422
418
|
export const packHalf2x16 = TSL.packHalf2x16;
|
|
423
419
|
export const packSnorm2x16 = TSL.packSnorm2x16;
|
|
@@ -487,8 +483,6 @@ export const screenCoordinate = TSL.screenCoordinate;
|
|
|
487
483
|
export const screenDPR = TSL.screenDPR;
|
|
488
484
|
export const screenSize = TSL.screenSize;
|
|
489
485
|
export const screenUV = TSL.screenUV;
|
|
490
|
-
export const scriptable = TSL.scriptable;
|
|
491
|
-
export const scriptableValue = TSL.scriptableValue;
|
|
492
486
|
export const select = TSL.select;
|
|
493
487
|
export const setCurrentStack = TSL.setCurrentStack;
|
|
494
488
|
export const setName = TSL.setName;
|
|
@@ -519,7 +513,6 @@ export const step = TSL.step;
|
|
|
519
513
|
export const stepElement = TSL.stepElement;
|
|
520
514
|
export const storage = TSL.storage;
|
|
521
515
|
export const storageBarrier = TSL.storageBarrier;
|
|
522
|
-
export const storageObject = TSL.storageObject;
|
|
523
516
|
export const storageTexture = TSL.storageTexture;
|
|
524
517
|
export const string = TSL.string;
|
|
525
518
|
export const struct = TSL.struct;
|
|
@@ -611,11 +604,14 @@ export const vibrance = TSL.vibrance;
|
|
|
611
604
|
export const viewZToLogarithmicDepth = TSL.viewZToLogarithmicDepth;
|
|
612
605
|
export const viewZToOrthographicDepth = TSL.viewZToOrthographicDepth;
|
|
613
606
|
export const viewZToPerspectiveDepth = TSL.viewZToPerspectiveDepth;
|
|
607
|
+
export const viewZToReversedOrthographicDepth = TSL.viewZToReversedOrthographicDepth;
|
|
608
|
+
export const viewZToReversedPerspectiveDepth = TSL.viewZToReversedPerspectiveDepth;
|
|
614
609
|
export const viewport = TSL.viewport;
|
|
615
610
|
export const viewportCoordinate = TSL.viewportCoordinate;
|
|
616
611
|
export const viewportDepthTexture = TSL.viewportDepthTexture;
|
|
617
612
|
export const viewportLinearDepth = TSL.viewportLinearDepth;
|
|
618
613
|
export const viewportMipTexture = TSL.viewportMipTexture;
|
|
614
|
+
export const viewportOpaqueMipTexture = TSL.viewportOpaqueMipTexture;
|
|
619
615
|
export const viewportResolution = TSL.viewportResolution;
|
|
620
616
|
export const viewportSafeUV = TSL.viewportSafeUV;
|
|
621
617
|
export const viewportSharedTexture = TSL.viewportSharedTexture;
|
|
@@ -6,6 +6,7 @@ export { default as Lighting } from './renderers/common/Lighting.js';
|
|
|
6
6
|
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
|
+
export { default as RenderPipeline } from './renderers/common/RenderPipeline.js';
|
|
9
10
|
export { default as PostProcessing } from './renderers/common/PostProcessing.js';
|
|
10
11
|
import * as RendererUtils from './renderers/common/RendererUtils.js';
|
|
11
12
|
export { RendererUtils };
|
|
@@ -20,6 +21,7 @@ export { default as NodeObjectLoader } from './loaders/nodes/NodeObjectLoader.js
|
|
|
20
21
|
export { default as NodeMaterialLoader } from './loaders/nodes/NodeMaterialLoader.js';
|
|
21
22
|
export { default as InspectorBase } from './renderers/common/InspectorBase.js';
|
|
22
23
|
export { default as CanvasTarget } from './renderers/common/CanvasTarget.js';
|
|
24
|
+
export { default as BlendMode } from './renderers/common/BlendMode.js';
|
|
23
25
|
export { ClippingGroup } from './objects/ClippingGroup.js';
|
|
24
26
|
export * from './nodes/Nodes.js';
|
|
25
27
|
import * as TSL from './nodes/TSL.js';
|
package/src/Three.WebGPU.js
CHANGED
|
@@ -6,9 +6,11 @@ export { default as Lighting } from './renderers/common/Lighting.js';
|
|
|
6
6
|
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
|
+
export { default as RenderPipeline } from './renderers/common/RenderPipeline.js';
|
|
9
10
|
export { default as PostProcessing } from './renderers/common/PostProcessing.js';
|
|
10
11
|
import * as RendererUtils from './renderers/common/RendererUtils.js';
|
|
11
12
|
export { RendererUtils };
|
|
13
|
+
export { default as CubeRenderTarget } from './renderers/common/CubeRenderTarget.js';
|
|
12
14
|
export { default as StorageTexture } from './renderers/common/StorageTexture.js';
|
|
13
15
|
export { default as Storage3DTexture } from './renderers/common/Storage3DTexture.js';
|
|
14
16
|
export { default as StorageArrayTexture } from './renderers/common/StorageArrayTexture.js';
|
|
@@ -22,6 +24,7 @@ export { default as NodeObjectLoader } from './loaders/nodes/NodeObjectLoader.js
|
|
|
22
24
|
export { default as NodeMaterialLoader } from './loaders/nodes/NodeMaterialLoader.js';
|
|
23
25
|
export { default as InspectorBase } from './renderers/common/InspectorBase.js';
|
|
24
26
|
export { default as CanvasTarget } from './renderers/common/CanvasTarget.js';
|
|
27
|
+
export { default as BlendMode } from './renderers/common/BlendMode.js';
|
|
25
28
|
export { ClippingGroup } from './objects/ClippingGroup.js';
|
|
26
29
|
export * from './nodes/Nodes.js';
|
|
27
30
|
import * as TSL from './nodes/TSL.js';
|
package/src/Three.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './Three.Core.js';
|
|
2
2
|
|
|
3
3
|
export { WebGLRenderer } from './renderers/WebGLRenderer.js';
|
|
4
|
+
export { WebGLCubeRenderTarget } from './renderers/WebGLCubeRenderTarget.js';
|
|
4
5
|
export { ShaderLib } from './renderers/shaders/ShaderLib.js';
|
|
5
6
|
export { UniformsLib } from './renderers/shaders/UniformsLib.js';
|
|
6
7
|
export { UniformsUtils } from './renderers/shaders/UniformsUtils.js';
|
|
@@ -301,7 +301,7 @@ class AnimationClip {
|
|
|
301
301
|
* @static
|
|
302
302
|
* @deprecated since r175.
|
|
303
303
|
* @param {Object} animation - A serialized animation clip as JSON.
|
|
304
|
-
* @param {Array<
|
|
304
|
+
* @param {Array<Bone>} bones - An array of bones.
|
|
305
305
|
* @return {?AnimationClip} The new animation clip.
|
|
306
306
|
*/
|
|
307
307
|
static parseAnimation( animation, bones ) {
|
|
@@ -48,6 +48,12 @@ class AnimationMixer extends EventDispatcher {
|
|
|
48
48
|
*/
|
|
49
49
|
this.timeScale = 1.0;
|
|
50
50
|
|
|
51
|
+
if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {
|
|
52
|
+
|
|
53
|
+
__THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'observe', { detail: this } ) );
|
|
54
|
+
|
|
55
|
+
}
|
|
56
|
+
|
|
51
57
|
}
|
|
52
58
|
|
|
53
59
|
_bindAction( action, prototypeAction ) {
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
InterpolateLinear,
|
|
3
3
|
InterpolateSmooth,
|
|
4
|
-
InterpolateDiscrete
|
|
4
|
+
InterpolateDiscrete,
|
|
5
|
+
InterpolateBezier
|
|
5
6
|
} from '../constants.js';
|
|
6
7
|
import { CubicInterpolant } from '../math/interpolants/CubicInterpolant.js';
|
|
7
8
|
import { LinearInterpolant } from '../math/interpolants/LinearInterpolant.js';
|
|
8
9
|
import { DiscreteInterpolant } from '../math/interpolants/DiscreteInterpolant.js';
|
|
10
|
+
import { BezierInterpolant } from '../math/interpolants/BezierInterpolant.js';
|
|
9
11
|
import * as AnimationUtils from './AnimationUtils.js';
|
|
10
12
|
import { warn, error } from '../utils.js';
|
|
11
13
|
|
|
12
14
|
/**
|
|
13
|
-
* Represents
|
|
15
|
+
* Represents a timed sequence of keyframes, which are composed of lists of
|
|
14
16
|
* times and related values, and which are used to animate a specific property
|
|
15
17
|
* of an object.
|
|
16
18
|
*/
|
|
@@ -22,7 +24,7 @@ class KeyframeTrack {
|
|
|
22
24
|
* @param {string} name - The keyframe track's name.
|
|
23
25
|
* @param {Array<number>} times - A list of keyframe times.
|
|
24
26
|
* @param {Array<number|string|boolean>} values - A list of keyframe values.
|
|
25
|
-
* @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.
|
|
27
|
+
* @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth|InterpolateBezier)} [interpolation] - The interpolation type.
|
|
26
28
|
*/
|
|
27
29
|
constructor( name, times, values, interpolation ) {
|
|
28
30
|
|
|
@@ -140,10 +142,37 @@ class KeyframeTrack {
|
|
|
140
142
|
|
|
141
143
|
}
|
|
142
144
|
|
|
145
|
+
/**
|
|
146
|
+
* Factory method for creating a new Bezier interpolant.
|
|
147
|
+
*
|
|
148
|
+
* The Bezier interpolant requires tangent data to be set via the `settings` property
|
|
149
|
+
* on the track before creating the interpolant. The settings should contain:
|
|
150
|
+
* - `inTangents`: Float32Array with [time, value] pairs per keyframe per component
|
|
151
|
+
* - `outTangents`: Float32Array with [time, value] pairs per keyframe per component
|
|
152
|
+
*
|
|
153
|
+
* @static
|
|
154
|
+
* @param {TypedArray} [result] - The result buffer.
|
|
155
|
+
* @return {BezierInterpolant} The new interpolant.
|
|
156
|
+
*/
|
|
157
|
+
InterpolantFactoryMethodBezier( result ) {
|
|
158
|
+
|
|
159
|
+
const interpolant = new BezierInterpolant( this.times, this.values, this.getValueSize(), result );
|
|
160
|
+
|
|
161
|
+
// Pass tangent data from track settings to interpolant
|
|
162
|
+
if ( this.settings ) {
|
|
163
|
+
|
|
164
|
+
interpolant.settings = this.settings;
|
|
165
|
+
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return interpolant;
|
|
169
|
+
|
|
170
|
+
}
|
|
171
|
+
|
|
143
172
|
/**
|
|
144
173
|
* Defines the interpolation factor method for this keyframe track.
|
|
145
174
|
*
|
|
146
|
-
* @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} interpolation - The interpolation type.
|
|
175
|
+
* @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth|InterpolateBezier)} interpolation - The interpolation type.
|
|
147
176
|
* @return {KeyframeTrack} A reference to this keyframe track.
|
|
148
177
|
*/
|
|
149
178
|
setInterpolation( interpolation ) {
|
|
@@ -170,6 +199,12 @@ class KeyframeTrack {
|
|
|
170
199
|
|
|
171
200
|
break;
|
|
172
201
|
|
|
202
|
+
case InterpolateBezier:
|
|
203
|
+
|
|
204
|
+
factoryMethod = this.InterpolantFactoryMethodBezier;
|
|
205
|
+
|
|
206
|
+
break;
|
|
207
|
+
|
|
173
208
|
}
|
|
174
209
|
|
|
175
210
|
if ( factoryMethod === undefined ) {
|
|
@@ -206,7 +241,7 @@ class KeyframeTrack {
|
|
|
206
241
|
/**
|
|
207
242
|
* Returns the current interpolation type.
|
|
208
243
|
*
|
|
209
|
-
* @return {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} The interpolation type.
|
|
244
|
+
* @return {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth|InterpolateBezier)} The interpolation type.
|
|
210
245
|
*/
|
|
211
246
|
getInterpolation() {
|
|
212
247
|
|
|
@@ -224,6 +259,10 @@ class KeyframeTrack {
|
|
|
224
259
|
|
|
225
260
|
return InterpolateSmooth;
|
|
226
261
|
|
|
262
|
+
case this.InterpolantFactoryMethodBezier:
|
|
263
|
+
|
|
264
|
+
return InterpolateBezier;
|
|
265
|
+
|
|
227
266
|
}
|
|
228
267
|
|
|
229
268
|
}
|
|
@@ -425,7 +464,7 @@ class KeyframeTrack {
|
|
|
425
464
|
* Optimizes this keyframe track by removing equivalent sequential keys (which are
|
|
426
465
|
* common in morph target sequences).
|
|
427
466
|
*
|
|
428
|
-
* @return {
|
|
467
|
+
* @return {KeyframeTrack} A reference to this keyframe track.
|
|
429
468
|
*/
|
|
430
469
|
optimize() {
|
|
431
470
|
|
|
@@ -589,7 +628,7 @@ KeyframeTrack.prototype.ValueBufferType = Float32Array;
|
|
|
589
628
|
/**
|
|
590
629
|
* The default interpolation type of this keyframe track.
|
|
591
630
|
*
|
|
592
|
-
* @type {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)}
|
|
631
|
+
* @type {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth|InterpolateBezier)}
|
|
593
632
|
* @default InterpolateLinear
|
|
594
633
|
*/
|
|
595
634
|
KeyframeTrack.prototype.DefaultInterpolation = InterpolateLinear;
|
|
@@ -88,7 +88,7 @@ class PropertyMixer {
|
|
|
88
88
|
this._addIndex = 4;
|
|
89
89
|
|
|
90
90
|
/**
|
|
91
|
-
*
|
|
91
|
+
* Accumulated weight of the property binding.
|
|
92
92
|
*
|
|
93
93
|
* @type {number}
|
|
94
94
|
* @default 0
|
|
@@ -96,7 +96,7 @@ class PropertyMixer {
|
|
|
96
96
|
this.cumulativeWeight = 0;
|
|
97
97
|
|
|
98
98
|
/**
|
|
99
|
-
*
|
|
99
|
+
* Accumulated additive weight of the property binding.
|
|
100
100
|
*
|
|
101
101
|
* @type {number}
|
|
102
102
|
* @default 0
|
|
@@ -104,7 +104,7 @@ class PropertyMixer {
|
|
|
104
104
|
this.cumulativeWeightAdditive = 0;
|
|
105
105
|
|
|
106
106
|
/**
|
|
107
|
-
*
|
|
107
|
+
* Number of active keyframe tracks currently using this property binding.
|
|
108
108
|
*
|
|
109
109
|
* @type {number}
|
|
110
110
|
* @default 0
|
|
@@ -112,7 +112,7 @@ class PropertyMixer {
|
|
|
112
112
|
this.useCount = 0;
|
|
113
113
|
|
|
114
114
|
/**
|
|
115
|
-
*
|
|
115
|
+
* Number of keyframe tracks referencing this property binding.
|
|
116
116
|
*
|
|
117
117
|
* @type {number}
|
|
118
118
|
* @default 0
|
package/src/audio/Audio.js
CHANGED
|
@@ -191,7 +191,7 @@ class Audio extends Object3D {
|
|
|
191
191
|
/**
|
|
192
192
|
* Defines the source type.
|
|
193
193
|
*
|
|
194
|
-
* The property is automatically by one of the `set*()` methods.
|
|
194
|
+
* The property is automatically set by one of the `set*()` methods.
|
|
195
195
|
*
|
|
196
196
|
* @type {('empty'|'audioNode'|'mediaNode'|'mediaStreamNode'|'buffer')}
|
|
197
197
|
* @readonly
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Vector3 } from '../math/Vector3.js';
|
|
2
2
|
import { Quaternion } from '../math/Quaternion.js';
|
|
3
|
-
import {
|
|
3
|
+
import { Timer } from '../core/Timer.js';
|
|
4
4
|
import { Object3D } from '../core/Object3D.js';
|
|
5
5
|
import { AudioContext } from './AudioContext.js';
|
|
6
6
|
|
|
@@ -71,7 +71,7 @@ class AudioListener extends Object3D {
|
|
|
71
71
|
|
|
72
72
|
// private
|
|
73
73
|
|
|
74
|
-
this.
|
|
74
|
+
this._timer = new Timer();
|
|
75
75
|
|
|
76
76
|
}
|
|
77
77
|
|
|
@@ -176,9 +176,11 @@ class AudioListener extends Object3D {
|
|
|
176
176
|
|
|
177
177
|
super.updateMatrixWorld( force );
|
|
178
178
|
|
|
179
|
+
this._timer.update();
|
|
180
|
+
|
|
179
181
|
const listener = this.context.listener;
|
|
180
182
|
|
|
181
|
-
this.timeDelta = this.
|
|
183
|
+
this.timeDelta = this._timer.getDelta();
|
|
182
184
|
|
|
183
185
|
this.matrixWorld.decompose( _position, _quaternion, _scale );
|
|
184
186
|
|
package/src/cameras/Camera.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { WebGLCoordinateSystem } from '../constants.js';
|
|
2
2
|
import { Matrix4 } from '../math/Matrix4.js';
|
|
3
3
|
import { Object3D } from '../core/Object3D.js';
|
|
4
|
+
import { Vector3 } from '../math/Vector3.js';
|
|
5
|
+
import { Quaternion } from '../math/Quaternion.js';
|
|
6
|
+
|
|
7
|
+
const _position = /*@__PURE__*/ new Vector3();
|
|
8
|
+
const _quaternion = /*@__PURE__*/ new Quaternion();
|
|
9
|
+
const _scale = /*@__PURE__*/ new Vector3();
|
|
4
10
|
|
|
5
11
|
/**
|
|
6
12
|
* Abstract base class for cameras. This class should always be inherited
|
|
@@ -107,7 +113,19 @@ class Camera extends Object3D {
|
|
|
107
113
|
|
|
108
114
|
super.updateMatrixWorld( force );
|
|
109
115
|
|
|
110
|
-
|
|
116
|
+
// exclude scale from view matrix to be glTF conform
|
|
117
|
+
|
|
118
|
+
this.matrixWorld.decompose( _position, _quaternion, _scale );
|
|
119
|
+
|
|
120
|
+
if ( _scale.x === 1 && _scale.y === 1 && _scale.z === 1 ) {
|
|
121
|
+
|
|
122
|
+
this.matrixWorldInverse.copy( this.matrixWorld ).invert();
|
|
123
|
+
|
|
124
|
+
} else {
|
|
125
|
+
|
|
126
|
+
this.matrixWorldInverse.compose( _position, _quaternion, _scale.set( 1, 1, 1 ) ).invert();
|
|
127
|
+
|
|
128
|
+
}
|
|
111
129
|
|
|
112
130
|
}
|
|
113
131
|
|
|
@@ -115,7 +133,19 @@ class Camera extends Object3D {
|
|
|
115
133
|
|
|
116
134
|
super.updateWorldMatrix( updateParents, updateChildren );
|
|
117
135
|
|
|
118
|
-
|
|
136
|
+
// exclude scale from view matrix to be glTF conform
|
|
137
|
+
|
|
138
|
+
this.matrixWorld.decompose( _position, _quaternion, _scale );
|
|
139
|
+
|
|
140
|
+
if ( _scale.x === 1 && _scale.y === 1 && _scale.z === 1 ) {
|
|
141
|
+
|
|
142
|
+
this.matrixWorldInverse.copy( this.matrixWorld ).invert();
|
|
143
|
+
|
|
144
|
+
} else {
|
|
145
|
+
|
|
146
|
+
this.matrixWorldInverse.compose( _position, _quaternion, _scale.set( 1, 1, 1 ) ).invert();
|
|
147
|
+
|
|
148
|
+
}
|
|
119
149
|
|
|
120
150
|
}
|
|
121
151
|
|
|
@@ -203,19 +203,38 @@ class CubeCamera extends Object3D {
|
|
|
203
203
|
|
|
204
204
|
renderTarget.texture.generateMipmaps = false;
|
|
205
205
|
|
|
206
|
+
// https://github.com/mrdoob/three.js/issues/31413#issuecomment-3095966812
|
|
207
|
+
|
|
208
|
+
let reversedDepthBuffer = false;
|
|
209
|
+
|
|
210
|
+
if ( renderer.isWebGLRenderer === true ) {
|
|
211
|
+
|
|
212
|
+
reversedDepthBuffer = renderer.state.buffers.depth.getReversed();
|
|
213
|
+
|
|
214
|
+
} else {
|
|
215
|
+
|
|
216
|
+
reversedDepthBuffer = renderer.reversedDepthBuffer;
|
|
217
|
+
|
|
218
|
+
}
|
|
219
|
+
|
|
206
220
|
renderer.setRenderTarget( renderTarget, 0, activeMipmapLevel );
|
|
221
|
+
if ( reversedDepthBuffer && renderer.autoClear === false ) renderer.clearDepth();
|
|
207
222
|
renderer.render( scene, cameraPX );
|
|
208
223
|
|
|
209
224
|
renderer.setRenderTarget( renderTarget, 1, activeMipmapLevel );
|
|
225
|
+
if ( reversedDepthBuffer && renderer.autoClear === false ) renderer.clearDepth();
|
|
210
226
|
renderer.render( scene, cameraNX );
|
|
211
227
|
|
|
212
228
|
renderer.setRenderTarget( renderTarget, 2, activeMipmapLevel );
|
|
229
|
+
if ( reversedDepthBuffer && renderer.autoClear === false ) renderer.clearDepth();
|
|
213
230
|
renderer.render( scene, cameraPY );
|
|
214
231
|
|
|
215
232
|
renderer.setRenderTarget( renderTarget, 3, activeMipmapLevel );
|
|
233
|
+
if ( reversedDepthBuffer && renderer.autoClear === false ) renderer.clearDepth();
|
|
216
234
|
renderer.render( scene, cameraNY );
|
|
217
235
|
|
|
218
236
|
renderer.setRenderTarget( renderTarget, 4, activeMipmapLevel );
|
|
237
|
+
if ( reversedDepthBuffer && renderer.autoClear === false ) renderer.clearDepth();
|
|
219
238
|
renderer.render( scene, cameraPZ );
|
|
220
239
|
|
|
221
240
|
// mipmaps are generated during the last call of render()
|
|
@@ -224,6 +243,7 @@ class CubeCamera extends Object3D {
|
|
|
224
243
|
renderTarget.texture.generateMipmaps = generateMipmaps;
|
|
225
244
|
|
|
226
245
|
renderer.setRenderTarget( renderTarget, 5, activeMipmapLevel );
|
|
246
|
+
if ( reversedDepthBuffer && renderer.autoClear === false ) renderer.clearDepth();
|
|
227
247
|
renderer.render( scene, cameraNZ );
|
|
228
248
|
|
|
229
249
|
renderer.setRenderTarget( currentRenderTarget, currentActiveCubeFace, currentActiveMipmapLevel );
|
package/src/constants.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const REVISION = '
|
|
1
|
+
export const REVISION = '183';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Represents mouse buttons and interaction types in context of controls.
|
|
@@ -155,6 +155,14 @@ export const MultiplyBlending = 4;
|
|
|
155
155
|
*/
|
|
156
156
|
export const CustomBlending = 5;
|
|
157
157
|
|
|
158
|
+
/**
|
|
159
|
+
* Represents material blending.
|
|
160
|
+
*
|
|
161
|
+
* @type {number}
|
|
162
|
+
* @constant
|
|
163
|
+
*/
|
|
164
|
+
export const MaterialBlending = 6;
|
|
165
|
+
|
|
158
166
|
/**
|
|
159
167
|
* A `source + destination` blending equation.
|
|
160
168
|
*
|
|
@@ -1160,6 +1168,17 @@ export const InterpolateLinear = 2301;
|
|
|
1160
1168
|
*/
|
|
1161
1169
|
export const InterpolateSmooth = 2302;
|
|
1162
1170
|
|
|
1171
|
+
/**
|
|
1172
|
+
* Bezier interpolation mode for keyframe tracks.
|
|
1173
|
+
*
|
|
1174
|
+
* Uses cubic Bezier curves with explicit 2D control points.
|
|
1175
|
+
* Requires tangent data to be set on the track.
|
|
1176
|
+
*
|
|
1177
|
+
* @type {number}
|
|
1178
|
+
* @constant
|
|
1179
|
+
*/
|
|
1180
|
+
export const InterpolateBezier = 2303;
|
|
1181
|
+
|
|
1163
1182
|
/**
|
|
1164
1183
|
* Zero curvature ending for animations.
|
|
1165
1184
|
*
|
|
@@ -1683,6 +1702,16 @@ export const InterpolationSamplingMode = {
|
|
|
1683
1702
|
EITHER: 'either'
|
|
1684
1703
|
};
|
|
1685
1704
|
|
|
1705
|
+
/**
|
|
1706
|
+
* Compatibility flags for features that may not be supported across all platforms.
|
|
1707
|
+
*
|
|
1708
|
+
* @type {Object}
|
|
1709
|
+
* @constant
|
|
1710
|
+
*/
|
|
1711
|
+
export const Compatibility = {
|
|
1712
|
+
TEXTURE_COMPARE: 'depthTextureCompare'
|
|
1713
|
+
};
|
|
1714
|
+
|
|
1686
1715
|
/**
|
|
1687
1716
|
* This type represents mouse buttons and interaction types in context of controls.
|
|
1688
1717
|
*
|
package/src/core/Clock.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
|
+
import { warn } from '../utils.js';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Class for keeping track of time.
|
|
5
|
+
*
|
|
6
|
+
* @deprecated since r183.
|
|
3
7
|
*/
|
|
4
8
|
class Clock {
|
|
5
9
|
|
|
6
10
|
/**
|
|
7
11
|
* Constructs a new clock.
|
|
8
12
|
*
|
|
13
|
+
* @deprecated since 183.
|
|
9
14
|
* @param {boolean} [autoStart=true] - Whether to automatically start the clock when
|
|
10
15
|
* `getDelta()` is called for the first time.
|
|
11
16
|
*/
|
|
@@ -53,6 +58,8 @@ class Clock {
|
|
|
53
58
|
*/
|
|
54
59
|
this.running = false;
|
|
55
60
|
|
|
61
|
+
warn( 'THREE.Clock: This module has been deprecated. Please use THREE.Timer instead.' ); // @deprecated, r183
|
|
62
|
+
|
|
56
63
|
}
|
|
57
64
|
|
|
58
65
|
/**
|