super-three 0.184.0 → 0.185.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/three.cjs +1260 -927
- package/build/three.core.js +1104 -829
- package/build/three.core.min.js +1 -1
- package/build/three.module.js +156 -98
- package/build/three.module.min.js +1 -1
- package/build/three.tsl.js +11 -4
- package/build/three.tsl.min.js +1 -1
- package/build/three.webgpu.js +7538 -3367
- package/build/three.webgpu.min.js +1 -1
- package/build/three.webgpu.nodes.js +7538 -3366
- package/build/three.webgpu.nodes.min.js +1 -1
- package/examples/jsm/Addons.js +3 -0
- package/examples/jsm/controls/ArcballControls.js +6 -2
- package/examples/jsm/controls/FirstPersonControls.js +79 -42
- package/examples/jsm/controls/TransformControls.js +68 -15
- package/examples/jsm/csm/CSMFrustum.js +31 -6
- package/examples/jsm/csm/CSMShadowNode.js +4 -1
- package/examples/jsm/effects/AsciiEffect.js +14 -1
- package/examples/jsm/exporters/DRACOExporter.js +27 -6
- package/examples/jsm/exporters/GLTFExporter.js +114 -12
- package/examples/jsm/exporters/PLYExporter.js +286 -73
- package/examples/jsm/exporters/USDZExporter.js +347 -112
- package/examples/jsm/generators/CityGenerator.js +346 -0
- package/examples/jsm/generators/ForestGenerator.js +347 -0
- package/examples/jsm/generators/TerrainGenerator.js +504 -0
- package/examples/jsm/generators/TreeGenerator.js +377 -0
- package/examples/jsm/generators/city/SidewalkGenerator.js +253 -0
- package/examples/jsm/generators/city/SkyscraperGenerator.js +1357 -0
- package/examples/jsm/geometries/LoftGeometry.js +355 -0
- package/examples/jsm/helpers/LightProbeGridHelper.js +1 -1
- package/examples/jsm/helpers/LightProbeHelper.js +5 -4
- package/examples/jsm/helpers/ViewHelper.js +16 -6
- package/examples/jsm/inspector/Inspector.js +53 -15
- package/examples/jsm/inspector/RendererInspector.js +152 -36
- package/examples/jsm/inspector/extensions/tsl-graph/TSLGraphEditor.js +1 -1
- package/examples/jsm/inspector/extensions/tsl-graph/TSLGraphLoader.js +1 -1
- package/examples/jsm/inspector/tabs/Console.js +200 -18
- package/examples/jsm/inspector/tabs/Memory.js +8 -0
- package/examples/jsm/inspector/tabs/Parameters.js +64 -4
- package/examples/jsm/inspector/tabs/Performance.js +21 -6
- package/examples/jsm/inspector/tabs/Settings.js +51 -9
- package/examples/jsm/inspector/tabs/Timeline.js +178 -93
- package/examples/jsm/inspector/tabs/Viewer.js +628 -16
- package/examples/jsm/inspector/ui/Graph.js +162 -25
- package/examples/jsm/inspector/ui/Item.js +92 -13
- package/examples/jsm/inspector/ui/List.js +1 -1
- package/examples/jsm/inspector/ui/Profiler.js +90 -45
- package/examples/jsm/inspector/ui/Style.js +1788 -1401
- package/examples/jsm/inspector/ui/Tab.js +5 -3
- package/examples/jsm/inspector/ui/Values.js +71 -6
- package/examples/jsm/inspector/ui/utils.js +130 -10
- package/examples/jsm/libs/basis/README.md +0 -1
- package/examples/jsm/libs/demuxer_mp4.js +3 -3
- package/examples/jsm/libs/draco/README.md +0 -1
- package/examples/jsm/libs/meshopt_clusterizer.module.js +421 -0
- package/examples/jsm/libs/meshopt_simplifier.module.js +627 -0
- package/examples/jsm/libs/mikktspace.module.js +34 -9
- package/examples/jsm/lighting/ClusteredLighting.js +55 -0
- package/examples/jsm/lighting/LightProbeGrid.js +106 -76
- package/examples/jsm/lines/LineMaterial.js +38 -15
- package/examples/jsm/lines/LineSegments2.js +8 -0
- package/examples/jsm/lines/webgpu/LineSegments2.js +8 -0
- package/examples/jsm/loaders/3DMLoader.js +1 -1
- package/examples/jsm/loaders/DRACOLoader.js +46 -13
- package/examples/jsm/loaders/EXRLoader.js +27 -55
- package/examples/jsm/loaders/HDRLoader.js +6 -28
- package/examples/jsm/loaders/KTX2Loader.js +31 -12
- package/examples/jsm/loaders/LDrawLoader.js +8 -8
- package/examples/jsm/loaders/LUT3dlLoader.js +2 -2
- package/examples/jsm/loaders/LUTCubeLoader.js +2 -2
- package/examples/jsm/loaders/LWOLoader.js +4 -0
- package/examples/jsm/loaders/LottieLoader.js +1 -1
- package/examples/jsm/loaders/MaterialXLoader.js +31 -9
- package/examples/jsm/loaders/NRRDLoader.js +3 -3
- package/examples/jsm/loaders/PCDLoader.js +7 -7
- package/examples/jsm/loaders/PLYLoader.js +218 -55
- package/examples/jsm/loaders/SVGLoader.js +547 -495
- package/examples/jsm/loaders/TTFLoader.js +1 -1
- package/examples/jsm/loaders/USDLoader.js +33 -9
- package/examples/jsm/loaders/VRMLLoader.js +1 -1
- package/examples/jsm/loaders/usd/USDAParser.js +93 -20
- package/examples/jsm/loaders/usd/USDCParser.js +1 -1
- package/examples/jsm/loaders/usd/USDComposer.js +52 -19
- package/examples/jsm/misc/TileCreasedNormalsPlugin.js +270 -0
- package/examples/jsm/misc/Volume.js +2 -2
- package/examples/jsm/objects/GroundedSkybox.js +1 -1
- package/examples/jsm/objects/Reflector.js +2 -3
- package/examples/jsm/objects/Water2Mesh.js +1 -1
- package/examples/jsm/physics/AmmoPhysics.js +15 -8
- package/examples/jsm/physics/RapierPhysics.js +27 -2
- package/examples/jsm/shaders/VolumeShader.js +31 -44
- package/examples/jsm/transpiler/GLSLDecoder.js +6 -6
- package/examples/jsm/transpiler/Linker.js +1 -1
- package/examples/jsm/tsl/display/BloomNode.js +59 -19
- package/examples/jsm/tsl/display/DepthOfFieldNode.js +2 -2
- package/examples/jsm/tsl/display/FXAANode.js +11 -12
- package/examples/jsm/tsl/display/GTAONode.js +34 -13
- package/examples/jsm/tsl/display/GodraysNode.js +1 -1
- package/examples/jsm/tsl/display/ImportanceSampledEnvironment.js +560 -0
- package/examples/jsm/tsl/display/PixelationPassNode.js +2 -2
- package/examples/jsm/tsl/display/RecurrentDenoiseNode.js +912 -0
- package/examples/jsm/tsl/display/SSAAPassNode.js +13 -25
- package/examples/jsm/tsl/display/SSGINode.js +89 -39
- package/examples/jsm/tsl/display/SSRNode.js +829 -132
- package/examples/jsm/tsl/display/SSSNode.js +2 -2
- package/examples/jsm/tsl/display/TemporalReprojectNode.js +1023 -0
- package/examples/jsm/tsl/lighting/ClusteredLightsNode.js +622 -0
- package/examples/jsm/tsl/lighting/DynamicLightsNode.js +1 -1
- package/examples/jsm/tsl/math/curlNoise.js +107 -0
- package/examples/jsm/tsl/shadows/TileShadowNode.js +1 -1
- package/examples/jsm/tsl/shadows/TileShadowNodeHelper.js +3 -3
- package/examples/jsm/tsl/utils/GroundedSkybox.js +62 -0
- package/examples/jsm/tsl/utils/RNoise.js +51 -0
- package/examples/jsm/tsl/utils/SpecularHelpers.js +325 -0
- package/examples/jsm/utils/BufferGeometryUtils.js +126 -59
- package/examples/jsm/utils/GeometryCompressionUtils.js +1 -1
- package/examples/jsm/utils/SceneOptimizer.js +1 -1
- package/examples/jsm/webxr/ARButton.js +1 -1
- package/examples/jsm/webxr/WebGLXRFallback.js +89 -0
- package/examples/jsm/webxr/XRControllerModelFactory.js +2 -2
- package/package.json +7 -7
- package/src/Three.TSL.js +10 -3
- package/src/Three.WebGPU.js +4 -0
- package/src/animation/AnimationAction.js +15 -11
- package/src/animation/AnimationClip.js +0 -139
- package/src/animation/KeyframeTrack.js +2 -2
- package/src/animation/PropertyBinding.js +2 -2
- package/src/cameras/Camera.js +2 -2
- package/src/cameras/StereoCamera.js +5 -2
- package/src/constants.js +1 -1
- package/src/core/BufferGeometry.js +29 -7
- package/src/core/Object3D.js +17 -7
- package/src/core/Raycaster.js +1 -1
- package/src/core/RenderTarget.js +15 -2
- package/src/extras/PMREMGenerator.js +6 -4
- package/src/extras/TextureUtils.js +1 -1
- package/src/extras/core/ShapePath.js +149 -160
- package/src/geometries/SphereGeometry.js +8 -3
- package/src/helpers/DirectionalLightHelper.js +2 -0
- package/src/helpers/HemisphereLightHelper.js +2 -0
- package/src/helpers/PointLightHelper.js +2 -0
- package/src/helpers/SpotLightHelper.js +1 -1
- package/src/loaders/DataTextureLoader.js +69 -38
- package/src/loaders/LoadingManager.js +5 -0
- package/src/loaders/MaterialLoader.js +36 -266
- package/src/loaders/ObjectLoader.js +3 -1
- package/src/materials/LineBasicMaterial.js +4 -0
- package/src/materials/Material.js +196 -1
- package/src/materials/MeshBasicMaterial.js +24 -0
- package/src/materials/MeshDepthMaterial.js +10 -0
- package/src/materials/MeshDistanceMaterial.js +10 -0
- package/src/materials/MeshLambertMaterial.js +40 -1
- package/src/materials/MeshMatcapMaterial.js +25 -1
- package/src/materials/MeshNormalMaterial.js +9 -1
- package/src/materials/MeshPhongMaterial.js +40 -1
- package/src/materials/MeshPhysicalMaterial.js +38 -0
- package/src/materials/MeshStandardMaterial.js +42 -1
- package/src/materials/MeshToonMaterial.js +34 -1
- package/src/materials/PointsMaterial.js +7 -0
- package/src/materials/ShaderMaterial.js +86 -0
- package/src/materials/SpriteMaterial.js +7 -0
- package/src/materials/nodes/Line2NodeMaterial.js +378 -322
- package/src/materials/nodes/MeshBasicNodeMaterial.js +2 -2
- package/src/materials/nodes/MeshNormalNodeMaterial.js +2 -2
- package/src/materials/nodes/MeshPhongNodeMaterial.js +0 -9
- package/src/materials/nodes/MeshPhysicalNodeMaterial.js +0 -30
- package/src/materials/nodes/MeshSSSNodeMaterial.js +0 -13
- package/src/materials/nodes/MeshStandardNodeMaterial.js +0 -11
- package/src/materials/nodes/NodeMaterial.js +115 -71
- package/src/materials/nodes/SpriteNodeMaterial.js +0 -10
- package/src/materials/nodes/manager/NodeMaterialObserver.js +49 -20
- package/src/math/Box3.js +5 -0
- package/src/math/FrustumArray.js +103 -133
- package/src/math/Interpolant.js +1 -1
- package/src/math/MathUtils.js +2 -2
- package/src/math/Matrix3.js +11 -0
- package/src/math/Matrix4.js +28 -3
- package/src/math/Vector2.js +2 -2
- package/src/math/Vector3.js +2 -2
- package/src/math/Vector4.js +2 -2
- package/src/math/interpolants/BezierInterpolant.js +4 -6
- package/src/nodes/Nodes.js +2 -5
- package/src/nodes/TSL.js +8 -6
- package/src/nodes/accessors/Arrays.js +4 -4
- package/src/nodes/accessors/Batch.js +108 -0
- package/src/nodes/accessors/Bitangent.js +2 -2
- package/src/nodes/accessors/BufferAttributeNode.js +13 -2
- package/src/nodes/accessors/Camera.js +7 -7
- package/src/nodes/accessors/ClippingNode.js +1 -1
- package/src/nodes/accessors/Instance.js +264 -0
- package/src/nodes/accessors/MaterialNode.js +18 -2
- package/src/nodes/accessors/MaterialProperties.js +4 -3
- package/src/nodes/accessors/{MorphNode.js → Morph.js} +99 -112
- package/src/nodes/accessors/Normal.js +13 -13
- package/src/nodes/accessors/Position.js +5 -1
- package/src/nodes/accessors/ReferenceNode.js +1 -0
- package/src/nodes/accessors/ReflectVector.js +3 -3
- package/src/nodes/accessors/SceneProperties.js +1 -1
- package/src/nodes/accessors/Skinning.js +263 -0
- package/src/nodes/accessors/StorageBufferNode.js +2 -2
- package/src/nodes/accessors/StorageTexture3DNode.js +100 -0
- package/src/nodes/accessors/StorageTextureNode.js +39 -7
- package/src/nodes/accessors/Tangent.js +4 -4
- package/src/nodes/accessors/TextureNode.js +60 -5
- package/src/nodes/code/FunctionNode.js +2 -16
- package/src/nodes/core/MRTNode.js +7 -2
- package/src/nodes/core/Node.js +39 -2
- package/src/nodes/core/NodeBuilder.js +201 -41
- package/src/nodes/core/NodeUtils.js +13 -13
- package/src/nodes/core/OutputStructNode.js +1 -1
- package/src/nodes/core/OverrideContextNode.js +153 -0
- package/src/nodes/core/PropertyNode.js +51 -5
- package/src/nodes/core/StackNode.js +56 -34
- package/src/nodes/core/StructNode.js +4 -6
- package/src/nodes/core/StructTypeNode.js +6 -6
- package/src/nodes/core/VarNode.js +8 -0
- package/src/nodes/core/VaryingNode.js +12 -2
- package/src/nodes/display/BlendModes.js +1 -41
- package/src/nodes/display/BumpMapNode.js +6 -1
- package/src/nodes/display/ColorAdjustment.js +10 -9
- package/src/nodes/display/FrontFacingNode.js +38 -9
- package/src/nodes/display/NormalMapNode.js +2 -2
- package/src/nodes/display/PassNode.js +35 -43
- package/src/nodes/display/PremultiplyAlphaFunctions.js +39 -0
- package/src/nodes/display/RenderOutputNode.js +12 -3
- package/src/nodes/functions/VolumetricLightingModel.js +40 -7
- package/src/nodes/gpgpu/WorkgroupInfoNode.js +1 -1
- package/src/nodes/lighting/EnvironmentNode.js +2 -2
- package/src/nodes/lighting/IESSpotLightNode.js +40 -2
- package/src/nodes/lighting/LightingContextNode.js +10 -2
- package/src/nodes/lighting/LightsNode.js +90 -37
- package/src/nodes/lighting/PointShadowNode.js +6 -1
- package/src/nodes/lighting/ShadowFilterNode.js +21 -52
- package/src/nodes/lighting/ShadowNode.js +34 -14
- package/src/nodes/materialx/lib/mx_noise.js +2 -2
- package/src/nodes/math/ConditionalNode.js +3 -3
- package/src/nodes/math/MathNode.js +39 -11
- package/src/nodes/math/OperatorNode.js +23 -23
- package/src/nodes/parsers/GLSLNodeFunction.js +1 -1
- package/src/nodes/pmrem/PMREMNode.js +33 -2
- package/src/nodes/tsl/TSLCore.js +63 -18
- package/src/nodes/utils/EquirectUV.js +30 -5
- package/src/nodes/utils/FunctionOverloadingNode.js +1 -1
- package/src/nodes/utils/Packing.js +35 -4
- package/src/nodes/utils/RTTNode.js +40 -24
- package/src/nodes/utils/ReflectorNode.js +1 -0
- package/src/nodes/utils/StorageArrayElementNode.js +1 -1
- package/src/objects/BatchedMesh.js +22 -14
- package/src/objects/InstancedMesh.js +0 -11
- package/src/objects/Skeleton.js +0 -9
- package/src/renderers/WebGLRenderer.js +19 -15
- package/src/renderers/common/Backend.js +49 -5
- package/src/renderers/common/Bindings.js +114 -45
- package/src/renderers/common/Buffer.js +9 -0
- package/src/renderers/common/ClippingContext.js +10 -2
- package/src/renderers/common/Info.js +63 -22
- package/src/renderers/common/Lighting.js +53 -5
- package/src/renderers/common/RenderList.js +41 -4
- package/src/renderers/common/RenderObject.js +73 -13
- package/src/renderers/common/Renderer.js +281 -108
- package/src/renderers/common/Sampler.js +16 -48
- package/src/renderers/common/Textures.js +32 -5
- package/src/renderers/common/TimestampQueryPool.js +1 -1
- package/src/renderers/common/UniformsGroup.js +31 -9
- package/src/renderers/common/XRManager.js +340 -22
- package/src/renderers/common/extras/PMREMGenerator.js +15 -38
- package/src/renderers/common/nodes/NodeBuilderState.js +9 -1
- package/src/renderers/common/nodes/NodeLibrary.js +4 -4
- package/src/renderers/common/nodes/NodeManager.js +63 -14
- package/src/renderers/common/nodes/NodeUniformBuffer.js +13 -0
- package/src/renderers/shaders/ShaderChunk/common.glsl.js +13 -4
- package/src/renderers/shaders/ShaderChunk/defaultnormal_vertex.glsl.js +0 -6
- package/src/renderers/shaders/ShaderChunk/envmap_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/envmap_physical_pars_fragment.glsl.js +2 -2
- package/src/renderers/shaders/ShaderChunk/envmap_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/lights_fragment_begin.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/lights_pars_begin.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/normal_fragment_begin.glsl.js +2 -2
- package/src/renderers/shaders/ShaderChunk/normal_vertex.glsl.js +6 -0
- package/src/renderers/shaders/ShaderChunk/shadowmap_vertex.glsl.js +1 -1
- package/src/renderers/shaders/ShaderChunk/transmission_fragment.glsl.js +1 -1
- package/src/renderers/shaders/ShaderLib/distance.glsl.js +1 -1
- package/src/renderers/webgl/WebGLOutput.js +2 -1
- package/src/renderers/webgl/WebGLProgram.js +5 -4
- package/src/renderers/webgl/WebGLPrograms.js +12 -5
- package/src/renderers/webgl/WebGLRenderLists.js +9 -1
- package/src/renderers/webgl/WebGLShaderCache.js +5 -11
- package/src/renderers/webgl/WebGLTextures.js +20 -7
- package/src/renderers/webgl/WebGLUniformsGroups.js +66 -38
- package/src/renderers/webgl-fallback/WebGLBackend.js +84 -25
- package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +138 -8
- package/src/renderers/webgl-fallback/utils/WebGLAttributeUtils.js +1 -1
- package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +52 -22
- package/src/renderers/webgl-fallback/utils/WebGLUtils.js +4 -2
- package/src/renderers/webgpu/WebGPUBackend.js +480 -169
- package/src/renderers/webgpu/descriptors/GPUBindGroupDescriptor.js +48 -0
- package/src/renderers/webgpu/descriptors/GPUBufferDescriptor.js +57 -0
- package/src/renderers/webgpu/descriptors/GPUCommandEncoderDescriptor.js +30 -0
- package/src/renderers/webgpu/descriptors/GPUComputePassDescriptor.js +38 -0
- package/src/renderers/webgpu/descriptors/GPUComputePipelineDescriptor.js +48 -0
- package/src/renderers/webgpu/descriptors/GPUCopyExternalImageDestInfo.js +47 -0
- package/src/renderers/webgpu/descriptors/GPUCopyExternalImageSourceInfo.js +50 -0
- package/src/renderers/webgpu/descriptors/GPUExtent3D.js +51 -0
- package/src/renderers/webgpu/descriptors/GPUPipelineLayoutDescriptor.js +39 -0
- package/src/renderers/webgpu/descriptors/GPUQuerySetDescriptor.js +47 -0
- package/src/renderers/webgpu/descriptors/GPURenderBundleEncoderDescriptor.js +74 -0
- package/src/renderers/webgpu/descriptors/GPURenderPassColorAttachment.js +72 -0
- package/src/renderers/webgpu/descriptors/GPURenderPassDepthStencilAttachment.js +99 -0
- package/src/renderers/webgpu/descriptors/GPURenderPassDescriptor.js +72 -0
- package/src/renderers/webgpu/descriptors/GPURenderPassTimestampWrites.js +49 -0
- package/src/renderers/webgpu/descriptors/GPURenderPipelineDescriptor.js +130 -0
- package/src/renderers/webgpu/descriptors/GPUSamplerDescriptor.js +119 -0
- package/src/renderers/webgpu/descriptors/GPUShaderModuleDescriptor.js +46 -0
- package/src/renderers/webgpu/descriptors/GPUTexelCopyBufferInfo.js +57 -0
- package/src/renderers/webgpu/descriptors/GPUTexelCopyBufferLayout.js +48 -0
- package/src/renderers/webgpu/descriptors/GPUTexelCopyTextureInfo.js +61 -0
- package/src/renderers/webgpu/descriptors/GPUTextureDescriptor.js +99 -0
- package/src/renderers/webgpu/descriptors/GPUTextureViewDescriptor.js +108 -0
- package/src/renderers/webgpu/nodes/StandardNodeLibrary.js +0 -1
- package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +164 -7
- package/src/renderers/webgpu/nodes/WGSLNodeFunction.js +1 -1
- package/src/renderers/webgpu/utils/WebGPUAttributeUtils.js +98 -38
- package/src/renderers/webgpu/utils/WebGPUBindingUtils.js +72 -68
- package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +164 -69
- package/src/renderers/webgpu/utils/WebGPUTexturePassUtils.js +158 -95
- package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +297 -141
- package/src/renderers/webgpu/utils/WebGPUTimestampQueryPool.js +33 -18
- package/src/renderers/webgpu/utils/WebGPUUtils.js +38 -3
- package/src/textures/DepthTexture.js +1 -1
- package/src/textures/ExternalTexture.js +0 -3
- package/examples/fonts/LICENSE +0 -13
- package/examples/fonts/MPLUSRounded1c/MPLUSRounded1c-Regular.typeface.json.zip +0 -0
- package/examples/fonts/MPLUSRounded1c/OFL.txt +0 -91
- package/examples/fonts/README.md +0 -11
- package/examples/fonts/droid/NOTICE +0 -190
- package/examples/fonts/droid/README.txt +0 -18
- package/examples/fonts/droid/droid_sans_bold.typeface.json +0 -1
- package/examples/fonts/droid/droid_sans_mono_regular.typeface.json +0 -1
- package/examples/fonts/droid/droid_sans_regular.typeface.json +0 -1
- package/examples/fonts/droid/droid_serif_bold.typeface.json +0 -1
- package/examples/fonts/droid/droid_serif_regular.typeface.json +0 -1
- package/examples/fonts/gentilis_bold.typeface.json +0 -1
- package/examples/fonts/gentilis_regular.typeface.json +0 -1
- package/examples/fonts/helvetiker_bold.typeface.json +0 -1
- package/examples/fonts/helvetiker_regular.typeface.json +0 -1
- package/examples/fonts/optimer_bold.typeface.json +0 -1
- package/examples/fonts/optimer_regular.typeface.json +0 -1
- package/examples/fonts/ttf/README.md +0 -9
- package/examples/fonts/ttf/kenpixel.ttf +0 -0
- package/examples/jsm/inspector/extensions/extensions.json +0 -6
- package/examples/jsm/libs/ammo.wasm.js +0 -822
- package/examples/jsm/libs/ammo.wasm.wasm +0 -0
- package/examples/jsm/libs/draco/draco_encoder.js +0 -33
- package/examples/jsm/libs/draco/gltf/draco_encoder.js +0 -33
- package/examples/jsm/libs/lottie_canvas.module.js +0 -14849
- package/examples/jsm/libs/opentype.module.js +0 -14506
- package/examples/jsm/libs/rhino3dm/rhino3dm.js +0 -21
- package/examples/jsm/libs/rhino3dm/rhino3dm.module.js +0 -16
- package/examples/jsm/libs/rhino3dm/rhino3dm.wasm +0 -0
- package/examples/jsm/lighting/TiledLighting.js +0 -42
- package/examples/jsm/tsl/display/AnamorphicNode.js +0 -293
- package/examples/jsm/tsl/lighting/TiledLightsNode.js +0 -442
- package/src/nodes/accessors/BatchNode.js +0 -163
- package/src/nodes/accessors/InstanceNode.js +0 -349
- package/src/nodes/accessors/InstancedMeshNode.js +0 -50
- package/src/nodes/accessors/SkinningNode.js +0 -328
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
export class Graph {
|
|
3
2
|
|
|
4
3
|
constructor( maxPoints = 512 ) {
|
|
@@ -8,20 +7,37 @@ export class Graph {
|
|
|
8
7
|
this.limit = 0;
|
|
9
8
|
this.limitIndex = 0;
|
|
10
9
|
|
|
11
|
-
this.domElement = document.
|
|
12
|
-
this.domElement.setAttribute( 'class', 'graph-
|
|
10
|
+
this.domElement = document.createElement( 'canvas' );
|
|
11
|
+
this.domElement.setAttribute( 'class', 'graph-canvas' );
|
|
12
|
+
|
|
13
|
+
this.ctx = this.domElement.getContext( '2d' );
|
|
14
|
+
|
|
15
|
+
this.width = 0;
|
|
16
|
+
this.height = 0;
|
|
17
|
+
this.devicePixelRatio = window.devicePixelRatio || 1;
|
|
13
18
|
|
|
14
19
|
}
|
|
15
20
|
|
|
16
|
-
|
|
21
|
+
resize( width, height ) {
|
|
22
|
+
|
|
23
|
+
this.width = width;
|
|
24
|
+
this.height = height;
|
|
17
25
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
this.
|
|
26
|
+
this.devicePixelRatio = window.devicePixelRatio || 1;
|
|
27
|
+
this.domElement.width = width * this.devicePixelRatio;
|
|
28
|
+
this.domElement.height = height * this.devicePixelRatio;
|
|
29
|
+
|
|
30
|
+
this.draw();
|
|
31
|
+
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
addLine( id, color ) {
|
|
23
35
|
|
|
24
|
-
this.lines[ id ] = {
|
|
36
|
+
this.lines[ id ] = {
|
|
37
|
+
color: color,
|
|
38
|
+
resolved: null,
|
|
39
|
+
points: []
|
|
40
|
+
};
|
|
25
41
|
|
|
26
42
|
}
|
|
27
43
|
|
|
@@ -55,41 +71,162 @@ export class Graph {
|
|
|
55
71
|
|
|
56
72
|
update() {
|
|
57
73
|
|
|
58
|
-
const
|
|
59
|
-
const
|
|
60
|
-
if ( svgWidth === 0 ) return;
|
|
74
|
+
const width = this.domElement.clientWidth;
|
|
75
|
+
const height = this.domElement.clientHeight;
|
|
61
76
|
|
|
62
|
-
|
|
77
|
+
if ( width === 0 || height === 0 ) return;
|
|
78
|
+
|
|
79
|
+
if ( width !== this.width || height !== this.height ) {
|
|
80
|
+
|
|
81
|
+
this.resize( width, height );
|
|
82
|
+
|
|
83
|
+
} else {
|
|
84
|
+
|
|
85
|
+
this.draw();
|
|
86
|
+
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if ( this.limitIndex ++ > this.maxPoints ) {
|
|
90
|
+
|
|
91
|
+
this.resetLimit();
|
|
92
|
+
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
draw() {
|
|
98
|
+
|
|
99
|
+
const ctx = this.ctx;
|
|
100
|
+
const dpr = this.devicePixelRatio;
|
|
101
|
+
const width = this.width;
|
|
102
|
+
const height = this.height;
|
|
103
|
+
|
|
104
|
+
ctx.clearRect( 0, 0, width * dpr, height * dpr );
|
|
105
|
+
|
|
106
|
+
if ( width === 0 || height === 0 ) return;
|
|
107
|
+
|
|
108
|
+
ctx.save();
|
|
109
|
+
ctx.scale( dpr, dpr );
|
|
110
|
+
|
|
111
|
+
const pointStep = width / ( this.maxPoints - 1 );
|
|
63
112
|
|
|
64
113
|
for ( const id in this.lines ) {
|
|
65
114
|
|
|
66
115
|
const line = this.lines[ id ];
|
|
116
|
+
if ( line.points.length === 0 ) continue;
|
|
117
|
+
|
|
118
|
+
if ( ! line.resolved ) {
|
|
119
|
+
|
|
120
|
+
line.resolved = this._resolveColor( line.color );
|
|
121
|
+
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const resolved = line.resolved;
|
|
125
|
+
const drawColor = resolved ? resolved.color : '#ffffff';
|
|
126
|
+
const offset = width - ( ( line.points.length - 1 ) * pointStep );
|
|
127
|
+
|
|
128
|
+
// 1. Draw fill (with opacity)
|
|
129
|
+
let fillStyle = drawColor;
|
|
130
|
+
|
|
131
|
+
if ( height > 0 ) {
|
|
67
132
|
|
|
68
|
-
|
|
133
|
+
const gradient = ctx.createLinearGradient( 0, 0, 0, height );
|
|
134
|
+
gradient.addColorStop( 0, drawColor );
|
|
135
|
+
gradient.addColorStop( 1, ( resolved && resolved.transparent ) || 'rgba(0,0,0,0)' );
|
|
136
|
+
fillStyle = gradient;
|
|
137
|
+
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
ctx.fillStyle = fillStyle;
|
|
141
|
+
ctx.globalAlpha = 0.4;
|
|
142
|
+
ctx.beginPath();
|
|
143
|
+
ctx.moveTo( offset, height );
|
|
69
144
|
for ( let i = 0; i < line.points.length; i ++ ) {
|
|
70
145
|
|
|
71
|
-
const x = i * pointStep;
|
|
72
|
-
const y =
|
|
73
|
-
|
|
146
|
+
const x = offset + i * pointStep;
|
|
147
|
+
const y = this.limit === 0 ? height : height - ( line.points[ i ] / this.limit ) * height;
|
|
148
|
+
ctx.lineTo( x, y );
|
|
74
149
|
|
|
75
150
|
}
|
|
76
151
|
|
|
77
|
-
|
|
152
|
+
ctx.lineTo( offset + ( line.points.length - 1 ) * pointStep, height );
|
|
153
|
+
ctx.closePath();
|
|
154
|
+
ctx.fill();
|
|
155
|
+
|
|
156
|
+
// 2. Draw stroke (full opacity)
|
|
157
|
+
ctx.strokeStyle = drawColor;
|
|
158
|
+
ctx.lineWidth = 2;
|
|
159
|
+
ctx.globalAlpha = 1.0;
|
|
160
|
+
ctx.beginPath();
|
|
161
|
+
for ( let i = 0; i < line.points.length; i ++ ) {
|
|
162
|
+
|
|
163
|
+
const x = offset + i * pointStep;
|
|
164
|
+
const y = this.limit === 0 ? height : height - ( line.points[ i ] / this.limit ) * height;
|
|
165
|
+
if ( i === 0 ) {
|
|
166
|
+
|
|
167
|
+
ctx.moveTo( x, y );
|
|
168
|
+
|
|
169
|
+
} else {
|
|
78
170
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
171
|
+
ctx.lineTo( x, y );
|
|
172
|
+
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
ctx.stroke();
|
|
82
178
|
|
|
83
179
|
}
|
|
84
180
|
|
|
85
|
-
|
|
181
|
+
ctx.restore();
|
|
86
182
|
|
|
87
|
-
|
|
183
|
+
}
|
|
88
184
|
|
|
89
|
-
|
|
185
|
+
_resolveColor( color ) {
|
|
186
|
+
|
|
187
|
+
let resolved = color;
|
|
188
|
+
|
|
189
|
+
if ( color.startsWith( 'var(' ) ) {
|
|
190
|
+
|
|
191
|
+
const varName = color.slice( 4, - 1 ).trim();
|
|
192
|
+
resolved = getComputedStyle( this.domElement ).getPropertyValue( varName ).trim();
|
|
193
|
+
|
|
194
|
+
if ( ! resolved ) {
|
|
195
|
+
|
|
196
|
+
return null;
|
|
197
|
+
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
let transparentColor = 'rgba(0,0,0,0)';
|
|
203
|
+
|
|
204
|
+
if ( resolved.startsWith( '#' ) ) {
|
|
205
|
+
|
|
206
|
+
const hex = resolved.substring( 0, 7 );
|
|
207
|
+
transparentColor = hex + '00';
|
|
208
|
+
|
|
209
|
+
} else if ( resolved.startsWith( 'rgb' ) ) {
|
|
210
|
+
|
|
211
|
+
const match = resolved.match( /^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)$/ );
|
|
212
|
+
|
|
213
|
+
if ( match ) {
|
|
214
|
+
|
|
215
|
+
transparentColor = `rgba(${match[ 1 ]}, ${match[ 2 ]}, ${match[ 3 ]}, 0)`;
|
|
216
|
+
|
|
217
|
+
}
|
|
90
218
|
|
|
91
219
|
}
|
|
92
220
|
|
|
221
|
+
return {
|
|
222
|
+
color: resolved,
|
|
223
|
+
transparent: transparentColor
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
dispose() {
|
|
229
|
+
|
|
93
230
|
}
|
|
94
231
|
|
|
95
232
|
}
|
|
@@ -4,6 +4,7 @@ export class Item {
|
|
|
4
4
|
|
|
5
5
|
this.children = [];
|
|
6
6
|
this.isOpen = true;
|
|
7
|
+
this.isCollapsible = false;
|
|
7
8
|
this.childrenContainer = null;
|
|
8
9
|
this.parent = null;
|
|
9
10
|
this.domElement = document.createElement( 'div' );
|
|
@@ -13,23 +14,15 @@ export class Item {
|
|
|
13
14
|
|
|
14
15
|
this.userData = {};
|
|
15
16
|
|
|
16
|
-
this.data =
|
|
17
|
-
|
|
17
|
+
this.data = [];
|
|
18
|
+
data.forEach( ( cellData, index ) => {
|
|
18
19
|
|
|
19
20
|
const cell = document.createElement( 'div' );
|
|
20
21
|
cell.className = 'list-item-cell';
|
|
21
|
-
if ( cellData instanceof HTMLElement ) {
|
|
22
|
-
|
|
23
|
-
cell.appendChild( cellData );
|
|
24
|
-
|
|
25
|
-
} else {
|
|
26
|
-
|
|
27
|
-
cell.append( String( cellData ) );
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
22
|
this.itemRow.appendChild( cell );
|
|
32
23
|
|
|
24
|
+
this.setValue( index, cellData );
|
|
25
|
+
|
|
33
26
|
} );
|
|
34
27
|
|
|
35
28
|
this.domElement.appendChild( this.itemRow );
|
|
@@ -116,7 +109,7 @@ export class Item {
|
|
|
116
109
|
const firstCell = this.itemRow.querySelector( '.list-item-cell:first-child' );
|
|
117
110
|
let toggler = this.itemRow.querySelector( '.item-toggler' );
|
|
118
111
|
|
|
119
|
-
if ( this.children.length > 0 ) {
|
|
112
|
+
if ( this.children.length > 0 || this.isCollapsible ) {
|
|
120
113
|
|
|
121
114
|
if ( ! toggler ) {
|
|
122
115
|
|
|
@@ -140,6 +133,36 @@ export class Item {
|
|
|
140
133
|
|
|
141
134
|
}
|
|
142
135
|
|
|
136
|
+
setCollapsible( collapsible ) {
|
|
137
|
+
|
|
138
|
+
this.isCollapsible = collapsible;
|
|
139
|
+
|
|
140
|
+
if ( collapsible ) {
|
|
141
|
+
|
|
142
|
+
this.itemRow.classList.add( 'collapsible' );
|
|
143
|
+
|
|
144
|
+
if ( ! this.childrenContainer ) {
|
|
145
|
+
|
|
146
|
+
this.childrenContainer = document.createElement( 'div' );
|
|
147
|
+
this.childrenContainer.className = 'list-children-container';
|
|
148
|
+
this.childrenContainer.classList.toggle( 'closed', ! this.isOpen );
|
|
149
|
+
this.domElement.appendChild( this.childrenContainer );
|
|
150
|
+
this.itemRow.addEventListener( 'click', this.onItemClick );
|
|
151
|
+
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
} else {
|
|
155
|
+
|
|
156
|
+
this.itemRow.classList.remove( 'collapsible' );
|
|
157
|
+
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
this.updateToggler();
|
|
161
|
+
|
|
162
|
+
return this;
|
|
163
|
+
|
|
164
|
+
}
|
|
165
|
+
|
|
143
166
|
toggle() {
|
|
144
167
|
|
|
145
168
|
this.isOpen = ! this.isOpen;
|
|
@@ -167,4 +190,60 @@ export class Item {
|
|
|
167
190
|
|
|
168
191
|
}
|
|
169
192
|
|
|
193
|
+
show() {
|
|
194
|
+
|
|
195
|
+
this.domElement.style.display = '';
|
|
196
|
+
|
|
197
|
+
return this;
|
|
198
|
+
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
hide() {
|
|
202
|
+
|
|
203
|
+
this.domElement.style.display = 'none';
|
|
204
|
+
|
|
205
|
+
return this;
|
|
206
|
+
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
setValue( index, value ) {
|
|
210
|
+
|
|
211
|
+
this.data[ index ] = value;
|
|
212
|
+
|
|
213
|
+
const cell = this.itemRow.children[ index ];
|
|
214
|
+
|
|
215
|
+
if ( cell ) {
|
|
216
|
+
|
|
217
|
+
const toggler = cell.querySelector( '.item-toggler' );
|
|
218
|
+
|
|
219
|
+
cell.innerHTML = '';
|
|
220
|
+
|
|
221
|
+
if ( toggler ) {
|
|
222
|
+
|
|
223
|
+
cell.appendChild( toggler );
|
|
224
|
+
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
if ( value instanceof HTMLElement ) {
|
|
228
|
+
|
|
229
|
+
cell.appendChild( value );
|
|
230
|
+
|
|
231
|
+
} else {
|
|
232
|
+
|
|
233
|
+
cell.append( String( value ) );
|
|
234
|
+
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
return this;
|
|
240
|
+
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
getValue( index ) {
|
|
244
|
+
|
|
245
|
+
return this.data[ index ];
|
|
246
|
+
|
|
247
|
+
}
|
|
248
|
+
|
|
170
249
|
}
|
|
@@ -7,7 +7,7 @@ export class List {
|
|
|
7
7
|
this.children = [];
|
|
8
8
|
this.domElement = document.createElement( 'div' );
|
|
9
9
|
this.domElement.className = 'list-container';
|
|
10
|
-
this.domElement.style.padding = '10px';
|
|
10
|
+
this.domElement.style.padding = '5px 10px 10px 10px';
|
|
11
11
|
this.id = `list-${Math.random().toString( 36 ).slice( 2, 11 )}`;
|
|
12
12
|
this.domElement.dataset.listId = this.id;
|
|
13
13
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EventDispatcher } from 'three';
|
|
2
2
|
import { Style } from './Style.js';
|
|
3
|
+
import { Graph } from './Graph.js';
|
|
3
4
|
import { getItem, setItem } from '../Inspector.js';
|
|
4
5
|
|
|
5
6
|
export class Profiler extends EventDispatcher {
|
|
@@ -19,17 +20,29 @@ export class Profiler extends EventDispatcher {
|
|
|
19
20
|
this.maxZIndex = 1002; // Track the highest z-index for detached windows (starts at base z-index from CSS)
|
|
20
21
|
this.nextTabOriginalIndex = 0; // Track the original order of tabs as they are added
|
|
21
22
|
|
|
22
|
-
Style.init();
|
|
23
|
-
|
|
24
23
|
this.setupShell();
|
|
25
24
|
this.setupResizing();
|
|
26
25
|
|
|
26
|
+
Style.init( this.domElement );
|
|
27
|
+
|
|
27
28
|
// Setup window resize listener and update mobile status
|
|
28
29
|
this.setupWindowResizeListener();
|
|
29
30
|
|
|
30
31
|
// Setup orientation change listener for mobile devices
|
|
31
32
|
this.setupOrientationListener();
|
|
32
33
|
|
|
34
|
+
this.checkHeaderScroll();
|
|
35
|
+
|
|
36
|
+
this.panel.addEventListener( 'transitionend', ( e ) => {
|
|
37
|
+
|
|
38
|
+
if ( e.target === this.panel && ( e.propertyName === 'width' || e.propertyName === 'height' || e.propertyName === 'transform' ) ) {
|
|
39
|
+
|
|
40
|
+
this.checkHeaderScroll();
|
|
41
|
+
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
} );
|
|
45
|
+
|
|
33
46
|
}
|
|
34
47
|
|
|
35
48
|
getSize() {
|
|
@@ -180,6 +193,7 @@ export class Profiler extends EventDispatcher {
|
|
|
180
193
|
|
|
181
194
|
constrainDetachedWindows();
|
|
182
195
|
constrainMainPanel();
|
|
196
|
+
this.checkHeaderScroll();
|
|
183
197
|
|
|
184
198
|
} );
|
|
185
199
|
|
|
@@ -237,31 +251,36 @@ export class Profiler extends EventDispatcher {
|
|
|
237
251
|
setupShell() {
|
|
238
252
|
|
|
239
253
|
this.domElement = document.createElement( 'div' );
|
|
240
|
-
|
|
254
|
+
|
|
255
|
+
this.domElement.classList.add( 'three-inspector' );
|
|
241
256
|
|
|
242
257
|
this.toggleButton = document.createElement( 'button' );
|
|
243
|
-
this.toggleButton.
|
|
258
|
+
this.toggleButton.classList.add( 'profiler-toggle' );
|
|
244
259
|
this.toggleButton.innerHTML = `
|
|
245
|
-
<span
|
|
246
|
-
<span
|
|
247
|
-
<span
|
|
260
|
+
<span class="builtin-tabs-container"></span>
|
|
261
|
+
<span class="toggle-text">
|
|
262
|
+
<span class="fps-counter">-</span>
|
|
248
263
|
<span class="fps-label">FPS</span>
|
|
249
264
|
</span>
|
|
250
|
-
<span
|
|
265
|
+
<span class="toggle-icon">
|
|
251
266
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-device-ipad-horizontal-search"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M11.5 20h-6.5a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v5.5" /><path d="M9 17h2" /><path d="M18 18m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" /><path d="M20.2 20.2l1.8 1.8" /></svg>
|
|
267
|
+
<span class="console-badge-container">
|
|
268
|
+
<span class="console-badge error" style="display: none;">0</span>
|
|
269
|
+
<span class="console-badge warn" style="display: none;">0</span>
|
|
270
|
+
</span>
|
|
252
271
|
</span>
|
|
253
272
|
`;
|
|
254
273
|
this.toggleButton.onclick = () => this.togglePanel();
|
|
255
274
|
|
|
256
|
-
this.builtinTabsContainer = this.toggleButton.querySelector( '
|
|
275
|
+
this.builtinTabsContainer = this.toggleButton.querySelector( '.builtin-tabs-container' );
|
|
257
276
|
|
|
258
277
|
// Create mini-panel for builtin tabs (shown when panel is hidden)
|
|
259
278
|
this.miniPanel = document.createElement( 'div' );
|
|
260
|
-
this.miniPanel.
|
|
279
|
+
this.miniPanel.classList.add( 'profiler-mini-panel' );
|
|
261
280
|
this.miniPanel.className = 'profiler-mini-panel';
|
|
262
281
|
|
|
263
282
|
this.panel = document.createElement( 'div' );
|
|
264
|
-
this.panel.
|
|
283
|
+
this.panel.classList.add( 'profiler-panel' );
|
|
265
284
|
|
|
266
285
|
const header = document.createElement( 'div' );
|
|
267
286
|
header.className = 'profiler-header';
|
|
@@ -285,7 +304,7 @@ export class Profiler extends EventDispatcher {
|
|
|
285
304
|
controls.className = 'profiler-controls';
|
|
286
305
|
|
|
287
306
|
this.floatingBtn = document.createElement( 'button' );
|
|
288
|
-
this.floatingBtn.
|
|
307
|
+
this.floatingBtn.classList.add( 'floating-btn' );
|
|
289
308
|
this.floatingBtn.title = 'Switch to Right Side';
|
|
290
309
|
this.floatingBtn.innerHTML = '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect><line x1="15" y1="3" x2="15" y2="21"></line></svg>';
|
|
291
310
|
this.floatingBtn.onclick = () => this.togglePosition();
|
|
@@ -305,12 +324,12 @@ export class Profiler extends EventDispatcher {
|
|
|
305
324
|
}
|
|
306
325
|
|
|
307
326
|
this.maximizeBtn = document.createElement( 'button' );
|
|
308
|
-
this.maximizeBtn.
|
|
327
|
+
this.maximizeBtn.classList.add( 'maximize-btn' );
|
|
309
328
|
this.maximizeBtn.innerHTML = '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"/></svg>';
|
|
310
329
|
this.maximizeBtn.onclick = () => this.toggleMaximize();
|
|
311
330
|
|
|
312
331
|
const hideBtn = document.createElement( 'button' );
|
|
313
|
-
hideBtn.
|
|
332
|
+
hideBtn.classList.add( 'hide-panel-btn' );
|
|
314
333
|
hideBtn.textContent = '-';
|
|
315
334
|
hideBtn.onclick = () => this.togglePanel();
|
|
316
335
|
|
|
@@ -337,6 +356,12 @@ export class Profiler extends EventDispatcher {
|
|
|
337
356
|
|
|
338
357
|
}
|
|
339
358
|
|
|
359
|
+
// Create a background performance graph for the toggle button
|
|
360
|
+
this.toggleGraph = new Graph( 80 );
|
|
361
|
+
this.toggleGraph.addLine( 'fps', '#4c4c6bff' );
|
|
362
|
+
this.toggleGraph.domElement.className = 'profiler-toggle-graph';
|
|
363
|
+
this.toggleButton.appendChild( this.toggleGraph.domElement );
|
|
364
|
+
|
|
340
365
|
}
|
|
341
366
|
|
|
342
367
|
setupResizing() {
|
|
@@ -385,6 +410,7 @@ export class Profiler extends EventDispatcher {
|
|
|
385
410
|
}
|
|
386
411
|
|
|
387
412
|
this.dispatchEvent( { type: 'resize' } );
|
|
413
|
+
this.checkHeaderScroll();
|
|
388
414
|
|
|
389
415
|
};
|
|
390
416
|
|
|
@@ -430,6 +456,7 @@ export class Profiler extends EventDispatcher {
|
|
|
430
456
|
if ( this.panel.classList.contains( 'maximized' ) ) {
|
|
431
457
|
|
|
432
458
|
this.panel.classList.remove( 'maximized' );
|
|
459
|
+
this.domElement.classList.remove( 'maximized' );
|
|
433
460
|
|
|
434
461
|
// Restore size based on current position
|
|
435
462
|
if ( this.position === 'bottom' ) {
|
|
@@ -460,6 +487,7 @@ export class Profiler extends EventDispatcher {
|
|
|
460
487
|
}
|
|
461
488
|
|
|
462
489
|
this.panel.classList.add( 'maximized' );
|
|
490
|
+
this.domElement.classList.add( 'maximized' );
|
|
463
491
|
|
|
464
492
|
// Maximize based on current position
|
|
465
493
|
if ( this.position === 'bottom' ) {
|
|
@@ -752,6 +780,7 @@ export class Profiler extends EventDispatcher {
|
|
|
752
780
|
if ( this.panel.classList.contains( 'maximized' ) ) {
|
|
753
781
|
|
|
754
782
|
this.panel.classList.remove( 'maximized' );
|
|
783
|
+
this.domElement.classList.remove( 'maximized' );
|
|
755
784
|
this.maximizeBtn.innerHTML = '<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"/></svg>';
|
|
756
785
|
|
|
757
786
|
}
|
|
@@ -759,7 +788,7 @@ export class Profiler extends EventDispatcher {
|
|
|
759
788
|
// No tabs visible - set to minimum size
|
|
760
789
|
if ( this.position === 'bottom' ) {
|
|
761
790
|
|
|
762
|
-
this.panel.style.height = '
|
|
791
|
+
this.panel.style.height = '32px';
|
|
763
792
|
|
|
764
793
|
} else if ( this.position === 'right' ) {
|
|
765
794
|
|
|
@@ -778,7 +807,7 @@ export class Profiler extends EventDispatcher {
|
|
|
778
807
|
if ( this.position === 'bottom' ) {
|
|
779
808
|
|
|
780
809
|
const currentHeight = parseInt( this.panel.style.height );
|
|
781
|
-
if ( currentHeight === 38 ) {
|
|
810
|
+
if ( currentHeight === 32 || currentHeight === 38 ) {
|
|
782
811
|
|
|
783
812
|
this.panel.style.height = `${ this.lastHeightBottom }px`;
|
|
784
813
|
|
|
@@ -800,6 +829,29 @@ export class Profiler extends EventDispatcher {
|
|
|
800
829
|
}
|
|
801
830
|
|
|
802
831
|
this.dispatchEvent( { type: 'resize' } );
|
|
832
|
+
this.checkHeaderScroll();
|
|
833
|
+
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
checkHeaderScroll() {
|
|
837
|
+
|
|
838
|
+
const header = this.panel.querySelector( '.profiler-header' );
|
|
839
|
+
|
|
840
|
+
if ( header ) {
|
|
841
|
+
|
|
842
|
+
const hasScroll = header.scrollWidth > header.clientWidth + 1;
|
|
843
|
+
|
|
844
|
+
if ( hasScroll ) {
|
|
845
|
+
|
|
846
|
+
this.panel.classList.add( 'has-horizontal-scroll' );
|
|
847
|
+
|
|
848
|
+
} else {
|
|
849
|
+
|
|
850
|
+
this.panel.classList.remove( 'has-horizontal-scroll' );
|
|
851
|
+
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
}
|
|
803
855
|
|
|
804
856
|
}
|
|
805
857
|
|
|
@@ -877,15 +929,15 @@ export class Profiler extends EventDispatcher {
|
|
|
877
929
|
|
|
878
930
|
if ( isDragging && hasMoved && previewWindow ) {
|
|
879
931
|
|
|
932
|
+
const finalX = parseInt( previewWindow.style.left ) + 200;
|
|
933
|
+
const finalY = parseInt( previewWindow.style.top ) + 20;
|
|
934
|
+
|
|
880
935
|
if ( previewWindow.parentNode ) {
|
|
881
936
|
|
|
882
937
|
previewWindow.parentNode.removeChild( previewWindow );
|
|
883
938
|
|
|
884
939
|
}
|
|
885
940
|
|
|
886
|
-
const finalX = parseInt( previewWindow.style.left ) + 200;
|
|
887
|
-
const finalY = parseInt( previewWindow.style.top ) + 20;
|
|
888
|
-
|
|
889
941
|
this.detachTab( tab, finalX, finalY );
|
|
890
942
|
|
|
891
943
|
} else if ( ! hasMoved ) {
|
|
@@ -975,7 +1027,7 @@ export class Profiler extends EventDispatcher {
|
|
|
975
1027
|
windowPanel.appendChild( windowHeader );
|
|
976
1028
|
windowPanel.appendChild( windowContent );
|
|
977
1029
|
|
|
978
|
-
|
|
1030
|
+
this.domElement.appendChild( windowPanel );
|
|
979
1031
|
|
|
980
1032
|
return windowPanel;
|
|
981
1033
|
|
|
@@ -1123,13 +1175,7 @@ export class Profiler extends EventDispatcher {
|
|
|
1123
1175
|
windowPanel.style.left = `${ constrainedX }px`;
|
|
1124
1176
|
windowPanel.style.top = `${ constrainedY }px`;
|
|
1125
1177
|
|
|
1126
|
-
if ( ! this.panel.classList.contains( 'visible' ) ) {
|
|
1127
1178
|
|
|
1128
|
-
windowPanel.style.opacity = '0';
|
|
1129
|
-
windowPanel.style.visibility = 'hidden';
|
|
1130
|
-
windowPanel.style.pointerEvents = 'none';
|
|
1131
|
-
|
|
1132
|
-
}
|
|
1133
1179
|
|
|
1134
1180
|
// Hide detached window if tab is not visible
|
|
1135
1181
|
if ( ! tab.isVisible ) {
|
|
@@ -1189,7 +1235,7 @@ export class Profiler extends EventDispatcher {
|
|
|
1189
1235
|
windowPanel.appendChild( windowHeader );
|
|
1190
1236
|
windowPanel.appendChild( windowContent );
|
|
1191
1237
|
|
|
1192
|
-
|
|
1238
|
+
this.domElement.appendChild( windowPanel );
|
|
1193
1239
|
|
|
1194
1240
|
// Setup window dragging
|
|
1195
1241
|
this.setupDetachedWindowDrag( windowPanel, windowHeader, tab );
|
|
@@ -1484,6 +1530,8 @@ export class Profiler extends EventDispatcher {
|
|
|
1484
1530
|
|
|
1485
1531
|
}
|
|
1486
1532
|
|
|
1533
|
+
this.dispatchEvent( { type: 'resize' } );
|
|
1534
|
+
|
|
1487
1535
|
};
|
|
1488
1536
|
|
|
1489
1537
|
const onResizeEnd = () => {
|
|
@@ -1564,8 +1612,8 @@ export class Profiler extends EventDispatcher {
|
|
|
1564
1612
|
|
|
1565
1613
|
}
|
|
1566
1614
|
|
|
1567
|
-
// Count only non-detached tabs that come before this one
|
|
1568
|
-
if ( ! t.isDetached ) {
|
|
1615
|
+
// Count only non-detached, non-builtin tabs that come before this one
|
|
1616
|
+
if ( ! t.isDetached && ! t.builtin ) {
|
|
1569
1617
|
|
|
1570
1618
|
insertIndex ++;
|
|
1571
1619
|
|
|
@@ -1609,11 +1657,20 @@ export class Profiler extends EventDispatcher {
|
|
|
1609
1657
|
|
|
1610
1658
|
if ( this.tabs[ id ] ) {
|
|
1611
1659
|
|
|
1612
|
-
this.tabs[ id ]
|
|
1660
|
+
const tab = this.tabs[ id ];
|
|
1661
|
+
|
|
1662
|
+
if ( ! tab.isVisible ) {
|
|
1663
|
+
|
|
1664
|
+
tab.show();
|
|
1665
|
+
|
|
1666
|
+
}
|
|
1667
|
+
|
|
1668
|
+
tab.setActive( true );
|
|
1613
1669
|
|
|
1614
1670
|
}
|
|
1615
1671
|
|
|
1616
1672
|
this.saveLayout();
|
|
1673
|
+
this.checkHeaderScroll();
|
|
1617
1674
|
|
|
1618
1675
|
}
|
|
1619
1676
|
|
|
@@ -1625,23 +1682,11 @@ export class Profiler extends EventDispatcher {
|
|
|
1625
1682
|
|
|
1626
1683
|
const isVisible = this.panel.classList.contains( 'visible' );
|
|
1627
1684
|
|
|
1628
|
-
this.
|
|
1629
|
-
|
|
1630
|
-
if ( isVisible ) {
|
|
1631
|
-
|
|
1632
|
-
detachedWindow.panel.style.opacity = '';
|
|
1633
|
-
detachedWindow.panel.style.visibility = '';
|
|
1634
|
-
detachedWindow.panel.style.pointerEvents = '';
|
|
1685
|
+
if ( isVisible && this.activeTabId && this.tabs[ this.activeTabId ] ) {
|
|
1635
1686
|
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
detachedWindow.panel.style.opacity = '0';
|
|
1639
|
-
detachedWindow.panel.style.visibility = 'hidden';
|
|
1640
|
-
detachedWindow.panel.style.pointerEvents = 'none';
|
|
1641
|
-
|
|
1642
|
-
}
|
|
1687
|
+
this.tabs[ this.activeTabId ].setActive( true );
|
|
1643
1688
|
|
|
1644
|
-
}
|
|
1689
|
+
}
|
|
1645
1690
|
|
|
1646
1691
|
this.dispatchEvent( { type: 'resize' } );
|
|
1647
1692
|
|