@types/three 0.167.2 → 0.169.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 +2 -2
- three/build/three.webgpu.nodes.d.ts +1 -0
- three/build/three.webgpu.nodes.min.d.ts +1 -0
- three/examples/jsm/Addons.d.ts +1 -4
- three/examples/jsm/capabilities/WebGL.d.ts +11 -3
- three/examples/jsm/controls/ArcballControls.d.ts +111 -77
- three/examples/jsm/controls/DragControls.d.ts +43 -29
- three/examples/jsm/controls/FirstPersonControls.d.ts +82 -12
- three/examples/jsm/controls/FlyControls.d.ts +35 -11
- three/examples/jsm/controls/OrbitControls.d.ts +84 -137
- three/examples/jsm/controls/PointerLockControls.d.ts +68 -9
- three/examples/jsm/controls/TrackballControls.d.ts +110 -26
- three/examples/jsm/controls/TransformControls.d.ts +152 -25
- three/examples/jsm/effects/AnaglyphEffect.d.ts +11 -5
- three/examples/jsm/effects/ParallaxBarrierEffect.d.ts +7 -4
- three/examples/jsm/environments/RoomEnvironment.d.ts +2 -2
- three/examples/jsm/exporters/EXRExporter.d.ts +7 -2
- three/examples/jsm/exporters/KTX2Exporter.d.ts +3 -1
- three/examples/jsm/helpers/LightProbeHelper.d.ts +5 -3
- three/examples/jsm/helpers/LightProbeHelperGPU.d.ts +12 -0
- three/examples/jsm/lights/LightProbeGenerator.d.ts +5 -1
- three/examples/jsm/lines/Line2.d.ts +15 -1
- three/examples/jsm/lines/LineGeometry.d.ts +18 -1
- three/examples/jsm/lines/LineMaterial.d.ts +65 -12
- three/examples/jsm/lines/LineSegments2.d.ts +25 -2
- three/examples/jsm/lines/LineSegmentsGeometry.d.ts +46 -9
- three/examples/jsm/loaders/DRACOLoader.d.ts +6 -0
- three/examples/jsm/loaders/KTX2Loader.d.ts +4 -0
- three/examples/jsm/modifiers/CurveModifier.d.ts +7 -3
- three/examples/jsm/modifiers/CurveModifierGPU.d.ts +31 -0
- three/examples/jsm/objects/Lensflare.d.ts +13 -9
- three/examples/jsm/objects/LensflareMesh.d.ts +21 -0
- three/examples/jsm/objects/SkyMesh.d.ts +17 -0
- three/examples/jsm/objects/Water2.d.ts +2 -2
- three/examples/jsm/objects/Water2Mesh.d.ts +42 -0
- three/examples/jsm/objects/WaterMesh.d.ts +31 -0
- three/examples/jsm/postprocessing/OutlinePass.d.ts +1 -1
- three/examples/jsm/postprocessing/SSAARenderPass.d.ts +11 -2
- three/examples/jsm/utils/GeometryCompressionUtils.d.ts +20 -4
- three/examples/jsm/utils/ShadowMapViewer.d.ts +8 -6
- three/examples/jsm/utils/ShadowMapViewerGPU.d.ts +26 -0
- three/examples/jsm/utils/SkeletonUtils.d.ts +25 -5
- three/examples/jsm/utils/TextureUtilsGPU.d.ts +3 -0
- three/package.json +4 -3
- three/src/Three.WebGPU.Nodes.d.ts +201 -0
- three/src/Three.WebGPU.d.ts +7 -0
- three/src/Three.d.ts +1 -0
- three/src/audio/Audio.d.ts +4 -1
- three/src/core/BufferAttribute.d.ts +0 -15
- three/src/core/EventDispatcher.d.ts +0 -3
- three/src/core/InterleavedBuffer.d.ts +0 -12
- three/src/core/Object3D.d.ts +3 -1
- three/src/core/Raycaster.d.ts +2 -1
- three/src/extras/Controls.d.ts +54 -0
- three/src/loaders/MaterialLoader.d.ts +2 -0
- three/src/{nodes/loaders → loaders/nodes}/NodeLoader.d.ts +8 -3
- three/src/loaders/nodes/NodeMaterialLoader.d.ts +11 -0
- three/src/loaders/nodes/NodeObjectLoader.d.ts +22 -0
- three/src/materials/Material.d.ts +17 -13
- three/src/materials/nodes/InstancedPointsNodeMaterial.d.ts +33 -0
- three/src/{nodes/materials → materials/nodes}/Line2NodeMaterial.d.ts +2 -2
- three/src/{nodes/materials → materials/nodes}/LineBasicNodeMaterial.d.ts +1 -1
- three/src/materials/nodes/LineDashedNodeMaterial.d.ts +29 -0
- three/src/{nodes/materials → materials/nodes}/MeshBasicNodeMaterial.d.ts +1 -1
- three/src/materials/nodes/MeshLambertNodeMaterial.d.ts +49 -0
- three/src/{nodes/materials → materials/nodes}/MeshMatcapNodeMaterial.d.ts +2 -2
- three/src/{nodes/materials → materials/nodes}/MeshNormalNodeMaterial.d.ts +1 -1
- three/src/{nodes/materials → materials/nodes}/MeshPhongNodeMaterial.d.ts +2 -2
- three/src/{nodes/materials → materials/nodes}/MeshPhysicalNodeMaterial.d.ts +5 -2
- three/src/{nodes/materials → materials/nodes}/MeshSSSNodeMaterial.d.ts +2 -2
- three/src/{nodes/materials → materials/nodes}/MeshStandardNodeMaterial.d.ts +3 -3
- three/src/{nodes/materials → materials/nodes}/MeshToonNodeMaterial.d.ts +2 -2
- three/src/materials/nodes/NodeMaterial.d.ts +89 -0
- three/src/{nodes/materials/Materials.d.ts → materials/nodes/NodeMaterials.d.ts} +5 -2
- three/src/{nodes/materials → materials/nodes}/PointsNodeMaterial.d.ts +1 -2
- three/src/{nodes/materials → materials/nodes}/ShadowNodeMaterial.d.ts +1 -1
- three/src/{nodes/materials → materials/nodes}/SpriteNodeMaterial.d.ts +2 -2
- three/src/{nodes/materials → materials/nodes}/VolumeNodeMaterial.d.ts +1 -1
- three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +81 -0
- three/src/math/Quaternion.d.ts +4 -3
- three/src/math/Triangle.d.ts +24 -0
- three/src/nodes/Nodes.d.ts +117 -362
- three/src/nodes/TSL.d.ts +175 -0
- three/src/nodes/accessors/AccessorsUtils.d.ts +1 -1
- three/src/nodes/accessors/BatchNode.d.ts +1 -2
- three/src/nodes/accessors/{BitangentNode.d.ts → Bitangent.d.ts} +1 -1
- three/src/nodes/accessors/BufferAttributeNode.d.ts +5 -4
- three/src/nodes/accessors/BufferNode.d.ts +1 -1
- three/src/nodes/accessors/{CameraNode.d.ts → Camera.d.ts} +1 -1
- three/src/nodes/accessors/ClippingNode.d.ts +1 -1
- three/src/nodes/accessors/CubeTextureNode.d.ts +1 -7
- three/src/nodes/accessors/InstanceNode.d.ts +1 -1
- three/src/nodes/accessors/MaterialNode.d.ts +3 -4
- three/src/nodes/accessors/MaterialProperties.d.ts +4 -0
- three/src/nodes/accessors/MaterialReferenceNode.d.ts +3 -1
- three/src/nodes/accessors/ModelNode.d.ts +8 -4
- three/src/nodes/accessors/ModelViewProjectionNode.d.ts +1 -1
- three/src/nodes/accessors/MorphNode.d.ts +15 -0
- three/src/nodes/accessors/Normal.d.ts +25 -0
- three/src/nodes/accessors/Object3DNode.d.ts +2 -6
- three/src/nodes/accessors/PointUVNode.d.ts +1 -1
- three/src/nodes/accessors/{PositionNode.d.ts → Position.d.ts} +2 -1
- three/src/nodes/accessors/ReferenceBaseNode.d.ts +27 -0
- three/src/nodes/accessors/ReferenceNode.d.ts +7 -5
- three/src/nodes/accessors/{ReflectVectorNode.d.ts → ReflectVector.d.ts} +1 -1
- three/src/nodes/accessors/RendererReferenceNode.d.ts +1 -1
- three/src/nodes/accessors/SceneNode.d.ts +20 -0
- three/src/nodes/accessors/SkinningNode.d.ts +11 -1
- three/src/nodes/accessors/StorageBufferNode.d.ts +2 -2
- three/src/nodes/accessors/StorageTextureNode.d.ts +1 -1
- three/src/nodes/accessors/{TangentNode.d.ts → Tangent.d.ts} +1 -1
- three/src/nodes/accessors/Texture3DNode.d.ts +1 -1
- three/src/nodes/accessors/TextureBicubic.d.ts +4 -0
- three/src/nodes/accessors/TextureNode.d.ts +26 -7
- three/src/nodes/accessors/TextureSizeNode.d.ts +18 -0
- three/src/nodes/accessors/{UVNode.d.ts → UV.d.ts} +1 -1
- three/src/nodes/accessors/UniformArrayNode.d.ts +30 -0
- three/src/nodes/accessors/UserDataNode.d.ts +1 -1
- three/src/nodes/accessors/VelocityNode.d.ts +16 -0
- three/src/nodes/accessors/VertexColorNode.d.ts +1 -1
- three/src/nodes/code/CodeNode.d.ts +1 -1
- three/src/nodes/code/ExpressionNode.d.ts +1 -1
- three/src/nodes/code/FunctionCallNode.d.ts +2 -2
- three/src/nodes/code/FunctionNode.d.ts +5 -6
- three/src/nodes/code/ScriptableNode.d.ts +22 -0
- three/src/nodes/code/ScriptableValueNode.d.ts +10 -0
- three/src/nodes/core/AssignNode.d.ts +2 -2
- three/src/nodes/core/AttributeNode.d.ts +2 -5
- three/src/nodes/core/BypassNode.d.ts +2 -2
- three/src/nodes/core/CacheNode.d.ts +2 -2
- three/src/nodes/core/ContextNode.d.ts +10 -7
- three/src/nodes/core/IndexNode.d.ts +11 -3
- three/src/nodes/core/MRTNode.d.ts +7 -2
- three/src/nodes/core/Node.d.ts +4 -7
- three/src/nodes/core/NodeUtils.d.ts +5 -1
- three/src/nodes/core/OutputStructNode.d.ts +1 -1
- three/src/nodes/core/ParameterNode.d.ts +12 -0
- three/src/nodes/core/PropertyNode.d.ts +1 -1
- three/src/nodes/core/StackNode.d.ts +12 -2
- three/src/nodes/core/StructTypeNode.d.ts +1 -0
- three/src/nodes/core/UniformNode.d.ts +2 -1
- three/src/nodes/core/VarNode.d.ts +2 -10
- three/src/nodes/core/VaryingNode.d.ts +2 -2
- three/src/nodes/display/AfterImageNode.d.ts +1 -7
- three/src/nodes/display/AnaglyphPassNode.d.ts +14 -0
- three/src/nodes/display/AnamorphicNode.d.ts +1 -7
- three/src/nodes/display/BleachBypass.d.ts +4 -0
- three/src/nodes/display/BlendMode.d.ts +10 -0
- three/src/nodes/display/BloomNode.d.ts +1 -7
- three/src/nodes/display/BumpMapNode.d.ts +16 -0
- three/src/nodes/display/ColorAdjustment.d.ts +27 -0
- three/src/nodes/display/ColorSpaceFunctions.d.ts +6 -0
- three/src/nodes/display/ColorSpaceNode.d.ts +40 -21
- three/src/nodes/display/DenoiseNode.d.ts +3 -9
- three/src/nodes/display/DepthOfFieldNode.d.ts +4 -8
- three/src/nodes/display/DotScreenNode.d.ts +4 -8
- three/src/nodes/display/FXAANode.d.ts +3 -9
- three/src/nodes/display/FilmNode.d.ts +3 -9
- three/src/nodes/display/FrontFacingNode.d.ts +4 -2
- three/src/nodes/display/GTAONode.d.ts +3 -9
- three/src/nodes/display/GaussianBlurNode.d.ts +4 -8
- three/src/nodes/display/Lut3DNode.d.ts +3 -9
- three/src/nodes/display/MotionBlur.d.ts +8 -0
- three/src/nodes/display/NormalMapNode.d.ts +4 -8
- three/src/nodes/display/ParallaxBarrierPassNode.d.ts +14 -0
- three/src/nodes/display/PassNode.d.ts +11 -2
- three/src/nodes/display/PixelationPassNode.d.ts +1 -37
- three/src/nodes/display/PosterizeNode.d.ts +1 -7
- three/src/nodes/display/RGBShiftNode.d.ts +1 -7
- three/src/nodes/display/RenderOutputNode.d.ts +2 -2
- three/src/nodes/display/SSAAPassNode.d.ts +26 -0
- three/src/nodes/display/ScreenNode.d.ts +48 -0
- three/src/nodes/display/Sepia.d.ts +4 -0
- three/src/nodes/display/SobelOperatorNode.d.ts +4 -8
- three/src/nodes/display/StereoCompositePassNode.d.ts +17 -0
- three/src/nodes/display/StereoPassNode.d.ts +17 -0
- three/src/nodes/display/ToneMappingFunctions.d.ts +14 -0
- three/src/nodes/display/ToneMappingNode.d.ts +5 -6
- three/src/nodes/display/ToonOutlinePassNode.d.ts +24 -0
- three/src/nodes/display/TransitionNode.d.ts +3 -9
- three/src/nodes/display/ViewportDepthNode.d.ts +6 -2
- three/src/nodes/display/ViewportDepthTextureNode.d.ts +4 -2
- three/src/nodes/display/ViewportSharedTextureNode.d.ts +4 -8
- three/src/nodes/display/ViewportTextureNode.d.ts +4 -9
- three/src/nodes/fog/FogExp2Node.d.ts +4 -8
- three/src/nodes/fog/FogNode.d.ts +4 -8
- three/src/nodes/fog/FogRangeNode.d.ts +4 -8
- three/src/nodes/functions/BSDF/BRDF_GGX.d.ts +1 -1
- three/src/nodes/functions/BSDF/BRDF_Lambert.d.ts +1 -1
- three/src/nodes/functions/BSDF/BRDF_Sheen.d.ts +1 -1
- three/src/nodes/functions/BSDF/DFGApprox.d.ts +1 -1
- three/src/nodes/functions/BSDF/D_GGX.d.ts +1 -1
- three/src/nodes/functions/BSDF/D_GGX_Anisotropic.d.ts +1 -1
- three/src/nodes/functions/BSDF/F_Schlick.d.ts +1 -1
- three/src/nodes/functions/BSDF/Schlick_to_F0.d.ts +10 -0
- three/src/nodes/functions/BSDF/V_GGX_SmithCorrelated.d.ts +1 -1
- three/src/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.d.ts +1 -1
- three/src/nodes/functions/ShadowMaskModel.d.ts +1 -1
- three/src/nodes/functions/material/getGeometryRoughness.d.ts +1 -1
- three/src/nodes/functions/material/getRoughness.d.ts +1 -1
- three/src/nodes/functions/material/getShIrradianceAt.d.ts +6 -0
- three/src/nodes/geometry/RangeNode.d.ts +1 -1
- three/src/nodes/gpgpu/ComputeNode.d.ts +2 -2
- three/src/nodes/lighting/AmbientLightNode.d.ts +8 -0
- three/src/nodes/lighting/DirectionalLightNode.d.ts +8 -0
- three/src/nodes/lighting/IESSpotLightNode.d.ts +5 -0
- three/src/nodes/lighting/LightNode.d.ts +18 -0
- three/src/nodes/lighting/LightProbeNode.d.ts +11 -0
- three/src/nodes/lighting/LightUtils.d.ts +3 -3
- three/src/nodes/lighting/LightingContextNode.d.ts +1 -7
- three/src/nodes/lighting/LightsNode.d.ts +9 -13
- three/src/nodes/materialx/MaterialXNodes.d.ts +1 -1
- three/src/nodes/materialx/lib/mx_hsv.d.ts +2 -2
- three/src/nodes/materialx/lib/mx_noise.d.ts +1 -1
- three/src/nodes/materialx/lib/mx_transform_color.d.ts +1 -1
- three/src/nodes/math/ConditionalNode.d.ts +39 -0
- three/src/nodes/math/Hash.d.ts +4 -0
- three/src/nodes/math/MathNode.d.ts +2 -2
- three/src/nodes/math/MathUtils.d.ts +0 -10
- three/src/nodes/math/OperatorNode.d.ts +18 -4
- three/src/nodes/math/TriNoise3D.d.ts +1 -1
- three/src/nodes/parsers/GLSLNodeFunction.d.ts +9 -0
- three/src/nodes/parsers/GLSLNodeParser.d.ts +8 -0
- three/src/nodes/pmrem/PMREMNode.d.ts +4 -2
- three/src/nodes/pmrem/PMREMUtils.d.ts +28 -0
- three/src/nodes/procedural/Checker.d.ts +4 -0
- three/src/nodes/tsl/TSLBase.d.ts +21 -0
- three/src/nodes/{shadernode/ShaderNode.d.ts → tsl/TSLCore.d.ts} +23 -23
- three/src/nodes/utils/CubeMapNode.d.ts +13 -0
- three/src/nodes/utils/Discard.d.ts +11 -0
- three/src/nodes/utils/EquirectUVNode.d.ts +1 -1
- three/src/nodes/utils/FunctionOverloadingNode.d.ts +13 -0
- three/src/nodes/utils/LoopNode.d.ts +22 -0
- three/src/nodes/utils/MatcapUVNode.d.ts +1 -1
- three/src/nodes/utils/MaxMipLevelNode.d.ts +1 -1
- three/src/nodes/utils/OscNode.d.ts +1 -1
- three/src/nodes/utils/Packing.d.ts +5 -0
- three/src/nodes/utils/RTTNode.d.ts +7 -7
- three/src/nodes/utils/ReflectorNode.d.ts +1 -1
- three/src/nodes/utils/RemapNode.d.ts +2 -2
- three/src/nodes/utils/RotateNode.d.ts +1 -7
- three/src/nodes/utils/SetNode.d.ts +11 -0
- three/src/nodes/utils/SplitNode.d.ts +1 -1
- three/src/nodes/utils/SpriteSheetUVNode.d.ts +1 -1
- three/src/nodes/utils/SpriteUtils.d.ts +6 -0
- three/src/nodes/utils/{StoargeArrayElementNode.d.ts → StorageArrayElementNode.d.ts} +1 -7
- three/src/nodes/utils/TimerNode.d.ts +1 -1
- three/src/nodes/utils/TriplanarTexturesNode.d.ts +1 -7
- three/src/nodes/utils/UVUtils.d.ts +14 -0
- three/src/nodes/utils/ViewportUtils.d.ts +4 -0
- three/src/objects/BatchedMesh.d.ts +33 -0
- three/src/objects/Group.d.ts +0 -6
- three/src/objects/LOD.d.ts +7 -0
- three/src/renderers/WebGLRenderer.d.ts +2 -12
- three/src/renderers/common/BindGroup.d.ts +8 -1
- three/src/renderers/common/Bindings.d.ts +2 -2
- three/src/renderers/common/BundleGroup.d.ts +10 -0
- three/src/renderers/common/ClippingContext.d.ts +1 -0
- three/src/renderers/common/QuadMesh.d.ts +2 -0
- three/src/renderers/common/RenderBundles.d.ts +3 -3
- three/src/renderers/common/RenderContext.d.ts +2 -0
- three/src/renderers/common/RenderContexts.d.ts +6 -4
- three/src/renderers/common/RenderList.d.ts +2 -1
- three/src/renderers/common/RenderObject.d.ts +19 -1
- three/src/renderers/common/RenderObjects.d.ts +1 -1
- three/src/renderers/common/Renderer.d.ts +24 -5
- three/src/renderers/common/SampledTexture.d.ts +7 -1
- three/src/renderers/common/Textures.d.ts +1 -0
- three/src/renderers/common/nodes/NodeBuilderState.d.ts +3 -2
- three/src/renderers/common/nodes/NodeLibrary.d.ts +56 -0
- three/src/renderers/common/nodes/NodeSampledTexture.d.ts +3 -3
- three/src/renderers/common/nodes/Nodes.d.ts +15 -9
- three/src/renderers/common/nodes/StandardNodeLibrary.d.ts +5 -0
- three/src/renderers/webgl/WebGLCapabilities.d.ts +13 -0
- three/src/renderers/webgl/WebGLPrograms.d.ts +1 -0
- three/src/renderers/webgl/WebGLProperties.d.ts +5 -4
- three/src/renderers/webgpu/WebGPUBackend.d.ts +6 -2
- three/src/renderers/webgpu/WebGPURenderer.Nodes.d.ts +12 -0
- three/src/renderers/webgpu/WebGPURenderer.d.ts +5 -1
- three/src/renderers/webgpu/nodes/BasicNodeLibrary.d.ts +5 -0
- three/src/renderers/webgpu/nodes/StandardNodeLibrary.d.ts +5 -0
- three/src/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts +2 -2
- three/src/renderers/webxr/WebXRManager.d.ts +0 -2
- three/examples/jsm/geometries/SDFGeometryGenerator.d.ts +0 -16
- three/examples/jsm/loaders/LogLuvLoader.d.ts +0 -19
- three/examples/jsm/loaders/TiltLoader.d.ts +0 -7
- three/examples/jsm/utils/GPUStatsPanel.d.ts +0 -12
- three/examples/jsm/utils/PackedPhongMaterial.d.ts +0 -10
- three/src/nodes/accessors/NormalNode.d.ts +0 -12
- three/src/nodes/accessors/TextureBicubicNode.d.ts +0 -18
- three/src/nodes/accessors/UniformsNode.d.ts +0 -23
- three/src/nodes/core/NodeKeywords.d.ts +0 -17
- three/src/nodes/display/BlendModeNode.d.ts +0 -47
- three/src/nodes/display/ColorAdjustmentNode.d.ts +0 -47
- three/src/nodes/display/ViewportNode.d.ts +0 -31
- three/src/nodes/loaders/NodeMaterialLoader.d.ts +0 -8
- three/src/nodes/loaders/NodeObjectLoader.d.ts +0 -10
- three/src/nodes/materials/NodeMaterial.d.ts +0 -124
- three/src/nodes/math/CondNode.d.ts +0 -22
- three/src/nodes/math/HashNode.d.ts +0 -16
- three/src/nodes/procedural/CheckerNode.d.ts +0 -15
- three/src/nodes/utils/DiscardNode.d.ts +0 -17
- three/src/nodes/utils/PackingNode.d.ts +0 -24
- three/src/nodes/utils/RotateUVNode.d.ts +0 -19
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import StorageBufferNode from "../accessors/StorageBufferNode.js";
|
|
2
|
-
import { NodeRepresentation, ShaderNodeObject } from "../
|
|
2
|
+
import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
|
|
3
3
|
import ArrayElementNode from "./ArrayElementNode.js";
|
|
4
4
|
|
|
5
5
|
export default class StorageArrayElementNode extends ArrayElementNode {
|
|
@@ -17,9 +17,3 @@ export const storageElement: (
|
|
|
17
17
|
storageBufferNode: NodeRepresentation,
|
|
18
18
|
indexNode: NodeRepresentation,
|
|
19
19
|
) => ShaderNodeObject<StorageArrayElementNode>;
|
|
20
|
-
|
|
21
|
-
declare module "../shadernode/ShaderNode.js" {
|
|
22
|
-
interface NodeElements {
|
|
23
|
-
storageElement: typeof storageElement;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import TextureNode from "../accessors/TextureNode.js";
|
|
2
2
|
import Node from "../core/Node.js";
|
|
3
|
-
import { NodeRepresentation, ShaderNodeObject } from "../
|
|
3
|
+
import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
|
|
4
4
|
|
|
5
5
|
export default class TriplanarTexturesNode extends Node {
|
|
6
6
|
textureXNode: TextureNode;
|
|
@@ -34,9 +34,3 @@ export const triplanarTexture: (
|
|
|
34
34
|
texture: NodeRepresentation,
|
|
35
35
|
...params: NodeRepresentation[]
|
|
36
36
|
) => ShaderNodeObject<TriplanarTexturesNode>;
|
|
37
|
-
|
|
38
|
-
declare module "../shadernode/ShaderNode.js" {
|
|
39
|
-
interface NodeElements {
|
|
40
|
-
triplanarTexture: typeof triplanarTexture;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import OperatorNode from "../math/OperatorNode.js";
|
|
2
|
+
import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
|
|
3
|
+
|
|
4
|
+
export const rotateUV: (
|
|
5
|
+
uv: NodeRepresentation,
|
|
6
|
+
rotation: NodeRepresentation,
|
|
7
|
+
center?: NodeRepresentation,
|
|
8
|
+
) => ShaderNodeObject<OperatorNode>;
|
|
9
|
+
|
|
10
|
+
export const spherizeUV: (
|
|
11
|
+
uv: NodeRepresentation,
|
|
12
|
+
strength: NodeRepresentation,
|
|
13
|
+
center?: NodeRepresentation,
|
|
14
|
+
) => ShaderNodeObject<OperatorNode>;
|
|
@@ -141,6 +141,25 @@ declare class BatchedMesh extends Mesh<BufferGeometry, Material> {
|
|
|
141
141
|
*/
|
|
142
142
|
getVisibleAt(instanceId: number): boolean;
|
|
143
143
|
|
|
144
|
+
/**
|
|
145
|
+
* Get the range representing the subset of triangles related to the attached geometry, indicating the starting
|
|
146
|
+
* offset and count, or `null` if invalid.
|
|
147
|
+
*
|
|
148
|
+
* Return an object of the form: { start: Integer, count: Integer }
|
|
149
|
+
* @param geometryId The id of the geometry to get the range of.
|
|
150
|
+
* @param target Optional target object to copy the range in to.
|
|
151
|
+
*/
|
|
152
|
+
getGeometryRangeAt(
|
|
153
|
+
geometryId: number,
|
|
154
|
+
target?: { start: number; count: number },
|
|
155
|
+
): { start: number; count: number } | null;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Get the geometryIndex of the defined instance.
|
|
159
|
+
* @param instanceId The id of an instance to get the geometryIndex of.
|
|
160
|
+
*/
|
|
161
|
+
getGeometryIdAt(instanceId: number): number;
|
|
162
|
+
|
|
144
163
|
/**
|
|
145
164
|
* Sets the given color to the defined geometry instance.
|
|
146
165
|
* @param instanceId The id of the instance to set the color of.
|
|
@@ -162,6 +181,13 @@ declare class BatchedMesh extends Mesh<BufferGeometry, Material> {
|
|
|
162
181
|
*/
|
|
163
182
|
setVisibleAt(instanceId: number, visible: boolean): this;
|
|
164
183
|
|
|
184
|
+
/**
|
|
185
|
+
* Sets the geometryIndex of the instance at the given index.
|
|
186
|
+
* @param instanceId The id of the instance to set the geometryIndex of.
|
|
187
|
+
* @param geometryId The geometryIndex to be use by the instance.
|
|
188
|
+
*/
|
|
189
|
+
setGeometryIdAt(instanceId: number, geometryId: number): this;
|
|
190
|
+
|
|
165
191
|
/**
|
|
166
192
|
* Adds the given geometry to the {@link BatchedMesh} and returns the associated index referring to it.
|
|
167
193
|
* @param geometry The geometry to add into the {@link BatchedMesh}.
|
|
@@ -182,6 +208,13 @@ declare class BatchedMesh extends Mesh<BufferGeometry, Material> {
|
|
|
182
208
|
*/
|
|
183
209
|
addInstance(geometryId: number): number;
|
|
184
210
|
|
|
211
|
+
/**
|
|
212
|
+
* Removes an existing instance from the BatchedMesh using the given instanceId.
|
|
213
|
+
* @param instanceId The id of an instance to remove from the BatchedMesh that was previously added via
|
|
214
|
+
* "addInstance".
|
|
215
|
+
*/
|
|
216
|
+
deleteInstance(instanceId: number): this;
|
|
217
|
+
|
|
185
218
|
/**
|
|
186
219
|
* Replaces the geometry at `geometryId` with the provided geometry. Throws an error if there is not enough space
|
|
187
220
|
* reserved for geometry. Calling this will change all instances that are rendering that geometry.
|
three/src/objects/Group.d.ts
CHANGED
three/src/objects/LOD.d.ts
CHANGED
|
@@ -81,6 +81,13 @@ export class LOD<TEventMap extends Object3DEventMap = Object3DEventMap> extends
|
|
|
81
81
|
*/
|
|
82
82
|
addLevel(object: Object3D, distance?: number, hysteresis?: number): this;
|
|
83
83
|
|
|
84
|
+
/**
|
|
85
|
+
* Removes an existing level, based on the distance from the camera. Returns `true` when the level has been removed.
|
|
86
|
+
* Otherwise `false`.
|
|
87
|
+
* @param distance Distance of the level to delete.
|
|
88
|
+
*/
|
|
89
|
+
removeLabel(distance: number): boolean;
|
|
90
|
+
|
|
84
91
|
/**
|
|
85
92
|
* Get the currently active {@link LOD} level
|
|
86
93
|
* @remarks
|
|
@@ -15,7 +15,7 @@ import { Scene } from "../scenes/Scene.js";
|
|
|
15
15
|
import { Data3DTexture } from "../textures/Data3DTexture.js";
|
|
16
16
|
import { DataArrayTexture } from "../textures/DataArrayTexture.js";
|
|
17
17
|
import { OffscreenCanvas, Texture } from "../textures/Texture.js";
|
|
18
|
-
import { WebGLCapabilities } from "./webgl/WebGLCapabilities.js";
|
|
18
|
+
import { WebGLCapabilities, WebGLCapabilitiesParameters } from "./webgl/WebGLCapabilities.js";
|
|
19
19
|
import { WebGLExtensions } from "./webgl/WebGLExtensions.js";
|
|
20
20
|
import { WebGLInfo } from "./webgl/WebGLInfo.js";
|
|
21
21
|
import { WebGLProgram } from "./webgl/WebGLProgram.js";
|
|
@@ -33,7 +33,7 @@ export interface Renderer {
|
|
|
33
33
|
setSize(width: number, height: number, updateStyle?: boolean): void;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
export interface WebGLRendererParameters {
|
|
36
|
+
export interface WebGLRendererParameters extends WebGLCapabilitiesParameters {
|
|
37
37
|
/**
|
|
38
38
|
* A Canvas where the renderer draws its output.
|
|
39
39
|
*/
|
|
@@ -46,11 +46,6 @@ export interface WebGLRendererParameters {
|
|
|
46
46
|
*/
|
|
47
47
|
context?: WebGLRenderingContext | undefined;
|
|
48
48
|
|
|
49
|
-
/**
|
|
50
|
-
* shader precision. Can be "highp", "mediump" or "lowp".
|
|
51
|
-
*/
|
|
52
|
-
precision?: string | undefined;
|
|
53
|
-
|
|
54
49
|
/**
|
|
55
50
|
* default is false.
|
|
56
51
|
*/
|
|
@@ -86,11 +81,6 @@ export interface WebGLRendererParameters {
|
|
|
86
81
|
*/
|
|
87
82
|
depth?: boolean | undefined;
|
|
88
83
|
|
|
89
|
-
/**
|
|
90
|
-
* default is false.
|
|
91
|
-
*/
|
|
92
|
-
logarithmicDepthBuffer?: boolean | undefined;
|
|
93
|
-
|
|
94
84
|
/**
|
|
95
85
|
* default is false.
|
|
96
86
|
*/
|
|
@@ -3,7 +3,14 @@ import NodeUniformsGroup from "./nodes/NodeUniformsGroup.js";
|
|
|
3
3
|
declare class BindGroup {
|
|
4
4
|
name: string;
|
|
5
5
|
bindings: NodeUniformsGroup[] | Binding[];
|
|
6
|
+
index: number;
|
|
7
|
+
bindingsReference: NodeUniformsGroup[] | BindGroup;
|
|
6
8
|
id: number;
|
|
7
|
-
constructor(
|
|
9
|
+
constructor(
|
|
10
|
+
name?: string,
|
|
11
|
+
bindings?: NodeUniformsGroup[],
|
|
12
|
+
index?: number,
|
|
13
|
+
bindingsReference?: NodeUniformsGroup[] | BindGroup,
|
|
14
|
+
);
|
|
8
15
|
}
|
|
9
16
|
export default BindGroup;
|
|
@@ -35,8 +35,8 @@ declare class Bindings extends DataMap<{
|
|
|
35
35
|
getForCompute(computeNode: ComputeNode): BindGroup[];
|
|
36
36
|
updateForCompute(computeNode: ComputeNode): void;
|
|
37
37
|
updateForRender(renderObject: RenderObject): void;
|
|
38
|
-
_updateBindings(
|
|
38
|
+
_updateBindings(bindings: BindGroup[]): void;
|
|
39
39
|
_init(bindGroup: BindGroup): void;
|
|
40
|
-
_update(
|
|
40
|
+
_update(bindGroup: BindGroup, bindings: BindGroup[]): void;
|
|
41
41
|
}
|
|
42
42
|
export default Bindings;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Group } from "../../objects/Group.js";
|
|
2
|
+
declare class BundleGroup extends Group {
|
|
3
|
+
readonly isBundleGroup: true;
|
|
4
|
+
readonly type: string;
|
|
5
|
+
static: boolean;
|
|
6
|
+
version: number;
|
|
7
|
+
constructor();
|
|
8
|
+
set needsUpdate(value: boolean);
|
|
9
|
+
}
|
|
10
|
+
export default BundleGroup;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Camera } from "../../cameras/Camera.js";
|
|
2
|
-
import
|
|
2
|
+
import BundleGroup from "./BundleGroup.js";
|
|
3
3
|
import ChainMap from "./ChainMap.js";
|
|
4
4
|
import RenderBundle from "./RenderBundle.js";
|
|
5
5
|
declare class RenderBundles {
|
|
6
|
-
lists: ChainMap<readonly [
|
|
6
|
+
lists: ChainMap<readonly [BundleGroup, Camera], RenderBundle>;
|
|
7
7
|
constructor();
|
|
8
|
-
get(scene:
|
|
8
|
+
get(scene: BundleGroup, camera: Camera): RenderBundle;
|
|
9
9
|
dispose(): void;
|
|
10
10
|
}
|
|
11
11
|
export default RenderBundles;
|
|
@@ -37,5 +37,7 @@ declare class RenderContext {
|
|
|
37
37
|
activeMipmapLevel?: number | undefined;
|
|
38
38
|
occlusionQueryCount?: number | undefined;
|
|
39
39
|
constructor();
|
|
40
|
+
getCacheKey(): number;
|
|
40
41
|
}
|
|
42
|
+
export declare function getCacheKey(renderContext: RenderContext): number;
|
|
41
43
|
export default RenderContext;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { Camera } from "../../cameras/Camera.js";
|
|
2
|
+
import { Object3D } from "../../core/Object3D.js";
|
|
2
3
|
import { RenderTarget } from "../../core/RenderTarget.js";
|
|
3
|
-
import { Scene } from "../../scenes/Scene.js";
|
|
4
4
|
import ChainMap from "./ChainMap.js";
|
|
5
5
|
import RenderContext from "./RenderContext.js";
|
|
6
6
|
declare class RenderContexts {
|
|
7
7
|
chainMaps: {
|
|
8
|
-
[attachmentState: string]: ChainMap<readonly [
|
|
8
|
+
[attachmentState: string]: ChainMap<readonly [Object3D, Camera], RenderContext> | undefined;
|
|
9
9
|
};
|
|
10
10
|
constructor();
|
|
11
|
-
get(scene:
|
|
12
|
-
getChainMap(
|
|
11
|
+
get(scene: Object3D, camera: Camera, renderTarget?: RenderTarget | null): RenderContext;
|
|
12
|
+
getChainMap(
|
|
13
|
+
attachmentState: string,
|
|
14
|
+
): ChainMap<readonly [Object3D<import("../../core/Object3D.js").Object3DEventMap>, Camera], RenderContext>;
|
|
13
15
|
dispose(): void;
|
|
14
16
|
}
|
|
15
17
|
export default RenderContexts;
|
|
@@ -4,8 +4,9 @@ import { Object3D } from "../../core/Object3D.js";
|
|
|
4
4
|
import { Light } from "../../lights/Light.js";
|
|
5
5
|
import { Material } from "../../materials/Material.js";
|
|
6
6
|
import { LightsNode } from "../../nodes/Nodes.js";
|
|
7
|
+
import BundleGroup from "./BundleGroup.js";
|
|
7
8
|
export interface Bundle {
|
|
8
|
-
|
|
9
|
+
bundleGroup: BundleGroup;
|
|
9
10
|
camera: Camera;
|
|
10
11
|
renderList: RenderList;
|
|
11
12
|
}
|
|
@@ -5,9 +5,11 @@ import { InterleavedBuffer } from "../../core/InterleavedBuffer.js";
|
|
|
5
5
|
import { InterleavedBufferAttribute } from "../../core/InterleavedBufferAttribute.js";
|
|
6
6
|
import { Object3D } from "../../core/Object3D.js";
|
|
7
7
|
import { Material } from "../../materials/Material.js";
|
|
8
|
+
import NodeMaterialObserver from "../../materials/nodes/manager/NodeMaterialObserver.js";
|
|
8
9
|
import { LightsNode } from "../../nodes/Nodes.js";
|
|
9
10
|
import { Scene } from "../../scenes/Scene.js";
|
|
10
11
|
import BindGroup from "./BindGroup.js";
|
|
12
|
+
import BundleGroup from "./BundleGroup.js";
|
|
11
13
|
import ClippingContext from "./ClippingContext.js";
|
|
12
14
|
import Geometries from "./Geometries.js";
|
|
13
15
|
import NodeBuilderState from "./nodes/NodeBuilderState.js";
|
|
@@ -35,12 +37,20 @@ export default class RenderObject {
|
|
|
35
37
|
attributes: Array<BufferAttribute | InterleavedBufferAttribute> | null;
|
|
36
38
|
pipeline: RenderPipeline | null;
|
|
37
39
|
vertexBuffers: Array<BufferAttribute | InterleavedBuffer> | null;
|
|
40
|
+
drawParams: {
|
|
41
|
+
vertexCount: number;
|
|
42
|
+
firstVertex: number;
|
|
43
|
+
instanceCount: number;
|
|
44
|
+
firstInstance: number;
|
|
45
|
+
} | null;
|
|
46
|
+
bundle: BundleGroup | null;
|
|
38
47
|
clippingContext: ClippingContext;
|
|
39
48
|
clippingContextVersion: number;
|
|
40
49
|
initialNodesCacheKey: string;
|
|
41
50
|
initialCacheKey: string;
|
|
42
51
|
_nodeBuilderState: NodeBuilderState | null;
|
|
43
52
|
_bindings: BindGroup[] | null;
|
|
53
|
+
_monitor: NodeMaterialObserver | null;
|
|
44
54
|
onDispose: (() => void) | null;
|
|
45
55
|
readonly isRenderObject: true;
|
|
46
56
|
onMaterialDispose: () => void;
|
|
@@ -58,6 +68,7 @@ export default class RenderObject {
|
|
|
58
68
|
updateClipping(parent: ClippingContext): void;
|
|
59
69
|
get clippingNeedsUpdate(): boolean;
|
|
60
70
|
getNodeBuilderState(): NodeBuilderState;
|
|
71
|
+
getMonitor(): NodeMaterialObserver;
|
|
61
72
|
getBindings(): BindGroup[];
|
|
62
73
|
getIndex(): BufferAttribute | null;
|
|
63
74
|
getChainArray(): readonly [
|
|
@@ -68,7 +79,14 @@ export default class RenderObject {
|
|
|
68
79
|
];
|
|
69
80
|
getAttributes(): (InterleavedBufferAttribute | BufferAttribute)[];
|
|
70
81
|
getVertexBuffers(): (InterleavedBuffer | BufferAttribute)[] | null;
|
|
71
|
-
|
|
82
|
+
getDrawParameters(): {
|
|
83
|
+
vertexCount: number;
|
|
84
|
+
firstVertex: number;
|
|
85
|
+
instanceCount: number;
|
|
86
|
+
firstInstance: number;
|
|
87
|
+
} | null;
|
|
88
|
+
getGeometryCacheKey(): string;
|
|
89
|
+
getMaterialCacheKey(): number;
|
|
72
90
|
get needsUpdate(): boolean;
|
|
73
91
|
getDynamicCacheKey(): string;
|
|
74
92
|
getCacheKey(): string;
|
|
@@ -10,7 +10,9 @@ import { Color } from "../../math/Color.js";
|
|
|
10
10
|
import { Plane } from "../../math/Plane.js";
|
|
11
11
|
import { Vector2 } from "../../math/Vector2.js";
|
|
12
12
|
import { Vector4 } from "../../math/Vector4.js";
|
|
13
|
-
import
|
|
13
|
+
import MRTNode from "../../nodes/core/MRTNode.js";
|
|
14
|
+
import ComputeNode from "../../nodes/gpgpu/ComputeNode.js";
|
|
15
|
+
import LightsNode from "../../nodes/lighting/LightsNode.js";
|
|
14
16
|
import { Scene } from "../../scenes/Scene.js";
|
|
15
17
|
import { FramebufferTexture } from "../../textures/FramebufferTexture.js";
|
|
16
18
|
import { Texture } from "../../textures/Texture.js";
|
|
@@ -22,6 +24,7 @@ import Bindings from "./Bindings.js";
|
|
|
22
24
|
import Color4 from "./Color4.js";
|
|
23
25
|
import Geometries from "./Geometries.js";
|
|
24
26
|
import Info from "./Info.js";
|
|
27
|
+
import NodeLibrary from "./nodes/NodeLibrary.js";
|
|
25
28
|
import Nodes from "./nodes/Nodes.js";
|
|
26
29
|
import Pipelines from "./Pipelines.js";
|
|
27
30
|
import QuadMesh from "./QuadMesh.js";
|
|
@@ -33,11 +36,18 @@ import RenderList, { Bundle, RenderItem } from "./RenderList.js";
|
|
|
33
36
|
import RenderLists from "./RenderLists.js";
|
|
34
37
|
import RenderObjects from "./RenderObjects.js";
|
|
35
38
|
import Textures from "./Textures.js";
|
|
39
|
+
interface Rectangle {
|
|
40
|
+
x: number;
|
|
41
|
+
y: number;
|
|
42
|
+
z: number;
|
|
43
|
+
w: number;
|
|
44
|
+
}
|
|
36
45
|
export interface RendererParameters {
|
|
37
46
|
logarithmicDepthBuffer?: boolean | undefined;
|
|
38
47
|
alpha?: boolean | undefined;
|
|
39
48
|
antialias?: boolean | undefined;
|
|
40
49
|
samples?: number | undefined;
|
|
50
|
+
getFallback?: ((error: unknown) => Backend) | null | undefined;
|
|
41
51
|
}
|
|
42
52
|
declare class Renderer {
|
|
43
53
|
readonly isRenderer: true;
|
|
@@ -58,6 +68,10 @@ declare class Renderer {
|
|
|
58
68
|
stencil: boolean;
|
|
59
69
|
clippingPlanes: readonly Plane[];
|
|
60
70
|
info: Info;
|
|
71
|
+
nodes: {
|
|
72
|
+
library: NodeLibrary;
|
|
73
|
+
};
|
|
74
|
+
_getFallback: ((error: unknown) => Backend) | null;
|
|
61
75
|
_pixelRatio: number;
|
|
62
76
|
_width: number;
|
|
63
77
|
_height: number;
|
|
@@ -142,12 +156,16 @@ declare class Renderer {
|
|
|
142
156
|
glFragmentShader: WebGLShader,
|
|
143
157
|
) => void)
|
|
144
158
|
| null;
|
|
159
|
+
getShaderAsync: (scene: Scene, camera: Camera, object: Object3D) => Promise<{
|
|
160
|
+
fragmentShader: string | null;
|
|
161
|
+
vertexShader: string | null;
|
|
162
|
+
}>;
|
|
145
163
|
};
|
|
146
164
|
localClippingEnabled?: boolean | undefined;
|
|
147
165
|
constructor(backend: Backend, parameters?: RendererParameters);
|
|
148
166
|
init(): Promise<void>;
|
|
149
167
|
get coordinateSystem(): import("../../constants.js").CoordinateSystem;
|
|
150
|
-
compileAsync(scene:
|
|
168
|
+
compileAsync(scene: Object3D, camera: Camera, targetScene?: Object3D | null): Promise<void>;
|
|
151
169
|
renderAsync(scene: Scene, camera: Camera): Promise<void>;
|
|
152
170
|
setMRT(mrt: MRTNode | null): this;
|
|
153
171
|
getMRT(): MRTNode | null;
|
|
@@ -194,6 +212,7 @@ declare class Renderer {
|
|
|
194
212
|
clearColorAsync(): Promise<void>;
|
|
195
213
|
clearDepthAsync(): Promise<void>;
|
|
196
214
|
clearStencilAsync(): Promise<void>;
|
|
215
|
+
get currentToneMapping(): ToneMapping;
|
|
197
216
|
get currentColorSpace(): ColorSpace;
|
|
198
217
|
dispose(): void;
|
|
199
218
|
setRenderTarget(renderTarget: RenderTarget | null, activeCubeFace?: number, activeMipmapLevel?: number): void;
|
|
@@ -225,7 +244,7 @@ declare class Renderer {
|
|
|
225
244
|
computeAsync(computeNodes: ComputeNode | ComputeNode[]): Promise<void>;
|
|
226
245
|
hasFeatureAsync(name: string): Promise<void>;
|
|
227
246
|
hasFeature(name: string): false | void;
|
|
228
|
-
copyFramebufferToTexture(framebufferTexture: FramebufferTexture): void;
|
|
247
|
+
copyFramebufferToTexture(framebufferTexture: FramebufferTexture, rectangle?: Rectangle | null): void;
|
|
229
248
|
copyTextureToTexture(
|
|
230
249
|
srcTexture: Texture,
|
|
231
250
|
dstTexture: Texture,
|
|
@@ -240,6 +259,7 @@ declare class Renderer {
|
|
|
240
259
|
width: number,
|
|
241
260
|
height: number,
|
|
242
261
|
index?: number,
|
|
262
|
+
faceIndex?: number,
|
|
243
263
|
): Promise<import("../../core/BufferAttribute.js").TypedArray>;
|
|
244
264
|
_projectObject(object: Object3D, camera: Camera, groupOrder: number, renderList: RenderList): void;
|
|
245
265
|
_renderBundles(bundles: Bundle[], sceneRef: Scene, lightsNode: LightsNode): void;
|
|
@@ -268,10 +288,9 @@ declare class Renderer {
|
|
|
268
288
|
scene: Scene,
|
|
269
289
|
camera: Camera,
|
|
270
290
|
lightsNode: LightsNode,
|
|
271
|
-
group: GeometryGroup,
|
|
272
291
|
passId?: string,
|
|
273
292
|
): void;
|
|
274
293
|
get compute(): (computeNodes: ComputeNode | ComputeNode[]) => Promise<void>;
|
|
275
|
-
get compile(): (scene:
|
|
294
|
+
get compile(): (scene: Object3D, camera: Camera, targetScene?: Object3D | null) => Promise<void>;
|
|
276
295
|
}
|
|
277
296
|
export default Renderer;
|
|
@@ -3,12 +3,18 @@ import Binding from "./Binding.js";
|
|
|
3
3
|
|
|
4
4
|
declare class SampledTexture extends Binding {
|
|
5
5
|
id: number;
|
|
6
|
+
|
|
6
7
|
texture: Texture | null;
|
|
7
8
|
version: number;
|
|
8
9
|
store: boolean;
|
|
10
|
+
generation: number | null;
|
|
11
|
+
|
|
9
12
|
readonly isSampledTexture: true;
|
|
13
|
+
|
|
10
14
|
constructor(name: string, texture: Texture | null);
|
|
11
|
-
|
|
15
|
+
|
|
16
|
+
needsBindingsUpdate(generation: number): boolean;
|
|
17
|
+
|
|
12
18
|
update(): boolean;
|
|
13
19
|
}
|
|
14
20
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import NodeMaterialObserver from "../../../materials/nodes/manager/NodeMaterialObserver.js";
|
|
1
2
|
import Node from "../../../nodes/core/Node.js";
|
|
2
3
|
import NodeAttribute from "../../../nodes/core/NodeAttribute.js";
|
|
3
4
|
import BindGroup from "../BindGroup.js";
|
|
@@ -11,7 +12,7 @@ declare class NodeBuilderState {
|
|
|
11
12
|
updateNodes: Node[];
|
|
12
13
|
updateBeforeNodes: Node[];
|
|
13
14
|
updateAfterNodes: Node[];
|
|
14
|
-
|
|
15
|
+
monitor: NodeMaterialObserver;
|
|
15
16
|
usedTimes: number;
|
|
16
17
|
constructor(
|
|
17
18
|
vertexShader: string | null,
|
|
@@ -22,7 +23,7 @@ declare class NodeBuilderState {
|
|
|
22
23
|
updateNodes: Node[],
|
|
23
24
|
updateBeforeNodes: Node[],
|
|
24
25
|
updateAfterNodes: Node[],
|
|
25
|
-
|
|
26
|
+
monitor: NodeMaterialObserver,
|
|
26
27
|
transforms?: never[],
|
|
27
28
|
);
|
|
28
29
|
createBindings(): BindGroup[];
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ToneMapping } from "../../../constants.js";
|
|
2
|
+
import { Light } from "../../../lights/Light.js";
|
|
3
|
+
import { Material } from "../../../materials/Material.js";
|
|
4
|
+
import NodeMaterial from "../../../materials/nodes/NodeMaterial.js";
|
|
5
|
+
import Node from "../../../nodes/core/Node.js";
|
|
6
|
+
import { ColorSpaceMethod } from "../../../nodes/display/ColorSpaceNode.js";
|
|
7
|
+
import AnalyticLightNode from "../../../nodes/lighting/AnalyticLightNode.js";
|
|
8
|
+
import { NodeRepresentation, ShaderNodeObject } from "../../../nodes/tsl/TSLCore.js";
|
|
9
|
+
declare class NodeLibrary {
|
|
10
|
+
lightNodes: WeakMap<{
|
|
11
|
+
new(): Light;
|
|
12
|
+
}, {
|
|
13
|
+
new(light: Light): AnalyticLightNode<Light>;
|
|
14
|
+
}>;
|
|
15
|
+
materialNodes: Map<string, {
|
|
16
|
+
new(): NodeMaterial;
|
|
17
|
+
}>;
|
|
18
|
+
toneMappingNodes: Map<
|
|
19
|
+
ToneMapping,
|
|
20
|
+
(color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject<Node>
|
|
21
|
+
>;
|
|
22
|
+
colorSpaceNodes: Map<ColorSpaceMethod, (color: NodeRepresentation) => ShaderNodeObject<Node>>;
|
|
23
|
+
constructor();
|
|
24
|
+
fromMaterial(material: Material): Material | null;
|
|
25
|
+
addColorSpace(
|
|
26
|
+
colorSpaceNode: (color: NodeRepresentation) => ShaderNodeObject<Node>,
|
|
27
|
+
colorSpace: ColorSpaceMethod,
|
|
28
|
+
): void;
|
|
29
|
+
getColorSpaceFunction(colorSpace: ColorSpaceMethod): ((color: NodeRepresentation) => ShaderNodeObject<Node>) | null;
|
|
30
|
+
addToneMapping(
|
|
31
|
+
toneMappingNode: (color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject<Node>,
|
|
32
|
+
toneMapping: ToneMapping,
|
|
33
|
+
): void;
|
|
34
|
+
getToneMappingFunction(
|
|
35
|
+
toneMapping: ToneMapping,
|
|
36
|
+
): ((color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject<Node>) | null;
|
|
37
|
+
getMaterialNodeClass(materialType: string): (new() => NodeMaterial) | null;
|
|
38
|
+
addMaterial(materialNodeClass: {
|
|
39
|
+
new(): NodeMaterial;
|
|
40
|
+
}, materialClass: {
|
|
41
|
+
new(): Material;
|
|
42
|
+
}): void;
|
|
43
|
+
getLightNodeClass(light: Light): (new(light: Light) => AnalyticLightNode<Light>) | null;
|
|
44
|
+
addLight<TLight extends Light>(lightNodeClass: {
|
|
45
|
+
new(light: TLight): AnalyticLightNode<TLight>;
|
|
46
|
+
}, lightClass: {
|
|
47
|
+
new(): TLight;
|
|
48
|
+
}): void;
|
|
49
|
+
addType<TNodeClass, TType>(nodeClass: TNodeClass, type: TType, library: Map<TType, TNodeClass>): void;
|
|
50
|
+
addClass<TNodeClass, TBaseClass extends object>(
|
|
51
|
+
nodeClass: TNodeClass,
|
|
52
|
+
baseClass: TBaseClass,
|
|
53
|
+
library: WeakMap<TBaseClass, TNodeClass>,
|
|
54
|
+
): void;
|
|
55
|
+
}
|
|
56
|
+
export default NodeLibrary;
|
|
@@ -7,15 +7,15 @@ type GPUStorageTextureAccess = "read-only" | "read-write" | "write-only";
|
|
|
7
7
|
declare class NodeSampledTexture extends SampledTexture {
|
|
8
8
|
textureNode: TextureNode | undefined;
|
|
9
9
|
groupNode: UniformGroupNode;
|
|
10
|
+
|
|
10
11
|
access: "read-write" | "read-only" | "write-only";
|
|
12
|
+
|
|
11
13
|
constructor(
|
|
12
14
|
name: string,
|
|
13
15
|
textureNode: TextureNode | undefined,
|
|
14
16
|
groupNode: UniformGroupNode,
|
|
15
|
-
access
|
|
17
|
+
access?: GPUStorageTextureAccess | null,
|
|
16
18
|
);
|
|
17
|
-
get needsBindingsUpdate(): boolean;
|
|
18
|
-
update(): boolean;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
declare class NodeSampledCubeTexture extends NodeSampledTexture {
|
|
@@ -2,15 +2,13 @@ import { Camera } from "../../../cameras/Camera.js";
|
|
|
2
2
|
import { Object3D } from "../../../core/Object3D.js";
|
|
3
3
|
import { Material } from "../../../materials/Material.js";
|
|
4
4
|
import { Color } from "../../../math/Color.js";
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
UniformGroupNode,
|
|
13
|
-
} from "../../../nodes/Nodes.js";
|
|
5
|
+
import Node from "../../../nodes/core/Node.js";
|
|
6
|
+
import NodeBuilder from "../../../nodes/core/NodeBuilder.js";
|
|
7
|
+
import UniformGroupNode from "../../../nodes/core/UniformGroupNode.js";
|
|
8
|
+
import ComputeNode from "../../../nodes/gpgpu/ComputeNode.js";
|
|
9
|
+
import LightsNode from "../../../nodes/lighting/LightsNode.js";
|
|
10
|
+
import { NodeFrame } from "../../../nodes/Nodes.js";
|
|
11
|
+
import { ShaderNodeObject } from "../../../nodes/TSL.js";
|
|
14
12
|
import { Fog } from "../../../scenes/Fog.js";
|
|
15
13
|
import { FogExp2 } from "../../../scenes/FogExp2.js";
|
|
16
14
|
import { Scene } from "../../../scenes/Scene.js";
|
|
@@ -41,6 +39,13 @@ interface SceneData {
|
|
|
41
39
|
environment?: Texture | undefined;
|
|
42
40
|
environmentNode?: Node | undefined;
|
|
43
41
|
}
|
|
42
|
+
declare module "../../../scenes/Scene.js" {
|
|
43
|
+
interface Scene {
|
|
44
|
+
environmentNode?: Node | null | undefined;
|
|
45
|
+
backgroundNode?: Node | null | undefined;
|
|
46
|
+
fogNode?: Node | null | undefined;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
44
49
|
declare class Nodes extends DataMap<{
|
|
45
50
|
nodeUniformsGroup: {
|
|
46
51
|
key: NodeUniformsGroup;
|
|
@@ -103,6 +108,7 @@ declare class Nodes extends DataMap<{
|
|
|
103
108
|
updateAfter(renderObject: RenderObject): void;
|
|
104
109
|
updateForCompute(computeNode: ComputeNode): void;
|
|
105
110
|
updateForRender(renderObject: RenderObject): void;
|
|
111
|
+
needsRefresh(renderObject: RenderObject): boolean;
|
|
106
112
|
dispose(): void;
|
|
107
113
|
}
|
|
108
114
|
export default Nodes;
|