@gnsx/three 0.184.20 → 0.185.2
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 +1261 -926
- package/build/three.core.js +1104 -829
- package/build/three.core.min.js +1 -1
- package/build/three.module.js +157 -97
- 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 +7542 -3371
- package/build/three.webgpu.min.js +1 -1
- package/build/three.webgpu.nodes.js +7542 -3370
- 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 +57 -64
- 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 +124 -91
- 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 -74
- 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 +92 -37
- package/src/nodes/lighting/PointShadowNode.js +7 -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 +21 -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 +42 -4
- package/src/renderers/common/RenderObject.js +73 -13
- package/src/renderers/common/Renderer.js +282 -109
- 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 +11 -4
- 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
|
@@ -298,6 +298,10 @@ class WebGLRenderer {
|
|
|
298
298
|
let _isContextLost = false;
|
|
299
299
|
let _nodesHandler = null;
|
|
300
300
|
|
|
301
|
+
let _scratchFramebuffer = null;
|
|
302
|
+
let _srcFramebuffer = null;
|
|
303
|
+
let _dstFramebuffer = null;
|
|
304
|
+
|
|
301
305
|
// internal state cache
|
|
302
306
|
|
|
303
307
|
this._outputColorSpace = SRGBColorSpace;
|
|
@@ -397,11 +401,11 @@ class WebGLRenderer {
|
|
|
397
401
|
|
|
398
402
|
if ( getContext( contextName ) ) {
|
|
399
403
|
|
|
400
|
-
throw new Error( 'Error creating WebGL context with your selected attributes.' );
|
|
404
|
+
throw new Error( 'THREE.WebGLRenderer: Error creating WebGL context with your selected attributes.' );
|
|
401
405
|
|
|
402
406
|
} else {
|
|
403
407
|
|
|
404
|
-
throw new Error( 'Error creating WebGL context.' );
|
|
408
|
+
throw new Error( 'THREE.WebGLRenderer: Error creating WebGL context.' );
|
|
405
409
|
|
|
406
410
|
}
|
|
407
411
|
|
|
@@ -441,6 +445,10 @@ class WebGLRenderer {
|
|
|
441
445
|
|
|
442
446
|
}
|
|
443
447
|
|
|
448
|
+
_scratchFramebuffer = _gl.createFramebuffer();
|
|
449
|
+
_srcFramebuffer = _gl.createFramebuffer();
|
|
450
|
+
_dstFramebuffer = _gl.createFramebuffer();
|
|
451
|
+
|
|
444
452
|
info = new WebGLInfo( _gl );
|
|
445
453
|
properties = new WebGLProperties();
|
|
446
454
|
textures = new WebGLTextures( _gl, extensions, state, properties, capabilities, utils, info );
|
|
@@ -547,7 +555,7 @@ class WebGLRenderer {
|
|
|
547
555
|
|
|
548
556
|
if ( _outputBufferType !== UnsignedByteType ) {
|
|
549
557
|
|
|
550
|
-
output = new WebGLOutput( _outputBufferType, canvas.width, canvas.height, depth, stencil );
|
|
558
|
+
output = new WebGLOutput( _outputBufferType, canvas.width, canvas.height, antialias, depth, stencil );
|
|
551
559
|
|
|
552
560
|
}
|
|
553
561
|
|
|
@@ -731,7 +739,7 @@ class WebGLRenderer {
|
|
|
731
739
|
|
|
732
740
|
if ( _outputBufferType === UnsignedByteType ) {
|
|
733
741
|
|
|
734
|
-
error( '
|
|
742
|
+
error( 'WebGLRenderer: setEffects() requires outputBufferType set to HalfFloatType or FloatType.' );
|
|
735
743
|
return;
|
|
736
744
|
|
|
737
745
|
}
|
|
@@ -742,7 +750,7 @@ class WebGLRenderer {
|
|
|
742
750
|
|
|
743
751
|
if ( effects[ i ].isOutputPass === true ) {
|
|
744
752
|
|
|
745
|
-
warn( '
|
|
753
|
+
warn( 'WebGLRenderer: OutputPass is not needed in setEffects(). Tone mapping and color space conversion are applied automatically.' );
|
|
746
754
|
break;
|
|
747
755
|
|
|
748
756
|
}
|
|
@@ -1180,7 +1188,7 @@ class WebGLRenderer {
|
|
|
1180
1188
|
|
|
1181
1189
|
if ( scene === null ) scene = _emptyScene; // renderBufferDirect second parameter used to be fog (could be null)
|
|
1182
1190
|
|
|
1183
|
-
const frontFaceCW = ( object.isMesh && object.matrixWorld.
|
|
1191
|
+
const frontFaceCW = ( object.isMesh && object.matrixWorld.determinantAffine() < 0 );
|
|
1184
1192
|
|
|
1185
1193
|
const program = setProgram( camera, scene, geometry, material, object );
|
|
1186
1194
|
|
|
@@ -1714,7 +1722,9 @@ class WebGLRenderer {
|
|
|
1714
1722
|
// WITH_GENESYS
|
|
1715
1723
|
ProfilerService.begin( 'sortRenderList' );
|
|
1716
1724
|
// !WITH_GENESYS
|
|
1717
|
-
|
|
1725
|
+
|
|
1726
|
+
currentRenderList.sort( _opaqueSort, _transparentSort, camera.reversedDepth );
|
|
1727
|
+
|
|
1718
1728
|
// WITH_GENESYS
|
|
1719
1729
|
ProfilerService.end( 'sortRenderList' );
|
|
1720
1730
|
// !WITH_GENESYS
|
|
@@ -1736,6 +1746,8 @@ class WebGLRenderer {
|
|
|
1736
1746
|
|
|
1737
1747
|
this.info.render.frame ++;
|
|
1738
1748
|
|
|
1749
|
+
if ( this.info.autoReset === true ) this.info.reset();
|
|
1750
|
+
|
|
1739
1751
|
if ( _clippingEnabled === true ) clipping.beginShadows();
|
|
1740
1752
|
|
|
1741
1753
|
const shadowsArray = currentRenderState.state.shadowsArray;
|
|
@@ -1752,8 +1764,6 @@ class WebGLRenderer {
|
|
|
1752
1764
|
|
|
1753
1765
|
//
|
|
1754
1766
|
|
|
1755
|
-
if ( this.info.autoReset === true ) this.info.reset();
|
|
1756
|
-
|
|
1757
1767
|
// render scene (skip if first effect is a render pass - it will render the scene itself)
|
|
1758
1768
|
|
|
1759
1769
|
const skipSceneRender = useOutput && output.hasRenderPass();
|
|
@@ -2959,8 +2969,6 @@ class WebGLRenderer {
|
|
|
2959
2969
|
|
|
2960
2970
|
};
|
|
2961
2971
|
|
|
2962
|
-
const _scratchFrameBuffer = _gl.createFramebuffer();
|
|
2963
|
-
|
|
2964
2972
|
/**
|
|
2965
2973
|
* Sets the active rendertarget.
|
|
2966
2974
|
*
|
|
@@ -3024,7 +3032,7 @@ class WebGLRenderer {
|
|
|
3024
3032
|
( renderTarget.width !== depthTexture.image.width || renderTarget.height !== depthTexture.image.height )
|
|
3025
3033
|
) {
|
|
3026
3034
|
|
|
3027
|
-
throw new Error( '
|
|
3035
|
+
throw new Error( 'THREE.WebGLRenderer: Attached DepthTexture is initialized to the incorrect size.' );
|
|
3028
3036
|
|
|
3029
3037
|
}
|
|
3030
3038
|
|
|
@@ -3093,7 +3101,7 @@ class WebGLRenderer {
|
|
|
3093
3101
|
// being bound that are different sizes.
|
|
3094
3102
|
if ( activeMipmapLevel !== 0 ) {
|
|
3095
3103
|
|
|
3096
|
-
framebuffer =
|
|
3104
|
+
framebuffer = _scratchFramebuffer;
|
|
3097
3105
|
|
|
3098
3106
|
}
|
|
3099
3107
|
|
|
@@ -3336,8 +3344,6 @@ class WebGLRenderer {
|
|
|
3336
3344
|
|
|
3337
3345
|
};
|
|
3338
3346
|
|
|
3339
|
-
const _srcFramebuffer = _gl.createFramebuffer();
|
|
3340
|
-
const _dstFramebuffer = _gl.createFramebuffer();
|
|
3341
3347
|
|
|
3342
3348
|
/**
|
|
3343
3349
|
* Copies data of the given source texture into a destination texture.
|
|
@@ -16,7 +16,6 @@ import { REVISION, TimestampQuery } from '../../constants.js';
|
|
|
16
16
|
* implement the interface.
|
|
17
17
|
*
|
|
18
18
|
* @abstract
|
|
19
|
-
* @private
|
|
20
19
|
*/
|
|
21
20
|
class Backend {
|
|
22
21
|
|
|
@@ -124,6 +123,15 @@ class Backend {
|
|
|
124
123
|
*/
|
|
125
124
|
finishRender( /*renderContext*/ ) {}
|
|
126
125
|
|
|
126
|
+
/**
|
|
127
|
+
* Sets the XR rendering destination.
|
|
128
|
+
*
|
|
129
|
+
* Backends that render directly into XR framebuffers can override this hook.
|
|
130
|
+
*
|
|
131
|
+
* @param {?Object} xrTarget - The XR rendering destination.
|
|
132
|
+
*/
|
|
133
|
+
setXRTarget( /*xrTarget*/ ) {}
|
|
134
|
+
|
|
127
135
|
/**
|
|
128
136
|
* This method is executed at the beginning of a compute call and
|
|
129
137
|
* can be used by the backend to prepare the state for upcoming
|
|
@@ -276,10 +284,18 @@ class Backend {
|
|
|
276
284
|
* Updates a GPU sampler for the given texture.
|
|
277
285
|
*
|
|
278
286
|
* @abstract
|
|
279
|
-
* @param {
|
|
287
|
+
* @param {Sampler} binding - The sampler binding to update.
|
|
280
288
|
* @return {string} The current sampler key.
|
|
281
289
|
*/
|
|
282
|
-
updateSampler( /*
|
|
290
|
+
updateSampler( /*binding*/ ) { }
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Frees the GPU sampler for the given sampler binding.
|
|
294
|
+
*
|
|
295
|
+
* @abstract
|
|
296
|
+
* @param {Sampler} binding - The sampler binding to free.
|
|
297
|
+
*/
|
|
298
|
+
destroySampler( /*binding*/ ) { }
|
|
283
299
|
|
|
284
300
|
/**
|
|
285
301
|
* Creates a default texture for the given texture that can be used
|
|
@@ -389,6 +405,22 @@ class Backend {
|
|
|
389
405
|
*/
|
|
390
406
|
createStorageAttribute( /*attribute*/ ) { }
|
|
391
407
|
|
|
408
|
+
/**
|
|
409
|
+
* Creates a uniform buffer.
|
|
410
|
+
*
|
|
411
|
+
* @abstract
|
|
412
|
+
* @param {Buffer} uniformBuffer - The uniform buffer.
|
|
413
|
+
*/
|
|
414
|
+
createUniformBuffer( /*uniformBuffer*/ ) { }
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* Destroys a uniform buffer.
|
|
418
|
+
*
|
|
419
|
+
* @abstract
|
|
420
|
+
* @param {Buffer} uniformBuffer - The uniform buffer.
|
|
421
|
+
*/
|
|
422
|
+
destroyUniformBuffer( /*uniformBuffer*/ ) { }
|
|
423
|
+
|
|
392
424
|
/**
|
|
393
425
|
* Updates the GPU buffer of a shader attribute.
|
|
394
426
|
*
|
|
@@ -516,17 +548,29 @@ class Backend {
|
|
|
516
548
|
|
|
517
549
|
}
|
|
518
550
|
|
|
551
|
+
/**
|
|
552
|
+
* Whether the backend supports query timestamps or not.
|
|
553
|
+
*
|
|
554
|
+
* @type {boolean}
|
|
555
|
+
* @readonly
|
|
556
|
+
*/
|
|
557
|
+
get hasTimestamp() {
|
|
558
|
+
|
|
559
|
+
return false;
|
|
560
|
+
|
|
561
|
+
}
|
|
562
|
+
|
|
519
563
|
/**
|
|
520
564
|
* Returns `true` if a timestamp for the given uid is available.
|
|
521
565
|
*
|
|
522
566
|
* @param {string} uid - The unique identifier.
|
|
523
567
|
* @return {boolean} Whether the timestamp is available or not.
|
|
524
568
|
*/
|
|
525
|
-
|
|
569
|
+
hasTimestampQuery( uid ) {
|
|
526
570
|
|
|
527
571
|
const queryPool = this._getQueryPool( uid );
|
|
528
572
|
|
|
529
|
-
return queryPool.
|
|
573
|
+
return queryPool.hasTimestampQuery( uid );
|
|
530
574
|
|
|
531
575
|
}
|
|
532
576
|
|
|
@@ -79,21 +79,15 @@ class Bindings extends DataMap {
|
|
|
79
79
|
|
|
80
80
|
const bindings = renderObject.getBindings();
|
|
81
81
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
const groupData = this.get( bindGroup );
|
|
85
|
-
|
|
86
|
-
if ( groupData.bindGroup === undefined ) {
|
|
87
|
-
|
|
88
|
-
// each object defines an array of bindings (ubos, textures, samplers etc.)
|
|
82
|
+
const renderObjectData = this.get( renderObject );
|
|
89
83
|
|
|
90
|
-
|
|
84
|
+
if ( renderObjectData.initialized !== true ) {
|
|
91
85
|
|
|
92
|
-
|
|
86
|
+
// bind groups are created once per object
|
|
93
87
|
|
|
94
|
-
|
|
88
|
+
this._createBindings( bindings );
|
|
95
89
|
|
|
96
|
-
|
|
90
|
+
renderObjectData.initialized = true;
|
|
97
91
|
|
|
98
92
|
}
|
|
99
93
|
|
|
@@ -110,20 +104,22 @@ class Bindings extends DataMap {
|
|
|
110
104
|
getForCompute( computeNode ) {
|
|
111
105
|
|
|
112
106
|
const bindings = this.nodes.getForCompute( computeNode ).bindings;
|
|
107
|
+
const computeNodeData = this.get( computeNode );
|
|
113
108
|
|
|
114
|
-
|
|
109
|
+
if ( computeNodeData.initialized !== true || computeNodeData.bindings !== bindings ) {
|
|
115
110
|
|
|
116
|
-
|
|
111
|
+
// bind groups are created once per compute node version
|
|
117
112
|
|
|
118
|
-
if (
|
|
113
|
+
if ( computeNodeData.bindings !== undefined ) {
|
|
119
114
|
|
|
120
|
-
this.
|
|
115
|
+
this._destroyBindings( computeNodeData.bindings );
|
|
121
116
|
|
|
122
|
-
|
|
117
|
+
}
|
|
123
118
|
|
|
124
|
-
|
|
119
|
+
this._createBindings( bindings );
|
|
125
120
|
|
|
126
|
-
|
|
121
|
+
computeNodeData.initialized = true;
|
|
122
|
+
computeNodeData.bindings = bindings;
|
|
127
123
|
|
|
128
124
|
}
|
|
129
125
|
|
|
@@ -160,14 +156,12 @@ class Bindings extends DataMap {
|
|
|
160
156
|
*/
|
|
161
157
|
deleteForCompute( computeNode ) {
|
|
162
158
|
|
|
163
|
-
const
|
|
159
|
+
const computeNodeData = this.get( computeNode );
|
|
160
|
+
const bindings = computeNodeData.bindings || this.nodes.getForCompute( computeNode ).bindings;
|
|
164
161
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
this.backend.deleteBindGroupData( bindGroup );
|
|
168
|
-
this.delete( bindGroup );
|
|
162
|
+
this._destroyBindings( bindings );
|
|
169
163
|
|
|
170
|
-
|
|
164
|
+
this.delete( computeNode );
|
|
171
165
|
|
|
172
166
|
}
|
|
173
167
|
|
|
@@ -180,53 +174,113 @@ class Bindings extends DataMap {
|
|
|
180
174
|
|
|
181
175
|
const bindings = renderObject.getBindings();
|
|
182
176
|
|
|
183
|
-
|
|
177
|
+
this._destroyBindings( bindings );
|
|
184
178
|
|
|
185
|
-
|
|
186
|
-
this.delete( bindGroup );
|
|
187
|
-
|
|
188
|
-
}
|
|
179
|
+
this.delete( renderObject );
|
|
189
180
|
|
|
190
181
|
}
|
|
191
182
|
|
|
192
183
|
/**
|
|
193
|
-
*
|
|
184
|
+
* Creates the bindings for the given array of bindings.
|
|
194
185
|
*
|
|
195
186
|
* @param {Array<BindGroup>} bindings - The bind groups.
|
|
196
187
|
*/
|
|
197
|
-
|
|
188
|
+
_createBindings( bindings ) {
|
|
198
189
|
|
|
199
190
|
for ( const bindGroup of bindings ) {
|
|
200
191
|
|
|
201
|
-
|
|
192
|
+
// binding group
|
|
193
|
+
|
|
194
|
+
const groupData = this.get( bindGroup );
|
|
195
|
+
|
|
196
|
+
if ( groupData.bindGroup === undefined ) {
|
|
197
|
+
|
|
198
|
+
// initialize
|
|
199
|
+
|
|
200
|
+
for ( const binding of bindGroup.bindings ) {
|
|
201
|
+
|
|
202
|
+
if ( binding.isUniformBuffer ) {
|
|
203
|
+
|
|
204
|
+
this.backend.createUniformBuffer( binding );
|
|
205
|
+
this.info.createUniformBuffer( binding );
|
|
206
|
+
|
|
207
|
+
} else if ( binding.isSampledTexture ) {
|
|
208
|
+
|
|
209
|
+
this.textures.updateTexture( binding.texture );
|
|
210
|
+
|
|
211
|
+
} else if ( binding.isSampler ) {
|
|
212
|
+
|
|
213
|
+
this.textures.updateSampler( binding );
|
|
214
|
+
|
|
215
|
+
} else if ( binding.isStorageBuffer ) {
|
|
216
|
+
|
|
217
|
+
const attribute = binding.attribute;
|
|
218
|
+
const attributeType = attribute.isIndirectStorageBufferAttribute ? AttributeType.INDIRECT : AttributeType.STORAGE;
|
|
219
|
+
|
|
220
|
+
this.attributes.update( attribute, attributeType );
|
|
221
|
+
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// each object defines an array of bindings (ubos, textures, samplers etc.)
|
|
227
|
+
|
|
228
|
+
this.backend.createBindings( bindGroup, bindings, 0 );
|
|
229
|
+
|
|
230
|
+
groupData.bindGroup = bindGroup;
|
|
231
|
+
groupData.usedTimes = 1;
|
|
232
|
+
|
|
233
|
+
} else {
|
|
234
|
+
|
|
235
|
+
groupData.usedTimes ++;
|
|
236
|
+
|
|
237
|
+
}
|
|
202
238
|
|
|
203
239
|
}
|
|
204
240
|
|
|
205
241
|
}
|
|
206
242
|
|
|
207
243
|
/**
|
|
208
|
-
*
|
|
244
|
+
* Deletes the given array of bindings.
|
|
209
245
|
*
|
|
210
|
-
* @param {BindGroup}
|
|
246
|
+
* @param {Array<BindGroup>} bindings - The bind groups.
|
|
211
247
|
*/
|
|
212
|
-
|
|
248
|
+
_destroyBindings( bindings ) {
|
|
213
249
|
|
|
214
|
-
for ( const
|
|
250
|
+
for ( const bindGroup of bindings ) {
|
|
215
251
|
|
|
216
|
-
|
|
252
|
+
const groupData = this.get( bindGroup );
|
|
253
|
+
groupData.usedTimes --;
|
|
217
254
|
|
|
218
|
-
|
|
255
|
+
if ( groupData.usedTimes === 0 ) {
|
|
219
256
|
|
|
220
|
-
|
|
257
|
+
for ( const binding of bindGroup.bindings ) {
|
|
221
258
|
|
|
222
|
-
|
|
259
|
+
if ( binding.isUniformBuffer ) {
|
|
223
260
|
|
|
224
|
-
|
|
261
|
+
this.backend.destroyUniformBuffer( binding );
|
|
262
|
+
this.info.destroyUniformBuffer( binding );
|
|
225
263
|
|
|
226
|
-
|
|
227
|
-
const attributeType = attribute.isIndirectStorageBufferAttribute ? AttributeType.INDIRECT : AttributeType.STORAGE;
|
|
264
|
+
// release arrays
|
|
228
265
|
|
|
229
|
-
|
|
266
|
+
binding.release();
|
|
267
|
+
|
|
268
|
+
} else if ( binding.isSampler ) {
|
|
269
|
+
|
|
270
|
+
if ( binding.isSampledTexture !== true ) {
|
|
271
|
+
|
|
272
|
+
this.backend.destroySampler( binding );
|
|
273
|
+
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
binding.release();
|
|
277
|
+
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
this.backend.deleteBindGroupData( bindGroup );
|
|
283
|
+
this.delete( bindGroup );
|
|
230
284
|
|
|
231
285
|
}
|
|
232
286
|
|
|
@@ -234,6 +288,21 @@ class Bindings extends DataMap {
|
|
|
234
288
|
|
|
235
289
|
}
|
|
236
290
|
|
|
291
|
+
/**
|
|
292
|
+
* Updates the given array of bindings.
|
|
293
|
+
*
|
|
294
|
+
* @param {Array<BindGroup>} bindings - The bind groups.
|
|
295
|
+
*/
|
|
296
|
+
_updateBindings( bindings ) {
|
|
297
|
+
|
|
298
|
+
for ( const bindGroup of bindings ) {
|
|
299
|
+
|
|
300
|
+
this._update( bindGroup, bindings );
|
|
301
|
+
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
}
|
|
305
|
+
|
|
237
306
|
/**
|
|
238
307
|
* Updates the given bind group.
|
|
239
308
|
*
|
|
@@ -359,7 +428,7 @@ class Bindings extends DataMap {
|
|
|
359
428
|
|
|
360
429
|
if ( updated ) {
|
|
361
430
|
|
|
362
|
-
const samplerKey = this.textures.updateSampler( binding
|
|
431
|
+
const samplerKey = this.textures.updateSampler( binding );
|
|
363
432
|
|
|
364
433
|
if ( binding.samplerKey !== samplerKey ) {
|
|
365
434
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Matrix3 } from '../../math/Matrix3.js';
|
|
2
|
+
import { Matrix4 } from '../../math/Matrix4.js';
|
|
2
3
|
import { Plane } from '../../math/Plane.js';
|
|
3
4
|
import { Vector4 } from '../../math/Vector4.js';
|
|
4
5
|
|
|
@@ -52,6 +53,13 @@ class ClippingContext {
|
|
|
52
53
|
*/
|
|
53
54
|
this.shadowPass = false;
|
|
54
55
|
|
|
56
|
+
/**
|
|
57
|
+
* The view matrix.
|
|
58
|
+
*
|
|
59
|
+
* @type {Matrix4}
|
|
60
|
+
*/
|
|
61
|
+
this.viewMatrix = new Matrix4();
|
|
62
|
+
|
|
55
63
|
/**
|
|
56
64
|
* The view normal matrix.
|
|
57
65
|
*
|
|
@@ -90,11 +98,11 @@ class ClippingContext {
|
|
|
90
98
|
|
|
91
99
|
if ( parentContext !== null ) {
|
|
92
100
|
|
|
101
|
+
this.viewMatrix = parentContext.viewMatrix;
|
|
93
102
|
this.viewNormalMatrix = parentContext.viewNormalMatrix;
|
|
94
103
|
this.clippingGroupContexts = parentContext.clippingGroupContexts;
|
|
95
104
|
|
|
96
105
|
this.shadowPass = parentContext.shadowPass;
|
|
97
|
-
this.viewMatrix = parentContext.viewMatrix;
|
|
98
106
|
|
|
99
107
|
}
|
|
100
108
|
|
|
@@ -137,8 +145,8 @@ class ClippingContext {
|
|
|
137
145
|
updateGlobal( scene, camera ) {
|
|
138
146
|
|
|
139
147
|
this.shadowPass = ( scene.overrideMaterial !== null && scene.overrideMaterial.isShadowPassMaterial );
|
|
140
|
-
this.viewMatrix = camera.matrixWorldInverse;
|
|
141
148
|
|
|
149
|
+
this.viewMatrix.copy( camera.matrixWorldInverse );
|
|
142
150
|
this.viewNormalMatrix.getNormalMatrix( this.viewMatrix );
|
|
143
151
|
|
|
144
152
|
}
|
|
@@ -94,42 +94,46 @@ class Info {
|
|
|
94
94
|
*
|
|
95
95
|
* @type {Object}
|
|
96
96
|
* @readonly
|
|
97
|
-
* @property {number} geometries - The number of active geometries.
|
|
98
|
-
* @property {number} textures - The number of active textures.
|
|
99
97
|
* @property {number} attributes - The number of active attributes.
|
|
98
|
+
* @property {number} attributesSize - The memory size of active attributes in bytes.
|
|
99
|
+
* @property {number} geometries - The number of active geometries.
|
|
100
100
|
* @property {number} indexAttributes - The number of active index attributes.
|
|
101
|
-
* @property {number}
|
|
101
|
+
* @property {number} indexAttributesSize - The memory size of active index attributes in bytes.
|
|
102
102
|
* @property {number} indirectStorageAttributes - The number of active indirect storage attributes.
|
|
103
|
-
* @property {number}
|
|
103
|
+
* @property {number} indirectStorageAttributesSize - The memory size of active indirect storage attributes in bytes.
|
|
104
104
|
* @property {number} programs - The number of active programs.
|
|
105
|
+
* @property {number} programsSize - The memory size of active programs in bytes.
|
|
106
|
+
* @property {number} readbackBuffers - The number of active readback buffers.
|
|
107
|
+
* @property {number} readbackBuffersSize - The memory size of active readback buffers in bytes.
|
|
105
108
|
* @property {number} renderTargets - The number of active renderTargets.
|
|
106
|
-
* @property {number}
|
|
107
|
-
* @property {number} texturesSize - The memory size of active textures in bytes.
|
|
108
|
-
* @property {number} attributesSize - The memory size of active attributes in bytes.
|
|
109
|
-
* @property {number} indexAttributesSize - The memory size of active index attributes in bytes.
|
|
109
|
+
* @property {number} storageAttributes - The number of active storage attributes.
|
|
110
110
|
* @property {number} storageAttributesSize - The memory size of active storage attributes in bytes.
|
|
111
|
-
* @property {number}
|
|
112
|
-
* @property {number}
|
|
113
|
-
* @property {number}
|
|
111
|
+
* @property {number} textures - The number of active textures.
|
|
112
|
+
* @property {number} texturesSize - The memory size of active textures in bytes.
|
|
113
|
+
* @property {number} uniformBuffers - The number of active uniform buffers.
|
|
114
|
+
* @property {number} uniformBuffersSize - The memory size of active uniform buffers in bytes.
|
|
115
|
+
* @property {number} total - The total memory size in bytes.
|
|
114
116
|
*/
|
|
115
117
|
this.memory = {
|
|
116
|
-
geometries: 0,
|
|
117
|
-
textures: 0,
|
|
118
118
|
attributes: 0,
|
|
119
|
+
attributesSize: 0,
|
|
120
|
+
geometries: 0,
|
|
119
121
|
indexAttributes: 0,
|
|
120
|
-
|
|
122
|
+
indexAttributesSize: 0,
|
|
121
123
|
indirectStorageAttributes: 0,
|
|
122
|
-
|
|
124
|
+
indirectStorageAttributesSize: 0,
|
|
123
125
|
programs: 0,
|
|
126
|
+
programsSize: 0,
|
|
127
|
+
readbackBuffers: 0,
|
|
128
|
+
readbackBuffersSize: 0,
|
|
124
129
|
renderTargets: 0,
|
|
125
|
-
|
|
126
|
-
texturesSize: 0,
|
|
127
|
-
attributesSize: 0,
|
|
128
|
-
indexAttributesSize: 0,
|
|
130
|
+
storageAttributes: 0,
|
|
129
131
|
storageAttributesSize: 0,
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
132
|
+
textures: 0,
|
|
133
|
+
texturesSize: 0,
|
|
134
|
+
uniformBuffers: 0,
|
|
135
|
+
uniformBuffersSize: 0,
|
|
136
|
+
total: 0
|
|
133
137
|
};
|
|
134
138
|
|
|
135
139
|
/**
|
|
@@ -365,6 +369,43 @@ class Info {
|
|
|
365
369
|
|
|
366
370
|
}
|
|
367
371
|
|
|
372
|
+
/**
|
|
373
|
+
* Tracks a uniform buffer memory explicitly.
|
|
374
|
+
*
|
|
375
|
+
* @param {UniformBuffer} uniformBuffer - The uniform buffer to track.
|
|
376
|
+
*/
|
|
377
|
+
createUniformBuffer( uniformBuffer ) {
|
|
378
|
+
|
|
379
|
+
const size = uniformBuffer.byteLength;
|
|
380
|
+
this.memoryMap.set( uniformBuffer, { size, type: 'uniformBuffers' } );
|
|
381
|
+
|
|
382
|
+
this.memory.uniformBuffers ++;
|
|
383
|
+
this.memory.total += size;
|
|
384
|
+
this.memory.uniformBuffersSize += size;
|
|
385
|
+
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Tracks a uniform buffer memory explicitly.
|
|
390
|
+
*
|
|
391
|
+
* @param {UniformBuffer} uniformBuffer - The uniform buffer to track.
|
|
392
|
+
*/
|
|
393
|
+
destroyUniformBuffer( uniformBuffer ) {
|
|
394
|
+
|
|
395
|
+
const data = this.memoryMap.get( uniformBuffer );
|
|
396
|
+
|
|
397
|
+
if ( data ) {
|
|
398
|
+
|
|
399
|
+
this.memoryMap.delete( uniformBuffer );
|
|
400
|
+
|
|
401
|
+
this.memory.uniformBuffers --;
|
|
402
|
+
this.memory.total -= data.size;
|
|
403
|
+
this.memory.uniformBuffersSize -= data.size;
|
|
404
|
+
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
}
|
|
408
|
+
|
|
368
409
|
/**
|
|
369
410
|
* Tracks program memory explicitly, updating counts and byte tracking.
|
|
370
411
|
*
|