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
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reusable descriptor for `GPUCommandEncoder.beginRenderPass()`.
|
|
3
|
+
*
|
|
4
|
+
* @private
|
|
5
|
+
*/
|
|
6
|
+
class GPURenderPassDescriptor {
|
|
7
|
+
|
|
8
|
+
constructor() {
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The label of the render pass.
|
|
12
|
+
*
|
|
13
|
+
* @type {string}
|
|
14
|
+
*/
|
|
15
|
+
this.label = '';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The color attachments of the render pass.
|
|
19
|
+
*
|
|
20
|
+
* @type {Array<?Object>}
|
|
21
|
+
*/
|
|
22
|
+
this.colorAttachments = [];
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The depth-stencil attachment of the render pass.
|
|
26
|
+
*
|
|
27
|
+
* @type {Object|undefined}
|
|
28
|
+
*/
|
|
29
|
+
this.depthStencilAttachment = undefined;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The query set used for occlusion queries during the pass.
|
|
33
|
+
*
|
|
34
|
+
* @type {?GPUQuerySet|undefined}
|
|
35
|
+
*/
|
|
36
|
+
this.occlusionQuerySet = undefined;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Defines which timestamp values are written and where.
|
|
40
|
+
*
|
|
41
|
+
* @type {Object|undefined}
|
|
42
|
+
*/
|
|
43
|
+
this.timestampWrites = undefined;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The maximum number of draw calls that can be issued during the pass.
|
|
47
|
+
*
|
|
48
|
+
* @type {number}
|
|
49
|
+
* @default 50000000
|
|
50
|
+
*/
|
|
51
|
+
this.maxDrawCount = 50000000;
|
|
52
|
+
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Resets the descriptor to its default state. The internal `colorAttachments`
|
|
57
|
+
* array is emptied without releasing its backing storage.
|
|
58
|
+
*/
|
|
59
|
+
reset() {
|
|
60
|
+
|
|
61
|
+
this.label = '';
|
|
62
|
+
this.colorAttachments.length = 0;
|
|
63
|
+
this.depthStencilAttachment = undefined;
|
|
64
|
+
this.occlusionQuerySet = undefined;
|
|
65
|
+
this.timestampWrites = undefined;
|
|
66
|
+
this.maxDrawCount = 50000000;
|
|
67
|
+
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export default GPURenderPassDescriptor;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reusable descriptor for `GPURenderPassTimestampWrites`, the
|
|
3
|
+
* `timestampWrites` field of `GPURenderPassDescriptor`. The same shape is
|
|
4
|
+
* also accepted as `GPUComputePassTimestampWrites`.
|
|
5
|
+
*
|
|
6
|
+
* @private
|
|
7
|
+
*/
|
|
8
|
+
class GPURenderPassTimestampWrites {
|
|
9
|
+
|
|
10
|
+
constructor() {
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The query set the timestamps are written to.
|
|
14
|
+
*
|
|
15
|
+
* @type {?GPUQuerySet}
|
|
16
|
+
* @default null
|
|
17
|
+
*/
|
|
18
|
+
this.querySet = null;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The index in the query set the beginning timestamp is written to.
|
|
22
|
+
*
|
|
23
|
+
* @type {number|undefined}
|
|
24
|
+
*/
|
|
25
|
+
this.beginningOfPassWriteIndex = undefined;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The index in the query set the ending timestamp is written to.
|
|
29
|
+
*
|
|
30
|
+
* @type {number|undefined}
|
|
31
|
+
*/
|
|
32
|
+
this.endOfPassWriteIndex = undefined;
|
|
33
|
+
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Resets the descriptor to its default state.
|
|
38
|
+
*/
|
|
39
|
+
reset() {
|
|
40
|
+
|
|
41
|
+
this.querySet = null;
|
|
42
|
+
this.beginningOfPassWriteIndex = undefined;
|
|
43
|
+
this.endOfPassWriteIndex = undefined;
|
|
44
|
+
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export default GPURenderPassTimestampWrites;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reusable descriptor for `GPUDevice.createRenderPipeline()` and
|
|
3
|
+
* `createRenderPipelineAsync()`.
|
|
4
|
+
*
|
|
5
|
+
* @private
|
|
6
|
+
*/
|
|
7
|
+
class GPURenderPipelineDescriptor {
|
|
8
|
+
|
|
9
|
+
constructor() {
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The label of the render pipeline.
|
|
13
|
+
*
|
|
14
|
+
* @type {string}
|
|
15
|
+
*/
|
|
16
|
+
this.label = '';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The pipeline layout the pipeline conforms to, or `'auto'`.
|
|
20
|
+
*
|
|
21
|
+
* @type {?GPUPipelineLayout|string}
|
|
22
|
+
* @default null
|
|
23
|
+
*/
|
|
24
|
+
this.layout = null;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The programmable vertex stage.
|
|
28
|
+
*
|
|
29
|
+
* @type {?Object}
|
|
30
|
+
* @default null
|
|
31
|
+
*/
|
|
32
|
+
this.vertex = null;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The primitive-assembly state.
|
|
36
|
+
*
|
|
37
|
+
* @type {Object}
|
|
38
|
+
*/
|
|
39
|
+
this.primitive = {};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The depth/stencil state, omitted when the pipeline has no depth or stencil aspect.
|
|
43
|
+
*
|
|
44
|
+
* @type {Object|undefined}
|
|
45
|
+
*/
|
|
46
|
+
this.depthStencil = undefined;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The multisample state.
|
|
50
|
+
*
|
|
51
|
+
* @type {GPUMultisampleState}
|
|
52
|
+
*/
|
|
53
|
+
this.multisample = new GPUMultisampleState();
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The programmable fragment stage. Omitted for vertex-only pipelines.
|
|
57
|
+
*
|
|
58
|
+
* @type {?Object}
|
|
59
|
+
* @default null
|
|
60
|
+
*/
|
|
61
|
+
this.fragment = null;
|
|
62
|
+
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Resets the descriptor to its default state.
|
|
67
|
+
*/
|
|
68
|
+
reset() {
|
|
69
|
+
|
|
70
|
+
this.label = '';
|
|
71
|
+
this.layout = null;
|
|
72
|
+
this.vertex = null;
|
|
73
|
+
this.primitive = {};
|
|
74
|
+
this.depthStencil = undefined;
|
|
75
|
+
this.multisample.reset();
|
|
76
|
+
this.fragment = null;
|
|
77
|
+
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Reusable nested state for `GPURenderPipelineDescriptor.multisample`.
|
|
84
|
+
*
|
|
85
|
+
* @private
|
|
86
|
+
*/
|
|
87
|
+
class GPUMultisampleState {
|
|
88
|
+
|
|
89
|
+
constructor() {
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* The number of samples per pixel.
|
|
93
|
+
*
|
|
94
|
+
* @type {number}
|
|
95
|
+
* @default 1
|
|
96
|
+
*/
|
|
97
|
+
this.count = 1;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* A bitmask determining which samples are written to.
|
|
101
|
+
*
|
|
102
|
+
* @type {number}
|
|
103
|
+
* @default 0xFFFFFFFF
|
|
104
|
+
*/
|
|
105
|
+
this.mask = 0xFFFFFFFF;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Whether a fragment's alpha channel is used to generate a sample coverage mask.
|
|
109
|
+
*
|
|
110
|
+
* @type {boolean}
|
|
111
|
+
* @default false
|
|
112
|
+
*/
|
|
113
|
+
this.alphaToCoverageEnabled = false;
|
|
114
|
+
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Resets the state to its default values.
|
|
119
|
+
*/
|
|
120
|
+
reset() {
|
|
121
|
+
|
|
122
|
+
this.count = 1;
|
|
123
|
+
this.mask = 0xFFFFFFFF;
|
|
124
|
+
this.alphaToCoverageEnabled = false;
|
|
125
|
+
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export default GPURenderPipelineDescriptor;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reusable descriptor for `GPUDevice.createSampler()`.
|
|
3
|
+
*
|
|
4
|
+
* @private
|
|
5
|
+
*/
|
|
6
|
+
class GPUSamplerDescriptor {
|
|
7
|
+
|
|
8
|
+
constructor() {
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The label of the sampler.
|
|
12
|
+
*
|
|
13
|
+
* @type {string}
|
|
14
|
+
*/
|
|
15
|
+
this.label = '';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The address mode for the sampler's U coordinate.
|
|
19
|
+
*
|
|
20
|
+
* @type {string}
|
|
21
|
+
* @default 'clamp-to-edge'
|
|
22
|
+
*/
|
|
23
|
+
this.addressModeU = 'clamp-to-edge';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The address mode for the sampler's V coordinate.
|
|
27
|
+
*
|
|
28
|
+
* @type {string}
|
|
29
|
+
* @default 'clamp-to-edge'
|
|
30
|
+
*/
|
|
31
|
+
this.addressModeV = 'clamp-to-edge';
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* The address mode for the sampler's W coordinate.
|
|
35
|
+
*
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @default 'clamp-to-edge'
|
|
38
|
+
*/
|
|
39
|
+
this.addressModeW = 'clamp-to-edge';
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The magnification filter mode.
|
|
43
|
+
*
|
|
44
|
+
* @type {string}
|
|
45
|
+
* @default 'nearest'
|
|
46
|
+
*/
|
|
47
|
+
this.magFilter = 'nearest';
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* The minification filter mode.
|
|
51
|
+
*
|
|
52
|
+
* @type {string}
|
|
53
|
+
* @default 'nearest'
|
|
54
|
+
*/
|
|
55
|
+
this.minFilter = 'nearest';
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* The mipmap filter mode.
|
|
59
|
+
*
|
|
60
|
+
* @type {string}
|
|
61
|
+
* @default 'nearest'
|
|
62
|
+
*/
|
|
63
|
+
this.mipmapFilter = 'nearest';
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* The minimum level of detail used to sample.
|
|
67
|
+
*
|
|
68
|
+
* @type {number}
|
|
69
|
+
* @default 0
|
|
70
|
+
*/
|
|
71
|
+
this.lodMinClamp = 0;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* The maximum level of detail used to sample.
|
|
75
|
+
*
|
|
76
|
+
* @type {number}
|
|
77
|
+
* @default 32
|
|
78
|
+
*/
|
|
79
|
+
this.lodMaxClamp = 32;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* The compare function used by the sampler.
|
|
83
|
+
*
|
|
84
|
+
* @type {string|undefined}
|
|
85
|
+
*/
|
|
86
|
+
this.compare = undefined;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* The maximum allowed anisotropic filtering.
|
|
90
|
+
*
|
|
91
|
+
* @type {number}
|
|
92
|
+
* @default 1
|
|
93
|
+
*/
|
|
94
|
+
this.maxAnisotropy = 1;
|
|
95
|
+
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Resets the descriptor to its default state.
|
|
100
|
+
*/
|
|
101
|
+
reset() {
|
|
102
|
+
|
|
103
|
+
this.label = '';
|
|
104
|
+
this.addressModeU = 'clamp-to-edge';
|
|
105
|
+
this.addressModeV = 'clamp-to-edge';
|
|
106
|
+
this.addressModeW = 'clamp-to-edge';
|
|
107
|
+
this.magFilter = 'nearest';
|
|
108
|
+
this.minFilter = 'nearest';
|
|
109
|
+
this.mipmapFilter = 'nearest';
|
|
110
|
+
this.lodMinClamp = 0;
|
|
111
|
+
this.lodMaxClamp = 32;
|
|
112
|
+
this.compare = undefined;
|
|
113
|
+
this.maxAnisotropy = 1;
|
|
114
|
+
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export default GPUSamplerDescriptor;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reusable descriptor for `GPUDevice.createShaderModule()`.
|
|
3
|
+
*
|
|
4
|
+
* @private
|
|
5
|
+
*/
|
|
6
|
+
class GPUShaderModuleDescriptor {
|
|
7
|
+
|
|
8
|
+
constructor() {
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The label of the shader module.
|
|
12
|
+
*
|
|
13
|
+
* @type {string}
|
|
14
|
+
*/
|
|
15
|
+
this.label = '';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The WGSL source code of the shader module.
|
|
19
|
+
*
|
|
20
|
+
* @type {string}
|
|
21
|
+
*/
|
|
22
|
+
this.code = '';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Compilation hints that may help the implementation produce optimized code.
|
|
26
|
+
*
|
|
27
|
+
* @type {Array<Object>}
|
|
28
|
+
*/
|
|
29
|
+
this.compilationHints = [];
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Resets the descriptor to its default state.
|
|
35
|
+
*/
|
|
36
|
+
reset() {
|
|
37
|
+
|
|
38
|
+
this.label = '';
|
|
39
|
+
this.code = '';
|
|
40
|
+
this.compilationHints.length = 0;
|
|
41
|
+
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export default GPUShaderModuleDescriptor;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reusable descriptor for `GPUTexelCopyBufferInfo`, the buffer side of
|
|
3
|
+
* `GPUCommandEncoder.copyTextureToBuffer()` and `copyBufferToTexture()`.
|
|
4
|
+
*
|
|
5
|
+
* @private
|
|
6
|
+
*/
|
|
7
|
+
class GPUTexelCopyBufferInfo {
|
|
8
|
+
|
|
9
|
+
constructor() {
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The target buffer.
|
|
13
|
+
*
|
|
14
|
+
* @type {?GPUBuffer}
|
|
15
|
+
* @default null
|
|
16
|
+
*/
|
|
17
|
+
this.buffer = null;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The byte offset within the buffer where the texel data begins.
|
|
21
|
+
*
|
|
22
|
+
* @type {number}
|
|
23
|
+
* @default 0
|
|
24
|
+
*/
|
|
25
|
+
this.offset = 0;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The stride, in bytes, between rows of texel blocks.
|
|
29
|
+
*
|
|
30
|
+
* @type {number|undefined}
|
|
31
|
+
*/
|
|
32
|
+
this.bytesPerRow = undefined;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* The number of texel block rows per single image of the texture.
|
|
36
|
+
*
|
|
37
|
+
* @type {number|undefined}
|
|
38
|
+
*/
|
|
39
|
+
this.rowsPerImage = undefined;
|
|
40
|
+
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Resets the descriptor to its default state.
|
|
45
|
+
*/
|
|
46
|
+
reset() {
|
|
47
|
+
|
|
48
|
+
this.buffer = null;
|
|
49
|
+
this.offset = 0;
|
|
50
|
+
this.bytesPerRow = undefined;
|
|
51
|
+
this.rowsPerImage = undefined;
|
|
52
|
+
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export default GPUTexelCopyBufferInfo;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reusable descriptor for `GPUTexelCopyBufferLayout`, the data-layout argument
|
|
3
|
+
* to `GPUQueue.writeTexture()`.
|
|
4
|
+
*
|
|
5
|
+
* @private
|
|
6
|
+
*/
|
|
7
|
+
class GPUTexelCopyBufferLayout {
|
|
8
|
+
|
|
9
|
+
constructor() {
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The byte offset within the source data where the texel data begins.
|
|
13
|
+
*
|
|
14
|
+
* @type {number}
|
|
15
|
+
* @default 0
|
|
16
|
+
*/
|
|
17
|
+
this.offset = 0;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The stride, in bytes, between rows of texel blocks.
|
|
21
|
+
*
|
|
22
|
+
* @type {number|undefined}
|
|
23
|
+
*/
|
|
24
|
+
this.bytesPerRow = undefined;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The number of texel block rows per single image of the texture.
|
|
28
|
+
*
|
|
29
|
+
* @type {number|undefined}
|
|
30
|
+
*/
|
|
31
|
+
this.rowsPerImage = undefined;
|
|
32
|
+
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Resets the descriptor to its default state.
|
|
37
|
+
*/
|
|
38
|
+
reset() {
|
|
39
|
+
|
|
40
|
+
this.offset = 0;
|
|
41
|
+
this.bytesPerRow = undefined;
|
|
42
|
+
this.rowsPerImage = undefined;
|
|
43
|
+
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export default GPUTexelCopyBufferLayout;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reusable descriptor for `GPUTexelCopyTextureInfo`, the texture side of
|
|
3
|
+
* `GPUCommandEncoder.copyTextureToTexture()`, `copyTextureToBuffer()` and
|
|
4
|
+
* `GPUQueue.writeTexture()`.
|
|
5
|
+
*
|
|
6
|
+
* @private
|
|
7
|
+
*/
|
|
8
|
+
class GPUTexelCopyTextureInfo {
|
|
9
|
+
|
|
10
|
+
constructor() {
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The target texture.
|
|
14
|
+
*
|
|
15
|
+
* @type {?GPUTexture}
|
|
16
|
+
* @default null
|
|
17
|
+
*/
|
|
18
|
+
this.texture = null;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The mipmap level of the texture.
|
|
22
|
+
*
|
|
23
|
+
* @type {number}
|
|
24
|
+
* @default 0
|
|
25
|
+
*/
|
|
26
|
+
this.mipLevel = 0;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The origin offset within the texture.
|
|
30
|
+
*
|
|
31
|
+
* @type {{x: number, y: number, z: number}}
|
|
32
|
+
*/
|
|
33
|
+
this.origin = { x: 0, y: 0, z: 0 };
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Which aspect of the texture is referenced.
|
|
37
|
+
*
|
|
38
|
+
* @type {string}
|
|
39
|
+
* @default 'all'
|
|
40
|
+
*/
|
|
41
|
+
this.aspect = 'all';
|
|
42
|
+
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Resets the descriptor to its default state.
|
|
47
|
+
*/
|
|
48
|
+
reset() {
|
|
49
|
+
|
|
50
|
+
this.texture = null;
|
|
51
|
+
this.mipLevel = 0;
|
|
52
|
+
this.origin.x = 0;
|
|
53
|
+
this.origin.y = 0;
|
|
54
|
+
this.origin.z = 0;
|
|
55
|
+
this.aspect = 'all';
|
|
56
|
+
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export default GPUTexelCopyTextureInfo;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reusable descriptor for `GPUDevice.createTexture()`.
|
|
3
|
+
*
|
|
4
|
+
* @private
|
|
5
|
+
*/
|
|
6
|
+
class GPUTextureDescriptor {
|
|
7
|
+
|
|
8
|
+
constructor() {
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The label of the texture.
|
|
12
|
+
*
|
|
13
|
+
* @type {string}
|
|
14
|
+
*/
|
|
15
|
+
this.label = '';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The size of the texture.
|
|
19
|
+
*
|
|
20
|
+
* @type {{width: number, height: number, depthOrArrayLayers: number}}
|
|
21
|
+
*/
|
|
22
|
+
this.size = { width: 0, height: 1, depthOrArrayLayers: 1 };
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* The number of mip levels the texture will contain.
|
|
26
|
+
*
|
|
27
|
+
* @type {number}
|
|
28
|
+
* @default 1
|
|
29
|
+
*/
|
|
30
|
+
this.mipLevelCount = 1;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* The sample count of the texture.
|
|
34
|
+
*
|
|
35
|
+
* @type {number}
|
|
36
|
+
* @default 1
|
|
37
|
+
*/
|
|
38
|
+
this.sampleCount = 1;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The dimension of the set of texel coordinates.
|
|
42
|
+
*
|
|
43
|
+
* @type {string}
|
|
44
|
+
* @default '2d'
|
|
45
|
+
*/
|
|
46
|
+
this.dimension = '2d';
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The format of the texture.
|
|
50
|
+
*
|
|
51
|
+
* @type {string|undefined}
|
|
52
|
+
*/
|
|
53
|
+
this.format = undefined;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The allowed usages for the texture.
|
|
57
|
+
*
|
|
58
|
+
* @type {number|undefined}
|
|
59
|
+
*/
|
|
60
|
+
this.usage = undefined;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* The formats that views of this texture may use.
|
|
64
|
+
*
|
|
65
|
+
* @type {Array<string>}
|
|
66
|
+
*/
|
|
67
|
+
this.viewFormats = [];
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* The view dimension to use when binding the texture (compatibility mode).
|
|
71
|
+
*
|
|
72
|
+
* @type {string|undefined}
|
|
73
|
+
*/
|
|
74
|
+
this.textureBindingViewDimension = undefined;
|
|
75
|
+
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Resets the descriptor to its default state.
|
|
80
|
+
*/
|
|
81
|
+
reset() {
|
|
82
|
+
|
|
83
|
+
this.label = '';
|
|
84
|
+
this.size.width = 0;
|
|
85
|
+
this.size.height = 1;
|
|
86
|
+
this.size.depthOrArrayLayers = 1;
|
|
87
|
+
this.mipLevelCount = 1;
|
|
88
|
+
this.sampleCount = 1;
|
|
89
|
+
this.dimension = '2d';
|
|
90
|
+
this.format = undefined;
|
|
91
|
+
this.usage = undefined;
|
|
92
|
+
this.viewFormats.length = 0;
|
|
93
|
+
this.textureBindingViewDimension = undefined;
|
|
94
|
+
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export default GPUTextureDescriptor;
|