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,5 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { InspectorBase, TimestampQuery, warnOnce } from 'three/webgpu';
|
|
2
|
+
import { InspectorBase, TimestampQuery, warnOnce, RendererUtils, MeshBasicNodeMaterial, AdditiveBlending, NoToneMapping, LinearSRGBColorSpace } from 'three/webgpu';
|
|
3
|
+
import { vec3 } from 'three/tsl';
|
|
3
4
|
|
|
4
5
|
class ObjectStats {
|
|
5
6
|
|
|
@@ -84,6 +85,9 @@ export class RendererInspector extends InspectorBase {
|
|
|
84
85
|
this._lastFinishTime = 0;
|
|
85
86
|
this._resolveTimestampPromise = null;
|
|
86
87
|
|
|
88
|
+
this.overdraw = false;
|
|
89
|
+
this._overdrawMaterial = null;
|
|
90
|
+
|
|
87
91
|
this.isRendererInspector = true;
|
|
88
92
|
|
|
89
93
|
}
|
|
@@ -122,6 +126,66 @@ export class RendererInspector extends InspectorBase {
|
|
|
122
126
|
|
|
123
127
|
this._lastFinishTime = now;
|
|
124
128
|
|
|
129
|
+
if ( this.overdraw === true ) {
|
|
130
|
+
|
|
131
|
+
this._renderOverdraw( frame );
|
|
132
|
+
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
_renderOverdraw( frame ) {
|
|
138
|
+
|
|
139
|
+
const renderer = this.getRenderer();
|
|
140
|
+
|
|
141
|
+
if ( renderer === null ) return;
|
|
142
|
+
|
|
143
|
+
// first scene render of the frame; nested shadow / RTT passes come after
|
|
144
|
+
|
|
145
|
+
let primary = null;
|
|
146
|
+
|
|
147
|
+
for ( const render of frame.renders ) {
|
|
148
|
+
|
|
149
|
+
if ( render.scene.isScene === true ) {
|
|
150
|
+
|
|
151
|
+
primary = render;
|
|
152
|
+
break;
|
|
153
|
+
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if ( primary === null ) return;
|
|
159
|
+
|
|
160
|
+
if ( this._overdrawMaterial === null ) {
|
|
161
|
+
|
|
162
|
+
// additive constant, so each pixel sums the depth-passing fragments it shaded
|
|
163
|
+
|
|
164
|
+
this._overdrawMaterial = new MeshBasicNodeMaterial( {
|
|
165
|
+
colorNode: vec3( 0.25 ),
|
|
166
|
+
blending: AdditiveBlending,
|
|
167
|
+
depthTest: true,
|
|
168
|
+
depthWrite: true,
|
|
169
|
+
toneMapped: false
|
|
170
|
+
} );
|
|
171
|
+
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
const { scene, camera } = primary;
|
|
175
|
+
|
|
176
|
+
// raw render against black with no tone mapping, so the count stays linear
|
|
177
|
+
|
|
178
|
+
const state = RendererUtils.resetRendererAndSceneState( renderer, scene );
|
|
179
|
+
|
|
180
|
+
renderer.toneMapping = NoToneMapping;
|
|
181
|
+
renderer.outputColorSpace = LinearSRGBColorSpace;
|
|
182
|
+
|
|
183
|
+
scene.overrideMaterial = this._overdrawMaterial;
|
|
184
|
+
|
|
185
|
+
renderer.render( scene, camera );
|
|
186
|
+
|
|
187
|
+
RendererUtils.restoreRendererAndSceneState( renderer, scene, state );
|
|
188
|
+
|
|
125
189
|
}
|
|
126
190
|
|
|
127
191
|
_getFPS() {
|
|
@@ -191,88 +255,140 @@ export class RendererInspector extends InspectorBase {
|
|
|
191
255
|
|
|
192
256
|
const renderer = this.getRenderer();
|
|
193
257
|
|
|
194
|
-
|
|
195
|
-
await renderer.resolveTimestampsAsync( TimestampQuery.RENDER );
|
|
258
|
+
if ( renderer.backend.hasTimestamp ) {
|
|
196
259
|
|
|
197
|
-
|
|
198
|
-
|
|
260
|
+
await renderer.resolveTimestampsAsync( TimestampQuery.COMPUTE );
|
|
261
|
+
await renderer.resolveTimestampsAsync( TimestampQuery.RENDER );
|
|
199
262
|
|
|
200
|
-
|
|
263
|
+
const computeFrames = renderer.backend.getTimestampFrames( TimestampQuery.COMPUTE );
|
|
264
|
+
const renderFrames = renderer.backend.getTimestampFrames( TimestampQuery.RENDER );
|
|
201
265
|
|
|
202
|
-
|
|
266
|
+
const frameIds = [ ...new Set( [ ...computeFrames, ...renderFrames ] ) ];
|
|
203
267
|
|
|
204
|
-
const
|
|
268
|
+
for ( const frameId of frameIds ) {
|
|
205
269
|
|
|
206
|
-
|
|
270
|
+
const frame = this.getFrameById( frameId );
|
|
207
271
|
|
|
208
|
-
|
|
272
|
+
if ( frame !== null ) {
|
|
209
273
|
|
|
210
|
-
|
|
274
|
+
// resolve compute timestamps
|
|
275
|
+
|
|
276
|
+
if ( frame.resolvedCompute === false ) {
|
|
211
277
|
|
|
212
|
-
|
|
278
|
+
if ( frame.computes.length > 0 ) {
|
|
213
279
|
|
|
214
|
-
|
|
280
|
+
if ( computeFrames.includes( frameId ) ) {
|
|
215
281
|
|
|
216
|
-
|
|
282
|
+
for ( const stats of frame.computes ) {
|
|
217
283
|
|
|
218
|
-
|
|
284
|
+
if ( renderer.backend.hasTimestampQuery( stats.uid ) ) {
|
|
219
285
|
|
|
220
|
-
|
|
286
|
+
stats.gpu = renderer.backend.getTimestamp( stats.uid );
|
|
221
287
|
|
|
222
|
-
|
|
288
|
+
} else {
|
|
223
289
|
|
|
224
|
-
|
|
225
|
-
|
|
290
|
+
stats.gpu = 0;
|
|
291
|
+
stats.gpuNotAvailable = true;
|
|
292
|
+
|
|
293
|
+
}
|
|
226
294
|
|
|
227
295
|
}
|
|
228
296
|
|
|
297
|
+
frame.resolvedCompute = true;
|
|
298
|
+
|
|
229
299
|
}
|
|
230
300
|
|
|
301
|
+
} else {
|
|
302
|
+
|
|
231
303
|
frame.resolvedCompute = true;
|
|
232
304
|
|
|
233
305
|
}
|
|
234
306
|
|
|
235
|
-
} else {
|
|
236
|
-
|
|
237
|
-
frame.resolvedCompute = true;
|
|
238
|
-
|
|
239
307
|
}
|
|
240
308
|
|
|
241
|
-
|
|
309
|
+
// resolve render timestamps
|
|
242
310
|
|
|
243
|
-
|
|
311
|
+
if ( frame.resolvedRender === false ) {
|
|
244
312
|
|
|
245
|
-
|
|
313
|
+
if ( frame.renders.length > 0 ) {
|
|
246
314
|
|
|
247
|
-
|
|
315
|
+
if ( renderFrames.includes( frameId ) ) {
|
|
248
316
|
|
|
249
|
-
|
|
317
|
+
for ( const stats of frame.renders ) {
|
|
250
318
|
|
|
251
|
-
|
|
319
|
+
if ( renderer.backend.hasTimestampQuery( stats.uid ) ) {
|
|
252
320
|
|
|
253
|
-
|
|
321
|
+
stats.gpu = renderer.backend.getTimestamp( stats.uid );
|
|
254
322
|
|
|
255
|
-
|
|
323
|
+
} else {
|
|
256
324
|
|
|
257
|
-
|
|
325
|
+
stats.gpu = 0;
|
|
326
|
+
stats.gpuNotAvailable = true;
|
|
258
327
|
|
|
259
|
-
|
|
260
|
-
stats.gpuNotAvailable = true;
|
|
328
|
+
}
|
|
261
329
|
|
|
262
330
|
}
|
|
263
331
|
|
|
332
|
+
frame.resolvedRender = true;
|
|
333
|
+
|
|
264
334
|
}
|
|
265
335
|
|
|
336
|
+
} else {
|
|
337
|
+
|
|
266
338
|
frame.resolvedRender = true;
|
|
267
339
|
|
|
268
340
|
}
|
|
269
341
|
|
|
270
|
-
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
if ( frame.resolvedCompute === true && frame.resolvedRender === true ) {
|
|
345
|
+
|
|
346
|
+
this.resolveFrame( frame );
|
|
347
|
+
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
} else {
|
|
355
|
+
|
|
356
|
+
for ( const frame of this.frames ) {
|
|
357
|
+
|
|
358
|
+
if ( frame.resolvedCompute === true && frame.resolvedRender === true ) {
|
|
359
|
+
|
|
360
|
+
continue;
|
|
361
|
+
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
const nextFrame = this.getFrameById( frame.frameId + 1 );
|
|
271
365
|
|
|
272
|
-
|
|
366
|
+
if ( nextFrame === null ) continue;
|
|
367
|
+
|
|
368
|
+
if ( frame.resolvedCompute === false ) {
|
|
369
|
+
|
|
370
|
+
for ( const stats of frame.computes ) {
|
|
371
|
+
|
|
372
|
+
stats.gpu = 0;
|
|
373
|
+
stats.gpuNotAvailable = true;
|
|
273
374
|
|
|
274
375
|
}
|
|
275
376
|
|
|
377
|
+
frame.resolvedCompute = true;
|
|
378
|
+
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
if ( frame.resolvedRender === false ) {
|
|
382
|
+
|
|
383
|
+
for ( const stats of frame.renders ) {
|
|
384
|
+
|
|
385
|
+
stats.gpu = 0;
|
|
386
|
+
stats.gpuNotAvailable = true;
|
|
387
|
+
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
frame.resolvedRender = true;
|
|
391
|
+
|
|
276
392
|
}
|
|
277
393
|
|
|
278
394
|
if ( frame.resolvedCompute === true && frame.resolvedRender === true ) {
|
|
@@ -306,7 +306,7 @@ class TSLGraphEditor extends Extension {
|
|
|
306
306
|
|
|
307
307
|
if ( ! this._pending.has( requestId ) ) return;
|
|
308
308
|
this._pending.delete( requestId );
|
|
309
|
-
reject( new Error( `Timeout for ${type}` ) );
|
|
309
|
+
reject( new Error( `THREE.TSLGraphEditor: Timeout for ${type}` ) );
|
|
310
310
|
|
|
311
311
|
}, 5000 );
|
|
312
312
|
|
|
@@ -236,7 +236,7 @@ export class TSLGraphLoader extends FileLoader {
|
|
|
236
236
|
|
|
237
237
|
if ( ! json.codes || ! json.graphs ) {
|
|
238
238
|
|
|
239
|
-
throw new Error( '
|
|
239
|
+
throw new Error( 'TSLGraphLoader: Invalid import file structure.' );
|
|
240
240
|
|
|
241
241
|
}
|
|
242
242
|
|
|
@@ -9,18 +9,38 @@ class Console extends Tab {
|
|
|
9
9
|
this.filters = { info: true, warn: true, error: true };
|
|
10
10
|
this.filterText = '';
|
|
11
11
|
|
|
12
|
+
this.unreadErrors = 0;
|
|
13
|
+
this.unreadWarns = 0;
|
|
14
|
+
|
|
15
|
+
this.tabBadgeContainer = document.createElement( 'span' );
|
|
16
|
+
this.tabBadgeContainer.className = 'tab-badge-container';
|
|
17
|
+
|
|
18
|
+
this.tabErrorBadge = document.createElement( 'span' );
|
|
19
|
+
this.tabErrorBadge.className = 'tab-badge error';
|
|
20
|
+
this.tabErrorBadge.style.display = 'none';
|
|
21
|
+
|
|
22
|
+
this.tabWarnBadge = document.createElement( 'span' );
|
|
23
|
+
this.tabWarnBadge.className = 'tab-badge warn';
|
|
24
|
+
this.tabWarnBadge.style.display = 'none';
|
|
25
|
+
|
|
26
|
+
this.tabBadgeContainer.appendChild( this.tabErrorBadge );
|
|
27
|
+
this.tabBadgeContainer.appendChild( this.tabWarnBadge );
|
|
28
|
+
this.button.appendChild( this.tabBadgeContainer );
|
|
29
|
+
|
|
12
30
|
this.buildHeader();
|
|
13
31
|
|
|
14
32
|
this.logContainer = document.createElement( 'div' );
|
|
15
|
-
this.logContainer.
|
|
33
|
+
this.logContainer.classList.add( 'console-log' );
|
|
16
34
|
this.content.appendChild( this.logContainer );
|
|
17
35
|
|
|
36
|
+
this.lastMessage = null;
|
|
37
|
+
|
|
18
38
|
}
|
|
19
39
|
|
|
20
40
|
buildHeader() {
|
|
21
41
|
|
|
22
42
|
const header = document.createElement( 'div' );
|
|
23
|
-
header.className = '
|
|
43
|
+
header.className = 'toolbar';
|
|
24
44
|
|
|
25
45
|
const filterInput = document.createElement( 'input' );
|
|
26
46
|
filterInput.type = 'text';
|
|
@@ -56,9 +76,13 @@ class Console extends Tab {
|
|
|
56
76
|
const checkmark = document.createElement( 'span' );
|
|
57
77
|
checkmark.className = 'checkmark';
|
|
58
78
|
|
|
79
|
+
const labelText = document.createElement( 'span' );
|
|
80
|
+
labelText.className = 'checkbox-text';
|
|
81
|
+
labelText.textContent = type.charAt( 0 ).toUpperCase() + type.slice( 1 );
|
|
82
|
+
|
|
59
83
|
label.appendChild( checkbox );
|
|
60
84
|
label.appendChild( checkmark );
|
|
61
|
-
label.
|
|
85
|
+
label.appendChild( labelText );
|
|
62
86
|
buttonsGroup.appendChild( label );
|
|
63
87
|
|
|
64
88
|
} );
|
|
@@ -172,10 +196,6 @@ class Console extends Tab {
|
|
|
172
196
|
const parts = fullPrefix.slice( 0, - 2 ).split( '.' );
|
|
173
197
|
const shortPrefix = ( parts.length > 1 ? parts[ parts.length - 1 ] : parts[ 0 ] ) + ':';
|
|
174
198
|
|
|
175
|
-
const icon = this._getIcon( type, shortPrefix.split( ':' )[ 0 ].toLowerCase() );
|
|
176
|
-
|
|
177
|
-
fragment.appendChild( document.createTextNode( icon + ' ' ) );
|
|
178
|
-
|
|
179
199
|
const prefixSpan = document.createElement( 'span' );
|
|
180
200
|
prefixSpan.className = 'log-prefix';
|
|
181
201
|
prefixSpan.textContent = shortPrefix;
|
|
@@ -210,24 +230,186 @@ class Console extends Tab {
|
|
|
210
230
|
|
|
211
231
|
}
|
|
212
232
|
|
|
233
|
+
setActive( isActive ) {
|
|
234
|
+
|
|
235
|
+
super.setActive( isActive );
|
|
236
|
+
|
|
237
|
+
if ( isActive ) {
|
|
238
|
+
|
|
239
|
+
this.clearUnread();
|
|
240
|
+
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
clearUnread() {
|
|
246
|
+
|
|
247
|
+
this.unreadErrors = 0;
|
|
248
|
+
this.unreadWarns = 0;
|
|
249
|
+
this.updateBadges();
|
|
250
|
+
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
updateBadges() {
|
|
254
|
+
|
|
255
|
+
if ( ! this.profiler ) return;
|
|
256
|
+
|
|
257
|
+
const errorBadge = this.profiler.toggleButton.querySelector( '.console-badge.error' );
|
|
258
|
+
const warnBadge = this.profiler.toggleButton.querySelector( '.console-badge.warn' );
|
|
259
|
+
|
|
260
|
+
if ( errorBadge ) {
|
|
261
|
+
|
|
262
|
+
if ( this.unreadErrors > 0 ) {
|
|
263
|
+
|
|
264
|
+
errorBadge.textContent = this.unreadErrors > 99 ? '+99' : this.unreadErrors;
|
|
265
|
+
errorBadge.style.display = '';
|
|
266
|
+
|
|
267
|
+
} else {
|
|
268
|
+
|
|
269
|
+
errorBadge.style.display = 'none';
|
|
270
|
+
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
if ( warnBadge ) {
|
|
276
|
+
|
|
277
|
+
if ( this.unreadWarns > 0 ) {
|
|
278
|
+
|
|
279
|
+
warnBadge.textContent = this.unreadWarns > 99 ? '+99' : this.unreadWarns;
|
|
280
|
+
warnBadge.style.display = '';
|
|
281
|
+
|
|
282
|
+
} else {
|
|
283
|
+
|
|
284
|
+
warnBadge.style.display = 'none';
|
|
285
|
+
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
if ( this.tabErrorBadge ) {
|
|
291
|
+
|
|
292
|
+
if ( this.unreadErrors > 0 ) {
|
|
293
|
+
|
|
294
|
+
this.tabErrorBadge.textContent = this.unreadErrors > 99 ? '+99' : this.unreadErrors;
|
|
295
|
+
this.tabErrorBadge.style.display = '';
|
|
296
|
+
|
|
297
|
+
} else {
|
|
298
|
+
|
|
299
|
+
this.tabErrorBadge.style.display = 'none';
|
|
300
|
+
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
if ( this.tabWarnBadge ) {
|
|
306
|
+
|
|
307
|
+
if ( this.unreadWarns > 0 ) {
|
|
308
|
+
|
|
309
|
+
this.tabWarnBadge.textContent = this.unreadWarns > 99 ? '+99' : this.unreadWarns;
|
|
310
|
+
this.tabWarnBadge.style.display = '';
|
|
311
|
+
|
|
312
|
+
} else {
|
|
313
|
+
|
|
314
|
+
this.tabWarnBadge.style.display = 'none';
|
|
315
|
+
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
}
|
|
321
|
+
|
|
213
322
|
addMessage( type, text ) {
|
|
214
323
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
324
|
+
if ( this.lastMessage && this.lastMessage.type === type && this.lastMessage.text === text ) {
|
|
325
|
+
|
|
326
|
+
this.lastMessage.count ++;
|
|
327
|
+
this.lastMessage.countBadge.textContent = this.lastMessage.count;
|
|
328
|
+
this.lastMessage.countBadge.style.display = '';
|
|
329
|
+
|
|
330
|
+
} else {
|
|
331
|
+
|
|
332
|
+
const msg = document.createElement( 'div' );
|
|
333
|
+
msg.className = `log-message ${type}`;
|
|
334
|
+
msg.dataset.type = type;
|
|
335
|
+
msg.dataset.rawText = text;
|
|
336
|
+
|
|
337
|
+
const countBadge = document.createElement( 'span' );
|
|
338
|
+
countBadge.className = 'log-count-badge';
|
|
339
|
+
countBadge.style.display = 'none';
|
|
340
|
+
msg.appendChild( countBadge );
|
|
219
341
|
|
|
220
|
-
|
|
342
|
+
let icon = null;
|
|
343
|
+
const prefixMatch = text.match( /^([\w\.]+:\s)/ );
|
|
344
|
+
if ( prefixMatch ) {
|
|
345
|
+
|
|
346
|
+
const fullPrefix = prefixMatch[ 0 ];
|
|
347
|
+
const parts = fullPrefix.slice( 0, - 2 ).split( '.' );
|
|
348
|
+
const shortPrefix = ( parts.length > 1 ? parts[ parts.length - 1 ] : parts[ 0 ] ) + ':';
|
|
349
|
+
icon = this._getIcon( type, shortPrefix.split( ':' )[ 0 ].toLowerCase() );
|
|
350
|
+
|
|
351
|
+
}
|
|
221
352
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
353
|
+
if ( icon ) {
|
|
354
|
+
|
|
355
|
+
const iconSpan = document.createElement( 'span' );
|
|
356
|
+
iconSpan.className = 'log-icon';
|
|
357
|
+
iconSpan.textContent = icon;
|
|
358
|
+
msg.appendChild( iconSpan );
|
|
359
|
+
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
const body = document.createElement( 'span' );
|
|
363
|
+
body.className = 'log-body';
|
|
364
|
+
body.appendChild( this._formatMessage( type, text ) );
|
|
365
|
+
msg.appendChild( body );
|
|
366
|
+
|
|
367
|
+
const showByType = this.filters[ type ];
|
|
368
|
+
const showByText = text.toLowerCase().includes( this.filterText );
|
|
369
|
+
msg.classList.toggle( 'hidden', ! ( showByType && showByText ) );
|
|
370
|
+
|
|
371
|
+
this.logContainer.appendChild( msg );
|
|
372
|
+
|
|
373
|
+
if ( this.logContainer.children.length > 200 ) {
|
|
374
|
+
|
|
375
|
+
const firstChild = this.logContainer.firstChild;
|
|
376
|
+
this.logContainer.removeChild( firstChild );
|
|
377
|
+
if ( this.lastMessage && this.lastMessage.element === firstChild ) {
|
|
378
|
+
|
|
379
|
+
this.lastMessage = null;
|
|
380
|
+
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
this.lastMessage = {
|
|
386
|
+
type,
|
|
387
|
+
text,
|
|
388
|
+
count: 1,
|
|
389
|
+
element: msg,
|
|
390
|
+
countBadge
|
|
391
|
+
};
|
|
392
|
+
|
|
393
|
+
}
|
|
225
394
|
|
|
226
|
-
this.logContainer.appendChild( msg );
|
|
227
395
|
this.logContainer.scrollTop = this.logContainer.scrollHeight;
|
|
228
|
-
if ( this.logContainer.children.length > 200 ) {
|
|
229
396
|
|
|
230
|
-
|
|
397
|
+
// Update unread counts if the console is not active/visible
|
|
398
|
+
const isUnread = ! this.isActive;
|
|
399
|
+
|
|
400
|
+
if ( isUnread ) {
|
|
401
|
+
|
|
402
|
+
if ( type === 'error' ) {
|
|
403
|
+
|
|
404
|
+
this.unreadErrors ++;
|
|
405
|
+
this.updateBadges();
|
|
406
|
+
|
|
407
|
+
} else if ( type === 'warn' ) {
|
|
408
|
+
|
|
409
|
+
this.unreadWarns ++;
|
|
410
|
+
this.updateBadges();
|
|
411
|
+
|
|
412
|
+
}
|
|
231
413
|
|
|
232
414
|
}
|
|
233
415
|
|
|
@@ -70,6 +70,9 @@ class Memory extends Tab {
|
|
|
70
70
|
this.textures = new Item( 'Textures', createValueSpan(), createValueSpan() );
|
|
71
71
|
this.memoryStats.add( this.textures );
|
|
72
72
|
|
|
73
|
+
this.uniformBuffers = new Item( 'Uniform Buffers', createValueSpan(), createValueSpan() );
|
|
74
|
+
this.memoryStats.add( this.uniformBuffers );
|
|
75
|
+
|
|
73
76
|
this.graph = graph;
|
|
74
77
|
|
|
75
78
|
}
|
|
@@ -100,6 +103,7 @@ class Memory extends Tab {
|
|
|
100
103
|
|
|
101
104
|
setText( this.attributes.data[ 1 ], memory.attributes.toString() );
|
|
102
105
|
setText( this.attributes.data[ 2 ], formatBytes( memory.attributesSize ) );
|
|
106
|
+
|
|
103
107
|
setText( this.geometries.data[ 1 ], memory.geometries.toString() );
|
|
104
108
|
|
|
105
109
|
setText( this.indexAttributes.data[ 1 ], memory.indexAttributes.toString() );
|
|
@@ -118,9 +122,13 @@ class Memory extends Tab {
|
|
|
118
122
|
|
|
119
123
|
setText( this.storageAttributes.data[ 1 ], memory.storageAttributes.toString() );
|
|
120
124
|
setText( this.storageAttributes.data[ 2 ], formatBytes( memory.storageAttributesSize ) );
|
|
125
|
+
|
|
121
126
|
setText( this.textures.data[ 1 ], memory.textures.toString() );
|
|
122
127
|
setText( this.textures.data[ 2 ], formatBytes( memory.texturesSize ) );
|
|
123
128
|
|
|
129
|
+
setText( this.uniformBuffers.data[ 1 ], memory.uniformBuffers.toString() );
|
|
130
|
+
setText( this.uniformBuffers.data[ 2 ], formatBytes( memory.uniformBuffersSize ) );
|
|
131
|
+
|
|
124
132
|
}
|
|
125
133
|
|
|
126
134
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Tab } from '../ui/Tab.js';
|
|
2
2
|
import { List } from '../ui/List.js';
|
|
3
3
|
import { Item } from '../ui/Item.js';
|
|
4
|
-
import { createValueSpan } from '../ui/utils.js';
|
|
4
|
+
import { createValueSpan, info } from '../ui/utils.js';
|
|
5
5
|
import { ValueString, ValueNumber, ValueSlider, ValueSelect, ValueCheckbox, ValueColor, ValueButton } from '../ui/Values.js';
|
|
6
6
|
|
|
7
7
|
class ParametersGroup {
|
|
@@ -9,9 +9,9 @@ class ParametersGroup {
|
|
|
9
9
|
constructor( parameters, name ) {
|
|
10
10
|
|
|
11
11
|
this.parameters = parameters;
|
|
12
|
-
this.name = name;
|
|
13
12
|
|
|
14
13
|
this.paramList = new Item( name );
|
|
14
|
+
this.paramList.setCollapsible( true );
|
|
15
15
|
|
|
16
16
|
this.objects = [];
|
|
17
17
|
|
|
@@ -25,6 +25,30 @@ class ParametersGroup {
|
|
|
25
25
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
name( name ) {
|
|
29
|
+
|
|
30
|
+
this.paramList.setValue( 0, name );
|
|
31
|
+
|
|
32
|
+
return this;
|
|
33
|
+
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
show() {
|
|
37
|
+
|
|
38
|
+
this.paramList.show();
|
|
39
|
+
|
|
40
|
+
return this;
|
|
41
|
+
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
hide() {
|
|
45
|
+
|
|
46
|
+
this.paramList.hide();
|
|
47
|
+
|
|
48
|
+
return this;
|
|
49
|
+
|
|
50
|
+
}
|
|
51
|
+
|
|
28
52
|
add( object, property, ...params ) {
|
|
29
53
|
|
|
30
54
|
const value = object[ property ];
|
|
@@ -66,16 +90,37 @@ class ParametersGroup {
|
|
|
66
90
|
|
|
67
91
|
}
|
|
68
92
|
|
|
93
|
+
_addInfo( editor, itemNode ) {
|
|
94
|
+
|
|
95
|
+
editor.info = ( text ) => {
|
|
96
|
+
|
|
97
|
+
info( itemNode, text );
|
|
98
|
+
return editor;
|
|
99
|
+
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
}
|
|
103
|
+
|
|
69
104
|
_addParameter( object, property, editor, subItem ) {
|
|
70
105
|
|
|
71
106
|
editor.name = ( name ) => {
|
|
72
107
|
|
|
73
|
-
subItem.data[ 0 ].
|
|
108
|
+
if ( subItem.data[ 0 ].childNodes.length > 0 && subItem.data[ 0 ].firstChild.nodeType === 3 /* Node.TEXT_NODE */ ) {
|
|
109
|
+
|
|
110
|
+
subItem.data[ 0 ].firstChild.textContent = name;
|
|
111
|
+
|
|
112
|
+
} else {
|
|
113
|
+
|
|
114
|
+
subItem.data[ 0 ].insertBefore( document.createTextNode( name ), subItem.data[ 0 ].firstChild );
|
|
115
|
+
|
|
116
|
+
}
|
|
74
117
|
|
|
75
118
|
return editor;
|
|
76
119
|
|
|
77
120
|
};
|
|
78
121
|
|
|
122
|
+
this._addInfo( editor, subItem.data[ 0 ] );
|
|
123
|
+
|
|
79
124
|
editor.listen = () => {
|
|
80
125
|
|
|
81
126
|
const update = () => {
|
|
@@ -108,6 +153,9 @@ class ParametersGroup {
|
|
|
108
153
|
|
|
109
154
|
this.objects.push( { object: object, key: property, editor: editor, subItem: subItem } );
|
|
110
155
|
|
|
156
|
+
editor.addEventListener( 'show', () => subItem.show() );
|
|
157
|
+
editor.addEventListener( 'hide', () => subItem.hide() );
|
|
158
|
+
|
|
111
159
|
}
|
|
112
160
|
|
|
113
161
|
addString( object, property ) {
|
|
@@ -328,12 +376,24 @@ class ParametersGroup {
|
|
|
328
376
|
|
|
329
377
|
editor.name = ( name ) => {
|
|
330
378
|
|
|
331
|
-
editor.domElement.childNodes[ 0 ]
|
|
379
|
+
const buttonNode = editor.domElement.childNodes[ 0 ];
|
|
380
|
+
|
|
381
|
+
if ( buttonNode.childNodes.length > 0 && buttonNode.firstChild.nodeType === 3 /* Node.TEXT_NODE */ ) {
|
|
382
|
+
|
|
383
|
+
buttonNode.firstChild.textContent = name;
|
|
384
|
+
|
|
385
|
+
} else {
|
|
386
|
+
|
|
387
|
+
buttonNode.insertBefore( document.createTextNode( name ), buttonNode.firstChild );
|
|
388
|
+
|
|
389
|
+
}
|
|
332
390
|
|
|
333
391
|
return editor;
|
|
334
392
|
|
|
335
393
|
};
|
|
336
394
|
|
|
395
|
+
this._addInfo( editor, editor.domElement.childNodes[ 0 ] );
|
|
396
|
+
|
|
337
397
|
this._registerParameter( object, property, editor, subItem );
|
|
338
398
|
|
|
339
399
|
return editor;
|