@types/three 0.179.0 → 0.181.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.
- three/README.md +1 -1
- three/examples/jsm/Addons.d.ts +1 -1
- three/examples/jsm/controls/DragControls.d.ts +0 -30
- three/examples/jsm/controls/PointerLockControls.d.ts +0 -5
- three/examples/jsm/exporters/DRACOExporter.d.ts +1 -1
- three/examples/jsm/exporters/EXRExporter.d.ts +2 -2
- three/examples/jsm/exporters/KTX2Exporter.d.ts +2 -2
- three/examples/jsm/exporters/STLExporter.d.ts +2 -2
- three/examples/jsm/exporters/USDZExporter.d.ts +2 -2
- three/examples/jsm/geometries/TextGeometry.d.ts +2 -0
- three/examples/jsm/gpgpu/BitonicSort.d.ts +21 -0
- three/examples/jsm/inspector/Inspector.d.ts +10 -0
- three/examples/jsm/inspector/RendererInspector.d.ts +4 -0
- three/examples/jsm/inspector/tabs/Parameters.d.ts +95 -0
- three/examples/jsm/inspector/ui/Tab.d.ts +3 -0
- three/examples/jsm/inspector/ui/Values.d.ts +80 -0
- three/examples/jsm/interactive/SelectionBox.d.ts +9 -9
- three/examples/jsm/lighting/TiledLighting.d.ts +1 -2
- three/examples/jsm/loaders/FontLoader.d.ts +1 -1
- three/examples/jsm/loaders/HDRCubeTextureLoader.d.ts +2 -2
- three/examples/jsm/loaders/HDRLoader.d.ts +22 -0
- three/examples/jsm/loaders/KTX2Loader.d.ts +3 -0
- three/examples/jsm/loaders/LDrawLoader.d.ts +5 -1
- three/examples/jsm/loaders/RGBELoader.d.ts +9 -15
- three/examples/jsm/materials/WoodNodeMaterial.d.ts +75 -0
- three/examples/jsm/math/ColorSpaces.d.ts +4 -0
- three/examples/jsm/objects/SkyMesh.d.ts +6 -7
- three/examples/jsm/objects/WaterMesh.d.ts +2 -2
- three/examples/jsm/postprocessing/SSRPass.d.ts +6 -29
- three/examples/jsm/renderers/CSS2DRenderer.d.ts +15 -10
- three/examples/jsm/tsl/display/AfterImageNode.d.ts +4 -5
- three/examples/jsm/tsl/display/AnaglyphPassNode.d.ts +1 -2
- three/examples/jsm/tsl/display/AnamorphicNode.d.ts +11 -3
- three/examples/jsm/tsl/display/BleachBypass.d.ts +1 -2
- three/examples/jsm/tsl/display/BloomNode.d.ts +2 -3
- three/examples/jsm/tsl/display/ChromaticAberrationNode.d.ts +1 -2
- three/examples/jsm/tsl/display/DenoiseNode.d.ts +1 -2
- three/examples/jsm/tsl/display/DepthOfFieldNode.d.ts +15 -10
- three/examples/jsm/tsl/display/DotScreenNode.d.ts +1 -2
- three/examples/jsm/tsl/display/FXAANode.d.ts +1 -2
- three/examples/jsm/tsl/display/FilmNode.d.ts +1 -2
- three/examples/jsm/tsl/display/GTAONode.d.ts +11 -10
- three/examples/jsm/tsl/display/GaussianBlurNode.d.ts +28 -9
- three/examples/jsm/tsl/display/LensflareNode.d.ts +6 -7
- three/examples/jsm/tsl/display/Lut3DNode.d.ts +2 -3
- three/examples/jsm/tsl/display/MotionBlur.d.ts +1 -2
- three/examples/jsm/tsl/display/OutlineNode.d.ts +6 -7
- three/examples/jsm/tsl/display/ParallaxBarrierPassNode.d.ts +1 -2
- three/examples/jsm/tsl/display/PixelationPassNode.d.ts +1 -2
- three/examples/jsm/tsl/display/RGBShiftNode.d.ts +1 -2
- three/examples/jsm/tsl/display/SMAANode.d.ts +1 -2
- three/examples/jsm/tsl/display/SSAAPassNode.d.ts +1 -2
- three/examples/jsm/tsl/display/SSGINode.d.ts +30 -0
- three/examples/jsm/tsl/display/SSRNode.d.ts +18 -14
- three/examples/jsm/tsl/display/SSSNode.d.ts +18 -0
- three/examples/jsm/tsl/display/Sepia.d.ts +1 -2
- three/examples/jsm/tsl/display/SobelOperatorNode.d.ts +1 -2
- three/examples/jsm/tsl/display/StereoPassNode.d.ts +1 -2
- three/examples/jsm/tsl/display/TRAANode.d.ts +1 -2
- three/examples/jsm/tsl/display/TransitionNode.d.ts +1 -2
- three/examples/jsm/tsl/display/boxBlur.d.ts +10 -0
- three/examples/jsm/tsl/display/hashBlur.d.ts +2 -3
- three/examples/jsm/tsl/lighting/TiledLightsNode.d.ts +3 -4
- three/examples/jsm/tsl/math/Bayer.d.ts +1 -2
- three/examples/jsm/tsl/utils/Raymarching.d.ts +2 -3
- three/package.json +2 -2
- three/src/Three.Core.d.ts +2 -1
- three/src/Three.TSL.d.ts +36 -5
- three/src/Three.WebGPU.Nodes.d.ts +2 -0
- three/src/Three.WebGPU.d.ts +2 -0
- three/src/animation/AnimationClip.d.ts +5 -0
- three/src/animation/AnimationMixer.d.ts +3 -3
- three/src/constants.d.ts +3 -1
- three/src/lights/DirectionalLight.d.ts +0 -1
- three/src/loaders/ObjectLoader.d.ts +3 -3
- three/src/loaders/TextureLoader.d.ts +3 -3
- three/src/materials/LineBasicMaterial.d.ts +1 -0
- three/src/materials/LineDashedMaterial.d.ts +1 -0
- three/src/materials/Material.d.ts +2 -2
- three/src/materials/MeshBasicMaterial.d.ts +1 -0
- three/src/materials/MeshDepthMaterial.d.ts +1 -0
- three/src/materials/MeshDistanceMaterial.d.ts +2 -1
- three/src/materials/MeshLambertMaterial.d.ts +2 -1
- three/src/materials/MeshMatcapMaterial.d.ts +15 -0
- three/src/materials/MeshNormalMaterial.d.ts +1 -0
- three/src/materials/MeshPhongMaterial.d.ts +2 -1
- three/src/materials/MeshPhysicalMaterial.d.ts +1 -1
- three/src/materials/MeshStandardMaterial.d.ts +7 -7
- three/src/materials/MeshToonMaterial.d.ts +1 -0
- three/src/materials/PointsMaterial.d.ts +2 -1
- three/src/materials/ShaderMaterial.d.ts +9 -8
- three/src/materials/ShadowMaterial.d.ts +1 -0
- three/src/materials/SpriteMaterial.d.ts +1 -0
- three/src/materials/nodes/Line2NodeMaterial.d.ts +1 -0
- three/src/materials/nodes/LineBasicNodeMaterial.d.ts +1 -0
- three/src/materials/nodes/LineDashedNodeMaterial.d.ts +1 -0
- three/src/materials/nodes/MeshBasicNodeMaterial.d.ts +1 -0
- three/src/materials/nodes/MeshLambertNodeMaterial.d.ts +1 -0
- three/src/materials/nodes/MeshMatcapNodeMaterial.d.ts +1 -0
- three/src/materials/nodes/MeshNormalNodeMaterial.d.ts +1 -0
- three/src/materials/nodes/MeshPhongNodeMaterial.d.ts +1 -0
- three/src/materials/nodes/MeshPhysicalNodeMaterial.d.ts +1 -0
- three/src/materials/nodes/MeshSSSNodeMaterial.d.ts +2 -1
- three/src/materials/nodes/MeshStandardNodeMaterial.d.ts +1 -0
- three/src/materials/nodes/MeshToonNodeMaterial.d.ts +1 -0
- three/src/materials/nodes/NodeMaterial.d.ts +3 -3
- three/src/materials/nodes/PointsNodeMaterial.d.ts +17 -0
- three/src/materials/nodes/ShadowNodeMaterial.d.ts +1 -0
- three/src/materials/nodes/SpriteNodeMaterial.d.ts +1 -0
- three/src/materials/nodes/VolumeNodeMaterial.d.ts +2 -2
- three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +1 -1
- three/src/math/ColorManagement.d.ts +1 -1
- three/src/math/Vector3.d.ts +2 -2
- three/src/nodes/Nodes.d.ts +4 -1
- three/src/nodes/TSL.d.ts +4 -1
- three/src/nodes/accessors/AccessorsUtils.d.ts +4 -5
- three/src/nodes/accessors/Arrays.d.ts +2 -3
- three/src/nodes/accessors/BatchNode.d.ts +1 -2
- three/src/nodes/accessors/Bitangent.d.ts +4 -5
- three/src/nodes/accessors/BufferAttributeNode.d.ts +8 -9
- three/src/nodes/accessors/BufferNode.d.ts +2 -2
- three/src/nodes/accessors/BuiltinNode.d.ts +1 -2
- three/src/nodes/accessors/Camera.d.ts +11 -10
- three/src/nodes/accessors/ClippingNode.d.ts +3 -6
- three/src/nodes/accessors/CubeTextureNode.d.ts +8 -9
- three/src/nodes/accessors/InstanceNode.d.ts +1 -2
- three/src/nodes/accessors/InstancedMeshNode.d.ts +1 -2
- three/src/nodes/accessors/Lights.d.ts +6 -7
- three/src/nodes/accessors/MaterialNode.d.ts +38 -39
- three/src/nodes/accessors/MaterialProperties.d.ts +3 -4
- three/src/nodes/accessors/MaterialReferenceNode.d.ts +2 -2
- three/src/nodes/accessors/ModelNode.d.ts +12 -13
- three/src/nodes/accessors/ModelViewProjectionNode.d.ts +1 -2
- three/src/nodes/accessors/MorphNode.d.ts +1 -2
- three/src/nodes/accessors/Normal.d.ts +13 -14
- three/src/nodes/accessors/Object3DNode.d.ts +6 -7
- three/src/nodes/accessors/PointUVNode.d.ts +1 -2
- three/src/nodes/accessors/Position.d.ts +7 -8
- three/src/nodes/accessors/ReferenceBaseNode.d.ts +2 -3
- three/src/nodes/accessors/ReferenceNode.d.ts +2 -3
- three/src/nodes/accessors/ReflectVector.d.ts +4 -5
- three/src/nodes/accessors/RendererReferenceNode.d.ts +1 -2
- three/src/nodes/accessors/SceneNode.d.ts +3 -4
- three/src/nodes/accessors/SkinningNode.d.ts +5 -6
- three/src/nodes/accessors/StorageBufferNode.d.ts +5 -5
- three/src/nodes/accessors/StorageTextureNode.d.ts +7 -4
- three/src/nodes/accessors/Tangent.d.ts +4 -6
- three/src/nodes/accessors/TangentUtils.d.ts +2 -3
- three/src/nodes/accessors/Texture3DNode.d.ts +3 -4
- three/src/nodes/accessors/TextureBicubic.d.ts +2 -3
- three/src/nodes/accessors/TextureNode.d.ts +31 -24
- three/src/nodes/accessors/TextureSizeNode.d.ts +1 -2
- three/src/nodes/accessors/UV.d.ts +1 -2
- three/src/nodes/accessors/UniformArrayNode.d.ts +2 -3
- three/src/nodes/accessors/UserDataNode.d.ts +1 -2
- three/src/nodes/accessors/VelocityNode.d.ts +1 -2
- three/src/nodes/accessors/VertexColorNode.d.ts +1 -2
- three/src/nodes/code/CodeNode.d.ts +4 -5
- three/src/nodes/code/ExpressionNode.d.ts +1 -2
- three/src/nodes/code/FunctionCallNode.d.ts +6 -5
- three/src/nodes/code/FunctionNode.d.ts +4 -6
- three/src/nodes/code/ScriptableNode.d.ts +1 -2
- three/src/nodes/code/ScriptableValueNode.d.ts +1 -2
- three/src/nodes/core/ArrayNode.d.ts +6 -6
- three/src/nodes/core/AssignNode.d.ts +1 -8
- three/src/nodes/core/AttributeNode.d.ts +1 -2
- three/src/nodes/core/BypassNode.d.ts +5 -5
- three/src/nodes/core/ContextNode.d.ts +25 -9
- three/src/nodes/core/IndexNode.d.ts +10 -7
- three/src/nodes/core/InspectorNode.d.ts +16 -0
- three/src/nodes/core/IsolateNode.d.ts +36 -0
- three/src/nodes/core/MRTNode.d.ts +3 -4
- three/src/nodes/core/Node.d.ts +22 -13
- three/src/nodes/core/NodeUtils.d.ts +0 -10
- three/src/nodes/core/OutputStructNode.d.ts +1 -2
- three/src/nodes/core/ParameterNode.d.ts +1 -2
- three/src/nodes/core/PropertyNode.d.ts +30 -31
- three/src/nodes/core/StackNode.d.ts +1 -4
- three/src/nodes/core/StructNode.d.ts +3 -4
- three/src/nodes/core/SubBuildNode.d.ts +1 -2
- three/src/nodes/core/UniformNode.d.ts +5 -8
- three/src/nodes/core/VarNode.d.ts +11 -21
- three/src/nodes/core/VaryingNode.d.ts +12 -10
- three/src/nodes/display/BlendModes.d.ts +11 -12
- three/src/nodes/display/BumpMapNode.d.ts +1 -2
- three/src/nodes/display/ColorAdjustment.d.ts +7 -8
- three/src/nodes/display/ColorSpaceFunctions.d.ts +2 -3
- three/src/nodes/display/ColorSpaceNode.d.ts +19 -9
- three/src/nodes/display/FrontFacingNode.d.ts +3 -4
- three/src/nodes/display/NormalMapNode.d.ts +1 -2
- three/src/nodes/display/PassNode.d.ts +20 -11
- three/src/nodes/display/PosterizeNode.d.ts +1 -2
- three/src/nodes/display/RenderOutputNode.d.ts +11 -6
- three/src/nodes/display/ScreenNode.d.ts +12 -10
- three/src/nodes/display/ToneMappingFunctions.d.ts +6 -7
- three/src/nodes/display/ToneMappingNode.d.ts +11 -10
- three/src/nodes/display/ToonOutlinePassNode.d.ts +1 -2
- three/src/nodes/display/ViewportDepthNode.d.ts +3 -4
- three/src/nodes/display/ViewportDepthTextureNode.d.ts +4 -2
- three/src/nodes/display/ViewportSharedTextureNode.d.ts +4 -2
- three/src/nodes/display/ViewportTextureNode.d.ts +6 -3
- three/src/nodes/fog/Fog.d.ts +5 -6
- three/src/nodes/functions/BSDF/BRDF_GGX.d.ts +4 -5
- three/src/nodes/functions/BSDF/BRDF_GGX_Multiscatter.d.ts +14 -0
- three/src/nodes/functions/BSDF/BRDF_Lambert.d.ts +1 -2
- three/src/nodes/functions/BSDF/BRDF_Sheen.d.ts +1 -2
- three/src/nodes/functions/BSDF/DFGApprox.d.ts +1 -2
- three/src/nodes/functions/BSDF/D_GGX.d.ts +1 -2
- three/src/nodes/functions/BSDF/D_GGX_Anisotropic.d.ts +1 -2
- three/src/nodes/functions/BSDF/F_Schlick.d.ts +1 -2
- three/src/nodes/functions/BSDF/Schlick_to_F0.d.ts +1 -2
- three/src/nodes/functions/BSDF/V_GGX_SmithCorrelated.d.ts +1 -2
- three/src/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.d.ts +1 -2
- three/src/nodes/functions/ShadowMaskModel.d.ts +1 -2
- three/src/nodes/functions/material/getAlphaHashThreshold.d.ts +1 -2
- three/src/nodes/functions/material/getGeometryRoughness.d.ts +1 -2
- three/src/nodes/functions/material/getParallaxCorrectNormal.d.ts +1 -2
- three/src/nodes/functions/material/getRoughness.d.ts +1 -2
- three/src/nodes/functions/material/getShIrradianceAt.d.ts +1 -2
- three/src/nodes/geometry/RangeNode.d.ts +1 -2
- three/src/nodes/gpgpu/AtomicFunctionNode.d.ts +10 -11
- three/src/nodes/gpgpu/BarrierNode.d.ts +3 -4
- three/src/nodes/gpgpu/ComputeBuiltinNode.d.ts +5 -6
- three/src/nodes/gpgpu/ComputeNode.d.ts +21 -13
- three/src/nodes/gpgpu/SubgroupFunctionNode.d.ts +99 -0
- three/src/nodes/gpgpu/WorkgroupInfoNode.d.ts +1 -2
- three/src/nodes/lighting/AnalyticLightNode.d.ts +1 -2
- three/src/nodes/lighting/LightUtils.d.ts +1 -2
- three/src/nodes/lighting/LightingContextNode.d.ts +1 -2
- three/src/nodes/lighting/LightsNode.d.ts +1 -2
- three/src/nodes/lighting/PointLightNode.d.ts +5 -6
- three/src/nodes/lighting/PointShadowNode.d.ts +4 -5
- three/src/nodes/lighting/ShadowBaseNode.d.ts +1 -2
- three/src/nodes/lighting/ShadowFilterNode.d.ts +4 -5
- three/src/nodes/lighting/ShadowNode.d.ts +1 -2
- three/src/nodes/lighting/SpotLightNode.d.ts +1 -2
- three/src/nodes/materialx/MaterialXNodes.d.ts +41 -42
- three/src/nodes/materialx/lib/mx_hsv.d.ts +2 -3
- three/src/nodes/materialx/lib/mx_noise.d.ts +73 -74
- three/src/nodes/materialx/lib/mx_transform_color.d.ts +1 -2
- three/src/nodes/math/BitcastNode.d.ts +24 -0
- three/src/nodes/math/ConditionalNode.d.ts +11 -5
- three/src/nodes/math/Hash.d.ts +1 -2
- three/src/nodes/math/MathNode.d.ts +223 -80
- three/src/nodes/math/OperatorNode.d.ts +203 -59
- three/src/nodes/math/TriNoise3D.d.ts +3 -4
- three/src/nodes/pmrem/PMREMNode.d.ts +1 -2
- three/src/nodes/pmrem/PMREMUtils.d.ts +3 -4
- three/src/nodes/procedural/Checker.d.ts +1 -2
- three/src/nodes/shapes/Shapes.d.ts +1 -2
- three/src/nodes/tsl/TSLBase.d.ts +2 -1
- three/src/nodes/tsl/TSLCore.d.ts +235 -128
- three/src/nodes/utils/CubeMapNode.d.ts +1 -2
- three/src/nodes/utils/DebugNode.d.ts +9 -5
- three/src/nodes/utils/Discard.d.ts +6 -6
- three/src/nodes/utils/EquirectUV.d.ts +1 -2
- three/src/nodes/utils/EventNode.d.ts +8 -3
- three/src/nodes/utils/FunctionOverloadingNode.d.ts +1 -2
- three/src/nodes/utils/LoopNode.d.ts +7 -6
- three/src/nodes/utils/MatcapUV.d.ts +1 -2
- three/src/nodes/utils/MaxMipLevelNode.d.ts +1 -2
- three/src/nodes/utils/Oscillators.d.ts +4 -5
- three/src/nodes/utils/Packing.d.ts +2 -3
- three/src/nodes/utils/PostProcessingUtils.d.ts +5 -4
- three/src/nodes/utils/RTTNode.d.ts +2 -3
- three/src/nodes/utils/ReflectorNode.d.ts +18 -4
- three/src/nodes/utils/RemapNode.d.ts +29 -7
- three/src/nodes/utils/RotateNode.d.ts +1 -2
- three/src/nodes/utils/SampleNode.d.ts +3 -3
- three/src/nodes/utils/SpriteSheetUVNode.d.ts +1 -2
- three/src/nodes/utils/SpriteUtils.d.ts +1 -2
- three/src/nodes/utils/StorageArrayElementNode.d.ts +1 -2
- three/src/nodes/utils/Timer.d.ts +3 -19
- three/src/nodes/utils/TriplanarTextures.d.ts +2 -3
- three/src/nodes/utils/UVUtils.d.ts +2 -3
- three/src/nodes/utils/ViewportUtils.d.ts +1 -2
- three/src/objects/InstancedMesh.d.ts +2 -3
- three/src/renderers/WebGLRenderer.d.ts +0 -25
- three/src/renderers/common/Animation.d.ts +4 -1
- three/src/renderers/common/Attributes.d.ts +1 -1
- three/src/renderers/common/Bindings.d.ts +12 -0
- three/src/renderers/common/CanvasTarget.d.ts +142 -0
- three/src/renderers/common/Geometries.d.ts +1 -0
- three/src/renderers/common/InspectorBase.d.ts +105 -0
- three/src/renderers/common/PostProcessing.d.ts +3 -0
- three/src/renderers/common/QuadMesh.d.ts +3 -0
- three/src/renderers/common/RenderContexts.d.ts +3 -1
- three/src/renderers/common/Renderer.d.ts +125 -37
- three/src/renderers/common/SampledTexture.d.ts +2 -0
- three/src/renderers/common/Sampler.d.ts +2 -0
- three/src/renderers/common/Textures.d.ts +21 -1
- three/src/renderers/common/TimestampQueryPool.d.ts +26 -4
- three/src/renderers/common/XRManager.d.ts +10 -0
- three/src/renderers/common/extras/PMREMGenerator.d.ts +19 -1
- three/src/renderers/common/nodes/NodeLibrary.d.ts +8 -12
- three/src/renderers/common/nodes/Nodes.d.ts +13 -14
- three/src/renderers/webgpu/utils/WebGPUConstants.d.ts +6 -1
- three/src/scenes/Scene.d.ts +2 -2
- three/src/textures/CanvasTexture.d.ts +3 -3
- three/src/textures/CompressedArrayTexture.d.ts +6 -9
- three/src/textures/CompressedCubeTexture.d.ts +3 -3
- three/src/textures/CompressedTexture.d.ts +10 -12
- three/src/textures/CubeTexture.d.ts +4 -11
- three/src/textures/Data3DTexture.d.ts +7 -11
- three/src/textures/DataArrayTexture.d.ts +10 -10
- three/src/textures/DataTexture.d.ts +6 -12
- three/src/textures/DepthTexture.d.ts +7 -8
- three/src/textures/ExternalTexture.d.ts +5 -3
- three/src/textures/FramebufferTexture.d.ts +6 -1
- three/src/textures/Source.d.ts +3 -3
- three/src/textures/Texture.d.ts +9 -9
- three/src/textures/VideoFrameTexture.d.ts +1 -1
- three/src/textures/VideoTexture.d.ts +2 -2
- three/src/utils.d.ts +18 -2
- three/examples/jsm/loaders/RGBMLoader.d.ts +0 -37
- three/src/nodes/core/CacheNode.d.ts +0 -21
|
@@ -4,7 +4,6 @@ import { Material } from "../../../materials/Material.js";
|
|
|
4
4
|
import NodeMaterial from "../../../materials/nodes/NodeMaterial.js";
|
|
5
5
|
import Node from "../../../nodes/core/Node.js";
|
|
6
6
|
import AnalyticLightNode from "../../../nodes/lighting/AnalyticLightNode.js";
|
|
7
|
-
import { ShaderNodeObject } from "../../../nodes/tsl/TSLCore.js";
|
|
8
7
|
/**
|
|
9
8
|
* The purpose of a node library is to assign node implementations
|
|
10
9
|
* to existing library features. In `WebGPURenderer` lights, materials
|
|
@@ -22,7 +21,7 @@ declare class NodeLibrary {
|
|
|
22
21
|
materialNodes: Map<string, {
|
|
23
22
|
new(): NodeMaterial;
|
|
24
23
|
}>;
|
|
25
|
-
toneMappingNodes: Map<ToneMapping, (color: Node, exposure: Node) =>
|
|
24
|
+
toneMappingNodes: Map<ToneMapping, (color: Node, exposure: Node) => Node>;
|
|
26
25
|
/**
|
|
27
26
|
* Constructs a new node library.
|
|
28
27
|
*/
|
|
@@ -44,17 +43,14 @@ declare class NodeLibrary {
|
|
|
44
43
|
* @param {Function} toneMappingNode - The tone mapping node function.
|
|
45
44
|
* @param {number} toneMapping - The tone mapping.
|
|
46
45
|
*/
|
|
47
|
-
addToneMapping(
|
|
48
|
-
toneMappingNode: (color: Node, exposure: Node) => ShaderNodeObject<Node>,
|
|
49
|
-
toneMapping: ToneMapping,
|
|
50
|
-
): void;
|
|
46
|
+
addToneMapping(toneMappingNode: (color: Node, exposure: Node) => Node, toneMapping: ToneMapping): void;
|
|
51
47
|
/**
|
|
52
48
|
* Returns a tone mapping node function for a tone mapping technique (constant).
|
|
53
49
|
*
|
|
54
50
|
* @param {number} toneMapping - The tone mapping.
|
|
55
51
|
* @return {?Function} The tone mapping node function. Returns `null` if no node function is found.
|
|
56
52
|
*/
|
|
57
|
-
getToneMappingFunction(toneMapping: ToneMapping): ((color: Node, exposure: Node) =>
|
|
53
|
+
getToneMappingFunction(toneMapping: ToneMapping): ((color: Node, exposure: Node) => Node) | null;
|
|
58
54
|
/**
|
|
59
55
|
* Returns a node material class definition for a material type.
|
|
60
56
|
*
|
|
@@ -92,17 +88,17 @@ declare class NodeLibrary {
|
|
|
92
88
|
/**
|
|
93
89
|
* Adds a node class definition for the given type to the provided type library.
|
|
94
90
|
*
|
|
95
|
-
* @param {
|
|
91
|
+
* @param {Node.constructor} nodeClass - The node class definition.
|
|
96
92
|
* @param {number|string} type - The object type.
|
|
97
|
-
* @param {Map} library - The type library.
|
|
93
|
+
* @param {Map<number|string,Node.constructor>} library - The type library.
|
|
98
94
|
*/
|
|
99
95
|
addType<TNodeClass, TType>(nodeClass: TNodeClass, type: TType, library: Map<TType, TNodeClass>): void;
|
|
100
96
|
/**
|
|
101
97
|
* Adds a node class definition for the given class definition to the provided type library.
|
|
102
98
|
*
|
|
103
|
-
* @param {
|
|
104
|
-
* @param {
|
|
105
|
-
* @param {WeakMap} library - The type library.
|
|
99
|
+
* @param {Node.constructor} nodeClass - The node class definition.
|
|
100
|
+
* @param {Node.constructor} baseClass - The class definition.
|
|
101
|
+
* @param {WeakMap<Node.constructor, Node.constructor>} library - The type library.
|
|
106
102
|
*/
|
|
107
103
|
addClass<TNodeClass, TBaseClass extends object>(
|
|
108
104
|
nodeClass: TNodeClass,
|
|
@@ -8,7 +8,6 @@ import UniformGroupNode from "../../../nodes/core/UniformGroupNode.js";
|
|
|
8
8
|
import ComputeNode from "../../../nodes/gpgpu/ComputeNode.js";
|
|
9
9
|
import LightsNode from "../../../nodes/lighting/LightsNode.js";
|
|
10
10
|
import { NodeFrame } from "../../../nodes/Nodes.js";
|
|
11
|
-
import { ShaderNodeObject } from "../../../nodes/TSL.js";
|
|
12
11
|
import { Fog } from "../../../scenes/Fog.js";
|
|
13
12
|
import { FogExp2 } from "../../../scenes/FogExp2.js";
|
|
14
13
|
import { Scene } from "../../../scenes/Scene.js";
|
|
@@ -33,11 +32,11 @@ interface ComputeNodeData {
|
|
|
33
32
|
}
|
|
34
33
|
interface SceneData {
|
|
35
34
|
background?: Color | Texture | CubeTexture | undefined;
|
|
36
|
-
backgroundNode?:
|
|
35
|
+
backgroundNode?: Node | undefined;
|
|
37
36
|
fog?: Fog | FogExp2 | undefined;
|
|
38
|
-
fogNode?:
|
|
37
|
+
fogNode?: Node | undefined;
|
|
39
38
|
environment?: Texture | undefined;
|
|
40
|
-
environmentNode?:
|
|
39
|
+
environmentNode?: Node | undefined;
|
|
41
40
|
}
|
|
42
41
|
interface CacheKeyData {
|
|
43
42
|
callId: number;
|
|
@@ -45,9 +44,9 @@ interface CacheKeyData {
|
|
|
45
44
|
}
|
|
46
45
|
declare module "../../../scenes/Scene.js" {
|
|
47
46
|
interface Scene {
|
|
48
|
-
environmentNode?:
|
|
49
|
-
backgroundNode?:
|
|
50
|
-
fogNode?:
|
|
47
|
+
environmentNode?: Node | null | undefined;
|
|
48
|
+
backgroundNode?: Node | null | undefined;
|
|
49
|
+
fogNode?: Node | null | undefined;
|
|
51
50
|
}
|
|
52
51
|
}
|
|
53
52
|
/**
|
|
@@ -90,7 +89,7 @@ declare class Nodes extends DataMap<{
|
|
|
90
89
|
version?: number;
|
|
91
90
|
}>;
|
|
92
91
|
cacheLib: {
|
|
93
|
-
[type: string]: WeakMap<object,
|
|
92
|
+
[type: string]: WeakMap<object, Node | undefined>;
|
|
94
93
|
};
|
|
95
94
|
constructor(renderer: Renderer, backend: Backend);
|
|
96
95
|
/**
|
|
@@ -145,7 +144,7 @@ declare class Nodes extends DataMap<{
|
|
|
145
144
|
* @param {Scene} scene - The scene.
|
|
146
145
|
* @return {Node} A node representing the current scene environment.
|
|
147
146
|
*/
|
|
148
|
-
getEnvironmentNode(scene: Scene):
|
|
147
|
+
getEnvironmentNode(scene: Scene): Node | null;
|
|
149
148
|
/**
|
|
150
149
|
* Returns a background node for the current configured
|
|
151
150
|
* scene background.
|
|
@@ -153,14 +152,14 @@ declare class Nodes extends DataMap<{
|
|
|
153
152
|
* @param {Scene} scene - The scene.
|
|
154
153
|
* @return {Node} A node representing the current scene background.
|
|
155
154
|
*/
|
|
156
|
-
getBackgroundNode(scene: Scene):
|
|
155
|
+
getBackgroundNode(scene: Scene): Node | null;
|
|
157
156
|
/**
|
|
158
157
|
* Returns a fog node for the current configured scene fog.
|
|
159
158
|
*
|
|
160
159
|
* @param {Scene} scene - The scene.
|
|
161
160
|
* @return {Node} A node representing the current scene fog.
|
|
162
161
|
*/
|
|
163
|
-
getFogNode(scene: Scene):
|
|
162
|
+
getFogNode(scene: Scene): Node | null;
|
|
164
163
|
/**
|
|
165
164
|
* Returns a cache key for the given scene and lights node.
|
|
166
165
|
* This key is used by `RenderObject` as a part of the dynamic
|
|
@@ -199,9 +198,9 @@ declare class Nodes extends DataMap<{
|
|
|
199
198
|
getCacheNode(
|
|
200
199
|
type: string,
|
|
201
200
|
object: object,
|
|
202
|
-
callback: () =>
|
|
201
|
+
callback: () => Node | undefined,
|
|
203
202
|
forceUpdate?: boolean,
|
|
204
|
-
):
|
|
203
|
+
): Node | undefined;
|
|
205
204
|
/**
|
|
206
205
|
* If a scene fog is configured, this method makes sure to
|
|
207
206
|
* represent the fog with a corresponding node-based implementation.
|
|
@@ -245,7 +244,7 @@ declare class Nodes extends DataMap<{
|
|
|
245
244
|
* @param {Texture} outputTarget - The output target.
|
|
246
245
|
* @return {Node} The output node.
|
|
247
246
|
*/
|
|
248
|
-
getOutputNode(outputTarget: Texture):
|
|
247
|
+
getOutputNode(outputTarget: Texture): Node;
|
|
249
248
|
/**
|
|
250
249
|
* Triggers the call of `updateBefore()` methods
|
|
251
250
|
* for all nodes of the given render object.
|
|
@@ -112,7 +112,7 @@ export enum GPUTextureFormat {
|
|
|
112
112
|
// Packed 32-bit formats
|
|
113
113
|
RGB9E5UFloat = "rgb9e5ufloat",
|
|
114
114
|
RGB10A2Unorm = "rgb10a2unorm",
|
|
115
|
-
RG11B10UFloat = "
|
|
115
|
+
RG11B10UFloat = "rg11b10ufloat",
|
|
116
116
|
|
|
117
117
|
// 64-bit formats
|
|
118
118
|
|
|
@@ -335,3 +335,8 @@ export enum GPUFeatureName {
|
|
|
335
335
|
TextureFormatsTier1 = "texture-formats-tier1",
|
|
336
336
|
TextureFormatsTier2 = "texture-formats-tier2",
|
|
337
337
|
}
|
|
338
|
+
|
|
339
|
+
export enum GPUFeatureMap {
|
|
340
|
+
"texture-compression-s3tc" = "texture-compression-bc",
|
|
341
|
+
"texture-compression-etc1" = "texture-compression-etc2",
|
|
342
|
+
}
|
three/src/scenes/Scene.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JSONMeta, Object3D, Object3DJSON, Object3DJSONObject } from "../core/Object3D.js";
|
|
1
|
+
import { JSONMeta, Object3D, Object3DEventMap, Object3DJSON, Object3DJSONObject } from "../core/Object3D.js";
|
|
2
2
|
import { Material } from "../materials/Material.js";
|
|
3
3
|
import { Color } from "../math/Color.js";
|
|
4
4
|
import { Euler, EulerTuple } from "../math/Euler.js";
|
|
@@ -31,7 +31,7 @@ export interface SceneJSON extends Object3DJSON {
|
|
|
31
31
|
* @see {@link https://threejs.org/docs/index.html#api/en/scenes/Scene | Official Documentation}
|
|
32
32
|
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/scenes/Scene.js | Source}
|
|
33
33
|
*/
|
|
34
|
-
export class Scene extends Object3D {
|
|
34
|
+
export class Scene<TEventMap extends Object3DEventMap = Object3DEventMap> extends Object3D<TEventMap> {
|
|
35
35
|
/**
|
|
36
36
|
* Create a new {@link Scene} object.
|
|
37
37
|
*/
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
TextureDataType,
|
|
7
7
|
Wrapping,
|
|
8
8
|
} from "../constants.js";
|
|
9
|
-
import {
|
|
9
|
+
import { Texture } from "./Texture.js";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Creates a texture from a {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas | canvas element}.
|
|
@@ -17,7 +17,7 @@ import { OffscreenCanvas, Texture } from "./Texture.js";
|
|
|
17
17
|
* @see {@link https://threejs.org/docs/index.html#api/en/textures/CanvasTexture | Official Documentation}
|
|
18
18
|
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/textures/CanvasTexture.js | Source}
|
|
19
19
|
*/
|
|
20
|
-
export class CanvasTexture extends Texture {
|
|
20
|
+
export class CanvasTexture<TCanvas = HTMLCanvasElement> extends Texture<TCanvas> {
|
|
21
21
|
/**
|
|
22
22
|
* This creates a new {@link THREE.CanvasTexture | CanvasTexture} object.
|
|
23
23
|
* @param canvas The HTML canvas element from which to load the texture.
|
|
@@ -31,7 +31,7 @@ export class CanvasTexture extends Texture {
|
|
|
31
31
|
* @param anisotropy See {@link Texture.anisotropy | .anisotropy}. Default {@link THREE.Texture.DEFAULT_ANISOTROPY}
|
|
32
32
|
*/
|
|
33
33
|
constructor(
|
|
34
|
-
canvas?:
|
|
34
|
+
canvas?: TCanvas,
|
|
35
35
|
mapping?: Mapping,
|
|
36
36
|
wrapS?: Wrapping,
|
|
37
37
|
wrapT?: Wrapping,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CompressedPixelFormat, TextureDataType, Wrapping } from "../constants.js";
|
|
2
|
-
import { CompressedTexture, CompressedTextureMipmap } from "./CompressedTexture.js";
|
|
2
|
+
import { CompressedTexture, CompressedTextureImageData, CompressedTextureMipmap } from "./CompressedTexture.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Creates an texture 2D array based on data in compressed form, for example from a
|
|
@@ -8,7 +8,7 @@ import { CompressedTexture, CompressedTextureMipmap } from "./CompressedTexture.
|
|
|
8
8
|
* @see {@link https://threejs.org/docs/index.html#api/en/textures/CompressedArrayTexture | Official Documentation}
|
|
9
9
|
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/textures/CompressedArrayTexture.js | Source}
|
|
10
10
|
*/
|
|
11
|
-
export class CompressedArrayTexture extends CompressedTexture {
|
|
11
|
+
export class CompressedArrayTexture extends CompressedTexture<CompressedArrayTextureImageData> {
|
|
12
12
|
/**
|
|
13
13
|
* Read-only flag to check if a given object is of type {@link CompressedArrayTexture}.
|
|
14
14
|
* @remarks This is a _constant_ value
|
|
@@ -16,13 +16,6 @@ export class CompressedArrayTexture extends CompressedTexture {
|
|
|
16
16
|
*/
|
|
17
17
|
readonly isCompressedArrayTexture: true;
|
|
18
18
|
|
|
19
|
-
/**
|
|
20
|
-
* Overridden with a object containing width and height.
|
|
21
|
-
* @override
|
|
22
|
-
*/
|
|
23
|
-
get image(): { width: number; height: number; depth: number };
|
|
24
|
-
set image(value: { width: number; height: number; depth: number });
|
|
25
|
-
|
|
26
19
|
/**
|
|
27
20
|
* This defines how the texture is wrapped in the depth direction.
|
|
28
21
|
* @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
|
|
@@ -66,3 +59,7 @@ export class CompressedArrayTexture extends CompressedTexture {
|
|
|
66
59
|
*/
|
|
67
60
|
clearLayoutUpdates(): void;
|
|
68
61
|
}
|
|
62
|
+
|
|
63
|
+
export interface CompressedArrayTextureImageData extends CompressedTextureImageData {
|
|
64
|
+
depth: number;
|
|
65
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { CompressedPixelFormat, TextureDataType } from "../constants.js";
|
|
2
|
-
import { CompressedTexture } from "./CompressedTexture.js";
|
|
2
|
+
import { CompressedTexture, CompressedTextureImageData } from "./CompressedTexture.js";
|
|
3
3
|
|
|
4
|
-
export class CompressedCubeTexture extends CompressedTexture {
|
|
4
|
+
export class CompressedCubeTexture extends CompressedTexture<CompressedTextureImageData[]> {
|
|
5
5
|
readonly isCompressedCubeTexture: true;
|
|
6
6
|
readonly isCubeTexture: true;
|
|
7
7
|
|
|
8
8
|
constructor(
|
|
9
|
-
images:
|
|
9
|
+
images: CompressedTextureImageData[],
|
|
10
10
|
format?: CompressedPixelFormat,
|
|
11
11
|
type?: TextureDataType,
|
|
12
12
|
);
|
|
@@ -21,7 +21,7 @@ export interface CompressedTextureMipmap {
|
|
|
21
21
|
* @see {@link https://threejs.org/docs/index.html#api/en/textures/CompressedTexture | Official Documentation}
|
|
22
22
|
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/textures/CompressedTexture.js | Source}
|
|
23
23
|
*/
|
|
24
|
-
export class CompressedTexture extends Texture {
|
|
24
|
+
export class CompressedTexture<TImageData = CompressedTextureImageData> extends Texture<TImageData> {
|
|
25
25
|
/**
|
|
26
26
|
* This creates a new {@link THREE.CompressedTexture | CompressedTexture} object.
|
|
27
27
|
* @param mipmaps The mipmaps array should contain objects with data, width and height. The mipmaps should be of the
|
|
@@ -39,9 +39,9 @@ export class CompressedTexture extends Texture {
|
|
|
39
39
|
* @param colorSpace See {@link Texture.colorSpace .colorSpace}. Default {@link NoColorSpace}
|
|
40
40
|
*/
|
|
41
41
|
constructor(
|
|
42
|
-
mipmaps
|
|
43
|
-
width
|
|
44
|
-
height
|
|
42
|
+
mipmaps: CompressedTextureMipmap[],
|
|
43
|
+
width: number,
|
|
44
|
+
height: number,
|
|
45
45
|
format?: CompressedPixelFormat,
|
|
46
46
|
type?: TextureDataType,
|
|
47
47
|
mapping?: Mapping,
|
|
@@ -60,18 +60,11 @@ export class CompressedTexture extends Texture {
|
|
|
60
60
|
*/
|
|
61
61
|
readonly isCompressedTexture: true;
|
|
62
62
|
|
|
63
|
-
/**
|
|
64
|
-
* Overridden with a object containing width and height.
|
|
65
|
-
* @override
|
|
66
|
-
*/
|
|
67
|
-
get image(): { width: number; height: number };
|
|
68
|
-
set image(value: { width: number; height: number });
|
|
69
|
-
|
|
70
63
|
/**
|
|
71
64
|
* The mipmaps array should contain objects with data, width and height. The mipmaps should be of the correct
|
|
72
65
|
* format and type.
|
|
73
66
|
*/
|
|
74
|
-
mipmaps: CompressedTextureMipmap[]
|
|
67
|
+
mipmaps: CompressedTextureMipmap[];
|
|
75
68
|
|
|
76
69
|
/**
|
|
77
70
|
* @override
|
|
@@ -92,3 +85,8 @@ export class CompressedTexture extends Texture {
|
|
|
92
85
|
*/
|
|
93
86
|
generateMipmaps: boolean;
|
|
94
87
|
}
|
|
88
|
+
|
|
89
|
+
export interface CompressedTextureImageData {
|
|
90
|
+
width: number;
|
|
91
|
+
height: number;
|
|
92
|
+
}
|
|
@@ -27,7 +27,7 @@ import { Texture } from "./Texture.js";
|
|
|
27
27
|
* @see {@link https://threejs.org/docs/index.html#api/en/textures/CubeTexture | Official Documentation}
|
|
28
28
|
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/textures/CubeTexture.js | Source}
|
|
29
29
|
*/
|
|
30
|
-
export class CubeTexture extends Texture {
|
|
30
|
+
export class CubeTexture extends Texture<HTMLImageElement[]> {
|
|
31
31
|
/**
|
|
32
32
|
* This creates a new {@link THREE.CubeTexture | CubeTexture} object.
|
|
33
33
|
* @param images
|
|
@@ -42,7 +42,7 @@ export class CubeTexture extends Texture {
|
|
|
42
42
|
* @param colorSpace See {@link Texture.colorSpace | .colorSpace}. Default {@link NoColorSpace}
|
|
43
43
|
*/
|
|
44
44
|
constructor(
|
|
45
|
-
images?:
|
|
45
|
+
images?: HTMLImageElement[],
|
|
46
46
|
mapping?: CubeTextureMapping,
|
|
47
47
|
wrapS?: Wrapping,
|
|
48
48
|
wrapT?: Wrapping,
|
|
@@ -65,15 +65,8 @@ export class CubeTexture extends Texture {
|
|
|
65
65
|
* An image object, typically created using the {@link THREE.CubeTextureLoader.load | CubeTextureLoader.load()} method.
|
|
66
66
|
* @see {@link Texture.image}
|
|
67
67
|
*/
|
|
68
|
-
get
|
|
69
|
-
set
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* An image object, typically created using the {@link THREE.CubeTextureLoader.load | CubeTextureLoader.load()} method.
|
|
73
|
-
* @see {@link Texture.image}
|
|
74
|
-
*/
|
|
75
|
-
get images(): any;
|
|
76
|
-
set images(data: any);
|
|
68
|
+
get images(): HTMLImageElement[];
|
|
69
|
+
set images(value: HTMLImageElement[]);
|
|
77
70
|
|
|
78
71
|
/**
|
|
79
72
|
* @inheritDoc
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MagnificationTextureFilter, MinificationTextureFilter, Wrapping } from "../constants.js";
|
|
2
|
-
import {
|
|
2
|
+
import { TypedArray } from "../core/BufferAttribute.js";
|
|
3
3
|
import { Texture } from "./Texture.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -32,7 +32,7 @@ import { Texture } from "./Texture.js";
|
|
|
32
32
|
* @see {@link https://threejs.org/docs/index.html#api/en/textures/Data3DTexture | Official Documentation}
|
|
33
33
|
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/textures/Data3DTexture.js | Source}
|
|
34
34
|
*/
|
|
35
|
-
export class Data3DTexture extends Texture {
|
|
35
|
+
export class Data3DTexture extends Texture<Data3DTextureImageData> {
|
|
36
36
|
/**
|
|
37
37
|
* Create a new instance of {@link Data3DTexture}
|
|
38
38
|
* @param data {@link https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView | ArrayBufferView} of the texture. Default `null`.
|
|
@@ -40,7 +40,7 @@ export class Data3DTexture extends Texture {
|
|
|
40
40
|
* @param height Height of the texture. Default `1`.
|
|
41
41
|
* @param depth Depth of the texture. Default `1`.
|
|
42
42
|
*/
|
|
43
|
-
constructor(data?:
|
|
43
|
+
constructor(data?: TypedArray | null, width?: number, height?: number, depth?: number);
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* Read-only flag to check if a given object is of type {@link Data3DTexture}.
|
|
@@ -49,13 +49,6 @@ export class Data3DTexture extends Texture {
|
|
|
49
49
|
*/
|
|
50
50
|
readonly isData3DTexture: true;
|
|
51
51
|
|
|
52
|
-
/**
|
|
53
|
-
* Overridden with a record type holding data, width and height and depth.
|
|
54
|
-
* @override
|
|
55
|
-
*/
|
|
56
|
-
get image(): Texture3DImageData;
|
|
57
|
-
set image(data: Texture3DImageData);
|
|
58
|
-
|
|
59
52
|
/**
|
|
60
53
|
* @override
|
|
61
54
|
* @defaultValue {@link THREE.NearestFilter}
|
|
@@ -93,6 +86,9 @@ export class Data3DTexture extends Texture {
|
|
|
93
86
|
unpackAlignment: number;
|
|
94
87
|
}
|
|
95
88
|
|
|
96
|
-
export interface
|
|
89
|
+
export interface Data3DTextureImageData {
|
|
90
|
+
data: TypedArray | null;
|
|
91
|
+
width: number;
|
|
92
|
+
height: number;
|
|
97
93
|
depth: number;
|
|
98
94
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MagnificationTextureFilter, MinificationTextureFilter } from "../constants.js";
|
|
2
|
-
import {
|
|
2
|
+
import { TypedArray } from "../core/BufferAttribute.js";
|
|
3
3
|
import { Texture } from "./Texture.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -35,7 +35,7 @@ import { Texture } from "./Texture.js";
|
|
|
35
35
|
* @see {@link https://threejs.org/docs/index.html#api/en/textures/DataArrayTexture | Official Documentation}
|
|
36
36
|
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/textures/DataArrayTexture.js | Source}
|
|
37
37
|
*/
|
|
38
|
-
export class DataArrayTexture extends Texture {
|
|
38
|
+
export class DataArrayTexture extends Texture<DataArrayTextureImageData> {
|
|
39
39
|
/**
|
|
40
40
|
* Read-only flag to check if a given object is of type {@link DataArrayTexture}.
|
|
41
41
|
* @remarks This is a _constant_ value
|
|
@@ -43,13 +43,6 @@ export class DataArrayTexture extends Texture {
|
|
|
43
43
|
*/
|
|
44
44
|
readonly isDataArrayTexture: true;
|
|
45
45
|
|
|
46
|
-
/**
|
|
47
|
-
* Overridden with a record type holding data, width and height and depth.
|
|
48
|
-
* @override
|
|
49
|
-
*/
|
|
50
|
-
get image(): Texture3DImageData;
|
|
51
|
-
set image(data: Texture3DImageData);
|
|
52
|
-
|
|
53
46
|
/**
|
|
54
47
|
* @override
|
|
55
48
|
* @defaultValue {@link THREE.NearestFilter}
|
|
@@ -107,7 +100,7 @@ export class DataArrayTexture extends Texture {
|
|
|
107
100
|
* @param height Height of the texture. Default `1`.
|
|
108
101
|
* @param depth Depth of the texture. Default `1`.
|
|
109
102
|
*/
|
|
110
|
-
constructor(data?:
|
|
103
|
+
constructor(data?: TypedArray | null, width?: number, height?: number, depth?: number);
|
|
111
104
|
|
|
112
105
|
/**
|
|
113
106
|
* Describes that a specific layer of the texture needs to be updated. Normally when {@link Texture.needsUpdate} is
|
|
@@ -121,3 +114,10 @@ export class DataArrayTexture extends Texture {
|
|
|
121
114
|
*/
|
|
122
115
|
clearLayoutUpdates(): void;
|
|
123
116
|
}
|
|
117
|
+
|
|
118
|
+
export interface DataArrayTextureImageData {
|
|
119
|
+
data: TypedArray | null;
|
|
120
|
+
width: number;
|
|
121
|
+
height: number;
|
|
122
|
+
depth: number;
|
|
123
|
+
}
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
TextureDataType,
|
|
7
7
|
Wrapping,
|
|
8
8
|
} from "../constants.js";
|
|
9
|
+
import { TypedArray } from "../core/BufferAttribute.js";
|
|
9
10
|
import { Texture } from "./Texture.js";
|
|
10
11
|
|
|
11
12
|
/**
|
|
@@ -35,7 +36,7 @@ import { Texture } from "./Texture.js";
|
|
|
35
36
|
* @see {@link https://threejs.org/docs/index.html#api/en/textures/DataTexture | Official Documentation}
|
|
36
37
|
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/textures/DataTexture.js | Source}
|
|
37
38
|
*/
|
|
38
|
-
export class DataTexture extends Texture {
|
|
39
|
+
export class DataTexture extends Texture<DataTextureImageData> {
|
|
39
40
|
/**
|
|
40
41
|
* @param data {@link https://developer.mozilla.org/en-US/docs/Web/API/ArrayBufferView | ArrayBufferView} of the texture. Default `null`.
|
|
41
42
|
* @param width Width of the texture. Default `1`.
|
|
@@ -51,7 +52,7 @@ export class DataTexture extends Texture {
|
|
|
51
52
|
* @param colorSpace See {@link Texture.colorSpace | .colorSpace}. Default {@link NoColorSpace}
|
|
52
53
|
*/
|
|
53
54
|
constructor(
|
|
54
|
-
data?:
|
|
55
|
+
data?: TypedArray | null,
|
|
55
56
|
width?: number,
|
|
56
57
|
height?: number,
|
|
57
58
|
format?: PixelFormat,
|
|
@@ -72,13 +73,6 @@ export class DataTexture extends Texture {
|
|
|
72
73
|
*/
|
|
73
74
|
readonly isDataTexture: true;
|
|
74
75
|
|
|
75
|
-
/**
|
|
76
|
-
* Overridden with a record type holding data, width and height and depth.
|
|
77
|
-
* @override
|
|
78
|
-
*/
|
|
79
|
-
get image(): TextureImageData;
|
|
80
|
-
set image(value: TextureImageData);
|
|
81
|
-
|
|
82
76
|
/**
|
|
83
77
|
* @override
|
|
84
78
|
* @defaultValue {@link THREE.NearestFilter}
|
|
@@ -110,8 +104,8 @@ export class DataTexture extends Texture {
|
|
|
110
104
|
unpackAlignment: number;
|
|
111
105
|
}
|
|
112
106
|
|
|
113
|
-
export interface
|
|
114
|
-
data:
|
|
115
|
-
height: number;
|
|
107
|
+
export interface DataTextureImageData {
|
|
108
|
+
data: TypedArray | null;
|
|
116
109
|
width: number;
|
|
110
|
+
height: number;
|
|
117
111
|
}
|
|
@@ -15,7 +15,7 @@ import { Texture } from "./Texture.js";
|
|
|
15
15
|
* @see {@link https://threejs.org/docs/index.html#api/en/textures/DepthTexture | Official Documentation}
|
|
16
16
|
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/textures/DepthTexture.js | Source}
|
|
17
17
|
*/
|
|
18
|
-
export class DepthTexture extends Texture {
|
|
18
|
+
export class DepthTexture extends Texture<DepthTextureImageData> {
|
|
19
19
|
/**
|
|
20
20
|
* Create a new instance of {@link DepthTexture}
|
|
21
21
|
* @param width Width of the texture.
|
|
@@ -51,13 +51,6 @@ export class DepthTexture extends Texture {
|
|
|
51
51
|
*/
|
|
52
52
|
readonly isDepthTexture: true;
|
|
53
53
|
|
|
54
|
-
/**
|
|
55
|
-
* Overridden with a record type holding width and height.
|
|
56
|
-
* @override
|
|
57
|
-
*/
|
|
58
|
-
get image(): { width: number; height: number; depth: number };
|
|
59
|
-
set image(value: { width: number; height: number; depth: number });
|
|
60
|
-
|
|
61
54
|
/**
|
|
62
55
|
* @override
|
|
63
56
|
* @defaultValue `false`
|
|
@@ -104,3 +97,9 @@ export class DepthTexture extends Texture {
|
|
|
104
97
|
*/
|
|
105
98
|
compareFunction: TextureComparisonFunction | null;
|
|
106
99
|
}
|
|
100
|
+
|
|
101
|
+
export interface DepthTextureImageData {
|
|
102
|
+
width: number;
|
|
103
|
+
height: number;
|
|
104
|
+
depth: number;
|
|
105
|
+
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
/// <reference types="@webgpu/types" />
|
|
2
|
+
|
|
1
3
|
import { Texture } from "./Texture.js";
|
|
2
4
|
|
|
3
|
-
declare class ExternalTexture extends Texture {
|
|
4
|
-
sourceTexture: WebGLTexture | null;
|
|
5
|
+
declare class ExternalTexture extends Texture<null> {
|
|
6
|
+
sourceTexture: WebGLTexture | GPUTexture | null;
|
|
5
7
|
|
|
6
8
|
readonly isExternalTexture: true;
|
|
7
9
|
|
|
8
|
-
constructor(sourceTexture?: WebGLTexture | null);
|
|
10
|
+
constructor(sourceTexture?: WebGLTexture | GPUTexture | null);
|
|
9
11
|
}
|
|
10
12
|
|
|
11
13
|
export { ExternalTexture };
|
|
@@ -27,7 +27,7 @@ import { Texture } from "./Texture.js";
|
|
|
27
27
|
* @see {@link https://threejs.org/docs/index.html#api/en/textures/FramebufferTexture | Official Documentation}
|
|
28
28
|
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/textures/FramebufferTexture.js | Source}
|
|
29
29
|
*/
|
|
30
|
-
export class FramebufferTexture extends Texture {
|
|
30
|
+
export class FramebufferTexture extends Texture<FramebufferTextureImageData> {
|
|
31
31
|
/**
|
|
32
32
|
* Create a new instance of {@link FramebufferTexture}
|
|
33
33
|
* @param width The width of the texture.
|
|
@@ -60,3 +60,8 @@ export class FramebufferTexture extends Texture {
|
|
|
60
60
|
*/
|
|
61
61
|
generateMipmaps: boolean;
|
|
62
62
|
}
|
|
63
|
+
|
|
64
|
+
export interface FramebufferTextureImageData {
|
|
65
|
+
width: number;
|
|
66
|
+
height: number;
|
|
67
|
+
}
|
three/src/textures/Source.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export class SourceJSON {
|
|
|
19
19
|
* @see {@link https://threejs.org/docs/index.html#api/en/textures/Source | Official Documentation}
|
|
20
20
|
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/textures/Source.js | Source}
|
|
21
21
|
*/
|
|
22
|
-
export class Source {
|
|
22
|
+
export class Source<TData> {
|
|
23
23
|
/**
|
|
24
24
|
* Flag to check if a given object is of type {@link Source}.
|
|
25
25
|
* @remarks This is a _constant_ value
|
|
@@ -39,7 +39,7 @@ export class Source {
|
|
|
39
39
|
* The actual data of a texture.
|
|
40
40
|
* @remarks The type of this property depends on the texture that uses this instance.
|
|
41
41
|
*/
|
|
42
|
-
data:
|
|
42
|
+
data: TData;
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* This property is only relevant when {@link .needsUpdate} is set to `true` and provides more control on how
|
|
@@ -61,7 +61,7 @@ export class Source {
|
|
|
61
61
|
* Create a new instance of {@link Source}
|
|
62
62
|
* @param data The data definition of a texture. Default `null`
|
|
63
63
|
*/
|
|
64
|
-
constructor(data:
|
|
64
|
+
constructor(data: TData);
|
|
65
65
|
|
|
66
66
|
getSize(target: Vector3): Vector3;
|
|
67
67
|
|