From 3d2577b011a4ad1c7ca7b754ce19007666ff5aa6 Mon Sep 17 00:00:00 2001 From: Nathan Bierema Date: Wed, 25 Mar 2026 21:38:11 -0400 Subject: [PATCH 1/4] Update three.js --- three.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/three.js b/three.js index 6abd1cf9f..a567d3642 160000 --- a/three.js +++ b/three.js @@ -1 +1 @@ -Subproject commit 6abd1cf9f8e7c98469f644731666371b8c68ed81 +Subproject commit a567d3642a5357194accb890ba02c42842b18193 From d4241cce08bcd1cd46195948ccd15ec1303aad4a Mon Sep 17 00:00:00 2001 From: Nathan Bierema Date: Wed, 25 Mar 2026 21:38:26 -0400 Subject: [PATCH 2/4] Add jsdoc --- .../jsdoc/animation/AnimationAction.d.ts | 310 ++++ .../jsdoc/animation/AnimationClip.d.ts | 164 ++ .../jsdoc/animation/AnimationMixer.d.ts | 152 ++ .../jsdoc/animation/AnimationObjectGroup.d.ts | 77 + .../jsdoc/animation/AnimationUtils.d.ts | 131 ++ .../jsdoc/animation/KeyframeTrack.d.ts | 178 ++ .../jsdoc/animation/PropertyBinding.d.ts | 144 ++ .../jsdoc/animation/PropertyMixer.d.ts | 95 + .../tracks/BooleanKeyframeTrack.d.ts | 28 + .../animation/tracks/ColorKeyframeTrack.d.ts | 17 + .../animation/tracks/NumberKeyframeTrack.d.ts | 17 + .../tracks/QuaternionKeyframeTrack.d.ts | 18 + .../animation/tracks/StringKeyframeTrack.d.ts | 28 + .../animation/tracks/VectorKeyframeTrack.d.ts | 17 + jsdoc-testing/jsdoc/audio/Audio.d.ts | 379 ++++ jsdoc-testing/jsdoc/audio/AudioAnalyser.d.ts | 65 + jsdoc-testing/jsdoc/audio/AudioContext.d.ts | 19 + jsdoc-testing/jsdoc/audio/AudioListener.d.ts | 91 + .../jsdoc/audio/PositionalAudio.d.ts | 115 ++ jsdoc-testing/jsdoc/cameras/ArrayCamera.d.ts | 42 + jsdoc-testing/jsdoc/cameras/Camera.d.ts | 56 + jsdoc-testing/jsdoc/cameras/CubeCamera.d.ts | 74 + .../jsdoc/cameras/OrthographicCamera.d.ts | 122 ++ .../jsdoc/cameras/PerspectiveCamera.d.ts | 216 +++ jsdoc-testing/jsdoc/cameras/StereoCamera.d.ts | 61 + jsdoc-testing/jsdoc/constants.d.ts | 1592 +++++++++++++++++ jsdoc-testing/jsdoc/core/BufferAttribute.d.ts | 482 +++++ jsdoc-testing/jsdoc/core/BufferGeometry.d.ts | 391 ++++ jsdoc-testing/jsdoc/core/EventDispatcher.d.ts | 53 + .../jsdoc/core/InstancedBufferAttribute.d.ts | 36 + .../core/InstancedInterleavedBuffer.d.ts | 35 + .../jsdoc/core/InterleavedBuffer.d.ts | 153 ++ .../core/InterleavedBufferAttribute.d.ts | 226 +++ jsdoc-testing/jsdoc/core/Layers.d.ts | 68 + jsdoc-testing/jsdoc/core/Object3D.d.ts | 584 ++++++ jsdoc-testing/jsdoc/core/RenderTarget.d.ts | 197 ++ jsdoc-testing/jsdoc/core/Timer.d.ts | 86 + jsdoc-testing/jsdoc/extras/DataUtils.d.ts | 39 + jsdoc-testing/jsdoc/extras/ImageUtils.d.ts | 22 + jsdoc-testing/jsdoc/extras/TextureUtils.d.ts | 81 + .../jsdoc/geometries/BoxGeometry.d.ts | 46 + .../jsdoc/geometries/ConeGeometry.d.ts | 29 + .../jsdoc/geometries/CylinderGeometry.d.ts | 47 + .../jsdoc/geometries/OctahedronGeometry.d.ts | 23 + .../jsdoc/geometries/PlaneGeometry.d.ts | 42 + .../jsdoc/geometries/PolyhedronGeometry.d.ts | 36 + .../jsdoc/geometries/SphereGeometry.d.ts | 45 + jsdoc-testing/jsdoc/helpers/ArrowHelper.d.ts | 75 + jsdoc-testing/jsdoc/helpers/AxesHelper.d.ts | 35 + jsdoc-testing/jsdoc/helpers/Box3Helper.d.ts | 35 + jsdoc-testing/jsdoc/helpers/BoxHelper.d.ts | 44 + jsdoc-testing/jsdoc/helpers/CameraHelper.d.ts | 64 + .../jsdoc/helpers/DirectionalLightHelper.d.ts | 68 + jsdoc-testing/jsdoc/helpers/GridHelper.d.ts | 32 + .../jsdoc/helpers/HemisphereLightHelper.d.ts | 55 + jsdoc-testing/jsdoc/helpers/PlaneHelper.d.ts | 41 + .../jsdoc/helpers/PointLightHelper.d.ts | 52 + .../jsdoc/helpers/PolarGridHelper.d.ts | 36 + .../jsdoc/helpers/SkeletonHelper.d.ts | 56 + .../jsdoc/helpers/SpotLightHelper.d.ts | 54 + jsdoc-testing/jsdoc/lights/AmbientLight.d.ts | 30 + .../jsdoc/lights/DirectionalLight.d.ts | 67 + .../jsdoc/lights/DirectionalLightShadow.d.ts | 20 + .../jsdoc/lights/HemisphereLight.d.ts | 40 + jsdoc-testing/jsdoc/lights/Light.d.ts | 47 + jsdoc-testing/jsdoc/lights/LightProbe.d.ts | 45 + jsdoc-testing/jsdoc/lights/LightShadow.d.ts | 198 ++ jsdoc-testing/jsdoc/lights/PointLight.d.ts | 70 + .../jsdoc/lights/PointLightShadow.d.ts | 20 + jsdoc-testing/jsdoc/lights/RectAreaLight.d.ts | 68 + jsdoc-testing/jsdoc/lights/SpotLight.d.ts | 116 ++ .../jsdoc/lights/SpotLightShadow.d.ts | 37 + .../jsdoc/lights/webgpu/IESSpotLight.d.ts | 18 + .../jsdoc/lights/webgpu/ProjectorLight.d.ts | 17 + .../jsdoc/materials/LineBasicMaterial.d.ts | 86 + .../jsdoc/materials/LineDashedMaterial.d.ts | 49 + jsdoc-testing/jsdoc/materials/Material.d.ts | 497 +++++ jsdoc-testing/jsdoc/materials/Materials.d.ts | 19 + .../jsdoc/materials/MeshBasicMaterial.d.ts | 184 ++ .../jsdoc/materials/MeshDepthMaterial.d.ts | 106 ++ .../jsdoc/materials/MeshDistanceMaterial.d.ts | 86 + .../jsdoc/materials/MeshLambertMaterial.d.ts | 305 ++++ .../jsdoc/materials/MeshMatcapMaterial.d.ts | 180 ++ .../jsdoc/materials/MeshNormalMaterial.d.ts | 127 ++ .../jsdoc/materials/MeshPhongMaterial.d.ts | 320 ++++ .../jsdoc/materials/MeshPhysicalMaterial.d.ts | 310 ++++ .../jsdoc/materials/MeshStandardMaterial.d.ts | 326 ++++ .../jsdoc/materials/MeshToonMaterial.d.ts | 242 +++ .../jsdoc/materials/PointsMaterial.d.ts | 102 ++ .../jsdoc/materials/RawShaderMaterial.d.ts | 108 ++ .../jsdoc/materials/ShaderMaterial.d.ts | 256 +++ .../jsdoc/materials/ShadowMaterial.d.ts | 56 + .../jsdoc/materials/SpriteMaterial.d.ts | 89 + .../materials/nodes/Line2NodeMaterial.d.ts | 86 + .../nodes/LineBasicNodeMaterial.d.ts | 23 + .../nodes/LineDashedNodeMaterial.d.ts | 78 + .../nodes/MeshBasicNodeMaterial.d.ts | 39 + .../nodes/MeshLambertNodeMaterial.d.ts | 39 + .../nodes/MeshMatcapNodeMaterial.d.ts | 29 + .../nodes/MeshNormalNodeMaterial.d.ts | 28 + .../nodes/MeshPhongNodeMaterial.d.ts | 64 + .../nodes/MeshPhysicalNodeMaterial.d.ts | 276 +++ .../materials/nodes/MeshSSSNodeMaterial.d.ts | 96 + .../nodes/MeshStandardNodeMaterial.d.ts | 81 + .../materials/nodes/MeshToonNodeMaterial.d.ts | 30 + .../jsdoc/materials/nodes/NodeMaterial.d.ts | 505 ++++++ .../jsdoc/materials/nodes/NodeMaterials.d.ts | 18 + .../materials/nodes/PointsNodeMaterial.d.ts | 49 + .../materials/nodes/ShadowNodeMaterial.d.ts | 30 + .../materials/nodes/SpriteNodeMaterial.d.ts | 62 + .../materials/nodes/VolumeNodeMaterial.d.ts | 48 + .../nodes/manager/NodeMaterialObserver.d.ts | 131 ++ jsdoc-testing/jsdoc/math/Box3.d.ts | 293 +++ jsdoc-testing/jsdoc/math/Color.d.ts | 538 ++++++ jsdoc-testing/jsdoc/math/ColorManagement.d.ts | 21 + jsdoc-testing/jsdoc/math/Euler.d.ts | 164 ++ jsdoc-testing/jsdoc/math/Frustum.d.ts | 100 ++ jsdoc-testing/jsdoc/math/FrustumArray.d.ts | 64 + jsdoc-testing/jsdoc/math/Interpolant.d.ts | 114 ++ jsdoc-testing/jsdoc/math/MathUtils.d.ts | 224 +++ jsdoc-testing/jsdoc/math/Matrix2.d.ts | 70 + jsdoc-testing/jsdoc/math/Matrix3.d.ts | 251 +++ jsdoc-testing/jsdoc/math/Matrix4.d.ts | 404 +++++ jsdoc-testing/jsdoc/math/Plane.d.ts | 189 ++ jsdoc-testing/jsdoc/math/Quaternion.d.ts | 310 ++++ jsdoc-testing/jsdoc/math/Ray.d.ts | 185 ++ jsdoc-testing/jsdoc/math/Sphere.d.ts | 185 ++ .../jsdoc/math/SphericalHarmonics3.d.ts | 131 ++ jsdoc-testing/jsdoc/math/Triangle.d.ts | 231 +++ jsdoc-testing/jsdoc/math/Vector2.d.ts | 440 +++++ jsdoc-testing/jsdoc/math/Vector3.d.ts | 613 +++++++ jsdoc-testing/jsdoc/math/Vector4.d.ts | 443 +++++ .../math/interpolants/BezierInterpolant.d.ts | 22 + .../math/interpolants/CubicInterpolant.d.ts | 22 + .../interpolants/DiscreteInterpolant.d.ts | 10 + .../math/interpolants/LinearInterpolant.d.ts | 9 + .../QuaternionLinearInterpolant.d.ts | 9 + jsdoc-testing/jsdoc/nodes/Nodes.d.ts | 140 ++ jsdoc-testing/jsdoc/nodes/TSL.d.ts | 136 ++ .../jsdoc/nodes/accessors/AccessorsUtils.d.ts | 23 + .../jsdoc/nodes/accessors/Arrays.d.ts | 2 + .../jsdoc/nodes/accessors/BatchNode.d.ts | 47 + .../jsdoc/nodes/accessors/Bitangent.d.ts | 28 + .../nodes/accessors/BufferAttributeNode.d.ts | 143 ++ .../jsdoc/nodes/accessors/BufferNode.d.ts | 75 + .../jsdoc/nodes/accessors/BuiltinNode.d.ts | 40 + .../jsdoc/nodes/accessors/Camera.d.ts | 70 + .../jsdoc/nodes/accessors/ClippingNode.d.ts | 65 + .../nodes/accessors/CubeTextureNode.d.ts | 48 + .../jsdoc/nodes/accessors/InstanceNode.d.ts | 125 ++ .../nodes/accessors/InstancedMeshNode.d.ts | 31 + .../jsdoc/nodes/accessors/Lights.d.ts | 48 + .../jsdoc/nodes/accessors/MaterialNode.d.ts | 384 ++++ .../nodes/accessors/MaterialProperties.d.ts | 24 + .../accessors/MaterialReferenceNode.d.ts | 41 + .../jsdoc/nodes/accessors/ModelNode.d.ts | 104 ++ .../accessors/ModelViewProjectionNode.d.ts | 7 + .../jsdoc/nodes/accessors/MorphNode.d.ts | 49 + .../jsdoc/nodes/accessors/Normal.d.ts | 100 ++ .../jsdoc/nodes/accessors/Object3DNode.d.ts | 128 ++ .../jsdoc/nodes/accessors/PointUVNode.d.ts | 33 + .../jsdoc/nodes/accessors/Position.d.ts | 57 + .../nodes/accessors/ReferenceBaseNode.d.ts | 181 ++ .../jsdoc/nodes/accessors/ReferenceNode.d.ts | 197 ++ .../jsdoc/nodes/accessors/ReflectVector.d.ts | 28 + .../accessors/RendererReferenceNode.d.ts | 33 + .../nodes/accessors/SceneProperties.d.ts | 21 + .../jsdoc/nodes/accessors/SkinningNode.d.ts | 122 ++ .../nodes/accessors/StorageBufferNode.d.ts | 183 ++ .../nodes/accessors/StorageTextureNode.d.ts | 123 ++ .../jsdoc/nodes/accessors/Tangent.d.ts | 28 + .../jsdoc/nodes/accessors/TangentUtils.d.ts | 20 + .../jsdoc/nodes/accessors/Texture3DNode.d.ts | 54 + .../jsdoc/nodes/accessors/TextureBicubic.d.ts | 20 + .../jsdoc/nodes/accessors/TextureNode.d.ts | 337 ++++ .../nodes/accessors/TextureSizeNode.d.ts | 50 + jsdoc-testing/jsdoc/nodes/accessors/UV.d.ts | 1 + .../nodes/accessors/UniformArrayNode.d.ts | 125 ++ .../jsdoc/nodes/accessors/UserDataNode.d.ts | 35 + .../jsdoc/nodes/accessors/VelocityNode.d.ts | 79 + .../nodes/accessors/VertexColorNode.d.ts | 31 + jsdoc-testing/jsdoc/nodes/code/CodeNode.d.ts | 79 + .../jsdoc/nodes/code/ExpressionNode.d.ts | 35 + .../jsdoc/nodes/code/FunctionCallNode.d.ts | 70 + .../jsdoc/nodes/code/FunctionNode.d.ts | 76 + jsdoc-testing/jsdoc/nodes/core/ArrayNode.d.ts | 76 + .../jsdoc/nodes/core/AssignNode.d.ts | 65 + .../jsdoc/nodes/core/AttributeNode.d.ts | 41 + .../jsdoc/nodes/core/BypassNode.d.ts | 54 + jsdoc-testing/jsdoc/nodes/core/ConstNode.d.ts | 25 + .../jsdoc/nodes/core/ContextNode.d.ts | 107 ++ jsdoc-testing/jsdoc/nodes/core/IndexNode.d.ts | 88 + jsdoc-testing/jsdoc/nodes/core/InputNode.d.ts | 61 + .../jsdoc/nodes/core/InspectorNode.d.ts | 57 + .../jsdoc/nodes/core/IsolateNode.d.ts | 55 + .../jsdoc/nodes/core/LightingModel.d.ts | 59 + jsdoc-testing/jsdoc/nodes/core/MRTNode.d.ts | 106 ++ jsdoc-testing/jsdoc/nodes/core/Node.d.ts | 437 +++++ .../jsdoc/nodes/core/NodeAttribute.d.ts | 44 + .../jsdoc/nodes/core/NodeBuilder.d.ts | 1322 ++++++++++++++ jsdoc-testing/jsdoc/nodes/core/NodeCache.d.ts | 47 + jsdoc-testing/jsdoc/nodes/core/NodeCode.d.ts | 36 + jsdoc-testing/jsdoc/nodes/core/NodeError.d.ts | 13 + jsdoc-testing/jsdoc/nodes/core/NodeFrame.d.ts | 133 ++ .../jsdoc/nodes/core/NodeFunction.d.ts | 55 + .../jsdoc/nodes/core/NodeFunctionInput.d.ts | 52 + .../jsdoc/nodes/core/NodeParser.d.ts | 15 + .../jsdoc/nodes/core/NodeUniform.d.ts | 62 + jsdoc-testing/jsdoc/nodes/core/NodeUtils.d.ts | 93 + jsdoc-testing/jsdoc/nodes/core/NodeVar.d.ts | 50 + .../jsdoc/nodes/core/NodeVarying.d.ts | 51 + .../jsdoc/nodes/core/OutputStructNode.d.ts | 41 + .../jsdoc/nodes/core/ParameterNode.d.ts | 35 + .../jsdoc/nodes/core/PropertyNode.d.ts | 253 +++ jsdoc-testing/jsdoc/nodes/core/StackNode.d.ts | 145 ++ .../jsdoc/nodes/core/StackTrace.d.ts | 44 + .../jsdoc/nodes/core/StructNode.d.ts | 33 + .../jsdoc/nodes/core/StructType.d.ts | 7 + .../jsdoc/nodes/core/StructTypeNode.d.ts | 48 + .../jsdoc/nodes/core/SubBuildNode.d.ts | 30 + jsdoc-testing/jsdoc/nodes/core/TempNode.d.ts | 28 + .../jsdoc/nodes/core/UniformGroupNode.d.ts | 77 + .../jsdoc/nodes/core/UniformNode.d.ts | 65 + jsdoc-testing/jsdoc/nodes/core/VarNode.d.ts | 88 + .../jsdoc/nodes/core/VaryingNode.d.ts | 80 + jsdoc-testing/jsdoc/nodes/core/constants.d.ts | 30 + .../jsdoc/nodes/display/BlendModes.d.ts | 95 + .../jsdoc/nodes/display/BumpMapNode.d.ts | 44 + .../jsdoc/nodes/display/ColorAdjustment.d.ts | 76 + .../nodes/display/ColorSpaceFunctions.d.ts | 18 + .../jsdoc/nodes/display/ColorSpaceNode.d.ts | 50 + .../jsdoc/nodes/display/FrontFacingNode.d.ts | 48 + .../jsdoc/nodes/display/NormalMapNode.d.ts | 58 + .../jsdoc/nodes/display/PassNode.d.ts | 417 +++++ .../jsdoc/nodes/display/RenderOutputNode.d.ts | 79 + .../jsdoc/nodes/display/ScreenNode.d.ts | 127 ++ .../nodes/display/ToneMappingFunctions.d.ts | 68 + .../jsdoc/nodes/display/ToneMappingNode.d.ts | 60 + .../nodes/display/ToonOutlinePassNode.d.ts | 71 + .../nodes/display/ViewportDepthNode.d.ts | 105 ++ .../display/ViewportDepthTextureNode.d.ts | 31 + .../display/ViewportSharedTextureNode.d.ts | 37 + .../nodes/display/ViewportTextureNode.d.ts | 89 + jsdoc-testing/jsdoc/nodes/fog/Fog.d.ts | 38 + .../jsdoc/nodes/functions/BSDF/BRDF_GGX.d.ts | 2 + .../functions/BSDF/BRDF_GGX_Multiscatter.d.ts | 2 + .../nodes/functions/BSDF/BRDF_Lambert.d.ts | 2 + .../nodes/functions/BSDF/BRDF_Sheen.d.ts | 2 + .../jsdoc/nodes/functions/BSDF/DFGLUT.d.ts | 2 + .../jsdoc/nodes/functions/BSDF/D_GGX.d.ts | 2 + .../functions/BSDF/D_GGX_Anisotropic.d.ts | 2 + .../nodes/functions/BSDF/EnvironmentBRDF.d.ts | 2 + .../jsdoc/nodes/functions/BSDF/F_Schlick.d.ts | 2 + .../jsdoc/nodes/functions/BSDF/LTC.d.ts | 3 + .../nodes/functions/BSDF/Schlick_to_F0.d.ts | 2 + .../functions/BSDF/V_GGX_SmithCorrelated.d.ts | 2 + .../V_GGX_SmithCorrelated_Anisotropic.d.ts | 2 + .../nodes/functions/BasicLightingModel.d.ts | 23 + .../nodes/functions/PhongLightingModel.d.ts | 31 + .../functions/PhysicalLightingModel.d.ts | 171 ++ .../nodes/functions/ShadowMaskModel.d.ts | 27 + .../nodes/functions/ToonLightingModel.d.ts | 23 + .../functions/VolumetricLightingModel.d.ts | 25 + .../material/getAlphaHashThreshold.d.ts | 2 + .../material/getGeometryRoughness.d.ts | 2 + .../material/getParallaxCorrectNormal.d.ts | 19 + .../functions/material/getRoughness.d.ts | 2 + .../functions/material/getShIrradianceAt.d.ts | 2 + .../jsdoc/nodes/geometry/RangeNode.d.ts | 68 + .../jsdoc/nodes/gpgpu/AtomicFunctionNode.d.ts | 78 + .../jsdoc/nodes/gpgpu/BarrierNode.d.ts | 23 + .../jsdoc/nodes/gpgpu/ComputeBuiltinNode.d.ts | 135 ++ .../jsdoc/nodes/gpgpu/ComputeNode.d.ts | 96 + .../nodes/gpgpu/SubgroupFunctionNode.d.ts | 303 ++++ .../jsdoc/nodes/gpgpu/WorkgroupInfoNode.d.ts | 119 ++ .../jsdoc/nodes/lighting/AONode.d.ts | 25 + .../nodes/lighting/AmbientLightNode.d.ts | 12 + .../nodes/lighting/AnalyticLightNode.d.ts | 127 ++ .../nodes/lighting/BasicEnvironmentNode.d.ts | 26 + .../nodes/lighting/BasicLightMapNode.d.ts | 24 + .../nodes/lighting/DirectionalLightNode.d.ts | 13 + .../jsdoc/nodes/lighting/EnvironmentNode.d.ts | 33 + .../nodes/lighting/HemisphereLightNode.d.ts | 34 + .../nodes/lighting/IESSpotLightNode.d.ts | 9 + .../jsdoc/nodes/lighting/IrradianceNode.d.ts | 24 + .../jsdoc/nodes/lighting/LightProbeNode.d.ts | 22 + .../jsdoc/nodes/lighting/LightUtils.d.ts | 11 + .../nodes/lighting/LightingContextNode.d.ts | 83 + .../jsdoc/nodes/lighting/LightingNode.d.ts | 21 + .../jsdoc/nodes/lighting/LightsNode.d.ts | 119 ++ .../jsdoc/nodes/lighting/PointLightNode.d.ts | 40 + .../jsdoc/nodes/lighting/PointShadowNode.d.ts | 52 + .../nodes/lighting/ProjectorLightNode.d.ts | 17 + .../nodes/lighting/RectAreaLightNode.d.ts | 41 + .../jsdoc/nodes/lighting/ShadowBaseNode.d.ts | 46 + .../nodes/lighting/ShadowFilterNode.d.ts | 50 + .../jsdoc/nodes/lighting/ShadowNode.d.ts | 193 ++ .../jsdoc/nodes/lighting/SpotLightNode.d.ts | 52 + .../jsdoc/nodes/materialx/MaterialXNodes.d.ts | 44 + .../jsdoc/nodes/materialx/lib/mx_hsv.d.ts | 2 + .../jsdoc/nodes/materialx/lib/mx_noise.d.ts | 70 + .../materialx/lib/mx_transform_color.d.ts | 1 + .../jsdoc/nodes/math/BitcastNode.d.ts | 62 + .../jsdoc/nodes/math/BitcountNode.d.ts | 111 ++ .../jsdoc/nodes/math/ConditionalNode.d.ts | 65 + jsdoc-testing/jsdoc/nodes/math/Hash.d.ts | 9 + jsdoc-testing/jsdoc/nodes/math/MathNode.d.ts | 701 ++++++++ jsdoc-testing/jsdoc/nodes/math/MathUtils.d.ts | 4 + .../jsdoc/nodes/math/OperatorNode.d.ts | 313 ++++ .../jsdoc/nodes/math/PackFloatNode.d.ts | 66 + .../jsdoc/nodes/math/TriNoise3D.d.ts | 11 + .../jsdoc/nodes/math/UnpackFloatNode.d.ts | 64 + .../jsdoc/nodes/parsers/GLSLNodeFunction.d.ts | 25 + .../jsdoc/nodes/parsers/GLSLNodeParser.d.ts | 17 + .../jsdoc/nodes/pmrem/PMREMNode.d.ts | 113 ++ .../jsdoc/nodes/pmrem/PMREMUtils.d.ts | 4 + .../jsdoc/nodes/procedural/Checker.d.ts | 9 + jsdoc-testing/jsdoc/nodes/shapes/Shapes.d.ts | 9 + jsdoc-testing/jsdoc/nodes/tsl/TSLBase.d.ts | 26 + jsdoc-testing/jsdoc/nodes/tsl/TSLCore.d.ts | 77 + .../jsdoc/nodes/utils/ArrayElementNode.d.ts | 53 + .../jsdoc/nodes/utils/ConvertNode.d.ts | 41 + .../jsdoc/nodes/utils/CubeMapNode.d.ts | 57 + .../jsdoc/nodes/utils/DebugNode.d.ts | 12 + jsdoc-testing/jsdoc/nodes/utils/Discard.d.ts | 2 + .../jsdoc/nodes/utils/EquirectUV.d.ts | 17 + .../jsdoc/nodes/utils/EventNode.d.ts | 30 + jsdoc-testing/jsdoc/nodes/utils/FlipNode.d.ts | 46 + .../nodes/utils/FunctionOverloadingNode.d.ts | 60 + jsdoc-testing/jsdoc/nodes/utils/JoinNode.d.ts | 33 + jsdoc-testing/jsdoc/nodes/utils/LoopNode.d.ts | 67 + jsdoc-testing/jsdoc/nodes/utils/MatcapUV.d.ts | 11 + .../jsdoc/nodes/utils/MaxMipLevelNode.d.ts | 51 + .../jsdoc/nodes/utils/MemberNode.d.ts | 41 + .../jsdoc/nodes/utils/Oscillators.d.ts | 4 + jsdoc-testing/jsdoc/nodes/utils/Packing.d.ts | 3 + .../nodes/utils/PostProcessingUtils.d.ts | 66 + jsdoc-testing/jsdoc/nodes/utils/RTTNode.d.ts | 120 ++ .../jsdoc/nodes/utils/ReflectorNode.d.ts | 233 +++ jsdoc-testing/jsdoc/nodes/utils/Remap.d.ts | 30 + .../jsdoc/nodes/utils/RotateNode.d.ts | 49 + .../jsdoc/nodes/utils/SampleNode.d.ts | 46 + jsdoc-testing/jsdoc/nodes/utils/SetNode.d.ts | 49 + .../jsdoc/nodes/utils/SplitNode.d.ts | 65 + .../jsdoc/nodes/utils/SpriteSheetUV.d.ts | 17 + .../jsdoc/nodes/utils/SpriteUtils.d.ts | 17 + .../nodes/utils/StorageArrayElementNode.d.ts | 51 + jsdoc-testing/jsdoc/nodes/utils/Timer.d.ts | 21 + .../jsdoc/nodes/utils/TriplanarTextures.d.ts | 21 + jsdoc-testing/jsdoc/nodes/utils/UVUtils.d.ts | 42 + .../jsdoc/nodes/utils/ViewportUtils.d.ts | 13 + jsdoc-testing/jsdoc/objects/Group.d.ts | 29 + jsdoc-testing/jsdoc/objects/Line.d.ts | 94 + jsdoc-testing/jsdoc/objects/LineSegments.d.ts | 24 + jsdoc-testing/jsdoc/objects/Mesh.d.ts | 97 + .../jsdoc/renderers/common/Animation.d.ts | 92 + .../jsdoc/renderers/common/Attributes.d.ts | 52 + .../jsdoc/renderers/common/Backend.d.ts | 531 ++++++ .../jsdoc/renderers/common/Background.d.ts | 40 + .../jsdoc/renderers/common/BindGroup.d.ts | 36 + .../jsdoc/renderers/common/Binding.d.ts | 49 + .../jsdoc/renderers/common/Bindings.d.ts | 114 ++ .../jsdoc/renderers/common/BlendMode.d.ts | 109 ++ .../jsdoc/renderers/common/Buffer.d.ts | 87 + .../jsdoc/renderers/common/BufferUtils.d.ts | 28 + .../jsdoc/renderers/common/BundleGroup.d.ts | 40 + .../jsdoc/renderers/common/CanvasTarget.d.ts | 189 ++ .../jsdoc/renderers/common/ChainMap.d.ts | 48 + .../renderers/common/ClippingContext.d.ts | 116 ++ .../jsdoc/renderers/common/Color4.d.ts | 49 + .../renderers/common/ComputePipeline.d.ts | 31 + .../jsdoc/renderers/common/Constants.d.ts | 9 + .../renderers/common/CubeRenderTarget.d.ts | 42 + .../jsdoc/renderers/common/DataMap.d.ts | 41 + .../jsdoc/renderers/common/Geometries.d.ts | 103 ++ .../IndirectStorageBufferAttribute.d.ts | 29 + .../jsdoc/renderers/common/Info.d.ts | 183 ++ .../jsdoc/renderers/common/InspectorBase.d.ts | 109 ++ .../jsdoc/renderers/common/Lighting.d.ts | 28 + .../jsdoc/renderers/common/Pipeline.d.ts | 28 + .../jsdoc/renderers/common/Pipelines.d.ts | 174 ++ .../renderers/common/PostProcessing.d.ts | 17 + .../renderers/common/ProgrammableStage.d.ts | 64 + .../jsdoc/renderers/common/QuadMesh.d.ts | 52 + .../jsdoc/renderers/common/RenderBundle.d.ts | 18 + .../jsdoc/renderers/common/RenderBundles.d.ts | 28 + .../jsdoc/renderers/common/RenderContext.d.ts | 221 +++ .../renderers/common/RenderContexts.d.ts | 42 + .../jsdoc/renderers/common/RenderList.d.ts | 169 ++ .../jsdoc/renderers/common/RenderLists.d.ts | 41 + .../jsdoc/renderers/common/RenderObject.d.ts | 409 +++++ .../common/RenderObjectPipeline.d.ts | 30 + .../jsdoc/renderers/common/RenderObjects.d.ts | 108 ++ .../renderers/common/RenderPipeline.d.ts | 126 ++ .../jsdoc/renderers/common/Renderer.d.ts | 1401 +++++++++++++++ .../jsdoc/renderers/common/RendererUtils.d.ts | 105 ++ .../renderers/common/SampledTexture.d.ts | 85 + .../jsdoc/renderers/common/Sampler.d.ts | 66 + .../renderers/common/Storage3DTexture.d.ts | 52 + .../renderers/common/StorageArrayTexture.d.ts | 38 + .../jsdoc/renderers/common/StorageBuffer.d.ts | 38 + .../common/StorageBufferAttribute.d.ts | 35 + .../StorageInstancedBufferAttribute.d.ts | 35 + .../renderers/common/StorageTexture.d.ts | 43 + .../jsdoc/renderers/common/Textures.d.ts | 110 ++ .../renderers/common/TimestampQueryPool.d.ts | 119 ++ .../jsdoc/renderers/common/Uniform.d.ts | 260 +++ .../jsdoc/renderers/common/UniformBuffer.d.ts | 18 + .../jsdoc/renderers/common/UniformsGroup.d.ts | 139 ++ .../jsdoc/renderers/common/XRManager.d.ts | 516 ++++++ .../renderers/common/XRRenderTarget.d.ts | 66 + .../common/extras/PMREMGenerator.d.ts | 196 ++ .../common/nodes/NodeBuilderState.d.ts | 105 ++ .../renderers/common/nodes/NodeLibrary.d.ts | 99 + .../renderers/common/nodes/NodeManager.d.ts | 280 +++ .../common/nodes/NodeSampledTexture.d.ts | 72 + .../renderers/common/nodes/NodeSampler.d.ts | 31 + .../common/nodes/NodeStorageBuffer.d.ts | 36 + .../renderers/common/nodes/NodeUniform.d.ts | 230 +++ .../common/nodes/NodeUniformBuffer.d.ts | 56 + .../common/nodes/NodeUniformsGroup.d.ts | 38 + .../ShaderChunk/default_fragment.glsl.d.ts | 2 + .../ShaderChunk/default_vertex.glsl.d.ts | 2 + .../renderers/shaders/UniformsUtils.d.ts | 29 + .../webgl-fallback/WebGLBackend.d.ts | 631 +++++++ .../webgl-fallback/WebGLBufferRenderer.d.ts | 13 + .../webgl-fallback/nodes/GLSLNodeBuilder.d.ts | 365 ++++ .../utils/WebGLAttributeUtils.d.ts | 59 + .../utils/WebGLCapabilities.d.ts | 48 + .../webgl-fallback/utils/WebGLConstants.d.ts | 11 + .../webgl-fallback/utils/WebGLExtensions.d.ts | 56 + .../webgl-fallback/utils/WebGLState.d.ts | 372 ++++ .../utils/WebGLTextureUtils.d.ts | 197 ++ .../utils/WebGLTimestampQueryPool.d.ts | 58 + .../webgl-fallback/utils/WebGLUtils.d.ts | 51 + .../jsdoc/renderers/webgpu/WebGPUBackend.d.ts | 537 ++++++ .../webgpu/WebGPURenderer.Nodes.d.ts | 25 + .../renderers/webgpu/WebGPURenderer.d.ts | 42 + .../webgpu/nodes/BasicNodeLibrary.d.ts | 11 + .../webgpu/nodes/StandardNodeLibrary.d.ts | 12 + .../webgpu/nodes/WGSLNodeBuilder.d.ts | 590 ++++++ .../webgpu/nodes/WGSLNodeFunction.d.ts | 25 + .../webgpu/nodes/WGSLNodeParser.d.ts | 17 + .../webgpu/utils/WebGPUAttributeUtils.d.ts | 73 + .../webgpu/utils/WebGPUBindingUtils.d.ts | 88 + .../webgpu/utils/WebGPUCapabilities.d.ts | 32 + .../webgpu/utils/WebGPUConstants.d.ts | 295 +++ .../webgpu/utils/WebGPUPipelineUtils.d.ts | 133 ++ .../webgpu/utils/WebGPUTexturePassUtils.d.ts | 97 + .../webgpu/utils/WebGPUTextureUtils.d.ts | 278 +++ .../utils/WebGPUTimestampQueryPool.d.ts | 53 + .../renderers/webgpu/utils/WebGPUUtils.d.ts | 95 + .../renderers/webxr/WebXRController.d.ts | 96 + jsdoc-testing/jsdoc/scenes/Fog.d.ts | 70 + jsdoc-testing/jsdoc/scenes/FogExp2.d.ts | 60 + jsdoc-testing/jsdoc/scenes/Scene.d.ts | 97 + .../jsdoc/textures/CubeDepthTexture.d.ts | 51 + jsdoc-testing/jsdoc/textures/CubeTexture.d.ts | 49 + .../jsdoc/textures/DataArrayTexture.d.ts | 53 + jsdoc-testing/jsdoc/textures/DataTexture.d.ts | 38 + .../jsdoc/textures/DepthTexture.d.ts | 42 + .../jsdoc/textures/FramebufferTexture.d.ts | 42 + jsdoc-testing/jsdoc/textures/Source.d.ts | 78 + jsdoc-testing/jsdoc/textures/Texture.d.ts | 405 +++++ jsdoc-testing/jsdoc/utils.d.ts | 185 ++ 465 files changed, 47345 insertions(+) create mode 100644 jsdoc-testing/jsdoc/animation/AnimationAction.d.ts create mode 100644 jsdoc-testing/jsdoc/animation/AnimationClip.d.ts create mode 100644 jsdoc-testing/jsdoc/animation/AnimationMixer.d.ts create mode 100644 jsdoc-testing/jsdoc/animation/AnimationObjectGroup.d.ts create mode 100644 jsdoc-testing/jsdoc/animation/AnimationUtils.d.ts create mode 100644 jsdoc-testing/jsdoc/animation/KeyframeTrack.d.ts create mode 100644 jsdoc-testing/jsdoc/animation/PropertyBinding.d.ts create mode 100644 jsdoc-testing/jsdoc/animation/PropertyMixer.d.ts create mode 100644 jsdoc-testing/jsdoc/animation/tracks/BooleanKeyframeTrack.d.ts create mode 100644 jsdoc-testing/jsdoc/animation/tracks/ColorKeyframeTrack.d.ts create mode 100644 jsdoc-testing/jsdoc/animation/tracks/NumberKeyframeTrack.d.ts create mode 100644 jsdoc-testing/jsdoc/animation/tracks/QuaternionKeyframeTrack.d.ts create mode 100644 jsdoc-testing/jsdoc/animation/tracks/StringKeyframeTrack.d.ts create mode 100644 jsdoc-testing/jsdoc/animation/tracks/VectorKeyframeTrack.d.ts create mode 100644 jsdoc-testing/jsdoc/audio/Audio.d.ts create mode 100644 jsdoc-testing/jsdoc/audio/AudioAnalyser.d.ts create mode 100644 jsdoc-testing/jsdoc/audio/AudioContext.d.ts create mode 100644 jsdoc-testing/jsdoc/audio/AudioListener.d.ts create mode 100644 jsdoc-testing/jsdoc/audio/PositionalAudio.d.ts create mode 100644 jsdoc-testing/jsdoc/cameras/ArrayCamera.d.ts create mode 100644 jsdoc-testing/jsdoc/cameras/Camera.d.ts create mode 100644 jsdoc-testing/jsdoc/cameras/CubeCamera.d.ts create mode 100644 jsdoc-testing/jsdoc/cameras/OrthographicCamera.d.ts create mode 100644 jsdoc-testing/jsdoc/cameras/PerspectiveCamera.d.ts create mode 100644 jsdoc-testing/jsdoc/cameras/StereoCamera.d.ts create mode 100644 jsdoc-testing/jsdoc/constants.d.ts create mode 100644 jsdoc-testing/jsdoc/core/BufferAttribute.d.ts create mode 100644 jsdoc-testing/jsdoc/core/BufferGeometry.d.ts create mode 100644 jsdoc-testing/jsdoc/core/EventDispatcher.d.ts create mode 100644 jsdoc-testing/jsdoc/core/InstancedBufferAttribute.d.ts create mode 100644 jsdoc-testing/jsdoc/core/InstancedInterleavedBuffer.d.ts create mode 100644 jsdoc-testing/jsdoc/core/InterleavedBuffer.d.ts create mode 100644 jsdoc-testing/jsdoc/core/InterleavedBufferAttribute.d.ts create mode 100644 jsdoc-testing/jsdoc/core/Layers.d.ts create mode 100644 jsdoc-testing/jsdoc/core/Object3D.d.ts create mode 100644 jsdoc-testing/jsdoc/core/RenderTarget.d.ts create mode 100644 jsdoc-testing/jsdoc/core/Timer.d.ts create mode 100644 jsdoc-testing/jsdoc/extras/DataUtils.d.ts create mode 100644 jsdoc-testing/jsdoc/extras/ImageUtils.d.ts create mode 100644 jsdoc-testing/jsdoc/extras/TextureUtils.d.ts create mode 100644 jsdoc-testing/jsdoc/geometries/BoxGeometry.d.ts create mode 100644 jsdoc-testing/jsdoc/geometries/ConeGeometry.d.ts create mode 100644 jsdoc-testing/jsdoc/geometries/CylinderGeometry.d.ts create mode 100644 jsdoc-testing/jsdoc/geometries/OctahedronGeometry.d.ts create mode 100644 jsdoc-testing/jsdoc/geometries/PlaneGeometry.d.ts create mode 100644 jsdoc-testing/jsdoc/geometries/PolyhedronGeometry.d.ts create mode 100644 jsdoc-testing/jsdoc/geometries/SphereGeometry.d.ts create mode 100644 jsdoc-testing/jsdoc/helpers/ArrowHelper.d.ts create mode 100644 jsdoc-testing/jsdoc/helpers/AxesHelper.d.ts create mode 100644 jsdoc-testing/jsdoc/helpers/Box3Helper.d.ts create mode 100644 jsdoc-testing/jsdoc/helpers/BoxHelper.d.ts create mode 100644 jsdoc-testing/jsdoc/helpers/CameraHelper.d.ts create mode 100644 jsdoc-testing/jsdoc/helpers/DirectionalLightHelper.d.ts create mode 100644 jsdoc-testing/jsdoc/helpers/GridHelper.d.ts create mode 100644 jsdoc-testing/jsdoc/helpers/HemisphereLightHelper.d.ts create mode 100644 jsdoc-testing/jsdoc/helpers/PlaneHelper.d.ts create mode 100644 jsdoc-testing/jsdoc/helpers/PointLightHelper.d.ts create mode 100644 jsdoc-testing/jsdoc/helpers/PolarGridHelper.d.ts create mode 100644 jsdoc-testing/jsdoc/helpers/SkeletonHelper.d.ts create mode 100644 jsdoc-testing/jsdoc/helpers/SpotLightHelper.d.ts create mode 100644 jsdoc-testing/jsdoc/lights/AmbientLight.d.ts create mode 100644 jsdoc-testing/jsdoc/lights/DirectionalLight.d.ts create mode 100644 jsdoc-testing/jsdoc/lights/DirectionalLightShadow.d.ts create mode 100644 jsdoc-testing/jsdoc/lights/HemisphereLight.d.ts create mode 100644 jsdoc-testing/jsdoc/lights/Light.d.ts create mode 100644 jsdoc-testing/jsdoc/lights/LightProbe.d.ts create mode 100644 jsdoc-testing/jsdoc/lights/LightShadow.d.ts create mode 100644 jsdoc-testing/jsdoc/lights/PointLight.d.ts create mode 100644 jsdoc-testing/jsdoc/lights/PointLightShadow.d.ts create mode 100644 jsdoc-testing/jsdoc/lights/RectAreaLight.d.ts create mode 100644 jsdoc-testing/jsdoc/lights/SpotLight.d.ts create mode 100644 jsdoc-testing/jsdoc/lights/SpotLightShadow.d.ts create mode 100644 jsdoc-testing/jsdoc/lights/webgpu/IESSpotLight.d.ts create mode 100644 jsdoc-testing/jsdoc/lights/webgpu/ProjectorLight.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/LineBasicMaterial.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/LineDashedMaterial.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/Material.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/Materials.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/MeshBasicMaterial.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/MeshDepthMaterial.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/MeshDistanceMaterial.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/MeshLambertMaterial.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/MeshMatcapMaterial.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/MeshNormalMaterial.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/MeshPhongMaterial.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/MeshPhysicalMaterial.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/MeshStandardMaterial.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/MeshToonMaterial.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/PointsMaterial.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/RawShaderMaterial.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/ShaderMaterial.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/ShadowMaterial.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/SpriteMaterial.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/nodes/Line2NodeMaterial.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/nodes/LineBasicNodeMaterial.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/nodes/LineDashedNodeMaterial.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/nodes/MeshBasicNodeMaterial.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/nodes/MeshLambertNodeMaterial.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/nodes/MeshMatcapNodeMaterial.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/nodes/MeshNormalNodeMaterial.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/nodes/MeshPhongNodeMaterial.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/nodes/MeshPhysicalNodeMaterial.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/nodes/MeshSSSNodeMaterial.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/nodes/MeshStandardNodeMaterial.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/nodes/MeshToonNodeMaterial.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/nodes/NodeMaterial.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/nodes/NodeMaterials.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/nodes/PointsNodeMaterial.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/nodes/ShadowNodeMaterial.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/nodes/SpriteNodeMaterial.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/nodes/VolumeNodeMaterial.d.ts create mode 100644 jsdoc-testing/jsdoc/materials/nodes/manager/NodeMaterialObserver.d.ts create mode 100644 jsdoc-testing/jsdoc/math/Box3.d.ts create mode 100644 jsdoc-testing/jsdoc/math/Color.d.ts create mode 100644 jsdoc-testing/jsdoc/math/ColorManagement.d.ts create mode 100644 jsdoc-testing/jsdoc/math/Euler.d.ts create mode 100644 jsdoc-testing/jsdoc/math/Frustum.d.ts create mode 100644 jsdoc-testing/jsdoc/math/FrustumArray.d.ts create mode 100644 jsdoc-testing/jsdoc/math/Interpolant.d.ts create mode 100644 jsdoc-testing/jsdoc/math/MathUtils.d.ts create mode 100644 jsdoc-testing/jsdoc/math/Matrix2.d.ts create mode 100644 jsdoc-testing/jsdoc/math/Matrix3.d.ts create mode 100644 jsdoc-testing/jsdoc/math/Matrix4.d.ts create mode 100644 jsdoc-testing/jsdoc/math/Plane.d.ts create mode 100644 jsdoc-testing/jsdoc/math/Quaternion.d.ts create mode 100644 jsdoc-testing/jsdoc/math/Ray.d.ts create mode 100644 jsdoc-testing/jsdoc/math/Sphere.d.ts create mode 100644 jsdoc-testing/jsdoc/math/SphericalHarmonics3.d.ts create mode 100644 jsdoc-testing/jsdoc/math/Triangle.d.ts create mode 100644 jsdoc-testing/jsdoc/math/Vector2.d.ts create mode 100644 jsdoc-testing/jsdoc/math/Vector3.d.ts create mode 100644 jsdoc-testing/jsdoc/math/Vector4.d.ts create mode 100644 jsdoc-testing/jsdoc/math/interpolants/BezierInterpolant.d.ts create mode 100644 jsdoc-testing/jsdoc/math/interpolants/CubicInterpolant.d.ts create mode 100644 jsdoc-testing/jsdoc/math/interpolants/DiscreteInterpolant.d.ts create mode 100644 jsdoc-testing/jsdoc/math/interpolants/LinearInterpolant.d.ts create mode 100644 jsdoc-testing/jsdoc/math/interpolants/QuaternionLinearInterpolant.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/Nodes.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/TSL.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/AccessorsUtils.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/Arrays.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/BatchNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/Bitangent.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/BufferAttributeNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/BufferNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/BuiltinNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/Camera.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/ClippingNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/CubeTextureNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/InstanceNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/InstancedMeshNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/Lights.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/MaterialNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/MaterialProperties.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/MaterialReferenceNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/ModelNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/ModelViewProjectionNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/MorphNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/Normal.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/Object3DNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/PointUVNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/Position.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/ReferenceBaseNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/ReferenceNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/ReflectVector.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/RendererReferenceNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/SceneProperties.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/SkinningNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/StorageBufferNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/StorageTextureNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/Tangent.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/TangentUtils.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/Texture3DNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/TextureBicubic.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/TextureNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/TextureSizeNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/UV.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/UniformArrayNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/UserDataNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/VelocityNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/accessors/VertexColorNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/code/CodeNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/code/ExpressionNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/code/FunctionCallNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/code/FunctionNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/ArrayNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/AssignNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/AttributeNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/BypassNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/ConstNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/ContextNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/IndexNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/InputNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/InspectorNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/IsolateNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/LightingModel.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/MRTNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/Node.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/NodeAttribute.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/NodeBuilder.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/NodeCache.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/NodeCode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/NodeError.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/NodeFrame.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/NodeFunction.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/NodeFunctionInput.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/NodeParser.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/NodeUniform.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/NodeUtils.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/NodeVar.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/NodeVarying.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/OutputStructNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/ParameterNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/PropertyNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/StackNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/StackTrace.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/StructNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/StructType.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/StructTypeNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/SubBuildNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/TempNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/UniformGroupNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/UniformNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/VarNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/VaryingNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/core/constants.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/display/BlendModes.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/display/BumpMapNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/display/ColorAdjustment.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/display/ColorSpaceFunctions.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/display/ColorSpaceNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/display/FrontFacingNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/display/NormalMapNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/display/PassNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/display/RenderOutputNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/display/ScreenNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/display/ToneMappingFunctions.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/display/ToneMappingNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/display/ToonOutlinePassNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/display/ViewportDepthNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/display/ViewportDepthTextureNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/display/ViewportSharedTextureNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/display/ViewportTextureNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/fog/Fog.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/functions/BSDF/BRDF_GGX.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/functions/BSDF/BRDF_GGX_Multiscatter.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/functions/BSDF/BRDF_Lambert.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/functions/BSDF/BRDF_Sheen.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/functions/BSDF/DFGLUT.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/functions/BSDF/D_GGX.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/functions/BSDF/D_GGX_Anisotropic.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/functions/BSDF/EnvironmentBRDF.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/functions/BSDF/F_Schlick.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/functions/BSDF/LTC.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/functions/BSDF/Schlick_to_F0.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/functions/BSDF/V_GGX_SmithCorrelated.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/functions/BasicLightingModel.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/functions/PhongLightingModel.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/functions/PhysicalLightingModel.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/functions/ShadowMaskModel.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/functions/ToonLightingModel.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/functions/VolumetricLightingModel.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/functions/material/getAlphaHashThreshold.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/functions/material/getGeometryRoughness.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/functions/material/getParallaxCorrectNormal.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/functions/material/getRoughness.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/functions/material/getShIrradianceAt.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/geometry/RangeNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/gpgpu/AtomicFunctionNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/gpgpu/BarrierNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/gpgpu/ComputeBuiltinNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/gpgpu/ComputeNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/gpgpu/SubgroupFunctionNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/gpgpu/WorkgroupInfoNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/lighting/AONode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/lighting/AmbientLightNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/lighting/AnalyticLightNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/lighting/BasicEnvironmentNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/lighting/BasicLightMapNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/lighting/DirectionalLightNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/lighting/EnvironmentNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/lighting/HemisphereLightNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/lighting/IESSpotLightNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/lighting/IrradianceNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/lighting/LightProbeNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/lighting/LightUtils.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/lighting/LightingContextNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/lighting/LightingNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/lighting/LightsNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/lighting/PointLightNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/lighting/PointShadowNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/lighting/ProjectorLightNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/lighting/RectAreaLightNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/lighting/ShadowBaseNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/lighting/ShadowFilterNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/lighting/ShadowNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/lighting/SpotLightNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/materialx/MaterialXNodes.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/materialx/lib/mx_hsv.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/materialx/lib/mx_noise.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/materialx/lib/mx_transform_color.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/math/BitcastNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/math/BitcountNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/math/ConditionalNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/math/Hash.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/math/MathNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/math/MathUtils.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/math/OperatorNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/math/PackFloatNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/math/TriNoise3D.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/math/UnpackFloatNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/parsers/GLSLNodeFunction.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/parsers/GLSLNodeParser.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/pmrem/PMREMNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/pmrem/PMREMUtils.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/procedural/Checker.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/shapes/Shapes.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/tsl/TSLBase.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/tsl/TSLCore.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/utils/ArrayElementNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/utils/ConvertNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/utils/CubeMapNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/utils/DebugNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/utils/Discard.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/utils/EquirectUV.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/utils/EventNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/utils/FlipNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/utils/FunctionOverloadingNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/utils/JoinNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/utils/LoopNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/utils/MatcapUV.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/utils/MaxMipLevelNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/utils/MemberNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/utils/Oscillators.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/utils/Packing.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/utils/PostProcessingUtils.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/utils/RTTNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/utils/ReflectorNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/utils/Remap.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/utils/RotateNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/utils/SampleNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/utils/SetNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/utils/SplitNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/utils/SpriteSheetUV.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/utils/SpriteUtils.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/utils/StorageArrayElementNode.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/utils/Timer.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/utils/TriplanarTextures.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/utils/UVUtils.d.ts create mode 100644 jsdoc-testing/jsdoc/nodes/utils/ViewportUtils.d.ts create mode 100644 jsdoc-testing/jsdoc/objects/Group.d.ts create mode 100644 jsdoc-testing/jsdoc/objects/Line.d.ts create mode 100644 jsdoc-testing/jsdoc/objects/LineSegments.d.ts create mode 100644 jsdoc-testing/jsdoc/objects/Mesh.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/Animation.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/Attributes.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/Backend.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/Background.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/BindGroup.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/Binding.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/Bindings.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/BlendMode.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/Buffer.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/BufferUtils.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/BundleGroup.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/CanvasTarget.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/ChainMap.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/ClippingContext.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/Color4.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/ComputePipeline.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/Constants.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/CubeRenderTarget.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/DataMap.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/Geometries.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/IndirectStorageBufferAttribute.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/Info.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/InspectorBase.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/Lighting.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/Pipeline.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/Pipelines.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/PostProcessing.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/ProgrammableStage.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/QuadMesh.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/RenderBundle.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/RenderBundles.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/RenderContext.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/RenderContexts.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/RenderList.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/RenderLists.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/RenderObject.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/RenderObjectPipeline.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/RenderObjects.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/RenderPipeline.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/Renderer.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/RendererUtils.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/SampledTexture.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/Sampler.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/Storage3DTexture.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/StorageArrayTexture.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/StorageBuffer.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/StorageBufferAttribute.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/StorageInstancedBufferAttribute.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/StorageTexture.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/Textures.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/TimestampQueryPool.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/Uniform.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/UniformBuffer.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/UniformsGroup.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/XRManager.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/XRRenderTarget.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/extras/PMREMGenerator.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/nodes/NodeBuilderState.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/nodes/NodeLibrary.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/nodes/NodeManager.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/nodes/NodeSampledTexture.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/nodes/NodeSampler.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/nodes/NodeStorageBuffer.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/nodes/NodeUniform.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/nodes/NodeUniformBuffer.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/common/nodes/NodeUniformsGroup.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/shaders/ShaderChunk/default_fragment.glsl.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/shaders/ShaderChunk/default_vertex.glsl.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/shaders/UniformsUtils.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/webgl-fallback/WebGLBackend.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/webgl-fallback/WebGLBufferRenderer.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/webgl-fallback/nodes/GLSLNodeBuilder.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLAttributeUtils.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLCapabilities.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLConstants.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLExtensions.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLState.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLTextureUtils.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLUtils.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/webgpu/WebGPUBackend.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/webgpu/WebGPURenderer.Nodes.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/webgpu/WebGPURenderer.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/webgpu/nodes/BasicNodeLibrary.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/webgpu/nodes/StandardNodeLibrary.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/webgpu/nodes/WGSLNodeFunction.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/webgpu/nodes/WGSLNodeParser.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUAttributeUtils.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUBindingUtils.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUCapabilities.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUConstants.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUPipelineUtils.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUTexturePassUtils.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUTextureUtils.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUTimestampQueryPool.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUUtils.d.ts create mode 100644 jsdoc-testing/jsdoc/renderers/webxr/WebXRController.d.ts create mode 100644 jsdoc-testing/jsdoc/scenes/Fog.d.ts create mode 100644 jsdoc-testing/jsdoc/scenes/FogExp2.d.ts create mode 100644 jsdoc-testing/jsdoc/scenes/Scene.d.ts create mode 100644 jsdoc-testing/jsdoc/textures/CubeDepthTexture.d.ts create mode 100644 jsdoc-testing/jsdoc/textures/CubeTexture.d.ts create mode 100644 jsdoc-testing/jsdoc/textures/DataArrayTexture.d.ts create mode 100644 jsdoc-testing/jsdoc/textures/DataTexture.d.ts create mode 100644 jsdoc-testing/jsdoc/textures/DepthTexture.d.ts create mode 100644 jsdoc-testing/jsdoc/textures/FramebufferTexture.d.ts create mode 100644 jsdoc-testing/jsdoc/textures/Source.d.ts create mode 100644 jsdoc-testing/jsdoc/textures/Texture.d.ts create mode 100644 jsdoc-testing/jsdoc/utils.d.ts diff --git a/jsdoc-testing/jsdoc/animation/AnimationAction.d.ts b/jsdoc-testing/jsdoc/animation/AnimationAction.d.ts new file mode 100644 index 000000000..7489bf508 --- /dev/null +++ b/jsdoc-testing/jsdoc/animation/AnimationAction.d.ts @@ -0,0 +1,310 @@ +/** + * An instance of `AnimationAction` schedules the playback of an animation which is + * stored in {@link AnimationClip}. + */ +export class AnimationAction { + /** + * Constructs a new animation action. + * + * @param {AnimationMixer} mixer - The mixer that is controlled by this action. + * @param {AnimationClip} clip - The animation clip that holds the actual keyframes. + * @param {?Object3D} [localRoot=null] - The root object on which this action is performed. + * @param {(NormalAnimationBlendMode|AdditiveAnimationBlendMode)} [blendMode] - The blend mode. + */ + constructor(mixer: AnimationMixer, clip: AnimationClip, localRoot?: Object3D | null, blendMode?: (number | number)); + _mixer: AnimationMixer; + _clip: AnimationClip; + _localRoot: any; + /** + * Defines how the animation is blended/combined when two or more animations + * are simultaneously played. + * + * @type {(NormalAnimationBlendMode|AdditiveAnimationBlendMode)} + */ + blendMode: (number | number); + _interpolantSettings: { + endingStart: number; + endingEnd: number; + }; + _interpolants: any[]; + _propertyBindings: any[]; + _cacheIndex: any; + _byClipCacheIndex: any; + _timeScaleInterpolant: any; + _weightInterpolant: any; + /** + * The loop mode, set via {@link AnimationAction#setLoop}. + * + * @type {(LoopRepeat|LoopOnce|LoopPingPong)} + * @default LoopRepeat + */ + loop: (number | number | number); + _loopCount: number; + _startTime: number | null; + /** + * The local time of this action (in seconds, starting with `0`). + * + * The value gets clamped or wrapped to `[0,clip.duration]` (according to the + * loop state). + * + * @type {number} + * @default Infinity + */ + time: number; + /** + * Scaling factor for the {@link AnimationAction#time}. A value of `0` causes the + * animation to pause. Negative values cause the animation to play backwards. + * + * @type {number} + * @default 1 + */ + timeScale: number; + _effectiveTimeScale: number; + /** + * The degree of influence of this action (in the interval `[0, 1]`). Values + * between `0` (no impact) and `1` (full impact) can be used to blend between + * several actions. + * + * @type {number} + * @default 1 + */ + weight: number; + _effectiveWeight: number; + /** + * The number of repetitions of the performed clip over the course of this action. + * Can be set via {@link AnimationAction#setLoop}. + * + * Setting this number has no effect if {@link AnimationAction#loop} is set to + * `THREE:LoopOnce`. + * + * @type {number} + * @default Infinity + */ + repetitions: number; + /** + * If set to `true`, the playback of the action is paused. + * + * @type {boolean} + * @default false + */ + paused: boolean; + /** + * If set to `false`, the action is disabled so it has no impact. + * + * When the action is re-enabled, the animation continues from its current + * time (setting `enabled` to `false` doesn't reset the action). + * + * @type {boolean} + * @default true + */ + enabled: boolean; + /** + * If set to true the animation will automatically be paused on its last frame. + * + * If set to false, {@link AnimationAction#enabled} will automatically be switched + * to `false` when the last loop of the action has finished, so that this action has + * no further impact. + * + * Note: This member has no impact if the action is interrupted (it + * has only an effect if its last loop has really finished). + * + * @type {boolean} + * @default false + */ + clampWhenFinished: boolean; + /** + * Enables smooth interpolation without separate clips for start, loop and end. + * + * @type {boolean} + * @default true + */ + zeroSlopeAtStart: boolean; + /** + * Enables smooth interpolation without separate clips for start, loop and end. + * + * @type {boolean} + * @default true + */ + zeroSlopeAtEnd: boolean; + /** + * Starts the playback of the animation. + * + * @return {AnimationAction} A reference to this animation action. + */ + play(): AnimationAction; + /** + * Stops the playback of the animation. + * + * @return {AnimationAction} A reference to this animation action. + */ + stop(): AnimationAction; + /** + * Resets the playback of the animation. + * + * @return {AnimationAction} A reference to this animation action. + */ + reset(): AnimationAction; + /** + * Returns `true` if the animation is running. + * + * @return {boolean} Whether the animation is running or not. + */ + isRunning(): boolean; + /** + * Returns `true` when {@link AnimationAction#play} has been called. + * + * @return {boolean} Whether the animation is scheduled or not. + */ + isScheduled(): boolean; + /** + * Defines the time when the animation should start. + * + * @param {number} time - The start time in seconds. + * @return {AnimationAction} A reference to this animation action. + */ + startAt(time: number): AnimationAction; + /** + * Configures the loop settings for this action. + * + * @param {(LoopRepeat|LoopOnce|LoopPingPong)} mode - The loop mode. + * @param {number} repetitions - The number of repetitions. + * @return {AnimationAction} A reference to this animation action. + */ + setLoop(mode: (number | number | number), repetitions: number): AnimationAction; + /** + * Sets the effective weight of this action. + * + * An action has no effect and thus an effective weight of zero when the + * action is disabled. + * + * @param {number} weight - The weight to set. + * @return {AnimationAction} A reference to this animation action. + */ + setEffectiveWeight(weight: number): AnimationAction; + /** + * Returns the effective weight of this action. + * + * @return {number} The effective weight. + */ + getEffectiveWeight(): number; + /** + * Fades the animation in by increasing its weight gradually from `0` to `1`, + * within the passed time interval. + * + * @param {number} duration - The duration of the fade. + * @return {AnimationAction} A reference to this animation action. + */ + fadeIn(duration: number): AnimationAction; + /** + * Fades the animation out by decreasing its weight gradually from `1` to `0`, + * within the passed time interval. + * + * @param {number} duration - The duration of the fade. + * @return {AnimationAction} A reference to this animation action. + */ + fadeOut(duration: number): AnimationAction; + /** + * Causes this action to fade in and the given action to fade out, + * within the passed time interval. + * + * @param {AnimationAction} fadeOutAction - The animation action to fade out. + * @param {number} duration - The duration of the fade. + * @param {boolean} [warp=false] - Whether warping should be used or not. + * @return {AnimationAction} A reference to this animation action. + */ + crossFadeFrom(fadeOutAction: AnimationAction, duration: number, warp?: boolean): AnimationAction; + /** + * Causes this action to fade out and the given action to fade in, + * within the passed time interval. + * + * @param {AnimationAction} fadeInAction - The animation action to fade in. + * @param {number} duration - The duration of the fade. + * @param {boolean} [warp=false] - Whether warping should be used or not. + * @return {AnimationAction} A reference to this animation action. + */ + crossFadeTo(fadeInAction: AnimationAction, duration: number, warp?: boolean): AnimationAction; + /** + * Stops any fading which is applied to this action. + * + * @return {AnimationAction} A reference to this animation action. + */ + stopFading(): AnimationAction; + /** + * Sets the effective time scale of this action. + * + * An action has no effect and thus an effective time scale of zero when the + * action is paused. + * + * @param {number} timeScale - The time scale to set. + * @return {AnimationAction} A reference to this animation action. + */ + setEffectiveTimeScale(timeScale: number): AnimationAction; + /** + * Returns the effective time scale of this action. + * + * @return {number} The effective time scale. + */ + getEffectiveTimeScale(): number; + /** + * Sets the duration for a single loop of this action. + * + * @param {number} duration - The duration to set. + * @return {AnimationAction} A reference to this animation action. + */ + setDuration(duration: number): AnimationAction; + /** + * Synchronizes this action with the passed other action. + * + * @param {AnimationAction} action - The action to sync with. + * @return {AnimationAction} A reference to this animation action. + */ + syncWith(action: AnimationAction): AnimationAction; + /** + * Decelerates this animation's speed to `0` within the passed time interval. + * + * @param {number} duration - The duration. + * @return {AnimationAction} A reference to this animation action. + */ + halt(duration: number): AnimationAction; + /** + * Changes the playback speed, within the passed time interval, by modifying + * {@link AnimationAction#timeScale} gradually from `startTimeScale` to + * `endTimeScale`. + * + * @param {number} startTimeScale - The start time scale. + * @param {number} endTimeScale - The end time scale. + * @param {number} duration - The duration. + * @return {AnimationAction} A reference to this animation action. + */ + warp(startTimeScale: number, endTimeScale: number, duration: number): AnimationAction; + /** + * Stops any scheduled warping which is applied to this action. + * + * @return {AnimationAction} A reference to this animation action. + */ + stopWarping(): AnimationAction; + /** + * Returns the animation mixer of this animation action. + * + * @return {AnimationMixer} The animation mixer. + */ + getMixer(): AnimationMixer; + /** + * Returns the animation clip of this animation action. + * + * @return {AnimationClip} The animation clip. + */ + getClip(): AnimationClip; + /** + * Returns the root object of this animation action. + * + * @return {Object3D} The root object. + */ + getRoot(): Object3D; + _update(time: any, deltaTime: any, timeDirection: any, accuIndex: any): void; + _updateWeight(time: any): number; + _updateTimeScale(time: any): number; + _updateTime(deltaTime: any): any; + _setEndings(atStart: any, atEnd: any, pingPong: any): void; + _scheduleFading(duration: any, weightNow: any, weightThen: any): this; +} diff --git a/jsdoc-testing/jsdoc/animation/AnimationClip.d.ts b/jsdoc-testing/jsdoc/animation/AnimationClip.d.ts new file mode 100644 index 000000000..aa45b91f8 --- /dev/null +++ b/jsdoc-testing/jsdoc/animation/AnimationClip.d.ts @@ -0,0 +1,164 @@ +/** + * A reusable set of keyframe tracks which represent an animation. + */ +export class AnimationClip { + /** + * Factory method for creating an animation clip from the given JSON. + * + * @static + * @param {Object} json - The serialized animation clip. + * @return {AnimationClip} The new animation clip. + */ + static parse(json: Object): AnimationClip; + /** + * Serializes the given animation clip into JSON. + * + * @static + * @param {AnimationClip} clip - The animation clip to serialize. + * @return {Object} The JSON object. + */ + static toJSON(clip: AnimationClip): Object; + /** + * Returns a new animation clip from the passed morph targets array of a + * geometry, taking a name and the number of frames per second. + * + * Note: The fps parameter is required, but the animation speed can be + * overridden via {@link AnimationAction#setDuration}. + * + * @static + * @param {string} name - The name of the animation clip. + * @param {Array} morphTargetSequence - A sequence of morph targets. + * @param {number} fps - The Frames-Per-Second value. + * @param {boolean} noLoop - Whether the clip should be no loop or not. + * @return {AnimationClip} The new animation clip. + */ + static CreateFromMorphTargetSequence(name: string, morphTargetSequence: Array, fps: number, noLoop: boolean): AnimationClip; + /** + * Searches for an animation clip by name, taking as its first parameter + * either an array of clips, or a mesh or geometry that contains an + * array named "animations" property. + * + * @static + * @param {(Array|Object3D)} objectOrClipArray - The array or object to search through. + * @param {string} name - The name to search for. + * @return {?AnimationClip} The found animation clip. Returns `null` if no clip has been found. + */ + static findByName(objectOrClipArray: (Array | Object3D), name: string): AnimationClip | null; + /** + * Returns an array of new AnimationClips created from the morph target + * sequences of a geometry, trying to sort morph target names into + * animation-group-based patterns like "Walk_001, Walk_002, Run_001, Run_002...". + * + * See {@link MD2Loader#parse} as an example for how the method should be used. + * + * @static + * @param {Array} morphTargets - A sequence of morph targets. + * @param {number} fps - The Frames-Per-Second value. + * @param {boolean} noLoop - Whether the clip should be no loop or not. + * @return {Array} An array of new animation clips. + */ + static CreateClipsFromMorphTargetSequences(morphTargets: Array, fps: number, noLoop: boolean): Array; + /** + * Parses the `animation.hierarchy` format and returns a new animation clip. + * + * @static + * @deprecated since r175. + * @param {Object} animation - A serialized animation clip as JSON. + * @param {Array} bones - An array of bones. + * @return {?AnimationClip} The new animation clip. + */ + static parseAnimation(animation: Object, bones: Array): AnimationClip | null; + /** + * Constructs a new animation clip. + * + * Note: Instead of instantiating an AnimationClip directly with the constructor, you can + * use the static interface of this class for creating clips. In most cases though, animation clips + * will automatically be created by loaders when importing animated 3D assets. + * + * @param {string} [name=''] - The clip's name. + * @param {number} [duration=-1] - The clip's duration in seconds. If a negative value is passed, + * the duration will be calculated from the passed keyframes. + * @param {Array} tracks - An array of keyframe tracks. + * @param {(NormalAnimationBlendMode|AdditiveAnimationBlendMode)} [blendMode=NormalAnimationBlendMode] - Defines how the animation + * is blended/combined when two or more animations are simultaneously played. + */ + constructor(name?: string, duration?: number, tracks?: Array, blendMode?: (number | AdditiveAnimationBlendMode)); + /** + * The clip's name. + * + * @type {string} + */ + name: string; + /** + * An array of keyframe tracks. + * + * @type {Array} + */ + tracks: Array; + /** + * The clip's duration in seconds. + * + * @type {number} + */ + duration: number; + /** + * Defines how the animation is blended/combined when two or more animations + * are simultaneously played. + * + * @type {(NormalAnimationBlendMode|AdditiveAnimationBlendMode)} + */ + blendMode: (number | AdditiveAnimationBlendMode); + /** + * The UUID of the animation clip. + * + * @type {string} + * @readonly + */ + readonly uuid: string; + /** + * An object that can be used to store custom data about the animation clip. + * It should not hold references to functions as these will not be cloned. + * + * @type {Object} + */ + userData: Object; + /** + * Sets the duration of this clip to the duration of its longest keyframe track. + * + * @return {AnimationClip} A reference to this animation clip. + */ + resetDuration(): AnimationClip; + /** + * Trims all tracks to the clip's duration. + * + * @return {AnimationClip} A reference to this animation clip. + */ + trim(): AnimationClip; + /** + * Performs minimal validation on each track in the clip. Returns `true` if all + * tracks are valid. + * + * @return {boolean} Whether the clip's keyframes are valid or not. + */ + validate(): boolean; + /** + * Optimizes each track by removing equivalent sequential keys (which are + * common in morph target sequences). + * + * @return {AnimationClip} A reference to this animation clip. + */ + optimize(): AnimationClip; + /** + * Returns a new animation clip with copied values from this instance. + * + * @return {AnimationClip} A clone of this instance. + */ + clone(): AnimationClip; + /** + * Serializes this animation clip into JSON. + * + * @return {Object} The JSON object. + */ + toJSON(): Object; +} +import { KeyframeTrack } from './KeyframeTrack.js'; diff --git a/jsdoc-testing/jsdoc/animation/AnimationMixer.d.ts b/jsdoc-testing/jsdoc/animation/AnimationMixer.d.ts new file mode 100644 index 000000000..b474470e7 --- /dev/null +++ b/jsdoc-testing/jsdoc/animation/AnimationMixer.d.ts @@ -0,0 +1,152 @@ +/** + * `AnimationMixer` is a player for animations on a particular object in + * the scene. When multiple objects in the scene are animated independently, + * one `AnimationMixer` may be used for each object. + */ +export class AnimationMixer extends EventDispatcher { + /** + * Constructs a new animation mixer. + * + * @param {Object3D} root - The object whose animations shall be played by this mixer. + */ + constructor(root: Object3D); + _root: Object3D; + _accuIndex: number; + /** + * The global mixer time (in seconds; starting with `0` on the mixer's creation). + * + * @type {number} + * @default 0 + */ + time: number; + /** + * A scaling factor for the global time. + * + * Note: Setting this member to `0` and later back to `1` is a + * possibility to pause/unpause all actions that are controlled by this + * mixer. + * + * @type {number} + * @default 1 + */ + timeScale: number; + _bindAction(action: any, prototypeAction: any): void; + _activateAction(action: any): void; + _deactivateAction(action: any): void; + _initMemoryManager(): void; + _actions: any[] | undefined; + _nActiveActions: number | undefined; + _actionsByClip: {} | undefined; + _bindings: any[] | undefined; + _nActiveBindings: number | undefined; + _bindingsByRootAndName: {} | undefined; + _controlInterpolants: any[] | undefined; + _nActiveControlInterpolants: number | undefined; + stats: { + actions: { + readonly total: number; + readonly inUse: number | undefined; + }; + bindings: { + readonly total: number; + readonly inUse: number | undefined; + }; + controlInterpolants: { + readonly total: number; + readonly inUse: number | undefined; + }; + } | undefined; + _isActiveAction(action: any): boolean; + _addInactiveAction(action: any, clipUuid: any, rootUuid: any): void; + _removeInactiveAction(action: any): void; + _removeInactiveBindingsForAction(action: any): void; + _lendAction(action: any): void; + _takeBackAction(action: any): void; + _addInactiveBinding(binding: any, rootUuid: any, trackName: any): void; + _removeInactiveBinding(binding: any): void; + _lendBinding(binding: any): void; + _takeBackBinding(binding: any): void; + _lendControlInterpolant(): any; + _takeBackControlInterpolant(interpolant: any): void; + /** + * Returns an instance of {@link AnimationAction} for the passed clip. + * + * If an action fitting the clip and root parameters doesn't yet exist, it + * will be created by this method. Calling this method several times with the + * same clip and root parameters always returns the same action. + * + * @param {AnimationClip|string} clip - An animation clip or alternatively the name of the animation clip. + * @param {Object3D} [optionalRoot] - An alternative root object. + * @param {(NormalAnimationBlendMode|AdditiveAnimationBlendMode)} [blendMode] - The blend mode. + * @return {?AnimationAction} The animation action. + */ + clipAction(clip: AnimationClip | string, optionalRoot?: Object3D, blendMode?: (number | AdditiveAnimationBlendMode)): AnimationAction | null; + /** + * Returns an existing animation action for the passed clip. + * + * @param {AnimationClip|string} clip - An animation clip or alternatively the name of the animation clip. + * @param {Object3D} [optionalRoot] - An alternative root object. + * @return {?AnimationAction} The animation action. Returns `null` if no action was found. + */ + existingAction(clip: AnimationClip | string, optionalRoot?: Object3D): AnimationAction | null; + /** + * Deactivates all previously scheduled actions on this mixer. + * + * @return {AnimationMixer} A reference to this animation mixer. + */ + stopAllAction(): AnimationMixer; + /** + * Advances the global mixer time and updates the animation. + * + * This is usually done in the render loop by passing the delta + * time from {@link Clock} or {@link Timer}. + * + * @param {number} deltaTime - The delta time in seconds. + * @return {AnimationMixer} A reference to this animation mixer. + */ + update(deltaTime: number): AnimationMixer; + /** + * Sets the global mixer to a specific time and updates the animation accordingly. + * + * This is useful when you need to jump to an exact time in an animation. The + * input parameter will be scaled by {@link AnimationMixer#timeScale} + * + * @param {number} time - The time to set in seconds. + * @return {AnimationMixer} A reference to this animation mixer. + */ + setTime(time: number): AnimationMixer; + /** + * Returns this mixer's root object. + * + * @return {Object3D} The mixer's root object. + */ + getRoot(): Object3D; + /** + * Deallocates all memory resources for a clip. Before using this method make + * sure to call {@link AnimationAction#stop} for all related actions. + * + * @param {AnimationClip} clip - The clip to uncache. + */ + uncacheClip(clip: AnimationClip): void; + /** + * Deallocates all memory resources for a root object. Before using this + * method make sure to call {@link AnimationAction#stop} for all related + * actions or alternatively {@link AnimationMixer#stopAllAction} when the + * mixer operates on a single root. + * + * @param {Object3D} root - The root object to uncache. + */ + uncacheRoot(root: Object3D): void; + /** + * Deallocates all memory resources for an action. The action is identified by the + * given clip and an optional root object. Before using this method make + * sure to call {@link AnimationAction#stop} to deactivate the action. + * + * @param {AnimationClip|string} clip - An animation clip or alternatively the name of the animation clip. + * @param {Object3D} [optionalRoot] - An alternative root object. + */ + uncacheAction(clip: AnimationClip | string, optionalRoot?: Object3D): void; +} +import { EventDispatcher } from '../core/EventDispatcher.js'; +import { AnimationClip } from './AnimationClip.js'; +import { AnimationAction } from './AnimationAction.js'; diff --git a/jsdoc-testing/jsdoc/animation/AnimationObjectGroup.d.ts b/jsdoc-testing/jsdoc/animation/AnimationObjectGroup.d.ts new file mode 100644 index 000000000..040c4af5c --- /dev/null +++ b/jsdoc-testing/jsdoc/animation/AnimationObjectGroup.d.ts @@ -0,0 +1,77 @@ +/** + * A group of objects that receives a shared animation state. + * + * Usage: + * + * - Add objects you would otherwise pass as 'root' to the + * constructor or the .clipAction method of AnimationMixer. + * - Instead pass this object as 'root'. + * - You can also add and remove objects later when the mixer is running. + * + * Note: + * + * - Objects of this class appear as one object to the mixer, + * so cache control of the individual objects must be done on the group. + * + * Limitation: + * + * - The animated properties must be compatible among the all objects in the group. + * - A single property can either be controlled through a target group or directly, but not both. + */ +export class AnimationObjectGroup { + /** + * Constructs a new animation group. + * + * @param {...Object3D} arguments - An arbitrary number of 3D objects that share the same animation state. + */ + constructor(...args: Object3D[]); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isAnimationObjectGroup: boolean; + /** + * The UUID of the 3D object. + * + * @type {string} + * @readonly + */ + readonly uuid: string; + _objects: any[]; + nCachedObjects_: number; + _indicesByUUID: {}; + _paths: any[]; + _parsedPaths: any[]; + _bindings: any[]; + _bindingsIndicesByPath: {}; + stats: { + objects: { + readonly total: number; + readonly inUse: number; + }; + readonly bindingsPerObject: number; + }; + /** + * Adds an arbitrary number of objects to this animation group. + * + * @param {...Object3D} arguments - The 3D objects to add. + */ + add(...args: Object3D[]): void; + /** + * Removes an arbitrary number of objects to this animation group + * + * @param {...Object3D} arguments - The 3D objects to remove. + */ + remove(...args: Object3D[]): void; + /** + * Deallocates all memory resources for the passed 3D objects of this animation group. + * + * @param {...Object3D} arguments - The 3D objects to uncache. + */ + uncache(...args: Object3D[]): void; + subscribe_(path: any, parsedPath: any): any; + unsubscribe_(path: any): void; +} diff --git a/jsdoc-testing/jsdoc/animation/AnimationUtils.d.ts b/jsdoc-testing/jsdoc/animation/AnimationUtils.d.ts new file mode 100644 index 000000000..7355fe037 --- /dev/null +++ b/jsdoc-testing/jsdoc/animation/AnimationUtils.d.ts @@ -0,0 +1,131 @@ +/** + * Converts an array to a specific type. + * + * @param {TypedArray|Array} array - The array to convert. + * @param {TypedArray.constructor} type - The constructor of a typed array that defines the new type. + * @return {TypedArray} The converted array. + */ +export function convertArray(array: TypedArray | any[], type: TypedArray.constructor): TypedArray; +import { isTypedArray } from '../utils.js'; +/** + * Returns an array by which times and values can be sorted. + * + * @param {Array} times - The keyframe time values. + * @return {Array} The array. + */ +export function getKeyframeOrder(times: Array): Array; +/** + * Sorts the given array by the previously computed order via `getKeyframeOrder()`. + * + * @param {Array} values - The values to sort. + * @param {number} stride - The stride. + * @param {Array} order - The sort order. + * @return {Array} The sorted values. + */ +export function sortedArray(values: Array, stride: number, order: Array): Array; +/** + * Used for parsing AOS keyframe formats. + * + * @param {Array} jsonKeys - A list of JSON keyframes. + * @param {Array} times - This array will be filled with keyframe times by this function. + * @param {Array} values - This array will be filled with keyframe values by this function. + * @param {string} valuePropertyName - The name of the property to use. + */ +export function flattenJSON(jsonKeys: Array, times: Array, values: Array, valuePropertyName: string): void; +/** + * Creates a new clip, containing only the segment of the original clip between the given frames. + * + * @param {AnimationClip} sourceClip - The values to sort. + * @param {string} name - The name of the clip. + * @param {number} startFrame - The start frame. + * @param {number} endFrame - The end frame. + * @param {number} [fps=30] - The FPS. + * @return {AnimationClip} The new sub clip. + */ +export function subclip(sourceClip: AnimationClip, name: string, startFrame: number, endFrame: number, fps?: number): AnimationClip; +/** + * Converts the keyframes of the given animation clip to an additive format. + * + * @param {AnimationClip} targetClip - The clip to make additive. + * @param {number} [referenceFrame=0] - The reference frame. + * @param {AnimationClip} [referenceClip=targetClip] - The reference clip. + * @param {number} [fps=30] - The FPS. + * @return {AnimationClip} The updated clip which is now additive. + */ +export function makeClipAdditive(targetClip: AnimationClip, referenceFrame?: number, referenceClip?: AnimationClip, fps?: number): AnimationClip; +/** + * A class with various methods to assist with animations. + * + * @hideconstructor + */ +export class AnimationUtils { + /** + * Converts an array to a specific type + * + * @static + * @param {TypedArray|Array} array - The array to convert. + * @param {TypedArray.constructor} type - The constructor of a type array. + * @return {TypedArray} The converted array + */ + static convertArray(array: TypedArray | any[], type: TypedArray.constructor): TypedArray; + /** + * Returns `true` if the given object is a typed array. + * + * @static + * @param {any} object - The object to check. + * @return {boolean} Whether the given object is a typed array. + */ + static isTypedArray(object: any): boolean; + /** + * Returns an array by which times and values can be sorted. + * + * @static + * @param {Array} times - The keyframe time values. + * @return {Array} The array. + */ + static getKeyframeOrder(times: Array): Array; + /** + * Sorts the given array by the previously computed order via `getKeyframeOrder()`. + * + * @static + * @param {Array} values - The values to sort. + * @param {number} stride - The stride. + * @param {Array} order - The sort order. + * @return {Array} The sorted values. + */ + static sortedArray(values: Array, stride: number, order: Array): Array; + /** + * Used for parsing AOS keyframe formats. + * + * @static + * @param {Array} jsonKeys - A list of JSON keyframes. + * @param {Array} times - This array will be filled with keyframe times by this method. + * @param {Array} values - This array will be filled with keyframe values by this method. + * @param {string} valuePropertyName - The name of the property to use. + */ + static flattenJSON(jsonKeys: Array, times: Array, values: Array, valuePropertyName: string): void; + /** + * Creates a new clip, containing only the segment of the original clip between the given frames. + * + * @static + * @param {AnimationClip} sourceClip - The values to sort. + * @param {string} name - The name of the clip. + * @param {number} startFrame - The start frame. + * @param {number} endFrame - The end frame. + * @param {number} [fps=30] - The FPS. + * @return {AnimationClip} The new sub clip. + */ + static subclip(sourceClip: AnimationClip, name: string, startFrame: number, endFrame: number, fps?: number): AnimationClip; + /** + * Converts the keyframes of the given animation clip to an additive format. + * + * @static + * @param {AnimationClip} targetClip - The clip to make additive. + * @param {number} [referenceFrame=0] - The reference frame. + * @param {AnimationClip} [referenceClip=targetClip] - The reference clip. + * @param {number} [fps=30] - The FPS. + * @return {AnimationClip} The updated clip which is now additive. + */ + static makeClipAdditive(targetClip: AnimationClip, referenceFrame?: number, referenceClip?: AnimationClip, fps?: number): AnimationClip; +} +export { isTypedArray }; diff --git a/jsdoc-testing/jsdoc/animation/KeyframeTrack.d.ts b/jsdoc-testing/jsdoc/animation/KeyframeTrack.d.ts new file mode 100644 index 000000000..72239e7a2 --- /dev/null +++ b/jsdoc-testing/jsdoc/animation/KeyframeTrack.d.ts @@ -0,0 +1,178 @@ +/** + * Represents a timed sequence of keyframes, which are composed of lists of + * times and related values, and which are used to animate a specific property + * of an object. + */ +export class KeyframeTrack { + /** + * Converts the keyframe track to JSON. + * + * @static + * @param {KeyframeTrack} track - The keyframe track to serialize. + * @return {Object} The serialized keyframe track as JSON. + */ + static toJSON(track: KeyframeTrack): Object; + /** + * Constructs a new keyframe track. + * + * @param {string} name - The keyframe track's name. + * @param {Array} times - A list of keyframe times. + * @param {Array} values - A list of keyframe values. + * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth|InterpolateBezier)} [interpolation] - The interpolation type. + */ + constructor(name: string, times: Array, values: Array, interpolation?: (number | number | number | number)); + /** + * The track's name can refer to morph targets or bones or + * possibly other values within an animated object. See {@link PropertyBinding#parseTrackName} + * for the forms of strings that can be parsed for property binding. + * + * @type {string} + */ + name: string; + /** + * The keyframe times. + * + * @type {Float32Array} + */ + times: Float32Array; + /** + * The keyframe values. + * + * @type {Float32Array} + */ + values: Float32Array; + /** + * Factory method for creating a new discrete interpolant. + * + * @static + * @param {TypedArray} [result] - The result buffer. + * @return {DiscreteInterpolant} The new interpolant. + */ + InterpolantFactoryMethodDiscrete(result?: TypedArray): DiscreteInterpolant; + /** + * Factory method for creating a new linear interpolant. + * + * @static + * @param {TypedArray} [result] - The result buffer. + * @return {LinearInterpolant} The new interpolant. + */ + InterpolantFactoryMethodLinear(result?: TypedArray): LinearInterpolant; + /** + * Factory method for creating a new smooth interpolant. + * + * @static + * @param {TypedArray} [result] - The result buffer. + * @return {CubicInterpolant} The new interpolant. + */ + InterpolantFactoryMethodSmooth(result?: TypedArray): CubicInterpolant; + /** + * Factory method for creating a new Bezier interpolant. + * + * The Bezier interpolant requires tangent data to be set via the `settings` property + * on the track before creating the interpolant. The settings should contain: + * - `inTangents`: Float32Array with [time, value] pairs per keyframe per component + * - `outTangents`: Float32Array with [time, value] pairs per keyframe per component + * + * @static + * @param {TypedArray} [result] - The result buffer. + * @return {BezierInterpolant} The new interpolant. + */ + InterpolantFactoryMethodBezier(result?: TypedArray): BezierInterpolant; + /** + * Defines the interpolation factor method for this keyframe track. + * + * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth|InterpolateBezier)} interpolation - The interpolation type. + * @return {KeyframeTrack} A reference to this keyframe track. + */ + setInterpolation(interpolation: (number | number | number | number)): KeyframeTrack; + createInterpolant: ((result?: TypedArray) => LinearInterpolant) | ((result?: TypedArray) => CubicInterpolant) | undefined; + /** + * Returns the current interpolation type. + * + * @return {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth|InterpolateBezier)} The interpolation type. + */ + getInterpolation(): (number | number | number | number); + /** + * Returns the value size. + * + * @return {number} The value size. + */ + getValueSize(): number; + /** + * Moves all keyframes either forward or backward in time. + * + * @param {number} timeOffset - The offset to move the time values. + * @return {KeyframeTrack} A reference to this keyframe track. + */ + shift(timeOffset: number): KeyframeTrack; + /** + * Scale all keyframe times by a factor (useful for frame - seconds conversions). + * + * @param {number} timeScale - The time scale. + * @return {KeyframeTrack} A reference to this keyframe track. + */ + scale(timeScale: number): KeyframeTrack; + /** + * Removes keyframes before and after animation without changing any values within the defined time range. + * + * Note: The method does not shift around keys to the start of the track time, because for interpolated + * keys this will change their values + * + * @param {number} startTime - The start time. + * @param {number} endTime - The end time. + * @return {KeyframeTrack} A reference to this keyframe track. + */ + trim(startTime: number, endTime: number): KeyframeTrack; + /** + * Performs minimal validation on the keyframe track. Returns `true` if the values + * are valid. + * + * @return {boolean} Whether the keyframes are valid or not. + */ + validate(): boolean; + /** + * Optimizes this keyframe track by removing equivalent sequential keys (which are + * common in morph target sequences). + * + * @return {KeyframeTrack} A reference to this keyframe track. + */ + optimize(): KeyframeTrack; + /** + * Returns a new keyframe track with copied values from this instance. + * + * @return {KeyframeTrack} A clone of this instance. + */ + clone(): KeyframeTrack; + /** + * The value type name. + * + * @type {string} + * @default '' + */ + ValueTypeName: string; + /** + * The time buffer type of this keyframe track. + * + * @type {TypedArray|Array} + * @default Float32Array.constructor + */ + TimeBufferType: TypedArray | any[]; + /** + * The value buffer type of this keyframe track. + * + * @type {TypedArray|Array} + * @default Float32Array.constructor + */ + ValueBufferType: TypedArray | any[]; + /** + * The default interpolation type of this keyframe track. + * + * @type {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth|InterpolateBezier)} + * @default InterpolateLinear + */ + DefaultInterpolation: (number | number | number | number); +} +import { DiscreteInterpolant } from '../math/interpolants/DiscreteInterpolant.js'; +import { LinearInterpolant } from '../math/interpolants/LinearInterpolant.js'; +import { CubicInterpolant } from '../math/interpolants/CubicInterpolant.js'; +import { BezierInterpolant } from '../math/interpolants/BezierInterpolant.js'; diff --git a/jsdoc-testing/jsdoc/animation/PropertyBinding.d.ts b/jsdoc-testing/jsdoc/animation/PropertyBinding.d.ts new file mode 100644 index 000000000..af4e99d9d --- /dev/null +++ b/jsdoc-testing/jsdoc/animation/PropertyBinding.d.ts @@ -0,0 +1,144 @@ +/** + * This holds a reference to a real property in the scene graph; used internally. + */ +export class PropertyBinding { + /** + * Factory method for creating a property binding from the given parameters. + * + * @static + * @param {Object} root - The root node. + * @param {string} path - The path. + * @param {?Object} [parsedPath] - The parsed path. + * @return {PropertyBinding|Composite} The created property binding or composite. + */ + static create(root: Object, path: string, parsedPath?: Object | null): PropertyBinding | Composite; + /** + * Replaces spaces with underscores and removes unsupported characters from + * node names, to ensure compatibility with parseTrackName(). + * + * @param {string} name - Node name to be sanitized. + * @return {string} The sanitized node name. + */ + static sanitizeNodeName(name: string): string; + /** + * Parses the given track name (an object path to an animated property) and + * returns an object with information about the path. Matches strings in the following forms: + * + * - nodeName.property + * - nodeName.property[accessor] + * - nodeName.material.property[accessor] + * - uuid.property[accessor] + * - uuid.objectName[objectIndex].propertyName[propertyIndex] + * - parentName/nodeName.property + * - parentName/parentName/nodeName.property[index] + * - .bone[Armature.DEF_cog].position + * - scene:helium_balloon_model:helium_balloon_model.position + * + * @static + * @param {string} trackName - The track name to parse. + * @return {Object} The parsed track name as an object. + */ + static parseTrackName(trackName: string): Object; + /** + * Searches for a node in the hierarchy of the given root object by the given + * node name. + * + * @static + * @param {Object} root - The root object. + * @param {string|number} nodeName - The name of the node. + * @return {?Object} The found node. Returns `null` if no object was found. + */ + static findNode(root: Object, nodeName: string | number): Object | null; + /** + * Constructs a new property binding. + * + * @param {Object} rootNode - The root node. + * @param {string} path - The path. + * @param {?Object} [parsedPath] - The parsed path. + */ + constructor(rootNode: Object, path: string, parsedPath?: Object | null); + /** + * The object path to the animated property. + * + * @type {string} + */ + path: string; + /** + * An object holding information about the path. + * + * @type {Object} + */ + parsedPath: Object; + /** + * The object owns the animated property. + * + * @type {?Object} + */ + node: Object | null; + /** + * The root node. + * + * @type {Object3D|Skeleton} + */ + rootNode: Object3D | Skeleton; + getValue: (targetArray: any, offset: any) => void; + setValue: (sourceArray: any, offset: any) => void; + _getValue_unavailable(): void; + _setValue_unavailable(): void; + _getValue_direct(buffer: any, offset: any): void; + _getValue_array(buffer: any, offset: any): void; + _getValue_arrayElement(buffer: any, offset: any): void; + _getValue_toArray(buffer: any, offset: any): void; + _setValue_direct(buffer: any, offset: any): void; + _setValue_direct_setNeedsUpdate(buffer: any, offset: any): void; + _setValue_direct_setMatrixWorldNeedsUpdate(buffer: any, offset: any): void; + _setValue_array(buffer: any, offset: any): void; + _setValue_array_setNeedsUpdate(buffer: any, offset: any): void; + _setValue_array_setMatrixWorldNeedsUpdate(buffer: any, offset: any): void; + _setValue_arrayElement(buffer: any, offset: any): void; + _setValue_arrayElement_setNeedsUpdate(buffer: any, offset: any): void; + _setValue_arrayElement_setMatrixWorldNeedsUpdate(buffer: any, offset: any): void; + _setValue_fromArray(buffer: any, offset: any): void; + _setValue_fromArray_setNeedsUpdate(buffer: any, offset: any): void; + _setValue_fromArray_setMatrixWorldNeedsUpdate(buffer: any, offset: any): void; + _getValue_unbound(targetArray: any, offset: any): void; + _setValue_unbound(sourceArray: any, offset: any): void; + /** + * Creates a getter / setter pair for the property tracked by this binding. + */ + bind(): void; + targetObject: Object | null | undefined; + resolvedProperty: any; + propertyIndex: any; + propertyName: any; + /** + * Unbinds the property. + */ + unbind(): void; + BindingType: { + Direct: number; + EntireArray: number; + ArrayElement: number; + HasFromToArray: number; + }; + Versioning: { + None: number; + NeedsUpdate: number; + MatrixWorldNeedsUpdate: number; + }; + GetterByBindingType: ((buffer: any, offset: any) => void)[]; + SetterByBindingTypeAndVersioning: ((buffer: any, offset: any) => void)[][]; +} +export namespace PropertyBinding { + export { Composite }; +} +declare class Composite { + constructor(targetGroup: any, path: any, optionalParsedPath: any); + _targetGroup: any; + _bindings: any; + getValue(array: any, offset: any): void; + setValue(array: any, offset: any): void; + bind(): void; + unbind(): void; +} +export {}; diff --git a/jsdoc-testing/jsdoc/animation/PropertyMixer.d.ts b/jsdoc-testing/jsdoc/animation/PropertyMixer.d.ts new file mode 100644 index 000000000..0f715aa7b --- /dev/null +++ b/jsdoc-testing/jsdoc/animation/PropertyMixer.d.ts @@ -0,0 +1,95 @@ +/** + * Buffered scene graph property that allows weighted accumulation; used internally. + */ +export class PropertyMixer { + /** + * Constructs a new property mixer. + * + * @param {PropertyBinding} binding - The property binding. + * @param {string} typeName - The keyframe track type name. + * @param {number} valueSize - The keyframe track value size. + */ + constructor(binding: PropertyBinding, typeName: string, valueSize: number); + /** + * The property binding. + * + * @type {PropertyBinding} + */ + binding: PropertyBinding; + /** + * The keyframe track value size. + * + * @type {number} + */ + valueSize: number; + buffer: any[] | Float64Array; + _workIndex: number | undefined; + _mixBufferRegion: (buffer: any, dstOffset: any, srcOffset: any, t: any, stride: any) => void; + _mixBufferRegionAdditive: (buffer: any, dstOffset: any, srcOffset: any, t: any, stride: any) => void; + _setIdentity: () => void; + _origIndex: number; + _addIndex: number; + /** + * Accumulated weight of the property binding. + * + * @type {number} + * @default 0 + */ + cumulativeWeight: number; + /** + * Accumulated additive weight of the property binding. + * + * @type {number} + * @default 0 + */ + cumulativeWeightAdditive: number; + /** + * Number of active keyframe tracks currently using this property binding. + * + * @type {number} + * @default 0 + */ + useCount: number; + /** + * Number of keyframe tracks referencing this property binding. + * + * @type {number} + * @default 0 + */ + referenceCount: number; + /** + * Accumulates data in the `incoming` region into `accu`. + * + * @param {number} accuIndex - The accumulation index. + * @param {number} weight - The weight. + */ + accumulate(accuIndex: number, weight: number): void; + /** + * Accumulates data in the `incoming` region into `add`. + * + * @param {number} weight - The weight. + */ + accumulateAdditive(weight: number): void; + /** + * Applies the state of `accu` to the binding when accus differ. + * + * @param {number} accuIndex - The accumulation index. + */ + apply(accuIndex: number): void; + /** + * Remembers the state of the bound property and copy it to both accus. + */ + saveOriginalState(): void; + /** + * Applies the state previously taken via {@link PropertyMixer#saveOriginalState} to the binding. + */ + restoreOriginalState(): void; + _setAdditiveIdentityNumeric(): void; + _setAdditiveIdentityQuaternion(): void; + _setAdditiveIdentityOther(): void; + _select(buffer: any, dstOffset: any, srcOffset: any, t: any, stride: any): void; + _slerp(buffer: any, dstOffset: any, srcOffset: any, t: any): void; + _slerpAdditive(buffer: any, dstOffset: any, srcOffset: any, t: any, stride: any): void; + _lerp(buffer: any, dstOffset: any, srcOffset: any, t: any, stride: any): void; + _lerpAdditive(buffer: any, dstOffset: any, srcOffset: any, t: any, stride: any): void; +} diff --git a/jsdoc-testing/jsdoc/animation/tracks/BooleanKeyframeTrack.d.ts b/jsdoc-testing/jsdoc/animation/tracks/BooleanKeyframeTrack.d.ts new file mode 100644 index 000000000..d8e3cfd7f --- /dev/null +++ b/jsdoc-testing/jsdoc/animation/tracks/BooleanKeyframeTrack.d.ts @@ -0,0 +1,28 @@ +/** + * A track for boolean keyframe values. + * + * @augments KeyframeTrack + */ +export class BooleanKeyframeTrack extends KeyframeTrack { + /** + * Constructs a new boolean keyframe track. + * + * This keyframe track type has no `interpolation` parameter because the + * interpolation is always discrete. + * + * @param {string} name - The keyframe track's name. + * @param {Array} times - A list of keyframe times. + * @param {Array} values - A list of keyframe values. + */ + constructor(name: string, times: Array, values: Array); + /** + * The default interpolation type of this keyframe track. + * + * @type {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} + * @default InterpolateDiscrete + */ + DefaultInterpolation: (InterpolateLinear | number | InterpolateSmooth); + InterpolantFactoryMethodLinear: any; + InterpolantFactoryMethodSmooth: any; +} +import { KeyframeTrack } from '../KeyframeTrack.js'; diff --git a/jsdoc-testing/jsdoc/animation/tracks/ColorKeyframeTrack.d.ts b/jsdoc-testing/jsdoc/animation/tracks/ColorKeyframeTrack.d.ts new file mode 100644 index 000000000..aa0f64d74 --- /dev/null +++ b/jsdoc-testing/jsdoc/animation/tracks/ColorKeyframeTrack.d.ts @@ -0,0 +1,17 @@ +/** + * A track for color keyframe values. + * + * @augments KeyframeTrack + */ +export class ColorKeyframeTrack extends KeyframeTrack { + /** + * Constructs a new color keyframe track. + * + * @param {string} name - The keyframe track's name. + * @param {Array} times - A list of keyframe times. + * @param {Array} values - A list of keyframe values. + * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type. + */ + constructor(name: string, times: Array, values: Array, interpolation?: (InterpolateLinear | InterpolateDiscrete | InterpolateSmooth)); +} +import { KeyframeTrack } from '../KeyframeTrack.js'; diff --git a/jsdoc-testing/jsdoc/animation/tracks/NumberKeyframeTrack.d.ts b/jsdoc-testing/jsdoc/animation/tracks/NumberKeyframeTrack.d.ts new file mode 100644 index 000000000..f83c955ca --- /dev/null +++ b/jsdoc-testing/jsdoc/animation/tracks/NumberKeyframeTrack.d.ts @@ -0,0 +1,17 @@ +/** + * A track for numeric keyframe values. + * + * @augments KeyframeTrack + */ +export class NumberKeyframeTrack extends KeyframeTrack { + /** + * Constructs a new number keyframe track. + * + * @param {string} name - The keyframe track's name. + * @param {Array} times - A list of keyframe times. + * @param {Array} values - A list of keyframe values. + * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type. + */ + constructor(name: string, times: Array, values: Array, interpolation?: (InterpolateLinear | InterpolateDiscrete | InterpolateSmooth)); +} +import { KeyframeTrack } from '../KeyframeTrack.js'; diff --git a/jsdoc-testing/jsdoc/animation/tracks/QuaternionKeyframeTrack.d.ts b/jsdoc-testing/jsdoc/animation/tracks/QuaternionKeyframeTrack.d.ts new file mode 100644 index 000000000..98e4a75e2 --- /dev/null +++ b/jsdoc-testing/jsdoc/animation/tracks/QuaternionKeyframeTrack.d.ts @@ -0,0 +1,18 @@ +/** + * A track for Quaternion keyframe values. + * + * @augments KeyframeTrack + */ +export class QuaternionKeyframeTrack extends KeyframeTrack { + /** + * Constructs a new Quaternion keyframe track. + * + * @param {string} name - The keyframe track's name. + * @param {Array} times - A list of keyframe times. + * @param {Array} values - A list of keyframe values. + * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type. + */ + constructor(name: string, times: Array, values: Array, interpolation?: (InterpolateLinear | InterpolateDiscrete | InterpolateSmooth)); + InterpolantFactoryMethodSmooth: any; +} +import { KeyframeTrack } from '../KeyframeTrack.js'; diff --git a/jsdoc-testing/jsdoc/animation/tracks/StringKeyframeTrack.d.ts b/jsdoc-testing/jsdoc/animation/tracks/StringKeyframeTrack.d.ts new file mode 100644 index 000000000..95c5bd155 --- /dev/null +++ b/jsdoc-testing/jsdoc/animation/tracks/StringKeyframeTrack.d.ts @@ -0,0 +1,28 @@ +/** + * A track for string keyframe values. + * + * @augments KeyframeTrack + */ +export class StringKeyframeTrack extends KeyframeTrack { + /** + * Constructs a new string keyframe track. + * + * This keyframe track type has no `interpolation` parameter because the + * interpolation is always discrete. + * + * @param {string} name - The keyframe track's name. + * @param {Array} times - A list of keyframe times. + * @param {Array} values - A list of keyframe values. + */ + constructor(name: string, times: Array, values: Array); + /** + * The default interpolation type of this keyframe track. + * + * @type {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} + * @default InterpolateDiscrete + */ + DefaultInterpolation: (InterpolateLinear | number | InterpolateSmooth); + InterpolantFactoryMethodLinear: any; + InterpolantFactoryMethodSmooth: any; +} +import { KeyframeTrack } from '../KeyframeTrack.js'; diff --git a/jsdoc-testing/jsdoc/animation/tracks/VectorKeyframeTrack.d.ts b/jsdoc-testing/jsdoc/animation/tracks/VectorKeyframeTrack.d.ts new file mode 100644 index 000000000..856db2d58 --- /dev/null +++ b/jsdoc-testing/jsdoc/animation/tracks/VectorKeyframeTrack.d.ts @@ -0,0 +1,17 @@ +/** + * A track for vector keyframe values. + * + * @augments KeyframeTrack + */ +export class VectorKeyframeTrack extends KeyframeTrack { + /** + * Constructs a new vector keyframe track. + * + * @param {string} name - The keyframe track's name. + * @param {Array} times - A list of keyframe times. + * @param {Array} values - A list of keyframe values. + * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type. + */ + constructor(name: string, times: Array, values: Array, interpolation?: (InterpolateLinear | InterpolateDiscrete | InterpolateSmooth)); +} +import { KeyframeTrack } from '../KeyframeTrack.js'; diff --git a/jsdoc-testing/jsdoc/audio/Audio.d.ts b/jsdoc-testing/jsdoc/audio/Audio.d.ts new file mode 100644 index 000000000..755622769 --- /dev/null +++ b/jsdoc-testing/jsdoc/audio/Audio.d.ts @@ -0,0 +1,379 @@ +/** + * Represents a non-positional ( global ) audio object. + * + * This and related audio modules make use of the [Web Audio API](https://www.w3.org/TR/webaudio-1.1/). + * + * ```js + * // create an AudioListener and add it to the camera + * const listener = new THREE.AudioListener(); + * camera.add( listener ); + * + * // create a global audio source + * const sound = new THREE.Audio( listener ); + * + * // load a sound and set it as the Audio object's buffer + * const audioLoader = new THREE.AudioLoader(); + * audioLoader.load( 'sounds/ambient.ogg', function( buffer ) { + * sound.setBuffer( buffer ); + * sound.setLoop( true ); + * sound.setVolume( 0.5 ); + * sound.play(); + * }); + * ``` + * + * @augments Object3D + */ +export class Audio extends Object3D { + /** + * Constructs a new audio. + * + * @param {AudioListener} listener - The global audio listener. + */ + constructor(listener: AudioListener); + type: string; + /** + * The global audio listener. + * + * @type {AudioListener} + * @readonly + */ + readonly listener: AudioListener; + /** + * The audio context. + * + * @type {AudioContext} + * @readonly + */ + readonly context: AudioContext; + /** + * The gain node used for volume control. + * + * @type {GainNode} + * @readonly + */ + readonly gain: GainNode; + /** + * Whether to start playback automatically or not. + * + * @type {boolean} + * @default false + */ + autoplay: boolean; + /** + * A reference to an audio buffer. + * + * Defined via {@link Audio#setBuffer}. + * + * @type {?AudioBuffer} + * @default null + * @readonly + */ + readonly buffer: AudioBuffer | null; + /** + * Modify pitch, measured in cents. +/- 100 is a semitone. + * +/- 1200 is an octave. + * + * Defined via {@link Audio#setDetune}. + * + * @type {number} + * @default 0 + * @readonly + */ + readonly detune: number; + /** + * Whether the audio should loop or not. + * + * Defined via {@link Audio#setLoop}. + * + * @type {boolean} + * @default false + * @readonly + */ + readonly loop: boolean; + /** + * Defines where in the audio buffer the replay should + * start, in seconds. + * + * @type {number} + * @default 0 + */ + loopStart: number; + /** + * Defines where in the audio buffer the replay should + * stop, in seconds. + * + * @type {number} + * @default 0 + */ + loopEnd: number; + /** + * An offset to the time within the audio buffer the playback + * should begin, in seconds. + * + * @type {number} + * @default 0 + */ + offset: number; + /** + * Overrides the default duration of the audio. + * + * @type {undefined|number} + * @default undefined + */ + duration: undefined | number; + /** + * The playback speed. + * + * Defined via {@link Audio#setPlaybackRate}. + * + * @type {number} + * @readonly + * @default 1 + */ + readonly playbackRate: number; + /** + * Indicates whether the audio is playing or not. + * + * This flag will be automatically set when using {@link Audio#play}, + * {@link Audio#pause}, {@link Audio#stop}. + * + * @type {boolean} + * @readonly + * @default false + */ + readonly isPlaying: boolean; + /** + * Indicates whether the audio playback can be controlled + * with method like {@link Audio#play} or {@link Audio#pause}. + * + * This flag will be automatically set when audio sources are + * defined. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly hasPlaybackControl: boolean; + /** + * Holds a reference to the current audio source. + * + * The property is automatically by one of the `set*()` methods. + * + * @type {?AudioNode} + * @readonly + * @default null + */ + readonly source: AudioNode | null; + /** + * Defines the source type. + * + * The property is automatically set by one of the `set*()` methods. + * + * @type {('empty'|'audioNode'|'mediaNode'|'mediaStreamNode'|'buffer')} + * @readonly + * @default 'empty' + */ + readonly sourceType: ("empty" | "audioNode" | "mediaNode" | "mediaStreamNode" | "buffer"); + _startedAt: number; + _progress: number; + _connected: boolean; + /** + * Can be used to apply a variety of low-order filters to create + * more complex sound effects e.g. via `BiquadFilterNode`. + * + * The property is automatically set by {@link Audio#setFilters}. + * + * @type {Array} + * @readonly + */ + readonly filters: Array; + /** + * Returns the output audio node. + * + * @return {GainNode} The output node. + */ + getOutput(): GainNode; + /** + * Sets the given audio node as the source of this instance. + * + * {@link Audio#sourceType} is set to `audioNode` and {@link Audio#hasPlaybackControl} to `false`. + * + * @param {AudioNode} audioNode - The audio node like an instance of `OscillatorNode`. + * @return {Audio} A reference to this instance. + */ + setNodeSource(audioNode: AudioNode): Audio; + /** + * Sets the given media element as the source of this instance. + * + * {@link Audio#sourceType} is set to `mediaNode` and {@link Audio#hasPlaybackControl} to `false`. + * + * @param {HTMLMediaElement} mediaElement - The media element. + * @return {Audio} A reference to this instance. + */ + setMediaElementSource(mediaElement: HTMLMediaElement): Audio; + /** + * Sets the given media stream as the source of this instance. + * + * {@link Audio#sourceType} is set to `mediaStreamNode` and {@link Audio#hasPlaybackControl} to `false`. + * + * @param {MediaStream} mediaStream - The media stream. + * @return {Audio} A reference to this instance. + */ + setMediaStreamSource(mediaStream: MediaStream): Audio; + /** + * Sets the given audio buffer as the source of this instance. + * + * {@link Audio#sourceType} is set to `buffer` and {@link Audio#hasPlaybackControl} to `true`. + * + * @param {AudioBuffer} audioBuffer - The audio buffer. + * @return {Audio} A reference to this instance. + */ + setBuffer(audioBuffer: AudioBuffer): Audio; + /** + * Starts the playback of the audio. + * + * Can only be used with compatible audio sources that allow playback control. + * + * @param {number} [delay=0] - The delay, in seconds, at which the audio should start playing. + * @return {Audio|undefined} A reference to this instance. + */ + play(delay?: number): Audio | undefined; + /** + * Pauses the playback of the audio. + * + * Can only be used with compatible audio sources that allow playback control. + * + * @return {Audio|undefined} A reference to this instance. + */ + pause(): Audio | undefined; + /** + * Stops the playback of the audio. + * + * Can only be used with compatible audio sources that allow playback control. + * + * @param {number} [delay=0] - The delay, in seconds, at which the audio should stop playing. + * @return {Audio|undefined} A reference to this instance. + */ + stop(delay?: number): Audio | undefined; + /** + * Connects to the audio source. This is used internally on + * initialisation and when setting / removing filters. + * + * @return {Audio} A reference to this instance. + */ + connect(): Audio; + /** + * Disconnects to the audio source. This is used internally on + * initialisation and when setting / removing filters. + * + * @return {Audio|undefined} A reference to this instance. + */ + disconnect(): Audio | undefined; + /** + * Returns the current set filters. + * + * @return {Array} The list of filters. + */ + getFilters(): Array; + /** + * Sets an array of filters and connects them with the audio source. + * + * @param {Array} [value] - A list of filters. + * @return {Audio} A reference to this instance. + */ + setFilters(value?: Array): Audio; + /** + * Defines the detuning of oscillation in cents. + * + * @param {number} value - The detuning of oscillation in cents. + * @return {Audio} A reference to this instance. + */ + setDetune(value: number): Audio; + /** + * Returns the detuning of oscillation in cents. + * + * @return {number} The detuning of oscillation in cents. + */ + getDetune(): number; + /** + * Returns the first filter in the list of filters. + * + * @return {AudioNode|undefined} The first filter in the list of filters. + */ + getFilter(): AudioNode | undefined; + /** + * Applies a single filter node to the audio. + * + * @param {AudioNode} [filter] - The filter to set. + * @return {Audio} A reference to this instance. + */ + setFilter(filter?: AudioNode): Audio; + /** + * Sets the playback rate. + * + * Can only be used with compatible audio sources that allow playback control. + * + * @param {number} [value] - The playback rate to set. + * @return {Audio|undefined} A reference to this instance. + */ + setPlaybackRate(value?: number): Audio | undefined; + /** + * Returns the current playback rate. + + * @return {number} The playback rate. + */ + getPlaybackRate(): number; + /** + * Automatically called when playback finished. + */ + onEnded(): void; + /** + * Returns the loop flag. + * + * Can only be used with compatible audio sources that allow playback control. + * + * @return {boolean} Whether the audio should loop or not. + */ + getLoop(): boolean; + /** + * Sets the loop flag. + * + * Can only be used with compatible audio sources that allow playback control. + * + * @param {boolean} value - Whether the audio should loop or not. + * @return {Audio|undefined} A reference to this instance. + */ + setLoop(value: boolean): Audio | undefined; + /** + * Sets the loop start value which defines where in the audio buffer the replay should + * start, in seconds. + * + * @param {number} value - The loop start value. + * @return {Audio} A reference to this instance. + */ + setLoopStart(value: number): Audio; + /** + * Sets the loop end value which defines where in the audio buffer the replay should + * stop, in seconds. + * + * @param {number} value - The loop end value. + * @return {Audio} A reference to this instance. + */ + setLoopEnd(value: number): Audio; + /** + * Returns the volume. + * + * @return {number} The volume. + */ + getVolume(): number; + /** + * Sets the volume. + * + * @param {number} value - The volume to set. + * @return {Audio} A reference to this instance. + */ + setVolume(value: number): Audio; + copy(source: any, recursive: any): this; + clone(recursive: any): any; +} +import { Object3D } from '../core/Object3D.js'; diff --git a/jsdoc-testing/jsdoc/audio/AudioAnalyser.d.ts b/jsdoc-testing/jsdoc/audio/AudioAnalyser.d.ts new file mode 100644 index 000000000..241498397 --- /dev/null +++ b/jsdoc-testing/jsdoc/audio/AudioAnalyser.d.ts @@ -0,0 +1,65 @@ +/** + * This class can be used to analyse audio data. + * + * ```js + * // create an AudioListener and add it to the camera + * const listener = new THREE.AudioListener(); + * camera.add( listener ); + * + * // create an Audio source + * const sound = new THREE.Audio( listener ); + * + * // load a sound and set it as the Audio object's buffer + * const audioLoader = new THREE.AudioLoader(); + * audioLoader.load( 'sounds/ambient.ogg', function( buffer ) { + * sound.setBuffer( buffer ); + * sound.setLoop(true); + * sound.setVolume(0.5); + * sound.play(); + * }); + * + * // create an AudioAnalyser, passing in the sound and desired fftSize + * const analyser = new THREE.AudioAnalyser( sound, 32 ); + * + * // get the average frequency of the sound + * const data = analyser.getAverageFrequency(); + * ``` + */ +export class AudioAnalyser { + /** + * Constructs a new audio analyzer. + * + * @param {Audio} audio - The audio to analyze. + * @param {number} [fftSize=2048] - The window size in samples that is used when performing a Fast Fourier Transform (FFT) to get frequency domain data. + */ + constructor(audio: new (src?: string) => HTMLAudioElement, fftSize?: number); + /** + * The global audio listener. + * + * @type {AnalyserNode} + */ + analyser: AnalyserNode; + /** + * Holds the analyzed data. + * + * @type {Uint8Array} + */ + data: Uint8Array; + /** + * Returns an array with frequency data of the audio. + * + * Each item in the array represents the decibel value for a specific frequency. + * The frequencies are spread linearly from 0 to 1/2 of the sample rate. + * For example, for 48000 sample rate, the last item of the array will represent + * the decibel value for 24000 Hz. + * + * @return {Uint8Array} The frequency data. + */ + getFrequencyData(): Uint8Array; + /** + * Returns the average of the frequencies returned by {@link AudioAnalyser#getFrequencyData}. + * + * @return {number} The average frequency. + */ + getAverageFrequency(): number; +} diff --git a/jsdoc-testing/jsdoc/audio/AudioContext.d.ts b/jsdoc-testing/jsdoc/audio/AudioContext.d.ts new file mode 100644 index 000000000..3a4632519 --- /dev/null +++ b/jsdoc-testing/jsdoc/audio/AudioContext.d.ts @@ -0,0 +1,19 @@ +/** + * Manages the global audio context in the engine. + * + * @hideconstructor + */ +export class AudioContext { + /** + * Returns the global native audio context. + * + * @return {Window.AudioContext} The native audio context. + */ + static getContext(): Window.AudioContext; + /** + * Allows to set the global native audio context from outside. + * + * @param {Window.AudioContext} value - The native context to set. + */ + static setContext(value: Window.AudioContext): void; +} diff --git a/jsdoc-testing/jsdoc/audio/AudioListener.d.ts b/jsdoc-testing/jsdoc/audio/AudioListener.d.ts new file mode 100644 index 000000000..c668dd516 --- /dev/null +++ b/jsdoc-testing/jsdoc/audio/AudioListener.d.ts @@ -0,0 +1,91 @@ +/** + * The class represents a virtual listener of the all positional and non-positional audio effects + * in the scene. A three.js application usually creates a single listener. It is a mandatory + * constructor parameter for audios entities like {@link Audio} and {@link PositionalAudio}. + * + * In most cases, the listener object is a child of the camera. So the 3D transformation of the + * camera represents the 3D transformation of the listener. + * + * @augments Object3D + */ +export class AudioListener extends Object3D { + type: string; + /** + * The native audio context. + * + * @type {AudioContext} + * @readonly + */ + readonly context: AudioContext; + /** + * The gain node used for volume control. + * + * @type {GainNode} + * @readonly + */ + readonly gain: GainNode; + /** + * An optional filter. + * + * Defined via {@link AudioListener#setFilter}. + * + * @type {?AudioNode} + * @default null + * @readonly + */ + readonly filter: AudioNode | null; + /** + * Time delta values required for `linearRampToValueAtTime()` usage. + * + * @type {number} + * @default 0 + * @readonly + */ + readonly timeDelta: number; + _timer: Timer; + /** + * Returns the listener's input node. + * + * This method is used by other audio nodes to connect to this listener. + * + * @return {GainNode} The input node. + */ + getInput(): GainNode; + /** + * Removes the current filter from this listener. + * + * @return {AudioListener} A reference to this listener. + */ + removeFilter(): AudioListener; + /** + * Returns the current set filter. + * + * @return {?AudioNode} The filter. + */ + getFilter(): AudioNode | null; + /** + * Sets the given filter to this listener. + * + * @param {AudioNode} value - The filter to set. + * @return {AudioListener} A reference to this listener. + */ + setFilter(value: AudioNode): AudioListener; + /** + * Returns the applications master volume. + * + * @return {number} The master volume. + */ + getMasterVolume(): number; + /** + * Sets the applications master volume. This volume setting affects + * all audio nodes in the scene. + * + * @param {number} value - The master volume to set. + * @return {AudioListener} A reference to this listener. + */ + setMasterVolume(value: number): AudioListener; + updateMatrixWorld(force: any): void; +} +import { Object3D } from '../core/Object3D.js'; +import { AudioContext } from './AudioContext.js'; +import { Timer } from '../core/Timer.js'; diff --git a/jsdoc-testing/jsdoc/audio/PositionalAudio.d.ts b/jsdoc-testing/jsdoc/audio/PositionalAudio.d.ts new file mode 100644 index 000000000..03307384c --- /dev/null +++ b/jsdoc-testing/jsdoc/audio/PositionalAudio.d.ts @@ -0,0 +1,115 @@ +/** + * Represents a positional audio object. + * + * ```js + * // create an AudioListener and add it to the camera + * const listener = new THREE.AudioListener(); + * camera.add( listener ); + * + * // create the PositionalAudio object (passing in the listener) + * const sound = new THREE.PositionalAudio( listener ); + * + * // load a sound and set it as the PositionalAudio object's buffer + * const audioLoader = new THREE.AudioLoader(); + * audioLoader.load( 'sounds/song.ogg', function( buffer ) { + * sound.setBuffer( buffer ); + * sound.setRefDistance( 20 ); + * sound.play(); + * }); + * + * // create an object for the sound to play from + * const sphere = new THREE.SphereGeometry( 20, 32, 16 ); + * const material = new THREE.MeshPhongMaterial( { color: 0xff2200 } ); + * const mesh = new THREE.Mesh( sphere, material ); + * scene.add( mesh ); + * + * // finally add the sound to the mesh + * mesh.add( sound ); + * + * @augments Audio + */ +export class PositionalAudio extends Audio { + /** + * The panner node represents the location, direction, and behavior of an audio + * source in 3D space. + * + * @type {PannerNode} + * @readonly + */ + readonly panner: PannerNode; + connect(): this; + disconnect(): this; + getOutput(): PannerNode; + /** + * Returns the current reference distance. + * + * @return {number} The reference distance. + */ + getRefDistance(): number; + /** + * Defines the reference distance for reducing volume as the audio source moves + * further from the listener – i.e. the distance at which the volume reduction + * starts taking effect. + * + * @param {number} value - The reference distance to set. + * @return {PositionalAudio} A reference to this instance. + */ + setRefDistance(value: number): PositionalAudio; + /** + * Returns the current rolloff factor. + * + * @return {number} The rolloff factor. + */ + getRolloffFactor(): number; + /** + * Defines how quickly the volume is reduced as the source moves away from the listener. + * + * @param {number} value - The rolloff factor. + * @return {PositionalAudio} A reference to this instance. + */ + setRolloffFactor(value: number): PositionalAudio; + /** + * Returns the current distance model. + * + * @return {('linear'|'inverse'|'exponential')} The distance model. + */ + getDistanceModel(): ("linear" | "inverse" | "exponential"); + /** + * Defines which algorithm to use to reduce the volume of the audio source + * as it moves away from the listener. + * + * Read [the spec](https://www.w3.org/TR/webaudio-1.1/#enumdef-distancemodeltype) + * for more details. + * + * @param {('linear'|'inverse'|'exponential')} value - The distance model to set. + * @return {PositionalAudio} A reference to this instance. + */ + setDistanceModel(value: ("linear" | "inverse" | "exponential")): PositionalAudio; + /** + * Returns the current max distance. + * + * @return {number} The max distance. + */ + getMaxDistance(): number; + /** + * Defines the maximum distance between the audio source and the listener, + * after which the volume is not reduced any further. + * + * This value is used only by the `linear` distance model. + * + * @param {number} value - The max distance. + * @return {PositionalAudio} A reference to this instance. + */ + setMaxDistance(value: number): PositionalAudio; + /** + * Sets the directional cone in which the audio can be listened. + * + * @param {number} coneInnerAngle - An angle, in degrees, of a cone inside of which there will be no volume reduction. + * @param {number} coneOuterAngle - An angle, in degrees, of a cone outside of which the volume will be reduced by a constant value, defined by the `coneOuterGain` parameter. + * @param {number} coneOuterGain - The amount of volume reduction outside the cone defined by the `coneOuterAngle`. When set to `0`, no sound can be heard. + * @return {PositionalAudio} A reference to this instance. + */ + setDirectionalCone(coneInnerAngle: number, coneOuterAngle: number, coneOuterGain: number): PositionalAudio; + updateMatrixWorld(force: any): void; +} +import { Audio } from './Audio.js'; diff --git a/jsdoc-testing/jsdoc/cameras/ArrayCamera.d.ts b/jsdoc-testing/jsdoc/cameras/ArrayCamera.d.ts new file mode 100644 index 000000000..d1dd98d30 --- /dev/null +++ b/jsdoc-testing/jsdoc/cameras/ArrayCamera.d.ts @@ -0,0 +1,42 @@ +/** + * This type of camera can be used in order to efficiently render a scene with a + * predefined set of cameras. This is an important performance aspect for + * rendering VR scenes. + * + * An instance of `ArrayCamera` always has an array of sub cameras. It's mandatory + * to define for each sub camera the `viewport` property which determines the + * part of the viewport that is rendered with this camera. + * + * @augments PerspectiveCamera + */ +export class ArrayCamera extends PerspectiveCamera { + /** + * Constructs a new array camera. + * + * @param {Array} [array=[]] - An array of perspective sub cameras. + */ + constructor(array?: Array); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isArrayCamera: boolean; + /** + * Whether this camera is used with multiview rendering or not. + * + * @type {boolean} + * @readonly + * @default false + */ + readonly isMultiViewCamera: boolean; + /** + * An array of perspective sub cameras. + * + * @type {Array} + */ + cameras: Array; +} +import { PerspectiveCamera } from './PerspectiveCamera.js'; diff --git a/jsdoc-testing/jsdoc/cameras/Camera.d.ts b/jsdoc-testing/jsdoc/cameras/Camera.d.ts new file mode 100644 index 000000000..b24b6e34a --- /dev/null +++ b/jsdoc-testing/jsdoc/cameras/Camera.d.ts @@ -0,0 +1,56 @@ +/** + * Abstract base class for cameras. This class should always be inherited + * when you build a new camera. + * + * @abstract + * @augments Object3D + */ +export class Camera extends Object3D { + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isCamera: boolean; + type: string; + /** + * The inverse of the camera's world matrix. + * + * @type {Matrix4} + */ + matrixWorldInverse: Matrix4; + /** + * The camera's projection matrix. + * + * @type {Matrix4} + */ + projectionMatrix: Matrix4; + /** + * The inverse of the camera's projection matrix. + * + * @type {Matrix4} + */ + projectionMatrixInverse: Matrix4; + /** + * The coordinate system in which the camera is used. + * + * @type {(WebGLCoordinateSystem|WebGPUCoordinateSystem)} + */ + coordinateSystem: (number | WebGPUCoordinateSystem); + _reversedDepth: boolean; + /** + * The flag that indicates whether the camera uses a reversed depth buffer. + * + * @type {boolean} + * @default false + */ + get reversedDepth(): boolean; + copy(source: any, recursive: any): this; + updateMatrixWorld(force: any): void; + updateWorldMatrix(updateParents: any, updateChildren: any): void; + clone(): any; +} +import { Object3D } from '../core/Object3D.js'; +import { Matrix4 } from '../math/Matrix4.js'; diff --git a/jsdoc-testing/jsdoc/cameras/CubeCamera.d.ts b/jsdoc-testing/jsdoc/cameras/CubeCamera.d.ts new file mode 100644 index 000000000..28a2ba9c1 --- /dev/null +++ b/jsdoc-testing/jsdoc/cameras/CubeCamera.d.ts @@ -0,0 +1,74 @@ +/** + * A special type of camera that is positioned in 3D space to render its surroundings into a + * cube render target. The render target can then be used as an environment map for rendering + * realtime reflections in your scene. + * + * ```js + * // Create cube render target + * const cubeRenderTarget = new THREE.WebGLCubeRenderTarget( 256, { generateMipmaps: true, minFilter: THREE.LinearMipmapLinearFilter } ); + * + * // Create cube camera + * const cubeCamera = new THREE.CubeCamera( 1, 100000, cubeRenderTarget ); + * scene.add( cubeCamera ); + * + * // Create car + * const chromeMaterial = new THREE.MeshLambertMaterial( { color: 0xffffff, envMap: cubeRenderTarget.texture } ); + * const car = new THREE.Mesh( carGeometry, chromeMaterial ); + * scene.add( car ); + * + * // Update the render target cube + * car.visible = false; + * cubeCamera.position.copy( car.position ); + * cubeCamera.update( renderer, scene ); + * + * // Render the scene + * car.visible = true; + * renderer.render( scene, camera ); + * ``` + * + * @augments Object3D + */ +export class CubeCamera extends Object3D { + /** + * Constructs a new cube camera. + * + * @param {number} near - The camera's near plane. + * @param {number} far - The camera's far plane. + * @param {WebGLCubeRenderTarget} renderTarget - The cube render target. + */ + constructor(near: number, far: number, renderTarget: WebGLCubeRenderTarget); + type: string; + /** + * A reference to the cube render target. + * + * @type {WebGLCubeRenderTarget} + */ + renderTarget: WebGLCubeRenderTarget; + /** + * The current active coordinate system. + * + * @type {?(WebGLCoordinateSystem|WebGPUCoordinateSystem)} + * @default null + */ + coordinateSystem: (number | number) | null; + /** + * The current active mipmap level + * + * @type {number} + * @default 0 + */ + activeMipmapLevel: number; + /** + * Must be called when the coordinate system of the cube camera is changed. + */ + updateCoordinateSystem(): void; + /** + * Calling this method will render the given scene with the given renderer + * into the cube render target of the camera. + * + * @param {(Renderer|WebGLRenderer)} renderer - The renderer. + * @param {Scene} scene - The scene to render. + */ + update(renderer: (Renderer | WebGLRenderer), scene: Scene): void; +} +import { Object3D } from '../core/Object3D.js'; diff --git a/jsdoc-testing/jsdoc/cameras/OrthographicCamera.d.ts b/jsdoc-testing/jsdoc/cameras/OrthographicCamera.d.ts new file mode 100644 index 000000000..b6269a9b1 --- /dev/null +++ b/jsdoc-testing/jsdoc/cameras/OrthographicCamera.d.ts @@ -0,0 +1,122 @@ +/** + * Camera that uses [orthographic projection](https://en.wikipedia.org/wiki/Orthographic_projection). + * + * In this projection mode, an object's size in the rendered image stays + * constant regardless of its distance from the camera. This can be useful + * for rendering 2D scenes and UI elements, amongst other things. + * + * ```js + * const camera = new THREE.OrthographicCamera( width / - 2, width / 2, height / 2, height / - 2, 1, 1000 ); + * scene.add( camera ); + * ``` + * + * @augments Camera + */ +export class OrthographicCamera extends Camera { + /** + * Constructs a new orthographic camera. + * + * @param {number} [left=-1] - The left plane of the camera's frustum. + * @param {number} [right=1] - The right plane of the camera's frustum. + * @param {number} [top=1] - The top plane of the camera's frustum. + * @param {number} [bottom=-1] - The bottom plane of the camera's frustum. + * @param {number} [near=0.1] - The camera's near plane. + * @param {number} [far=2000] - The camera's far plane. + */ + constructor(left?: number, right?: number, top?: number, bottom?: number, near?: number, far?: number); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isOrthographicCamera: boolean; + /** + * The zoom factor of the camera. + * + * @type {number} + * @default 1 + */ + zoom: number; + /** + * Represents the frustum window specification. This property should not be edited + * directly but via {@link PerspectiveCamera#setViewOffset} and {@link PerspectiveCamera#clearViewOffset}. + * + * @type {?Object} + * @default null + */ + view: Object | null; + /** + * The left plane of the camera's frustum. + * + * @type {number} + * @default -1 + */ + left: number; + /** + * The right plane of the camera's frustum. + * + * @type {number} + * @default 1 + */ + right: number; + /** + * The top plane of the camera's frustum. + * + * @type {number} + * @default 1 + */ + top: number; + /** + * The bottom plane of the camera's frustum. + * + * @type {number} + * @default -1 + */ + bottom: number; + /** + * The camera's near plane. The valid range is greater than `0` + * and less than the current value of {@link OrthographicCamera#far}. + * + * Note that, unlike for the {@link PerspectiveCamera}, `0` is a + * valid value for an orthographic camera's near plane. + * + * @type {number} + * @default 0.1 + */ + near: number; + /** + * The camera's far plane. Must be greater than the + * current value of {@link OrthographicCamera#near}. + * + * @type {number} + * @default 2000 + */ + far: number; + copy(source: any, recursive: any): this; + /** + * Sets an offset in a larger frustum. This is useful for multi-window or + * multi-monitor/multi-machine setups. + * + * @param {number} fullWidth - The full width of multiview setup. + * @param {number} fullHeight - The full height of multiview setup. + * @param {number} x - The horizontal offset of the subcamera. + * @param {number} y - The vertical offset of the subcamera. + * @param {number} width - The width of subcamera. + * @param {number} height - The height of subcamera. + * @see {@link PerspectiveCamera#setViewOffset} + */ + setViewOffset(fullWidth: number, fullHeight: number, x: number, y: number, width: number, height: number): void; + /** + * Removes the view offset from the projection matrix. + */ + clearViewOffset(): void; + /** + * Updates the camera's projection matrix. Must be called after any change of + * camera properties. + */ + updateProjectionMatrix(): void; + toJSON(meta: any): Object; +} +import { Camera } from './Camera.js'; diff --git a/jsdoc-testing/jsdoc/cameras/PerspectiveCamera.d.ts b/jsdoc-testing/jsdoc/cameras/PerspectiveCamera.d.ts new file mode 100644 index 000000000..0bf274692 --- /dev/null +++ b/jsdoc-testing/jsdoc/cameras/PerspectiveCamera.d.ts @@ -0,0 +1,216 @@ +/** + * Camera that uses [perspective projection](https://en.wikipedia.org/wiki/Perspective_(graphical)). + * + * This projection mode is designed to mimic the way the human eye sees. It + * is the most common projection mode used for rendering a 3D scene. + * + * ```js + * const camera = new THREE.PerspectiveCamera( 45, width / height, 1, 1000 ); + * scene.add( camera ); + * ``` + * + * @augments Camera + */ +export class PerspectiveCamera extends Camera { + /** + * Constructs a new perspective camera. + * + * @param {number} [fov=50] - The vertical field of view. + * @param {number} [aspect=1] - The aspect ratio. + * @param {number} [near=0.1] - The camera's near plane. + * @param {number} [far=2000] - The camera's far plane. + */ + constructor(fov?: number, aspect?: number, near?: number, far?: number); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isPerspectiveCamera: boolean; + /** + * The vertical field of view, from bottom to top of view, + * in degrees. + * + * @type {number} + * @default 50 + */ + fov: number; + /** + * The zoom factor of the camera. + * + * @type {number} + * @default 1 + */ + zoom: number; + /** + * The camera's near plane. The valid range is greater than `0` + * and less than the current value of {@link PerspectiveCamera#far}. + * + * Note that, unlike for the {@link OrthographicCamera}, `0` is not a + * valid value for a perspective camera's near plane. + * + * @type {number} + * @default 0.1 + */ + near: number; + /** + * The camera's far plane. Must be greater than the + * current value of {@link PerspectiveCamera#near}. + * + * @type {number} + * @default 2000 + */ + far: number; + /** + * Object distance used for stereoscopy and depth-of-field effects. This + * parameter does not influence the projection matrix unless a + * {@link StereoCamera} is being used. + * + * @type {number} + * @default 10 + */ + focus: number; + /** + * The aspect ratio, usually the canvas width / canvas height. + * + * @type {number} + * @default 1 + */ + aspect: number; + /** + * Represents the frustum window specification. This property should not be edited + * directly but via {@link PerspectiveCamera#setViewOffset} and {@link PerspectiveCamera#clearViewOffset}. + * + * @type {?Object} + * @default null + */ + view: Object | null; + /** + * Film size used for the larger axis. Default is `35` (millimeters). This + * parameter does not influence the projection matrix unless {@link PerspectiveCamera#filmOffset} + * is set to a nonzero value. + * + * @type {number} + * @default 35 + */ + filmGauge: number; + /** + * Horizontal off-center offset in the same unit as {@link PerspectiveCamera#filmGauge}. + * + * @type {number} + * @default 0 + */ + filmOffset: number; + copy(source: any, recursive: any): this; + /** + * Sets the FOV by focal length in respect to the current {@link PerspectiveCamera#filmGauge}. + * + * The default film gauge is 35, so that the focal length can be specified for + * a 35mm (full frame) camera. + * + * @param {number} focalLength - Values for focal length and film gauge must have the same unit. + */ + setFocalLength(focalLength: number): void; + /** + * Returns the focal length from the current {@link PerspectiveCamera#fov} and + * {@link PerspectiveCamera#filmGauge}. + * + * @return {number} The computed focal length. + */ + getFocalLength(): number; + /** + * Returns the current vertical field of view angle in degrees considering {@link PerspectiveCamera#zoom}. + * + * @return {number} The effective FOV. + */ + getEffectiveFOV(): number; + /** + * Returns the width of the image on the film. If {@link PerspectiveCamera#aspect} is greater than or + * equal to one (landscape format), the result equals {@link PerspectiveCamera#filmGauge}. + * + * @return {number} The film width. + */ + getFilmWidth(): number; + /** + * Returns the height of the image on the film. If {@link PerspectiveCamera#aspect} is greater than or + * equal to one (landscape format), the result equals {@link PerspectiveCamera#filmGauge}. + * + * @return {number} The film width. + */ + getFilmHeight(): number; + /** + * Computes the 2D bounds of the camera's viewable rectangle at a given distance along the viewing direction. + * Sets `minTarget` and `maxTarget` to the coordinates of the lower-left and upper-right corners of the view rectangle. + * + * @param {number} distance - The viewing distance. + * @param {Vector2} minTarget - The lower-left corner of the view rectangle is written into this vector. + * @param {Vector2} maxTarget - The upper-right corner of the view rectangle is written into this vector. + */ + getViewBounds(distance: number, minTarget: Vector2, maxTarget: Vector2): void; + /** + * Computes the width and height of the camera's viewable rectangle at a given distance along the viewing direction. + * + * @param {number} distance - The viewing distance. + * @param {Vector2} target - The target vector that is used to store result where x is width and y is height. + * @returns {Vector2} The view size. + */ + getViewSize(distance: number, target: Vector2): Vector2; + /** + * Sets an offset in a larger frustum. This is useful for multi-window or + * multi-monitor/multi-machine setups. + * + * For example, if you have 3x2 monitors and each monitor is 1920x1080 and + * the monitors are in grid like this + *``` + * +---+---+---+ + * | A | B | C | + * +---+---+---+ + * | D | E | F | + * +---+---+---+ + *``` + * then for each monitor you would call it like this: + *```js + * const w = 1920; + * const h = 1080; + * const fullWidth = w * 3; + * const fullHeight = h * 2; + * + * // --A-- + * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 0, w, h ); + * // --B-- + * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 0, w, h ); + * // --C-- + * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 0, w, h ); + * // --D-- + * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 1, w, h ); + * // --E-- + * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 1, w, h ); + * // --F-- + * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h ); + * ``` + * + * Note there is no reason monitors have to be the same size or in a grid. + * + * @param {number} fullWidth - The full width of multiview setup. + * @param {number} fullHeight - The full height of multiview setup. + * @param {number} x - The horizontal offset of the subcamera. + * @param {number} y - The vertical offset of the subcamera. + * @param {number} width - The width of subcamera. + * @param {number} height - The height of subcamera. + */ + setViewOffset(fullWidth: number, fullHeight: number, x: number, y: number, width: number, height: number): void; + /** + * Removes the view offset from the projection matrix. + */ + clearViewOffset(): void; + /** + * Updates the camera's projection matrix. Must be called after any change of + * camera properties. + */ + updateProjectionMatrix(): void; + toJSON(meta: any): Object; +} +import { Camera } from './Camera.js'; +import { Vector2 } from '../math/Vector2.js'; diff --git a/jsdoc-testing/jsdoc/cameras/StereoCamera.d.ts b/jsdoc-testing/jsdoc/cameras/StereoCamera.d.ts new file mode 100644 index 000000000..929bf5258 --- /dev/null +++ b/jsdoc-testing/jsdoc/cameras/StereoCamera.d.ts @@ -0,0 +1,61 @@ +/** + * A special type of camera that uses two perspective cameras with + * stereoscopic projection. Can be used for rendering stereo effects + * like [3D Anaglyph](https://en.wikipedia.org/wiki/Anaglyph_3D) or + * [Parallax Barrier](https://en.wikipedia.org/wiki/parallax_barrier). + */ +export class StereoCamera { + /** + * The type property is used for detecting the object type + * in context of serialization/deserialization. + * + * @type {string} + * @readonly + */ + readonly type: string; + /** + * The aspect. + * + * @type {number} + * @default 1 + */ + aspect: number; + /** + * The eye separation which represents the distance + * between the left and right camera. + * + * @type {number} + * @default 0.064 + */ + eyeSep: number; + /** + * The camera representing the left eye. This is added to layer `1` so objects to be + * rendered by the left camera must also be added to this layer. + * + * @type {PerspectiveCamera} + */ + cameraL: PerspectiveCamera; + /** + * The camera representing the right eye. This is added to layer `2` so objects to be + * rendered by the right camera must also be added to this layer. + * + * @type {PerspectiveCamera} + */ + cameraR: PerspectiveCamera; + _cache: { + focus: null; + fov: null; + aspect: null; + near: null; + far: null; + zoom: null; + eyeSep: null; + }; + /** + * Updates the stereo camera based on the given perspective camera. + * + * @param {PerspectiveCamera} camera - The perspective camera. + */ + update(camera: PerspectiveCamera): void; +} +import { PerspectiveCamera } from './PerspectiveCamera.js'; diff --git a/jsdoc-testing/jsdoc/constants.d.ts b/jsdoc-testing/jsdoc/constants.d.ts new file mode 100644 index 000000000..4d57958af --- /dev/null +++ b/jsdoc-testing/jsdoc/constants.d.ts @@ -0,0 +1,1592 @@ +export const REVISION: "184dev"; +/** + * Represents mouse buttons and interaction types in context of controls. + * + * @type {ConstantsMouse} + * @constant + */ +export const MOUSE: ConstantsMouse; +/** + * Represents touch interaction types in context of controls. + * + * @type {ConstantsTouch} + * @constant + */ +export const TOUCH: ConstantsTouch; +/** + * Disables face culling. + * + * @type {number} + * @constant + */ +export const CullFaceNone: number; +/** + * Culls back faces. + * + * @type {number} + * @constant + */ +export const CullFaceBack: number; +/** + * Culls front faces. + * + * @type {number} + * @constant + */ +export const CullFaceFront: number; +/** + * Culls both front and back faces. + * + * @type {number} + * @constant + */ +export const CullFaceFrontBack: number; +/** + * Gives unfiltered shadow maps - fastest, but lowest quality. + * + * @type {number} + * @constant + */ +export const BasicShadowMap: number; +/** + * Filters shadow maps using the Percentage-Closer Filtering (PCF) algorithm. + * + * @type {number} + * @constant + */ +export const PCFShadowMap: number; +/** + * Filters shadow maps using the Percentage-Closer Filtering (PCF) algorithm with + * better soft shadows especially when using low-resolution shadow maps. + * + * @type {number} + * @constant + */ +export const PCFSoftShadowMap: number; +/** + * Filters shadow maps using the Variance Shadow Map (VSM) algorithm. + * When using VSMShadowMap all shadow receivers will also cast shadows. + * + * @type {number} + * @constant + */ +export const VSMShadowMap: number; +/** + * Only front faces are rendered. + * + * @type {number} + * @constant + */ +export const FrontSide: number; +/** + * Only back faces are rendered. + * + * @type {number} + * @constant + */ +export const BackSide: number; +/** + * Both front and back faces are rendered. + * + * @type {number} + * @constant + */ +export const DoubleSide: number; +/** + * No blending is performed which effectively disables + * alpha transparency. + * + * @type {number} + * @constant + */ +export const NoBlending: number; +/** + * The default blending. + * + * @type {number} + * @constant + */ +export const NormalBlending: number; +/** + * Represents additive blending. + * + * @type {number} + * @constant + */ +export const AdditiveBlending: number; +/** + * Represents subtractive blending. + * + * @type {number} + * @constant + */ +export const SubtractiveBlending: number; +/** + * Represents multiply blending. + * + * @type {number} + * @constant + */ +export const MultiplyBlending: number; +/** + * Represents custom blending. + * + * @type {number} + * @constant + */ +export const CustomBlending: number; +/** + * Represents material blending. + * + * @type {number} + * @constant + */ +export const MaterialBlending: number; +/** + * A `source + destination` blending equation. + * + * @type {number} + * @constant + */ +export const AddEquation: number; +/** + * A `source - destination` blending equation. + * + * @type {number} + * @constant + */ +export const SubtractEquation: number; +/** + * A `destination - source` blending equation. + * + * @type {number} + * @constant + */ +export const ReverseSubtractEquation: number; +/** + * A blend equation that uses the minimum of source and destination. + * + * @type {number} + * @constant + */ +export const MinEquation: number; +/** + * A blend equation that uses the maximum of source and destination. + * + * @type {number} + * @constant + */ +export const MaxEquation: number; +/** + * Multiplies all colors by `0`. + * + * @type {number} + * @constant + */ +export const ZeroFactor: number; +/** + * Multiplies all colors by `1`. + * + * @type {number} + * @constant + */ +export const OneFactor: number; +/** + * Multiplies all colors by the source colors. + * + * @type {number} + * @constant + */ +export const SrcColorFactor: number; +/** + * Multiplies all colors by `1` minus each source color. + * + * @type {number} + * @constant + */ +export const OneMinusSrcColorFactor: number; +/** + * Multiplies all colors by the source alpha value. + * + * @type {number} + * @constant + */ +export const SrcAlphaFactor: number; +/** + * Multiplies all colors by 1 minus the source alpha value. + * + * @type {number} + * @constant + */ +export const OneMinusSrcAlphaFactor: number; +/** + * Multiplies all colors by the destination alpha value. + * + * @type {number} + * @constant + */ +export const DstAlphaFactor: number; +/** + * Multiplies all colors by `1` minus the destination alpha value. + * + * @type {number} + * @constant + */ +export const OneMinusDstAlphaFactor: number; +/** + * Multiplies all colors by the destination color. + * + * @type {number} + * @constant + */ +export const DstColorFactor: number; +/** + * Multiplies all colors by `1` minus each destination color. + * + * @type {number} + * @constant + */ +export const OneMinusDstColorFactor: number; +/** + * Multiplies the RGB colors by the smaller of either the source alpha + * value or the value of `1` minus the destination alpha value. The alpha + * value is multiplied by `1`. + * + * @type {number} + * @constant + */ +export const SrcAlphaSaturateFactor: number; +/** + * Multiplies all colors by a constant color. + * + * @type {number} + * @constant + */ +export const ConstantColorFactor: number; +/** + * Multiplies all colors by `1` minus a constant color. + * + * @type {number} + * @constant + */ +export const OneMinusConstantColorFactor: number; +/** + * Multiplies all colors by a constant alpha value. + * + * @type {number} + * @constant + */ +export const ConstantAlphaFactor: number; +/** + * Multiplies all colors by 1 minus a constant alpha value. + * + * @type {number} + * @constant + */ +export const OneMinusConstantAlphaFactor: number; +/** + * Never pass. + * + * @type {number} + * @constant + */ +export const NeverDepth: number; +/** + * Always pass. + * + * @type {number} + * @constant + */ +export const AlwaysDepth: number; +/** + * Pass if the incoming value is less than the depth buffer value. + * + * @type {number} + * @constant + */ +export const LessDepth: number; +/** + * Pass if the incoming value is less than or equal to the depth buffer value. + * + * @type {number} + * @constant + */ +export const LessEqualDepth: number; +/** + * Pass if the incoming value equals the depth buffer value. + * + * @type {number} + * @constant + */ +export const EqualDepth: number; +/** + * Pass if the incoming value is greater than or equal to the depth buffer value. + * + * @type {number} + * @constant + */ +export const GreaterEqualDepth: number; +/** + * Pass if the incoming value is greater than the depth buffer value. + * + * @type {number} + * @constant + */ +export const GreaterDepth: number; +/** + * Pass if the incoming value is not equal to the depth buffer value. + * + * @type {number} + * @constant + */ +export const NotEqualDepth: number; +/** + * Multiplies the environment map color with the surface color. + * + * @type {number} + * @constant + */ +export const MultiplyOperation: number; +/** + * Uses reflectivity to blend between the two colors. + * + * @type {number} + * @constant + */ +export const MixOperation: number; +/** + * Adds the two colors. + * + * @type {number} + * @constant + */ +export const AddOperation: number; +/** + * No tone mapping is applied. + * + * @type {number} + * @constant + */ +export const NoToneMapping: number; +/** + * Linear tone mapping. + * + * @type {number} + * @constant + */ +export const LinearToneMapping: number; +/** + * Reinhard tone mapping. + * + * @type {number} + * @constant + */ +export const ReinhardToneMapping: number; +/** + * Cineon tone mapping. + * + * @type {number} + * @constant + */ +export const CineonToneMapping: number; +/** + * ACES Filmic tone mapping. + * + * @type {number} + * @constant + */ +export const ACESFilmicToneMapping: number; +/** + * Custom tone mapping. + * + * Expects a custom implementation by modifying shader code of the material's fragment shader. + * + * @type {number} + * @constant + */ +export const CustomToneMapping: number; +/** + * AgX tone mapping. + * + * @type {number} + * @constant + */ +export const AgXToneMapping: number; +/** + * Neutral tone mapping. + * + * Implementation based on the Khronos 3D Commerce Group standard tone mapping. + * + * @type {number} + * @constant + */ +export const NeutralToneMapping: number; +/** + * The skinned mesh shares the same world space as the skeleton. + * + * @type {string} + * @constant + */ +export const AttachedBindMode: string; +/** + * The skinned mesh does not share the same world space as the skeleton. + * This is useful when a skeleton is shared across multiple skinned meshes. + * + * @type {string} + * @constant + */ +export const DetachedBindMode: string; +/** + * Maps textures using the geometry's UV coordinates. + * + * @type {number} + * @constant + */ +export const UVMapping: number; +/** + * Reflection mapping for cube textures. + * + * @type {number} + * @constant + */ +export const CubeReflectionMapping: number; +/** + * Refraction mapping for cube textures. + * + * @type {number} + * @constant + */ +export const CubeRefractionMapping: number; +/** + * Reflection mapping for equirectangular textures. + * + * @type {number} + * @constant + */ +export const EquirectangularReflectionMapping: number; +/** + * Refraction mapping for equirectangular textures. + * + * @type {number} + * @constant + */ +export const EquirectangularRefractionMapping: number; +/** + * Reflection mapping for PMREM textures. + * + * @type {number} + * @constant + */ +export const CubeUVReflectionMapping: number; +/** + * The texture will simply repeat to infinity. + * + * @type {number} + * @constant + */ +export const RepeatWrapping: number; +/** + * The last pixel of the texture stretches to the edge of the mesh. + * + * @type {number} + * @constant + */ +export const ClampToEdgeWrapping: number; +/** + * The texture will repeats to infinity, mirroring on each repeat. + * + * @type {number} + * @constant + */ +export const MirroredRepeatWrapping: number; +/** + * Returns the value of the texture element that is nearest (in Manhattan distance) + * to the specified texture coordinates. + * + * @type {number} + * @constant + */ +export const NearestFilter: number; +/** + * Chooses the mipmap that most closely matches the size of the pixel being textured + * and uses the `NearestFilter` criterion (the texel nearest to the center of the pixel) + * to produce a texture value. + * + * @type {number} + * @constant + */ +export const NearestMipmapNearestFilter: number; +export const NearestMipMapNearestFilter: 1004; +/** + * Chooses the two mipmaps that most closely match the size of the pixel being textured and + * uses the `NearestFilter` criterion to produce a texture value from each mipmap. + * The final texture value is a weighted average of those two values. + * + * @type {number} + * @constant + */ +export const NearestMipmapLinearFilter: number; +export const NearestMipMapLinearFilter: 1005; +/** + * Returns the weighted average of the four texture elements that are closest to the specified + * texture coordinates, and can include items wrapped or repeated from other parts of a texture, + * depending on the values of `wrapS` and `wrapT`, and on the exact mapping. + * + * @type {number} + * @constant + */ +export const LinearFilter: number; +/** + * Chooses the mipmap that most closely matches the size of the pixel being textured and uses + * the `LinearFilter` criterion (a weighted average of the four texels that are closest to the + * center of the pixel) to produce a texture value. + * + * @type {number} + * @constant + */ +export const LinearMipmapNearestFilter: number; +export const LinearMipMapNearestFilter: 1007; +/** + * Chooses the two mipmaps that most closely match the size of the pixel being textured and uses + * the `LinearFilter` criterion to produce a texture value from each mipmap. The final texture value + * is a weighted average of those two values. + * + * @type {number} + * @constant + */ +export const LinearMipmapLinearFilter: number; +export const LinearMipMapLinearFilter: 1008; +/** + * An unsigned byte data type for textures. + * + * @type {number} + * @constant + */ +export const UnsignedByteType: number; +/** + * A byte data type for textures. + * + * @type {number} + * @constant + */ +export const ByteType: number; +/** + * A short data type for textures. + * + * @type {number} + * @constant + */ +export const ShortType: number; +/** + * An unsigned short data type for textures. + * + * @type {number} + * @constant + */ +export const UnsignedShortType: number; +/** + * An int data type for textures. + * + * @type {number} + * @constant + */ +export const IntType: number; +/** + * An unsigned int data type for textures. + * + * @type {number} + * @constant + */ +export const UnsignedIntType: number; +/** + * A float data type for textures. + * + * @type {number} + * @constant + */ +export const FloatType: number; +/** + * A half float data type for textures. + * + * @type {number} + * @constant + */ +export const HalfFloatType: number; +/** + * An unsigned short 4_4_4_4 (packed) data type for textures. + * + * @type {number} + * @constant + */ +export const UnsignedShort4444Type: number; +/** + * An unsigned short 5_5_5_1 (packed) data type for textures. + * + * @type {number} + * @constant + */ +export const UnsignedShort5551Type: number; +/** + * An unsigned int 24_8 data type for textures. + * + * @type {number} + * @constant + */ +export const UnsignedInt248Type: number; +/** + * An unsigned int 5_9_9_9 (packed) data type for textures. + * + * @type {number} + * @constant + */ +export const UnsignedInt5999Type: number; +/** + * An unsigned int 10_11_11 (packed) data type for textures. + * + * @type {number} + * @constant + */ +export const UnsignedInt101111Type: number; +/** + * Discards the red, green and blue components and reads just the alpha component. + * + * @type {number} + * @constant + */ +export const AlphaFormat: number; +/** + * Discards the alpha component and reads the red, green and blue component. + * + * @type {number} + * @constant + */ +export const RGBFormat: number; +/** + * Reads the red, green, blue and alpha components. + * + * @type {number} + * @constant + */ +export const RGBAFormat: number; +/** + * Reads each element as a single depth value, converts it to floating point, and clamps to the range `[0,1]`. + * + * @type {number} + * @constant + */ +export const DepthFormat: number; +/** + * Reads each element is a pair of depth and stencil values. The depth component of the pair is interpreted as + * in `DepthFormat`. The stencil component is interpreted based on the depth + stencil internal format. + * + * @type {number} + * @constant + */ +export const DepthStencilFormat: number; +/** + * Discards the green, blue and alpha components and reads just the red component. + * + * @type {number} + * @constant + */ +export const RedFormat: number; +/** + * Discards the green, blue and alpha components and reads just the red component. The texels are read as integers instead of floating point. + * + * @type {number} + * @constant + */ +export const RedIntegerFormat: number; +/** + * Discards the alpha, and blue components and reads the red, and green components. + * + * @type {number} + * @constant + */ +export const RGFormat: number; +/** + * Discards the alpha, and blue components and reads the red, and green components. The texels are read as integers instead of floating point. + * + * @type {number} + * @constant + */ +export const RGIntegerFormat: number; +/** + * Discards the alpha component and reads the red, green and blue component. The texels are read as integers instead of floating point. + * + * @type {number} + * @constant + */ +export const RGBIntegerFormat: number; +/** + * Reads the red, green, blue and alpha components. The texels are read as integers instead of floating point. + * + * @type {number} + * @constant + */ +export const RGBAIntegerFormat: number; +/** + * A DXT1-compressed image in an RGB image format. + * + * @type {number} + * @constant + */ +export const RGB_S3TC_DXT1_Format: number; +/** + * A DXT1-compressed image in an RGB image format with a simple on/off alpha value. + * + * @type {number} + * @constant + */ +export const RGBA_S3TC_DXT1_Format: number; +/** + * A DXT3-compressed image in an RGBA image format. Compared to a 32-bit RGBA texture, it offers 4:1 compression. + * + * @type {number} + * @constant + */ +export const RGBA_S3TC_DXT3_Format: number; +/** + * A DXT5-compressed image in an RGBA image format. It also provides a 4:1 compression, but differs to the DXT3 + * compression in how the alpha compression is done. + * + * @type {number} + * @constant + */ +export const RGBA_S3TC_DXT5_Format: number; +/** + * PVRTC RGB compression in 4-bit mode. One block for each 4×4 pixels. + * + * @type {number} + * @constant + */ +export const RGB_PVRTC_4BPPV1_Format: number; +/** + * PVRTC RGB compression in 2-bit mode. One block for each 8×4 pixels. + * + * @type {number} + * @constant + */ +export const RGB_PVRTC_2BPPV1_Format: number; +/** + * PVRTC RGBA compression in 4-bit mode. One block for each 4×4 pixels. + * + * @type {number} + * @constant + */ +export const RGBA_PVRTC_4BPPV1_Format: number; +/** + * PVRTC RGBA compression in 2-bit mode. One block for each 8×4 pixels. + * + * @type {number} + * @constant + */ +export const RGBA_PVRTC_2BPPV1_Format: number; +/** + * ETC1 RGB format. + * + * @type {number} + * @constant + */ +export const RGB_ETC1_Format: number; +/** + * ETC2 RGB format. + * + * @type {number} + * @constant + */ +export const RGB_ETC2_Format: number; +/** + * ETC2 RGBA format. + * + * @type {number} + * @constant + */ +export const RGBA_ETC2_EAC_Format: number; +/** + * EAC R11 UNORM format. + * + * @type {number} + * @constant + */ +export const R11_EAC_Format: number; +/** + * EAC R11 SNORM format. + * + * @type {number} + * @constant + */ +export const SIGNED_R11_EAC_Format: number; +/** + * EAC RG11 UNORM format. + * + * @type {number} + * @constant + */ +export const RG11_EAC_Format: number; +/** + * EAC RG11 SNORM format. + * + * @type {number} + * @constant + */ +export const SIGNED_RG11_EAC_Format: number; +/** + * ASTC RGBA 4x4 format. + * + * @type {number} + * @constant + */ +export const RGBA_ASTC_4x4_Format: number; +/** + * ASTC RGBA 5x4 format. + * + * @type {number} + * @constant + */ +export const RGBA_ASTC_5x4_Format: number; +/** + * ASTC RGBA 5x5 format. + * + * @type {number} + * @constant + */ +export const RGBA_ASTC_5x5_Format: number; +/** + * ASTC RGBA 6x5 format. + * + * @type {number} + * @constant + */ +export const RGBA_ASTC_6x5_Format: number; +/** + * ASTC RGBA 6x6 format. + * + * @type {number} + * @constant + */ +export const RGBA_ASTC_6x6_Format: number; +/** + * ASTC RGBA 8x5 format. + * + * @type {number} + * @constant + */ +export const RGBA_ASTC_8x5_Format: number; +/** + * ASTC RGBA 8x6 format. + * + * @type {number} + * @constant + */ +export const RGBA_ASTC_8x6_Format: number; +/** + * ASTC RGBA 8x8 format. + * + * @type {number} + * @constant + */ +export const RGBA_ASTC_8x8_Format: number; +/** + * ASTC RGBA 10x5 format. + * + * @type {number} + * @constant + */ +export const RGBA_ASTC_10x5_Format: number; +/** + * ASTC RGBA 10x6 format. + * + * @type {number} + * @constant + */ +export const RGBA_ASTC_10x6_Format: number; +/** + * ASTC RGBA 10x8 format. + * + * @type {number} + * @constant + */ +export const RGBA_ASTC_10x8_Format: number; +/** + * ASTC RGBA 10x10 format. + * + * @type {number} + * @constant + */ +export const RGBA_ASTC_10x10_Format: number; +/** + * ASTC RGBA 12x10 format. + * + * @type {number} + * @constant + */ +export const RGBA_ASTC_12x10_Format: number; +/** + * ASTC RGBA 12x12 format. + * + * @type {number} + * @constant + */ +export const RGBA_ASTC_12x12_Format: number; +/** + * BPTC RGBA format. + * + * @type {number} + * @constant + */ +export const RGBA_BPTC_Format: number; +/** + * BPTC Signed RGB format. + * + * @type {number} + * @constant + */ +export const RGB_BPTC_SIGNED_Format: number; +/** + * BPTC Unsigned RGB format. + * + * @type {number} + * @constant + */ +export const RGB_BPTC_UNSIGNED_Format: number; +/** + * RGTC1 Red format. + * + * @type {number} + * @constant + */ +export const RED_RGTC1_Format: number; +/** + * RGTC1 Signed Red format. + * + * @type {number} + * @constant + */ +export const SIGNED_RED_RGTC1_Format: number; +/** + * RGTC2 Red Green format. + * + * @type {number} + * @constant + */ +export const RED_GREEN_RGTC2_Format: number; +/** + * RGTC2 Signed Red Green format. + * + * @type {number} + * @constant + */ +export const SIGNED_RED_GREEN_RGTC2_Format: number; +/** + * Animations are played once. + * + * @type {number} + * @constant + */ +export const LoopOnce: number; +/** + * Animations are played with a chosen number of repetitions, each time jumping from + * the end of the clip directly to its beginning. + * + * @type {number} + * @constant + */ +export const LoopRepeat: number; +/** + * Animations are played with a chosen number of repetitions, alternately playing forward + * and backward. + * + * @type {number} + * @constant + */ +export const LoopPingPong: number; +/** + * Discrete interpolation mode for keyframe tracks. + * + * @type {number} + * @constant + */ +export const InterpolateDiscrete: number; +/** + * Linear interpolation mode for keyframe tracks. + * + * @type {number} + * @constant + */ +export const InterpolateLinear: number; +/** + * Smooth interpolation mode for keyframe tracks. + * + * @type {number} + * @constant + */ +export const InterpolateSmooth: number; +/** + * Bezier interpolation mode for keyframe tracks. + * + * Uses cubic Bezier curves with explicit 2D control points. + * Requires tangent data to be set on the track. + * + * @type {number} + * @constant + */ +export const InterpolateBezier: number; +/** + * Zero curvature ending for animations. + * + * @type {number} + * @constant + */ +export const ZeroCurvatureEnding: number; +/** + * Zero slope ending for animations. + * + * @type {number} + * @constant + */ +export const ZeroSlopeEnding: number; +/** + * Wrap around ending for animations. + * + * @type {number} + * @constant + */ +export const WrapAroundEnding: number; +/** + * Default animation blend mode. + * + * @type {number} + * @constant + */ +export const NormalAnimationBlendMode: number; +/** + * Additive animation blend mode. Can be used to layer motions on top of + * each other to build complex performances from smaller re-usable assets. + * + * @type {number} + * @constant + */ +export const AdditiveAnimationBlendMode: number; +/** + * For every three vertices draw a single triangle. + * + * @type {number} + * @constant + */ +export const TrianglesDrawMode: number; +/** + * For each vertex draw a triangle from the last three vertices. + * + * @type {number} + * @constant + */ +export const TriangleStripDrawMode: number; +/** + * For each vertex draw a triangle from the first vertex and the last two vertices. + * + * @type {number} + * @constant + */ +export const TriangleFanDrawMode: number; +/** + * The depth value is inverted (1.0 - z) for visualization purposes. + * + * @type {number} + * @constant + */ +export const BasicDepthPacking: number; +/** + * The depth value is packed into 32 bit RGBA. + * + * @type {number} + * @constant + */ +export const RGBADepthPacking: number; +/** + * The depth value is packed into 24 bit RGB. + * + * @type {number} + * @constant + */ +export const RGBDepthPacking: number; +/** + * The depth value is packed into 16 bit RG. + * + * @type {number} + * @constant + */ +export const RGDepthPacking: number; +/** + * Normal information is relative to the underlying surface. + * + * @type {number} + * @constant + */ +export const TangentSpaceNormalMap: number; +/** + * Normal information is relative to the object orientation. + * + * @type {number} + * @constant + */ +export const ObjectSpaceNormalMap: number; +/** + * No color space. + * + * @type {string} + * @constant + */ +export const NoColorSpace: string; +/** + * sRGB color space. + * + * @type {string} + * @constant + */ +export const SRGBColorSpace: string; +/** + * sRGB-linear color space. + * + * @type {string} + * @constant + */ +export const LinearSRGBColorSpace: string; +/** + * Linear transfer function. + * + * @type {string} + * @constant + */ +export const LinearTransfer: string; +/** + * sRGB transfer function. + * + * @type {string} + * @constant + */ +export const SRGBTransfer: string; +/** + * No normal map packing. + * + * @type {string} + * @constant + */ +export const NoNormalPacking: string; +/** + * Normal RG packing. + * + * @type {string} + * @constant + */ +export const NormalRGPacking: string; +/** + * Normal GA packing. + * + * @type {string} + * @constant + */ +export const NormalGAPacking: string; +/** + * Sets the stencil buffer value to `0`. + * + * @type {number} + * @constant + */ +export const ZeroStencilOp: number; +/** + * Keeps the current value. + * + * @type {number} + * @constant + */ +export const KeepStencilOp: number; +/** + * Sets the stencil buffer value to the specified reference value. + * + * @type {number} + * @constant + */ +export const ReplaceStencilOp: number; +/** + * Increments the current stencil buffer value. Clamps to the maximum representable unsigned value. + * + * @type {number} + * @constant + */ +export const IncrementStencilOp: number; +/** + * Decrements the current stencil buffer value. Clamps to `0`. + * + * @type {number} + * @constant + */ +export const DecrementStencilOp: number; +/** + * Increments the current stencil buffer value. Wraps stencil buffer value to zero when incrementing + * the maximum representable unsigned value. + * + * @type {number} + * @constant + */ +export const IncrementWrapStencilOp: number; +/** + * Decrements the current stencil buffer value. Wraps stencil buffer value to the maximum representable + * unsigned value when decrementing a stencil buffer value of `0`. + * + * @type {number} + * @constant + */ +export const DecrementWrapStencilOp: number; +/** + * Inverts the current stencil buffer value bitwise. + * + * @type {number} + * @constant + */ +export const InvertStencilOp: number; +/** + * Will never return true. + * + * @type {number} + * @constant + */ +export const NeverStencilFunc: number; +/** + * Will return true if the stencil reference value is less than the current stencil value. + * + * @type {number} + * @constant + */ +export const LessStencilFunc: number; +/** + * Will return true if the stencil reference value is equal to the current stencil value. + * + * @type {number} + * @constant + */ +export const EqualStencilFunc: number; +/** + * Will return true if the stencil reference value is less than or equal to the current stencil value. + * + * @type {number} + * @constant + */ +export const LessEqualStencilFunc: number; +/** + * Will return true if the stencil reference value is greater than the current stencil value. + * + * @type {number} + * @constant + */ +export const GreaterStencilFunc: number; +/** + * Will return true if the stencil reference value is not equal to the current stencil value. + * + * @type {number} + * @constant + */ +export const NotEqualStencilFunc: number; +/** + * Will return true if the stencil reference value is greater than or equal to the current stencil value. + * + * @type {number} + * @constant + */ +export const GreaterEqualStencilFunc: number; +/** + * Will always return true. + * + * @type {number} + * @constant + */ +export const AlwaysStencilFunc: number; +/** + * Never pass. + * + * @type {number} + * @constant + */ +export const NeverCompare: number; +/** + * Pass if the incoming value is less than the texture value. + * + * @type {number} + * @constant + */ +export const LessCompare: number; +/** + * Pass if the incoming value equals the texture value. + * + * @type {number} + * @constant + */ +export const EqualCompare: number; +/** + * Pass if the incoming value is less than or equal to the texture value. + * + * @type {number} + * @constant + */ +export const LessEqualCompare: number; +/** + * Pass if the incoming value is greater than the texture value. + * + * @type {number} + * @constant + */ +export const GreaterCompare: number; +/** + * Pass if the incoming value is not equal to the texture value. + * + * @type {number} + * @constant + */ +export const NotEqualCompare: number; +/** + * Pass if the incoming value is greater than or equal to the texture value. + * + * @type {number} + * @constant + */ +export const GreaterEqualCompare: number; +/** + * Always pass. + * + * @type {number} + * @constant + */ +export const AlwaysCompare: number; +/** + * The contents are intended to be specified once by the application, and used many + * times as the source for drawing and image specification commands. + * + * @type {number} + * @constant + */ +export const StaticDrawUsage: number; +/** + * The contents are intended to be respecified repeatedly by the application, and + * used many times as the source for drawing and image specification commands. + * + * @type {number} + * @constant + */ +export const DynamicDrawUsage: number; +/** + * The contents are intended to be specified once by the application, and used at most + * a few times as the source for drawing and image specification commands. + * + * @type {number} + * @constant + */ +export const StreamDrawUsage: number; +/** + * The contents are intended to be specified once by reading data from the 3D API, and queried + * many times by the application. + * + * @type {number} + * @constant + */ +export const StaticReadUsage: number; +/** + * The contents are intended to be respecified repeatedly by reading data from the 3D API, and queried + * many times by the application. + * + * @type {number} + * @constant + */ +export const DynamicReadUsage: number; +/** + * The contents are intended to be specified once by reading data from the 3D API, and queried at most + * a few times by the application + * + * @type {number} + * @constant + */ +export const StreamReadUsage: number; +/** + * The contents are intended to be specified once by reading data from the 3D API, and used many times as + * the source for WebGL drawing and image specification commands. + * + * @type {number} + * @constant + */ +export const StaticCopyUsage: number; +/** + * The contents are intended to be respecified repeatedly by reading data from the 3D API, and used many times + * as the source for WebGL drawing and image specification commands. + * + * @type {number} + * @constant + */ +export const DynamicCopyUsage: number; +/** + * The contents are intended to be specified once by reading data from the 3D API, and used at most a few times + * as the source for WebGL drawing and image specification commands. + * + * @type {number} + * @constant + */ +export const StreamCopyUsage: number; +/** + * GLSL 1 shader code. + * + * @type {string} + * @constant + */ +export const GLSL1: string; +/** + * GLSL 3 shader code. + * + * @type {string} + * @constant + */ +export const GLSL3: string; +/** + * WebGL coordinate system. + * + * @type {number} + * @constant + */ +export const WebGLCoordinateSystem: number; +/** + * WebGPU coordinate system. + * + * @type {number} + * @constant + */ +export const WebGPUCoordinateSystem: number; +/** + * Represents the different timestamp query types. + * + * @type {ConstantsTimestampQuery} + * @constant + */ +export const TimestampQuery: ConstantsTimestampQuery; +/** + * Represents mouse buttons and interaction types in context of controls. + * + * @type {ConstantsInterpolationSamplingType} + * @constant + */ +export const InterpolationSamplingType: ConstantsInterpolationSamplingType; +/** + * Represents the different interpolation sampling modes. + * + * @type {ConstantsInterpolationSamplingMode} + * @constant + */ +export const InterpolationSamplingMode: ConstantsInterpolationSamplingMode; +/** + * Compatibility flags for features that may not be supported across all platforms. + * + * @type {Object} + * @constant + */ +export const Compatibility: Object; +/** + * This type represents mouse buttons and interaction types in context of controls. + */ +export type ConstantsMouse = { + /** + * - The left mouse button. + */ + MIDDLE: number; + /** + * - The middle mouse button. + */ + LEFT: number; + /** + * - The right mouse button. + */ + RIGHT: number; + /** + * - A rotate interaction. + */ + ROTATE: number; + /** + * - A dolly interaction. + */ + DOLLY: number; + /** + * - A pan interaction. + */ + PAN: number; +}; +/** + * This type represents touch interaction types in context of controls. + */ +export type ConstantsTouch = { + /** + * - A rotate interaction. + */ + ROTATE: number; + /** + * - A pan interaction. + */ + PAN: number; + /** + * - The dolly-pan interaction. + */ + DOLLY_PAN: number; + /** + * - A dolly-rotate interaction. + */ + DOLLY_ROTATE: number; +}; +/** + * This type represents the different timestamp query types. + */ +export type ConstantsTimestampQuery = { + /** + * - A `compute` timestamp query. + */ + COMPUTE: string; + /** + * - A `render` timestamp query. + */ + RENDER: string; +}; +/** + * Represents the different interpolation sampling types. + */ +export type ConstantsInterpolationSamplingType = { + /** + * - Perspective-correct interpolation. + */ + PERSPECTIVE: string; + /** + * - Linear interpolation. + */ + LINEAR: string; + /** + * - Flat interpolation. + */ + FLAT: string; +}; +/** + * Represents the different interpolation sampling modes. + */ +export type ConstantsInterpolationSamplingMode = { + /** + * - Normal sampling mode. + */ + NORMAL: string; + /** + * - Centroid sampling mode. + */ + CENTROID: string; + /** + * - Sample-specific sampling mode. + */ + SAMPLE: string; + /** + * - Flat interpolation using the first vertex. + */ + FIRST: string; + /** + * - Flat interpolation using either vertex. + */ + EITHER: string; +}; diff --git a/jsdoc-testing/jsdoc/core/BufferAttribute.d.ts b/jsdoc-testing/jsdoc/core/BufferAttribute.d.ts new file mode 100644 index 000000000..c2ca498b3 --- /dev/null +++ b/jsdoc-testing/jsdoc/core/BufferAttribute.d.ts @@ -0,0 +1,482 @@ +/** + * Convenient class that can be used when creating a `Float32` buffer attribute with + * a plain `Array` instance. + * + * @augments BufferAttribute + */ +export class Float32BufferAttribute extends BufferAttribute { + /** + * Constructs a new buffer attribute. + * + * @param {(Array|Float32Array)} array - The array holding the attribute data. + * @param {number} itemSize - The item size. + * @param {boolean} [normalized=false] - Whether the data are normalized or not. + */ + constructor(array: (Array | Float32Array), itemSize: number, normalized?: boolean); +} +/** + * Convenient class that can be used when creating a `Float16` buffer attribute with + * a plain `Array` instance. + * + * This class automatically converts to and from FP16 via `Uint16Array` since `Float16Array` + * browser support is still problematic. + * + * @augments BufferAttribute + */ +export class Float16BufferAttribute extends BufferAttribute { + /** + * Constructs a new buffer attribute. + * + * @param {(Array|Uint16Array)} array - The array holding the attribute data. + * @param {number} itemSize - The item size. + * @param {boolean} [normalized=false] - Whether the data are normalized or not. + */ + constructor(array: (Array | Uint16Array), itemSize: number, normalized?: boolean); + isFloat16BufferAttribute: boolean; + getX(index: any): number; + setX(index: any, x: any): this; + getY(index: any): number; + setY(index: any, y: any): this; + getZ(index: any): number; + setZ(index: any, z: any): this; + getW(index: any): number; + setW(index: any, w: any): this; + setXY(index: any, x: any, y: any): this; + setXYZ(index: any, x: any, y: any, z: any): this; + setXYZW(index: any, x: any, y: any, z: any, w: any): this; +} +/** + * Convenient class that can be used when creating a `UInt32` buffer attribute with + * a plain `Array` instance. + * + * @augments BufferAttribute + */ +export class Uint32BufferAttribute extends BufferAttribute { + /** + * Constructs a new buffer attribute. + * + * @param {(Array|Uint32Array)} array - The array holding the attribute data. + * @param {number} itemSize - The item size. + * @param {boolean} [normalized=false] - Whether the data are normalized or not. + */ + constructor(array: (Array | Uint32Array), itemSize: number, normalized?: boolean); +} +/** + * Convenient class that can be used when creating a `Int32` buffer attribute with + * a plain `Array` instance. + * + * @augments BufferAttribute + */ +export class Int32BufferAttribute extends BufferAttribute { + /** + * Constructs a new buffer attribute. + * + * @param {(Array|Int32Array)} array - The array holding the attribute data. + * @param {number} itemSize - The item size. + * @param {boolean} [normalized=false] - Whether the data are normalized or not. + */ + constructor(array: (Array | Int32Array), itemSize: number, normalized?: boolean); +} +/** + * Convenient class that can be used when creating a `UInt16` buffer attribute with + * a plain `Array` instance. + * + * @augments BufferAttribute + */ +export class Uint16BufferAttribute extends BufferAttribute { + /** + * Constructs a new buffer attribute. + * + * @param {(Array|Uint16Array)} array - The array holding the attribute data. + * @param {number} itemSize - The item size. + * @param {boolean} [normalized=false] - Whether the data are normalized or not. + */ + constructor(array: (Array | Uint16Array), itemSize: number, normalized?: boolean); +} +/** + * Convenient class that can be used when creating a `Int16` buffer attribute with + * a plain `Array` instance. + * + * @augments BufferAttribute + */ +export class Int16BufferAttribute extends BufferAttribute { + /** + * Constructs a new buffer attribute. + * + * @param {(Array|Int16Array)} array - The array holding the attribute data. + * @param {number} itemSize - The item size. + * @param {boolean} [normalized=false] - Whether the data are normalized or not. + */ + constructor(array: (Array | Int16Array), itemSize: number, normalized?: boolean); +} +/** + * Convenient class that can be used when creating a `UInt8Clamped` buffer attribute with + * a plain `Array` instance. + * + * @augments BufferAttribute + */ +export class Uint8ClampedBufferAttribute extends BufferAttribute { + /** + * Constructs a new buffer attribute. + * + * @param {(Array|Uint8ClampedArray)} array - The array holding the attribute data. + * @param {number} itemSize - The item size. + * @param {boolean} [normalized=false] - Whether the data are normalized or not. + */ + constructor(array: (Array | Uint8ClampedArray), itemSize: number, normalized?: boolean); +} +/** + * Convenient class that can be used when creating a `UInt8` buffer attribute with + * a plain `Array` instance. + * + * @augments BufferAttribute + */ +export class Uint8BufferAttribute extends BufferAttribute { + /** + * Constructs a new buffer attribute. + * + * @param {(Array|Uint8Array)} array - The array holding the attribute data. + * @param {number} itemSize - The item size. + * @param {boolean} [normalized=false] - Whether the data are normalized or not. + */ + constructor(array: (Array | Uint8Array), itemSize: number, normalized?: boolean); +} +/** + * Convenient class that can be used when creating a `Int8` buffer attribute with + * a plain `Array` instance. + * + * @augments BufferAttribute + */ +export class Int8BufferAttribute extends BufferAttribute { + /** + * Constructs a new buffer attribute. + * + * @param {(Array|Int8Array)} array - The array holding the attribute data. + * @param {number} itemSize - The item size. + * @param {boolean} [normalized=false] - Whether the data are normalized or not. + */ + constructor(array: (Array | Int8Array), itemSize: number, normalized?: boolean); +} +/** + * This class stores data for an attribute (such as vertex positions, face + * indices, normals, colors, UVs, and any custom attributes ) associated with + * a geometry, which allows for more efficient passing of data to the GPU. + * + * When working with vector-like data, the `fromBufferAttribute( attribute, index )` + * helper methods on vector and color class might be helpful. E.g. {@link Vector3#fromBufferAttribute}. + */ +export class BufferAttribute { + /** + * Constructs a new buffer attribute. + * + * @param {TypedArray} array - The array holding the attribute data. + * @param {number} itemSize - The item size. + * @param {boolean} [normalized=false] - Whether the data are normalized or not. + */ + constructor(array: TypedArray, itemSize: number, normalized?: boolean); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isBufferAttribute: boolean; + /** + * The name of the buffer attribute. + * + * @type {string} + */ + name: string; + /** + * The array holding the attribute data. It should have `itemSize * numVertices` + * elements, where `numVertices` is the number of vertices in the associated geometry. + * + * @type {TypedArray} + */ + array: TypedArray; + /** + * The number of values of the array that should be associated with a particular vertex. + * For instance, if this attribute is storing a 3-component vector (such as a position, + * normal, or color), then the value should be `3`. + * + * @type {number} + */ + itemSize: number; + /** + * Represents the number of items this buffer attribute stores. It is internally computed + * by dividing the `array` length by the `itemSize`. + * + * @type {number} + * @readonly + */ + readonly count: number; + /** + * Applies to integer data only. Indicates how the underlying data in the buffer maps to + * the values in the GLSL code. For instance, if `array` is an instance of `UInt16Array`, + * and `normalized` is `true`, the values `0 - +65535` in the array data will be mapped to + * `0.0f - +1.0f` in the GLSL attribute. If `normalized` is `false`, the values will be converted + * to floats unmodified, i.e. `65535` becomes `65535.0f`. + * + * @type {boolean} + */ + normalized: boolean; + /** + * Defines the intended usage pattern of the data store for optimization purposes. + * + * Note: After the initial use of a buffer, its usage cannot be changed. Instead, + * instantiate a new one and set the desired usage before the next render. + * + * @type {(StaticDrawUsage|DynamicDrawUsage|StreamDrawUsage|StaticReadUsage|DynamicReadUsage|StreamReadUsage|StaticCopyUsage|DynamicCopyUsage|StreamCopyUsage)} + * @default StaticDrawUsage + */ + usage: (number | DynamicDrawUsage | StreamDrawUsage | StaticReadUsage | DynamicReadUsage | StreamReadUsage | StaticCopyUsage | DynamicCopyUsage | StreamCopyUsage); + /** + * This can be used to only update some components of stored vectors (for example, just the + * component related to color). Use the `addUpdateRange()` function to add ranges to this array. + * + * @type {Array} + */ + updateRanges: Array; + /** + * Configures the bound GPU type for use in shaders. + * + * Note: this only has an effect for integer arrays and is not configurable for float arrays. + * For lower precision float types, use `Float16BufferAttribute`. + * + * @type {(FloatType|IntType)} + * @default FloatType + */ + gpuType: (number | IntType); + /** + * A version number, incremented every time the `needsUpdate` is set to `true`. + * + * @type {number} + */ + version: number; + /** + * A callback function that is executed after the renderer has transferred the attribute + * array data to the GPU. + */ + onUploadCallback(): void; + /** + * Flag to indicate that this attribute has changed and should be re-sent to + * the GPU. Set this to `true` when you modify the value of the array. + * + * @type {number} + * @default false + * @param {boolean} value + */ + set needsUpdate(value: boolean); + /** + * Sets the usage of this buffer attribute. + * + * @param {(StaticDrawUsage|DynamicDrawUsage|StreamDrawUsage|StaticReadUsage|DynamicReadUsage|StreamReadUsage|StaticCopyUsage|DynamicCopyUsage|StreamCopyUsage)} value - The usage to set. + * @return {BufferAttribute} A reference to this buffer attribute. + */ + setUsage(value: (number | DynamicDrawUsage | StreamDrawUsage | StaticReadUsage | DynamicReadUsage | StreamReadUsage | StaticCopyUsage | DynamicCopyUsage | StreamCopyUsage)): BufferAttribute; + /** + * Adds a range of data in the data array to be updated on the GPU. + * + * @param {number} start - Position at which to start update. + * @param {number} count - The number of components to update. + */ + addUpdateRange(start: number, count: number): void; + /** + * Clears the update ranges. + */ + clearUpdateRanges(): void; + /** + * Copies the values of the given buffer attribute to this instance. + * + * @param {BufferAttribute} source - The buffer attribute to copy. + * @return {BufferAttribute} A reference to this instance. + */ + copy(source: BufferAttribute): BufferAttribute; + /** + * Copies a vector from the given buffer attribute to this one. The start + * and destination position in the attribute buffers are represented by the + * given indices. + * + * @param {number} index1 - The destination index into this buffer attribute. + * @param {BufferAttribute} attribute - The buffer attribute to copy from. + * @param {number} index2 - The source index into the given buffer attribute. + * @return {BufferAttribute} A reference to this instance. + */ + copyAt(index1: number, attribute: BufferAttribute, index2: number): BufferAttribute; + /** + * Copies the given array data into this buffer attribute. + * + * @param {(TypedArray|Array)} array - The array to copy. + * @return {BufferAttribute} A reference to this instance. + */ + copyArray(array: (TypedArray | any[])): BufferAttribute; + /** + * Applies the given 3x3 matrix to the given attribute. Works with + * item size `2` and `3`. + * + * @param {Matrix3} m - The matrix to apply. + * @return {BufferAttribute} A reference to this instance. + */ + applyMatrix3(m: Matrix3): BufferAttribute; + /** + * Applies the given 4x4 matrix to the given attribute. Only works with + * item size `3`. + * + * @param {Matrix4} m - The matrix to apply. + * @return {BufferAttribute} A reference to this instance. + */ + applyMatrix4(m: Matrix4): BufferAttribute; + /** + * Applies the given 3x3 normal matrix to the given attribute. Only works with + * item size `3`. + * + * @param {Matrix3} m - The normal matrix to apply. + * @return {BufferAttribute} A reference to this instance. + */ + applyNormalMatrix(m: Matrix3): BufferAttribute; + /** + * Applies the given 4x4 matrix to the given attribute. Only works with + * item size `3` and with direction vectors. + * + * @param {Matrix4} m - The matrix to apply. + * @return {BufferAttribute} A reference to this instance. + */ + transformDirection(m: Matrix4): BufferAttribute; + /** + * Sets the given array data in the buffer attribute. + * + * @param {(TypedArray|Array)} value - The array data to set. + * @param {number} [offset=0] - The offset in this buffer attribute's array. + * @return {BufferAttribute} A reference to this instance. + */ + set(value: (TypedArray | any[]), offset?: number): BufferAttribute; + /** + * Returns the given component of the vector at the given index. + * + * @param {number} index - The index into the buffer attribute. + * @param {number} component - The component index. + * @return {number} The returned value. + */ + getComponent(index: number, component: number): number; + /** + * Sets the given value to the given component of the vector at the given index. + * + * @param {number} index - The index into the buffer attribute. + * @param {number} component - The component index. + * @param {number} value - The value to set. + * @return {BufferAttribute} A reference to this instance. + */ + setComponent(index: number, component: number, value: number): BufferAttribute; + /** + * Returns the x component of the vector at the given index. + * + * @param {number} index - The index into the buffer attribute. + * @return {number} The x component. + */ + getX(index: number): number; + /** + * Sets the x component of the vector at the given index. + * + * @param {number} index - The index into the buffer attribute. + * @param {number} x - The value to set. + * @return {BufferAttribute} A reference to this instance. + */ + setX(index: number, x: number): BufferAttribute; + /** + * Returns the y component of the vector at the given index. + * + * @param {number} index - The index into the buffer attribute. + * @return {number} The y component. + */ + getY(index: number): number; + /** + * Sets the y component of the vector at the given index. + * + * @param {number} index - The index into the buffer attribute. + * @param {number} y - The value to set. + * @return {BufferAttribute} A reference to this instance. + */ + setY(index: number, y: number): BufferAttribute; + /** + * Returns the z component of the vector at the given index. + * + * @param {number} index - The index into the buffer attribute. + * @return {number} The z component. + */ + getZ(index: number): number; + /** + * Sets the z component of the vector at the given index. + * + * @param {number} index - The index into the buffer attribute. + * @param {number} z - The value to set. + * @return {BufferAttribute} A reference to this instance. + */ + setZ(index: number, z: number): BufferAttribute; + /** + * Returns the w component of the vector at the given index. + * + * @param {number} index - The index into the buffer attribute. + * @return {number} The w component. + */ + getW(index: number): number; + /** + * Sets the w component of the vector at the given index. + * + * @param {number} index - The index into the buffer attribute. + * @param {number} w - The value to set. + * @return {BufferAttribute} A reference to this instance. + */ + setW(index: number, w: number): BufferAttribute; + /** + * Sets the x and y component of the vector at the given index. + * + * @param {number} index - The index into the buffer attribute. + * @param {number} x - The value for the x component to set. + * @param {number} y - The value for the y component to set. + * @return {BufferAttribute} A reference to this instance. + */ + setXY(index: number, x: number, y: number): BufferAttribute; + /** + * Sets the x, y and z component of the vector at the given index. + * + * @param {number} index - The index into the buffer attribute. + * @param {number} x - The value for the x component to set. + * @param {number} y - The value for the y component to set. + * @param {number} z - The value for the z component to set. + * @return {BufferAttribute} A reference to this instance. + */ + setXYZ(index: number, x: number, y: number, z: number): BufferAttribute; + /** + * Sets the x, y, z and w component of the vector at the given index. + * + * @param {number} index - The index into the buffer attribute. + * @param {number} x - The value for the x component to set. + * @param {number} y - The value for the y component to set. + * @param {number} z - The value for the z component to set. + * @param {number} w - The value for the w component to set. + * @return {BufferAttribute} A reference to this instance. + */ + setXYZW(index: number, x: number, y: number, z: number, w: number): BufferAttribute; + /** + * Sets the given callback function that is executed after the Renderer has transferred + * the attribute array data to the GPU. Can be used to perform clean-up operations after + * the upload when attribute data are not needed anymore on the CPU side. + * + * @param {Function} callback - The `onUpload()` callback. + * @return {BufferAttribute} A reference to this instance. + */ + onUpload(callback: Function): BufferAttribute; + /** + * Returns a new buffer attribute with copied values from this instance. + * + * @return {BufferAttribute} A clone of this instance. + */ + clone(): BufferAttribute; + /** + * Serializes the buffer attribute into JSON. + * + * @return {Object} A JSON object representing the serialized buffer attribute. + */ + toJSON(): Object; +} diff --git a/jsdoc-testing/jsdoc/core/BufferGeometry.d.ts b/jsdoc-testing/jsdoc/core/BufferGeometry.d.ts new file mode 100644 index 000000000..82a3230ad --- /dev/null +++ b/jsdoc-testing/jsdoc/core/BufferGeometry.d.ts @@ -0,0 +1,391 @@ +/** + * A representation of mesh, line, or point geometry. Includes vertex + * positions, face indices, normals, colors, UVs, and custom attributes + * within buffers, reducing the cost of passing all this data to the GPU. + * + * ```js + * const geometry = new THREE.BufferGeometry(); + * // create a simple square shape. We duplicate the top left and bottom right + * // vertices because each vertex needs to appear once per triangle. + * const vertices = new Float32Array( [ + * -1.0, -1.0, 1.0, // v0 + * 1.0, -1.0, 1.0, // v1 + * 1.0, 1.0, 1.0, // v2 + * + * 1.0, 1.0, 1.0, // v3 + * -1.0, 1.0, 1.0, // v4 + * -1.0, -1.0, 1.0 // v5 + * ] ); + * // itemSize = 3 because there are 3 values (components) per vertex + * geometry.setAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) ); + * const material = new THREE.MeshBasicMaterial( { color: 0xff0000 } ); + * const mesh = new THREE.Mesh( geometry, material ); + * ``` + * + * @augments EventDispatcher + */ +export class BufferGeometry extends EventDispatcher { + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isBufferGeometry: boolean; + /** + * The UUID of the geometry. + * + * @type {string} + * @readonly + */ + readonly uuid: string; + /** + * The name of the geometry. + * + * @type {string} + */ + name: string; + type: string; + /** + * Allows for vertices to be re-used across multiple triangles; this is + * called using "indexed triangles". Each triangle is associated with the + * indices of three vertices. This attribute therefore stores the index of + * each vertex for each triangular face. If this attribute is not set, the + * renderer assumes that each three contiguous positions represent a single triangle. + * + * @type {?BufferAttribute} + * @default null + */ + index: BufferAttribute | null; + /** + * A (storage) buffer attribute which was generated with a compute shader and + * now defines indirect draw calls. + * + * Can only be used with {@link WebGPURenderer} and a WebGPU backend. + * + * @type {?BufferAttribute} + * @default null + */ + indirect: BufferAttribute | null; + /** + * The offset, in bytes, into the indirect drawing buffer where the value data begins. If an array is provided, multiple indirect draw calls will be made for each offset. + * + * Can only be used with {@link WebGPURenderer} and a WebGPU backend. + * + * @type {number|Array} + * @default 0 + */ + indirectOffset: number | Array; + /** + * This dictionary has as id the name of the attribute to be set and as value + * the buffer attribute to set it to. Rather than accessing this property directly, + * use `setAttribute()` and `getAttribute()` to access attributes of this geometry. + * + * @type {Object} + */ + attributes: { + [x: string]: any; + }; + /** + * This dictionary holds the morph targets of the geometry. + * + * Note: Once the geometry has been rendered, the morph attribute data cannot + * be changed. You will have to call `dispose()`, and create a new geometry instance. + * + * @type {Object} + */ + morphAttributes: Object; + /** + * Used to control the morph target behavior; when set to `true`, the morph + * target data is treated as relative offsets, rather than as absolute + * positions/normals. + * + * @type {boolean} + * @default false + */ + morphTargetsRelative: boolean; + /** + * Split the geometry into groups, each of which will be rendered in a + * separate draw call. This allows an array of materials to be used with the geometry. + * + * Use `addGroup()` and `clearGroups()` to edit groups, rather than modifying this array directly. + * + * Every vertex and index must belong to exactly one group — groups must not share vertices or + * indices, and must not leave vertices or indices unused. + * + * @type {Array} + */ + groups: Array; + /** + * Bounding box for the geometry which can be calculated with `computeBoundingBox()`. + * + * @type {?Box3} + * @default null + */ + boundingBox: Box3 | null; + /** + * Bounding sphere for the geometry which can be calculated with `computeBoundingSphere()`. + * + * @type {?Sphere} + * @default null + */ + boundingSphere: Sphere | null; + /** + * Determines the part of the geometry to render. This should not be set directly, + * instead use `setDrawRange()`. + * + * @type {{start:number,count:number}} + */ + drawRange: { + start: number; + count: number; + }; + /** + * An object that can be used to store custom data about the geometry. + * It should not hold references to functions as these will not be cloned. + * + * @type {Object} + */ + userData: Object; + /** + * Returns the index of this geometry. + * + * @return {?BufferAttribute} The index. Returns `null` if no index is defined. + */ + getIndex(): BufferAttribute | null; + /** + * Sets the given index to this geometry. + * + * @param {Array|BufferAttribute} index - The index to set. + * @return {BufferGeometry} A reference to this instance. + */ + setIndex(index: Array | BufferAttribute): BufferGeometry; + /** + * Sets the given indirect attribute to this geometry. + * + * @param {BufferAttribute} indirect - The attribute holding indirect draw calls. + * @param {number|Array} [indirectOffset=0] - The offset, in bytes, into the indirect drawing buffer where the value data begins. If an array is provided, multiple indirect draw calls will be made for each offset. + * @return {BufferGeometry} A reference to this instance. + */ + setIndirect(indirect: BufferAttribute, indirectOffset?: number | Array): BufferGeometry; + /** + * Returns the indirect attribute of this geometry. + * + * @return {?BufferAttribute} The indirect attribute. Returns `null` if no indirect attribute is defined. + */ + getIndirect(): BufferAttribute | null; + /** + * Returns the buffer attribute for the given name. + * + * @param {string} name - The attribute name. + * @return {BufferAttribute|InterleavedBufferAttribute|undefined} The buffer attribute. + * Returns `undefined` if not attribute has been found. + */ + getAttribute(name: string): BufferAttribute | InterleavedBufferAttribute | undefined; + /** + * Sets the given attribute for the given name. + * + * @param {string} name - The attribute name. + * @param {BufferAttribute|InterleavedBufferAttribute} attribute - The attribute to set. + * @return {BufferGeometry} A reference to this instance. + */ + setAttribute(name: string, attribute: BufferAttribute | InterleavedBufferAttribute): BufferGeometry; + /** + * Deletes the attribute for the given name. + * + * @param {string} name - The attribute name to delete. + * @return {BufferGeometry} A reference to this instance. + */ + deleteAttribute(name: string): BufferGeometry; + /** + * Returns `true` if this geometry has an attribute for the given name. + * + * @param {string} name - The attribute name. + * @return {boolean} Whether this geometry has an attribute for the given name or not. + */ + hasAttribute(name: string): boolean; + /** + * Adds a group to this geometry. + * + * @param {number} start - The first element in this draw call. That is the first + * vertex for non-indexed geometry, otherwise the first triangle index. + * @param {number} count - Specifies how many vertices (or indices) are part of this group. + * @param {number} [materialIndex=0] - The material array index to use. + */ + addGroup(start: number, count: number, materialIndex?: number): void; + /** + * Clears all groups. + */ + clearGroups(): void; + /** + * Sets the draw range for this geometry. + * + * @param {number} start - The first vertex for non-indexed geometry, otherwise the first triangle index. + * @param {number} count - For non-indexed BufferGeometry, `count` is the number of vertices to render. + * For indexed BufferGeometry, `count` is the number of indices to render. + */ + setDrawRange(start: number, count: number): void; + /** + * Applies the given 4x4 transformation matrix to the geometry. + * + * @param {Matrix4} matrix - The matrix to apply. + * @return {BufferGeometry} A reference to this instance. + */ + applyMatrix4(matrix: Matrix4): BufferGeometry; + /** + * Applies the rotation represented by the Quaternion to the geometry. + * + * @param {Quaternion} q - The Quaternion to apply. + * @return {BufferGeometry} A reference to this instance. + */ + applyQuaternion(q: Quaternion): BufferGeometry; + /** + * Rotates the geometry about the X axis. This is typically done as a one time + * operation, and not during a loop. Use {@link Object3D#rotation} for typical + * real-time mesh rotation. + * + * @param {number} angle - The angle in radians. + * @return {BufferGeometry} A reference to this instance. + */ + rotateX(angle: number): BufferGeometry; + /** + * Rotates the geometry about the Y axis. This is typically done as a one time + * operation, and not during a loop. Use {@link Object3D#rotation} for typical + * real-time mesh rotation. + * + * @param {number} angle - The angle in radians. + * @return {BufferGeometry} A reference to this instance. + */ + rotateY(angle: number): BufferGeometry; + /** + * Rotates the geometry about the Z axis. This is typically done as a one time + * operation, and not during a loop. Use {@link Object3D#rotation} for typical + * real-time mesh rotation. + * + * @param {number} angle - The angle in radians. + * @return {BufferGeometry} A reference to this instance. + */ + rotateZ(angle: number): BufferGeometry; + /** + * Translates the geometry. This is typically done as a one time + * operation, and not during a loop. Use {@link Object3D#position} for typical + * real-time mesh rotation. + * + * @param {number} x - The x offset. + * @param {number} y - The y offset. + * @param {number} z - The z offset. + * @return {BufferGeometry} A reference to this instance. + */ + translate(x: number, y: number, z: number): BufferGeometry; + /** + * Scales the geometry. This is typically done as a one time + * operation, and not during a loop. Use {@link Object3D#scale} for typical + * real-time mesh rotation. + * + * @param {number} x - The x scale. + * @param {number} y - The y scale. + * @param {number} z - The z scale. + * @return {BufferGeometry} A reference to this instance. + */ + scale(x: number, y: number, z: number): BufferGeometry; + /** + * Rotates the geometry to face a point in 3D space. This is typically done as a one time + * operation, and not during a loop. Use {@link Object3D#lookAt} for typical + * real-time mesh rotation. + * + * @param {Vector3} vector - The target point. + * @return {BufferGeometry} A reference to this instance. + */ + lookAt(vector: Vector3): BufferGeometry; + /** + * Center the geometry based on its bounding box. + * + * @return {BufferGeometry} A reference to this instance. + */ + center(): BufferGeometry; + /** + * Defines a geometry by creating a `position` attribute based on the given array of points. The array + * can hold 2D or 3D vectors. When using two-dimensional data, the `z` coordinate for all vertices is + * set to `0`. + * + * If the method is used with an existing `position` attribute, the vertex data are overwritten with the + * data from the array. The length of the array must match the vertex count. + * + * @param {Array|Array} points - The points. + * @return {BufferGeometry} A reference to this instance. + */ + setFromPoints(points: Array | Array): BufferGeometry; + /** + * Computes the bounding box of the geometry, and updates the `boundingBox` member. + * The bounding box is not computed by the engine; it must be computed by your app. + * You may need to recompute the bounding box if the geometry vertices are modified. + */ + computeBoundingBox(): void; + /** + * Computes the bounding sphere of the geometry, and updates the `boundingSphere` member. + * The engine automatically computes the bounding sphere when it is needed, e.g., for ray casting or view frustum culling. + * You may need to recompute the bounding sphere if the geometry vertices are modified. + */ + computeBoundingSphere(): void; + /** + * Calculates and adds a tangent attribute to this geometry. + * + * The computation is only supported for indexed geometries and if position, normal, and uv attributes + * are defined. When using a tangent space normal map, prefer the MikkTSpace algorithm provided by + * {@link BufferGeometryUtils#computeMikkTSpaceTangents} instead. + */ + computeTangents(): void; + /** + * Computes vertex normals for the given vertex data. For indexed geometries, the method sets + * each vertex normal to be the average of the face normals of the faces that share that vertex. + * For non-indexed geometries, vertices are not shared, and the method sets each vertex normal + * to be the same as the face normal. + */ + computeVertexNormals(): void; + /** + * Ensures every normal vector in a geometry will have a magnitude of `1`. This will + * correct lighting on the geometry surfaces. + */ + normalizeNormals(): void; + /** + * Return a new non-index version of this indexed geometry. If the geometry + * is already non-indexed, the method is a NOOP. + * + * @return {BufferGeometry} The non-indexed version of this indexed geometry. + */ + toNonIndexed(): BufferGeometry; + /** + * Serializes the geometry into JSON. + * + * @return {Object} A JSON object representing the serialized geometry. + */ + toJSON(): Object; + /** + * Returns a new geometry with copied values from this instance. + * + * @return {BufferGeometry} A clone of this instance. + */ + clone(): BufferGeometry; + /** + * Copies the values of the given geometry to this instance. + * + * @param {BufferGeometry} source - The geometry to copy. + * @return {BufferGeometry} A reference to this instance. + */ + copy(source: BufferGeometry): BufferGeometry; + /** + * Frees the GPU-related resources allocated by this instance. Call this + * method whenever this instance is no longer used in your app. + * + * @fires BufferGeometry#dispose + */ + dispose(): void; +} +import { EventDispatcher } from './EventDispatcher.js'; +import { BufferAttribute } from './BufferAttribute.js'; +import { Box3 } from '../math/Box3.js'; +import { Sphere } from '../math/Sphere.js'; +import { Matrix4 } from '../math/Matrix4.js'; +import { Vector3 } from '../math/Vector3.js'; +import { Vector2 } from '../math/Vector2.js'; diff --git a/jsdoc-testing/jsdoc/core/EventDispatcher.d.ts b/jsdoc-testing/jsdoc/core/EventDispatcher.d.ts new file mode 100644 index 000000000..b53482ecc --- /dev/null +++ b/jsdoc-testing/jsdoc/core/EventDispatcher.d.ts @@ -0,0 +1,53 @@ +/** + * This modules allows to dispatch event objects on custom JavaScript objects. + * + * Main repository: [eventdispatcher.js](https://github.com/mrdoob/eventdispatcher.js/) + * + * Code Example: + * ```js + * class Car extends EventDispatcher { + * start() { + * this.dispatchEvent( { type: 'start', message: 'vroom vroom!' } ); + * } + *}; + * + * // Using events with the custom object + * const car = new Car(); + * car.addEventListener( 'start', function ( event ) { + * alert( event.message ); + * } ); + * + * car.start(); + * ``` + */ +export class EventDispatcher { + /** + * Adds the given event listener to the given event type. + * + * @param {string} type - The type of event to listen to. + * @param {Function} listener - The function that gets called when the event is fired. + */ + addEventListener(type: string, listener: Function): void; + _listeners: {} | undefined; + /** + * Returns `true` if the given event listener has been added to the given event type. + * + * @param {string} type - The type of event. + * @param {Function} listener - The listener to check. + * @return {boolean} Whether the given event listener has been added to the given event type. + */ + hasEventListener(type: string, listener: Function): boolean; + /** + * Removes the given event listener from the given event type. + * + * @param {string} type - The type of event. + * @param {Function} listener - The listener to remove. + */ + removeEventListener(type: string, listener: Function): void; + /** + * Dispatches an event object. + * + * @param {Object} event - The event that gets fired. + */ + dispatchEvent(event: Object): void; +} diff --git a/jsdoc-testing/jsdoc/core/InstancedBufferAttribute.d.ts b/jsdoc-testing/jsdoc/core/InstancedBufferAttribute.d.ts new file mode 100644 index 000000000..aed6b3ff4 --- /dev/null +++ b/jsdoc-testing/jsdoc/core/InstancedBufferAttribute.d.ts @@ -0,0 +1,36 @@ +/** + * An instanced version of a buffer attribute. + * + * @augments BufferAttribute + */ +export class InstancedBufferAttribute extends BufferAttribute { + /** + * Constructs a new instanced buffer attribute. + * + * @param {TypedArray} array - The array holding the attribute data. + * @param {number} itemSize - The item size. + * @param {boolean} [normalized=false] - Whether the data are normalized or not. + * @param {number} [meshPerAttribute=1] - How often a value of this buffer attribute should be repeated. + */ + constructor(array: TypedArray, itemSize: number, normalized?: boolean, meshPerAttribute?: number); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isInstancedBufferAttribute: boolean; + /** + * Defines how often a value of this buffer attribute should be repeated. A + * value of one means that each value of the instanced attribute is used for + * a single instance. A value of two means that each value is used for two + * consecutive instances (and so on). + * + * @type {number} + * @default 1 + */ + meshPerAttribute: number; + copy(source: any): this; +} +import { BufferAttribute } from './BufferAttribute.js'; diff --git a/jsdoc-testing/jsdoc/core/InstancedInterleavedBuffer.d.ts b/jsdoc-testing/jsdoc/core/InstancedInterleavedBuffer.d.ts new file mode 100644 index 000000000..3f95ae1bb --- /dev/null +++ b/jsdoc-testing/jsdoc/core/InstancedInterleavedBuffer.d.ts @@ -0,0 +1,35 @@ +/** + * An instanced version of an interleaved buffer. + * + * @augments InterleavedBuffer + */ +export class InstancedInterleavedBuffer extends InterleavedBuffer { + /** + * Constructs a new instanced interleaved buffer. + * + * @param {TypedArray} array - A typed array with a shared buffer storing attribute data. + * @param {number} stride - The number of typed-array elements per vertex. + * @param {number} [meshPerAttribute=1] - Defines how often a value of this interleaved buffer should be repeated. + */ + constructor(array: TypedArray, stride: number, meshPerAttribute?: number); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isInstancedInterleavedBuffer: boolean; + /** + * Defines how often a value of this buffer attribute should be repeated, + * see {@link InstancedBufferAttribute#meshPerAttribute}. + * + * @type {number} + * @default 1 + */ + meshPerAttribute: number; + copy(source: any): this; + clone(data: any): InterleavedBuffer; + toJSON(data: any): Object; +} +import { InterleavedBuffer } from './InterleavedBuffer.js'; diff --git a/jsdoc-testing/jsdoc/core/InterleavedBuffer.d.ts b/jsdoc-testing/jsdoc/core/InterleavedBuffer.d.ts new file mode 100644 index 000000000..c6054ce83 --- /dev/null +++ b/jsdoc-testing/jsdoc/core/InterleavedBuffer.d.ts @@ -0,0 +1,153 @@ +/** + * "Interleaved" means that multiple attributes, possibly of different types, + * (e.g., position, normal, uv, color) are packed into a single array buffer. + * + * An introduction into interleaved arrays can be found here: [Interleaved array basics](https://blog.tojicode.com/2011/05/interleaved-array-basics.html) + */ +export class InterleavedBuffer { + /** + * Constructs a new interleaved buffer. + * + * @param {TypedArray} array - A typed array with a shared buffer storing attribute data. + * @param {number} stride - The number of typed-array elements per vertex. + */ + constructor(array: TypedArray, stride: number); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isInterleavedBuffer: boolean; + /** + * A typed array with a shared buffer storing attribute data. + * + * @type {TypedArray} + */ + array: TypedArray; + /** + * The number of typed-array elements per vertex. + * + * @type {number} + */ + stride: number; + /** + * The total number of elements in the array + * + * @type {number} + * @readonly + */ + readonly count: number; + /** + * Defines the intended usage pattern of the data store for optimization purposes. + * + * Note: After the initial use of a buffer, its usage cannot be changed. Instead, + * instantiate a new one and set the desired usage before the next render. + * + * @type {(StaticDrawUsage|DynamicDrawUsage|StreamDrawUsage|StaticReadUsage|DynamicReadUsage|StreamReadUsage|StaticCopyUsage|DynamicCopyUsage|StreamCopyUsage)} + * @default StaticDrawUsage + */ + usage: (number | DynamicDrawUsage | StreamDrawUsage | StaticReadUsage | DynamicReadUsage | StreamReadUsage | StaticCopyUsage | DynamicCopyUsage | StreamCopyUsage); + /** + * This can be used to only update some components of stored vectors (for example, just the + * component related to color). Use the `addUpdateRange()` function to add ranges to this array. + * + * @type {Array} + */ + updateRanges: Array; + /** + * A version number, incremented every time the `needsUpdate` is set to `true`. + * + * @type {number} + */ + version: number; + /** + * The UUID of the interleaved buffer. + * + * @type {string} + * @readonly + */ + readonly uuid: string; + /** + * A callback function that is executed after the renderer has transferred the attribute array + * data to the GPU. + */ + onUploadCallback(): void; + /** + * Flag to indicate that this attribute has changed and should be re-sent to + * the GPU. Set this to `true` when you modify the value of the array. + * + * @type {number} + * @default false + * @param {boolean} value + */ + set needsUpdate(value: boolean); + /** + * Sets the usage of this interleaved buffer. + * + * @param {(StaticDrawUsage|DynamicDrawUsage|StreamDrawUsage|StaticReadUsage|DynamicReadUsage|StreamReadUsage|StaticCopyUsage|DynamicCopyUsage|StreamCopyUsage)} value - The usage to set. + * @return {InterleavedBuffer} A reference to this interleaved buffer. + */ + setUsage(value: (number | DynamicDrawUsage | StreamDrawUsage | StaticReadUsage | DynamicReadUsage | StreamReadUsage | StaticCopyUsage | DynamicCopyUsage | StreamCopyUsage)): InterleavedBuffer; + /** + * Adds a range of data in the data array to be updated on the GPU. + * + * @param {number} start - Position at which to start update. + * @param {number} count - The number of components to update. + */ + addUpdateRange(start: number, count: number): void; + /** + * Clears the update ranges. + */ + clearUpdateRanges(): void; + /** + * Copies the values of the given interleaved buffer to this instance. + * + * @param {InterleavedBuffer} source - The interleaved buffer to copy. + * @return {InterleavedBuffer} A reference to this instance. + */ + copy(source: InterleavedBuffer): InterleavedBuffer; + /** + * Copies a vector from the given interleaved buffer to this one. The start + * and destination position in the attribute buffers are represented by the + * given indices. + * + * @param {number} index1 - The destination index into this interleaved buffer. + * @param {InterleavedBuffer} interleavedBuffer - The interleaved buffer to copy from. + * @param {number} index2 - The source index into the given interleaved buffer. + * @return {InterleavedBuffer} A reference to this instance. + */ + copyAt(index1: number, interleavedBuffer: InterleavedBuffer, index2: number): InterleavedBuffer; + /** + * Sets the given array data in the interleaved buffer. + * + * @param {(TypedArray|Array)} value - The array data to set. + * @param {number} [offset=0] - The offset in this interleaved buffer's array. + * @return {InterleavedBuffer} A reference to this instance. + */ + set(value: (TypedArray | any[]), offset?: number): InterleavedBuffer; + /** + * Returns a new interleaved buffer with copied values from this instance. + * + * @param {Object} [data] - An object with shared array buffers that allows to retain shared structures. + * @return {InterleavedBuffer} A clone of this instance. + */ + clone(data?: Object): InterleavedBuffer; + /** + * Sets the given callback function that is executed after the Renderer has transferred + * the array data to the GPU. Can be used to perform clean-up operations after + * the upload when data are not needed anymore on the CPU side. + * + * @param {Function} callback - The `onUpload()` callback. + * @return {InterleavedBuffer} A reference to this instance. + */ + onUpload(callback: Function): InterleavedBuffer; + /** + * Serializes the interleaved buffer into JSON. + * + * @param {Object} [data] - An optional value holding meta information about the serialization. + * @return {Object} A JSON object representing the serialized interleaved buffer. + */ + toJSON(data?: Object): Object; +} diff --git a/jsdoc-testing/jsdoc/core/InterleavedBufferAttribute.d.ts b/jsdoc-testing/jsdoc/core/InterleavedBufferAttribute.d.ts new file mode 100644 index 000000000..8fd60911e --- /dev/null +++ b/jsdoc-testing/jsdoc/core/InterleavedBufferAttribute.d.ts @@ -0,0 +1,226 @@ +/** + * An alternative version of a buffer attribute with interleaved data. Interleaved + * attributes share a common interleaved data storage ({@link InterleavedBuffer}) and refer with + * different offsets into the buffer. + */ +export class InterleavedBufferAttribute { + /** + * Constructs a new interleaved buffer attribute. + * + * @param {InterleavedBuffer} interleavedBuffer - The buffer holding the interleaved data. + * @param {number} itemSize - The item size. + * @param {number} offset - The attribute offset into the buffer. + * @param {boolean} [normalized=false] - Whether the data are normalized or not. + */ + constructor(interleavedBuffer: InterleavedBuffer, itemSize: number, offset: number, normalized?: boolean); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isInterleavedBufferAttribute: boolean; + /** + * The name of the buffer attribute. + * + * @type {string} + */ + name: string; + /** + * The buffer holding the interleaved data. + * + * @type {InterleavedBuffer} + */ + data: InterleavedBuffer; + /** + * The item size, see {@link BufferAttribute#itemSize}. + * + * @type {number} + */ + itemSize: number; + /** + * The attribute offset into the buffer. + * + * @type {number} + */ + offset: number; + /** + * Whether the data are normalized or not, see {@link BufferAttribute#normalized} + * + * @type {InterleavedBuffer} + */ + normalized: InterleavedBuffer; + /** + * The item count of this buffer attribute. + * + * @type {number} + * @readonly + */ + readonly get count(): number; + /** + * The array holding the interleaved buffer attribute data. + * + * @type {TypedArray} + */ + get array(): TypedArray; + /** + * Flag to indicate that this attribute has changed and should be re-sent to + * the GPU. Set this to `true` when you modify the value of the array. + * + * @type {number} + * @default false + * @param {boolean} value + */ + set needsUpdate(value: boolean); + /** + * Applies the given 4x4 matrix to the given attribute. Only works with + * item size `3`. + * + * @param {Matrix4} m - The matrix to apply. + * @return {InterleavedBufferAttribute} A reference to this instance. + */ + applyMatrix4(m: Matrix4): InterleavedBufferAttribute; + /** + * Applies the given 3x3 normal matrix to the given attribute. Only works with + * item size `3`. + * + * @param {Matrix3} m - The normal matrix to apply. + * @return {InterleavedBufferAttribute} A reference to this instance. + */ + applyNormalMatrix(m: Matrix3): InterleavedBufferAttribute; + /** + * Applies the given 4x4 matrix to the given attribute. Only works with + * item size `3` and with direction vectors. + * + * @param {Matrix4} m - The matrix to apply. + * @return {InterleavedBufferAttribute} A reference to this instance. + */ + transformDirection(m: Matrix4): InterleavedBufferAttribute; + /** + * Returns the given component of the vector at the given index. + * + * @param {number} index - The index into the buffer attribute. + * @param {number} component - The component index. + * @return {number} The returned value. + */ + getComponent(index: number, component: number): number; + /** + * Sets the given value to the given component of the vector at the given index. + * + * @param {number} index - The index into the buffer attribute. + * @param {number} component - The component index. + * @param {number} value - The value to set. + * @return {InterleavedBufferAttribute} A reference to this instance. + */ + setComponent(index: number, component: number, value: number): InterleavedBufferAttribute; + /** + * Sets the x component of the vector at the given index. + * + * @param {number} index - The index into the buffer attribute. + * @param {number} x - The value to set. + * @return {InterleavedBufferAttribute} A reference to this instance. + */ + setX(index: number, x: number): InterleavedBufferAttribute; + /** + * Sets the y component of the vector at the given index. + * + * @param {number} index - The index into the buffer attribute. + * @param {number} y - The value to set. + * @return {InterleavedBufferAttribute} A reference to this instance. + */ + setY(index: number, y: number): InterleavedBufferAttribute; + /** + * Sets the z component of the vector at the given index. + * + * @param {number} index - The index into the buffer attribute. + * @param {number} z - The value to set. + * @return {InterleavedBufferAttribute} A reference to this instance. + */ + setZ(index: number, z: number): InterleavedBufferAttribute; + /** + * Sets the w component of the vector at the given index. + * + * @param {number} index - The index into the buffer attribute. + * @param {number} w - The value to set. + * @return {InterleavedBufferAttribute} A reference to this instance. + */ + setW(index: number, w: number): InterleavedBufferAttribute; + /** + * Returns the x component of the vector at the given index. + * + * @param {number} index - The index into the buffer attribute. + * @return {number} The x component. + */ + getX(index: number): number; + /** + * Returns the y component of the vector at the given index. + * + * @param {number} index - The index into the buffer attribute. + * @return {number} The y component. + */ + getY(index: number): number; + /** + * Returns the z component of the vector at the given index. + * + * @param {number} index - The index into the buffer attribute. + * @return {number} The z component. + */ + getZ(index: number): number; + /** + * Returns the w component of the vector at the given index. + * + * @param {number} index - The index into the buffer attribute. + * @return {number} The w component. + */ + getW(index: number): number; + /** + * Sets the x and y component of the vector at the given index. + * + * @param {number} index - The index into the buffer attribute. + * @param {number} x - The value for the x component to set. + * @param {number} y - The value for the y component to set. + * @return {InterleavedBufferAttribute} A reference to this instance. + */ + setXY(index: number, x: number, y: number): InterleavedBufferAttribute; + /** + * Sets the x, y and z component of the vector at the given index. + * + * @param {number} index - The index into the buffer attribute. + * @param {number} x - The value for the x component to set. + * @param {number} y - The value for the y component to set. + * @param {number} z - The value for the z component to set. + * @return {InterleavedBufferAttribute} A reference to this instance. + */ + setXYZ(index: number, x: number, y: number, z: number): InterleavedBufferAttribute; + /** + * Sets the x, y, z and w component of the vector at the given index. + * + * @param {number} index - The index into the buffer attribute. + * @param {number} x - The value for the x component to set. + * @param {number} y - The value for the y component to set. + * @param {number} z - The value for the z component to set. + * @param {number} w - The value for the w component to set. + * @return {InterleavedBufferAttribute} A reference to this instance. + */ + setXYZW(index: number, x: number, y: number, z: number, w: number): InterleavedBufferAttribute; + /** + * Returns a new buffer attribute with copied values from this instance. + * + * If no parameter is provided, cloning an interleaved buffer attribute will de-interleave buffer data. + * + * @param {Object} [data] - An object with interleaved buffers that allows to retain the interleaved property. + * @return {BufferAttribute|InterleavedBufferAttribute} A clone of this instance. + */ + clone(data?: Object): BufferAttribute | InterleavedBufferAttribute; + /** + * Serializes the buffer attribute into JSON. + * + * If no parameter is provided, cloning an interleaved buffer attribute will de-interleave buffer data. + * + * @param {Object} [data] - An optional value holding meta information about the serialization. + * @return {Object} A JSON object representing the serialized buffer attribute. + */ + toJSON(data?: Object): Object; +} +import { BufferAttribute } from './BufferAttribute.js'; diff --git a/jsdoc-testing/jsdoc/core/Layers.d.ts b/jsdoc-testing/jsdoc/core/Layers.d.ts new file mode 100644 index 000000000..34b3c6175 --- /dev/null +++ b/jsdoc-testing/jsdoc/core/Layers.d.ts @@ -0,0 +1,68 @@ +/** + * A layers object assigns an 3D object to 1 or more of 32 + * layers numbered `0` to `31` - internally the layers are stored as a + * bit mask], and by default all 3D objects are a member of layer `0`. + * + * This can be used to control visibility - an object must share a layer with + * a camera to be visible when that camera's view is + * rendered. + * + * All classes that inherit from {@link Object3D} have an `layers` property which + * is an instance of this class. + */ +export class Layers { + /** + * A bit mask storing which of the 32 layers this layers object is currently + * a member of. + * + * @type {number} + */ + mask: number; + /** + * Sets membership to the given layer, and remove membership all other layers. + * + * @param {number} layer - The layer to set. + */ + set(layer: number): void; + /** + * Adds membership of the given layer. + * + * @param {number} layer - The layer to enable. + */ + enable(layer: number): void; + /** + * Adds membership to all layers. + */ + enableAll(): void; + /** + * Toggles the membership of the given layer. + * + * @param {number} layer - The layer to toggle. + */ + toggle(layer: number): void; + /** + * Removes membership of the given layer. + * + * @param {number} layer - The layer to enable. + */ + disable(layer: number): void; + /** + * Removes the membership from all layers. + */ + disableAll(): void; + /** + * Returns `true` if this and the given layers object have at least one + * layer in common. + * + * @param {Layers} layers - The layers to test. + * @return {boolean } Whether this and the given layers object have at least one layer in common or not. + */ + test(layers: Layers): boolean; + /** + * Returns `true` if the given layer is enabled. + * + * @param {number} layer - The layer to test. + * @return {boolean } Whether the given layer is enabled or not. + */ + isEnabled(layer: number): boolean; +} diff --git a/jsdoc-testing/jsdoc/core/Object3D.d.ts b/jsdoc-testing/jsdoc/core/Object3D.d.ts new file mode 100644 index 000000000..b6e8715c8 --- /dev/null +++ b/jsdoc-testing/jsdoc/core/Object3D.d.ts @@ -0,0 +1,584 @@ +/** + * This is the base class for most objects in three.js and provides a set of + * properties and methods for manipulating objects in 3D space. + * + * @augments EventDispatcher + */ +export class Object3D extends EventDispatcher { + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isObject3D: boolean; + /** + * The UUID of the 3D object. + * + * @type {string} + * @readonly + */ + readonly uuid: string; + /** + * The name of the 3D object. + * + * @type {string} + */ + name: string; + /** + * The type property is used for detecting the object type + * in context of serialization/deserialization. + * + * @type {string} + * @readonly + */ + readonly type: string; + /** + * A reference to the parent object. + * + * @type {?Object3D} + * @default null + */ + parent: Object3D | null; + /** + * An array holding the child 3D objects of this instance. + * + * @type {Array} + */ + children: Array; + /** + * Defines the `up` direction of the 3D object which influences + * the orientation via methods like {@link Object3D#lookAt}. + * + * The default values for all 3D objects is defined by `Object3D.DEFAULT_UP`. + * + * @type {Vector3} + */ + up: Vector3; + /** + * Represents the object's transformation matrix in local space. + * + * @type {Matrix4} + */ + matrix: Matrix4; + /** + * Represents the object's transformation matrix in world space. + * If the 3D object has no parent, then it's identical to the local transformation matrix + * + * @type {Matrix4} + */ + matrixWorld: Matrix4; + /** + * When set to `true`, the engine automatically computes the local matrix from position, + * rotation and scale every frame. If set to `false`, the app is responsible for recomputing + * the local matrix by calling `updateMatrix()`. + * + * The default values for all 3D objects is defined by `Object3D.DEFAULT_MATRIX_AUTO_UPDATE`. + * + * @type {boolean} + * @default true + */ + matrixAutoUpdate: boolean; + /** + * When set to `true`, the engine automatically computes the world matrix from the current local + * matrix and the object's transformation hierarchy. If set to `false`, the app is responsible for + * recomputing the world matrix by directly updating the `matrixWorld` property. + * + * The default values for all 3D objects is defined by `Object3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE`. + * + * @type {boolean} + * @default true + */ + matrixWorldAutoUpdate: boolean; + /** + * When set to `true`, it calculates the world matrix in that frame and resets this property + * to `false`. + * + * @type {boolean} + * @default false + */ + matrixWorldNeedsUpdate: boolean; + /** + * The layer membership of the 3D object. The 3D object is only visible if it has + * at least one layer in common with the camera in use. This property can also be + * used to filter out unwanted objects in ray-intersection tests when using {@link Raycaster}. + * + * @type {Layers} + */ + layers: Layers; + /** + * When set to `true`, the 3D object gets rendered. + * + * @type {boolean} + * @default true + */ + visible: boolean; + /** + * When set to `true`, the 3D object gets rendered into shadow maps. + * + * @type {boolean} + * @default false + */ + castShadow: boolean; + /** + * When set to `true`, the 3D object is affected by shadows in the scene. + * + * @type {boolean} + * @default false + */ + receiveShadow: boolean; + /** + * When set to `true`, the 3D object is honored by view frustum culling. + * + * @type {boolean} + * @default true + */ + frustumCulled: boolean; + /** + * This value allows the default rendering order of scene graph objects to be + * overridden although opaque and transparent objects remain sorted independently. + * When this property is set for an instance of {@link Group},all descendants + * objects will be sorted and rendered together. Sorting is from lowest to highest + * render order. + * + * @type {number} + * @default 0 + */ + renderOrder: number; + /** + * An array holding the animation clips of the 3D object. + * + * @type {Array} + */ + animations: Array; + /** + * Custom depth material to be used when rendering to the depth map. Can only be used + * in context of meshes. When shadow-casting with a {@link DirectionalLight} or {@link SpotLight}, + * if you are modifying vertex positions in the vertex shader you must specify a custom depth + * material for proper shadows. + * + * Only relevant in context of {@link WebGLRenderer}. + * + * @type {(Material|undefined)} + * @default undefined + */ + customDepthMaterial: (Material | undefined); + /** + * Same as {@link Object3D#customDepthMaterial}, but used with {@link PointLight}. + * + * Only relevant in context of {@link WebGLRenderer}. + * + * @type {(Material|undefined)} + * @default undefined + */ + customDistanceMaterial: (Material | undefined); + /** + * Whether the 3D object is supposed to be static or not. If set to `true`, it means + * the 3D object is not going to be changed after the initial renderer. This includes + * geometry and material settings. A static 3D object can be processed by the renderer + * slightly faster since certain state checks can be bypassed. + * + * Only relevant in context of {@link WebGPURenderer}. + * + * @type {boolean} + * @default false + */ + static: boolean; + /** + * An object that can be used to store custom data about the 3D object. It + * should not hold references to functions as these will not be cloned. + * + * @type {Object} + */ + userData: Object; + /** + * The pivot point for rotation and scale transformations. + * When set, rotation and scale are applied around this point + * instead of the object's origin. + * + * @type {?Vector3} + * @default null + */ + pivot: Vector3 | null; + /** + * A callback that is executed immediately before a 3D object is rendered to a shadow map. + * + * @param {Renderer|WebGLRenderer} renderer - The renderer. + * @param {Object3D} object - The 3D object. + * @param {Camera} camera - The camera that is used to render the scene. + * @param {Camera} shadowCamera - The shadow camera. + * @param {BufferGeometry} geometry - The 3D object's geometry. + * @param {Material} depthMaterial - The depth material. + * @param {Object} group - The geometry group data. + */ + onBeforeShadow(): void; + /** + * A callback that is executed immediately after a 3D object is rendered to a shadow map. + * + * @param {Renderer|WebGLRenderer} renderer - The renderer. + * @param {Object3D} object - The 3D object. + * @param {Camera} camera - The camera that is used to render the scene. + * @param {Camera} shadowCamera - The shadow camera. + * @param {BufferGeometry} geometry - The 3D object's geometry. + * @param {Material} depthMaterial - The depth material. + * @param {Object} group - The geometry group data. + */ + onAfterShadow(): void; + /** + * A callback that is executed immediately before a 3D object is rendered. + * + * @param {Renderer|WebGLRenderer} renderer - The renderer. + * @param {Object3D} object - The 3D object. + * @param {Camera} camera - The camera that is used to render the scene. + * @param {BufferGeometry} geometry - The 3D object's geometry. + * @param {Material} material - The 3D object's material. + * @param {Object} group - The geometry group data. + */ + onBeforeRender(): void; + /** + * A callback that is executed immediately after a 3D object is rendered. + * + * @param {Renderer|WebGLRenderer} renderer - The renderer. + * @param {Object3D} object - The 3D object. + * @param {Camera} camera - The camera that is used to render the scene. + * @param {BufferGeometry} geometry - The 3D object's geometry. + * @param {Material} material - The 3D object's material. + * @param {Object} group - The geometry group data. + */ + onAfterRender(): void; + /** + * Applies the given transformation matrix to the object and updates the object's position, + * rotation and scale. + * + * @param {Matrix4} matrix - The transformation matrix. + */ + applyMatrix4(matrix: Matrix4): void; + /** + * Applies a rotation represented by given the quaternion to the 3D object. + * + * @param {Quaternion} q - The quaternion. + * @return {Object3D} A reference to this instance. + */ + applyQuaternion(q: Quaternion): Object3D; + /** + * Sets the given rotation represented as an axis/angle couple to the 3D object. + * + * @param {Vector3} axis - The (normalized) axis vector. + * @param {number} angle - The angle in radians. + */ + setRotationFromAxisAngle(axis: Vector3, angle: number): void; + /** + * Sets the given rotation represented as Euler angles to the 3D object. + * + * @param {Euler} euler - The Euler angles. + */ + setRotationFromEuler(euler: Euler): void; + /** + * Sets the given rotation represented as rotation matrix to the 3D object. + * + * @param {Matrix4} m - Although a 4x4 matrix is expected, the upper 3x3 portion must be + * a pure rotation matrix (i.e, unscaled). + */ + setRotationFromMatrix(m: Matrix4): void; + /** + * Sets the given rotation represented as a Quaternion to the 3D object. + * + * @param {Quaternion} q - The Quaternion + */ + setRotationFromQuaternion(q: Quaternion): void; + /** + * Rotates the 3D object along an axis in local space. + * + * @param {Vector3} axis - The (normalized) axis vector. + * @param {number} angle - The angle in radians. + * @return {Object3D} A reference to this instance. + */ + rotateOnAxis(axis: Vector3, angle: number): Object3D; + /** + * Rotates the 3D object along an axis in world space. + * + * @param {Vector3} axis - The (normalized) axis vector. + * @param {number} angle - The angle in radians. + * @return {Object3D} A reference to this instance. + */ + rotateOnWorldAxis(axis: Vector3, angle: number): Object3D; + /** + * Rotates the 3D object around its X axis in local space. + * + * @param {number} angle - The angle in radians. + * @return {Object3D} A reference to this instance. + */ + rotateX(angle: number): Object3D; + /** + * Rotates the 3D object around its Y axis in local space. + * + * @param {number} angle - The angle in radians. + * @return {Object3D} A reference to this instance. + */ + rotateY(angle: number): Object3D; + /** + * Rotates the 3D object around its Z axis in local space. + * + * @param {number} angle - The angle in radians. + * @return {Object3D} A reference to this instance. + */ + rotateZ(angle: number): Object3D; + /** + * Translate the 3D object by a distance along the given axis in local space. + * + * @param {Vector3} axis - The (normalized) axis vector. + * @param {number} distance - The distance in world units. + * @return {Object3D} A reference to this instance. + */ + translateOnAxis(axis: Vector3, distance: number): Object3D; + /** + * Translate the 3D object by a distance along its X-axis in local space. + * + * @param {number} distance - The distance in world units. + * @return {Object3D} A reference to this instance. + */ + translateX(distance: number): Object3D; + /** + * Translate the 3D object by a distance along its Y-axis in local space. + * + * @param {number} distance - The distance in world units. + * @return {Object3D} A reference to this instance. + */ + translateY(distance: number): Object3D; + /** + * Translate the 3D object by a distance along its Z-axis in local space. + * + * @param {number} distance - The distance in world units. + * @return {Object3D} A reference to this instance. + */ + translateZ(distance: number): Object3D; + /** + * Converts the given vector from this 3D object's local space to world space. + * + * @param {Vector3} vector - The vector to convert. + * @return {Vector3} The converted vector. + */ + localToWorld(vector: Vector3): Vector3; + /** + * Converts the given vector from this 3D object's world space to local space. + * + * @param {Vector3} vector - The vector to convert. + * @return {Vector3} The converted vector. + */ + worldToLocal(vector: Vector3): Vector3; + /** + * Rotates the object to face a point in world space. + * + * This method does not support objects having non-uniformly-scaled parent(s). + * + * @param {number|Vector3} x - The x coordinate in world space. Alternatively, a vector representing a position in world space + * @param {number} [y] - The y coordinate in world space. + * @param {number} [z] - The z coordinate in world space. + */ + lookAt(x: number | Vector3, y?: number, z?: number): void; + /** + * Adds the given 3D object as a child to this 3D object. An arbitrary number of + * objects may be added. Any current parent on an object passed in here will be + * removed, since an object can have at most one parent. + * + * @fires Object3D#added + * @fires Object3D#childadded + * @param {Object3D} object - The 3D object to add. + * @return {Object3D} A reference to this instance. + */ + add(object: Object3D, ...args: any[]): Object3D; + /** + * Removes the given 3D object as child from this 3D object. + * An arbitrary number of objects may be removed. + * + * @fires Object3D#removed + * @fires Object3D#childremoved + * @param {Object3D} object - The 3D object to remove. + * @return {Object3D} A reference to this instance. + */ + remove(object: Object3D, ...args: any[]): Object3D; + /** + * Removes this 3D object from its current parent. + * + * @fires Object3D#removed + * @fires Object3D#childremoved + * @return {Object3D} A reference to this instance. + */ + removeFromParent(): Object3D; + /** + * Removes all child objects. + * + * @fires Object3D#removed + * @fires Object3D#childremoved + * @return {Object3D} A reference to this instance. + */ + clear(): Object3D; + /** + * Adds the given 3D object as a child of this 3D object, while maintaining the object's world + * transform. This method does not support scene graphs having non-uniformly-scaled nodes(s). + * + * @fires Object3D#added + * @fires Object3D#childadded + * @param {Object3D} object - The 3D object to attach. + * @return {Object3D} A reference to this instance. + */ + attach(object: Object3D): Object3D; + /** + * Searches through the 3D object and its children, starting with the 3D object + * itself, and returns the first with a matching ID. + * + * @param {number} id - The id. + * @return {Object3D|undefined} The found 3D object. Returns `undefined` if no 3D object has been found. + */ + getObjectById(id: number): Object3D | undefined; + /** + * Searches through the 3D object and its children, starting with the 3D object + * itself, and returns the first with a matching name. + * + * @param {string} name - The name. + * @return {Object3D|undefined} The found 3D object. Returns `undefined` if no 3D object has been found. + */ + getObjectByName(name: string): Object3D | undefined; + /** + * Searches through the 3D object and its children, starting with the 3D object + * itself, and returns the first with a matching property value. + * + * @param {string} name - The name of the property. + * @param {any} value - The value. + * @return {Object3D|undefined} The found 3D object. Returns `undefined` if no 3D object has been found. + */ + getObjectByProperty(name: string, value: any): Object3D | undefined; + /** + * Searches through the 3D object and its children, starting with the 3D object + * itself, and returns all 3D objects with a matching property value. + * + * @param {string} name - The name of the property. + * @param {any} value - The value. + * @param {Array} result - The method stores the result in this array. + * @return {Array} The found 3D objects. + */ + getObjectsByProperty(name: string, value: any, result?: Array): Array; + /** + * Returns a vector representing the position of the 3D object in world space. + * + * @param {Vector3} target - The target vector the result is stored to. + * @return {Vector3} The 3D object's position in world space. + */ + getWorldPosition(target: Vector3): Vector3; + /** + * Returns a Quaternion representing the position of the 3D object in world space. + * + * @param {Quaternion} target - The target Quaternion the result is stored to. + * @return {Quaternion} The 3D object's rotation in world space. + */ + getWorldQuaternion(target: Quaternion): Quaternion; + /** + * Returns a vector representing the scale of the 3D object in world space. + * + * @param {Vector3} target - The target vector the result is stored to. + * @return {Vector3} The 3D object's scale in world space. + */ + getWorldScale(target: Vector3): Vector3; + /** + * Returns a vector representing the ("look") direction of the 3D object in world space. + * + * @param {Vector3} target - The target vector the result is stored to. + * @return {Vector3} The 3D object's direction in world space. + */ + getWorldDirection(target: Vector3): Vector3; + /** + * Abstract method to get intersections between a casted ray and this + * 3D object. Renderable 3D objects such as {@link Mesh}, {@link Line} or {@link Points} + * implement this method in order to use raycasting. + * + * @abstract + * @param {Raycaster} raycaster - The raycaster. + * @param {Array} intersects - An array holding the result of the method. + */ + raycast(): void; + /** + * Executes the callback on this 3D object and all descendants. + * + * Note: Modifying the scene graph inside the callback is discouraged. + * + * @param {Function} callback - A callback function that allows to process the current 3D object. + */ + traverse(callback: Function): void; + /** + * Like {@link Object3D#traverse}, but the callback will only be executed for visible 3D objects. + * Descendants of invisible 3D objects are not traversed. + * + * Note: Modifying the scene graph inside the callback is discouraged. + * + * @param {Function} callback - A callback function that allows to process the current 3D object. + */ + traverseVisible(callback: Function): void; + /** + * Like {@link Object3D#traverse}, but the callback will only be executed for all ancestors. + * + * Note: Modifying the scene graph inside the callback is discouraged. + * + * @param {Function} callback - A callback function that allows to process the current 3D object. + */ + traverseAncestors(callback: Function): void; + /** + * Updates the transformation matrix in local space by computing it from the current + * position, rotation and scale values. + */ + updateMatrix(): void; + /** + * Updates the transformation matrix in world space of this 3D objects and its descendants. + * + * To ensure correct results, this method also recomputes the 3D object's transformation matrix in + * local space. The computation of the local and world matrix can be controlled with the + * {@link Object3D#matrixAutoUpdate} and {@link Object3D#matrixWorldAutoUpdate} flags which are both + * `true` by default. Set these flags to `false` if you need more control over the update matrix process. + * + * @param {boolean} [force=false] - When set to `true`, a recomputation of world matrices is forced even + * when {@link Object3D#matrixWorldNeedsUpdate} is `false`. + */ + updateMatrixWorld(force?: boolean): void; + /** + * An alternative version of {@link Object3D#updateMatrixWorld} with more control over the + * update of ancestor and descendant nodes. + * + * @param {boolean} [updateParents=false] Whether ancestor nodes should be updated or not. + * @param {boolean} [updateChildren=false] Whether descendant nodes should be updated or not. + */ + updateWorldMatrix(updateParents?: boolean, updateChildren?: boolean): void; + /** + * Serializes the 3D object into JSON. + * + * @param {?(Object|string)} meta - An optional value holding meta information about the serialization. + * @return {Object} A JSON object representing the serialized 3D object. + * @see {@link ObjectLoader#parse} + */ + toJSON(meta: (Object | string) | null): Object; + /** + * Returns a new 3D object with copied values from this instance. + * + * @param {boolean} [recursive=true] - When set to `true`, descendants of the 3D object are also cloned. + * @return {Object3D} A clone of this instance. + */ + clone(recursive?: boolean): Object3D; + /** + * Copies the values of the given 3D object to this instance. + * + * @param {Object3D} source - The 3D object to copy. + * @param {boolean} [recursive=true] - When set to `true`, descendants of the 3D object are cloned. + * @return {Object3D} A reference to this instance. + */ + copy(source: Object3D, recursive?: boolean): Object3D; +} +export namespace Object3D { + let DEFAULT_UP: Vector3; + let DEFAULT_MATRIX_AUTO_UPDATE: boolean; + let DEFAULT_MATRIX_WORLD_AUTO_UPDATE: boolean; +} +import { EventDispatcher } from './EventDispatcher.js'; +import { Vector3 } from '../math/Vector3.js'; +import { Matrix4 } from '../math/Matrix4.js'; +import { Layers } from './Layers.js'; +import { Quaternion } from '../math/Quaternion.js'; +import { Euler } from '../math/Euler.js'; diff --git a/jsdoc-testing/jsdoc/core/RenderTarget.d.ts b/jsdoc-testing/jsdoc/core/RenderTarget.d.ts new file mode 100644 index 000000000..d610b86f8 --- /dev/null +++ b/jsdoc-testing/jsdoc/core/RenderTarget.d.ts @@ -0,0 +1,197 @@ +/** + * A render target is a buffer where the video card draws pixels for a scene + * that is being rendered in the background. It is used in different effects, + * such as applying postprocessing to a rendered image before displaying it + * on the screen. + * + * @augments EventDispatcher + */ +export class RenderTarget extends EventDispatcher { + /** + * Render target options. + * + * @typedef {Object} RenderTarget~Options + * @property {boolean} [generateMipmaps=false] - Whether to generate mipmaps or not. + * @property {number} [magFilter=LinearFilter] - The mag filter. + * @property {number} [minFilter=LinearFilter] - The min filter. + * @property {number} [format=RGBAFormat] - The texture format. + * @property {number} [type=UnsignedByteType] - The texture type. + * @property {?string} [internalFormat=null] - The texture's internal format. + * @property {number} [wrapS=ClampToEdgeWrapping] - The texture's uv wrapping mode. + * @property {number} [wrapT=ClampToEdgeWrapping] - The texture's uv wrapping mode. + * @property {number} [anisotropy=1] - The texture's anisotropy value. + * @property {string} [colorSpace=NoColorSpace] - The texture's color space. + * @property {boolean} [depthBuffer=true] - Whether to allocate a depth buffer or not. + * @property {boolean} [stencilBuffer=false] - Whether to allocate a stencil buffer or not. + * @property {boolean} [resolveDepthBuffer=true] - Whether to resolve the depth buffer or not. + * @property {boolean} [resolveStencilBuffer=true] - Whether to resolve the stencil buffer or not. + * @property {?Texture} [depthTexture=null] - Reference to a depth texture. + * @property {number} [samples=0] - The MSAA samples count. + * @property {number} [count=1] - Defines the number of color attachments . Must be at least `1`. + * @property {number} [depth=1] - The texture depth. + * @property {boolean} [multiview=false] - Whether this target is used for multiview rendering. + */ + /** + * Constructs a new render target. + * + * @param {number} [width=1] - The width of the render target. + * @param {number} [height=1] - The height of the render target. + * @param {RenderTarget~Options} [options] - The configuration object. + */ + constructor(width?: number, height?: number, options?: {}); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isRenderTarget: boolean; + /** + * The width of the render target. + * + * @type {number} + * @default 1 + */ + width: number; + /** + * The height of the render target. + * + * @type {number} + * @default 1 + */ + height: number; + /** + * The depth of the render target. + * + * @type {number} + * @default 1 + */ + depth: number; + /** + * A rectangular area inside the render target's viewport. Fragments that are + * outside the area will be discarded. + * + * @type {Vector4} + * @default (0,0,width,height) + */ + scissor: Vector4; + /** + * Indicates whether the scissor test should be enabled when rendering into + * this render target or not. + * + * @type {boolean} + * @default false + */ + scissorTest: boolean; + /** + * A rectangular area representing the render target's viewport. + * + * @type {Vector4} + * @default (0,0,width,height) + */ + viewport: Vector4; + /** + * An array of textures. Each color attachment is represented as a separate texture. + * Has at least a single entry for the default color attachment. + * + * @type {Array} + */ + textures: Array; + /** + * Whether to allocate a depth buffer or not. + * + * @type {boolean} + * @default true + */ + depthBuffer: boolean; + /** + * Whether to allocate a stencil buffer or not. + * + * @type {boolean} + * @default false + */ + stencilBuffer: boolean; + /** + * Whether to resolve the depth buffer or not. + * + * @type {boolean} + * @default true + */ + resolveDepthBuffer: boolean; + /** + * Whether to resolve the stencil buffer or not. + * + * @type {boolean} + * @default true + */ + resolveStencilBuffer: boolean; + _depthTexture: any; + set depthTexture(current: DepthTexture | null); + /** + * Instead of saving the depth in a renderbuffer, a texture + * can be used instead which is useful for further processing + * e.g. in context of post-processing. + * + * @type {?DepthTexture} + * @default null + */ + get depthTexture(): DepthTexture | null; + /** + * The number of MSAA samples. + * + * A value of `0` disables MSAA. + * + * @type {number} + * @default 0 + */ + samples: number; + /** + * Whether to this target is used in multiview rendering. + * + * @type {boolean} + * @default false + */ + multiview: boolean; + _setTextureOptions(options?: {}): void; + set texture(value: Texture); + /** + * The texture representing the default color attachment. + * + * @type {Texture} + */ + get texture(): Texture; + /** + * Sets the size of this render target. + * + * @param {number} width - The width. + * @param {number} height - The height. + * @param {number} [depth=1] - The depth. + */ + setSize(width: number, height: number, depth?: number): void; + /** + * Returns a new render target with copied values from this instance. + * + * @return {RenderTarget} A clone of this instance. + */ + clone(): RenderTarget; + /** + * Copies the settings of the given render target. This is a structural copy so + * no resources are shared between render targets after the copy. That includes + * all MRT textures and the depth texture. + * + * @param {RenderTarget} source - The render target to copy. + * @return {RenderTarget} A reference to this instance. + */ + copy(source: RenderTarget): RenderTarget; + /** + * Frees the GPU-related resources allocated by this instance. Call this + * method whenever this instance is no longer used in your app. + * + * @fires RenderTarget#dispose + */ + dispose(): void; +} +import { EventDispatcher } from './EventDispatcher.js'; +import { Vector4 } from '../math/Vector4.js'; +import { Texture } from '../textures/Texture.js'; diff --git a/jsdoc-testing/jsdoc/core/Timer.d.ts b/jsdoc-testing/jsdoc/core/Timer.d.ts new file mode 100644 index 000000000..d47c2d4bd --- /dev/null +++ b/jsdoc-testing/jsdoc/core/Timer.d.ts @@ -0,0 +1,86 @@ +/** + * This class is an alternative to {@link Clock} with a different API design and behavior. + * The goal is to avoid the conceptual flaws that became apparent in `Clock` over time. + * + * - `Timer` has an `update()` method that updates its internal state. That makes it possible to + * call `getDelta()` and `getElapsed()` multiple times per simulation step without getting different values. + * - The class can make use of the Page Visibility API to avoid large time delta values when the app + * is inactive (e.g. tab switched or browser hidden). + * + * ```js + * const timer = new Timer(); + * timer.connect( document ); // use Page Visibility API + * ``` + */ +export class Timer { + _previousTime: number; + _currentTime: number; + _startTime: number; + _delta: number; + _elapsed: number; + _timescale: number; + _document: Document | null; + _pageVisibilityHandler: typeof handleVisibilityChange | null; + /** + * Connect the timer to the given document.Calling this method is not mandatory to + * use the timer but enables the usage of the Page Visibility API to avoid large time + * delta values. + * + * @param {Document} document - The document. + */ + connect(document: Document): void; + /** + * Disconnects the timer from the DOM and also disables the usage of the Page Visibility API. + */ + disconnect(): void; + /** + * Returns the time delta in seconds. + * + * @return {number} The time delta in second. + */ + getDelta(): number; + /** + * Returns the elapsed time in seconds. + * + * @return {number} The elapsed time in second. + */ + getElapsed(): number; + /** + * Returns the timescale. + * + * @return {number} The timescale. + */ + getTimescale(): number; + /** + * Sets the given timescale which scale the time delta computation + * in `update()`. + * + * @param {number} timescale - The timescale to set. + * @return {Timer} A reference to this timer. + */ + setTimescale(timescale: number): Timer; + /** + * Resets the time computation for the current simulation step. + * + * @return {Timer} A reference to this timer. + */ + reset(): Timer; + /** + * Can be used to free all internal resources. Usually called when + * the timer instance isn't required anymore. + */ + dispose(): void; + /** + * Updates the internal state of the timer. This method should be called + * once per simulation step and before you perform queries against the timer + * (e.g. via `getDelta()`). + * + * @param {number} timestamp - The current time in milliseconds. Can be obtained + * from the `requestAnimationFrame` callback argument. If not provided, the current + * time will be determined with `performance.now`. + * @return {Timer} A reference to this timer. + */ + update(timestamp: number): Timer; +} +declare function handleVisibilityChange(): void; +export {}; diff --git a/jsdoc-testing/jsdoc/extras/DataUtils.d.ts b/jsdoc-testing/jsdoc/extras/DataUtils.d.ts new file mode 100644 index 000000000..66cfe1590 --- /dev/null +++ b/jsdoc-testing/jsdoc/extras/DataUtils.d.ts @@ -0,0 +1,39 @@ +/** + * Returns a half precision floating point value (FP16) from the given single + * precision floating point value (FP32). + * + * @param {number} val - A single precision floating point value. + * @return {number} The FP16 value. + */ +export function toHalfFloat(val: number): number; +/** + * Returns a single precision floating point value (FP32) from the given half + * precision floating point value (FP16). + * + * @param {number} val - A half precision floating point value. + * @return {number} The FP32 value. + */ +export function fromHalfFloat(val: number): number; +/** + * A class containing utility functions for data. + * + * @hideconstructor + */ +export class DataUtils { + /** + * Returns a half precision floating point value (FP16) from the given single + * precision floating point value (FP32). + * + * @param {number} val - A single precision floating point value. + * @return {number} The FP16 value. + */ + static toHalfFloat(val: number): number; + /** + * Returns a single precision floating point value (FP32) from the given half + * precision floating point value (FP16). + * + * @param {number} val - A half precision floating point value. + * @return {number} The FP32 value. + */ + static fromHalfFloat(val: number): number; +} diff --git a/jsdoc-testing/jsdoc/extras/ImageUtils.d.ts b/jsdoc-testing/jsdoc/extras/ImageUtils.d.ts new file mode 100644 index 000000000..26077e10c --- /dev/null +++ b/jsdoc-testing/jsdoc/extras/ImageUtils.d.ts @@ -0,0 +1,22 @@ +/** + * A class containing utility functions for images. + * + * @hideconstructor + */ +export class ImageUtils { + /** + * Returns a data URI containing a representation of the given image. + * + * @param {(HTMLImageElement|HTMLCanvasElement)} image - The image object. + * @param {string} [type='image/png'] - Indicates the image format. + * @return {string} The data URI. + */ + static getDataURL(image: (HTMLImageElement | HTMLCanvasElement), type?: string): string; + /** + * Converts the given sRGB image data to linear color space. + * + * @param {(HTMLImageElement|HTMLCanvasElement|ImageBitmap|Object)} image - The image object. + * @return {HTMLCanvasElement|Object} The converted image. + */ + static sRGBToLinear(image: (HTMLImageElement | HTMLCanvasElement | ImageBitmap | Object)): HTMLCanvasElement | Object; +} diff --git a/jsdoc-testing/jsdoc/extras/TextureUtils.d.ts b/jsdoc-testing/jsdoc/extras/TextureUtils.d.ts new file mode 100644 index 000000000..5de7a1677 --- /dev/null +++ b/jsdoc-testing/jsdoc/extras/TextureUtils.d.ts @@ -0,0 +1,81 @@ +/** + * Scales the texture as large as possible within its surface without cropping + * or stretching the texture. The method preserves the original aspect ratio of + * the texture. Akin to CSS `object-fit: contain` + * + * @param {Texture} texture - The texture. + * @param {number} aspect - The texture's aspect ratio. + * @return {Texture} The updated texture. + */ +export function contain(texture: Texture, aspect: number): Texture; +/** + * Scales the texture to the smallest possible size to fill the surface, leaving + * no empty space. The method preserves the original aspect ratio of the texture. + * Akin to CSS `object-fit: cover`. + * + * @param {Texture} texture - The texture. + * @param {number} aspect - The texture's aspect ratio. + * @return {Texture} The updated texture. + */ +export function cover(texture: Texture, aspect: number): Texture; +/** + * Configures the texture to the default transformation. Akin to CSS `object-fit: fill`. + * + * @param {Texture} texture - The texture. + * @return {Texture} The updated texture. + */ +export function fill(texture: Texture): Texture; +/** + * Determines how many bytes must be used to represent the texture. + * + * @param {number} width - The width of the texture. + * @param {number} height - The height of the texture. + * @param {number} format - The texture's format. + * @param {number} type - The texture's type. + * @return {number} The byte length. + */ +export function getByteLength(width: number, height: number, format: number, type: number): number; +/** + * A class containing utility functions for textures. + * + * @hideconstructor + */ +export class TextureUtils { + /** + * Scales the texture as large as possible within its surface without cropping + * or stretching the texture. The method preserves the original aspect ratio of + * the texture. Akin to CSS `object-fit: contain` + * + * @param {Texture} texture - The texture. + * @param {number} aspect - The texture's aspect ratio. + * @return {Texture} The updated texture. + */ + static contain(texture: Texture, aspect: number): Texture; + /** + * Scales the texture to the smallest possible size to fill the surface, leaving + * no empty space. The method preserves the original aspect ratio of the texture. + * Akin to CSS `object-fit: cover`. + * + * @param {Texture} texture - The texture. + * @param {number} aspect - The texture's aspect ratio. + * @return {Texture} The updated texture. + */ + static cover(texture: Texture, aspect: number): Texture; + /** + * Configures the texture to the default transformation. Akin to CSS `object-fit: fill`. + * + * @param {Texture} texture - The texture. + * @return {Texture} The updated texture. + */ + static fill(texture: Texture): Texture; + /** + * Determines how many bytes must be used to represent the texture. + * + * @param {number} width - The width of the texture. + * @param {number} height - The height of the texture. + * @param {number} format - The texture's format. + * @param {number} type - The texture's type. + * @return {number} The byte length. + */ + static getByteLength(width: number, height: number, format: number, type: number): number; +} diff --git a/jsdoc-testing/jsdoc/geometries/BoxGeometry.d.ts b/jsdoc-testing/jsdoc/geometries/BoxGeometry.d.ts new file mode 100644 index 000000000..36fb50dad --- /dev/null +++ b/jsdoc-testing/jsdoc/geometries/BoxGeometry.d.ts @@ -0,0 +1,46 @@ +/** + * A geometry class for a rectangular cuboid with a given width, height, and depth. + * On creation, the cuboid is centred on the origin, with each edge parallel to one + * of the axes. + * + * ```js + * const geometry = new THREE.BoxGeometry( 1, 1, 1 ); + * const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } ); + * const cube = new THREE.Mesh( geometry, material ); + * scene.add( cube ); + * ``` + * + * @augments BufferGeometry + * @demo scenes/geometry-browser.html#BoxGeometry + */ +export class BoxGeometry extends BufferGeometry { + /** + * Factory method for creating an instance of this class from the given + * JSON object. + * + * @param {Object} data - A JSON object representing the serialized geometry. + * @return {BoxGeometry} A new instance. + */ + static fromJSON(data: Object): BoxGeometry; + /** + * Constructs a new box geometry. + * + * @param {number} [width=1] - The width. That is, the length of the edges parallel to the X axis. + * @param {number} [height=1] - The height. That is, the length of the edges parallel to the Y axis. + * @param {number} [depth=1] - The depth. That is, the length of the edges parallel to the Z axis. + * @param {number} [widthSegments=1] - Number of segmented rectangular faces along the width of the sides. + * @param {number} [heightSegments=1] - Number of segmented rectangular faces along the height of the sides. + * @param {number} [depthSegments=1] - Number of segmented rectangular faces along the depth of the sides. + */ + constructor(width?: number, height?: number, depth?: number, widthSegments?: number, heightSegments?: number, depthSegments?: number); + /** + * Holds the constructor parameters that have been + * used to generate the geometry. Any modification + * after instantiation does not change the geometry. + * + * @type {Object} + */ + parameters: Object; + copy(source: any): this; +} +import { BufferGeometry } from '../core/BufferGeometry.js'; diff --git a/jsdoc-testing/jsdoc/geometries/ConeGeometry.d.ts b/jsdoc-testing/jsdoc/geometries/ConeGeometry.d.ts new file mode 100644 index 000000000..0df48d532 --- /dev/null +++ b/jsdoc-testing/jsdoc/geometries/ConeGeometry.d.ts @@ -0,0 +1,29 @@ +/** + * A geometry class for representing a cone. + * + * ```js + * const geometry = new THREE.ConeGeometry( 5, 20, 32 ); + * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } ); + * const cone = new THREE.Mesh(geometry, material ); + * scene.add( cone ); + * ``` + * + * @augments CylinderGeometry + * @demo scenes/geometry-browser.html#ConeGeometry + */ +export class ConeGeometry extends CylinderGeometry { + /** + * Constructs a new cone geometry. + * + * @param {number} [radius=1] - Radius of the cone base. + * @param {number} [height=1] - Height of the cone. + * @param {number} [radialSegments=32] - Number of segmented faces around the circumference of the cone. + * @param {number} [heightSegments=1] - Number of rows of faces along the height of the cone. + * @param {boolean} [openEnded=false] - Whether the base of the cone is open or capped. + * @param {number} [thetaStart=0] - Start angle for first segment, in radians. + * @param {number} [thetaLength=Math.PI*2] - The central angle, often called theta, of the circular sector, in radians. + * The default value results in a complete cone. + */ + constructor(radius?: number, height?: number, radialSegments?: number, heightSegments?: number, openEnded?: boolean, thetaStart?: number, thetaLength?: number); +} +import { CylinderGeometry } from './CylinderGeometry.js'; diff --git a/jsdoc-testing/jsdoc/geometries/CylinderGeometry.d.ts b/jsdoc-testing/jsdoc/geometries/CylinderGeometry.d.ts new file mode 100644 index 000000000..6b28774bd --- /dev/null +++ b/jsdoc-testing/jsdoc/geometries/CylinderGeometry.d.ts @@ -0,0 +1,47 @@ +/** + * A geometry class for representing a cylinder. + * + * ```js + * const geometry = new THREE.CylinderGeometry( 5, 5, 20, 32 ); + * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } ); + * const cylinder = new THREE.Mesh( geometry, material ); + * scene.add( cylinder ); + * ``` + * + * @augments BufferGeometry + * @demo scenes/geometry-browser.html#CylinderGeometry + */ +export class CylinderGeometry extends BufferGeometry { + /** + * Factory method for creating an instance of this class from the given + * JSON object. + * + * @param {Object} data - A JSON object representing the serialized geometry. + * @return {CylinderGeometry} A new instance. + */ + static fromJSON(data: Object): CylinderGeometry; + /** + * Constructs a new cylinder geometry. + * + * @param {number} [radiusTop=1] - Radius of the cylinder at the top. + * @param {number} [radiusBottom=1] - Radius of the cylinder at the bottom. + * @param {number} [height=1] - Height of the cylinder. + * @param {number} [radialSegments=32] - Number of segmented faces around the circumference of the cylinder. + * @param {number} [heightSegments=1] - Number of rows of faces along the height of the cylinder. + * @param {boolean} [openEnded=false] - Whether the base of the cylinder is open or capped. + * @param {number} [thetaStart=0] - Start angle for first segment, in radians. + * @param {number} [thetaLength=Math.PI*2] - The central angle, often called theta, of the circular sector, in radians. + * The default value results in a complete cylinder. + */ + constructor(radiusTop?: number, radiusBottom?: number, height?: number, radialSegments?: number, heightSegments?: number, openEnded?: boolean, thetaStart?: number, thetaLength?: number); + /** + * Holds the constructor parameters that have been + * used to generate the geometry. Any modification + * after instantiation does not change the geometry. + * + * @type {Object} + */ + parameters: Object; + copy(source: any): this; +} +import { BufferGeometry } from '../core/BufferGeometry.js'; diff --git a/jsdoc-testing/jsdoc/geometries/OctahedronGeometry.d.ts b/jsdoc-testing/jsdoc/geometries/OctahedronGeometry.d.ts new file mode 100644 index 000000000..d61fe28a2 --- /dev/null +++ b/jsdoc-testing/jsdoc/geometries/OctahedronGeometry.d.ts @@ -0,0 +1,23 @@ +/** + * A geometry class for representing an octahedron. + * + * ```js + * const geometry = new THREE.OctahedronGeometry(); + * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } ); + * const octahedron = new THREE.Mesh( geometry, material ); + * scene.add( octahedron ); + * ``` + * + * @augments PolyhedronGeometry + * @demo scenes/geometry-browser.html#OctahedronGeometry + */ +export class OctahedronGeometry extends PolyhedronGeometry { + /** + * Constructs a new octahedron geometry. + * + * @param {number} [radius=1] - Radius of the octahedron. + * @param {number} [detail=0] - Setting this to a value greater than `0` adds vertices making it no longer a octahedron. + */ + constructor(radius?: number, detail?: number); +} +import { PolyhedronGeometry } from './PolyhedronGeometry.js'; diff --git a/jsdoc-testing/jsdoc/geometries/PlaneGeometry.d.ts b/jsdoc-testing/jsdoc/geometries/PlaneGeometry.d.ts new file mode 100644 index 000000000..d75a367ea --- /dev/null +++ b/jsdoc-testing/jsdoc/geometries/PlaneGeometry.d.ts @@ -0,0 +1,42 @@ +/** + * A geometry class for representing a plane. + * + * ```js + * const geometry = new THREE.PlaneGeometry( 1, 1 ); + * const material = new THREE.MeshBasicMaterial( { color: 0xffff00, side: THREE.DoubleSide } ); + * const plane = new THREE.Mesh( geometry, material ); + * scene.add( plane ); + * ``` + * + * @augments BufferGeometry + * @demo scenes/geometry-browser.html#PlaneGeometry + */ +export class PlaneGeometry extends BufferGeometry { + /** + * Factory method for creating an instance of this class from the given + * JSON object. + * + * @param {Object} data - A JSON object representing the serialized geometry. + * @return {PlaneGeometry} A new instance. + */ + static fromJSON(data: Object): PlaneGeometry; + /** + * Constructs a new plane geometry. + * + * @param {number} [width=1] - The width along the X axis. + * @param {number} [height=1] - The height along the Y axis + * @param {number} [widthSegments=1] - The number of segments along the X axis. + * @param {number} [heightSegments=1] - The number of segments along the Y axis. + */ + constructor(width?: number, height?: number, widthSegments?: number, heightSegments?: number); + /** + * Holds the constructor parameters that have been + * used to generate the geometry. Any modification + * after instantiation does not change the geometry. + * + * @type {Object} + */ + parameters: Object; + copy(source: any): this; +} +import { BufferGeometry } from '../core/BufferGeometry.js'; diff --git a/jsdoc-testing/jsdoc/geometries/PolyhedronGeometry.d.ts b/jsdoc-testing/jsdoc/geometries/PolyhedronGeometry.d.ts new file mode 100644 index 000000000..c0ef0437c --- /dev/null +++ b/jsdoc-testing/jsdoc/geometries/PolyhedronGeometry.d.ts @@ -0,0 +1,36 @@ +/** + * A polyhedron is a solid in three dimensions with flat faces. This class + * will take an array of vertices, project them onto a sphere, and then + * divide them up to the desired level of detail. + * + * @augments BufferGeometry + */ +export class PolyhedronGeometry extends BufferGeometry { + /** + * Factory method for creating an instance of this class from the given + * JSON object. + * + * @param {Object} data - A JSON object representing the serialized geometry. + * @return {PolyhedronGeometry} A new instance. + */ + static fromJSON(data: Object): PolyhedronGeometry; + /** + * Constructs a new polyhedron geometry. + * + * @param {Array} [vertices] - A flat array of vertices describing the base shape. + * @param {Array} [indices] - A flat array of indices describing the base shape. + * @param {number} [radius=1] - The radius of the shape. + * @param {number} [detail=0] - How many levels to subdivide the geometry. The more detail, the smoother the shape. + */ + constructor(vertices?: Array, indices?: Array, radius?: number, detail?: number); + /** + * Holds the constructor parameters that have been + * used to generate the geometry. Any modification + * after instantiation does not change the geometry. + * + * @type {Object} + */ + parameters: Object; + copy(source: any): this; +} +import { BufferGeometry } from '../core/BufferGeometry.js'; diff --git a/jsdoc-testing/jsdoc/geometries/SphereGeometry.d.ts b/jsdoc-testing/jsdoc/geometries/SphereGeometry.d.ts new file mode 100644 index 000000000..b150fa7df --- /dev/null +++ b/jsdoc-testing/jsdoc/geometries/SphereGeometry.d.ts @@ -0,0 +1,45 @@ +/** + * A class for generating a sphere geometry. + * + * ```js + * const geometry = new THREE.SphereGeometry( 15, 32, 16 ); + * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } ); + * const sphere = new THREE.Mesh( geometry, material ); + * scene.add( sphere ); + * ``` + * + * @augments BufferGeometry + * @demo scenes/geometry-browser.html#SphereGeometry + */ +export class SphereGeometry extends BufferGeometry { + /** + * Factory method for creating an instance of this class from the given + * JSON object. + * + * @param {Object} data - A JSON object representing the serialized geometry. + * @return {SphereGeometry} A new instance. + */ + static fromJSON(data: Object): SphereGeometry; + /** + * Constructs a new sphere geometry. + * + * @param {number} [radius=1] - The sphere radius. + * @param {number} [widthSegments=32] - The number of horizontal segments. Minimum value is `3`. + * @param {number} [heightSegments=16] - The number of vertical segments. Minimum value is `2`. + * @param {number} [phiStart=0] - The horizontal starting angle in radians. + * @param {number} [phiLength=Math.PI*2] - The horizontal sweep angle size. + * @param {number} [thetaStart=0] - The vertical starting angle in radians. + * @param {number} [thetaLength=Math.PI] - The vertical sweep angle size. + */ + constructor(radius?: number, widthSegments?: number, heightSegments?: number, phiStart?: number, phiLength?: number, thetaStart?: number, thetaLength?: number); + /** + * Holds the constructor parameters that have been + * used to generate the geometry. Any modification + * after instantiation does not change the geometry. + * + * @type {Object} + */ + parameters: Object; + copy(source: any): this; +} +import { BufferGeometry } from '../core/BufferGeometry.js'; diff --git a/jsdoc-testing/jsdoc/helpers/ArrowHelper.d.ts b/jsdoc-testing/jsdoc/helpers/ArrowHelper.d.ts new file mode 100644 index 000000000..302ccad5a --- /dev/null +++ b/jsdoc-testing/jsdoc/helpers/ArrowHelper.d.ts @@ -0,0 +1,75 @@ +/** + * An 3D arrow object for visualizing directions. + * + * ```js + * const dir = new THREE.Vector3( 1, 2, 0 ); + * + * //normalize the direction vector (convert to vector of length 1) + * dir.normalize(); + * + * const origin = new THREE.Vector3( 0, 0, 0 ); + * const length = 1; + * const hex = 0xffff00; + * + * const arrowHelper = new THREE.ArrowHelper( dir, origin, length, hex ); + * scene.add( arrowHelper ); + * ``` + * + * @augments Object3D + */ +export class ArrowHelper extends Object3D { + /** + * Constructs a new arrow helper. + * + * @param {Vector3} [dir=(0, 0, 1)] - The (normalized) direction vector. + * @param {Vector3} [origin=(0, 0, 0)] - Point at which the arrow starts. + * @param {number} [length=1] - Length of the arrow in world units. + * @param {(number|Color|string)} [color=0xffff00] - Color of the arrow. + * @param {number} [headLength=length*0.2] - The length of the head of the arrow. + * @param {number} [headWidth=headLength*0.2] - The width of the head of the arrow. + */ + constructor(dir?: Vector3, origin?: Vector3, length?: number, color?: (number | Color | string), headLength?: number, headWidth?: number); + type: string; + /** + * The line part of the arrow helper. + * + * @type {Line} + */ + line: Line; + /** + * The cone part of the arrow helper. + * + * @type {Mesh} + */ + cone: Mesh; + /** + * Sets the direction of the helper. + * + * @param {Vector3} dir - The normalized direction vector. + */ + setDirection(dir: Vector3): void; + /** + * Sets the length of the helper. + * + * @param {number} length - Length of the arrow in world units. + * @param {number} [headLength=length*0.2] - The length of the head of the arrow. + * @param {number} [headWidth=headLength*0.2] - The width of the head of the arrow. + */ + setLength(length: number, headLength?: number, headWidth?: number): void; + /** + * Sets the color of the helper. + * + * @param {number|Color|string} color - The color to set. + */ + setColor(color: number | Color | string): void; + copy(source: any): this; + /** + * Frees the GPU-related resources allocated by this instance. Call this + * method whenever this instance is no longer used in your app. + */ + dispose(): void; +} +import { Object3D } from '../core/Object3D.js'; +import { Line } from '../objects/Line.js'; +import { Mesh } from '../objects/Mesh.js'; +import { Vector3 } from '../math/Vector3.js'; diff --git a/jsdoc-testing/jsdoc/helpers/AxesHelper.d.ts b/jsdoc-testing/jsdoc/helpers/AxesHelper.d.ts new file mode 100644 index 000000000..cc7858bfe --- /dev/null +++ b/jsdoc-testing/jsdoc/helpers/AxesHelper.d.ts @@ -0,0 +1,35 @@ +/** + * An axis object to visualize the 3 axes in a simple way. + * The X axis is red. The Y axis is green. The Z axis is blue. + * + * ```js + * const axesHelper = new THREE.AxesHelper( 5 ); + * scene.add( axesHelper ); + * ``` + * + * @augments LineSegments + */ +export class AxesHelper extends LineSegments { + /** + * Constructs a new axes helper. + * + * @param {number} [size=1] - Size of the lines representing the axes. + */ + constructor(size?: number); + /** + * Defines the colors of the axes helper. + * + * @param {number|Color|string} xAxisColor - The color for the x axis. + * @param {number|Color|string} yAxisColor - The color for the y axis. + * @param {number|Color|string} zAxisColor - The color for the z axis. + * @return {AxesHelper} A reference to this axes helper. + */ + setColors(xAxisColor: number | Color | string, yAxisColor: number | Color | string, zAxisColor: number | Color | string): AxesHelper; + /** + * Frees the GPU-related resources allocated by this instance. Call this + * method whenever this instance is no longer used in your app. + */ + dispose(): void; +} +import { LineSegments } from '../objects/LineSegments.js'; +import { Color } from '../math/Color.js'; diff --git a/jsdoc-testing/jsdoc/helpers/Box3Helper.d.ts b/jsdoc-testing/jsdoc/helpers/Box3Helper.d.ts new file mode 100644 index 000000000..982072dbb --- /dev/null +++ b/jsdoc-testing/jsdoc/helpers/Box3Helper.d.ts @@ -0,0 +1,35 @@ +/** + * A helper object to visualize an instance of {@link Box3}. + * + * ```js + * const box = new THREE.Box3(); + * box.setFromCenterAndSize( new THREE.Vector3( 1, 1, 1 ), new THREE.Vector3( 2, 1, 3 ) ); + * + * const helper = new THREE.Box3Helper( box, 0xffff00 ); + * scene.add( helper ) + * ``` + * + * @augments LineSegments + */ +export class Box3Helper extends LineSegments { + /** + * Constructs a new box3 helper. + * + * @param {Box3} box - The box to visualize. + * @param {number|Color|string} [color=0xffff00] - The box's color. + */ + constructor(box: Box3, color?: number | Color | string); + /** + * The box being visualized. + * + * @type {Box3} + */ + box: Box3; + updateMatrixWorld(force: any): void; + /** + * Frees the GPU-related resources allocated by this instance. Call this + * method whenever this instance is no longer used in your app. + */ + dispose(): void; +} +import { LineSegments } from '../objects/LineSegments.js'; diff --git a/jsdoc-testing/jsdoc/helpers/BoxHelper.d.ts b/jsdoc-testing/jsdoc/helpers/BoxHelper.d.ts new file mode 100644 index 000000000..0b864050e --- /dev/null +++ b/jsdoc-testing/jsdoc/helpers/BoxHelper.d.ts @@ -0,0 +1,44 @@ +/** + * Helper object to graphically show the world-axis-aligned bounding box + * around an object. The actual bounding box is handled with {@link Box3}, + * this is just a visual helper for debugging. It can be automatically + * resized with {@link BoxHelper#update} when the object it's created from + * is transformed. Note that the object must have a geometry for this to work, + * so it won't work with sprites. + * + * ```js + * const sphere = new THREE.SphereGeometry(); + * const object = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial( 0xff0000 ) ); + * const box = new THREE.BoxHelper( object, 0xffff00 ); + * scene.add( box ); + * ``` + * + * @augments LineSegments + */ +export class BoxHelper extends LineSegments { + /** + * The 3D object being visualized. + * + * @type {Object3D} + */ + object: Object3D; + /** + * Updates the helper's geometry to match the dimensions of the object, + * including any children. + */ + update(): void; + /** + * Updates the wireframe box for the passed object. + * + * @param {Object3D} object - The 3D object to create the helper for. + * @return {BoxHelper} A reference to this instance. + */ + setFromObject(object: Object3D): BoxHelper; + copy(source: any, recursive: any): this; + /** + * Frees the GPU-related resources allocated by this instance. Call this + * method whenever this instance is no longer used in your app. + */ + dispose(): void; +} +import { LineSegments } from '../objects/LineSegments.js'; diff --git a/jsdoc-testing/jsdoc/helpers/CameraHelper.d.ts b/jsdoc-testing/jsdoc/helpers/CameraHelper.d.ts new file mode 100644 index 000000000..69f517585 --- /dev/null +++ b/jsdoc-testing/jsdoc/helpers/CameraHelper.d.ts @@ -0,0 +1,64 @@ +/** + * This helps with visualizing what a camera contains in its frustum. It + * visualizes the frustum of a camera using a line segments. + * + * Based on frustum visualization in [lightgl.js shadowmap example](https://github.com/evanw/lightgl.js/blob/master/tests/shadowmap.html). + * + * `CameraHelper` must be a child of the scene. + * + * When the camera is transformed or its projection matrix is changed, it's necessary + * to call the `update()` method of the respective helper. + * + * ```js + * const camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 ); + * const helper = new THREE.CameraHelper( camera ); + * scene.add( helper ); + * ``` + * + * @augments LineSegments + */ +export class CameraHelper extends LineSegments { + /** + * Constructs a new arrow helper. + * + * @param {Camera} camera - The camera to visualize. + */ + constructor(camera: Camera); + /** + * The camera being visualized. + * + * @type {Camera} + */ + camera: Camera; + /** + * This contains the points used to visualize the camera. + * + * @type {Object>} + */ + pointMap: { + [x: string]: number[]; + }; + /** + * Defines the colors of the helper. + * + * @param {Color} frustum - The frustum line color. + * @param {Color} cone - The cone line color. + * @param {Color} up - The up line color. + * @param {Color} target - The target line color. + * @param {Color} cross - The cross line color. + * @return {CameraHelper} A reference to this helper. + */ + setColors(frustum: Color, cone: Color, up: Color, target: Color, cross: Color): CameraHelper; + /** + * Updates the helper based on the projection matrix of the camera. + */ + update(): void; + /** + * Frees the GPU-related resources allocated by this instance. Call this + * method whenever this instance is no longer used in your app. + */ + dispose(): void; +} +import { LineSegments } from '../objects/LineSegments.js'; +import { Camera } from '../cameras/Camera.js'; +import { Color } from '../math/Color.js'; diff --git a/jsdoc-testing/jsdoc/helpers/DirectionalLightHelper.d.ts b/jsdoc-testing/jsdoc/helpers/DirectionalLightHelper.d.ts new file mode 100644 index 000000000..edd4fa7ff --- /dev/null +++ b/jsdoc-testing/jsdoc/helpers/DirectionalLightHelper.d.ts @@ -0,0 +1,68 @@ +/** + * Helper object to assist with visualizing a {@link DirectionalLight}'s + * effect on the scene. This consists of a plane and a line representing the + * light's position and direction. + * + * When the directional light or its target are transformed or light properties + * are changed, it's necessary to call the `update()` method of the respective helper. + * + * ```js + * const light = new THREE.DirectionalLight( 0xFFFFFF ); + * scene.add( light ); + * + * const helper = new THREE.DirectionalLightHelper( light, 5 ); + * scene.add( helper ); + * ``` + * + * @augments Object3D + */ +export class DirectionalLightHelper extends Object3D { + /** + * Constructs a new directional light helper. + * + * @param {DirectionalLight} light - The light to be visualized. + * @param {number} [size=1] - The dimensions of the plane. + * @param {number|Color|string} [color] - The helper's color. If not set, the helper will take + * the color of the light. + */ + constructor(light: DirectionalLight, size?: number, color?: number | Color | string); + /** + * The light being visualized. + * + * @type {DirectionalLight} + */ + light: DirectionalLight; + matrix: any; + /** + * The color parameter passed in the constructor. + * If not set, the helper will take the color of the light. + * + * @type {number|Color|string} + */ + color: number | Color | string; + type: string; + /** + * Contains the line showing the location of the directional light. + * + * @type {Line} + */ + lightPlane: Line; + /** + * Represents the target line of the directional light. + * + * @type {Line} + */ + targetLine: Line; + /** + * Frees the GPU-related resources allocated by this instance. Call this + * method whenever this instance is no longer used in your app. + */ + dispose(): void; + /** + * Updates the helper to match the position and direction of the + * light being visualized. + */ + update(): void; +} +import { Object3D } from '../core/Object3D.js'; +import { Line } from '../objects/Line.js'; diff --git a/jsdoc-testing/jsdoc/helpers/GridHelper.d.ts b/jsdoc-testing/jsdoc/helpers/GridHelper.d.ts new file mode 100644 index 000000000..c0df154aa --- /dev/null +++ b/jsdoc-testing/jsdoc/helpers/GridHelper.d.ts @@ -0,0 +1,32 @@ +/** + * The helper is an object to define grids. Grids are two-dimensional + * arrays of lines. + * + * ```js + * const size = 10; + * const divisions = 10; + * + * const gridHelper = new THREE.GridHelper( size, divisions ); + * scene.add( gridHelper ); + * ``` + * + * @augments LineSegments + */ +export class GridHelper extends LineSegments { + /** + * Constructs a new grid helper. + * + * @param {number} [size=10] - The size of the grid. + * @param {number} [divisions=10] - The number of divisions across the grid. + * @param {number|Color|string} [color1=0x444444] - The color of the center line. + * @param {number|Color|string} [color2=0x888888] - The color of the lines of the grid. + */ + constructor(size?: number, divisions?: number, color1?: number | Color | string, color2?: number | Color | string); + /** + * Frees the GPU-related resources allocated by this instance. Call this + * method whenever this instance is no longer used in your app. + */ + dispose(): void; +} +import { LineSegments } from '../objects/LineSegments.js'; +import { Color } from '../math/Color.js'; diff --git a/jsdoc-testing/jsdoc/helpers/HemisphereLightHelper.d.ts b/jsdoc-testing/jsdoc/helpers/HemisphereLightHelper.d.ts new file mode 100644 index 000000000..5920f3014 --- /dev/null +++ b/jsdoc-testing/jsdoc/helpers/HemisphereLightHelper.d.ts @@ -0,0 +1,55 @@ +/** + * Creates a visual aid consisting of a spherical mesh for a + * given {@link HemisphereLight}. + * + * When the hemisphere light is transformed or its light properties are changed, + * it's necessary to call the `update()` method of the respective helper. + * + * ```js + * const light = new THREE.HemisphereLight( 0xffffbb, 0x080820, 1 ); + * const helper = new THREE.HemisphereLightHelper( light, 5 ); + * scene.add( helper ); + * ``` + * + * @augments Object3D + */ +export class HemisphereLightHelper extends Object3D { + /** + * Constructs a new hemisphere light helper. + * + * @param {HemisphereLight} light - The light to be visualized. + * @param {number} [size=1] - The size of the mesh used to visualize the light. + * @param {number|Color|string} [color] - The helper's color. If not set, the helper will take + * the color of the light. + */ + constructor(light: HemisphereLight, size?: number, color?: number | Color | string); + /** + * The light being visualized. + * + * @type {HemisphereLight} + */ + light: HemisphereLight; + matrix: any; + /** + * The color parameter passed in the constructor. + * If not set, the helper will take the color of the light. + * + * @type {number|Color|string} + */ + color: number | Color | string; + type: string; + material: MeshBasicMaterial; + /** + * Frees the GPU-related resources allocated by this instance. Call this + * method whenever this instance is no longer used in your app. + */ + dispose(): void; + /** + * Updates the helper to match the position and direction of the + * light being visualized. + */ + update(): void; +} +import { Object3D } from '../core/Object3D.js'; +import { Color } from '../math/Color.js'; +import { MeshBasicMaterial } from '../materials/MeshBasicMaterial.js'; diff --git a/jsdoc-testing/jsdoc/helpers/PlaneHelper.d.ts b/jsdoc-testing/jsdoc/helpers/PlaneHelper.d.ts new file mode 100644 index 000000000..be6163223 --- /dev/null +++ b/jsdoc-testing/jsdoc/helpers/PlaneHelper.d.ts @@ -0,0 +1,41 @@ +/** + * A helper object to visualize an instance of {@link Plane}. + * + * ```js + * const plane = new THREE.Plane( new THREE.Vector3( 1, 1, 0.2 ), 3 ); + * const helper = new THREE.PlaneHelper( plane, 1, 0xffff00 ); + * scene.add( helper ); + * ``` + * + * @augments Line + */ +export class PlaneHelper extends Line { + /** + * Constructs a new plane helper. + * + * @param {Plane} plane - The plane to be visualized. + * @param {number} [size=1] - The side length of plane helper. + * @param {number|Color|string} [hex=0xffff00] - The helper's color. + */ + constructor(plane: Plane, size?: number, hex?: number | Color | string); + /** + * The plane being visualized. + * + * @type {Plane} + */ + plane: Plane; + /** + * The side length of plane helper. + * + * @type {number} + * @default 1 + */ + size: number; + updateMatrixWorld(force: any): void; + /** + * Updates the helper to match the position and direction of the + * light being visualized. + */ + dispose(): void; +} +import { Line } from '../objects/Line.js'; diff --git a/jsdoc-testing/jsdoc/helpers/PointLightHelper.d.ts b/jsdoc-testing/jsdoc/helpers/PointLightHelper.d.ts new file mode 100644 index 000000000..f2f51e312 --- /dev/null +++ b/jsdoc-testing/jsdoc/helpers/PointLightHelper.d.ts @@ -0,0 +1,52 @@ +/** + * This displays a helper object consisting of a spherical mesh for + * visualizing an instance of {@link PointLight}. + * + * ```js + * const pointLight = new THREE.PointLight( 0xff0000, 1, 100 ); + * pointLight.position.set( 10, 10, 10 ); + * scene.add( pointLight ); + * + * const sphereSize = 1; + * const pointLightHelper = new THREE.PointLightHelper( pointLight, sphereSize ); + * scene.add( pointLightHelper ); + * ``` + * + * @augments Mesh + */ +export class PointLightHelper extends Mesh { + /** + * Constructs a new point light helper. + * + * @param {PointLight} light - The light to be visualized. + * @param {number} [sphereSize=1] - The size of the sphere helper. + * @param {number|Color|string} [color] - The helper's color. If not set, the helper will take + * the color of the light. + */ + constructor(light: PointLight, sphereSize?: number, color?: number | Color | string); + /** + * The light being visualized. + * + * @type {PointLight} + */ + light: PointLight; + /** + * The color parameter passed in the constructor. + * If not set, the helper will take the color of the light. + * + * @type {number|Color|string} + */ + color: number | Color | string; + matrix: any; + /** + * Frees the GPU-related resources allocated by this instance. Call this + * method whenever this instance is no longer used in your app. + */ + dispose(): void; + /** + * Updates the helper to match the position of the + * light being visualized. + */ + update(): void; +} +import { Mesh } from '../objects/Mesh.js'; diff --git a/jsdoc-testing/jsdoc/helpers/PolarGridHelper.d.ts b/jsdoc-testing/jsdoc/helpers/PolarGridHelper.d.ts new file mode 100644 index 000000000..9d4caa9c7 --- /dev/null +++ b/jsdoc-testing/jsdoc/helpers/PolarGridHelper.d.ts @@ -0,0 +1,36 @@ +/** + * This helper is an object to define polar grids. Grids are + * two-dimensional arrays of lines. + * + * ```js + * const radius = 10; + * const sectors = 16; + * const rings = 8; + * const divisions = 64; + * + * const helper = new THREE.PolarGridHelper( radius, sectors, rings, divisions ); + * scene.add( helper ); + * ``` + * + * @augments LineSegments + */ +export class PolarGridHelper extends LineSegments { + /** + * Constructs a new polar grid helper. + * + * @param {number} [radius=10] - The radius of the polar grid. This can be any positive number. + * @param {number} [sectors=16] - The number of sectors the grid will be divided into. This can be any positive integer. + * @param {number} [rings=16] - The number of rings. This can be any positive integer. + * @param {number} [divisions=64] - The number of line segments used for each circle. This can be any positive integer. + * @param {number|Color|string} [color1=0x444444] - The first color used for grid elements. + * @param {number|Color|string} [color2=0x888888] - The second color used for grid elements. + */ + constructor(radius?: number, sectors?: number, rings?: number, divisions?: number, color1?: number | Color | string, color2?: number | Color | string); + /** + * Frees the GPU-related resources allocated by this instance. Call this + * method whenever this instance is no longer used in your app. + */ + dispose(): void; +} +import { LineSegments } from '../objects/LineSegments.js'; +import { Color } from '../math/Color.js'; diff --git a/jsdoc-testing/jsdoc/helpers/SkeletonHelper.d.ts b/jsdoc-testing/jsdoc/helpers/SkeletonHelper.d.ts new file mode 100644 index 000000000..a129e99ab --- /dev/null +++ b/jsdoc-testing/jsdoc/helpers/SkeletonHelper.d.ts @@ -0,0 +1,56 @@ +/** + * A helper object to assist with visualizing a {@link Skeleton}. + * + * ```js + * const helper = new THREE.SkeletonHelper( skinnedMesh ); + * scene.add( helper ); + * ``` + * + * @augments LineSegments + */ +export class SkeletonHelper extends LineSegments { + /** + * Constructs a new skeleton helper. + * + * @param {Object3D} object - Usually an instance of {@link SkinnedMesh}. However, any 3D object + * can be used if it represents a hierarchy of bones (see {@link Bone}). + */ + constructor(object: Object3D); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isSkeletonHelper: boolean; + /** + * The object being visualized. + * + * @type {Object3D} + */ + root: Object3D; + /** + * The list of bones that the helper visualizes. + * + * @type {Array} + */ + bones: Array; + matrix: any; + updateMatrixWorld(force: any): void; + /** + * Defines the colors of the helper. + * + * @param {Color} color1 - The first line color for each bone. + * @param {Color} color2 - The second line color for each bone. + * @return {SkeletonHelper} A reference to this helper. + */ + setColors(color1: Color, color2: Color): SkeletonHelper; + /** + * Frees the GPU-related resources allocated by this instance. Call this + * method whenever this instance is no longer used in your app. + */ + dispose(): void; +} +import { LineSegments } from '../objects/LineSegments.js'; +import { Color } from '../math/Color.js'; diff --git a/jsdoc-testing/jsdoc/helpers/SpotLightHelper.d.ts b/jsdoc-testing/jsdoc/helpers/SpotLightHelper.d.ts new file mode 100644 index 000000000..7e73edcef --- /dev/null +++ b/jsdoc-testing/jsdoc/helpers/SpotLightHelper.d.ts @@ -0,0 +1,54 @@ +/** + * This displays a cone shaped helper object for a {@link SpotLight}. + * + * When the spot light or its target are transformed or light properties are + * changed, it's necessary to call the `update()` method of the respective helper. + * + * ```js + * const spotLight = new THREE.SpotLight( 0xffffff ); + * spotLight.position.set( 10, 10, 10 ); + * scene.add( spotLight ); + * + * const spotLightHelper = new THREE.SpotLightHelper( spotLight ); + * scene.add( spotLightHelper ); + * ``` + * + * @augments Object3D + */ +export class SpotLightHelper extends Object3D { + /** + * Constructs a new spot light helper. + * + * @param {HemisphereLight} light - The light to be visualized. + * @param {number|Color|string} [color] - The helper's color. If not set, the helper will take + * the color of the light. + */ + constructor(light: HemisphereLight, color?: number | Color | string); + /** + * The light being visualized. + * + * @type {SpotLight} + */ + light: SpotLight; + /** + * The color parameter passed in the constructor. + * If not set, the helper will take the color of the light. + * + * @type {number|Color|string} + */ + color: number | Color | string; + type: string; + cone: LineSegments; + /** + * Frees the GPU-related resources allocated by this instance. Call this + * method whenever this instance is no longer used in your app. + */ + dispose(): void; + /** + * Updates the helper to match the position and direction of the + * light being visualized. + */ + update(): void; +} +import { Object3D } from '../core/Object3D.js'; +import { LineSegments } from '../objects/LineSegments.js'; diff --git a/jsdoc-testing/jsdoc/lights/AmbientLight.d.ts b/jsdoc-testing/jsdoc/lights/AmbientLight.d.ts new file mode 100644 index 000000000..78c3196fd --- /dev/null +++ b/jsdoc-testing/jsdoc/lights/AmbientLight.d.ts @@ -0,0 +1,30 @@ +/** + * This light globally illuminates all objects in the scene equally. + * + * It cannot be used to cast shadows as it does not have a direction. + * + * ```js + * const light = new THREE.AmbientLight( 0x404040 ); // soft white light + * scene.add( light ); + * ``` + * + * @augments Light + */ +export class AmbientLight extends Light { + /** + * Constructs a new ambient light. + * + * @param {(number|Color|string)} [color=0xffffff] - The light's color. + * @param {number} [intensity=1] - The light's strength/intensity. + */ + constructor(color?: (number | Color | string), intensity?: number); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isAmbientLight: boolean; +} +import { Light } from './Light.js'; diff --git a/jsdoc-testing/jsdoc/lights/DirectionalLight.d.ts b/jsdoc-testing/jsdoc/lights/DirectionalLight.d.ts new file mode 100644 index 000000000..753317423 --- /dev/null +++ b/jsdoc-testing/jsdoc/lights/DirectionalLight.d.ts @@ -0,0 +1,67 @@ +/** + * A light that gets emitted in a specific direction. This light will behave + * as though it is infinitely far away and the rays produced from it are all + * parallel. The common use case for this is to simulate daylight; the sun is + * far enough away that its position can be considered to be infinite, and + * all light rays coming from it are parallel. + * + * A common point of confusion for directional lights is that setting the + * rotation has no effect. This is because three.js's DirectionalLight is the + * equivalent to what is often called a 'Target Direct Light' in other + * applications. + * + * This means that its direction is calculated as pointing from the light's + * {@link Object3D#position} to the {@link DirectionalLight#target} position + * (as opposed to a 'Free Direct Light' that just has a rotation + * component). + * + * This light can cast shadows - see the {@link DirectionalLightShadow} for details. + * + * ```js + * // White directional light at half intensity shining from the top. + * const directionalLight = new THREE.DirectionalLight( 0xffffff, 0.5 ); + * scene.add( directionalLight ); + * ``` + * + * @augments Light + */ +export class DirectionalLight extends Light { + /** + * Constructs a new directional light. + * + * @param {(number|Color|string)} [color=0xffffff] - The light's color. + * @param {number} [intensity=1] - The light's strength/intensity. + */ + constructor(color?: (number | Color | string), intensity?: number); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isDirectionalLight: boolean; + /** + * The directional light points from its position to the + * target's position. + * + * For the target's position to be changed to anything other + * than the default, it must be added to the scene. + * + * It is also possible to set the target to be another 3D object + * in the scene. The light will now track the target object. + * + * @type {Object3D} + */ + target: Object3D; + /** + * This property holds the light's shadow configuration. + * + * @type {DirectionalLightShadow} + */ + shadow: DirectionalLightShadow; + copy(source: any): this; +} +import { Light } from './Light.js'; +import { Object3D } from '../core/Object3D.js'; +import { DirectionalLightShadow } from './DirectionalLightShadow.js'; diff --git a/jsdoc-testing/jsdoc/lights/DirectionalLightShadow.d.ts b/jsdoc-testing/jsdoc/lights/DirectionalLightShadow.d.ts new file mode 100644 index 000000000..69d809ea1 --- /dev/null +++ b/jsdoc-testing/jsdoc/lights/DirectionalLightShadow.d.ts @@ -0,0 +1,20 @@ +/** + * Represents the shadow configuration of directional lights. + * + * @augments LightShadow + */ +export class DirectionalLightShadow extends LightShadow { + /** + * Constructs a new directional light shadow. + */ + constructor(); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isDirectionalLightShadow: boolean; +} +import { LightShadow } from './LightShadow.js'; diff --git a/jsdoc-testing/jsdoc/lights/HemisphereLight.d.ts b/jsdoc-testing/jsdoc/lights/HemisphereLight.d.ts new file mode 100644 index 000000000..9bffa0d03 --- /dev/null +++ b/jsdoc-testing/jsdoc/lights/HemisphereLight.d.ts @@ -0,0 +1,40 @@ +/** + * A light source positioned directly above the scene, with color fading from + * the sky color to the ground color. + * + * This light cannot be used to cast shadows. + * + * ```js + * const light = new THREE.HemisphereLight( 0xffffbb, 0x080820, 1 ); + * scene.add( light ); + * ``` + * + * @augments Light + */ +export class HemisphereLight extends Light { + /** + * Constructs a new hemisphere light. + * + * @param {(number|Color|string)} [skyColor=0xffffff] - The light's sky color. + * @param {(number|Color|string)} [groundColor=0xffffff] - The light's ground color. + * @param {number} [intensity=1] - The light's strength/intensity. + */ + constructor(skyColor?: (number | Color | string), groundColor?: (number | Color | string), intensity?: number); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isHemisphereLight: boolean; + /** + * The light's ground color. + * + * @type {Color} + */ + groundColor: Color; + copy(source: any, recursive: any): this; +} +import { Light } from './Light.js'; +import { Color } from '../math/Color.js'; diff --git a/jsdoc-testing/jsdoc/lights/Light.d.ts b/jsdoc-testing/jsdoc/lights/Light.d.ts new file mode 100644 index 000000000..15a77b361 --- /dev/null +++ b/jsdoc-testing/jsdoc/lights/Light.d.ts @@ -0,0 +1,47 @@ +/** + * Abstract base class for lights - all other light types inherit the + * properties and methods described here. + * + * @abstract + * @augments Object3D + */ +export class Light extends Object3D { + /** + * Constructs a new light. + * + * @param {(number|Color|string)} [color=0xffffff] - The light's color. + * @param {number} [intensity=1] - The light's strength/intensity. + */ + constructor(color?: (number | Color | string), intensity?: number); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isLight: boolean; + type: string; + /** + * The light's color. + * + * @type {Color} + */ + color: Color; + /** + * The light's intensity. + * + * @type {number} + * @default 1 + */ + intensity: number; + /** + * Frees the GPU-related resources allocated by this instance. Call this + * method whenever this instance is no longer used in your app. + */ + dispose(): void; + copy(source: any, recursive: any): this; + toJSON(meta: any): Object; +} +import { Object3D } from '../core/Object3D.js'; +import { Color } from '../math/Color.js'; diff --git a/jsdoc-testing/jsdoc/lights/LightProbe.d.ts b/jsdoc-testing/jsdoc/lights/LightProbe.d.ts new file mode 100644 index 000000000..8a03aa8cf --- /dev/null +++ b/jsdoc-testing/jsdoc/lights/LightProbe.d.ts @@ -0,0 +1,45 @@ +/** + * Light probes are an alternative way of adding light to a 3D scene. Unlike + * classical light sources (e.g. directional, point or spot lights), light + * probes do not emit light. Instead they store information about light + * passing through 3D space. During rendering, the light that hits a 3D + * object is approximated by using the data from the light probe. + * + * Light probes are usually created from (radiance) environment maps. The + * class {@link LightProbeGenerator} can be used to create light probes from + * cube textures or render targets. However, light estimation data could also + * be provided in other forms e.g. by WebXR. This enables the rendering of + * augmented reality content that reacts to real world lighting. + * + * The current probe implementation in three.js supports so-called diffuse + * light probes. This type of light probe is functionally equivalent to an + * irradiance environment map. + * + * @augments Light + */ +export class LightProbe extends Light { + /** + * Constructs a new light probe. + * + * @param {SphericalHarmonics3} sh - The spherical harmonics which represents encoded lighting information. + * @param {number} [intensity=1] - The light's strength/intensity. + */ + constructor(sh?: SphericalHarmonics3, intensity?: number); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isLightProbe: boolean; + /** + * A light probe uses spherical harmonics to encode lighting information. + * + * @type {SphericalHarmonics3} + */ + sh: SphericalHarmonics3; + copy(source: any): this; +} +import { Light } from './Light.js'; +import { SphericalHarmonics3 } from '../math/SphericalHarmonics3.js'; diff --git a/jsdoc-testing/jsdoc/lights/LightShadow.d.ts b/jsdoc-testing/jsdoc/lights/LightShadow.d.ts new file mode 100644 index 000000000..24ffaf5b3 --- /dev/null +++ b/jsdoc-testing/jsdoc/lights/LightShadow.d.ts @@ -0,0 +1,198 @@ +/** + * Abstract base class for light shadow classes. These classes + * represent the shadow configuration for different light types. + * + * @abstract + */ +export class LightShadow { + /** + * Constructs a new light shadow. + * + * @param {Camera} camera - The light's view of the world. + */ + constructor(camera: Camera); + /** + * The light's view of the world. + * + * @type {Camera} + */ + camera: Camera; + /** + * The intensity of the shadow. The default is `1`. + * Valid values are in the range `[0, 1]`. + * + * @type {number} + * @default 1 + */ + intensity: number; + /** + * Shadow map bias, how much to add or subtract from the normalized depth + * when deciding whether a surface is in shadow. + * + * The default is `0`. Very tiny adjustments here (in the order of `0.0001`) + * may help reduce artifacts in shadows. + * + * @type {number} + * @default 0 + */ + bias: number; + /** + * A node version of `bias`. Only supported with `WebGPURenderer`. + * + * If a bias node is defined, `bias` has no effect. + * + * @type {?Node} + * @default null + */ + biasNode: Node | null; + /** + * Defines how much the position used to query the shadow map is offset along + * the object normal. The default is `0`. Increasing this value can be used to + * reduce shadow acne especially in large scenes where light shines onto + * geometry at a shallow angle. The cost is that shadows may appear distorted. + * + * @type {number} + * @default 0 + */ + normalBias: number; + /** + * Setting this to values greater than 1 will blur the edges of the shadow. + * High values will cause unwanted banding effects in the shadows - a greater + * map size will allow for a higher value to be used here before these effects + * become visible. + * + * The property has no effect when the shadow map type is `BasicShadowMap`. + * + * @type {number} + * @default 1 + */ + radius: number; + /** + * The amount of samples to use when blurring a VSM shadow map. + * + * @type {number} + * @default 8 + */ + blurSamples: number; + /** + * Defines the width and height of the shadow map. Higher values give better quality + * shadows at the cost of computation time. Values must be powers of two. + * + * @type {Vector2} + * @default (512,512) + */ + mapSize: Vector2; + /** + * The type of shadow texture. The default is `UnsignedByteType`. + * + * @type {number} + * @default UnsignedByteType + */ + mapType: number; + /** + * The depth map generated using the internal camera; a location beyond a + * pixel's depth is in shadow. Computed internally during rendering. + * + * @type {?RenderTarget} + * @default null + */ + map: RenderTarget | null; + /** + * The distribution map generated using the internal camera; an occlusion is + * calculated based on the distribution of depths. Computed internally during + * rendering. + * + * @type {?RenderTarget} + * @default null + */ + mapPass: RenderTarget | null; + /** + * Model to shadow camera space, to compute location and depth in shadow map. + * This is computed internally during rendering. + * + * @type {Matrix4} + */ + matrix: Matrix4; + /** + * Enables automatic updates of the light's shadow. If you do not require dynamic + * lighting / shadows, you may set this to `false`. + * + * @type {boolean} + * @default true + */ + autoUpdate: boolean; + /** + * When set to `true`, shadow maps will be updated in the next `render` call. + * If you have set {@link LightShadow#autoUpdate} to `false`, you will need to + * set this property to `true` and then make a render call to update the light's shadow. + * + * @type {boolean} + * @default false + */ + needsUpdate: boolean; + _frustum: Frustum; + _frameExtents: Vector2; + _viewportCount: number; + _viewports: Vector4[]; + /** + * Used internally by the renderer to get the number of viewports that need + * to be rendered for this shadow. + * + * @return {number} The viewport count. + */ + getViewportCount(): number; + /** + * Gets the shadow cameras frustum. Used internally by the renderer to cull objects. + * + * @return {Frustum} The shadow camera frustum. + */ + getFrustum(): Frustum; + /** + * Update the matrices for the camera and shadow, used internally by the renderer. + * + * @param {Light} light - The light for which the shadow is being rendered. + */ + updateMatrices(light: Light): void; + /** + * Returns a viewport definition for the given viewport index. + * + * @param {number} viewportIndex - The viewport index. + * @return {Vector4} The viewport. + */ + getViewport(viewportIndex: number): Vector4; + /** + * Returns the frame extends. + * + * @return {Vector2} The frame extends. + */ + getFrameExtents(): Vector2; + /** + * Frees the GPU-related resources allocated by this instance. Call this + * method whenever this instance is no longer used in your app. + */ + dispose(): void; + /** + * Copies the values of the given light shadow instance to this instance. + * + * @param {LightShadow} source - The light shadow to copy. + * @return {LightShadow} A reference to this light shadow instance. + */ + copy(source: LightShadow): LightShadow; + /** + * Returns a new light shadow instance with copied values from this instance. + * + * @return {LightShadow} A clone of this instance. + */ + clone(): LightShadow; + /** + * Serializes the light shadow into JSON. + * + * @return {Object} A JSON object representing the serialized light shadow. + * @see {@link ObjectLoader#parse} + */ + toJSON(): Object; +} +import { Vector2 } from '../math/Vector2.js'; +import { Matrix4 } from '../math/Matrix4.js'; +import { Frustum } from '../math/Frustum.js'; +import { Vector4 } from '../math/Vector4.js'; diff --git a/jsdoc-testing/jsdoc/lights/PointLight.d.ts b/jsdoc-testing/jsdoc/lights/PointLight.d.ts new file mode 100644 index 000000000..f42ec0f7c --- /dev/null +++ b/jsdoc-testing/jsdoc/lights/PointLight.d.ts @@ -0,0 +1,70 @@ +/** + * A light that gets emitted from a single point in all directions. A common + * use case for this is to replicate the light emitted from a bare + * lightbulb. + * + * This light can cast shadows - see the {@link PointLightShadow} for details. + * + * ```js + * const light = new THREE.PointLight( 0xff0000, 1, 100 ); + * light.position.set( 50, 50, 50 ); + * scene.add( light ); + * ``` + * + * @augments Light + */ +export class PointLight extends Light { + /** + * Constructs a new point light. + * + * @param {(number|Color|string)} [color=0xffffff] - The light's color. + * @param {number} [intensity=1] - The light's strength/intensity measured in candela (cd). + * @param {number} [distance=0] - Maximum range of the light. `0` means no limit. + * @param {number} [decay=2] - The amount the light dims along the distance of the light. + */ + constructor(color?: (number | Color | string), intensity?: number, distance?: number, decay?: number); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isPointLight: boolean; + /** + * When distance is zero, light will attenuate according to inverse-square + * law to infinite distance. When distance is non-zero, light will attenuate + * according to inverse-square law until near the distance cutoff, where it + * will then attenuate quickly and smoothly to 0. Inherently, cutoffs are not + * physically correct. + * + * @type {number} + * @default 0 + */ + distance: number; + /** + * The amount the light dims along the distance of the light. In context of + * physically-correct rendering the default value should not be changed. + * + * @type {number} + * @default 2 + */ + decay: number; + /** + * This property holds the light's shadow configuration. + * + * @type {PointLightShadow} + */ + shadow: PointLightShadow; + set power(power: number); + /** + * The light's power. Power is the luminous power of the light measured in lumens (lm). + * Changing the power will also change the light's intensity. + * + * @type {number} + */ + get power(): number; + copy(source: any, recursive: any): this; +} +import { Light } from './Light.js'; +import { PointLightShadow } from './PointLightShadow.js'; diff --git a/jsdoc-testing/jsdoc/lights/PointLightShadow.d.ts b/jsdoc-testing/jsdoc/lights/PointLightShadow.d.ts new file mode 100644 index 000000000..9157a63b8 --- /dev/null +++ b/jsdoc-testing/jsdoc/lights/PointLightShadow.d.ts @@ -0,0 +1,20 @@ +/** + * Represents the shadow configuration of point lights. + * + * @augments LightShadow + */ +export class PointLightShadow extends LightShadow { + /** + * Constructs a new point light shadow. + */ + constructor(); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isPointLightShadow: boolean; +} +import { LightShadow } from './LightShadow.js'; diff --git a/jsdoc-testing/jsdoc/lights/RectAreaLight.d.ts b/jsdoc-testing/jsdoc/lights/RectAreaLight.d.ts new file mode 100644 index 000000000..6d4b7b657 --- /dev/null +++ b/jsdoc-testing/jsdoc/lights/RectAreaLight.d.ts @@ -0,0 +1,68 @@ +/** + * This class emits light uniformly across the face a rectangular plane. + * This light type can be used to simulate light sources such as bright + * windows or strip lighting. + * + * Important Notes: + * + * - There is no shadow support. + * - Only PBR materials are supported. + * - You have to include `RectAreaLightUniformsLib` (`WebGLRenderer`) or `RectAreaLightTexturesLib` (`WebGPURenderer`) + * into your app and init the uniforms/textures. + * + * ```js + * RectAreaLightUniformsLib.init(); // only relevant for WebGLRenderer + * THREE.RectAreaLightNode.setLTC( RectAreaLightTexturesLib.init() ); // only relevant for WebGPURenderer + * + * const intensity = 1; const width = 10; const height = 10; + * const rectLight = new THREE.RectAreaLight( 0xffffff, intensity, width, height ); + * rectLight.position.set( 5, 5, 0 ); + * rectLight.lookAt( 0, 0, 0 ); + * scene.add( rectLight ) + * ``` + * + * @augments Light + */ +export class RectAreaLight extends Light { + /** + * Constructs a new area light. + * + * @param {(number|Color|string)} [color=0xffffff] - The light's color. + * @param {number} [intensity=1] - The light's strength/intensity. + * @param {number} [width=10] - The width of the light. + * @param {number} [height=10] - The height of the light. + */ + constructor(color?: (number | Color | string), intensity?: number, width?: number, height?: number); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isRectAreaLight: boolean; + /** + * The width of the light. + * + * @type {number} + * @default 10 + */ + width: number; + /** + * The height of the light. + * + * @type {number} + * @default 10 + */ + height: number; + set power(power: number); + /** + * The light's power. Power is the luminous power of the light measured in lumens (lm). + * Changing the power will also change the light's intensity. + * + * @type {number} + */ + get power(): number; + copy(source: any): this; +} +import { Light } from './Light.js'; diff --git a/jsdoc-testing/jsdoc/lights/SpotLight.d.ts b/jsdoc-testing/jsdoc/lights/SpotLight.d.ts new file mode 100644 index 000000000..1197fdf27 --- /dev/null +++ b/jsdoc-testing/jsdoc/lights/SpotLight.d.ts @@ -0,0 +1,116 @@ +/** + * This light gets emitted from a single point in one direction, along a cone + * that increases in size the further from the light it gets. + * + * This light can cast shadows - see the {@link SpotLightShadow} for details. + * + * ```js + * // white spotlight shining from the side, modulated by a texture + * const spotLight = new THREE.SpotLight( 0xffffff ); + * spotLight.position.set( 100, 1000, 100 ); + * spotLight.map = new THREE.TextureLoader().load( url ); + * + * spotLight.castShadow = true; + * spotLight.shadow.mapSize.width = 1024; + * spotLight.shadow.mapSize.height = 1024; + * spotLight.shadow.camera.near = 500; + * spotLight.shadow.camera.far = 4000; + * spotLight.shadow.camera.fov = 30;s + * ``` + * + * @augments Light + */ +export class SpotLight extends Light { + /** + * Constructs a new spot light. + * + * @param {(number|Color|string)} [color=0xffffff] - The light's color. + * @param {number} [intensity=1] - The light's strength/intensity measured in candela (cd). + * @param {number} [distance=0] - Maximum range of the light. `0` means no limit. + * @param {number} [angle=Math.PI/3] - Maximum angle of light dispersion from its direction whose upper bound is `Math.PI/2`. + * @param {number} [penumbra=0] - Percent of the spotlight cone that is attenuated due to penumbra. Value range is `[0,1]`. + * @param {number} [decay=2] - The amount the light dims along the distance of the light. + */ + constructor(color?: (number | Color | string), intensity?: number, distance?: number, angle?: number, penumbra?: number, decay?: number); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isSpotLight: boolean; + /** + * The spot light points from its position to the + * target's position. + * + * For the target's position to be changed to anything other + * than the default, it must be added to the scene. + * + * It is also possible to set the target to be another 3D object + * in the scene. The light will now track the target object. + * + * @type {Object3D} + */ + target: Object3D; + /** + * Maximum range of the light. `0` means no limit. + * + * @type {number} + * @default 0 + */ + distance: number; + /** + * Maximum angle of light dispersion from its direction whose upper bound is `Math.PI/2`. + * + * @type {number} + * @default Math.PI/3 + */ + angle: number; + /** + * Percent of the spotlight cone that is attenuated due to penumbra. + * Value range is `[0,1]`. + * + * @type {number} + * @default 0 + */ + penumbra: number; + /** + * The amount the light dims along the distance of the light. In context of + * physically-correct rendering the default value should not be changed. + * + * @type {number} + * @default 2 + */ + decay: number; + /** + * A texture used to modulate the color of the light. The spot light + * color is mixed with the RGB value of this texture, with a ratio + * corresponding to its alpha value. The cookie-like masking effect is + * reproduced using pixel values (0, 0, 0, 1-cookie_value). + * + * *Warning*: This property is disabled if {@link Object3D#castShadow} is set to `false`. + * + * @type {?Texture} + * @default null + */ + map: Texture | null; + /** + * This property holds the light's shadow configuration. + * + * @type {SpotLightShadow} + */ + shadow: SpotLightShadow; + set power(power: number); + /** + * The light's power. Power is the luminous power of the light measured in lumens (lm). + * Changing the power will also change the light's intensity. + * + * @type {number} + */ + get power(): number; + copy(source: any, recursive: any): this; +} +import { Light } from './Light.js'; +import { Object3D } from '../core/Object3D.js'; +import { SpotLightShadow } from './SpotLightShadow.js'; diff --git a/jsdoc-testing/jsdoc/lights/SpotLightShadow.d.ts b/jsdoc-testing/jsdoc/lights/SpotLightShadow.d.ts new file mode 100644 index 000000000..0de4c95b0 --- /dev/null +++ b/jsdoc-testing/jsdoc/lights/SpotLightShadow.d.ts @@ -0,0 +1,37 @@ +/** + * Represents the shadow configuration of directional lights. + * + * @augments LightShadow + */ +export class SpotLightShadow extends LightShadow { + /** + * Constructs a new spot light shadow. + */ + constructor(); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isSpotLightShadow: boolean; + /** + * Used to focus the shadow camera. The camera's field of view is set as a + * percentage of the spotlight's field-of-view. Range is `[0, 1]`. + * + * @type {number} + * @default 1 + */ + focus: number; + /** + * Texture aspect ratio. + * + * @type {number} + * @default 1 + */ + aspect: number; + updateMatrices(light: any): void; + copy(source: any): this; +} +import { LightShadow } from './LightShadow.js'; diff --git a/jsdoc-testing/jsdoc/lights/webgpu/IESSpotLight.d.ts b/jsdoc-testing/jsdoc/lights/webgpu/IESSpotLight.d.ts new file mode 100644 index 000000000..0e372ff20 --- /dev/null +++ b/jsdoc-testing/jsdoc/lights/webgpu/IESSpotLight.d.ts @@ -0,0 +1,18 @@ +export default IESSpotLight; +/** + * A IES version of {@link SpotLight}. Can only be used with {@link WebGPURenderer}. + * + * @augments SpotLight + */ +declare class IESSpotLight extends SpotLight { + /** + * The IES map. It's a lookup table that stores normalized attenuation factors + * (0.0 to 1.0) that represent the light's intensity at a specific angle. + * + * @type {?Texture} + * @default null + */ + iesMap: Texture | null; + copy(source: any, recursive: any): this; +} +import { SpotLight } from '../SpotLight.js'; diff --git a/jsdoc-testing/jsdoc/lights/webgpu/ProjectorLight.d.ts b/jsdoc-testing/jsdoc/lights/webgpu/ProjectorLight.d.ts new file mode 100644 index 000000000..f561855ff --- /dev/null +++ b/jsdoc-testing/jsdoc/lights/webgpu/ProjectorLight.d.ts @@ -0,0 +1,17 @@ +export default ProjectorLight; +/** + * A projector light version of {@link SpotLight}. Can only be used with {@link WebGPURenderer}. + * + * @augments SpotLight + */ +declare class ProjectorLight extends SpotLight { + /** + * Aspect ratio of the light. Set to `null` to use the texture aspect ratio. + * + * @type {?number} + * @default null + */ + aspect: number | null; + copy(source: any, recursive: any): this; +} +import { SpotLight } from '../SpotLight.js'; diff --git a/jsdoc-testing/jsdoc/materials/LineBasicMaterial.d.ts b/jsdoc-testing/jsdoc/materials/LineBasicMaterial.d.ts new file mode 100644 index 000000000..64e5c7024 --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/LineBasicMaterial.d.ts @@ -0,0 +1,86 @@ +/** + * A material for rendering line primitives. + * + * Materials define the appearance of renderable 3D objects. + * + * ```js + * const material = new THREE.LineBasicMaterial( { color: 0xffffff } ); + * ``` + * + * @augments Material + */ +export class LineBasicMaterial extends Material { + /** + * Constructs a new line basic material. + * + * @param {Object} [parameters] - An object with one or more properties + * defining the material's appearance. Any property of the material + * (including any property from inherited materials) can be passed + * in here. Color values can be passed any type of value accepted + * by {@link Color#set}. + */ + constructor(parameters?: Object); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isLineBasicMaterial: boolean; + type: string; + /** + * Color of the material. + * + * @type {Color} + * @default (1,1,1) + */ + color: Color; + /** + * Sets the color of the lines using data from a texture. The texture map + * color is modulated by the diffuse `color`. + * + * @type {?Texture} + * @default null + */ + map: Texture | null; + /** + * Controls line thickness or lines. + * + * Can only be used with {@link SVGRenderer}. WebGL and WebGPU + * ignore this setting and always render line primitives with a + * width of one pixel. + * + * @type {number} + * @default 1 + */ + linewidth: number; + /** + * Defines appearance of line ends. + * + * Can only be used with {@link SVGRenderer}. + * + * @type {('butt'|'round'|'square')} + * @default 'round' + */ + linecap: ("butt" | "round" | "square"); + /** + * Defines appearance of line joints. + * + * Can only be used with {@link SVGRenderer}. + * + * @type {('round'|'bevel'|'miter')} + * @default 'round' + */ + linejoin: ("round" | "bevel" | "miter"); + /** + * Whether the material is affected by fog or not. + * + * @type {boolean} + * @default true + */ + fog: boolean; + copy(source: any): this; +} +import { Material } from './Material.js'; +import { Color } from '../math/Color.js'; diff --git a/jsdoc-testing/jsdoc/materials/LineDashedMaterial.d.ts b/jsdoc-testing/jsdoc/materials/LineDashedMaterial.d.ts new file mode 100644 index 000000000..3cb1a34d8 --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/LineDashedMaterial.d.ts @@ -0,0 +1,49 @@ +/** + * A material for rendering line primitives. + * + * Materials define the appearance of renderable 3D objects. + * + * ```js + * const material = new THREE.LineDashedMaterial( { + * color: 0xffffff, + * scale: 1, + * dashSize: 3, + * gapSize: 1, + * } ); + * ``` + * + * @augments LineBasicMaterial + */ +export class LineDashedMaterial extends LineBasicMaterial { + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isLineDashedMaterial: boolean; + /** + * The scale of the dashed part of a line. + * + * @type {number} + * @default 1 + */ + scale: number; + /** + * The size of the dash. This is both the gap with the stroke. + * + * @type {number} + * @default 3 + */ + dashSize: number; + /** + * The size of the gap. + * + * @type {number} + * @default 1 + */ + gapSize: number; + copy(source: any): this; +} +import { LineBasicMaterial } from './LineBasicMaterial.js'; diff --git a/jsdoc-testing/jsdoc/materials/Material.d.ts b/jsdoc-testing/jsdoc/materials/Material.d.ts new file mode 100644 index 000000000..c05cd91f7 --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/Material.d.ts @@ -0,0 +1,497 @@ +/** + * Abstract base class for materials. + * + * Materials define the appearance of renderable 3D objects. + * + * @abstract + * @augments EventDispatcher + */ +export class Material extends EventDispatcher { + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isMaterial: boolean; + /** + * The UUID of the material. + * + * @type {string} + * @readonly + */ + readonly uuid: string; + /** + * The name of the material. + * + * @type {string} + */ + name: string; + /** + * The type property is used for detecting the object type + * in context of serialization/deserialization. + * + * @type {string} + * @readonly + */ + readonly type: string; + /** + * Defines the blending type of the material. + * + * It must be set to `CustomBlending` if custom blending properties like + * {@link Material#blendSrc}, {@link Material#blendDst} or {@link Material#blendEquation} + * should have any effect. + * + * @type {(NoBlending|NormalBlending|AdditiveBlending|SubtractiveBlending|MultiplyBlending|CustomBlending)} + * @default NormalBlending + */ + blending: (NoBlending | number | AdditiveBlending | SubtractiveBlending | MultiplyBlending | CustomBlending); + /** + * Defines which side of faces will be rendered - front, back or both. + * + * @type {(FrontSide|BackSide|DoubleSide)} + * @default FrontSide + */ + side: (number | BackSide | DoubleSide); + /** + * If set to `true`, vertex colors should be used. + * + * The engine supports RGB and RGBA vertex colors depending on whether a three (RGB) or + * four (RGBA) component color buffer attribute is used. + * + * @type {boolean} + * @default false + */ + vertexColors: boolean; + /** + * Defines how transparent the material is. + * A value of `0.0` indicates fully transparent, `1.0` is fully opaque. + * + * If the {@link Material#transparent} is not set to `true`, + * the material will remain fully opaque and this value will only affect its color. + * + * @type {number} + * @default 1 + */ + opacity: number; + /** + * Defines whether this material is transparent. This has an effect on + * rendering as transparent objects need special treatment and are rendered + * after non-transparent objects. + * + * When set to true, the extent to which the material is transparent is + * controlled by {@link Material#opacity}. + * + * @type {boolean} + * @default false + */ + transparent: boolean; + /** + * Enables alpha hashed transparency, an alternative to {@link Material#transparent} or + * {@link Material#alphaTest}. The material will not be rendered if opacity is lower than + * a random threshold. Randomization introduces some grain or noise, but approximates alpha + * blending without the associated problems of sorting. Using TAA can reduce the resulting noise. + * + * @type {boolean} + * @default false + */ + alphaHash: boolean; + /** + * Defines the blending source factor. + * + * @type {(ZeroFactor|OneFactor|SrcColorFactor|OneMinusSrcColorFactor|SrcAlphaFactor|OneMinusSrcAlphaFactor|DstAlphaFactor|OneMinusDstAlphaFactor|DstColorFactor|OneMinusDstColorFactor|SrcAlphaSaturateFactor|ConstantColorFactor|OneMinusConstantColorFactor|ConstantAlphaFactor|OneMinusConstantAlphaFactor)} + * @default SrcAlphaFactor + */ + blendSrc: (ZeroFactor | OneFactor | SrcColorFactor | OneMinusSrcColorFactor | number | number | DstAlphaFactor | OneMinusDstAlphaFactor | DstColorFactor | OneMinusDstColorFactor | SrcAlphaSaturateFactor | ConstantColorFactor | OneMinusConstantColorFactor | ConstantAlphaFactor | OneMinusConstantAlphaFactor); + /** + * Defines the blending destination factor. + * + * @type {(ZeroFactor|OneFactor|SrcColorFactor|OneMinusSrcColorFactor|SrcAlphaFactor|OneMinusSrcAlphaFactor|DstAlphaFactor|OneMinusDstAlphaFactor|DstColorFactor|OneMinusDstColorFactor|SrcAlphaSaturateFactor|ConstantColorFactor|OneMinusConstantColorFactor|ConstantAlphaFactor|OneMinusConstantAlphaFactor)} + * @default OneMinusSrcAlphaFactor + */ + blendDst: (ZeroFactor | OneFactor | SrcColorFactor | OneMinusSrcColorFactor | number | number | DstAlphaFactor | OneMinusDstAlphaFactor | DstColorFactor | OneMinusDstColorFactor | SrcAlphaSaturateFactor | ConstantColorFactor | OneMinusConstantColorFactor | ConstantAlphaFactor | OneMinusConstantAlphaFactor); + /** + * Defines the blending equation. + * + * @type {(AddEquation|SubtractEquation|ReverseSubtractEquation|MinEquation|MaxEquation)} + * @default AddEquation + */ + blendEquation: (number | SubtractEquation | ReverseSubtractEquation | MinEquation | MaxEquation); + /** + * Defines the blending source alpha factor. + * + * @type {?(ZeroFactor|OneFactor|SrcColorFactor|OneMinusSrcColorFactor|SrcAlphaFactor|OneMinusSrcAlphaFactor|DstAlphaFactor|OneMinusDstAlphaFactor|DstColorFactor|OneMinusDstColorFactor|SrcAlphaSaturateFactor|ConstantColorFactor|OneMinusConstantColorFactor|ConstantAlphaFactor|OneMinusConstantAlphaFactor)} + * @default null + */ + blendSrcAlpha: (ZeroFactor | OneFactor | SrcColorFactor | OneMinusSrcColorFactor | number | number | DstAlphaFactor | OneMinusDstAlphaFactor | DstColorFactor | OneMinusDstColorFactor | SrcAlphaSaturateFactor | ConstantColorFactor | OneMinusConstantColorFactor | ConstantAlphaFactor | OneMinusConstantAlphaFactor) | null; + /** + * Defines the blending destination alpha factor. + * + * @type {?(ZeroFactor|OneFactor|SrcColorFactor|OneMinusSrcColorFactor|SrcAlphaFactor|OneMinusSrcAlphaFactor|DstAlphaFactor|OneMinusDstAlphaFactor|DstColorFactor|OneMinusDstColorFactor|SrcAlphaSaturateFactor|ConstantColorFactor|OneMinusConstantColorFactor|ConstantAlphaFactor|OneMinusConstantAlphaFactor)} + * @default null + */ + blendDstAlpha: (ZeroFactor | OneFactor | SrcColorFactor | OneMinusSrcColorFactor | number | number | DstAlphaFactor | OneMinusDstAlphaFactor | DstColorFactor | OneMinusDstColorFactor | SrcAlphaSaturateFactor | ConstantColorFactor | OneMinusConstantColorFactor | ConstantAlphaFactor | OneMinusConstantAlphaFactor) | null; + /** + * Defines the blending equation of the alpha channel. + * + * @type {?(AddEquation|SubtractEquation|ReverseSubtractEquation|MinEquation|MaxEquation)} + * @default null + */ + blendEquationAlpha: (number | SubtractEquation | ReverseSubtractEquation | MinEquation | MaxEquation) | null; + /** + * Represents the RGB values of the constant blend color. + * + * This property has only an effect when using custom blending with `ConstantColor` or `OneMinusConstantColor`. + * + * @type {Color} + * @default (0,0,0) + */ + blendColor: Color; + /** + * Represents the alpha value of the constant blend color. + * + * This property has only an effect when using custom blending with `ConstantAlpha` or `OneMinusConstantAlpha`. + * + * @type {number} + * @default 0 + */ + blendAlpha: number; + /** + * Defines the depth function. + * + * @type {(NeverDepth|AlwaysDepth|LessDepth|LessEqualDepth|EqualDepth|GreaterEqualDepth|GreaterDepth|NotEqualDepth)} + * @default LessEqualDepth + */ + depthFunc: (NeverDepth | AlwaysDepth | LessDepth | number | EqualDepth | GreaterEqualDepth | GreaterDepth | NotEqualDepth); + /** + * Whether to have depth test enabled when rendering this material. + * When the depth test is disabled, the depth write will also be implicitly disabled. + * + * @type {boolean} + * @default true + */ + depthTest: boolean; + /** + * Whether rendering this material has any effect on the depth buffer. + * + * When drawing 2D overlays it can be useful to disable the depth writing in + * order to layer several things together without creating z-index artifacts. + * + * @type {boolean} + * @default true + */ + depthWrite: boolean; + /** + * The bit mask to use when writing to the stencil buffer. + * + * @type {number} + * @default 0xff + */ + stencilWriteMask: number; + /** + * The stencil comparison function to use. + * + * @type {NeverStencilFunc|LessStencilFunc|EqualStencilFunc|LessEqualStencilFunc|GreaterStencilFunc|NotEqualStencilFunc|GreaterEqualStencilFunc|AlwaysStencilFunc} + * @default AlwaysStencilFunc + */ + stencilFunc: NeverStencilFunc | LessStencilFunc | EqualStencilFunc | LessEqualStencilFunc | GreaterStencilFunc | NotEqualStencilFunc | GreaterEqualStencilFunc | number; + /** + * The value to use when performing stencil comparisons or stencil operations. + * + * @type {number} + * @default 0 + */ + stencilRef: number; + /** + * The bit mask to use when comparing against the stencil buffer. + * + * @type {number} + * @default 0xff + */ + stencilFuncMask: number; + /** + * Which stencil operation to perform when the comparison function returns `false`. + * + * @type {ZeroStencilOp|KeepStencilOp|ReplaceStencilOp|IncrementStencilOp|DecrementStencilOp|IncrementWrapStencilOp|DecrementWrapStencilOp|InvertStencilOp} + * @default KeepStencilOp + */ + stencilFail: ZeroStencilOp | number | ReplaceStencilOp | IncrementStencilOp | DecrementStencilOp | IncrementWrapStencilOp | DecrementWrapStencilOp | InvertStencilOp; + /** + * Which stencil operation to perform when the comparison function returns + * `true` but the depth test fails. + * + * @type {ZeroStencilOp|KeepStencilOp|ReplaceStencilOp|IncrementStencilOp|DecrementStencilOp|IncrementWrapStencilOp|DecrementWrapStencilOp|InvertStencilOp} + * @default KeepStencilOp + */ + stencilZFail: ZeroStencilOp | number | ReplaceStencilOp | IncrementStencilOp | DecrementStencilOp | IncrementWrapStencilOp | DecrementWrapStencilOp | InvertStencilOp; + /** + * Which stencil operation to perform when the comparison function returns + * `true` and the depth test passes. + * + * @type {ZeroStencilOp|KeepStencilOp|ReplaceStencilOp|IncrementStencilOp|DecrementStencilOp|IncrementWrapStencilOp|DecrementWrapStencilOp|InvertStencilOp} + * @default KeepStencilOp + */ + stencilZPass: ZeroStencilOp | number | ReplaceStencilOp | IncrementStencilOp | DecrementStencilOp | IncrementWrapStencilOp | DecrementWrapStencilOp | InvertStencilOp; + /** + * Whether stencil operations are performed against the stencil buffer. In + * order to perform writes or comparisons against the stencil buffer this + * value must be `true`. + * + * @type {boolean} + * @default false + */ + stencilWrite: boolean; + /** + * User-defined clipping planes specified as THREE.Plane objects in world + * space. These planes apply to the objects this material is attached to. + * Points in space whose signed distance to the plane is negative are clipped + * (not rendered). This requires {@link WebGLRenderer#localClippingEnabled} to + * be `true`. + * + * @type {?Array} + * @default null + */ + clippingPlanes: Array | null; + /** + * Changes the behavior of clipping planes so that only their intersection is + * clipped, rather than their union. + * + * @type {boolean} + * @default false + */ + clipIntersection: boolean; + /** + * Defines whether to clip shadows according to the clipping planes specified + * on this material. + * + * @type {boolean} + * @default false + */ + clipShadows: boolean; + /** + * Defines which side of faces cast shadows. If `null`, the side casting shadows + * is determined as follows: + * + * - When {@link Material#side} is set to `FrontSide`, the back side cast shadows. + * - When {@link Material#side} is set to `BackSide`, the front side cast shadows. + * - When {@link Material#side} is set to `DoubleSide`, both sides cast shadows. + * + * @type {?(FrontSide|BackSide|DoubleSide)} + * @default null + */ + shadowSide: (number | BackSide | DoubleSide) | null; + /** + * Whether to render the material's color. + * + * This can be used in conjunction with {@link Object3D#renderOder} to create invisible + * objects that occlude other objects. + * + * @type {boolean} + * @default true + */ + colorWrite: boolean; + /** + * Override the renderer's default precision for this material. + * + * @type {?('highp'|'mediump'|'lowp')} + * @default null + */ + precision: ("highp" | "mediump" | "lowp") | null; + /** + * Whether to use polygon offset or not. When enabled, each fragment's depth value will + * be offset after it is interpolated from the depth values of the appropriate vertices. + * The offset is added before the depth test is performed and before the value is written + * into the depth buffer. + * + * Can be useful for rendering hidden-line images, for applying decals to surfaces, and for + * rendering solids with highlighted edges. + * + * @type {boolean} + * @default false + */ + polygonOffset: boolean; + /** + * Specifies a scale factor that is used to create a variable depth offset for each polygon. + * + * @type {number} + * @default 0 + */ + polygonOffsetFactor: number; + /** + * Is multiplied by an implementation-specific value to create a constant depth offset. + * + * @type {number} + * @default 0 + */ + polygonOffsetUnits: number; + /** + * Whether to apply dithering to the color to remove the appearance of banding. + * + * @type {boolean} + * @default false + */ + dithering: boolean; + /** + * Whether alpha to coverage should be enabled or not. Can only be used with MSAA-enabled contexts + * (meaning when the renderer was created with *antialias* parameter set to `true`). Enabling this + * will smooth aliasing on clip plane edges and alphaTest-clipped edges. + * + * @type {boolean} + * @default false + */ + alphaToCoverage: boolean; + /** + * Whether to premultiply the alpha (transparency) value. + * + * @type {boolean} + * @default false + */ + premultipliedAlpha: boolean; + /** + * Whether double-sided, transparent objects should be rendered with a single pass or not. + * + * The engine renders double-sided, transparent objects with two draw calls (back faces first, + * then front faces) to mitigate transparency artifacts. There are scenarios however where this + * approach produces no quality gains but still doubles draw calls e.g. when rendering flat + * vegetation like grass sprites. In these cases, set the `forceSinglePass` flag to `true` to + * disable the two pass rendering to avoid performance issues. + * + * @type {boolean} + * @default false + */ + forceSinglePass: boolean; + /** + * Whether it's possible to override the material with {@link Scene#overrideMaterial} or not. + * + * @type {boolean} + * @default true + */ + allowOverride: boolean; + /** + * Defines whether 3D objects using this material are visible. + * + * @type {boolean} + * @default true + */ + visible: boolean; + /** + * Defines whether this material is tone mapped according to the renderer's tone mapping setting. + * + * It is ignored when rendering to a render target or using post processing or when using + * `WebGPURenderer`. In all these cases, all materials are honored by tone mapping. + * + * @type {boolean} + * @default true + */ + toneMapped: boolean; + /** + * An object that can be used to store custom data about the Material. It + * should not hold references to functions as these will not be cloned. + * + * @type {Object} + */ + userData: Object; + /** + * This starts at `0` and counts how many times {@link Material#needsUpdate} is set to `true`. + * + * @type {number} + * @readonly + * @default 0 + */ + readonly version: number; + _alphaTest: number; + readonly set alphaTest(value: number); + /** + * Sets the alpha value to be used when running an alpha test. The material + * will not be rendered if the opacity is lower than this value. + * + * @type {number} + * @readonly + * @default 0 + */ + readonly get alphaTest(): number; + /** + * An optional callback that is executed immediately before the material is used to render a 3D object. + * + * This method can only be used when rendering with {@link WebGLRenderer}. + * + * @param {WebGLRenderer} renderer - The renderer. + * @param {Scene} scene - The scene. + * @param {Camera} camera - The camera that is used to render the scene. + * @param {BufferGeometry} geometry - The 3D object's geometry. + * @param {Object3D} object - The 3D object. + * @param {Object} group - The geometry group data. + */ + onBeforeRender(): void; + /** + * An optional callback that is executed immediately before the shader + * program is compiled. This function is called with the shader source code + * as a parameter. Useful for the modification of built-in materials. + * + * This method can only be used when rendering with {@link WebGLRenderer}. The + * recommended approach when customizing materials is to use `WebGPURenderer` with the new + * Node Material system and [TSL](https://github.com/mrdoob/three.js/wiki/Three.js-Shading-Language). + * + * @param {{vertexShader:string,fragmentShader:string,uniforms:Object}} shaderobject - The object holds the uniforms and the vertex and fragment shader source. + * @param {WebGLRenderer} renderer - A reference to the renderer. + */ + onBeforeCompile(): void; + /** + * In case {@link Material#onBeforeCompile} is used, this callback can be used to identify + * values of settings used in `onBeforeCompile()`, so three.js can reuse a cached + * shader or recompile the shader for this material as needed. + * + * This method can only be used when rendering with {@link WebGLRenderer}. + * + * @return {string} The custom program cache key. + */ + customProgramCacheKey(): string; + /** + * This method can be used to set default values from parameter objects. + * It is a generic implementation so it can be used with different types + * of materials. + * + * @param {Object} [values] - The material values to set. + */ + setValues(values?: Object): void; + /** + * Serializes the material into JSON. + * + * @param {?(Object|string)} meta - An optional value holding meta information about the serialization. + * @return {Object} A JSON object representing the serialized material. + * @see {@link ObjectLoader#parse} + */ + toJSON(meta: (Object | string) | null): Object; + /** + * Returns a new material with copied values from this instance. + * + * @return {Material} A clone of this instance. + */ + clone(): Material; + /** + * Copies the values of the given material to this instance. + * + * @param {Material} source - The material to copy. + * @return {Material} A reference to this instance. + */ + copy(source: Material): Material; + /** + * Frees the GPU-related resources allocated by this instance. Call this + * method whenever this instance is no longer used in your app. + * + * @fires Material#dispose + */ + dispose(): void; + /** + * Setting this property to `true` indicates the engine the material + * needs to be recompiled. + * + * @type {boolean} + * @default false + * @param {boolean} value + */ + set needsUpdate(value: boolean); +} +import { EventDispatcher } from '../core/EventDispatcher.js'; +import { Color } from '../math/Color.js'; diff --git a/jsdoc-testing/jsdoc/materials/Materials.d.ts b/jsdoc-testing/jsdoc/materials/Materials.d.ts new file mode 100644 index 000000000..3f555b856 --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/Materials.d.ts @@ -0,0 +1,19 @@ +import { ShadowMaterial } from './ShadowMaterial.js'; +import { SpriteMaterial } from './SpriteMaterial.js'; +import { RawShaderMaterial } from './RawShaderMaterial.js'; +import { ShaderMaterial } from './ShaderMaterial.js'; +import { PointsMaterial } from './PointsMaterial.js'; +import { MeshPhysicalMaterial } from './MeshPhysicalMaterial.js'; +import { MeshStandardMaterial } from './MeshStandardMaterial.js'; +import { MeshPhongMaterial } from './MeshPhongMaterial.js'; +import { MeshToonMaterial } from './MeshToonMaterial.js'; +import { MeshNormalMaterial } from './MeshNormalMaterial.js'; +import { MeshLambertMaterial } from './MeshLambertMaterial.js'; +import { MeshDepthMaterial } from './MeshDepthMaterial.js'; +import { MeshDistanceMaterial } from './MeshDistanceMaterial.js'; +import { MeshBasicMaterial } from './MeshBasicMaterial.js'; +import { MeshMatcapMaterial } from './MeshMatcapMaterial.js'; +import { LineDashedMaterial } from './LineDashedMaterial.js'; +import { LineBasicMaterial } from './LineBasicMaterial.js'; +import { Material } from './Material.js'; +export { ShadowMaterial, SpriteMaterial, RawShaderMaterial, ShaderMaterial, PointsMaterial, MeshPhysicalMaterial, MeshStandardMaterial, MeshPhongMaterial, MeshToonMaterial, MeshNormalMaterial, MeshLambertMaterial, MeshDepthMaterial, MeshDistanceMaterial, MeshBasicMaterial, MeshMatcapMaterial, LineDashedMaterial, LineBasicMaterial, Material }; diff --git a/jsdoc-testing/jsdoc/materials/MeshBasicMaterial.d.ts b/jsdoc-testing/jsdoc/materials/MeshBasicMaterial.d.ts new file mode 100644 index 000000000..83636586f --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/MeshBasicMaterial.d.ts @@ -0,0 +1,184 @@ +/** + * A material for drawing geometries in a simple shaded (flat or wireframe) way. + * + * This material is not affected by lights. + * + * @augments Material + * @demo scenes/material-browser.html#MeshBasicMaterial + */ +export class MeshBasicMaterial extends Material { + /** + * Constructs a new mesh basic material. + * + * @param {Object} [parameters] - An object with one or more properties + * defining the material's appearance. Any property of the material + * (including any property from inherited materials) can be passed + * in here. Color values can be passed any type of value accepted + * by {@link Color#set}. + */ + constructor(parameters?: Object); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isMeshBasicMaterial: boolean; + type: string; + /** + * Color of the material. + * + * @type {Color} + * @default (1,1,1) + */ + color: Color; + /** + * The color map. May optionally include an alpha channel, typically combined + * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map + * color is modulated by the diffuse `color`. + * + * @type {?Texture} + * @default null + */ + map: Texture | null; + /** + * The light map. Requires a second set of UVs. + * + * @type {?Texture} + * @default null + */ + lightMap: Texture | null; + /** + * Intensity of the baked light. + * + * @type {number} + * @default 1 + */ + lightMapIntensity: number; + /** + * The red channel of this texture is used as the ambient occlusion map. + * Requires a second set of UVs. + * + * @type {?Texture} + * @default null + */ + aoMap: Texture | null; + /** + * Intensity of the ambient occlusion effect. Range is `[0,1]`, where `0` + * disables ambient occlusion. Where intensity is `1` and the AO map's + * red channel is also `1`, ambient light is fully occluded on a surface. + * + * @type {number} + * @default 1 + */ + aoMapIntensity: number; + /** + * Specular map used by the material. + * + * @type {?Texture} + * @default null + */ + specularMap: Texture | null; + /** + * The alpha map is a grayscale texture that controls the opacity across the + * surface (black: fully transparent; white: fully opaque). + * + * Only the color of the texture is used, ignoring the alpha channel if one + * exists. For RGB and RGBA textures, the renderer will use the green channel + * when sampling this texture due to the extra bit of precision provided for + * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and + * luminance/alpha textures will also still work as expected. + * + * @type {?Texture} + * @default null + */ + alphaMap: Texture | null; + /** + * The environment map. + * + * @type {?Texture} + * @default null + */ + envMap: Texture | null; + /** + * The rotation of the environment map in radians. + * + * @type {Euler} + * @default (0,0,0) + */ + envMapRotation: Euler; + /** + * How to combine the result of the surface's color with the environment map, if any. + * + * When set to `MixOperation`, the {@link MeshBasicMaterial#reflectivity} is used to + * blend between the two colors. + * + * @type {(MultiplyOperation|MixOperation|AddOperation)} + * @default MultiplyOperation + */ + combine: (number | MixOperation | AddOperation); + /** + * How much the environment map affects the surface. + * The valid range is between `0` (no reflections) and `1` (full reflections). + * + * @type {number} + * @default 1 + */ + reflectivity: number; + /** + * The index of refraction (IOR) of air (approximately 1) divided by the + * index of refraction of the material. It is used with environment mapping + * modes {@link CubeRefractionMapping} and {@link EquirectangularRefractionMapping}. + * The refraction ratio should not exceed `1`. + * + * @type {number} + * @default 0.98 + */ + refractionRatio: number; + /** + * Renders the geometry as a wireframe. + * + * @type {boolean} + * @default false + */ + wireframe: boolean; + /** + * Controls the thickness of the wireframe. + * + * Can only be used with {@link SVGRenderer}. + * + * @type {number} + * @default 1 + */ + wireframeLinewidth: number; + /** + * Defines appearance of wireframe ends. + * + * Can only be used with {@link SVGRenderer}. + * + * @type {('round'|'bevel'|'miter')} + * @default 'round' + */ + wireframeLinecap: ("round" | "bevel" | "miter"); + /** + * Defines appearance of wireframe joints. + * + * Can only be used with {@link SVGRenderer}. + * + * @type {('round'|'bevel'|'miter')} + * @default 'round' + */ + wireframeLinejoin: ("round" | "bevel" | "miter"); + /** + * Whether the material is affected by fog or not. + * + * @type {boolean} + * @default true + */ + fog: boolean; + copy(source: any): this; +} +import { Material } from './Material.js'; +import { Color } from '../math/Color.js'; +import { Euler } from '../math/Euler.js'; diff --git a/jsdoc-testing/jsdoc/materials/MeshDepthMaterial.d.ts b/jsdoc-testing/jsdoc/materials/MeshDepthMaterial.d.ts new file mode 100644 index 000000000..a85883a0e --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/MeshDepthMaterial.d.ts @@ -0,0 +1,106 @@ +/** + * A material for drawing geometry by depth. Depth is based off of the camera + * near and far plane. White is nearest, black is farthest. + * + * @augments Material + * @demo scenes/material-browser.html#MeshDepthMaterial + */ +export class MeshDepthMaterial extends Material { + /** + * Constructs a new mesh depth material. + * + * @param {Object} [parameters] - An object with one or more properties + * defining the material's appearance. Any property of the material + * (including any property from inherited materials) can be passed + * in here. Color values can be passed any type of value accepted + * by {@link Color#set}. + */ + constructor(parameters?: Object); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isMeshDepthMaterial: boolean; + type: string; + /** + * Type for depth packing. + * + * @type {(BasicDepthPacking|RGBADepthPacking|RGBDepthPacking|RGDepthPacking)} + * @default BasicDepthPacking + */ + depthPacking: (number | RGBADepthPacking | RGBDepthPacking | RGDepthPacking); + /** + * The color map. May optionally include an alpha channel, typically combined + * with {@link Material#transparent} or {@link Material#alphaTest}. + * + * @type {?Texture} + * @default null + */ + map: Texture | null; + /** + * The alpha map is a grayscale texture that controls the opacity across the + * surface (black: fully transparent; white: fully opaque). + * + * Only the color of the texture is used, ignoring the alpha channel if one + * exists. For RGB and RGBA textures, the renderer will use the green channel + * when sampling this texture due to the extra bit of precision provided for + * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and + * luminance/alpha textures will also still work as expected. + * + * @type {?Texture} + * @default null + */ + alphaMap: Texture | null; + /** + * The displacement map affects the position of the mesh's vertices. Unlike + * other maps which only affect the light and shade of the material the + * displaced vertices can cast shadows, block other objects, and otherwise + * act as real geometry. The displacement texture is an image where the value + * of each pixel (white being the highest) is mapped against, and + * repositions, the vertices of the mesh. + * + * @type {?Texture} + * @default null + */ + displacementMap: Texture | null; + /** + * How much the displacement map affects the mesh (where black is no + * displacement, and white is maximum displacement). Without a displacement + * map set, this value is not applied. + * + * @type {number} + * @default 0 + */ + displacementScale: number; + /** + * The offset of the displacement map's values on the mesh's vertices. + * The bias is added to the scaled sample of the displacement map. + * Without a displacement map set, this value is not applied. + * + * @type {number} + * @default 0 + */ + displacementBias: number; + /** + * Renders the geometry as a wireframe. + * + * @type {boolean} + * @default false + */ + wireframe: boolean; + /** + * Controls the thickness of the wireframe. + * + * WebGL and WebGPU ignore this property and always render + * 1 pixel wide lines. + * + * @type {number} + * @default 1 + */ + wireframeLinewidth: number; + copy(source: any): this; +} +import { Material } from './Material.js'; diff --git a/jsdoc-testing/jsdoc/materials/MeshDistanceMaterial.d.ts b/jsdoc-testing/jsdoc/materials/MeshDistanceMaterial.d.ts new file mode 100644 index 000000000..bddc4ff5c --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/MeshDistanceMaterial.d.ts @@ -0,0 +1,86 @@ +/** + * A material used internally for implementing shadow mapping with + * point lights. + * + * Can also be used to customize the shadow casting of an object by assigning + * an instance of `MeshDistanceMaterial` to {@link Object3D#customDistanceMaterial}. + * The following examples demonstrates this approach in order to ensure + * transparent parts of objects do not cast shadows. + * + * @augments Material + */ +export class MeshDistanceMaterial extends Material { + /** + * Constructs a new mesh distance material. + * + * @param {Object} [parameters] - An object with one or more properties + * defining the material's appearance. Any property of the material + * (including any property from inherited materials) can be passed + * in here. Color values can be passed any type of value accepted + * by {@link Color#set}. + */ + constructor(parameters?: Object); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isMeshDistanceMaterial: boolean; + type: string; + /** + * The color map. May optionally include an alpha channel, typically combined + * with {@link Material#transparent} or {@link Material#alphaTest}. + * + * @type {?Texture} + * @default null + */ + map: Texture | null; + /** + * The alpha map is a grayscale texture that controls the opacity across the + * surface (black: fully transparent; white: fully opaque). + * + * Only the color of the texture is used, ignoring the alpha channel if one + * exists. For RGB and RGBA textures, the renderer will use the green channel + * when sampling this texture due to the extra bit of precision provided for + * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and + * luminance/alpha textures will also still work as expected. + * + * @type {?Texture} + * @default null + */ + alphaMap: Texture | null; + /** + * The displacement map affects the position of the mesh's vertices. Unlike + * other maps which only affect the light and shade of the material the + * displaced vertices can cast shadows, block other objects, and otherwise + * act as real geometry. The displacement texture is an image where the value + * of each pixel (white being the highest) is mapped against, and + * repositions, the vertices of the mesh. + * + * @type {?Texture} + * @default null + */ + displacementMap: Texture | null; + /** + * How much the displacement map affects the mesh (where black is no + * displacement, and white is maximum displacement). Without a displacement + * map set, this value is not applied. + * + * @type {number} + * @default 0 + */ + displacementScale: number; + /** + * The offset of the displacement map's values on the mesh's vertices. + * The bias is added to the scaled sample of the displacement map. + * Without a displacement map set, this value is not applied. + * + * @type {number} + * @default 0 + */ + displacementBias: number; + copy(source: any): this; +} +import { Material } from './Material.js'; diff --git a/jsdoc-testing/jsdoc/materials/MeshLambertMaterial.d.ts b/jsdoc-testing/jsdoc/materials/MeshLambertMaterial.d.ts new file mode 100644 index 000000000..d83f9155b --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/MeshLambertMaterial.d.ts @@ -0,0 +1,305 @@ +/** + * A material for non-shiny surfaces, without specular highlights. + * + * The material uses a non-physically based [Lambertian](https://en.wikipedia.org/wiki/Lambertian_reflectance) + * model for calculating reflectance. This can simulate some surfaces (such + * as untreated wood or stone) well, but cannot simulate shiny surfaces with + * specular highlights (such as varnished wood). `MeshLambertMaterial` uses per-fragment + * shading. + * + * Due to the simplicity of the reflectance and illumination models, + * performance will be greater when using this material over the + * {@link MeshPhongMaterial}, {@link MeshStandardMaterial} or + * {@link MeshPhysicalMaterial}, at the cost of some graphical accuracy. + * + * @augments Material + * @demo scenes/material-browser.html#MeshLambertMaterial + */ +export class MeshLambertMaterial extends Material { + /** + * Constructs a new mesh lambert material. + * + * @param {Object} [parameters] - An object with one or more properties + * defining the material's appearance. Any property of the material + * (including any property from inherited materials) can be passed + * in here. Color values can be passed any type of value accepted + * by {@link Color#set}. + */ + constructor(parameters?: Object); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isMeshLambertMaterial: boolean; + type: string; + /** + * Color of the material. + * + * @type {Color} + * @default (1,1,1) + */ + color: Color; + /** + * The color map. May optionally include an alpha channel, typically combined + * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map + * color is modulated by the diffuse `color`. + * + * @type {?Texture} + * @default null + */ + map: Texture | null; + /** + * The light map. Requires a second set of UVs. + * + * @type {?Texture} + * @default null + */ + lightMap: Texture | null; + /** + * Intensity of the baked light. + * + * @type {number} + * @default 1 + */ + lightMapIntensity: number; + /** + * The red channel of this texture is used as the ambient occlusion map. + * Requires a second set of UVs. + * + * @type {?Texture} + * @default null + */ + aoMap: Texture | null; + /** + * Intensity of the ambient occlusion effect. Range is `[0,1]`, where `0` + * disables ambient occlusion. Where intensity is `1` and the AO map's + * red channel is also `1`, ambient light is fully occluded on a surface. + * + * @type {number} + * @default 1 + */ + aoMapIntensity: number; + /** + * Emissive (light) color of the material, essentially a solid color + * unaffected by other lighting. + * + * @type {Color} + * @default (0,0,0) + */ + emissive: Color; + /** + * Intensity of the emissive light. Modulates the emissive color. + * + * @type {number} + * @default 1 + */ + emissiveIntensity: number; + /** + * Set emissive (glow) map. The emissive map color is modulated by the + * emissive color and the emissive intensity. If you have an emissive map, + * be sure to set the emissive color to something other than black. + * + * @type {?Texture} + * @default null + */ + emissiveMap: Texture | null; + /** + * The texture to create a bump map. The black and white values map to the + * perceived depth in relation to the lights. Bump doesn't actually affect + * the geometry of the object, only the lighting. If a normal map is defined + * this will be ignored. + * + * @type {?Texture} + * @default null + */ + bumpMap: Texture | null; + /** + * How much the bump map affects the material. Typical range is `[0,1]`. + * + * @type {number} + * @default 1 + */ + bumpScale: number; + /** + * The texture to create a normal map. The RGB values affect the surface + * normal for each pixel fragment and change the way the color is lit. Normal + * maps do not change the actual shape of the surface, only the lighting. In + * case the material has a normal map authored using the left handed + * convention, the `y` component of `normalScale` should be negated to compensate + * for the different handedness. + * + * @type {?Texture} + * @default null + */ + normalMap: Texture | null; + /** + * The type of normal map. + * + * @type {(TangentSpaceNormalMap|ObjectSpaceNormalMap)} + * @default TangentSpaceNormalMap + */ + normalMapType: (number | ObjectSpaceNormalMap); + /** + * How much the normal map affects the material. Typical value range is `[0,1]`. + * + * @type {Vector2} + * @default (1,1) + */ + normalScale: Vector2; + /** + * The displacement map affects the position of the mesh's vertices. Unlike + * other maps which only affect the light and shade of the material the + * displaced vertices can cast shadows, block other objects, and otherwise + * act as real geometry. The displacement texture is an image where the value + * of each pixel (white being the highest) is mapped against, and + * repositions, the vertices of the mesh. + * + * @type {?Texture} + * @default null + */ + displacementMap: Texture | null; + /** + * How much the displacement map affects the mesh (where black is no + * displacement, and white is maximum displacement). Without a displacement + * map set, this value is not applied. + * + * @type {number} + * @default 0 + */ + displacementScale: number; + /** + * The offset of the displacement map's values on the mesh's vertices. + * The bias is added to the scaled sample of the displacement map. + * Without a displacement map set, this value is not applied. + * + * @type {number} + * @default 0 + */ + displacementBias: number; + /** + * Specular map used by the material. + * + * @type {?Texture} + * @default null + */ + specularMap: Texture | null; + /** + * The alpha map is a grayscale texture that controls the opacity across the + * surface (black: fully transparent; white: fully opaque). + * + * Only the color of the texture is used, ignoring the alpha channel if one + * exists. For RGB and RGBA textures, the renderer will use the green channel + * when sampling this texture due to the extra bit of precision provided for + * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and + * luminance/alpha textures will also still work as expected. + * + * @type {?Texture} + * @default null + */ + alphaMap: Texture | null; + /** + * The environment map. + * + * @type {?Texture} + * @default null + */ + envMap: Texture | null; + /** + * The rotation of the environment map in radians. + * + * @type {Euler} + * @default (0,0,0) + */ + envMapRotation: Euler; + /** + * How to combine the result of the surface's color with the environment map, if any. + * + * When set to `MixOperation`, the {@link MeshBasicMaterial#reflectivity} is used to + * blend between the two colors. + * + * @type {(MultiplyOperation|MixOperation|AddOperation)} + * @default MultiplyOperation + */ + combine: (number | MixOperation | AddOperation); + /** + * How much the environment map affects the surface. + * The valid range is between `0` (no reflections) and `1` (full reflections). + * + * @type {number} + * @default 1 + */ + reflectivity: number; + /** + * Scales the effect of the environment map by multiplying its color. + * + * @type {number} + * @default 1 + */ + envMapIntensity: number; + /** + * The index of refraction (IOR) of air (approximately 1) divided by the + * index of refraction of the material. It is used with environment mapping + * modes {@link CubeRefractionMapping} and {@link EquirectangularRefractionMapping}. + * The refraction ratio should not exceed `1`. + * + * @type {number} + * @default 0.98 + */ + refractionRatio: number; + /** + * Renders the geometry as a wireframe. + * + * @type {boolean} + * @default false + */ + wireframe: boolean; + /** + * Controls the thickness of the wireframe. + * + * Can only be used with {@link SVGRenderer}. + * + * @type {number} + * @default 1 + */ + wireframeLinewidth: number; + /** + * Defines appearance of wireframe ends. + * + * Can only be used with {@link SVGRenderer}. + * + * @type {('round'|'bevel'|'miter')} + * @default 'round' + */ + wireframeLinecap: ("round" | "bevel" | "miter"); + /** + * Defines appearance of wireframe joints. + * + * Can only be used with {@link SVGRenderer}. + * + * @type {('round'|'bevel'|'miter')} + * @default 'round' + */ + wireframeLinejoin: ("round" | "bevel" | "miter"); + /** + * Whether the material is rendered with flat shading or not. + * + * @type {boolean} + * @default false + */ + flatShading: boolean; + /** + * Whether the material is affected by fog or not. + * + * @type {boolean} + * @default true + */ + fog: boolean; + copy(source: any): this; +} +import { Material } from './Material.js'; +import { Color } from '../math/Color.js'; +import { Vector2 } from '../math/Vector2.js'; +import { Euler } from '../math/Euler.js'; diff --git a/jsdoc-testing/jsdoc/materials/MeshMatcapMaterial.d.ts b/jsdoc-testing/jsdoc/materials/MeshMatcapMaterial.d.ts new file mode 100644 index 000000000..ac33b9fb2 --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/MeshMatcapMaterial.d.ts @@ -0,0 +1,180 @@ +/** + * This material is defined by a MatCap (or Lit Sphere) texture, which encodes the + * material color and shading. + * + * `MeshMatcapMaterial` does not respond to lights since the matcap image file encodes + * baked lighting. It will cast a shadow onto an object that receives shadows + * (and shadow clipping works), but it will not self-shadow or receive + * shadows. + * + * @augments Material + * @demo scenes/material-browser.html#MeshMatcapMaterial + */ +export class MeshMatcapMaterial extends Material { + /** + * Constructs a new mesh matcap material. + * + * @param {Object} [parameters] - An object with one or more properties + * defining the material's appearance. Any property of the material + * (including any property from inherited materials) can be passed + * in here. Color values can be passed any type of value accepted + * by {@link Color#set}. + */ + constructor(parameters?: Object); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isMeshMatcapMaterial: boolean; + defines: { + MATCAP: string; + }; + type: string; + /** + * Color of the material. + * + * @type {Color} + * @default (1,1,1) + */ + color: Color; + /** + * The matcap map. + * + * @type {?Texture} + * @default null + */ + matcap: Texture | null; + /** + * The color map. May optionally include an alpha channel, typically combined + * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map + * color is modulated by the diffuse `color`. + * + * @type {?Texture} + * @default null + */ + map: Texture | null; + /** + * The texture to create a bump map. The black and white values map to the + * perceived depth in relation to the lights. Bump doesn't actually affect + * the geometry of the object, only the lighting. If a normal map is defined + * this will be ignored. + * + * @type {?Texture} + * @default null + */ + bumpMap: Texture | null; + /** + * How much the bump map affects the material. Typical range is `[0,1]`. + * + * @type {number} + * @default 1 + */ + bumpScale: number; + /** + * The texture to create a normal map. The RGB values affect the surface + * normal for each pixel fragment and change the way the color is lit. Normal + * maps do not change the actual shape of the surface, only the lighting. In + * case the material has a normal map authored using the left handed + * convention, the `y` component of `normalScale` should be negated to compensate + * for the different handedness. + * + * @type {?Texture} + * @default null + */ + normalMap: Texture | null; + /** + * The type of normal map. + * + * @type {(TangentSpaceNormalMap|ObjectSpaceNormalMap)} + * @default TangentSpaceNormalMap + */ + normalMapType: (number | ObjectSpaceNormalMap); + /** + * How much the normal map affects the material. Typical value range is `[0,1]`. + * + * @type {Vector2} + * @default (1,1) + */ + normalScale: Vector2; + /** + * The displacement map affects the position of the mesh's vertices. Unlike + * other maps which only affect the light and shade of the material the + * displaced vertices can cast shadows, block other objects, and otherwise + * act as real geometry. The displacement texture is an image where the value + * of each pixel (white being the highest) is mapped against, and + * repositions, the vertices of the mesh. + * + * @type {?Texture} + * @default null + */ + displacementMap: Texture | null; + /** + * How much the displacement map affects the mesh (where black is no + * displacement, and white is maximum displacement). Without a displacement + * map set, this value is not applied. + * + * @type {number} + * @default 0 + */ + displacementScale: number; + /** + * The offset of the displacement map's values on the mesh's vertices. + * The bias is added to the scaled sample of the displacement map. + * Without a displacement map set, this value is not applied. + * + * @type {number} + * @default 0 + */ + displacementBias: number; + /** + * The alpha map is a grayscale texture that controls the opacity across the + * surface (black: fully transparent; white: fully opaque). + * + * Only the color of the texture is used, ignoring the alpha channel if one + * exists. For RGB and RGBA textures, the renderer will use the green channel + * when sampling this texture due to the extra bit of precision provided for + * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and + * luminance/alpha textures will also still work as expected. + * + * @type {?Texture} + * @default null + */ + alphaMap: Texture | null; + /** + * Renders the geometry as a wireframe. + * + * @type {boolean} + * @default false + */ + wireframe: boolean; + /** + * Controls the thickness of the wireframe. + * + * Can only be used with {@link SVGRenderer}. + * + * @type {number} + * @default 1 + */ + wireframeLinewidth: number; + /** + * Whether the material is rendered with flat shading or not. + * + * @type {boolean} + * @default false + */ + flatShading: boolean; + /** + * Whether the material is affected by fog or not. + * + * @type {boolean} + * @default true + */ + fog: boolean; + copy(source: any): this; +} +import { Material } from './Material.js'; +import { Color } from '../math/Color.js'; +import { Vector2 } from '../math/Vector2.js'; diff --git a/jsdoc-testing/jsdoc/materials/MeshNormalMaterial.d.ts b/jsdoc-testing/jsdoc/materials/MeshNormalMaterial.d.ts new file mode 100644 index 000000000..7d0ab053f --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/MeshNormalMaterial.d.ts @@ -0,0 +1,127 @@ +/** + * A material that maps the normal vectors to RGB colors. + * + * @augments Material + * @demo scenes/material-browser.html#MeshNormalMaterial + */ +export class MeshNormalMaterial extends Material { + /** + * Constructs a new mesh normal material. + * + * @param {Object} [parameters] - An object with one or more properties + * defining the material's appearance. Any property of the material + * (including any property from inherited materials) can be passed + * in here. Color values can be passed any type of value accepted + * by {@link Color#set}. + */ + constructor(parameters?: Object); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isMeshNormalMaterial: boolean; + type: string; + /** + * The texture to create a bump map. The black and white values map to the + * perceived depth in relation to the lights. Bump doesn't actually affect + * the geometry of the object, only the lighting. If a normal map is defined + * this will be ignored. + * + * @type {?Texture} + * @default null + */ + bumpMap: Texture | null; + /** + * How much the bump map affects the material. Typical range is `[0,1]`. + * + * @type {number} + * @default 1 + */ + bumpScale: number; + /** + * The texture to create a normal map. The RGB values affect the surface + * normal for each pixel fragment and change the way the color is lit. Normal + * maps do not change the actual shape of the surface, only the lighting. In + * case the material has a normal map authored using the left handed + * convention, the `y` component of `normalScale` should be negated to compensate + * for the different handedness. + * + * @type {?Texture} + * @default null + */ + normalMap: Texture | null; + /** + * The type of normal map. + * + * @type {(TangentSpaceNormalMap|ObjectSpaceNormalMap)} + * @default TangentSpaceNormalMap + */ + normalMapType: (number | ObjectSpaceNormalMap); + /** + * How much the normal map affects the material. Typical value range is `[0,1]`. + * + * @type {Vector2} + * @default (1,1) + */ + normalScale: Vector2; + /** + * The displacement map affects the position of the mesh's vertices. Unlike + * other maps which only affect the light and shade of the material the + * displaced vertices can cast shadows, block other objects, and otherwise + * act as real geometry. The displacement texture is an image where the value + * of each pixel (white being the highest) is mapped against, and + * repositions, the vertices of the mesh. + * + * @type {?Texture} + * @default null + */ + displacementMap: Texture | null; + /** + * How much the displacement map affects the mesh (where black is no + * displacement, and white is maximum displacement). Without a displacement + * map set, this value is not applied. + * + * @type {number} + * @default 0 + */ + displacementScale: number; + /** + * The offset of the displacement map's values on the mesh's vertices. + * The bias is added to the scaled sample of the displacement map. + * Without a displacement map set, this value is not applied. + * + * @type {number} + * @default 0 + */ + displacementBias: number; + /** + * Renders the geometry as a wireframe. + * + * @type {boolean} + * @default false + */ + wireframe: boolean; + /** + * Controls the thickness of the wireframe. + * + * WebGL and WebGPU ignore this property and always render + * 1 pixel wide lines. + * + * @type {number} + * @default 1 + */ + wireframeLinewidth: number; + /** + * Whether the material is rendered with flat shading or not. + * + * @type {boolean} + * @default false + */ + flatShading: boolean; + copy(source: any): this; +} +import { Material } from './Material.js'; +import { Vector2 } from '../math/Vector2.js'; diff --git a/jsdoc-testing/jsdoc/materials/MeshPhongMaterial.d.ts b/jsdoc-testing/jsdoc/materials/MeshPhongMaterial.d.ts new file mode 100644 index 000000000..085598b1b --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/MeshPhongMaterial.d.ts @@ -0,0 +1,320 @@ +/** + * A material for shiny surfaces with specular highlights. + * + * The material uses a non-physically based [Blinn-Phong](https://en.wikipedia.org/wiki/Blinn-Phong_shading_model) + * model for calculating reflectance. Unlike the Lambertian model used in the + * {@link MeshLambertMaterial} this can simulate shiny surfaces with specular + * highlights (such as varnished wood). `MeshPhongMaterial` uses per-fragment shading. + * + * Performance will generally be greater when using this material over the + * {@link MeshStandardMaterial} or {@link MeshPhysicalMaterial}, at the cost of + * some graphical accuracy. + * + * @augments Material + * @demo scenes/material-browser.html#MeshPhongMaterial + */ +export class MeshPhongMaterial extends Material { + /** + * Constructs a new mesh phong material. + * + * @param {Object} [parameters] - An object with one or more properties + * defining the material's appearance. Any property of the material + * (including any property from inherited materials) can be passed + * in here. Color values can be passed any type of value accepted + * by {@link Color#set}. + */ + constructor(parameters?: Object); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isMeshPhongMaterial: boolean; + type: string; + /** + * Color of the material. + * + * @type {Color} + * @default (1,1,1) + */ + color: Color; + /** + * Specular color of the material. The default color is set to `0x111111` (very dark grey) + * + * This defines how shiny the material is and the color of its shine. + * + * @type {Color} + */ + specular: Color; + /** + * How shiny the specular highlight is; a higher value gives a sharper highlight. + * + * @type {number} + * @default 30 + */ + shininess: number; + /** + * The color map. May optionally include an alpha channel, typically combined + * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map + * color is modulated by the diffuse `color`. + * + * @type {?Texture} + * @default null + */ + map: Texture | null; + /** + * The light map. Requires a second set of UVs. + * + * @type {?Texture} + * @default null + */ + lightMap: Texture | null; + /** + * Intensity of the baked light. + * + * @type {number} + * @default 1 + */ + lightMapIntensity: number; + /** + * The red channel of this texture is used as the ambient occlusion map. + * Requires a second set of UVs. + * + * @type {?Texture} + * @default null + */ + aoMap: Texture | null; + /** + * Intensity of the ambient occlusion effect. Range is `[0,1]`, where `0` + * disables ambient occlusion. Where intensity is `1` and the AO map's + * red channel is also `1`, ambient light is fully occluded on a surface. + * + * @type {number} + * @default 1 + */ + aoMapIntensity: number; + /** + * Emissive (light) color of the material, essentially a solid color + * unaffected by other lighting. + * + * @type {Color} + * @default (0,0,0) + */ + emissive: Color; + /** + * Intensity of the emissive light. Modulates the emissive color. + * + * @type {number} + * @default 1 + */ + emissiveIntensity: number; + /** + * Set emissive (glow) map. The emissive map color is modulated by the + * emissive color and the emissive intensity. If you have an emissive map, + * be sure to set the emissive color to something other than black. + * + * @type {?Texture} + * @default null + */ + emissiveMap: Texture | null; + /** + * The texture to create a bump map. The black and white values map to the + * perceived depth in relation to the lights. Bump doesn't actually affect + * the geometry of the object, only the lighting. If a normal map is defined + * this will be ignored. + * + * @type {?Texture} + * @default null + */ + bumpMap: Texture | null; + /** + * How much the bump map affects the material. Typical range is `[0,1]`. + * + * @type {number} + * @default 1 + */ + bumpScale: number; + /** + * The texture to create a normal map. The RGB values affect the surface + * normal for each pixel fragment and change the way the color is lit. Normal + * maps do not change the actual shape of the surface, only the lighting. In + * case the material has a normal map authored using the left handed + * convention, the `y` component of `normalScale` should be negated to compensate + * for the different handedness. + * + * @type {?Texture} + * @default null + */ + normalMap: Texture | null; + /** + * The type of normal map. + * + * @type {(TangentSpaceNormalMap|ObjectSpaceNormalMap)} + * @default TangentSpaceNormalMap + */ + normalMapType: (number | ObjectSpaceNormalMap); + /** + * How much the normal map affects the material. Typical value range is `[0,1]`. + * + * @type {Vector2} + * @default (1,1) + */ + normalScale: Vector2; + /** + * The displacement map affects the position of the mesh's vertices. Unlike + * other maps which only affect the light and shade of the material the + * displaced vertices can cast shadows, block other objects, and otherwise + * act as real geometry. The displacement texture is an image where the value + * of each pixel (white being the highest) is mapped against, and + * repositions, the vertices of the mesh. + * + * @type {?Texture} + * @default null + */ + displacementMap: Texture | null; + /** + * How much the displacement map affects the mesh (where black is no + * displacement, and white is maximum displacement). Without a displacement + * map set, this value is not applied. + * + * @type {number} + * @default 0 + */ + displacementScale: number; + /** + * The offset of the displacement map's values on the mesh's vertices. + * The bias is added to the scaled sample of the displacement map. + * Without a displacement map set, this value is not applied. + * + * @type {number} + * @default 0 + */ + displacementBias: number; + /** + * The specular map value affects both how much the specular surface + * highlight contributes and how much of the environment map affects the + * surface. + * + * @type {?Texture} + * @default null + */ + specularMap: Texture | null; + /** + * The alpha map is a grayscale texture that controls the opacity across the + * surface (black: fully transparent; white: fully opaque). + * + * Only the color of the texture is used, ignoring the alpha channel if one + * exists. For RGB and RGBA textures, the renderer will use the green channel + * when sampling this texture due to the extra bit of precision provided for + * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and + * luminance/alpha textures will also still work as expected. + * + * @type {?Texture} + * @default null + */ + alphaMap: Texture | null; + /** + * The environment map. + * + * @type {?Texture} + * @default null + */ + envMap: Texture | null; + /** + * The rotation of the environment map in radians. + * + * @type {Euler} + * @default (0,0,0) + */ + envMapRotation: Euler; + /** + * How to combine the result of the surface's color with the environment map, if any. + * + * When set to `MixOperation`, the {@link MeshBasicMaterial#reflectivity} is used to + * blend between the two colors. + * + * @type {(MultiplyOperation|MixOperation|AddOperation)} + * @default MultiplyOperation + */ + combine: (number | MixOperation | AddOperation); + /** + * How much the environment map affects the surface. + * The valid range is between `0` (no reflections) and `1` (full reflections). + * + * @type {number} + * @default 1 + */ + reflectivity: number; + /** + * Scales the effect of the environment map by multiplying its color. + * + * @type {number} + * @default 1 + */ + envMapIntensity: number; + /** + * The index of refraction (IOR) of air (approximately 1) divided by the + * index of refraction of the material. It is used with environment mapping + * modes {@link CubeRefractionMapping} and {@link EquirectangularRefractionMapping}. + * The refraction ratio should not exceed `1`. + * + * @type {number} + * @default 0.98 + */ + refractionRatio: number; + /** + * Renders the geometry as a wireframe. + * + * @type {boolean} + * @default false + */ + wireframe: boolean; + /** + * Controls the thickness of the wireframe. + * + * Can only be used with {@link SVGRenderer}. + * + * @type {number} + * @default 1 + */ + wireframeLinewidth: number; + /** + * Defines appearance of wireframe ends. + * + * Can only be used with {@link SVGRenderer}. + * + * @type {('round'|'bevel'|'miter')} + * @default 'round' + */ + wireframeLinecap: ("round" | "bevel" | "miter"); + /** + * Defines appearance of wireframe joints. + * + * Can only be used with {@link SVGRenderer}. + * + * @type {('round'|'bevel'|'miter')} + * @default 'round' + */ + wireframeLinejoin: ("round" | "bevel" | "miter"); + /** + * Whether the material is rendered with flat shading or not. + * + * @type {boolean} + * @default false + */ + flatShading: boolean; + /** + * Whether the material is affected by fog or not. + * + * @type {boolean} + * @default true + */ + fog: boolean; + copy(source: any): this; +} +import { Material } from './Material.js'; +import { Color } from '../math/Color.js'; +import { Vector2 } from '../math/Vector2.js'; +import { Euler } from '../math/Euler.js'; diff --git a/jsdoc-testing/jsdoc/materials/MeshPhysicalMaterial.d.ts b/jsdoc-testing/jsdoc/materials/MeshPhysicalMaterial.d.ts new file mode 100644 index 000000000..3dd61375e --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/MeshPhysicalMaterial.d.ts @@ -0,0 +1,310 @@ +/** + * An extension of the {@link MeshStandardMaterial}, providing more advanced + * physically-based rendering properties: + * + * - Anisotropy: Ability to represent the anisotropic property of materials + * as observable with brushed metals. + * - Clearcoat: Some materials — like car paints, carbon fiber, and wet surfaces — require + * a clear, reflective layer on top of another layer that may be irregular or rough. + * Clearcoat approximates this effect, without the need for a separate transparent surface. + * - Iridescence: Allows to render the effect where hue varies depending on the viewing + * angle and illumination angle. This can be seen on soap bubbles, oil films, or on the + * wings of many insects. + * - Physically-based transparency: One limitation of {@link Material#opacity} is that highly + * transparent materials are less reflective. Physically-based transmission provides a more + * realistic option for thin, transparent surfaces like glass. + * - Advanced reflectivity: More flexible reflectivity for non-metallic materials. + * - Sheen: Can be used for representing cloth and fabric materials. + * + * As a result of these complex shading features, `MeshPhysicalMaterial` has a + * higher performance cost, per pixel, than other three.js materials. Most + * effects are disabled by default, and add cost as they are enabled. For + * best results, always specify an environment map when using this material. + * + * @augments MeshStandardMaterial + * @demo scenes/material-browser.html#MeshPhysicalMaterial + */ +export class MeshPhysicalMaterial extends MeshStandardMaterial { + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isMeshPhysicalMaterial: boolean; + defines: { + STANDARD: string; + PHYSICAL: string; + }; + /** + * The rotation of the anisotropy in tangent, bitangent space, measured in radians + * counter-clockwise from the tangent. When `anisotropyMap` is present, this + * property provides additional rotation to the vectors in the texture. + * + * @type {number} + * @default 1 + */ + anisotropyRotation: number; + /** + * Red and green channels represent the anisotropy direction in `[-1, 1]` tangent, + * bitangent space, to be rotated by `anisotropyRotation`. The blue channel + * contains strength as `[0, 1]` to be multiplied by `anisotropy`. + * + * @type {?Texture} + * @default null + */ + anisotropyMap: Texture | null; + /** + * The red channel of this texture is multiplied against `clearcoat`, + * for per-pixel control over a coating's intensity. + * + * @type {?Texture} + * @default null + */ + clearcoatMap: Texture | null; + /** + * Roughness of the clear coat layer, from `0.0` to `1.0`. + * + * @type {number} + * @default 0 + */ + clearcoatRoughness: number; + /** + * The green channel of this texture is multiplied against + * `clearcoatRoughness`, for per-pixel control over a coating's roughness. + * + * @type {?Texture} + * @default null + */ + clearcoatRoughnessMap: Texture | null; + /** + * How much `clearcoatNormalMap` affects the clear coat layer, from + * `(0,0)` to `(1,1)`. + * + * @type {Vector2} + * @default (1,1) + */ + clearcoatNormalScale: Vector2; + /** + * Can be used to enable independent normals for the clear coat layer. + * + * @type {?Texture} + * @default null + */ + clearcoatNormalMap: Texture | null; + /** + * Index-of-refraction for non-metallic materials, from `1.0` to `2.333`. + * + * @type {number} + * @default 1.5 + */ + ior: number; + /** + * The red channel of this texture is multiplied against `iridescence`, for per-pixel + * control over iridescence. + * + * @type {?Texture} + * @default null + */ + iridescenceMap: Texture | null; + /** + * Strength of the iridescence RGB color shift effect, represented by an index-of-refraction. + * Between `1.0` to `2.333`. + * + * @type {number} + * @default 1.3 + */ + iridescenceIOR: number; + /** + *Array of exactly 2 elements, specifying minimum and maximum thickness of the iridescence layer. + Thickness of iridescence layer has an equivalent effect of the one `thickness` has on `ior`. + * + * @type {Array} + * @default [100,400] + */ + iridescenceThicknessRange: Array; + /** + * A texture that defines the thickness of the iridescence layer, stored in the green channel. + * Minimum and maximum values of thickness are defined by `iridescenceThicknessRange` array: + * - `0.0` in the green channel will result in thickness equal to first element of the array. + * - `1.0` in the green channel will result in thickness equal to second element of the array. + * - Values in-between will linearly interpolate between the elements of the array. + * + * @type {?Texture} + * @default null + */ + iridescenceThicknessMap: Texture | null; + /** + * The sheen tint. + * + * @type {Color} + * @default (0,0,0) + */ + sheenColor: Color; + /** + * The RGB channels of this texture are multiplied against `sheenColor`, for per-pixel control + * over sheen tint. + * + * @type {?Texture} + * @default null + */ + sheenColorMap: Texture | null; + /** + * Roughness of the sheen layer, from `0.0` to `1.0`. + * + * @type {number} + * @default 1 + */ + sheenRoughness: number; + /** + * The alpha channel of this texture is multiplied against `sheenRoughness`, for per-pixel control + * over sheen roughness. + * + * @type {?Texture} + * @default null + */ + sheenRoughnessMap: Texture | null; + /** + * The red channel of this texture is multiplied against `transmission`, for per-pixel control over + * optical transparency. + * + * @type {?Texture} + * @default null + */ + transmissionMap: Texture | null; + /** + * The thickness of the volume beneath the surface. The value is given in the + * coordinate space of the mesh. If the value is `0` the material is + * thin-walled. Otherwise the material is a volume boundary. + * + * @type {number} + * @default 0 + */ + thickness: number; + /** + * A texture that defines the thickness, stored in the green channel. This will + * be multiplied by `thickness`. + * + * @type {?Texture} + * @default null + */ + thicknessMap: Texture | null; + /** + * Density of the medium given as the average distance that light travels in + * the medium before interacting with a particle. The value is given in world + * space units, and must be greater than zero. + * + * @type {number} + * @default Infinity + */ + attenuationDistance: number; + /** + * The color that white light turns into due to absorption when reaching the + * attenuation distance. + * + * @type {Color} + * @default (1,1,1) + */ + attenuationColor: Color; + /** + * A float that scales the amount of specular reflection for non-metals only. + * When set to zero, the model is effectively Lambertian. From `0.0` to `1.0`. + * + * @type {number} + * @default 1 + */ + specularIntensity: number; + /** + * The alpha channel of this texture is multiplied against `specularIntensity`, + * for per-pixel control over specular intensity. + * + * @type {?Texture} + * @default null + */ + specularIntensityMap: Texture | null; + /** + * Tints the specular reflection at normal incidence for non-metals only. + * + * @type {Color} + * @default (1,1,1) + */ + specularColor: Color; + /** + * The RGB channels of this texture are multiplied against `specularColor`, + * for per-pixel control over specular color. + * + * @type {?Texture} + * @default null + */ + specularColorMap: Texture | null; + _anisotropy: number; + _clearcoat: number; + _dispersion: number; + _iridescence: number; + _sheen: number; + _transmission: number; + set anisotropy(value: number); + /** + * The anisotropy strength, from `0.0` to `1.0`. + * + * @type {number} + * @default 0 + */ + get anisotropy(): number; + set clearcoat(value: number); + /** + * Represents the intensity of the clear coat layer, from `0.0` to `1.0`. Use + * clear coat related properties to enable multilayer materials that have a + * thin translucent layer over the base layer. + * + * @type {number} + * @default 0 + */ + get clearcoat(): number; + set iridescence(value: number); + /** + * The intensity of the iridescence layer, simulating RGB color shift based on the angle between + * the surface and the viewer, from `0.0` to `1.0`. + * + * @type {number} + * @default 0 + */ + get iridescence(): number; + set dispersion(value: number); + /** + * Defines the strength of the angular separation of colors (chromatic aberration) transmitting + * through a relatively clear volume. Any value zero or larger is valid, the typical range of + * realistic values is `[0, 1]`. This property can be only be used with transmissive objects. + * + * @type {number} + * @default 0 + */ + get dispersion(): number; + set sheen(value: number); + /** + * The intensity of the sheen layer, from `0.0` to `1.0`. + * + * @type {number} + * @default 0 + */ + get sheen(): number; + set transmission(value: number); + /** + * Degree of transmission (or optical transparency), from `0.0` to `1.0`. + * + * Thin, transparent or semitransparent, plastic or glass materials remain + * largely reflective even if they are fully transmissive. The transmission + * property can be used to model these materials. + * + * When transmission is non-zero, `opacity` should be set to `1`. + * + * @type {number} + * @default 0 + */ + get transmission(): number; + copy(source: any): this; +} +import { MeshStandardMaterial } from './MeshStandardMaterial.js'; +import { Vector2 } from '../math/Vector2.js'; +import { Color } from '../math/Color.js'; diff --git a/jsdoc-testing/jsdoc/materials/MeshStandardMaterial.d.ts b/jsdoc-testing/jsdoc/materials/MeshStandardMaterial.d.ts new file mode 100644 index 000000000..5b623bfb8 --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/MeshStandardMaterial.d.ts @@ -0,0 +1,326 @@ +/** + * A standard physically based material, using Metallic-Roughness workflow. + * + * Physically based rendering (PBR) has recently become the standard in many + * 3D applications, such as [Unity](https://blogs.unity3d.com/2014/10/29/physically-based-shading-in-unity-5-a-primer/), + * [Unreal](https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/PhysicallyBased/) and + * [3D Studio Max](http://area.autodesk.com/blogs/the-3ds-max-blog/what039s-new-for-rendering-in-3ds-max-2017). + * + * This approach differs from older approaches in that instead of using + * approximations for the way in which light interacts with a surface, a + * physically correct model is used. The idea is that, instead of tweaking + * materials to look good under specific lighting, a material can be created + * that will react 'correctly' under all lighting scenarios. + * + * In practice this gives a more accurate and realistic looking result than + * the {@link MeshLambertMaterial} or {@link MeshPhongMaterial}, at the cost of + * being somewhat more computationally expensive. `MeshStandardMaterial` uses per-fragment + * shading. + * + * Note that for best results you should always specify an environment map when using this material. + * + * For a non-technical introduction to the concept of PBR and how to set up a + * PBR material, check out these articles by the people at [marmoset](https://www.marmoset.co): + * + * - [Basic Theory of Physically Based Rendering](https://www.marmoset.co/posts/basic-theory-of-physically-based-rendering/) + * - [Physically Based Rendering and You Can Too](https://www.marmoset.co/posts/physically-based-rendering-and-you-can-too/) + * + * Technical details of the approach used in three.js (and most other PBR systems) can be found is this + * [paper from Disney](https://media.disneyanimation.com/uploads/production/publication_asset/48/asset/s2012_pbs_disney_brdf_notes_v3.pdf) + * (pdf), by Brent Burley. + * + * @augments Material + * @demo scenes/material-browser.html#MeshStandardMaterial + */ +export class MeshStandardMaterial extends Material { + /** + * Constructs a new mesh standard material. + * + * @param {Object} [parameters] - An object with one or more properties + * defining the material's appearance. Any property of the material + * (including any property from inherited materials) can be passed + * in here. Color values can be passed any type of value accepted + * by {@link Color#set}. + */ + constructor(parameters?: Object); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isMeshStandardMaterial: boolean; + type: string; + defines: { + STANDARD: string; + }; + /** + * Color of the material. + * + * @type {Color} + * @default (1,1,1) + */ + color: Color; + /** + * How rough the material appears. `0.0` means a smooth mirror reflection, `1.0` + * means fully diffuse. If `roughnessMap` is also provided, + * both values are multiplied. + * + * @type {number} + * @default 1 + */ + roughness: number; + /** + * How much the material is like a metal. Non-metallic materials such as wood + * or stone use `0.0`, metallic use `1.0`, with nothing (usually) in between. + * A value between `0.0` and `1.0` could be used for a rusty metal look. + * If `metalnessMap` is also provided, both values are multiplied. + * + * @type {number} + * @default 0 + */ + metalness: number; + /** + * The color map. May optionally include an alpha channel, typically combined + * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map + * color is modulated by the diffuse `color`. + * + * @type {?Texture} + * @default null + */ + map: Texture | null; + /** + * The light map. Requires a second set of UVs. + * + * @type {?Texture} + * @default null + */ + lightMap: Texture | null; + /** + * Intensity of the baked light. + * + * @type {number} + * @default 1 + */ + lightMapIntensity: number; + /** + * The red channel of this texture is used as the ambient occlusion map. + * Requires a second set of UVs. + * + * @type {?Texture} + * @default null + */ + aoMap: Texture | null; + /** + * Intensity of the ambient occlusion effect. Range is `[0,1]`, where `0` + * disables ambient occlusion. Where intensity is `1` and the AO map's + * red channel is also `1`, ambient light is fully occluded on a surface. + * + * @type {number} + * @default 1 + */ + aoMapIntensity: number; + /** + * Emissive (light) color of the material, essentially a solid color + * unaffected by other lighting. + * + * @type {Color} + * @default (0,0,0) + */ + emissive: Color; + /** + * Intensity of the emissive light. Modulates the emissive color. + * + * @type {number} + * @default 1 + */ + emissiveIntensity: number; + /** + * Set emissive (glow) map. The emissive map color is modulated by the + * emissive color and the emissive intensity. If you have an emissive map, + * be sure to set the emissive color to something other than black. + * + * @type {?Texture} + * @default null + */ + emissiveMap: Texture | null; + /** + * The texture to create a bump map. The black and white values map to the + * perceived depth in relation to the lights. Bump doesn't actually affect + * the geometry of the object, only the lighting. If a normal map is defined + * this will be ignored. + * + * @type {?Texture} + * @default null + */ + bumpMap: Texture | null; + /** + * How much the bump map affects the material. Typical range is `[0,1]`. + * + * @type {number} + * @default 1 + */ + bumpScale: number; + /** + * The texture to create a normal map. The RGB values affect the surface + * normal for each pixel fragment and change the way the color is lit. Normal + * maps do not change the actual shape of the surface, only the lighting. In + * case the material has a normal map authored using the left handed + * convention, the `y` component of `normalScale` should be negated to compensate + * for the different handedness. + * + * @type {?Texture} + * @default null + */ + normalMap: Texture | null; + /** + * The type of normal map. + * + * @type {(TangentSpaceNormalMap|ObjectSpaceNormalMap)} + * @default TangentSpaceNormalMap + */ + normalMapType: (number | ObjectSpaceNormalMap); + /** + * How much the normal map affects the material. Typical value range is `[0,1]`. + * + * @type {Vector2} + * @default (1,1) + */ + normalScale: Vector2; + /** + * The displacement map affects the position of the mesh's vertices. Unlike + * other maps which only affect the light and shade of the material the + * displaced vertices can cast shadows, block other objects, and otherwise + * act as real geometry. The displacement texture is an image where the value + * of each pixel (white being the highest) is mapped against, and + * repositions, the vertices of the mesh. + * + * @type {?Texture} + * @default null + */ + displacementMap: Texture | null; + /** + * How much the displacement map affects the mesh (where black is no + * displacement, and white is maximum displacement). Without a displacement + * map set, this value is not applied. + * + * @type {number} + * @default 0 + */ + displacementScale: number; + /** + * The offset of the displacement map's values on the mesh's vertices. + * The bias is added to the scaled sample of the displacement map. + * Without a displacement map set, this value is not applied. + * + * @type {number} + * @default 0 + */ + displacementBias: number; + /** + * The green channel of this texture is used to alter the roughness of the + * material. + * + * @type {?Texture} + * @default null + */ + roughnessMap: Texture | null; + /** + * The blue channel of this texture is used to alter the metalness of the + * material. + * + * @type {?Texture} + * @default null + */ + metalnessMap: Texture | null; + /** + * The alpha map is a grayscale texture that controls the opacity across the + * surface (black: fully transparent; white: fully opaque). + * + * Only the color of the texture is used, ignoring the alpha channel if one + * exists. For RGB and RGBA textures, the renderer will use the green channel + * when sampling this texture due to the extra bit of precision provided for + * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and + * luminance/alpha textures will also still work as expected. + * + * @type {?Texture} + * @default null + */ + alphaMap: Texture | null; + /** + * The environment map. To ensure a physically correct rendering, environment maps + * are internally pre-processed with {@link PMREMGenerator}. + * + * @type {?Texture} + * @default null + */ + envMap: Texture | null; + /** + * The rotation of the environment map in radians. + * + * @type {Euler} + * @default (0,0,0) + */ + envMapRotation: Euler; + /** + * Scales the effect of the environment map by multiplying its color. + * + * @type {number} + * @default 1 + */ + envMapIntensity: number; + /** + * Renders the geometry as a wireframe. + * + * @type {boolean} + * @default false + */ + wireframe: boolean; + /** + * Controls the thickness of the wireframe. + * + * Can only be used with {@link SVGRenderer}. + * + * @type {number} + * @default 1 + */ + wireframeLinewidth: number; + /** + * Defines appearance of wireframe ends. + * + * Can only be used with {@link SVGRenderer}. + * + * @type {('round'|'bevel'|'miter')} + * @default 'round' + */ + wireframeLinecap: ("round" | "bevel" | "miter"); + /** + * Defines appearance of wireframe joints. + * + * Can only be used with {@link SVGRenderer}. + * + * @type {('round'|'bevel'|'miter')} + * @default 'round' + */ + wireframeLinejoin: ("round" | "bevel" | "miter"); + /** + * Whether the material is rendered with flat shading or not. + * + * @type {boolean} + * @default false + */ + flatShading: boolean; + /** + * Whether the material is affected by fog or not. + * + * @type {boolean} + * @default true + */ + fog: boolean; + copy(source: any): this; +} +import { Material } from './Material.js'; +import { Color } from '../math/Color.js'; +import { Vector2 } from '../math/Vector2.js'; +import { Euler } from '../math/Euler.js'; diff --git a/jsdoc-testing/jsdoc/materials/MeshToonMaterial.d.ts b/jsdoc-testing/jsdoc/materials/MeshToonMaterial.d.ts new file mode 100644 index 000000000..9d8db3ec6 --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/MeshToonMaterial.d.ts @@ -0,0 +1,242 @@ +/** + * A material implementing toon shading. + * + * @augments Material + * @demo scenes/material-browser.html#MeshToonMaterial + */ +export class MeshToonMaterial extends Material { + /** + * Constructs a new mesh toon material. + * + * @param {Object} [parameters] - An object with one or more properties + * defining the material's appearance. Any property of the material + * (including any property from inherited materials) can be passed + * in here. Color values can be passed any type of value accepted + * by {@link Color#set}. + */ + constructor(parameters?: Object); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isMeshToonMaterial: boolean; + defines: { + TOON: string; + }; + type: string; + /** + * Color of the material. + * + * @type {Color} + * @default (1,1,1) + */ + color: Color; + /** + * The color map. May optionally include an alpha channel, typically combined + * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map + * color is modulated by the diffuse `color`. + * + * @type {?Texture} + * @default null + */ + map: Texture | null; + /** + * Gradient map for toon shading. It's required to set + * {@link Texture#minFilter} and {@link Texture#magFilter} to {@link NearestFilter} + * when using this type of texture. + * + * @type {?Texture} + * @default null + */ + gradientMap: Texture | null; + /** + * The light map. Requires a second set of UVs. + * + * @type {?Texture} + * @default null + */ + lightMap: Texture | null; + /** + * Intensity of the baked light. + * + * @type {number} + * @default 1 + */ + lightMapIntensity: number; + /** + * The red channel of this texture is used as the ambient occlusion map. + * Requires a second set of UVs. + * + * @type {?Texture} + * @default null + */ + aoMap: Texture | null; + /** + * Intensity of the ambient occlusion effect. Range is `[0,1]`, where `0` + * disables ambient occlusion. Where intensity is `1` and the AO map's + * red channel is also `1`, ambient light is fully occluded on a surface. + * + * @type {number} + * @default 1 + */ + aoMapIntensity: number; + /** + * Emissive (light) color of the material, essentially a solid color + * unaffected by other lighting. + * + * @type {Color} + * @default (0,0,0) + */ + emissive: Color; + /** + * Intensity of the emissive light. Modulates the emissive color. + * + * @type {number} + * @default 1 + */ + emissiveIntensity: number; + /** + * Set emissive (glow) map. The emissive map color is modulated by the + * emissive color and the emissive intensity. If you have an emissive map, + * be sure to set the emissive color to something other than black. + * + * @type {?Texture} + * @default null + */ + emissiveMap: Texture | null; + /** + * The texture to create a bump map. The black and white values map to the + * perceived depth in relation to the lights. Bump doesn't actually affect + * the geometry of the object, only the lighting. If a normal map is defined + * this will be ignored. + * + * @type {?Texture} + * @default null + */ + bumpMap: Texture | null; + /** + * How much the bump map affects the material. Typical range is `[0,1]`. + * + * @type {number} + * @default 1 + */ + bumpScale: number; + /** + * The texture to create a normal map. The RGB values affect the surface + * normal for each pixel fragment and change the way the color is lit. Normal + * maps do not change the actual shape of the surface, only the lighting. In + * case the material has a normal map authored using the left handed + * convention, the `y` component of `normalScale` should be negated to compensate + * for the different handedness. + * + * @type {?Texture} + * @default null + */ + normalMap: Texture | null; + /** + * The type of normal map. + * + * @type {(TangentSpaceNormalMap|ObjectSpaceNormalMap)} + * @default TangentSpaceNormalMap + */ + normalMapType: (number | ObjectSpaceNormalMap); + /** + * How much the normal map affects the material. Typical value range is `[0,1]`. + * + * @type {Vector2} + * @default (1,1) + */ + normalScale: Vector2; + /** + * The displacement map affects the position of the mesh's vertices. Unlike + * other maps which only affect the light and shade of the material the + * displaced vertices can cast shadows, block other objects, and otherwise + * act as real geometry. The displacement texture is an image where the value + * of each pixel (white being the highest) is mapped against, and + * repositions, the vertices of the mesh. + * + * @type {?Texture} + * @default null + */ + displacementMap: Texture | null; + /** + * How much the displacement map affects the mesh (where black is no + * displacement, and white is maximum displacement). Without a displacement + * map set, this value is not applied. + * + * @type {number} + * @default 0 + */ + displacementScale: number; + /** + * The offset of the displacement map's values on the mesh's vertices. + * The bias is added to the scaled sample of the displacement map. + * Without a displacement map set, this value is not applied. + * + * @type {number} + * @default 0 + */ + displacementBias: number; + /** + * The alpha map is a grayscale texture that controls the opacity across the + * surface (black: fully transparent; white: fully opaque). + * + * Only the color of the texture is used, ignoring the alpha channel if one + * exists. For RGB and RGBA textures, the renderer will use the green channel + * when sampling this texture due to the extra bit of precision provided for + * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and + * luminance/alpha textures will also still work as expected. + * + * @type {?Texture} + * @default null + */ + alphaMap: Texture | null; + /** + * Renders the geometry as a wireframe. + * + * @type {boolean} + * @default false + */ + wireframe: boolean; + /** + * Controls the thickness of the wireframe. + * + * Can only be used with {@link SVGRenderer}. + * + * @type {number} + * @default 1 + */ + wireframeLinewidth: number; + /** + * Defines appearance of wireframe ends. + * + * Can only be used with {@link SVGRenderer}. + * + * @type {('round'|'bevel'|'miter')} + * @default 'round' + */ + wireframeLinecap: ("round" | "bevel" | "miter"); + /** + * Defines appearance of wireframe joints. + * + * Can only be used with {@link SVGRenderer}. + * + * @type {('round'|'bevel'|'miter')} + * @default 'round' + */ + wireframeLinejoin: ("round" | "bevel" | "miter"); + /** + * Whether the material is affected by fog or not. + * + * @type {boolean} + * @default true + */ + fog: boolean; + copy(source: any): this; +} +import { Material } from './Material.js'; +import { Color } from '../math/Color.js'; +import { Vector2 } from '../math/Vector2.js'; diff --git a/jsdoc-testing/jsdoc/materials/PointsMaterial.d.ts b/jsdoc-testing/jsdoc/materials/PointsMaterial.d.ts new file mode 100644 index 000000000..b6869b31b --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/PointsMaterial.d.ts @@ -0,0 +1,102 @@ +/** + * A material for rendering point primitives. + * + * Materials define the appearance of renderable 3D objects. + * + * ```js + * const vertices = []; + * + * for ( let i = 0; i < 10000; i ++ ) { + * const x = THREE.MathUtils.randFloatSpread( 2000 ); + * const y = THREE.MathUtils.randFloatSpread( 2000 ); + * const z = THREE.MathUtils.randFloatSpread( 2000 ); + * + * vertices.push( x, y, z ); + * } + * + * const geometry = new THREE.BufferGeometry(); + * geometry.setAttribute( 'position', new THREE.Float32BufferAttribute( vertices, 3 ) ); + * const material = new THREE.PointsMaterial( { color: 0x888888 } ); + * const points = new THREE.Points( geometry, material ); + * scene.add( points ); + * ``` + * + * @augments Material + */ +export class PointsMaterial extends Material { + /** + * Constructs a new points material. + * + * @param {Object} [parameters] - An object with one or more properties + * defining the material's appearance. Any property of the material + * (including any property from inherited materials) can be passed + * in here. Color values can be passed any type of value accepted + * by {@link Color#set}. + */ + constructor(parameters?: Object); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isPointsMaterial: boolean; + type: string; + /** + * Color of the material. + * + * @type {Color} + * @default (1,1,1) + */ + color: Color; + /** + * The color map. May optionally include an alpha channel, typically combined + * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map + * color is modulated by the diffuse `color`. + * + * @type {?Texture} + * @default null + */ + map: Texture | null; + /** + * The alpha map is a grayscale texture that controls the opacity across the + * surface (black: fully transparent; white: fully opaque). + * + * Only the color of the texture is used, ignoring the alpha channel if one + * exists. For RGB and RGBA textures, the renderer will use the green channel + * when sampling this texture due to the extra bit of precision provided for + * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and + * luminance/alpha textures will also still work as expected. + * + * @type {?Texture} + * @default null + */ + alphaMap: Texture | null; + /** + * Defines the size of the points in pixels. + * + * Might be capped if the value exceeds hardware dependent parameters like [gl.ALIASED_POINT_SIZE_RANGE](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getParamete). + * + * @type {number} + * @default 1 + */ + size: number; + /** + * Specifies whether size of individual points is attenuated by the camera depth (perspective camera only). + * + * @type {boolean} + * @default true + */ + sizeAttenuation: boolean; + /** + * Whether the material is affected by fog or not. + * + * @type {boolean} + * @default true + */ + fog: boolean; + copy(source: any): this; +} +import { Material } from './Material.js'; +import { Color } from '../math/Color.js'; diff --git a/jsdoc-testing/jsdoc/materials/RawShaderMaterial.d.ts b/jsdoc-testing/jsdoc/materials/RawShaderMaterial.d.ts new file mode 100644 index 000000000..6f5a5c8a5 --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/RawShaderMaterial.d.ts @@ -0,0 +1,108 @@ +declare const RawShaderMaterial_base: { + new (parameters?: Object): { + readonly isShaderMaterial: boolean; + type: string; + defines: Object; + uniforms: Object; + uniformsGroups: Array; + vertexShader: string; + fragmentShader: string; + linewidth: number; + wireframe: boolean; + wireframeLinewidth: number; + fog: boolean; + lights: boolean; + clipping: boolean; + forceSinglePass: boolean; + extensions: { + clipCullDistance: false; + multiDraw: false; + }; + defaultAttributeValues: Object; + index0AttributeName: string | undefined; + uniformsNeedUpdate: boolean; + glslVersion: (GLSL1 | GLSL3) | null; + copy(source: any): /*elided*/ any; + toJSON(meta: any): Object; + readonly isMaterial: boolean; + readonly uuid: string; + name: string; + blending: (NoBlending | number | AdditiveBlending | SubtractiveBlending | MultiplyBlending | CustomBlending); + side: (number | BackSide | DoubleSide); + vertexColors: boolean; + opacity: number; + transparent: boolean; + alphaHash: boolean; + blendSrc: (ZeroFactor | OneFactor | SrcColorFactor | OneMinusSrcColorFactor | number | number | DstAlphaFactor | OneMinusDstAlphaFactor | DstColorFactor | OneMinusDstColorFactor | SrcAlphaSaturateFactor | ConstantColorFactor | OneMinusConstantColorFactor | ConstantAlphaFactor | OneMinusConstantAlphaFactor); + blendDst: (ZeroFactor | OneFactor | SrcColorFactor | OneMinusSrcColorFactor | number | number | DstAlphaFactor | OneMinusDstAlphaFactor | DstColorFactor | OneMinusDstColorFactor | SrcAlphaSaturateFactor | ConstantColorFactor | OneMinusConstantColorFactor | ConstantAlphaFactor | OneMinusConstantAlphaFactor); + blendEquation: (number | SubtractEquation | ReverseSubtractEquation | MinEquation | MaxEquation); + blendSrcAlpha: (ZeroFactor | OneFactor | SrcColorFactor | OneMinusSrcColorFactor | number | number | DstAlphaFactor | OneMinusDstAlphaFactor | DstColorFactor | OneMinusDstColorFactor | SrcAlphaSaturateFactor | ConstantColorFactor | OneMinusConstantColorFactor | ConstantAlphaFactor | OneMinusConstantAlphaFactor) | null; + blendDstAlpha: (ZeroFactor | OneFactor | SrcColorFactor | OneMinusSrcColorFactor | number | number | DstAlphaFactor | OneMinusDstAlphaFactor | DstColorFactor | OneMinusDstColorFactor | SrcAlphaSaturateFactor | ConstantColorFactor | OneMinusConstantColorFactor | ConstantAlphaFactor | OneMinusConstantAlphaFactor) | null; + blendEquationAlpha: (number | SubtractEquation | ReverseSubtractEquation | MinEquation | MaxEquation) | null; + blendColor: import("../math/Color.js").Color; + blendAlpha: number; + depthFunc: (NeverDepth | AlwaysDepth | LessDepth | number | EqualDepth | GreaterEqualDepth | GreaterDepth | NotEqualDepth); + depthTest: boolean; + depthWrite: boolean; + stencilWriteMask: number; + stencilFunc: NeverStencilFunc | LessStencilFunc | EqualStencilFunc | LessEqualStencilFunc | GreaterStencilFunc | NotEqualStencilFunc | GreaterEqualStencilFunc | number; + stencilRef: number; + stencilFuncMask: number; + stencilFail: ZeroStencilOp | number | ReplaceStencilOp | IncrementStencilOp | DecrementStencilOp | IncrementWrapStencilOp | DecrementWrapStencilOp | InvertStencilOp; + stencilZFail: ZeroStencilOp | number | ReplaceStencilOp | IncrementStencilOp | DecrementStencilOp | IncrementWrapStencilOp | DecrementWrapStencilOp | InvertStencilOp; + stencilZPass: ZeroStencilOp | number | ReplaceStencilOp | IncrementStencilOp | DecrementStencilOp | IncrementWrapStencilOp | DecrementWrapStencilOp | InvertStencilOp; + stencilWrite: boolean; + clippingPlanes: Array | null; + clipIntersection: boolean; + clipShadows: boolean; + shadowSide: (number | BackSide | DoubleSide) | null; + colorWrite: boolean; + precision: ("highp" | "mediump" | "lowp") | null; + polygonOffset: boolean; + polygonOffsetFactor: number; + polygonOffsetUnits: number; + dithering: boolean; + alphaToCoverage: boolean; + premultipliedAlpha: boolean; + allowOverride: boolean; + visible: boolean; + toneMapped: boolean; + userData: Object; + readonly version: number; + _alphaTest: number; + get alphaTest(): number; + set alphaTest(value: number); + onBeforeRender(): void; + onBeforeCompile(): void; + customProgramCacheKey(): string; + setValues(values?: Object): void; + clone(): Material; + dispose(): void; + set needsUpdate(value: boolean); + addEventListener(type: string, listener: Function): void; + _listeners: {} | undefined; + hasEventListener(type: string, listener: Function): boolean; + removeEventListener(type: string, listener: Function): void; + dispatchEvent(event: Object): void; + }; +}; +/** + * This class works just like {@link ShaderMaterial}, except that definitions + * of built-in uniforms and attributes are not automatically prepended to the + * GLSL shader code. + * + * `RawShaderMaterial` can only be used with {@link WebGLRenderer}. + * + * @augments ShaderMaterial + */ +export class RawShaderMaterial extends RawShaderMaterial_base { + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isRawShaderMaterial: boolean; +} +export {}; diff --git a/jsdoc-testing/jsdoc/materials/ShaderMaterial.d.ts b/jsdoc-testing/jsdoc/materials/ShaderMaterial.d.ts new file mode 100644 index 000000000..63d1da267 --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/ShaderMaterial.d.ts @@ -0,0 +1,256 @@ +/** + * ~Shader + */ +export type ShaderMaterial = { + /** + * - The name of the shader. + */ + name: string; + /** + * - The uniforms of the shader. + */ + uniforms: { + [x: string]: Uniform; + }; + /** + * - The defines of the shader. + */ + defines: { + [x: string]: any; + }; + /** + * - The vertex shader code. + */ + vertexShader: string; + /** + * - The fragment shader code. + */ + fragmentShader: string; +}; +/** + * A material rendered with custom shaders. A shader is a small program written in GLSL. + * that runs on the GPU. You may want to use a custom shader if you need to implement an + * effect not included with any of the built-in materials. + * + * There are the following notes to bear in mind when using a `ShaderMaterial`: + * + * - `ShaderMaterial` can only be used with {@link WebGLRenderer}. + * - Built in attributes and uniforms are passed to the shaders along with your code. If + * you don't want that, use {@link RawShaderMaterial} instead. + * - You can use the directive `#pragma unroll_loop_start` and `#pragma unroll_loop_end` + * in order to unroll a `for` loop in GLSL by the shader preprocessor. The directive has + * to be placed right above the loop. The loop formatting has to correspond to a defined standard. + * - The loop has to be [normalized](https://en.wikipedia.org/wiki/Normalized_loop). + * - The loop variable has to be *i*. + * - The value `UNROLLED_LOOP_INDEX` will be replaced with the explicitly + * value of *i* for the given iteration and can be used in preprocessor + * statements. + * + * ```js + * const material = new THREE.ShaderMaterial( { + * uniforms: { + * time: { value: 1.0 }, + * resolution: { value: new THREE.Vector2() } + * }, + * vertexShader: document.getElementById( 'vertexShader' ).textContent, + * fragmentShader: document.getElementById( 'fragmentShader' ).textContent + * } ); + * ``` + * + * @augments Material + */ +export class ShaderMaterial extends Material { + /** + * Constructs a new shader material. + * + * @param {Object} [parameters] - An object with one or more properties + * defining the material's appearance. Any property of the material + * (including any property from inherited materials) can be passed + * in here. Color values can be passed any type of value accepted + * by {@link Color#set}. + */ + constructor(parameters?: Object); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isShaderMaterial: boolean; + type: string; + /** + * Defines custom constants using `#define` directives within the GLSL code + * for both the vertex shader and the fragment shader; each key/value pair + * yields another directive. + * ```js + * defines: { + * FOO: 15, + * BAR: true + * } + * ``` + * Yields the lines: + * ``` + * #define FOO 15 + * #define BAR true + * ``` + * + * @type {Object} + */ + defines: Object; + /** + * An object of the form: + * ```js + * { + * "uniform1": { value: 1.0 }, + * "uniform2": { value: 2 } + * } + * ``` + * specifying the uniforms to be passed to the shader code; keys are uniform + * names, values are definitions of the form + * ``` + * { + * value: 1.0 + * } + * ``` + * where `value` is the value of the uniform. Names must match the name of + * the uniform, as defined in the GLSL code. Note that uniforms are refreshed + * on every frame, so updating the value of the uniform will immediately + * update the value available to the GLSL code. + * + * @type {Object} + */ + uniforms: Object; + /** + * An array holding uniforms groups for configuring UBOs. + * + * @type {Array} + */ + uniformsGroups: Array; + /** + * Vertex shader GLSL code. This is the actual code for the shader. + * + * @type {string} + */ + vertexShader: string; + /** + * Fragment shader GLSL code. This is the actual code for the shader. + * + * @type {string} + */ + fragmentShader: string; + /** + * Controls line thickness or lines. + * + * WebGL and WebGPU ignore this setting and always render line primitives with a + * width of one pixel. + * + * @type {number} + * @default 1 + */ + linewidth: number; + /** + * Renders the geometry as a wireframe. + * + * @type {boolean} + * @default false + */ + wireframe: boolean; + /** + * Controls the thickness of the wireframe. + * + * WebGL and WebGPU ignore this property and always render + * 1 pixel wide lines. + * + * @type {number} + * @default 1 + */ + wireframeLinewidth: number; + /** + * Defines whether the material color is affected by global fog settings; `true` + * to pass fog uniforms to the shader. + * + * Setting this property to `true` requires the definition of fog uniforms. It is + * recommended to use `UniformsUtils.merge()` to combine the custom shader uniforms + * with predefined fog uniforms. + * + * ```js + * const material = new ShaderMaterial( { + * uniforms: UniformsUtils.merge( [ UniformsLib[ 'fog' ], shaderUniforms ] ); + * vertexShader: vertexShader, + * fragmentShader: fragmentShader, + * fog: true + * } ); + * ``` + * + * @type {boolean} + * @default false + */ + fog: boolean; + /** + * Defines whether this material uses lighting; `true` to pass uniform data + * related to lighting to this shader. + * + * @type {boolean} + * @default false + */ + lights: boolean; + /** + * Defines whether this material supports clipping; `true` to let the renderer + * pass the clippingPlanes uniform. + * + * @type {boolean} + * @default false + */ + clipping: boolean; + /** + * This object allows to enable certain WebGL 2 extensions. + * + * - clipCullDistance: set to `true` to use vertex shader clipping + * - multiDraw: set to `true` to use vertex shader multi_draw / enable gl_DrawID + * + * @type {{clipCullDistance:false,multiDraw:false}} + */ + extensions: { + clipCullDistance: false; + multiDraw: false; + }; + /** + * When the rendered geometry doesn't include these attributes but the + * material does, these default values will be passed to the shaders. This + * avoids errors when buffer data is missing. + * + * - color: [ 1, 1, 1 ] + * - uv: [ 0, 0 ] + * - uv1: [ 0, 0 ] + * + * @type {Object} + */ + defaultAttributeValues: Object; + /** + * If set, this calls [gl.bindAttribLocation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bindAttribLocation) + * to bind a generic vertex index to an attribute variable. + * + * @type {string|undefined} + * @default undefined + */ + index0AttributeName: string | undefined; + /** + * Can be used to force a uniform update while changing uniforms in + * {@link Object3D#onBeforeRender}. + * + * @type {boolean} + * @default false + */ + uniformsNeedUpdate: boolean; + /** + * Defines the GLSL version of custom shader code. + * + * @type {?(GLSL1|GLSL3)} + * @default null + */ + glslVersion: (GLSL1 | GLSL3) | null; + copy(source: any): this; + toJSON(meta: any): Object; +} +import { Material } from './Material.js'; diff --git a/jsdoc-testing/jsdoc/materials/ShadowMaterial.d.ts b/jsdoc-testing/jsdoc/materials/ShadowMaterial.d.ts new file mode 100644 index 000000000..2e66a5668 --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/ShadowMaterial.d.ts @@ -0,0 +1,56 @@ +/** + * This material can receive shadows, but otherwise is completely transparent. + * + * ```js + * const geometry = new THREE.PlaneGeometry( 2000, 2000 ); + * geometry.rotateX( - Math.PI / 2 ); + * + * const material = new THREE.ShadowMaterial(); + * material.opacity = 0.2; + * + * const plane = new THREE.Mesh( geometry, material ); + * plane.position.y = -200; + * plane.receiveShadow = true; + * scene.add( plane ); + * ``` + * + * @augments Material + */ +export class ShadowMaterial extends Material { + /** + * Constructs a new shadow material. + * + * @param {Object} [parameters] - An object with one or more properties + * defining the material's appearance. Any property of the material + * (including any property from inherited materials) can be passed + * in here. Color values can be passed any type of value accepted + * by {@link Color#set}. + */ + constructor(parameters?: Object); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isShadowMaterial: boolean; + type: string; + /** + * Color of the material. + * + * @type {Color} + * @default (0,0,0) + */ + color: Color; + /** + * Whether the material is affected by fog or not. + * + * @type {boolean} + * @default true + */ + fog: boolean; + copy(source: any): this; +} +import { Material } from './Material.js'; +import { Color } from '../math/Color.js'; diff --git a/jsdoc-testing/jsdoc/materials/SpriteMaterial.d.ts b/jsdoc-testing/jsdoc/materials/SpriteMaterial.d.ts new file mode 100644 index 000000000..e44d5d72d --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/SpriteMaterial.d.ts @@ -0,0 +1,89 @@ +/** + * A material for rendering instances of {@link Sprite}. + * + * ```js + * const map = new THREE.TextureLoader().load( 'textures/sprite.png' ); + * const material = new THREE.SpriteMaterial( { map: map, color: 0xffffff } ); + * + * const sprite = new THREE.Sprite( material ); + * sprite.scale.set(200, 200, 1) + * scene.add( sprite ); + * ``` + * + * @augments Material + */ +export class SpriteMaterial extends Material { + /** + * Constructs a new sprite material. + * + * @param {Object} [parameters] - An object with one or more properties + * defining the material's appearance. Any property of the material + * (including any property from inherited materials) can be passed + * in here. Color values can be passed any type of value accepted + * by {@link Color#set}. + */ + constructor(parameters?: Object); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isSpriteMaterial: boolean; + type: string; + /** + * Color of the material. + * + * @type {Color} + * @default (1,1,1) + */ + color: Color; + /** + * The color map. May optionally include an alpha channel, typically combined + * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map + * color is modulated by the diffuse `color`. + * + * @type {?Texture} + * @default null + */ + map: Texture | null; + /** + * The alpha map is a grayscale texture that controls the opacity across the + * surface (black: fully transparent; white: fully opaque). + * + * Only the color of the texture is used, ignoring the alpha channel if one + * exists. For RGB and RGBA textures, the renderer will use the green channel + * when sampling this texture due to the extra bit of precision provided for + * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and + * luminance/alpha textures will also still work as expected. + * + * @type {?Texture} + * @default null + */ + alphaMap: Texture | null; + /** + * The rotation of the sprite in radians. + * + * @type {number} + * @default 0 + */ + rotation: number; + /** + * Specifies whether size of the sprite is attenuated by the camera depth (perspective camera only). + * + * @type {boolean} + * @default true + */ + sizeAttenuation: boolean; + /** + * Whether the material is affected by fog or not. + * + * @type {boolean} + * @default true + */ + fog: boolean; + copy(source: any): this; +} +import { Material } from './Material.js'; +import { Color } from '../math/Color.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/Line2NodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/Line2NodeMaterial.d.ts new file mode 100644 index 000000000..1637e7e49 --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/nodes/Line2NodeMaterial.d.ts @@ -0,0 +1,86 @@ +export default Line2NodeMaterial; +/** + * This node material can be used to render lines with a size larger than one + * by representing them as instanced meshes. + * + * @augments NodeMaterial + */ +declare class Line2NodeMaterial extends NodeMaterial { + /** + * Constructs a new node material for wide line rendering. + * + * @param {Object} [parameters={}] - The configuration parameter. + */ + constructor(parameters?: Object); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isLine2NodeMaterial: boolean; + /** + * The dash offset. + * + * @type {number} + * @default 0 + */ + dashOffset: number; + /** + * Defines the lines color. + * + * @type {?Node} + * @default null + */ + lineColorNode: Node | null; + /** + * Defines the offset. + * + * @type {?Node} + * @default null + */ + offsetNode: Node | null; + /** + * Defines the dash scale. + * + * @type {?Node} + * @default null + */ + dashScaleNode: Node | null; + /** + * Defines the dash size. + * + * @type {?Node} + * @default null + */ + dashSizeNode: Node | null; + /** + * Defines the gap size. + * + * @type {?Node} + * @default null + */ + gapSizeNode: Node | null; + _useDash: any; + _useAlphaToCoverage: boolean; + _useWorldUnits: boolean; + set worldUnits(value: boolean); + /** + * Whether the lines should sized in world units or not. + * When set to `false` the unit is pixel. + * + * @type {boolean} + * @default false + */ + get worldUnits(): boolean; + set dashed(value: boolean); + /** + * Whether the lines should be dashed or not. + * + * @type {boolean} + * @default false + */ + get dashed(): boolean; +} +import NodeMaterial from './NodeMaterial.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/LineBasicNodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/LineBasicNodeMaterial.d.ts new file mode 100644 index 000000000..da65dc888 --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/nodes/LineBasicNodeMaterial.d.ts @@ -0,0 +1,23 @@ +export default LineBasicNodeMaterial; +/** + * Node material version of {@link LineBasicMaterial}. + * + * @augments NodeMaterial + */ +declare class LineBasicNodeMaterial extends NodeMaterial { + /** + * Constructs a new line basic node material. + * + * @param {Object} [parameters] - The configuration parameter. + */ + constructor(parameters?: Object); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isLineBasicNodeMaterial: boolean; +} +import NodeMaterial from './NodeMaterial.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/LineDashedNodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/LineDashedNodeMaterial.d.ts new file mode 100644 index 000000000..89820e463 --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/nodes/LineDashedNodeMaterial.d.ts @@ -0,0 +1,78 @@ +export default LineDashedNodeMaterial; +/** + * Node material version of {@link LineDashedMaterial}. + * + * @augments NodeMaterial + */ +declare class LineDashedNodeMaterial extends NodeMaterial { + /** + * Constructs a new line dashed node material. + * + * @param {Object} [parameters] - The configuration parameter. + */ + constructor(parameters?: Object); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isLineDashedNodeMaterial: boolean; + /** + * The dash offset. + * + * @type {number} + * @default 0 + */ + dashOffset: number; + /** + * The offset of dash materials is by default inferred from the `dashOffset` + * property. This node property allows to overwrite the default + * and define the offset with a node instead. + * + * If you don't want to overwrite the offset but modify the existing + * value instead, use {@link materialLineDashOffset}. + * + * @type {?Node} + * @default null + */ + offsetNode: Node | null; + /** + * The scale of dash materials is by default inferred from the `scale` + * property. This node property allows to overwrite the default + * and define the scale with a node instead. + * + * If you don't want to overwrite the scale but modify the existing + * value instead, use {@link materialLineScale}. + * + * @type {?Node} + * @default null + */ + dashScaleNode: Node | null; + /** + * The dash size of dash materials is by default inferred from the `dashSize` + * property. This node property allows to overwrite the default + * and define the dash size with a node instead. + * + * If you don't want to overwrite the dash size but modify the existing + * value instead, use {@link materialLineDashSize}. + * + * @type {?Node} + * @default null + */ + dashSizeNode: Node | null; + /** + * The gap size of dash materials is by default inferred from the `gapSize` + * property. This node property allows to overwrite the default + * and define the gap size with a node instead. + * + * If you don't want to overwrite the gap size but modify the existing + * value instead, use {@link materialLineGapSize}. + * + * @type {?Node} + * @default null + */ + gapSizeNode: Node | null; +} +import NodeMaterial from './NodeMaterial.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/MeshBasicNodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/MeshBasicNodeMaterial.d.ts new file mode 100644 index 000000000..97d6b1cb4 --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/nodes/MeshBasicNodeMaterial.d.ts @@ -0,0 +1,39 @@ +export default MeshBasicNodeMaterial; +/** + * Node material version of {@link MeshBasicMaterial}. + * + * @augments NodeMaterial + */ +declare class MeshBasicNodeMaterial extends NodeMaterial { + /** + * Constructs a new mesh basic node material. + * + * @param {Object} [parameters] - The configuration parameter. + */ + constructor(parameters?: Object); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isMeshBasicNodeMaterial: boolean; + /** + * Overwritten since this type of material uses {@link BasicEnvironmentNode} + * to implement the default environment mapping. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {?BasicEnvironmentNode} The environment node. + */ + setupEnvironment(builder: NodeBuilder): BasicEnvironmentNode | null; + /** + * Setups the lighting model. + * + * @return {BasicLightingModel} The lighting model. + */ + setupLightingModel(): BasicLightingModel; +} +import NodeMaterial from './NodeMaterial.js'; +import BasicEnvironmentNode from '../../nodes/lighting/BasicEnvironmentNode.js'; +import BasicLightingModel from '../../nodes/functions/BasicLightingModel.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/MeshLambertNodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/MeshLambertNodeMaterial.d.ts new file mode 100644 index 000000000..a5e110905 --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/nodes/MeshLambertNodeMaterial.d.ts @@ -0,0 +1,39 @@ +export default MeshLambertNodeMaterial; +/** + * Node material version of {@link MeshLambertMaterial}. + * + * @augments NodeMaterial + */ +declare class MeshLambertNodeMaterial extends NodeMaterial { + /** + * Constructs a new mesh lambert node material. + * + * @param {Object} [parameters] - The configuration parameter. + */ + constructor(parameters?: Object); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isMeshLambertNodeMaterial: boolean; + /** + * Overwritten since this type of material uses {@link BasicEnvironmentNode} + * to implement the default environment mapping. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {?BasicEnvironmentNode} The environment node. + */ + setupEnvironment(builder: NodeBuilder): BasicEnvironmentNode | null; + /** + * Setups the lighting model. + * + * @return {PhongLightingModel} The lighting model. + */ + setupLightingModel(): PhongLightingModel; +} +import NodeMaterial from './NodeMaterial.js'; +import BasicEnvironmentNode from '../../nodes/lighting/BasicEnvironmentNode.js'; +import PhongLightingModel from '../../nodes/functions/PhongLightingModel.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/MeshMatcapNodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/MeshMatcapNodeMaterial.d.ts new file mode 100644 index 000000000..1a2d32c8c --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/nodes/MeshMatcapNodeMaterial.d.ts @@ -0,0 +1,29 @@ +export default MeshMatcapNodeMaterial; +/** + * Node material version of {@link MeshMatcapMaterial}. + * + * @augments NodeMaterial + */ +declare class MeshMatcapNodeMaterial extends NodeMaterial { + /** + * Constructs a new mesh normal node material. + * + * @param {Object} [parameters] - The configuration parameter. + */ + constructor(parameters?: Object); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isMeshMatcapNodeMaterial: boolean; + /** + * Setups the matcap specific node variables. + * + * @param {NodeBuilder} builder - The current node builder. + */ + setupVariants(builder: NodeBuilder): void; +} +import NodeMaterial from './NodeMaterial.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/MeshNormalNodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/MeshNormalNodeMaterial.d.ts new file mode 100644 index 000000000..effc5951b --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/nodes/MeshNormalNodeMaterial.d.ts @@ -0,0 +1,28 @@ +export default MeshNormalNodeMaterial; +/** + * Node material version of {@link MeshNormalMaterial}. + * + * @augments NodeMaterial + */ +declare class MeshNormalNodeMaterial extends NodeMaterial { + /** + * Constructs a new mesh normal node material. + * + * @param {Object} [parameters] - The configuration parameter. + */ + constructor(parameters?: Object); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isMeshNormalNodeMaterial: boolean; + /** + * Overwrites the default implementation by computing the diffuse color + * based on the normal data. + */ + setupDiffuseColor(): void; +} +import NodeMaterial from './NodeMaterial.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/MeshPhongNodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/MeshPhongNodeMaterial.d.ts new file mode 100644 index 000000000..b55a9c942 --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/nodes/MeshPhongNodeMaterial.d.ts @@ -0,0 +1,64 @@ +export default MeshPhongNodeMaterial; +/** + * Node material version of {@link MeshPhongMaterial}. + * + * @augments NodeMaterial + */ +declare class MeshPhongNodeMaterial extends NodeMaterial { + /** + * Constructs a new mesh lambert node material. + * + * @param {Object} [parameters] - The configuration parameter. + */ + constructor(parameters?: Object); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isMeshPhongNodeMaterial: boolean; + /** + * The shininess of phong materials is by default inferred from the `shininess` + * property. This node property allows to overwrite the default + * and define the shininess with a node instead. + * + * If you don't want to overwrite the shininess but modify the existing + * value instead, use {@link materialShininess}. + * + * @type {?Node} + * @default null + */ + shininessNode: Node | null; + /** + * The specular color of phong materials is by default inferred from the + * `specular` property. This node property allows to overwrite the default + * and define the specular color with a node instead. + * + * If you don't want to overwrite the specular color but modify the existing + * value instead, use {@link materialSpecular}. + * + * @type {?Node} + * @default null + */ + specularNode: Node | null; + /** + * Overwritten since this type of material uses {@link BasicEnvironmentNode} + * to implement the default environment mapping. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {?BasicEnvironmentNode} The environment node. + */ + setupEnvironment(builder: NodeBuilder): BasicEnvironmentNode | null; + /** + * Setups the lighting model. + * + * @return {PhongLightingModel} The lighting model. + */ + setupLightingModel(): PhongLightingModel; + copy(source: any): NodeMaterial; +} +import NodeMaterial from './NodeMaterial.js'; +import BasicEnvironmentNode from '../../nodes/lighting/BasicEnvironmentNode.js'; +import PhongLightingModel from '../../nodes/functions/PhongLightingModel.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/MeshPhysicalNodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/MeshPhysicalNodeMaterial.d.ts new file mode 100644 index 000000000..0545af43c --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/nodes/MeshPhysicalNodeMaterial.d.ts @@ -0,0 +1,276 @@ +export default MeshPhysicalNodeMaterial; +/** + * Node material version of {@link MeshPhysicalMaterial}. + * + * @augments MeshStandardNodeMaterial + */ +declare class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial { + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isMeshPhysicalNodeMaterial: boolean; + /** + * The clearcoat of physical materials is by default inferred from the `clearcoat` + * and `clearcoatMap` properties. This node property allows to overwrite the default + * and define the clearcoat with a node instead. + * + * If you don't want to overwrite the clearcoat but modify the existing + * value instead, use {@link materialClearcoat}. + * + * @type {?Node} + * @default null + */ + clearcoatNode: Node | null; + /** + * The clearcoat roughness of physical materials is by default inferred from the `clearcoatRoughness` + * and `clearcoatRoughnessMap` properties. This node property allows to overwrite the default + * and define the clearcoat roughness with a node instead. + * + * If you don't want to overwrite the clearcoat roughness but modify the existing + * value instead, use {@link materialClearcoatRoughness}. + * + * @type {?Node} + * @default null + */ + clearcoatRoughnessNode: Node | null; + /** + * The clearcoat normal of physical materials is by default inferred from the `clearcoatNormalMap` + * property. This node property allows to overwrite the default + * and define the clearcoat normal with a node instead. + * + * If you don't want to overwrite the clearcoat normal but modify the existing + * value instead, use {@link materialClearcoatNormal}. + * + * @type {?Node} + * @default null + */ + clearcoatNormalNode: Node | null; + /** + * The sheen of physical materials is by default inferred from the `sheen`, `sheenColor` + * and `sheenColorMap` properties. This node property allows to overwrite the default + * and define the sheen with a node instead. + * + * If you don't want to overwrite the sheen but modify the existing + * value instead, use {@link materialSheen}. + * + * @type {?Node} + * @default null + */ + sheenNode: Node | null; + /** + * The sheen roughness of physical materials is by default inferred from the `sheenRoughness` and + * `sheenRoughnessMap` properties. This node property allows to overwrite the default + * and define the sheen roughness with a node instead. + * + * If you don't want to overwrite the sheen roughness but modify the existing + * value instead, use {@link materialSheenRoughness}. + * + * @type {?Node} + * @default null + */ + sheenRoughnessNode: Node | null; + /** + * The iridescence of physical materials is by default inferred from the `iridescence` + * property. This node property allows to overwrite the default + * and define the iridescence with a node instead. + * + * If you don't want to overwrite the iridescence but modify the existing + * value instead, use {@link materialIridescence}. + * + * @type {?Node} + * @default null + */ + iridescenceNode: Node | null; + /** + * The iridescence IOR of physical materials is by default inferred from the `iridescenceIOR` + * property. This node property allows to overwrite the default + * and define the iridescence IOR with a node instead. + * + * If you don't want to overwrite the iridescence IOR but modify the existing + * value instead, use {@link materialIridescenceIOR}. + * + * @type {?Node} + * @default null + */ + iridescenceIORNode: Node | null; + /** + * The iridescence thickness of physical materials is by default inferred from the `iridescenceThicknessRange` + * and `iridescenceThicknessMap` properties. This node property allows to overwrite the default + * and define the iridescence thickness with a node instead. + * + * If you don't want to overwrite the iridescence thickness but modify the existing + * value instead, use {@link materialIridescenceThickness}. + * + * @type {?Node} + * @default null + */ + iridescenceThicknessNode: Node | null; + /** + * The specular intensity of physical materials is by default inferred from the `specularIntensity` + * and `specularIntensityMap` properties. This node property allows to overwrite the default + * and define the specular intensity with a node instead. + * + * If you don't want to overwrite the specular intensity but modify the existing + * value instead, use {@link materialSpecularIntensity}. + * + * @type {?Node} + * @default null + */ + specularIntensityNode: Node | null; + /** + * The specular color of physical materials is by default inferred from the `specularColor` + * and `specularColorMap` properties. This node property allows to overwrite the default + * and define the specular color with a node instead. + * + * If you don't want to overwrite the specular color but modify the existing + * value instead, use {@link materialSpecularColor}. + * + * @type {?Node} + * @default null + */ + specularColorNode: Node | null; + /** + * The ior of physical materials is by default inferred from the `ior` + * property. This node property allows to overwrite the default + * and define the ior with a node instead. + * + * If you don't want to overwrite the ior but modify the existing + * value instead, use {@link materialIOR}. + * + * @type {?Node} + * @default null + */ + iorNode: Node | null; + /** + * The transmission of physical materials is by default inferred from the `transmission` and + * `transmissionMap` properties. This node property allows to overwrite the default + * and define the transmission with a node instead. + * + * If you don't want to overwrite the transmission but modify the existing + * value instead, use {@link materialTransmission}. + * + * @type {?Node} + * @default null + */ + transmissionNode: Node | null; + /** + * The thickness of physical materials is by default inferred from the `thickness` and + * `thicknessMap` properties. This node property allows to overwrite the default + * and define the thickness with a node instead. + * + * If you don't want to overwrite the thickness but modify the existing + * value instead, use {@link materialThickness}. + * + * @type {?Node} + * @default null + */ + thicknessNode: Node | null; + /** + * The attenuation distance of physical materials is by default inferred from the + * `attenuationDistance` property. This node property allows to overwrite the default + * and define the attenuation distance with a node instead. + * + * If you don't want to overwrite the attenuation distance but modify the existing + * value instead, use {@link materialAttenuationDistance}. + * + * @type {?Node} + * @default null + */ + attenuationDistanceNode: Node | null; + /** + * The attenuation color of physical materials is by default inferred from the + * `attenuationColor` property. This node property allows to overwrite the default + * and define the attenuation color with a node instead. + * + * If you don't want to overwrite the attenuation color but modify the existing + * value instead, use {@link materialAttenuationColor}. + * + * @type {?Node} + * @default null + */ + attenuationColorNode: Node | null; + /** + * The dispersion of physical materials is by default inferred from the + * `dispersion` property. This node property allows to overwrite the default + * and define the dispersion with a node instead. + * + * If you don't want to overwrite the dispersion but modify the existing + * value instead, use {@link materialDispersion}. + * + * @type {?Node} + * @default null + */ + dispersionNode: Node | null; + /** + * The anisotropy of physical materials is by default inferred from the + * `anisotropy` property. This node property allows to overwrite the default + * and define the anisotropy with a node instead. + * + * If you don't want to overwrite the anisotropy but modify the existing + * value instead, use {@link materialAnisotropy}. + * + * @type {?Node} + * @default null + */ + anisotropyNode: Node | null; + /** + * Whether the lighting model should use clearcoat or not. + * + * @type {boolean} + * @default true + */ + get useClearcoat(): boolean; + /** + * Whether the lighting model should use iridescence or not. + * + * @type {boolean} + * @default true + */ + get useIridescence(): boolean; + /** + * Whether the lighting model should use sheen or not. + * + * @type {boolean} + * @default true + */ + get useSheen(): boolean; + /** + * Whether the lighting model should use anisotropy or not. + * + * @type {boolean} + * @default true + */ + get useAnisotropy(): boolean; + /** + * Whether the lighting model should use transmission or not. + * + * @type {boolean} + * @default true + */ + get useTransmission(): boolean; + /** + * Whether the lighting model should use dispersion or not. + * + * @type {boolean} + * @default true + */ + get useDispersion(): boolean; + /** + * Setups the physical specific node variables. + * + * @param {NodeBuilder} builder - The current node builder. + */ + setupVariants(builder: NodeBuilder): void; + /** + * Setups the clearcoat normal node. + * + * @return {Node} The clearcoat normal. + */ + setupClearcoatNormal(): Node; + setup(builder: any): void; +} +import MeshStandardNodeMaterial from './MeshStandardNodeMaterial.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/MeshSSSNodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/MeshSSSNodeMaterial.d.ts new file mode 100644 index 000000000..ca33d8128 --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/nodes/MeshSSSNodeMaterial.d.ts @@ -0,0 +1,96 @@ +export default MeshSSSNodeMaterial; +/** + * This node material is an experimental extension of {@link MeshPhysicalNodeMaterial} + * that implements a Subsurface scattering (SSS) term. + * + * @augments MeshPhysicalNodeMaterial + */ +declare class MeshSSSNodeMaterial extends MeshPhysicalNodeMaterial { + /** + * Represents the thickness color. + * + * @type {?Node} + * @default null + */ + thicknessColorNode: Node | null; + /** + * Represents the distortion factor. + * + * @type {?Node} + */ + thicknessDistortionNode: Node | null; + /** + * Represents the thickness ambient factor. + * + * @type {?Node} + */ + thicknessAmbientNode: Node | null; + /** + * Represents the thickness attenuation. + * + * @type {?Node} + */ + thicknessAttenuationNode: Node | null; + /** + * Represents the thickness power. + * + * @type {?Node} + */ + thicknessPowerNode: Node | null; + /** + * Represents the thickness scale. + * + * @type {?Node} + */ + thicknessScaleNode: Node | null; + /** + * Whether the lighting model should use SSS or not. + * + * @type {boolean} + * @default true + */ + get useSSS(): boolean; + /** + * Setups the lighting model. + * + * @return {SSSLightingModel} The lighting model. + */ + setupLightingModel(): SSSLightingModel; +} +import MeshPhysicalNodeMaterial from './MeshPhysicalNodeMaterial.js'; +/** + * Represents the lighting model for {@link MeshSSSNodeMaterial}. + * + * @augments PhysicalLightingModel + */ +declare class SSSLightingModel extends PhysicalLightingModel { + /** + * Constructs a new physical lighting model. + * + * @param {boolean} [clearcoat=false] - Whether clearcoat is supported or not. + * @param {boolean} [sheen=false] - Whether sheen is supported or not. + * @param {boolean} [iridescence=false] - Whether iridescence is supported or not. + * @param {boolean} [anisotropy=false] - Whether anisotropy is supported or not. + * @param {boolean} [transmission=false] - Whether transmission is supported or not. + * @param {boolean} [dispersion=false] - Whether dispersion is supported or not. + * @param {boolean} [sss=false] - Whether SSS is supported or not. + */ + constructor(clearcoat?: boolean, sheen?: boolean, iridescence?: boolean, anisotropy?: boolean, transmission?: boolean, dispersion?: boolean, sss?: boolean); + /** + * Whether the lighting model should use SSS or not. + * + * @type {boolean} + * @default false + */ + useSSS: boolean; + /** + * Extends the default implementation with a SSS term. + * + * Reference: [Approximating Translucency for a Fast, Cheap and Convincing Subsurface Scattering Look](https://colinbarrebrisebois.com/2011/03/07/gdc-2011-approximating-translucency-for-a-fast-cheap-and-convincing-subsurface-scattering-look/) + * + * @param {Object} input - The input data. + * @param {NodeBuilder} builder - The current node builder. + */ + direct({ lightDirection, lightColor, reflectedLight }: Object, builder: NodeBuilder): void; +} +import PhysicalLightingModel from '../../nodes/functions/PhysicalLightingModel.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/MeshStandardNodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/MeshStandardNodeMaterial.d.ts new file mode 100644 index 000000000..2128d9631 --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/nodes/MeshStandardNodeMaterial.d.ts @@ -0,0 +1,81 @@ +export default MeshStandardNodeMaterial; +/** + * Node material version of {@link MeshStandardMaterial}. + * + * @augments NodeMaterial + */ +declare class MeshStandardNodeMaterial extends NodeMaterial { + /** + * Constructs a new mesh standard node material. + * + * @param {Object} [parameters] - The configuration parameter. + */ + constructor(parameters?: Object); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isMeshStandardNodeMaterial: boolean; + /** + * The emissive color of standard materials is by default inferred from the `emissive`, + * `emissiveIntensity` and `emissiveMap` properties. This node property allows to + * overwrite the default and define the emissive color with a node instead. + * + * If you don't want to overwrite the emissive color but modify the existing + * value instead, use {@link materialEmissive}. + * + * @type {?Node} + * @default null + */ + emissiveNode: Node | null; + /** + * The metalness of standard materials is by default inferred from the `metalness`, + * and `metalnessMap` properties. This node property allows to + * overwrite the default and define the metalness with a node instead. + * + * If you don't want to overwrite the metalness but modify the existing + * value instead, use {@link materialMetalness}. + * + * @type {?Node} + * @default null + */ + metalnessNode: Node | null; + /** + * The roughness of standard materials is by default inferred from the `roughness`, + * and `roughnessMap` properties. This node property allows to + * overwrite the default and define the roughness with a node instead. + * + * If you don't want to overwrite the roughness but modify the existing + * value instead, use {@link materialRoughness}. + * + * @type {?Node} + * @default null + */ + roughnessNode: Node | null; + /** + * Overwritten since this type of material uses {@link EnvironmentNode} + * to implement the PBR (PMREM based) environment mapping. Besides, the + * method honors `Scene.environment`. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {?EnvironmentNode} The environment node. + */ + setupEnvironment(builder: NodeBuilder): EnvironmentNode | null; + /** + * Setups the lighting model. + * + * @return {PhysicalLightingModel} The lighting model. + */ + setupLightingModel(): PhysicalLightingModel; + /** + * Setups the specular related node variables. + */ + setupSpecular(): void; + copy(source: any): NodeMaterial; +} +import NodeMaterial from './NodeMaterial.js'; +import EnvironmentNode from '../../nodes/lighting/EnvironmentNode.js'; +import PhysicalLightingModel from '../../nodes/functions/PhysicalLightingModel.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/MeshToonNodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/MeshToonNodeMaterial.d.ts new file mode 100644 index 000000000..1ffe1bd1b --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/nodes/MeshToonNodeMaterial.d.ts @@ -0,0 +1,30 @@ +export default MeshToonNodeMaterial; +/** + * Node material version of {@link MeshToonMaterial}. + * + * @augments NodeMaterial + */ +declare class MeshToonNodeMaterial extends NodeMaterial { + /** + * Constructs a new mesh toon node material. + * + * @param {Object} [parameters] - The configuration parameter. + */ + constructor(parameters?: Object); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isMeshToonNodeMaterial: boolean; + /** + * Setups the lighting model. + * + * @return {ToonLightingModel} The lighting model. + */ + setupLightingModel(): ToonLightingModel; +} +import NodeMaterial from './NodeMaterial.js'; +import ToonLightingModel from '../../nodes/functions/ToonLightingModel.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/NodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/NodeMaterial.d.ts new file mode 100644 index 000000000..3c8a1d19f --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/nodes/NodeMaterial.d.ts @@ -0,0 +1,505 @@ +export default NodeMaterial; +/** + * Base class for all node materials. + * + * @augments Material + */ +declare class NodeMaterial extends Material { + static get type(): string; + set type(_value: string); + /** + * Represents the type of the node material. + * + * @type {string} + */ + get type(): string; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isNodeMaterial: boolean; + /** + * Whether this material is affected by fog or not. + * + * @type {boolean} + * @default true + */ + fog: boolean; + /** + * Whether this material is affected by lights or not. + * + * @type {boolean} + * @default false + */ + lights: boolean; + /** + * Whether this material uses hardware clipping or not. + * This property is managed by the engine and should not be + * modified by apps. + * + * @type {boolean} + * @default false + */ + hardwareClipping: boolean; + /** + * Node materials which set their `lights` property to `true` + * are affected by all lights of the scene. Sometimes selective + * lighting is wanted which means only _some_ lights in the scene + * affect a material. This can be achieved by creating an instance + * of {@link LightsNode} with a list of selective + * lights and assign the node to this property. + * + * ```js + * const customLightsNode = lights( [ light1, light2 ] ); + * material.lightsNode = customLightsNode; + * ``` + * + * @type {?LightsNode} + * @default null + */ + lightsNode: LightsNode | null; + /** + * The environment of node materials can be defined by an environment + * map assigned to the `envMap` property or by `Scene.environment` + * if the node material is a PBR material. This node property allows to overwrite + * the default behavior and define the environment with a custom node. + * + * ```js + * material.envNode = pmremTexture( renderTarget.texture ); + * ``` + * + * @type {?Node} + * @default null + */ + envNode: Node | null; + /** + * The lighting of node materials might be influenced by ambient occlusion. + * The default AO is inferred from an ambient occlusion map assigned to `aoMap` + * and the respective `aoMapIntensity`. This node property allows to overwrite + * the default and define the ambient occlusion with a custom node instead. + * + * If you don't want to overwrite the diffuse color but modify the existing + * values instead, use {@link materialAO}. + * + * @type {?Node} + * @default null + */ + aoNode: Node | null; + /** + * The diffuse color of node materials is by default inferred from the + * `color` and `map` properties. This node property allows to overwrite the default + * and define the diffuse color with a node instead. + * + * ```js + * material.colorNode = color( 0xff0000 ); // define red color + * ``` + * + * If you don't want to overwrite the diffuse color but modify the existing + * values instead, use {@link materialColor}. + * + * ```js + * material.colorNode = materialColor.mul( color( 0xff0000 ) ); // give diffuse colors a red tint + * ``` + * + * @type {?Node} + * @default null + */ + colorNode: Node | null; + /** + * The normals of node materials are by default inferred from the `normalMap`/`normalScale` + * or `bumpMap`/`bumpScale` properties. This node property allows to overwrite the default + * and define the normals with a node instead. + * + * If you don't want to overwrite the normals but modify the existing values instead, + * use {@link materialNormal}. + * + * @type {?Node} + * @default null + */ + normalNode: Node | null; + /** + * The opacity of node materials is by default inferred from the `opacity` + * and `alphaMap` properties. This node property allows to overwrite the default + * and define the opacity with a node instead. + * + * If you don't want to overwrite the opacity but modify the existing + * value instead, use {@link materialOpacity}. + * + * @type {?Node} + * @default null + */ + opacityNode: Node | null; + /** + * This node can be used to implement a variety of filter-like effects. The idea is + * to store the current rendering into a texture e.g. via `viewportSharedTexture()`, use it + * to create an arbitrary effect and then assign the node composition to this property. + * Everything behind the object using this material will now be affected by a filter. + * + * ```js + * const material = new NodeMaterial() + * material.transparent = true; + * + * // everything behind the object will be monochromatic + * material.backdropNode = saturation( viewportSharedTexture().rgb, 0 ); + * ``` + * + * Backdrop computations are part of the lighting so only lit materials can use this property. + * + * @type {?Node} + * @default null + */ + backdropNode: Node | null; + /** + * This node allows to modulate the influence of `backdropNode` to the outgoing light. + * + * @type {?Node} + * @default null + */ + backdropAlphaNode: Node | null; + /** + * The alpha test of node materials is by default inferred from the `alphaTest` + * property. This node property allows to overwrite the default and define the + * alpha test with a node instead. + * + * If you don't want to overwrite the alpha test but modify the existing + * value instead, use {@link materialAlphaTest}. + * + * @type {?Node} + * @default null + */ + alphaTestNode: Node | null; + /** + * Discards the fragment if the mask value is `false`. + * + * @type {?Node} + * @default null + */ + maskNode: Node | null; + /** + * This node can be used to implement a shadow mask for the material. + * + * @type {?Node} + * @default null + */ + maskShadowNode: Node | null; + /** + * The local vertex positions are computed based on multiple factors like the + * attribute data, morphing or skinning. This node property allows to overwrite + * the default and define local vertex positions with nodes instead. + * + * If you don't want to overwrite the vertex positions but modify the existing + * values instead, use {@link positionLocal}. + * + *```js + * material.positionNode = positionLocal.add( displace ); + * ``` + * + * @type {?Node} + * @default null + */ + positionNode: Node | null; + /** + * This node property is intended for logic which modifies geometry data once or per animation step. + * Apps usually place such logic randomly in initialization routines or in the animation loop. + * `geometryNode` is intended as a dedicated API so there is an intended spot where geometry modifications + * can be implemented. + * + * The idea is to assign a `Fn` definition that holds the geometry modification logic. A typical example + * would be a GPU based particle system that provides a node material for usage on app level. The particle + * simulation would be implemented as compute shaders and managed inside a `Fn` function. This function is + * eventually assigned to `geometryNode`. + * + * @type {?Function} + * @default null + */ + geometryNode: Function | null; + /** + * Allows to overwrite depth values in the fragment shader. + * + * @type {?Node} + * @default null + */ + depthNode: Node | null; + /** + * Allows to overwrite the position used for shadow map rendering which + * is by default {@link positionWorld}, the vertex position + * in world space. + * + * @type {?Node} + * @default null + */ + receivedShadowPositionNode: Node | null; + /** + * Allows to overwrite the geometry position used for shadow map projection which + * is by default {@link positionLocal}, the vertex position in local space. + * + * @type {?Node} + * @default null + */ + castShadowPositionNode: Node | null; + /** + * This node can be used to influence how an object using this node material + * receive shadows. + * + * ```js + * const totalShadows = float( 1 ).toVar(); + * material.receivedShadowNode = Fn( ( [ shadow ] ) => { + * totalShadows.mulAssign( shadow ); + * //return float( 1 ); // bypass received shadows + * return shadow.mix( color( 0xff0000 ), 1 ); // modify shadow color + * } ); + * + * @type {?(Function|FunctionNode)} + * @default null + */ + receivedShadowNode: (Function | FunctionNode) | null; + /** + * This node can be used to influence how an object using this node material + * casts shadows. To apply a color to shadows, you can simply do: + * + * ```js + * material.castShadowNode = vec4( 1, 0, 0, 1 ); + * ``` + * + * Which can be nice to fake colored shadows of semi-transparent objects. It + * is also common to use the property with `Fn` function so checks are performed + * per fragment. + * + * ```js + * materialCustomShadow.castShadowNode = Fn( () => { + * hash( vertexIndex ).greaterThan( 0.5 ).discard(); + * return materialColor; + * } )(); + * ``` + * + * @type {?Node} + * @default null + */ + castShadowNode: Node | null; + /** + * This node can be used to define the final output of the material. + * + * TODO: Explain the differences to `fragmentNode`. + * + * @type {?Node} + * @default null + */ + outputNode: Node | null; + /** + * MRT configuration is done on renderer or pass level. This node allows to + * overwrite what values are written into MRT targets on material level. This + * can be useful for implementing selective FX features that should only affect + * specific objects. + * + * @type {?MRTNode} + * @default null + */ + mrtNode: MRTNode | null; + /** + * This node property can be used if you need complete freedom in implementing + * the fragment shader. Assigning a node will replace the built-in material + * logic used in the fragment stage. + * + * @type {?Node} + * @default null + */ + fragmentNode: Node | null; + /** + * This node property can be used if you need complete freedom in implementing + * the vertex shader. Assigning a node will replace the built-in material logic + * used in the vertex stage. + * + * @type {?Node} + * @default null + */ + vertexNode: Node | null; + /** + * This node can be used as a global context management component for this material. + * + * @type {?ContextNode} + * @default null + */ + contextNode: ContextNode | null; + /** + * Returns an array of child nodes for this material. + * + * @private + * @returns {Array<{property: string, childNode: Node}>} + */ + private _getNodeChildren; + /** + * Builds this material with the given node builder. + * + * @param {NodeBuilder} builder - The current node builder. + */ + build(builder: NodeBuilder): void; + /** + * Setups a node material observer with the given builder. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {NodeMaterialObserver} The node material observer. + */ + setupObserver(builder: NodeBuilder): NodeMaterialObserver; + /** + * Setups the vertex and fragment stage of this node material. + * + * @param {NodeBuilder} builder - The current node builder. + */ + setup(builder: NodeBuilder): void; + /** + * Setups the clipping node. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {ClippingNode} The clipping node. + */ + setupClipping(builder: NodeBuilder): ClippingNode; + /** + * Setups the hardware clipping if available on the current device. + * + * @param {NodeBuilder} builder - The current node builder. + */ + setupHardwareClipping(builder: NodeBuilder): void; + /** + * Setups the depth of this material. + * + * @param {NodeBuilder} builder - The current node builder. + */ + setupDepth(builder: NodeBuilder): void; + /** + * Setups the position node in view space. This method exists + * so derived node materials can modify the implementation e.g. sprite materials. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {Node} The position in view space. + */ + setupPositionView(): Node; + /** + * Setups the position in clip space. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {Node} The position in view space. + */ + setupModelViewProjection(): Node; + /** + * Setups the logic for the vertex stage. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {Node} The position in clip space. + */ + setupVertex(builder: NodeBuilder): Node; + /** + * Setups the computation of the position in local space. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {Node} The position in local space. + */ + setupPosition(builder: NodeBuilder): Node; + /** + * Setups the computation of the material's diffuse color. + * + * @param {NodeBuilder} builder - The current node builder. + * @param {BufferGeometry} geometry - The geometry. + */ + setupDiffuseColor(builder: NodeBuilder): void; + /** + * Abstract interface method that can be implemented by derived materials + * to setup material-specific node variables. + * + * @abstract + * @param {NodeBuilder} builder - The current node builder. + */ + setupVariants(): void; + /** + * Setups the outgoing light node variable + * + * @return {Node} The outgoing light node. + */ + setupOutgoingLight(): Node; + /** + * Setups the normal node from the material. + * + * @return {Node} The normal node. + */ + setupNormal(): Node; + /** + * Setups the environment node from the material. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {Node} The environment node. + */ + setupEnvironment(): Node; + /** + * Setups the light map node from the material. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {Node} The light map node. + */ + setupLightMap(builder: NodeBuilder): Node; + /** + * Setups the lights node based on the scene, environment and material. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {LightsNode} The lights node. + */ + setupLights(builder: NodeBuilder): LightsNode; + /** + * This method should be implemented by most derived materials + * since it defines the material's lighting model. + * + * @abstract + * @param {NodeBuilder} builder - The current node builder. + * @return {LightingModel} The lighting model. + */ + setupLightingModel(): LightingModel; + /** + * Setups the outgoing light node. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {Node} The outgoing light node. + */ + setupLighting(builder: NodeBuilder): Node; + /** + * Setup the fog. + * + * @param {NodeBuilder} builder - The current node builder. + * @param {Node} outputNode - The existing output node. + * @return {Node} The output node. + */ + setupFog(builder: NodeBuilder, outputNode: Node): Node; + /** + * Setups premultiplied alpha. + * + * @param {NodeBuilder} builder - The current node builder. + * @param {Node} outputNode - The existing output node. + * @return {Node} The output node. + */ + setupPremultipliedAlpha(builder: NodeBuilder, outputNode: Node): Node; + /** + * Setups the output node. + * + * @param {NodeBuilder} builder - The current node builder. + * @param {Node} outputNode - The existing output node. + * @return {Node} The output node. + */ + setupOutput(builder: NodeBuilder, outputNode: Node): Node; + /** + * Most classic material types have a node pendant e.g. for `MeshBasicMaterial` + * there is `MeshBasicNodeMaterial`. This utility method is intended for + * defining all material properties of the classic type in the node type. + * + * @param {Material} material - The material to copy properties with their values to this node material. + */ + setDefaultValues(material: Material): void; + /** + * Copies the properties of the given node material to this instance. + * + * @param {NodeMaterial} source - The material to copy. + * @return {NodeMaterial} A reference to this node material. + */ + copy(source: NodeMaterial): NodeMaterial; +} +import { Material } from '../Material.js'; +import NodeMaterialObserver from './manager/NodeMaterialObserver.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/NodeMaterials.d.ts b/jsdoc-testing/jsdoc/materials/nodes/NodeMaterials.d.ts new file mode 100644 index 000000000..3ab3141d1 --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/nodes/NodeMaterials.d.ts @@ -0,0 +1,18 @@ +export { default as NodeMaterialObserver } from "./manager/NodeMaterialObserver.js"; +export { default as NodeMaterial } from "./NodeMaterial.js"; +export { default as LineBasicNodeMaterial } from "./LineBasicNodeMaterial.js"; +export { default as LineDashedNodeMaterial } from "./LineDashedNodeMaterial.js"; +export { default as Line2NodeMaterial } from "./Line2NodeMaterial.js"; +export { default as MeshNormalNodeMaterial } from "./MeshNormalNodeMaterial.js"; +export { default as MeshBasicNodeMaterial } from "./MeshBasicNodeMaterial.js"; +export { default as MeshLambertNodeMaterial } from "./MeshLambertNodeMaterial.js"; +export { default as MeshPhongNodeMaterial } from "./MeshPhongNodeMaterial.js"; +export { default as MeshStandardNodeMaterial } from "./MeshStandardNodeMaterial.js"; +export { default as MeshPhysicalNodeMaterial } from "./MeshPhysicalNodeMaterial.js"; +export { default as MeshSSSNodeMaterial } from "./MeshSSSNodeMaterial.js"; +export { default as MeshToonNodeMaterial } from "./MeshToonNodeMaterial.js"; +export { default as MeshMatcapNodeMaterial } from "./MeshMatcapNodeMaterial.js"; +export { default as PointsNodeMaterial } from "./PointsNodeMaterial.js"; +export { default as SpriteNodeMaterial } from "./SpriteNodeMaterial.js"; +export { default as ShadowNodeMaterial } from "./ShadowNodeMaterial.js"; +export { default as VolumeNodeMaterial } from "./VolumeNodeMaterial.js"; diff --git a/jsdoc-testing/jsdoc/materials/nodes/PointsNodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/PointsNodeMaterial.d.ts new file mode 100644 index 000000000..1a6e48eef --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/nodes/PointsNodeMaterial.d.ts @@ -0,0 +1,49 @@ +export default PointsNodeMaterial; +/** + * Node material version of {@link PointsMaterial}. + * + * This material can be used in two ways: + * + * - By rendering point primitives with {@link Points}. Since WebGPU only supports point primitives + * with a pixel size of `1`, it's not possible to define a size. + * + * ```js + * const pointCloud = new THREE.Points( geometry, new THREE.PointsNodeMaterial() ); + * ``` + * + * - By rendering point primitives with {@link Sprites}. In this case, size is honored, + * see {@link PointsNodeMaterial#sizeNode}. + * + * ```js + * const instancedPoints = new THREE.Sprite( new THREE.PointsNodeMaterial( { positionNode: instancedBufferAttribute( positionAttribute ) } ) ); + * ``` + * + * @augments SpriteNodeMaterial + */ +declare class PointsNodeMaterial extends SpriteNodeMaterial { + /** + * This node property provides an additional way to set the point size. + * + * Note that WebGPU only supports point primitives with 1 pixel size. Consequently, + * this node has no effect when the material is used with {@link Points} and a WebGPU + * backend. If an application wants to render points with a size larger than 1 pixel, + * the material should be used with {@link Sprite} and instancing. + * + * @type {?Node} + * @default null + */ + sizeNode: Node | null; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isPointsNodeMaterial: boolean; + setupPositionView(): any; + setupVertexSprite(builder: any): any; + setupVertex(builder: any): any; + _useAlphaToCoverage: any; +} +import SpriteNodeMaterial from './SpriteNodeMaterial.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/ShadowNodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/ShadowNodeMaterial.d.ts new file mode 100644 index 000000000..edf904684 --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/nodes/ShadowNodeMaterial.d.ts @@ -0,0 +1,30 @@ +export default ShadowNodeMaterial; +/** + * Node material version of {@link ShadowMaterial}. + * + * @augments NodeMaterial + */ +declare class ShadowNodeMaterial extends NodeMaterial { + /** + * Constructs a new shadow node material. + * + * @param {Object} [parameters] - The configuration parameter. + */ + constructor(parameters?: Object); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isShadowNodeMaterial: boolean; + /** + * Setups the lighting model. + * + * @return {ShadowMaskModel} The lighting model. + */ + setupLightingModel(): ShadowMaskModel; +} +import NodeMaterial from './NodeMaterial.js'; +import ShadowMaskModel from '../../nodes/functions/ShadowMaskModel.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/SpriteNodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/SpriteNodeMaterial.d.ts new file mode 100644 index 000000000..7f8da84d3 --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/nodes/SpriteNodeMaterial.d.ts @@ -0,0 +1,62 @@ +export default SpriteNodeMaterial; +/** + * Node material version of {@link SpriteMaterial}. + * + * @augments NodeMaterial + */ +declare class SpriteNodeMaterial extends NodeMaterial { + /** + * Constructs a new sprite node material. + * + * @param {Object} [parameters] - The configuration parameter. + */ + constructor(parameters?: Object); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isSpriteNodeMaterial: boolean; + _useSizeAttenuation: boolean; + /** + * The rotation of sprite materials is by default inferred from the `rotation`, + * property. This node property allows to overwrite the default and define + * the rotation with a node instead. + * + * If you don't want to overwrite the rotation but modify the existing + * value instead, use {@link materialRotation}. + * + * @type {?Node} + * @default null + */ + rotationNode: Node | null; + /** + * This node property provides an additional way to scale sprites next to + * `Object3D.scale`. The scale transformation based in `Object3D.scale` + * is multiplied with the scale value of this node in the vertex shader. + * + * @type {?Node} + * @default null + */ + scaleNode: Node | null; + /** + * Setups the position node in view space. This method implements + * the sprite specific vertex shader. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {Node} The position in view space. + */ + setupPositionView(builder: NodeBuilder): Node; + copy(source: any): NodeMaterial; + set sizeAttenuation(value: boolean); + /** + * Whether to use size attenuation or not. + * + * @type {boolean} + * @default true + */ + get sizeAttenuation(): boolean; +} +import NodeMaterial from './NodeMaterial.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/VolumeNodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/VolumeNodeMaterial.d.ts new file mode 100644 index 000000000..8b5885c3c --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/nodes/VolumeNodeMaterial.d.ts @@ -0,0 +1,48 @@ +export default VolumeNodeMaterial; +/** + * Volume node material. + * + * @augments NodeMaterial + */ +declare class VolumeNodeMaterial extends NodeMaterial { + /** + * Constructs a new volume node material. + * + * @param {Object} [parameters] - The configuration parameter. + */ + constructor(parameters?: Object); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isVolumeNodeMaterial: boolean; + /** + * Number of steps used for raymarching. + * + * @type {number} + * @default 25 + */ + steps: number; + /** + * Offsets the distance a ray has been traveled through a volume. + * Can be used to implement dithering to reduce banding. + * + * @type {Node} + * @default null + */ + offsetNode: Node; + /** + * Node used for scattering calculations. + * + * @type {Function|FunctionNode} + * @default null + */ + scatteringNode: Function | FunctionNode; + side: number; + setupLightingModel(): VolumetricLightingModel; +} +import NodeMaterial from './NodeMaterial.js'; +import VolumetricLightingModel from '../../nodes/functions/VolumetricLightingModel.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/manager/NodeMaterialObserver.d.ts b/jsdoc-testing/jsdoc/materials/nodes/manager/NodeMaterialObserver.d.ts new file mode 100644 index 000000000..cd485df56 --- /dev/null +++ b/jsdoc-testing/jsdoc/materials/nodes/manager/NodeMaterialObserver.d.ts @@ -0,0 +1,131 @@ +export default NodeMaterialObserver; +/** + * This class is used by {@link WebGPURenderer} as management component. + * It's primary purpose is to determine whether render objects require a + * refresh right before they are going to be rendered or not. + */ +declare class NodeMaterialObserver { + /** + * Constructs a new node material observer. + * + * @param {NodeBuilder} builder - The node builder. + */ + constructor(builder: NodeBuilder); + /** + * A node material can be used by more than one render object so the + * monitor must maintain a list of render objects. + * + * @type {WeakMap} + */ + renderObjects: WeakMap; + /** + * Whether the material uses node objects or not. + * + * @type {boolean} + */ + hasNode: boolean; + /** + * Whether the node builder's 3D object is animated or not. + * + * @type {boolean} + */ + hasAnimation: boolean; + /** + * A list of all possible material uniforms + * + * @type {Array} + */ + refreshUniforms: Array; + /** + * Holds the current render ID from the node frame. + * + * @type {number} + * @default 0 + */ + renderId: number; + /** + * Returns `true` if the given render object is verified for the first time of this observer. + * + * @param {RenderObject} renderObject - The render object. + * @return {boolean} Whether the given render object is verified for the first time of this observer. + */ + firstInitialization(renderObject: RenderObject): boolean; + /** + * Returns `true` if the current rendering produces motion vectors. + * + * @param {Renderer} renderer - The renderer. + * @return {boolean} Whether the current rendering produces motion vectors or not. + */ + needsVelocity(renderer: Renderer): boolean; + /** + * Returns monitoring data for the given render object. + * + * @param {RenderObject} renderObject - The render object. + * @return {Object} The monitoring data. + */ + getRenderObjectData(renderObject: RenderObject): Object; + /** + * Returns an attribute data structure holding the attributes versions for + * monitoring. + * + * @param {Object} attributes - The geometry attributes. + * @return {Object} An object for monitoring the versions of attributes. + */ + getAttributesData(attributes: Object): Object; + /** + * Returns `true` if the node builder's material uses + * node properties. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {boolean} Whether the node builder's material uses node properties or not. + */ + containsNode(builder: NodeBuilder): boolean; + /** + * Returns a geometry data structure holding the geometry property values for + * monitoring. + * + * @param {BufferGeometry} geometry - The geometry. + * @return {Object} An object for monitoring geometry properties. + */ + getGeometryData(geometry: BufferGeometry): Object; + /** + * Returns a material data structure holding the material property values for + * monitoring. + * + * @param {Material} material - The material. + * @return {Object} An object for monitoring material properties. + */ + getMaterialData(material: Material): Object; + /** + * Returns `true` if the given render object has not changed its state. + * + * @param {RenderObject} renderObject - The render object. + * @param {Array} lightsData - The current material lights. + * @param {number} renderId - The current render ID. + * @return {boolean} Whether the given render object has changed its state or not. + */ + equals(renderObject: RenderObject, lightsData: Array, renderId: number): boolean; + /** + * Returns the lights data for the given material lights. + * + * @param {Array} materialLights - The material lights. + * @return {Array} The lights data for the given material lights. + */ + getLightsData(materialLights: Array): Array; + /** + * Returns the lights for the given lights node and render ID. + * + * @param {LightsNode} lightsNode - The lights node. + * @param {number} renderId - The render ID. + * @return {Array} The lights for the given lights node and render ID. + */ + getLights(lightsNode: LightsNode, renderId: number): Array; + /** + * Checks if the given render object requires a refresh. + * + * @param {RenderObject} renderObject - The render object. + * @param {NodeFrame} nodeFrame - The current node frame. + * @return {boolean} Whether the given render object requires a refresh or not. + */ + needsRefresh(renderObject: RenderObject, nodeFrame: NodeFrame): boolean; +} diff --git a/jsdoc-testing/jsdoc/math/Box3.d.ts b/jsdoc-testing/jsdoc/math/Box3.d.ts new file mode 100644 index 000000000..b85cca985 --- /dev/null +++ b/jsdoc-testing/jsdoc/math/Box3.d.ts @@ -0,0 +1,293 @@ +/** + * Represents an axis-aligned bounding box (AABB) in 3D space. + */ +export class Box3 { + /** + * Constructs a new bounding box. + * + * @param {Vector3} [min=(Infinity,Infinity,Infinity)] - A vector representing the lower boundary of the box. + * @param {Vector3} [max=(-Infinity,-Infinity,-Infinity)] - A vector representing the upper boundary of the box. + */ + constructor(min?: Vector3, max?: Vector3); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isBox3: boolean; + /** + * The lower boundary of the box. + * + * @type {Vector3} + */ + min: Vector3; + /** + * The upper boundary of the box. + * + * @type {Vector3} + */ + max: Vector3; + /** + * Sets the lower and upper boundaries of this box. + * Please note that this method only copies the values from the given objects. + * + * @param {Vector3} min - The lower boundary of the box. + * @param {Vector3} max - The upper boundary of the box. + * @return {Box3} A reference to this bounding box. + */ + set(min: Vector3, max: Vector3): Box3; + /** + * Sets the upper and lower bounds of this box so it encloses the position data + * in the given array. + * + * @param {Array} array - An array holding 3D position data. + * @return {Box3} A reference to this bounding box. + */ + setFromArray(array: Array): Box3; + /** + * Sets the upper and lower bounds of this box so it encloses the position data + * in the given buffer attribute. + * + * @param {BufferAttribute} attribute - A buffer attribute holding 3D position data. + * @return {Box3} A reference to this bounding box. + */ + setFromBufferAttribute(attribute: BufferAttribute): Box3; + /** + * Sets the upper and lower bounds of this box so it encloses the position data + * in the given array. + * + * @param {Array} points - An array holding 3D position data as instances of {@link Vector3}. + * @return {Box3} A reference to this bounding box. + */ + setFromPoints(points: Array): Box3; + /** + * Centers this box on the given center vector and sets this box's width, height and + * depth to the given size values. + * + * @param {Vector3} center - The center of the box. + * @param {Vector3} size - The x, y and z dimensions of the box. + * @return {Box3} A reference to this bounding box. + */ + setFromCenterAndSize(center: Vector3, size: Vector3): Box3; + /** + * Computes the world-axis-aligned bounding box for the given 3D object + * (including its children), accounting for the object's, and children's, + * world transforms. The function may result in a larger box than strictly necessary. + * + * @param {Object3D} object - The 3D object to compute the bounding box for. + * @param {boolean} [precise=false] - If set to `true`, the method computes the smallest + * world-axis-aligned bounding box at the expense of more computation. + * @return {Box3} A reference to this bounding box. + */ + setFromObject(object: Object3D, precise?: boolean): Box3; + /** + * Returns a new box with copied values from this instance. + * + * @return {Box3} A clone of this instance. + */ + clone(): Box3; + /** + * Copies the values of the given box to this instance. + * + * @param {Box3} box - The box to copy. + * @return {Box3} A reference to this bounding box. + */ + copy(box: Box3): Box3; + /** + * Makes this box empty which means in encloses a zero space in 3D. + * + * @return {Box3} A reference to this bounding box. + */ + makeEmpty(): Box3; + /** + * Returns true if this box includes zero points within its bounds. + * Note that a box with equal lower and upper bounds still includes one + * point, the one both bounds share. + * + * @return {boolean} Whether this box is empty or not. + */ + isEmpty(): boolean; + /** + * Returns the center point of this box. + * + * @param {Vector3} target - The target vector that is used to store the method's result. + * @return {Vector3} The center point. + */ + getCenter(target: Vector3): Vector3; + /** + * Returns the dimensions of this box. + * + * @param {Vector3} target - The target vector that is used to store the method's result. + * @return {Vector3} The size. + */ + getSize(target: Vector3): Vector3; + /** + * Expands the boundaries of this box to include the given point. + * + * @param {Vector3} point - The point that should be included by the bounding box. + * @return {Box3} A reference to this bounding box. + */ + expandByPoint(point: Vector3): Box3; + /** + * Expands this box equilaterally by the given vector. The width of this + * box will be expanded by the x component of the vector in both + * directions. The height of this box will be expanded by the y component of + * the vector in both directions. The depth of this box will be + * expanded by the z component of the vector in both directions. + * + * @param {Vector3} vector - The vector that should expand the bounding box. + * @return {Box3} A reference to this bounding box. + */ + expandByVector(vector: Vector3): Box3; + /** + * Expands each dimension of the box by the given scalar. If negative, the + * dimensions of the box will be contracted. + * + * @param {number} scalar - The scalar value that should expand the bounding box. + * @return {Box3} A reference to this bounding box. + */ + expandByScalar(scalar: number): Box3; + /** + * Expands the boundaries of this box to include the given 3D object and + * its children, accounting for the object's, and children's, world + * transforms. The function may result in a larger box than strictly + * necessary (unless the precise parameter is set to true). + * + * @param {Object3D} object - The 3D object that should expand the bounding box. + * @param {boolean} precise - If set to `true`, the method expands the bounding box + * as little as necessary at the expense of more computation. + * @return {Box3} A reference to this bounding box. + */ + expandByObject(object: Object3D, precise?: boolean): Box3; + /** + * Returns `true` if the given point lies within or on the boundaries of this box. + * + * @param {Vector3} point - The point to test. + * @return {boolean} Whether the bounding box contains the given point or not. + */ + containsPoint(point: Vector3): boolean; + /** + * Returns `true` if this bounding box includes the entirety of the given bounding box. + * If this box and the given one are identical, this function also returns `true`. + * + * @param {Box3} box - The bounding box to test. + * @return {boolean} Whether the bounding box contains the given bounding box or not. + */ + containsBox(box: Box3): boolean; + /** + * Returns a point as a proportion of this box's width, height and depth. + * + * @param {Vector3} point - A point in 3D space. + * @param {Vector3} target - The target vector that is used to store the method's result. + * @return {Vector3} A point as a proportion of this box's width, height and depth. + */ + getParameter(point: Vector3, target: Vector3): Vector3; + /** + * Returns `true` if the given bounding box intersects with this bounding box. + * + * @param {Box3} box - The bounding box to test. + * @return {boolean} Whether the given bounding box intersects with this bounding box. + */ + intersectsBox(box: Box3): boolean; + /** + * Returns `true` if the given bounding sphere intersects with this bounding box. + * + * @param {Sphere} sphere - The bounding sphere to test. + * @return {boolean} Whether the given bounding sphere intersects with this bounding box. + */ + intersectsSphere(sphere: Sphere): boolean; + /** + * Returns `true` if the given plane intersects with this bounding box. + * + * @param {Plane} plane - The plane to test. + * @return {boolean} Whether the given plane intersects with this bounding box. + */ + intersectsPlane(plane: Plane): boolean; + /** + * Returns `true` if the given triangle intersects with this bounding box. + * + * @param {Triangle} triangle - The triangle to test. + * @return {boolean} Whether the given triangle intersects with this bounding box. + */ + intersectsTriangle(triangle: Triangle): boolean; + /** + * Clamps the given point within the bounds of this box. + * + * @param {Vector3} point - The point to clamp. + * @param {Vector3} target - The target vector that is used to store the method's result. + * @return {Vector3} The clamped point. + */ + clampPoint(point: Vector3, target: Vector3): Vector3; + /** + * Returns the euclidean distance from any edge of this box to the specified point. If + * the given point lies inside of this box, the distance will be `0`. + * + * @param {Vector3} point - The point to compute the distance to. + * @return {number} The euclidean distance. + */ + distanceToPoint(point: Vector3): number; + /** + * Returns a bounding sphere that encloses this bounding box. + * + * @param {Sphere} target - The target sphere that is used to store the method's result. + * @return {Sphere} The bounding sphere that encloses this bounding box. + */ + getBoundingSphere(target: Sphere): Sphere; + /** + * Computes the intersection of this bounding box and the given one, setting the upper + * bound of this box to the lesser of the two boxes' upper bounds and the + * lower bound of this box to the greater of the two boxes' lower bounds. If + * there's no overlap, makes this box empty. + * + * @param {Box3} box - The bounding box to intersect with. + * @return {Box3} A reference to this bounding box. + */ + intersect(box: Box3): Box3; + /** + * Computes the union of this box and another and the given one, setting the upper + * bound of this box to the greater of the two boxes' upper bounds and the + * lower bound of this box to the lesser of the two boxes' lower bounds. + * + * @param {Box3} box - The bounding box that will be unioned with this instance. + * @return {Box3} A reference to this bounding box. + */ + union(box: Box3): Box3; + /** + * Transforms this bounding box by the given 4x4 transformation matrix. + * + * @param {Matrix4} matrix - The transformation matrix. + * @return {Box3} A reference to this bounding box. + */ + applyMatrix4(matrix: Matrix4): Box3; + /** + * Adds the given offset to both the upper and lower bounds of this bounding box, + * effectively moving it in 3D space. + * + * @param {Vector3} offset - The offset that should be used to translate the bounding box. + * @return {Box3} A reference to this bounding box. + */ + translate(offset: Vector3): Box3; + /** + * Returns `true` if this bounding box is equal with the given one. + * + * @param {Box3} box - The box to test for equality. + * @return {boolean} Whether this bounding box is equal with the given one. + */ + equals(box: Box3): boolean; + /** + * Returns a serialized structure of the bounding box. + * + * @return {Object} Serialized structure with fields representing the object state. + */ + toJSON(): Object; + /** + * Returns a serialized structure of the bounding box. + * + * @param {Object} json - The serialized json to set the box from. + * @return {Box3} A reference to this bounding box. + */ + fromJSON(json: Object): Box3; +} +import { Vector3 } from './Vector3.js'; diff --git a/jsdoc-testing/jsdoc/math/Color.d.ts b/jsdoc-testing/jsdoc/math/Color.d.ts new file mode 100644 index 000000000..88445d822 --- /dev/null +++ b/jsdoc-testing/jsdoc/math/Color.d.ts @@ -0,0 +1,538 @@ +/** + * A Color instance is represented by RGB components in the linear working + * color space, which defaults to `LinearSRGBColorSpace`. Inputs + * conventionally using `SRGBColorSpace` (such as hexadecimals and CSS + * strings) are converted to the working color space automatically. + * + * ```js + * // converted automatically from SRGBColorSpace to LinearSRGBColorSpace + * const color = new THREE.Color().setHex( 0x112233 ); + * ``` + * Source color spaces may be specified explicitly, to ensure correct conversions. + * ```js + * // assumed already LinearSRGBColorSpace; no conversion + * const color = new THREE.Color().setRGB( 0.5, 0.5, 0.5 ); + * + * // converted explicitly from SRGBColorSpace to LinearSRGBColorSpace + * const color = new THREE.Color().setRGB( 0.5, 0.5, 0.5, SRGBColorSpace ); + * ``` + * If THREE.ColorManagement is disabled, no conversions occur. For details, + * see Color management. Iterating through a Color instance will yield + * its components (r, g, b) in the corresponding order. A Color can be initialised + * in any of the following ways: + * ```js + * //empty constructor - will default white + * const color1 = new THREE.Color(); + * + * //Hexadecimal color (recommended) + * const color2 = new THREE.Color( 0xff0000 ); + * + * //RGB string + * const color3 = new THREE.Color("rgb(255, 0, 0)"); + * const color4 = new THREE.Color("rgb(100%, 0%, 0%)"); + * + * //X11 color name - all 140 color names are supported. + * //Note the lack of CamelCase in the name + * const color5 = new THREE.Color( 'skyblue' ); + * //HSL string + * const color6 = new THREE.Color("hsl(0, 100%, 50%)"); + * + * //Separate RGB values between 0 and 1 + * const color7 = new THREE.Color( 1, 0, 0 ); + * ``` + */ +export class Color { + /** + * Constructs a new color. + * + * Note that standard method of specifying color in three.js is with a hexadecimal triplet, + * and that method is used throughout the rest of the documentation. + * + * @param {(number|string|Color)} [r] - The red component of the color. If `g` and `b` are + * not provided, it can be hexadecimal triplet, a CSS-style string or another `Color` instance. + * @param {number} [g] - The green component. + * @param {number} [b] - The blue component. + */ + constructor(r?: (number | string | Color), g?: number, b?: number); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isColor: boolean; + /** + * The red component. + * + * @type {number} + * @default 1 + */ + r: number; + /** + * The green component. + * + * @type {number} + * @default 1 + */ + g: number; + /** + * The blue component. + * + * @type {number} + * @default 1 + */ + b: number; + /** + * Sets the colors's components from the given values. + * + * @param {(number|string|Color)} [r] - The red component of the color. If `g` and `b` are + * not provided, it can be hexadecimal triplet, a CSS-style string or another `Color` instance. + * @param {number} [g] - The green component. + * @param {number} [b] - The blue component. + * @return {Color} A reference to this color. + */ + set(r?: (number | string | Color), g?: number, b?: number): Color; + /** + * Sets the colors's components to the given scalar value. + * + * @param {number} scalar - The scalar value. + * @return {Color} A reference to this color. + */ + setScalar(scalar: number): Color; + /** + * Sets this color from a hexadecimal value. + * + * @param {number} hex - The hexadecimal value. + * @param {string} [colorSpace=SRGBColorSpace] - The color space. + * @return {Color} A reference to this color. + */ + setHex(hex: number, colorSpace?: string): Color; + /** + * Sets this color from RGB values. + * + * @param {number} r - Red channel value between `0.0` and `1.0`. + * @param {number} g - Green channel value between `0.0` and `1.0`. + * @param {number} b - Blue channel value between `0.0` and `1.0`. + * @param {string} [colorSpace=ColorManagement.workingColorSpace] - The color space. + * @return {Color} A reference to this color. + */ + setRGB(r: number, g: number, b: number, colorSpace?: string): Color; + /** + * Sets this color from RGB values. + * + * @param {number} h - Hue value between `0.0` and `1.0`. + * @param {number} s - Saturation value between `0.0` and `1.0`. + * @param {number} l - Lightness value between `0.0` and `1.0`. + * @param {string} [colorSpace=ColorManagement.workingColorSpace] - The color space. + * @return {Color} A reference to this color. + */ + setHSL(h: number, s: number, l: number, colorSpace?: string): Color; + /** + * Sets this color from a CSS-style string. For example, `rgb(250, 0,0)`, + * `rgb(100%, 0%, 0%)`, `hsl(0, 100%, 50%)`, `#ff0000`, `#f00`, or `red` ( or + * any [X11 color name](https://en.wikipedia.org/wiki/X11_color_names#Color_name_chart) - + * all 140 color names are supported). + * + * @param {string} style - Color as a CSS-style string. + * @param {string} [colorSpace=SRGBColorSpace] - The color space. + * @return {Color} A reference to this color. + */ + setStyle(style: string, colorSpace?: string): Color; + /** + * Sets this color from a color name. Faster than {@link Color#setStyle} if + * you don't need the other CSS-style formats. + * + * For convenience, the list of names is exposed in `Color.NAMES` as a hash. + * ```js + * Color.NAMES.aliceblue // returns 0xF0F8FF + * ``` + * + * @param {string} style - The color name. + * @param {string} [colorSpace=SRGBColorSpace] - The color space. + * @return {Color} A reference to this color. + */ + setColorName(style: string, colorSpace?: string): Color; + /** + * Returns a new color with copied values from this instance. + * + * @return {Color} A clone of this instance. + */ + clone(): Color; + /** + * Copies the values of the given color to this instance. + * + * @param {Color} color - The color to copy. + * @return {Color} A reference to this color. + */ + copy(color: Color): Color; + /** + * Copies the given color into this color, and then converts this color from + * `SRGBColorSpace` to `LinearSRGBColorSpace`. + * + * @param {Color} color - The color to copy/convert. + * @return {Color} A reference to this color. + */ + copySRGBToLinear(color: Color): Color; + /** + * Copies the given color into this color, and then converts this color from + * `LinearSRGBColorSpace` to `SRGBColorSpace`. + * + * @param {Color} color - The color to copy/convert. + * @return {Color} A reference to this color. + */ + copyLinearToSRGB(color: Color): Color; + /** + * Converts this color from `SRGBColorSpace` to `LinearSRGBColorSpace`. + * + * @return {Color} A reference to this color. + */ + convertSRGBToLinear(): Color; + /** + * Converts this color from `LinearSRGBColorSpace` to `SRGBColorSpace`. + * + * @return {Color} A reference to this color. + */ + convertLinearToSRGB(): Color; + /** + * Returns the hexadecimal value of this color. + * + * @param {string} [colorSpace=SRGBColorSpace] - The color space. + * @return {number} The hexadecimal value. + */ + getHex(colorSpace?: string): number; + /** + * Returns the hexadecimal value of this color as a string (for example, 'FFFFFF'). + * + * @param {string} [colorSpace=SRGBColorSpace] - The color space. + * @return {string} The hexadecimal value as a string. + */ + getHexString(colorSpace?: string): string; + /** + * Converts the colors RGB values into the HSL format and stores them into the + * given target object. + * + * @param {{h:number,s:number,l:number}} target - The target object that is used to store the method's result. + * @param {string} [colorSpace=ColorManagement.workingColorSpace] - The color space. + * @return {{h:number,s:number,l:number}} The HSL representation of this color. + */ + getHSL(target: { + h: number; + s: number; + l: number; + }, colorSpace?: string): { + h: number; + s: number; + l: number; + }; + /** + * Returns the RGB values of this color and stores them into the given target object. + * + * @param {Color} target - The target color that is used to store the method's result. + * @param {string} [colorSpace=ColorManagement.workingColorSpace] - The color space. + * @return {Color} The RGB representation of this color. + */ + getRGB(target: Color, colorSpace?: string): Color; + /** + * Returns the value of this color as a CSS style string. Example: `rgb(255,0,0)`. + * + * @param {string} [colorSpace=SRGBColorSpace] - The color space. + * @return {string} The CSS representation of this color. + */ + getStyle(colorSpace?: string): string; + /** + * Adds the given HSL values to this color's values. + * Internally, this converts the color's RGB values to HSL, adds HSL + * and then converts the color back to RGB. + * + * @param {number} h - Hue value between `0.0` and `1.0`. + * @param {number} s - Saturation value between `0.0` and `1.0`. + * @param {number} l - Lightness value between `0.0` and `1.0`. + * @return {Color} A reference to this color. + */ + offsetHSL(h: number, s: number, l: number): Color; + /** + * Adds the RGB values of the given color to the RGB values of this color. + * + * @param {Color} color - The color to add. + * @return {Color} A reference to this color. + */ + add(color: Color): Color; + /** + * Adds the RGB values of the given colors and stores the result in this instance. + * + * @param {Color} color1 - The first color. + * @param {Color} color2 - The second color. + * @return {Color} A reference to this color. + */ + addColors(color1: Color, color2: Color): Color; + /** + * Adds the given scalar value to the RGB values of this color. + * + * @param {number} s - The scalar to add. + * @return {Color} A reference to this color. + */ + addScalar(s: number): Color; + /** + * Subtracts the RGB values of the given color from the RGB values of this color. + * + * @param {Color} color - The color to subtract. + * @return {Color} A reference to this color. + */ + sub(color: Color): Color; + /** + * Multiplies the RGB values of the given color with the RGB values of this color. + * + * @param {Color} color - The color to multiply. + * @return {Color} A reference to this color. + */ + multiply(color: Color): Color; + /** + * Multiplies the given scalar value with the RGB values of this color. + * + * @param {number} s - The scalar to multiply. + * @return {Color} A reference to this color. + */ + multiplyScalar(s: number): Color; + /** + * Linearly interpolates this color's RGB values toward the RGB values of the + * given color. The alpha argument can be thought of as the ratio between + * the two colors, where `0.0` is this color and `1.0` is the first argument. + * + * @param {Color} color - The color to converge on. + * @param {number} alpha - The interpolation factor in the closed interval `[0,1]`. + * @return {Color} A reference to this color. + */ + lerp(color: Color, alpha: number): Color; + /** + * Linearly interpolates between the given colors and stores the result in this instance. + * The alpha argument can be thought of as the ratio between the two colors, where `0.0` + * is the first and `1.0` is the second color. + * + * @param {Color} color1 - The first color. + * @param {Color} color2 - The second color. + * @param {number} alpha - The interpolation factor in the closed interval `[0,1]`. + * @return {Color} A reference to this color. + */ + lerpColors(color1: Color, color2: Color, alpha: number): Color; + /** + * Linearly interpolates this color's HSL values toward the HSL values of the + * given color. It differs from {@link Color#lerp} by not interpolating straight + * from one color to the other, but instead going through all the hues in between + * those two colors. The alpha argument can be thought of as the ratio between + * the two colors, where 0.0 is this color and 1.0 is the first argument. + * + * @param {Color} color - The color to converge on. + * @param {number} alpha - The interpolation factor in the closed interval `[0,1]`. + * @return {Color} A reference to this color. + */ + lerpHSL(color: Color, alpha: number): Color; + /** + * Sets the color's RGB components from the given 3D vector. + * + * @param {Vector3} v - The vector to set. + * @return {Color} A reference to this color. + */ + setFromVector3(v: Vector3): Color; + /** + * Transforms this color with the given 3x3 matrix. + * + * @param {Matrix3} m - The matrix. + * @return {Color} A reference to this color. + */ + applyMatrix3(m: Matrix3): Color; + /** + * Returns `true` if this color is equal with the given one. + * + * @param {Color} c - The color to test for equality. + * @return {boolean} Whether this bounding color is equal with the given one. + */ + equals(c: Color): boolean; + /** + * Sets this color's RGB components from the given array. + * + * @param {Array} array - An array holding the RGB values. + * @param {number} [offset=0] - The offset into the array. + * @return {Color} A reference to this color. + */ + fromArray(array: Array, offset?: number): Color; + /** + * Writes the RGB components of this color to the given array. If no array is provided, + * the method returns a new instance. + * + * @param {Array} [array=[]] - The target array holding the color components. + * @param {number} [offset=0] - Index of the first element in the array. + * @return {Array} The color components. + */ + toArray(array?: Array, offset?: number): Array; + /** + * Sets the components of this color from the given buffer attribute. + * + * @param {BufferAttribute} attribute - The buffer attribute holding color data. + * @param {number} index - The index into the attribute. + * @return {Color} A reference to this color. + */ + fromBufferAttribute(attribute: BufferAttribute, index: number): Color; + /** + * This methods defines the serialization result of this class. Returns the color + * as a hexadecimal value. + * + * @return {number} The hexadecimal value. + */ + toJSON(): number; + [Symbol.iterator](): Generator; +} +export namespace Color { + export { _colorKeywords as NAMES }; +} +declare namespace _colorKeywords { + let aliceblue: number; + let antiquewhite: number; + let aqua: number; + let aquamarine: number; + let azure: number; + let beige: number; + let bisque: number; + let black: number; + let blanchedalmond: number; + let blue: number; + let blueviolet: number; + let brown: number; + let burlywood: number; + let cadetblue: number; + let chartreuse: number; + let chocolate: number; + let coral: number; + let cornflowerblue: number; + let cornsilk: number; + let crimson: number; + let cyan: number; + let darkblue: number; + let darkcyan: number; + let darkgoldenrod: number; + let darkgray: number; + let darkgreen: number; + let darkgrey: number; + let darkkhaki: number; + let darkmagenta: number; + let darkolivegreen: number; + let darkorange: number; + let darkorchid: number; + let darkred: number; + let darksalmon: number; + let darkseagreen: number; + let darkslateblue: number; + let darkslategray: number; + let darkslategrey: number; + let darkturquoise: number; + let darkviolet: number; + let deeppink: number; + let deepskyblue: number; + let dimgray: number; + let dimgrey: number; + let dodgerblue: number; + let firebrick: number; + let floralwhite: number; + let forestgreen: number; + let fuchsia: number; + let gainsboro: number; + let ghostwhite: number; + let gold: number; + let goldenrod: number; + let gray: number; + let green: number; + let greenyellow: number; + let grey: number; + let honeydew: number; + let hotpink: number; + let indianred: number; + let indigo: number; + let ivory: number; + let khaki: number; + let lavender: number; + let lavenderblush: number; + let lawngreen: number; + let lemonchiffon: number; + let lightblue: number; + let lightcoral: number; + let lightcyan: number; + let lightgoldenrodyellow: number; + let lightgray: number; + let lightgreen: number; + let lightgrey: number; + let lightpink: number; + let lightsalmon: number; + let lightseagreen: number; + let lightskyblue: number; + let lightslategray: number; + let lightslategrey: number; + let lightsteelblue: number; + let lightyellow: number; + let lime: number; + let limegreen: number; + let linen: number; + let magenta: number; + let maroon: number; + let mediumaquamarine: number; + let mediumblue: number; + let mediumorchid: number; + let mediumpurple: number; + let mediumseagreen: number; + let mediumslateblue: number; + let mediumspringgreen: number; + let mediumturquoise: number; + let mediumvioletred: number; + let midnightblue: number; + let mintcream: number; + let mistyrose: number; + let moccasin: number; + let navajowhite: number; + let navy: number; + let oldlace: number; + let olive: number; + let olivedrab: number; + let orange: number; + let orangered: number; + let orchid: number; + let palegoldenrod: number; + let palegreen: number; + let paleturquoise: number; + let palevioletred: number; + let papayawhip: number; + let peachpuff: number; + let peru: number; + let pink: number; + let plum: number; + let powderblue: number; + let purple: number; + let rebeccapurple: number; + let red: number; + let rosybrown: number; + let royalblue: number; + let saddlebrown: number; + let salmon: number; + let sandybrown: number; + let seagreen: number; + let seashell: number; + let sienna: number; + let silver: number; + let skyblue: number; + let slateblue: number; + let slategray: number; + let slategrey: number; + let snow: number; + let springgreen: number; + let steelblue: number; + let tan: number; + let teal: number; + let thistle: number; + let tomato: number; + let turquoise: number; + let violet: number; + let wheat: number; + let white: number; + let whitesmoke: number; + let yellow: number; + let yellowgreen: number; +} +export {}; diff --git a/jsdoc-testing/jsdoc/math/ColorManagement.d.ts b/jsdoc-testing/jsdoc/math/ColorManagement.d.ts new file mode 100644 index 000000000..63d1502b9 --- /dev/null +++ b/jsdoc-testing/jsdoc/math/ColorManagement.d.ts @@ -0,0 +1,21 @@ +export function SRGBToLinear(c: any): number; +export function LinearToSRGB(c: any): number; +export namespace ColorManagement { + export let enabled: boolean; + export { LinearSRGBColorSpace as workingColorSpace }; + export let spaces: {}; + export function convert(color: any, sourceColorSpace: any, targetColorSpace: any): any; + export function workingToColorSpace(color: any, targetColorSpace: any): any; + export function colorSpaceToWorking(color: any, sourceColorSpace: any): any; + export function getPrimaries(colorSpace: any): any; + export function getTransfer(colorSpace: any): any; + export function getToneMappingMode(colorSpace: any): any; + export function getLuminanceCoefficients(target: any, colorSpace?: any): any; + export function define(colorSpaces: any): void; + export function _getMatrix(targetMatrix: any, sourceColorSpace: any, targetColorSpace: any): any; + export function _getDrawingBufferColorSpace(colorSpace: any): any; + export function _getUnpackColorSpace(colorSpace?: any): any; + export function fromWorkingColorSpace(color: any, targetColorSpace: any): any; + export function toWorkingColorSpace(color: any, sourceColorSpace: any): any; +} +import { LinearSRGBColorSpace } from '../constants.js'; diff --git a/jsdoc-testing/jsdoc/math/Euler.d.ts b/jsdoc-testing/jsdoc/math/Euler.d.ts new file mode 100644 index 000000000..8ba21b0f2 --- /dev/null +++ b/jsdoc-testing/jsdoc/math/Euler.d.ts @@ -0,0 +1,164 @@ +/** + * A class representing Euler angles. + * + * Euler angles describe a rotational transformation by rotating an object on + * its various axes in specified amounts per axis, and a specified axis + * order. + * + * Iterating through an instance will yield its components (x, y, z, + * order) in the corresponding order. + * + * ```js + * const a = new THREE.Euler( 0, 1, 1.57, 'XYZ' ); + * const b = new THREE.Vector3( 1, 0, 1 ); + * b.applyEuler(a); + * ``` + */ +export class Euler { + /** + * Constructs a new euler instance. + * + * @param {number} [x=0] - The angle of the x axis in radians. + * @param {number} [y=0] - The angle of the y axis in radians. + * @param {number} [z=0] - The angle of the z axis in radians. + * @param {string} [order=Euler.DEFAULT_ORDER] - A string representing the order that the rotations are applied. + */ + constructor(x?: number, y?: number, z?: number, order?: string); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isEuler: boolean; + _x: number; + _y: number; + _z: number; + _order: string; + set x(value: number); + /** + * The angle of the x axis in radians. + * + * @type {number} + * @default 0 + */ + get x(): number; + set y(value: number); + /** + * The angle of the y axis in radians. + * + * @type {number} + * @default 0 + */ + get y(): number; + set z(value: number); + /** + * The angle of the z axis in radians. + * + * @type {number} + * @default 0 + */ + get z(): number; + set order(value: string); + /** + * A string representing the order that the rotations are applied. + * + * @type {string} + * @default 'XYZ' + */ + get order(): string; + /** + * Sets the Euler components. + * + * @param {number} x - The angle of the x axis in radians. + * @param {number} y - The angle of the y axis in radians. + * @param {number} z - The angle of the z axis in radians. + * @param {string} [order] - A string representing the order that the rotations are applied. + * @return {Euler} A reference to this Euler instance. + */ + set(x: number, y: number, z: number, order?: string): Euler; + /** + * Returns a new Euler instance with copied values from this instance. + * + * @return {Euler} A clone of this instance. + */ + clone(): Euler; + /** + * Copies the values of the given Euler instance to this instance. + * + * @param {Euler} euler - The Euler instance to copy. + * @return {Euler} A reference to this Euler instance. + */ + copy(euler: Euler): Euler; + /** + * Sets the angles of this Euler instance from a pure rotation matrix. + * + * @param {Matrix4} m - A 4x4 matrix of which the upper 3x3 of matrix is a pure rotation matrix (i.e. unscaled). + * @param {string} [order] - A string representing the order that the rotations are applied. + * @param {boolean} [update=true] - Whether the internal `onChange` callback should be executed or not. + * @return {Euler} A reference to this Euler instance. + */ + setFromRotationMatrix(m: Matrix4, order?: string, update?: boolean): Euler; + /** + * Sets the angles of this Euler instance from a normalized quaternion. + * + * @param {Quaternion} q - A normalized Quaternion. + * @param {string} [order] - A string representing the order that the rotations are applied. + * @param {boolean} [update=true] - Whether the internal `onChange` callback should be executed or not. + * @return {Euler} A reference to this Euler instance. + */ + setFromQuaternion(q: Quaternion, order?: string, update?: boolean): Euler; + /** + * Sets the angles of this Euler instance from the given vector. + * + * @param {Vector3} v - The vector. + * @param {string} [order] - A string representing the order that the rotations are applied. + * @return {Euler} A reference to this Euler instance. + */ + setFromVector3(v: Vector3, order?: string): Euler; + /** + * Resets the euler angle with a new order by creating a quaternion from this + * euler angle and then setting this euler angle with the quaternion and the + * new order. + * + * Warning: This discards revolution information. + * + * @param {string} [newOrder] - A string representing the new order that the rotations are applied. + * @return {Euler} A reference to this Euler instance. + */ + reorder(newOrder?: string): Euler; + /** + * Returns `true` if this Euler instance is equal with the given one. + * + * @param {Euler} euler - The Euler instance to test for equality. + * @return {boolean} Whether this Euler instance is equal with the given one. + */ + equals(euler: Euler): boolean; + /** + * Sets this Euler instance's components to values from the given array. The first three + * entries of the array are assign to the x,y and z components. An optional fourth entry + * defines the Euler order. + * + * @param {Array} array - An array holding the Euler component values. + * @return {Euler} A reference to this Euler instance. + */ + fromArray(array: Array): Euler; + /** + * Writes the components of this Euler instance to the given array. If no array is provided, + * the method returns a new instance. + * + * @param {Array} [array=[]] - The target array holding the Euler components. + * @param {number} [offset=0] - Index of the first element in the array. + * @return {Array} The Euler components. + */ + toArray(array?: Array, offset?: number): Array; + _onChange(callback: any): this; + _onChangeCallback(): void; + [Symbol.iterator](): Generator; +} +export namespace Euler { + let DEFAULT_ORDER: string; +} +import { Matrix4 } from './Matrix4.js'; +import { Quaternion } from './Quaternion.js'; diff --git a/jsdoc-testing/jsdoc/math/Frustum.d.ts b/jsdoc-testing/jsdoc/math/Frustum.d.ts new file mode 100644 index 000000000..d6e9231b3 --- /dev/null +++ b/jsdoc-testing/jsdoc/math/Frustum.d.ts @@ -0,0 +1,100 @@ +/** + * Frustums are used to determine what is inside the camera's field of view. + * They help speed up the rendering process - objects which lie outside a camera's + * frustum can safely be excluded from rendering. + * + * This class is mainly intended for use internally by a renderer. + */ +export class Frustum { + /** + * Constructs a new frustum. + * + * @param {Plane} [p0] - The first plane that encloses the frustum. + * @param {Plane} [p1] - The second plane that encloses the frustum. + * @param {Plane} [p2] - The third plane that encloses the frustum. + * @param {Plane} [p3] - The fourth plane that encloses the frustum. + * @param {Plane} [p4] - The fifth plane that encloses the frustum. + * @param {Plane} [p5] - The sixth plane that encloses the frustum. + */ + constructor(p0?: Plane, p1?: Plane, p2?: Plane, p3?: Plane, p4?: Plane, p5?: Plane); + /** + * This array holds the planes that enclose the frustum. + * + * @type {Array} + */ + planes: Array; + /** + * Sets the frustum planes by copying the given planes. + * + * @param {Plane} [p0] - The first plane that encloses the frustum. + * @param {Plane} [p1] - The second plane that encloses the frustum. + * @param {Plane} [p2] - The third plane that encloses the frustum. + * @param {Plane} [p3] - The fourth plane that encloses the frustum. + * @param {Plane} [p4] - The fifth plane that encloses the frustum. + * @param {Plane} [p5] - The sixth plane that encloses the frustum. + * @return {Frustum} A reference to this frustum. + */ + set(p0?: Plane, p1?: Plane, p2?: Plane, p3?: Plane, p4?: Plane, p5?: Plane): Frustum; + /** + * Copies the values of the given frustum to this instance. + * + * @param {Frustum} frustum - The frustum to copy. + * @return {Frustum} A reference to this frustum. + */ + copy(frustum: Frustum): Frustum; + /** + * Sets the frustum planes from the given projection matrix. + * + * @param {Matrix4} m - The projection matrix. + * @param {(WebGLCoordinateSystem|WebGPUCoordinateSystem)} coordinateSystem - The coordinate system. + * @param {boolean} [reversedDepth=false] - Whether to use a reversed depth. + * @return {Frustum} A reference to this frustum. + */ + setFromProjectionMatrix(m: Matrix4, coordinateSystem?: (number | number), reversedDepth?: boolean): Frustum; + /** + * Returns `true` if the 3D object's bounding sphere is intersecting this frustum. + * + * Note that the 3D object must have a geometry so that the bounding sphere can be calculated. + * + * @param {Object3D} object - The 3D object to test. + * @return {boolean} Whether the 3D object's bounding sphere is intersecting this frustum or not. + */ + intersectsObject(object: Object3D): boolean; + /** + * Returns `true` if the given sprite is intersecting this frustum. + * + * @param {Sprite} sprite - The sprite to test. + * @return {boolean} Whether the sprite is intersecting this frustum or not. + */ + intersectsSprite(sprite: Sprite): boolean; + /** + * Returns `true` if the given bounding sphere is intersecting this frustum. + * + * @param {Sphere} sphere - The bounding sphere to test. + * @return {boolean} Whether the bounding sphere is intersecting this frustum or not. + */ + intersectsSphere(sphere: Sphere): boolean; + /** + * Returns `true` if the given bounding box is intersecting this frustum. + * + * @param {Box3} box - The bounding box to test. + * @return {boolean} Whether the bounding box is intersecting this frustum or not. + */ + intersectsBox(box: Box3): boolean; + /** + * Returns `true` if the given point lies within the frustum. + * + * @param {Vector3} point - The point to test. + * @return {boolean} Whether the point lies within this frustum or not. + */ + containsPoint(point: Vector3): boolean; + /** + * Returns a new frustum with copied values from this instance. + * + * @return {Frustum} A clone of this instance. + */ + clone(): Frustum; +} +import { Plane } from './Plane.js'; +import { Sphere } from './Sphere.js'; +import { Vector3 } from './Vector3.js'; diff --git a/jsdoc-testing/jsdoc/math/FrustumArray.d.ts b/jsdoc-testing/jsdoc/math/FrustumArray.d.ts new file mode 100644 index 000000000..f5f5b4bd9 --- /dev/null +++ b/jsdoc-testing/jsdoc/math/FrustumArray.d.ts @@ -0,0 +1,64 @@ +/** + * FrustumArray is used to determine if an object is visible in at least one camera + * from an array of cameras. This is particularly useful for multi-view renderers. +*/ +export class FrustumArray { + /** + * The coordinate system to use. + * + * @type {WebGLCoordinateSystem|WebGPUCoordinateSystem} + * @default WebGLCoordinateSystem + */ + coordinateSystem: number | WebGPUCoordinateSystem; + /** + * Returns `true` if the 3D object's bounding sphere is intersecting any frustum + * from the camera array. + * + * @param {Object3D} object - The 3D object to test. + * @param {Object} cameraArray - An object with a cameras property containing an array of cameras. + * @return {boolean} Whether the 3D object is visible in any camera. + */ + intersectsObject(object: Object3D, cameraArray: Object): boolean; + /** + * Returns `true` if the given sprite is intersecting any frustum + * from the camera array. + * + * @param {Sprite} sprite - The sprite to test. + * @param {Object} cameraArray - An object with a cameras property containing an array of cameras. + * @return {boolean} Whether the sprite is visible in any camera. + */ + intersectsSprite(sprite: Sprite, cameraArray: Object): boolean; + /** + * Returns `true` if the given bounding sphere is intersecting any frustum + * from the camera array. + * + * @param {Sphere} sphere - The bounding sphere to test. + * @param {Object} cameraArray - An object with a cameras property containing an array of cameras. + * @return {boolean} Whether the sphere is visible in any camera. + */ + intersectsSphere(sphere: Sphere, cameraArray: Object): boolean; + /** + * Returns `true` if the given bounding box is intersecting any frustum + * from the camera array. + * + * @param {Box3} box - The bounding box to test. + * @param {Object} cameraArray - An object with a cameras property containing an array of cameras. + * @return {boolean} Whether the box is visible in any camera. + */ + intersectsBox(box: Box3, cameraArray: Object): boolean; + /** + * Returns `true` if the given point lies within any frustum + * from the camera array. + * + * @param {Vector3} point - The point to test. + * @param {Object} cameraArray - An object with a cameras property containing an array of cameras. + * @return {boolean} Whether the point is visible in any camera. + */ + containsPoint(point: Vector3, cameraArray: Object): boolean; + /** + * Returns a new frustum array with copied values from this instance. + * + * @return {FrustumArray} A clone of this instance. + */ + clone(): FrustumArray; +} diff --git a/jsdoc-testing/jsdoc/math/Interpolant.d.ts b/jsdoc-testing/jsdoc/math/Interpolant.d.ts new file mode 100644 index 000000000..561415c0e --- /dev/null +++ b/jsdoc-testing/jsdoc/math/Interpolant.d.ts @@ -0,0 +1,114 @@ +/** + * Abstract base class of interpolants over parametric samples. + * + * The parameter domain is one dimensional, typically the time or a path + * along a curve defined by the data. + * + * The sample values can have any dimensionality and derived classes may + * apply special interpretations to the data. + * + * This class provides the interval seek in a Template Method, deferring + * the actual interpolation to derived classes. + * + * Time complexity is O(1) for linear access crossing at most two points + * and O(log N) for random access, where N is the number of positions. + * + * References: {@link http://www.oodesign.com/template-method-pattern.html} + * + * @abstract + */ +export class Interpolant { + /** + * Constructs a new interpolant. + * + * @param {TypedArray} parameterPositions - The parameter positions hold the interpolation factors. + * @param {TypedArray} sampleValues - The sample values. + * @param {number} sampleSize - The sample size + * @param {TypedArray} [resultBuffer] - The result buffer. + */ + constructor(parameterPositions: TypedArray, sampleValues: TypedArray, sampleSize: number, resultBuffer?: TypedArray); + /** + * The parameter positions. + * + * @type {TypedArray} + */ + parameterPositions: TypedArray; + /** + * A cache index. + * + * @private + * @type {number} + * @default 0 + */ + private _cachedIndex; + /** + * The result buffer. + * + * @type {TypedArray} + */ + resultBuffer: TypedArray; + /** + * The sample values. + * + * @type {TypedArray} + */ + sampleValues: TypedArray; + /** + * The value size. + * + * @type {TypedArray} + */ + valueSize: TypedArray; + /** + * The interpolation settings. + * + * @type {?Object} + * @default null + */ + settings: Object | null; + /** + * The default settings object. + * + * @type {Object} + */ + DefaultSettings_: Object; + /** + * Evaluate the interpolant at position `t`. + * + * @param {number} t - The interpolation factor. + * @return {TypedArray} The result buffer. + */ + evaluate(t: number): TypedArray; + /** + * Returns the interpolation settings. + * + * @return {Object} The interpolation settings. + */ + getSettings_(): Object; + /** + * Copies a sample value to the result buffer. + * + * @param {number} index - An index into the sample value buffer. + * @return {TypedArray} The result buffer. + */ + copySampleValue_(index: number): TypedArray; + /** + * Copies a sample value to the result buffer. + * + * @abstract + * @param {number} i1 - An index into the sample value buffer. + * @param {number} t0 - The previous interpolation factor. + * @param {number} t - The current interpolation factor. + * @param {number} t1 - The next interpolation factor. + * @return {TypedArray} The result buffer. + */ + interpolate_(): TypedArray; + /** + * Optional method that is executed when the interval has changed. + * + * @param {number} i1 - An index into the sample value buffer. + * @param {number} t0 - The previous interpolation factor. + * @param {number} t - The current interpolation factor. + */ + intervalChanged_(): void; +} diff --git a/jsdoc-testing/jsdoc/math/MathUtils.d.ts b/jsdoc-testing/jsdoc/math/MathUtils.d.ts new file mode 100644 index 000000000..bc4d11f77 --- /dev/null +++ b/jsdoc-testing/jsdoc/math/MathUtils.d.ts @@ -0,0 +1,224 @@ +export const DEG2RAD: number; +export const RAD2DEG: number; +/** + * Generate a [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) + * (universally unique identifier). + * + * @return {string} The UUID. + */ +export function generateUUID(): string; +/** + * Clamps the given value between min and max. + * + * @param {number} value - The value to clamp. + * @param {number} min - The min value. + * @param {number} max - The max value. + * @return {number} The clamped value. + */ +export function clamp(value: number, min: number, max: number): number; +/** + * Computes the Euclidean modulo of the given parameters that + * is `( ( n % m ) + m ) % m`. + * + * @param {number} n - The first parameter. + * @param {number} m - The second parameter. + * @return {number} The Euclidean modulo. + */ +export function euclideanModulo(n: number, m: number): number; +/** + * Performs a linear mapping from range `` to range `` + * for the given value. `a2` must be greater than `a1`. + * + * @param {number} x - The value to be mapped. + * @param {number} a1 - Minimum value for range A. + * @param {number} a2 - Maximum value for range A. + * @param {number} b1 - Minimum value for range B. + * @param {number} b2 - Maximum value for range B. + * @return {number} The mapped value. + */ +export function mapLinear(x: number, a1: number, a2: number, b1: number, b2: number): number; +/** + * Returns the percentage in the closed interval `[0, 1]` of the given value + * between the start and end point. + * + * @param {number} x - The start point + * @param {number} y - The end point. + * @param {number} value - A value between start and end. + * @return {number} The interpolation factor. + */ +export function inverseLerp(x: number, y: number, value: number): number; +/** + * Returns a value linearly interpolated from two known points based on the given interval - + * `t = 0` will return `x` and `t = 1` will return `y`. + * + * @param {number} x - The start point + * @param {number} y - The end point. + * @param {number} t - The interpolation factor in the closed interval `[0, 1]`. + * @return {number} The interpolated value. + */ +export function lerp(x: number, y: number, t: number): number; +/** + * Smoothly interpolate a number from `x` to `y` in a spring-like manner using a delta + * time to maintain frame rate independent movement. For details, see + * [Frame rate independent damping using lerp](http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/). + * + * @param {number} x - The current point. + * @param {number} y - The target point. + * @param {number} lambda - A higher lambda value will make the movement more sudden, + * and a lower value will make the movement more gradual. + * @param {number} dt - Delta time in seconds. + * @return {number} The interpolated value. + */ +export function damp(x: number, y: number, lambda: number, dt: number): number; +/** + * Returns a value that alternates between `0` and the given `length` parameter. + * + * @param {number} x - The value to pingpong. + * @param {number} [length=1] - The positive value the function will pingpong to. + * @return {number} The alternated value. + */ +export function pingpong(x: number, length?: number): number; +/** + * Returns a value in the range `[0,1]` that represents the percentage that `x` has + * moved between `min` and `max`, but smoothed or slowed down the closer `x` is to + * the `min` and `max`. + * + * See [Smoothstep](http://en.wikipedia.org/wiki/Smoothstep) for more details. + * + * @param {number} x - The value to evaluate based on its position between `min` and `max`. + * @param {number} min - The min value. Any `x` value below `min` will be `0`. `min` must be lower than `max`. + * @param {number} max - The max value. Any `x` value above `max` will be `1`. `max` must be greater than `min`. + * @return {number} The alternated value. + */ +export function smoothstep(x: number, min: number, max: number): number; +/** + * A [variation on smoothstep](https://en.wikipedia.org/wiki/Smoothstep#Variations) + * that has zero 1st and 2nd order derivatives at `x=0` and `x=1`. + * + * @param {number} x - The value to evaluate based on its position between `min` and `max`. + * @param {number} min - The min value. Any `x` value below `min` will be `0`. `min` must be lower than `max`. + * @param {number} max - The max value. Any `x` value above `max` will be `1`. `max` must be greater than `min`. + * @return {number} The alternated value. + */ +export function smootherstep(x: number, min: number, max: number): number; +/** + * Returns a random integer from `` interval. + * + * @param {number} low - The lower value boundary. + * @param {number} high - The upper value boundary + * @return {number} A random integer. + */ +export function randInt(low: number, high: number): number; +/** + * Returns a random float from `` interval. + * + * @param {number} low - The lower value boundary. + * @param {number} high - The upper value boundary + * @return {number} A random float. + */ +export function randFloat(low: number, high: number): number; +/** + * Returns a random integer from `<-range/2, range/2>` interval. + * + * @param {number} range - Defines the value range. + * @return {number} A random float. + */ +export function randFloatSpread(range: number): number; +/** + * Returns a deterministic pseudo-random float in the interval `[0, 1]`. + * + * @param {number} [s] - The integer seed. + * @return {number} A random float. + */ +export function seededRandom(s?: number): number; +/** + * Converts degrees to radians. + * + * @param {number} degrees - A value in degrees. + * @return {number} The converted value in radians. + */ +export function degToRad(degrees: number): number; +/** + * Converts radians to degrees. + * + * @param {number} radians - A value in radians. + * @return {number} The converted value in degrees. + */ +export function radToDeg(radians: number): number; +/** + * Returns `true` if the given number is a power of two. + * + * @param {number} value - The value to check. + * @return {boolean} Whether the given number is a power of two or not. + */ +export function isPowerOfTwo(value: number): boolean; +/** + * Returns the smallest power of two that is greater than or equal to the given number. + * + * @param {number} value - The value to find a POT for. Must be greater than `0`. + * @return {number} The smallest power of two that is greater than or equal to the given number. + */ +export function ceilPowerOfTwo(value: number): number; +/** + * Returns the largest power of two that is less than or equal to the given number. + * + * @param {number} value - The value to find a POT for. Must be greater than `0`. + * @return {number} The largest power of two that is less than or equal to the given number. + */ +export function floorPowerOfTwo(value: number): number; +/** + * Sets the given quaternion from the [Intrinsic Proper Euler Angles](https://en.wikipedia.org/wiki/Euler_angles) + * defined by the given angles and order. + * + * Rotations are applied to the axes in the order specified by order: + * rotation by angle `a` is applied first, then by angle `b`, then by angle `c`. + * + * @param {Quaternion} q - The quaternion to set. + * @param {number} a - The rotation applied to the first axis, in radians. + * @param {number} b - The rotation applied to the second axis, in radians. + * @param {number} c - The rotation applied to the third axis, in radians. + * @param {('XYX'|'XZX'|'YXY'|'YZY'|'ZXZ'|'ZYZ')} order - A string specifying the axes order. + */ +export function setQuaternionFromProperEuler(q: Quaternion, a: number, b: number, c: number, order: ("XYX" | "XZX" | "YXY" | "YZY" | "ZXZ" | "ZYZ")): void; +/** + * Normalizes the given value according to the given typed array. + * + * @param {number} value - The float value in the range `[0,1]` to normalize. + * @param {TypedArray} array - The typed array that defines the data type of the value. + * @return {number} The normalize value. + */ +export function normalize(value: number, array: TypedArray): number; +/** + * Denormalizes the given value according to the given typed array. + * + * @param {number} value - The value to denormalize. + * @param {TypedArray} array - The typed array that defines the data type of the value. + * @return {number} The denormalize (float) value in the range `[0,1]`. + */ +export function denormalize(value: number, array: TypedArray): number; +export namespace MathUtils { + export { DEG2RAD }; + export { RAD2DEG }; + export { generateUUID }; + export { clamp }; + export { euclideanModulo }; + export { mapLinear }; + export { inverseLerp }; + export { lerp }; + export { damp }; + export { pingpong }; + export { smoothstep }; + export { smootherstep }; + export { randInt }; + export { randFloat }; + export { randFloatSpread }; + export { seededRandom }; + export { degToRad }; + export { radToDeg }; + export { isPowerOfTwo }; + export { ceilPowerOfTwo }; + export { floorPowerOfTwo }; + export { setQuaternionFromProperEuler }; + export { normalize }; + export { denormalize }; +} diff --git a/jsdoc-testing/jsdoc/math/Matrix2.d.ts b/jsdoc-testing/jsdoc/math/Matrix2.d.ts new file mode 100644 index 000000000..7eac72d0b --- /dev/null +++ b/jsdoc-testing/jsdoc/math/Matrix2.d.ts @@ -0,0 +1,70 @@ +/** + * Represents a 2x2 matrix. + * + * A Note on Row-Major and Column-Major Ordering: + * + * The constructor and {@link Matrix2#set} method take arguments in + * [row-major](https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order) + * order, while internally they are stored in the {@link Matrix2#elements} array in column-major order. + * This means that calling: + * ```js + * const m = new THREE.Matrix2(); + * m.set( 11, 12, + * 21, 22 ); + * ``` + * will result in the elements array containing: + * ```js + * m.elements = [ 11, 21, + * 12, 22 ]; + * ``` + * and internally all calculations are performed using column-major ordering. + * However, as the actual ordering makes no difference mathematically and + * most people are used to thinking about matrices in row-major order, the + * three.js documentation shows matrices in row-major order. Just bear in + * mind that if you are reading the source code, you'll have to take the + * transpose of any matrices outlined here to make sense of the calculations. + */ +export class Matrix2 { + /** + * Constructs a new 2x2 matrix. The arguments are supposed to be + * in row-major order. If no arguments are provided, the constructor + * initializes the matrix as an identity matrix. + * + * @param {number} [n11] - 1-1 matrix element. + * @param {number} [n12] - 1-2 matrix element. + * @param {number} [n21] - 2-1 matrix element. + * @param {number} [n22] - 2-2 matrix element. + */ + constructor(n11?: number, n12?: number, n21?: number, n22?: number); + /** + * A column-major list of matrix values. + * + * @type {Array} + */ + elements: Array; + /** + * Sets this matrix to the 2x2 identity matrix. + * + * @return {Matrix2} A reference to this matrix. + */ + identity(): Matrix2; + /** + * Sets the elements of the matrix from the given array. + * + * @param {Array} array - The matrix elements in column-major order. + * @param {number} [offset=0] - Index of the first element in the array. + * @return {Matrix2} A reference to this matrix. + */ + fromArray(array: Array, offset?: number): Matrix2; + /** + * Sets the elements of the matrix.The arguments are supposed to be + * in row-major order. + * + * @param {number} n11 - 1-1 matrix element. + * @param {number} n12 - 1-2 matrix element. + * @param {number} n21 - 2-1 matrix element. + * @param {number} n22 - 2-2 matrix element. + * @return {Matrix2} A reference to this matrix. + */ + set(n11: number, n12: number, n21: number, n22: number): Matrix2; +} diff --git a/jsdoc-testing/jsdoc/math/Matrix3.d.ts b/jsdoc-testing/jsdoc/math/Matrix3.d.ts new file mode 100644 index 000000000..0aea68708 --- /dev/null +++ b/jsdoc-testing/jsdoc/math/Matrix3.d.ts @@ -0,0 +1,251 @@ +/** + * Represents a 3x3 matrix. + * + * A Note on Row-Major and Column-Major Ordering: + * + * The constructor and {@link Matrix3#set} method take arguments in + * [row-major](https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order) + * order, while internally they are stored in the {@link Matrix3#elements} array in column-major order. + * This means that calling: + * ```js + * const m = new THREE.Matrix(); + * m.set( 11, 12, 13, + * 21, 22, 23, + * 31, 32, 33 ); + * ``` + * will result in the elements array containing: + * ```js + * m.elements = [ 11, 21, 31, + * 12, 22, 32, + * 13, 23, 33 ]; + * ``` + * and internally all calculations are performed using column-major ordering. + * However, as the actual ordering makes no difference mathematically and + * most people are used to thinking about matrices in row-major order, the + * three.js documentation shows matrices in row-major order. Just bear in + * mind that if you are reading the source code, you'll have to take the + * transpose of any matrices outlined here to make sense of the calculations. + */ +export class Matrix3 { + /** + * Constructs a new 3x3 matrix. The arguments are supposed to be + * in row-major order. If no arguments are provided, the constructor + * initializes the matrix as an identity matrix. + * + * @param {number} [n11] - 1-1 matrix element. + * @param {number} [n12] - 1-2 matrix element. + * @param {number} [n13] - 1-3 matrix element. + * @param {number} [n21] - 2-1 matrix element. + * @param {number} [n22] - 2-2 matrix element. + * @param {number} [n23] - 2-3 matrix element. + * @param {number} [n31] - 3-1 matrix element. + * @param {number} [n32] - 3-2 matrix element. + * @param {number} [n33] - 3-3 matrix element. + */ + constructor(n11?: number, n12?: number, n13?: number, n21?: number, n22?: number, n23?: number, n31?: number, n32?: number, n33?: number); + /** + * A column-major list of matrix values. + * + * @type {Array} + */ + elements: Array; + /** + * Sets the elements of the matrix.The arguments are supposed to be + * in row-major order. + * + * @param {number} [n11] - 1-1 matrix element. + * @param {number} [n12] - 1-2 matrix element. + * @param {number} [n13] - 1-3 matrix element. + * @param {number} [n21] - 2-1 matrix element. + * @param {number} [n22] - 2-2 matrix element. + * @param {number} [n23] - 2-3 matrix element. + * @param {number} [n31] - 3-1 matrix element. + * @param {number} [n32] - 3-2 matrix element. + * @param {number} [n33] - 3-3 matrix element. + * @return {Matrix3} A reference to this matrix. + */ + set(n11?: number, n12?: number, n13?: number, n21?: number, n22?: number, n23?: number, n31?: number, n32?: number, n33?: number): Matrix3; + /** + * Sets this matrix to the 3x3 identity matrix. + * + * @return {Matrix3} A reference to this matrix. + */ + identity(): Matrix3; + /** + * Copies the values of the given matrix to this instance. + * + * @param {Matrix3} m - The matrix to copy. + * @return {Matrix3} A reference to this matrix. + */ + copy(m: Matrix3): Matrix3; + /** + * Extracts the basis of this matrix into the three axis vectors provided. + * + * @param {Vector3} xAxis - The basis's x axis. + * @param {Vector3} yAxis - The basis's y axis. + * @param {Vector3} zAxis - The basis's z axis. + * @return {Matrix3} A reference to this matrix. + */ + extractBasis(xAxis: Vector3, yAxis: Vector3, zAxis: Vector3): Matrix3; + /** + * Set this matrix to the upper 3x3 matrix of the given 4x4 matrix. + * + * @param {Matrix4} m - The 4x4 matrix. + * @return {Matrix3} A reference to this matrix. + */ + setFromMatrix4(m: Matrix4): Matrix3; + /** + * Post-multiplies this matrix by the given 3x3 matrix. + * + * @param {Matrix3} m - The matrix to multiply with. + * @return {Matrix3} A reference to this matrix. + */ + multiply(m: Matrix3): Matrix3; + /** + * Pre-multiplies this matrix by the given 3x3 matrix. + * + * @param {Matrix3} m - The matrix to multiply with. + * @return {Matrix3} A reference to this matrix. + */ + premultiply(m: Matrix3): Matrix3; + /** + * Multiples the given 3x3 matrices and stores the result + * in this matrix. + * + * @param {Matrix3} a - The first matrix. + * @param {Matrix3} b - The second matrix. + * @return {Matrix3} A reference to this matrix. + */ + multiplyMatrices(a: Matrix3, b: Matrix3): Matrix3; + /** + * Multiplies every component of the matrix by the given scalar. + * + * @param {number} s - The scalar. + * @return {Matrix3} A reference to this matrix. + */ + multiplyScalar(s: number): Matrix3; + /** + * Computes and returns the determinant of this matrix. + * + * @return {number} The determinant. + */ + determinant(): number; + /** + * Inverts this matrix, using the [analytic method](https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution). + * You can not invert with a determinant of zero. If you attempt this, the method produces + * a zero matrix instead. + * + * @return {Matrix3} A reference to this matrix. + */ + invert(): Matrix3; + /** + * Transposes this matrix in place. + * + * @return {Matrix3} A reference to this matrix. + */ + transpose(): Matrix3; + /** + * Computes the normal matrix which is the inverse transpose of the upper + * left 3x3 portion of the given 4x4 matrix. + * + * @param {Matrix4} matrix4 - The 4x4 matrix. + * @return {Matrix3} A reference to this matrix. + */ + getNormalMatrix(matrix4: Matrix4): Matrix3; + /** + * Transposes this matrix into the supplied array, and returns itself unchanged. + * + * @param {Array} r - An array to store the transposed matrix elements. + * @return {Matrix3} A reference to this matrix. + */ + transposeIntoArray(r: Array): Matrix3; + /** + * Sets the UV transform matrix from offset, repeat, rotation, and center. + * + * @param {number} tx - Offset x. + * @param {number} ty - Offset y. + * @param {number} sx - Repeat x. + * @param {number} sy - Repeat y. + * @param {number} rotation - Rotation, in radians. Positive values rotate counterclockwise. + * @param {number} cx - Center x of rotation. + * @param {number} cy - Center y of rotation + * @return {Matrix3} A reference to this matrix. + */ + setUvTransform(tx: number, ty: number, sx: number, sy: number, rotation: number, cx: number, cy: number): Matrix3; + /** + * Scales this matrix with the given scalar values. + * + * @param {number} sx - The amount to scale in the X axis. + * @param {number} sy - The amount to scale in the Y axis. + * @return {Matrix3} A reference to this matrix. + */ + scale(sx: number, sy: number): Matrix3; + /** + * Rotates this matrix by the given angle. + * + * @param {number} theta - The rotation in radians. + * @return {Matrix3} A reference to this matrix. + */ + rotate(theta: number): Matrix3; + /** + * Translates this matrix by the given scalar values. + * + * @param {number} tx - The amount to translate in the X axis. + * @param {number} ty - The amount to translate in the Y axis. + * @return {Matrix3} A reference to this matrix. + */ + translate(tx: number, ty: number): Matrix3; + /** + * Sets this matrix as a 2D translation transform. + * + * @param {number|Vector2} x - The amount to translate in the X axis or alternatively a translation vector. + * @param {number} y - The amount to translate in the Y axis. + * @return {Matrix3} A reference to this matrix. + */ + makeTranslation(x: number | Vector2, y: number): Matrix3; + /** + * Sets this matrix as a 2D rotational transformation. + * + * @param {number} theta - The rotation in radians. + * @return {Matrix3} A reference to this matrix. + */ + makeRotation(theta: number): Matrix3; + /** + * Sets this matrix as a 2D scale transform. + * + * @param {number} x - The amount to scale in the X axis. + * @param {number} y - The amount to scale in the Y axis. + * @return {Matrix3} A reference to this matrix. + */ + makeScale(x: number, y: number): Matrix3; + /** + * Returns `true` if this matrix is equal with the given one. + * + * @param {Matrix3} matrix - The matrix to test for equality. + * @return {boolean} Whether this matrix is equal with the given one. + */ + equals(matrix: Matrix3): boolean; + /** + * Sets the elements of the matrix from the given array. + * + * @param {Array} array - The matrix elements in column-major order. + * @param {number} [offset=0] - Index of the first element in the array. + * @return {Matrix3} A reference to this matrix. + */ + fromArray(array: Array, offset?: number): Matrix3; + /** + * Writes the elements of this matrix to the given array. If no array is provided, + * the method returns a new instance. + * + * @param {Array} [array=[]] - The target array holding the matrix elements in column-major order. + * @param {number} [offset=0] - Index of the first element in the array. + * @return {Array} The matrix elements in column-major order. + */ + toArray(array?: Array, offset?: number): Array; + /** + * Returns a matrix with copied values from this instance. + * + * @return {Matrix3} A clone of this instance. + */ + clone(): Matrix3; +} diff --git a/jsdoc-testing/jsdoc/math/Matrix4.d.ts b/jsdoc-testing/jsdoc/math/Matrix4.d.ts new file mode 100644 index 000000000..6f15181df --- /dev/null +++ b/jsdoc-testing/jsdoc/math/Matrix4.d.ts @@ -0,0 +1,404 @@ +/** + * Represents a 4x4 matrix. + * + * The most common use of a 4x4 matrix in 3D computer graphics is as a transformation matrix. + * For an introduction to transformation matrices as used in WebGL, check out [this tutorial](https://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices) + * + * This allows a 3D vector representing a point in 3D space to undergo + * transformations such as translation, rotation, shear, scale, reflection, + * orthogonal or perspective projection and so on, by being multiplied by the + * matrix. This is known as `applying` the matrix to the vector. + * + * A Note on Row-Major and Column-Major Ordering: + * + * The constructor and {@link Matrix3#set} method take arguments in + * [row-major](https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order) + * order, while internally they are stored in the {@link Matrix3#elements} array in column-major order. + * This means that calling: + * ```js + * const m = new THREE.Matrix4(); + * m.set( 11, 12, 13, 14, + * 21, 22, 23, 24, + * 31, 32, 33, 34, + * 41, 42, 43, 44 ); + * ``` + * will result in the elements array containing: + * ```js + * m.elements = [ 11, 21, 31, 41, + * 12, 22, 32, 42, + * 13, 23, 33, 43, + * 14, 24, 34, 44 ]; + * ``` + * and internally all calculations are performed using column-major ordering. + * However, as the actual ordering makes no difference mathematically and + * most people are used to thinking about matrices in row-major order, the + * three.js documentation shows matrices in row-major order. Just bear in + * mind that if you are reading the source code, you'll have to take the + * transpose of any matrices outlined here to make sense of the calculations. + */ +export class Matrix4 { + /** + * Constructs a new 4x4 matrix. The arguments are supposed to be + * in row-major order. If no arguments are provided, the constructor + * initializes the matrix as an identity matrix. + * + * @param {number} [n11] - 1-1 matrix element. + * @param {number} [n12] - 1-2 matrix element. + * @param {number} [n13] - 1-3 matrix element. + * @param {number} [n14] - 1-4 matrix element. + * @param {number} [n21] - 2-1 matrix element. + * @param {number} [n22] - 2-2 matrix element. + * @param {number} [n23] - 2-3 matrix element. + * @param {number} [n24] - 2-4 matrix element. + * @param {number} [n31] - 3-1 matrix element. + * @param {number} [n32] - 3-2 matrix element. + * @param {number} [n33] - 3-3 matrix element. + * @param {number} [n34] - 3-4 matrix element. + * @param {number} [n41] - 4-1 matrix element. + * @param {number} [n42] - 4-2 matrix element. + * @param {number} [n43] - 4-3 matrix element. + * @param {number} [n44] - 4-4 matrix element. + */ + constructor(n11?: number, n12?: number, n13?: number, n14?: number, n21?: number, n22?: number, n23?: number, n24?: number, n31?: number, n32?: number, n33?: number, n34?: number, n41?: number, n42?: number, n43?: number, n44?: number); + /** + * A column-major list of matrix values. + * + * @type {Array} + */ + elements: Array; + /** + * Sets the elements of the matrix.The arguments are supposed to be + * in row-major order. + * + * @param {number} [n11] - 1-1 matrix element. + * @param {number} [n12] - 1-2 matrix element. + * @param {number} [n13] - 1-3 matrix element. + * @param {number} [n14] - 1-4 matrix element. + * @param {number} [n21] - 2-1 matrix element. + * @param {number} [n22] - 2-2 matrix element. + * @param {number} [n23] - 2-3 matrix element. + * @param {number} [n24] - 2-4 matrix element. + * @param {number} [n31] - 3-1 matrix element. + * @param {number} [n32] - 3-2 matrix element. + * @param {number} [n33] - 3-3 matrix element. + * @param {number} [n34] - 3-4 matrix element. + * @param {number} [n41] - 4-1 matrix element. + * @param {number} [n42] - 4-2 matrix element. + * @param {number} [n43] - 4-3 matrix element. + * @param {number} [n44] - 4-4 matrix element. + * @return {Matrix4} A reference to this matrix. + */ + set(n11?: number, n12?: number, n13?: number, n14?: number, n21?: number, n22?: number, n23?: number, n24?: number, n31?: number, n32?: number, n33?: number, n34?: number, n41?: number, n42?: number, n43?: number, n44?: number): Matrix4; + /** + * Sets this matrix to the 4x4 identity matrix. + * + * @return {Matrix4} A reference to this matrix. + */ + identity(): Matrix4; + /** + * Returns a matrix with copied values from this instance. + * + * @return {Matrix4} A clone of this instance. + */ + clone(): Matrix4; + /** + * Copies the values of the given matrix to this instance. + * + * @param {Matrix4} m - The matrix to copy. + * @return {Matrix4} A reference to this matrix. + */ + copy(m: Matrix4): Matrix4; + /** + * Copies the translation component of the given matrix + * into this matrix's translation component. + * + * @param {Matrix4} m - The matrix to copy the translation component. + * @return {Matrix4} A reference to this matrix. + */ + copyPosition(m: Matrix4): Matrix4; + /** + * Set the upper 3x3 elements of this matrix to the values of given 3x3 matrix. + * + * @param {Matrix3} m - The 3x3 matrix. + * @return {Matrix4} A reference to this matrix. + */ + setFromMatrix3(m: Matrix3): Matrix4; + /** + * Extracts the basis of this matrix into the three axis vectors provided. + * + * @param {Vector3} xAxis - The basis's x axis. + * @param {Vector3} yAxis - The basis's y axis. + * @param {Vector3} zAxis - The basis's z axis. + * @return {Matrix4} A reference to this matrix. + */ + extractBasis(xAxis: Vector3, yAxis: Vector3, zAxis: Vector3): Matrix4; + /** + * Sets the given basis vectors to this matrix. + * + * @param {Vector3} xAxis - The basis's x axis. + * @param {Vector3} yAxis - The basis's y axis. + * @param {Vector3} zAxis - The basis's z axis. + * @return {Matrix4} A reference to this matrix. + */ + makeBasis(xAxis: Vector3, yAxis: Vector3, zAxis: Vector3): Matrix4; + /** + * Extracts the rotation component of the given matrix + * into this matrix's rotation component. + * + * Note: This method does not support reflection matrices. + * + * @param {Matrix4} m - The matrix. + * @return {Matrix4} A reference to this matrix. + */ + extractRotation(m: Matrix4): Matrix4; + /** + * Sets the rotation component (the upper left 3x3 matrix) of this matrix to + * the rotation specified by the given Euler angles. The rest of + * the matrix is set to the identity. Depending on the {@link Euler#order}, + * there are six possible outcomes. See [this page](https://en.wikipedia.org/wiki/Euler_angles#Rotation_matrix) + * for a complete list. + * + * @param {Euler} euler - The Euler angles. + * @return {Matrix4} A reference to this matrix. + */ + makeRotationFromEuler(euler: Euler): Matrix4; + /** + * Sets the rotation component of this matrix to the rotation specified by + * the given Quaternion as outlined [here](https://en.wikipedia.org/wiki/Rotation_matrix#Quaternion) + * The rest of the matrix is set to the identity. + * + * @param {Quaternion} q - The Quaternion. + * @return {Matrix4} A reference to this matrix. + */ + makeRotationFromQuaternion(q: Quaternion): Matrix4; + /** + * Sets the rotation component of the transformation matrix, looking from `eye` towards + * `target`, and oriented by the up-direction. + * + * @param {Vector3} eye - The eye vector. + * @param {Vector3} target - The target vector. + * @param {Vector3} up - The up vector. + * @return {Matrix4} A reference to this matrix. + */ + lookAt(eye: Vector3, target: Vector3, up: Vector3): Matrix4; + /** + * Post-multiplies this matrix by the given 4x4 matrix. + * + * @param {Matrix4} m - The matrix to multiply with. + * @return {Matrix4} A reference to this matrix. + */ + multiply(m: Matrix4): Matrix4; + /** + * Pre-multiplies this matrix by the given 4x4 matrix. + * + * @param {Matrix4} m - The matrix to multiply with. + * @return {Matrix4} A reference to this matrix. + */ + premultiply(m: Matrix4): Matrix4; + /** + * Multiples the given 4x4 matrices and stores the result + * in this matrix. + * + * @param {Matrix4} a - The first matrix. + * @param {Matrix4} b - The second matrix. + * @return {Matrix4} A reference to this matrix. + */ + multiplyMatrices(a: Matrix4, b: Matrix4): Matrix4; + /** + * Multiplies every component of the matrix by the given scalar. + * + * @param {number} s - The scalar. + * @return {Matrix4} A reference to this matrix. + */ + multiplyScalar(s: number): Matrix4; + /** + * Computes and returns the determinant of this matrix. + * + * Based on the method outlined [here](http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.html). + * + * @return {number} The determinant. + */ + determinant(): number; + /** + * Transposes this matrix in place. + * + * @return {Matrix4} A reference to this matrix. + */ + transpose(): Matrix4; + /** + * Sets the position component for this matrix from the given vector, + * without affecting the rest of the matrix. + * + * @param {number|Vector3} x - The x component of the vector or alternatively the vector object. + * @param {number} y - The y component of the vector. + * @param {number} z - The z component of the vector. + * @return {Matrix4} A reference to this matrix. + */ + setPosition(x: number | Vector3, y: number, z: number): Matrix4; + /** + * Inverts this matrix, using the [analytic method](https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution). + * You can not invert with a determinant of zero. If you attempt this, the method produces + * a zero matrix instead. + * + * @return {Matrix4} A reference to this matrix. + */ + invert(): Matrix4; + /** + * Multiplies the columns of this matrix by the given vector. + * + * @param {Vector3} v - The scale vector. + * @return {Matrix4} A reference to this matrix. + */ + scale(v: Vector3): Matrix4; + /** + * Gets the maximum scale value of the three axes. + * + * @return {number} The maximum scale. + */ + getMaxScaleOnAxis(): number; + /** + * Sets this matrix as a translation transform from the given vector. + * + * @param {number|Vector3} x - The amount to translate in the X axis or alternatively a translation vector. + * @param {number} y - The amount to translate in the Y axis. + * @param {number} z - The amount to translate in the z axis. + * @return {Matrix4} A reference to this matrix. + */ + makeTranslation(x: number | Vector3, y: number, z: number): Matrix4; + /** + * Sets this matrix as a rotational transformation around the X axis by + * the given angle. + * + * @param {number} theta - The rotation in radians. + * @return {Matrix4} A reference to this matrix. + */ + makeRotationX(theta: number): Matrix4; + /** + * Sets this matrix as a rotational transformation around the Y axis by + * the given angle. + * + * @param {number} theta - The rotation in radians. + * @return {Matrix4} A reference to this matrix. + */ + makeRotationY(theta: number): Matrix4; + /** + * Sets this matrix as a rotational transformation around the Z axis by + * the given angle. + * + * @param {number} theta - The rotation in radians. + * @return {Matrix4} A reference to this matrix. + */ + makeRotationZ(theta: number): Matrix4; + /** + * Sets this matrix as a rotational transformation around the given axis by + * the given angle. + * + * This is a somewhat controversial but mathematically sound alternative to + * rotating via Quaternions. See the discussion [here](https://www.gamedev.net/articles/programming/math-and-physics/do-we-really-need-quaternions-r1199). + * + * @param {Vector3} axis - The normalized rotation axis. + * @param {number} angle - The rotation in radians. + * @return {Matrix4} A reference to this matrix. + */ + makeRotationAxis(axis: Vector3, angle: number): Matrix4; + /** + * Sets this matrix as a scale transformation. + * + * @param {number} x - The amount to scale in the X axis. + * @param {number} y - The amount to scale in the Y axis. + * @param {number} z - The amount to scale in the Z axis. + * @return {Matrix4} A reference to this matrix. + */ + makeScale(x: number, y: number, z: number): Matrix4; + /** + * Sets this matrix as a shear transformation. + * + * @param {number} xy - The amount to shear X by Y. + * @param {number} xz - The amount to shear X by Z. + * @param {number} yx - The amount to shear Y by X. + * @param {number} yz - The amount to shear Y by Z. + * @param {number} zx - The amount to shear Z by X. + * @param {number} zy - The amount to shear Z by Y. + * @return {Matrix4} A reference to this matrix. + */ + makeShear(xy: number, xz: number, yx: number, yz: number, zx: number, zy: number): Matrix4; + /** + * Sets this matrix to the transformation composed of the given position, + * rotation (Quaternion) and scale. + * + * @param {Vector3} position - The position vector. + * @param {Quaternion} quaternion - The rotation as a Quaternion. + * @param {Vector3} scale - The scale vector. + * @return {Matrix4} A reference to this matrix. + */ + compose(position: Vector3, quaternion: Quaternion, scale: Vector3): Matrix4; + /** + * Decomposes this matrix into its position, rotation and scale components + * and provides the result in the given objects. + * + * Note: Not all matrices are decomposable in this way. For example, if an + * object has a non-uniformly scaled parent, then the object's world matrix + * may not be decomposable, and this method may not be appropriate. + * + * @param {Vector3} position - The position vector. + * @param {Quaternion} quaternion - The rotation as a Quaternion. + * @param {Vector3} scale - The scale vector. + * @return {Matrix4} A reference to this matrix. + */ + decompose(position: Vector3, quaternion: Quaternion, scale: Vector3): Matrix4; + /** + * Creates a perspective projection matrix. This is used internally by + * {@link PerspectiveCamera#updateProjectionMatrix}. + + * @param {number} left - Left boundary of the viewing frustum at the near plane. + * @param {number} right - Right boundary of the viewing frustum at the near plane. + * @param {number} top - Top boundary of the viewing frustum at the near plane. + * @param {number} bottom - Bottom boundary of the viewing frustum at the near plane. + * @param {number} near - The distance from the camera to the near plane. + * @param {number} far - The distance from the camera to the far plane. + * @param {(WebGLCoordinateSystem|WebGPUCoordinateSystem)} [coordinateSystem=WebGLCoordinateSystem] - The coordinate system. + * @param {boolean} [reversedDepth=false] - Whether to use a reversed depth. + * @return {Matrix4} A reference to this matrix. + */ + makePerspective(left: number, right: number, top: number, bottom: number, near: number, far: number, coordinateSystem?: (number | number), reversedDepth?: boolean): Matrix4; + /** + * Creates a orthographic projection matrix. This is used internally by + * {@link OrthographicCamera#updateProjectionMatrix}. + + * @param {number} left - Left boundary of the viewing frustum at the near plane. + * @param {number} right - Right boundary of the viewing frustum at the near plane. + * @param {number} top - Top boundary of the viewing frustum at the near plane. + * @param {number} bottom - Bottom boundary of the viewing frustum at the near plane. + * @param {number} near - The distance from the camera to the near plane. + * @param {number} far - The distance from the camera to the far plane. + * @param {(WebGLCoordinateSystem|WebGPUCoordinateSystem)} [coordinateSystem=WebGLCoordinateSystem] - The coordinate system. + * @param {boolean} [reversedDepth=false] - Whether to use a reversed depth. + * @return {Matrix4} A reference to this matrix. + */ + makeOrthographic(left: number, right: number, top: number, bottom: number, near: number, far: number, coordinateSystem?: (number | number), reversedDepth?: boolean): Matrix4; + /** + * Returns `true` if this matrix is equal with the given one. + * + * @param {Matrix4} matrix - The matrix to test for equality. + * @return {boolean} Whether this matrix is equal with the given one. + */ + equals(matrix: Matrix4): boolean; + /** + * Sets the elements of the matrix from the given array. + * + * @param {Array} array - The matrix elements in column-major order. + * @param {number} [offset=0] - Index of the first element in the array. + * @return {Matrix4} A reference to this matrix. + */ + fromArray(array: Array, offset?: number): Matrix4; + /** + * Writes the elements of this matrix to the given array. If no array is provided, + * the method returns a new instance. + * + * @param {Array} [array=[]] - The target array holding the matrix elements in column-major order. + * @param {number} [offset=0] - Index of the first element in the array. + * @return {Array} The matrix elements in column-major order. + */ + toArray(array?: Array, offset?: number): Array; +} +import { Vector3 } from './Vector3.js'; diff --git a/jsdoc-testing/jsdoc/math/Plane.d.ts b/jsdoc-testing/jsdoc/math/Plane.d.ts new file mode 100644 index 000000000..7cf5d9a16 --- /dev/null +++ b/jsdoc-testing/jsdoc/math/Plane.d.ts @@ -0,0 +1,189 @@ +/** + * A two dimensional surface that extends infinitely in 3D space, represented + * in [Hessian normal form](http://mathworld.wolfram.com/HessianNormalForm.html) + * by a unit length normal vector and a constant. + */ +export class Plane { + /** + * Constructs a new plane. + * + * @param {Vector3} [normal=(1,0,0)] - A unit length vector defining the normal of the plane. + * @param {number} [constant=0] - The signed distance from the origin to the plane. + */ + constructor(normal?: Vector3, constant?: number); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isPlane: boolean; + /** + * A unit length vector defining the normal of the plane. + * + * @type {Vector3} + */ + normal: Vector3; + /** + * The signed distance from the origin to the plane. + * + * @type {number} + * @default 0 + */ + constant: number; + /** + * Sets the plane components by copying the given values. + * + * @param {Vector3} normal - The normal. + * @param {number} constant - The constant. + * @return {Plane} A reference to this plane. + */ + set(normal: Vector3, constant: number): Plane; + /** + * Sets the plane components by defining `x`, `y`, `z` as the + * plane normal and `w` as the constant. + * + * @param {number} x - The value for the normal's x component. + * @param {number} y - The value for the normal's y component. + * @param {number} z - The value for the normal's z component. + * @param {number} w - The constant value. + * @return {Plane} A reference to this plane. + */ + setComponents(x: number, y: number, z: number, w: number): Plane; + /** + * Sets the plane from the given normal and coplanar point (that is a point + * that lies onto the plane). + * + * @param {Vector3} normal - The normal. + * @param {Vector3} point - A coplanar point. + * @return {Plane} A reference to this plane. + */ + setFromNormalAndCoplanarPoint(normal: Vector3, point: Vector3): Plane; + /** + * Sets the plane from three coplanar points. The winding order is + * assumed to be counter-clockwise, and determines the direction of + * the plane normal. + * + * @param {Vector3} a - The first coplanar point. + * @param {Vector3} b - The second coplanar point. + * @param {Vector3} c - The third coplanar point. + * @return {Plane} A reference to this plane. + */ + setFromCoplanarPoints(a: Vector3, b: Vector3, c: Vector3): Plane; + /** + * Copies the values of the given plane to this instance. + * + * @param {Plane} plane - The plane to copy. + * @return {Plane} A reference to this plane. + */ + copy(plane: Plane): Plane; + /** + * Normalizes the plane normal and adjusts the constant accordingly. + * + * @return {Plane} A reference to this plane. + */ + normalize(): Plane; + /** + * Negates both the plane normal and the constant. + * + * @return {Plane} A reference to this plane. + */ + negate(): Plane; + /** + * Returns the signed distance from the given point to this plane. + * + * @param {Vector3} point - The point to compute the distance for. + * @return {number} The signed distance. + */ + distanceToPoint(point: Vector3): number; + /** + * Returns the signed distance from the given sphere to this plane. + * + * @param {Sphere} sphere - The sphere to compute the distance for. + * @return {number} The signed distance. + */ + distanceToSphere(sphere: Sphere): number; + /** + * Projects a the given point onto the plane. + * + * @param {Vector3} point - The point to project. + * @param {Vector3} target - The target vector that is used to store the method's result. + * @return {Vector3} The projected point on the plane. + */ + projectPoint(point: Vector3, target: Vector3): Vector3; + /** + * Returns the intersection point of the passed line and the plane. Returns + * `null` if the line does not intersect. Returns the line's starting point if + * the line is coplanar with the plane. + * + * @param {Line3} line - The line to compute the intersection for. + * @param {Vector3} target - The target vector that is used to store the method's result. + * @return {?Vector3} The intersection point. + */ + intersectLine(line: Line3, target: Vector3): Vector3 | null; + /** + * Returns `true` if the given line segment intersects with (passes through) the plane. + * + * @param {Line3} line - The line to test. + * @return {boolean} Whether the given line segment intersects with the plane or not. + */ + intersectsLine(line: Line3): boolean; + /** + * Returns `true` if the given bounding box intersects with the plane. + * + * @param {Box3} box - The bounding box to test. + * @return {boolean} Whether the given bounding box intersects with the plane or not. + */ + intersectsBox(box: Box3): boolean; + /** + * Returns `true` if the given bounding sphere intersects with the plane. + * + * @param {Sphere} sphere - The bounding sphere to test. + * @return {boolean} Whether the given bounding sphere intersects with the plane or not. + */ + intersectsSphere(sphere: Sphere): boolean; + /** + * Returns a coplanar vector to the plane, by calculating the + * projection of the normal at the origin onto the plane. + * + * @param {Vector3} target - The target vector that is used to store the method's result. + * @return {Vector3} The coplanar point. + */ + coplanarPoint(target: Vector3): Vector3; + /** + * Apply a 4x4 matrix to the plane. The matrix must be an affine, homogeneous transform. + * + * The optional normal matrix can be pre-computed like so: + * ```js + * const optionalNormalMatrix = new THREE.Matrix3().getNormalMatrix( matrix ); + * ``` + * + * @param {Matrix4} matrix - The transformation matrix. + * @param {Matrix4} [optionalNormalMatrix] - A pre-computed normal matrix. + * @return {Plane} A reference to this plane. + */ + applyMatrix4(matrix: Matrix4, optionalNormalMatrix?: Matrix4): Plane; + /** + * Translates the plane by the distance defined by the given offset vector. + * Note that this only affects the plane constant and will not affect the normal vector. + * + * @param {Vector3} offset - The offset vector. + * @return {Plane} A reference to this plane. + */ + translate(offset: Vector3): Plane; + /** + * Returns `true` if this plane is equal with the given one. + * + * @param {Plane} plane - The plane to test for equality. + * @return {boolean} Whether this plane is equal with the given one. + */ + equals(plane: Plane): boolean; + /** + * Returns a new plane with copied values from this instance. + * + * @return {Plane} A clone of this instance. + */ + clone(): Plane; +} +import { Vector3 } from './Vector3.js'; diff --git a/jsdoc-testing/jsdoc/math/Quaternion.d.ts b/jsdoc-testing/jsdoc/math/Quaternion.d.ts new file mode 100644 index 000000000..214548cde --- /dev/null +++ b/jsdoc-testing/jsdoc/math/Quaternion.d.ts @@ -0,0 +1,310 @@ +/** + * Class for representing a Quaternion. Quaternions are used in three.js to represent rotations. + * + * Iterating through a vector instance will yield its components `(x, y, z, w)` in + * the corresponding order. + * + * Note that three.js expects Quaternions to be normalized. + * ```js + * const quaternion = new THREE.Quaternion(); + * quaternion.setFromAxisAngle( new THREE.Vector3( 0, 1, 0 ), Math.PI / 2 ); + * + * const vector = new THREE.Vector3( 1, 0, 0 ); + * vector.applyQuaternion( quaternion ); + * ``` + */ +export class Quaternion { + /** + * Interpolates between two quaternions via SLERP. This implementation assumes the + * quaternion data are managed in flat arrays. + * + * @param {Array} dst - The destination array. + * @param {number} dstOffset - An offset into the destination array. + * @param {Array} src0 - The source array of the first quaternion. + * @param {number} srcOffset0 - An offset into the first source array. + * @param {Array} src1 - The source array of the second quaternion. + * @param {number} srcOffset1 - An offset into the second source array. + * @param {number} t - The interpolation factor. A value in the range `[0,1]` will interpolate. A value outside the range `[0,1]` will extrapolate. + * @see {@link Quaternion#slerp} + */ + static slerpFlat(dst: Array, dstOffset: number, src0: Array, srcOffset0: number, src1: Array, srcOffset1: number, t: number): void; + /** + * Multiplies two quaternions. This implementation assumes the quaternion data are managed + * in flat arrays. + * + * @param {Array} dst - The destination array. + * @param {number} dstOffset - An offset into the destination array. + * @param {Array} src0 - The source array of the first quaternion. + * @param {number} srcOffset0 - An offset into the first source array. + * @param {Array} src1 - The source array of the second quaternion. + * @param {number} srcOffset1 - An offset into the second source array. + * @return {Array} The destination array. + * @see {@link Quaternion#multiplyQuaternions}. + */ + static multiplyQuaternionsFlat(dst: Array, dstOffset: number, src0: Array, srcOffset0: number, src1: Array, srcOffset1: number): Array; + /** + * Constructs a new quaternion. + * + * @param {number} [x=0] - The x value of this quaternion. + * @param {number} [y=0] - The y value of this quaternion. + * @param {number} [z=0] - The z value of this quaternion. + * @param {number} [w=1] - The w value of this quaternion. + */ + constructor(x?: number, y?: number, z?: number, w?: number); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isQuaternion: boolean; + _x: number; + _y: number; + _z: number; + _w: number; + set x(value: number); + /** + * The x value of this quaternion. + * + * @type {number} + * @default 0 + */ + get x(): number; + set y(value: number); + /** + * The y value of this quaternion. + * + * @type {number} + * @default 0 + */ + get y(): number; + set z(value: number); + /** + * The z value of this quaternion. + * + * @type {number} + * @default 0 + */ + get z(): number; + set w(value: number); + /** + * The w value of this quaternion. + * + * @type {number} + * @default 1 + */ + get w(): number; + /** + * Sets the quaternion components. + * + * @param {number} x - The x value of this quaternion. + * @param {number} y - The y value of this quaternion. + * @param {number} z - The z value of this quaternion. + * @param {number} w - The w value of this quaternion. + * @return {Quaternion} A reference to this quaternion. + */ + set(x: number, y: number, z: number, w: number): Quaternion; + /** + * Returns a new quaternion with copied values from this instance. + * + * @return {Quaternion} A clone of this instance. + */ + clone(): Quaternion; + /** + * Copies the values of the given quaternion to this instance. + * + * @param {Quaternion} quaternion - The quaternion to copy. + * @return {Quaternion} A reference to this quaternion. + */ + copy(quaternion: Quaternion): Quaternion; + /** + * Sets this quaternion from the rotation specified by the given + * Euler angles. + * + * @param {Euler} euler - The Euler angles. + * @param {boolean} [update=true] - Whether the internal `onChange` callback should be executed or not. + * @return {Quaternion} A reference to this quaternion. + */ + setFromEuler(euler: Euler, update?: boolean): Quaternion; + /** + * Sets this quaternion from the given axis and angle. + * + * @param {Vector3} axis - The normalized axis. + * @param {number} angle - The angle in radians. + * @return {Quaternion} A reference to this quaternion. + */ + setFromAxisAngle(axis: Vector3, angle: number): Quaternion; + /** + * Sets this quaternion from the given rotation matrix. + * + * @param {Matrix4} m - A 4x4 matrix of which the upper 3x3 of matrix is a pure rotation matrix (i.e. unscaled). + * @return {Quaternion} A reference to this quaternion. + */ + setFromRotationMatrix(m: Matrix4): Quaternion; + /** + * Sets this quaternion to the rotation required to rotate the direction vector + * `vFrom` to the direction vector `vTo`. + * + * @param {Vector3} vFrom - The first (normalized) direction vector. + * @param {Vector3} vTo - The second (normalized) direction vector. + * @return {Quaternion} A reference to this quaternion. + */ + setFromUnitVectors(vFrom: Vector3, vTo: Vector3): Quaternion; + /** + * Returns the angle between this quaternion and the given one in radians. + * + * @param {Quaternion} q - The quaternion to compute the angle with. + * @return {number} The angle in radians. + */ + angleTo(q: Quaternion): number; + /** + * Rotates this quaternion by a given angular step to the given quaternion. + * The method ensures that the final quaternion will not overshoot `q`. + * + * @param {Quaternion} q - The target quaternion. + * @param {number} step - The angular step in radians. + * @return {Quaternion} A reference to this quaternion. + */ + rotateTowards(q: Quaternion, step: number): Quaternion; + /** + * Sets this quaternion to the identity quaternion; that is, to the + * quaternion that represents "no rotation". + * + * @return {Quaternion} A reference to this quaternion. + */ + identity(): Quaternion; + /** + * Inverts this quaternion via {@link Quaternion#conjugate}. The + * quaternion is assumed to have unit length. + * + * @return {Quaternion} A reference to this quaternion. + */ + invert(): Quaternion; + /** + * Returns the rotational conjugate of this quaternion. The conjugate of a + * quaternion represents the same rotation in the opposite direction about + * the rotational axis. + * + * @return {Quaternion} A reference to this quaternion. + */ + conjugate(): Quaternion; + /** + * Calculates the dot product of this quaternion and the given one. + * + * @param {Quaternion} v - The quaternion to compute the dot product with. + * @return {number} The result of the dot product. + */ + dot(v: Quaternion): number; + /** + * Computes the squared Euclidean length (straight-line length) of this quaternion, + * considered as a 4 dimensional vector. This can be useful if you are comparing the + * lengths of two quaternions, as this is a slightly more efficient calculation than + * {@link Quaternion#length}. + * + * @return {number} The squared Euclidean length. + */ + lengthSq(): number; + /** + * Computes the Euclidean length (straight-line length) of this quaternion, + * considered as a 4 dimensional vector. + * + * @return {number} The Euclidean length. + */ + length(): number; + /** + * Normalizes this quaternion - that is, calculated the quaternion that performs + * the same rotation as this one, but has a length equal to `1`. + * + * @return {Quaternion} A reference to this quaternion. + */ + normalize(): Quaternion; + /** + * Multiplies this quaternion by the given one. + * + * @param {Quaternion} q - The quaternion. + * @return {Quaternion} A reference to this quaternion. + */ + multiply(q: Quaternion): Quaternion; + /** + * Pre-multiplies this quaternion by the given one. + * + * @param {Quaternion} q - The quaternion. + * @return {Quaternion} A reference to this quaternion. + */ + premultiply(q: Quaternion): Quaternion; + /** + * Multiplies the given quaternions and stores the result in this instance. + * + * @param {Quaternion} a - The first quaternion. + * @param {Quaternion} b - The second quaternion. + * @return {Quaternion} A reference to this quaternion. + */ + multiplyQuaternions(a: Quaternion, b: Quaternion): Quaternion; + /** + * Performs a spherical linear interpolation between this quaternion and the target quaternion. + * + * @param {Quaternion} qb - The target quaternion. + * @param {number} t - The interpolation factor. A value in the range `[0,1]` will interpolate. A value outside the range `[0,1]` will extrapolate. + * @return {Quaternion} A reference to this quaternion. + */ + slerp(qb: Quaternion, t: number): Quaternion; + /** + * Performs a spherical linear interpolation between the given quaternions + * and stores the result in this quaternion. + * + * @param {Quaternion} qa - The source quaternion. + * @param {Quaternion} qb - The target quaternion. + * @param {number} t - The interpolation factor in the closed interval `[0, 1]`. + * @return {Quaternion} A reference to this quaternion. + */ + slerpQuaternions(qa: Quaternion, qb: Quaternion, t: number): Quaternion; + /** + * Sets this quaternion to a uniformly random, normalized quaternion. + * + * @return {Quaternion} A reference to this quaternion. + */ + random(): Quaternion; + /** + * Returns `true` if this quaternion is equal with the given one. + * + * @param {Quaternion} quaternion - The quaternion to test for equality. + * @return {boolean} Whether this quaternion is equal with the given one. + */ + equals(quaternion: Quaternion): boolean; + /** + * Sets this quaternion's components from the given array. + * + * @param {Array} array - An array holding the quaternion component values. + * @param {number} [offset=0] - The offset into the array. + * @return {Quaternion} A reference to this quaternion. + */ + fromArray(array: Array, offset?: number): Quaternion; + /** + * Writes the components of this quaternion to the given array. If no array is provided, + * the method returns a new instance. + * + * @param {Array} [array=[]] - The target array holding the quaternion components. + * @param {number} [offset=0] - Index of the first element in the array. + * @return {Array} The quaternion components. + */ + toArray(array?: Array, offset?: number): Array; + /** + * Sets the components of this quaternion from the given buffer attribute. + * + * @param {BufferAttribute} attribute - The buffer attribute holding quaternion data. + * @param {number} index - The index into the attribute. + * @return {Quaternion} A reference to this quaternion. + */ + fromBufferAttribute(attribute: BufferAttribute, index: number): Quaternion; + /** + * This methods defines the serialization result of this class. Returns the + * numerical elements of this quaternion in an array of format `[x, y, z, w]`. + * + * @return {Array} The serialized quaternion. + */ + toJSON(): Array; + _onChange(callback: any): this; + _onChangeCallback(): void; + [Symbol.iterator](): Generator; +} diff --git a/jsdoc-testing/jsdoc/math/Ray.d.ts b/jsdoc-testing/jsdoc/math/Ray.d.ts new file mode 100644 index 000000000..02531c54e --- /dev/null +++ b/jsdoc-testing/jsdoc/math/Ray.d.ts @@ -0,0 +1,185 @@ +/** + * A ray that emits from an origin in a certain direction. The class is used by + * {@link Raycaster} to assist with raycasting. Raycasting is used for + * mouse picking (working out what objects in the 3D space the mouse is over) + * amongst other things. + */ +export class Ray { + /** + * Constructs a new ray. + * + * @param {Vector3} [origin=(0,0,0)] - The origin of the ray. + * @param {Vector3} [direction=(0,0,-1)] - The (normalized) direction of the ray. + */ + constructor(origin?: Vector3, direction?: Vector3); + /** + * The origin of the ray. + * + * @type {Vector3} + */ + origin: Vector3; + /** + * The (normalized) direction of the ray. + * + * @type {Vector3} + */ + direction: Vector3; + /** + * Sets the ray's components by copying the given values. + * + * @param {Vector3} origin - The origin. + * @param {Vector3} direction - The direction. + * @return {Ray} A reference to this ray. + */ + set(origin: Vector3, direction: Vector3): Ray; + /** + * Copies the values of the given ray to this instance. + * + * @param {Ray} ray - The ray to copy. + * @return {Ray} A reference to this ray. + */ + copy(ray: Ray): Ray; + /** + * Returns a vector that is located at a given distance along this ray. + * + * @param {number} t - The distance along the ray to retrieve a position for. + * @param {Vector3} target - The target vector that is used to store the method's result. + * @return {Vector3} A position on the ray. + */ + at(t: number, target: Vector3): Vector3; + /** + * Adjusts the direction of the ray to point at the given vector in world space. + * + * @param {Vector3} v - The target position. + * @return {Ray} A reference to this ray. + */ + lookAt(v: Vector3): Ray; + /** + * Shift the origin of this ray along its direction by the given distance. + * + * @param {number} t - The distance along the ray to interpolate. + * @return {Ray} A reference to this ray. + */ + recast(t: number): Ray; + /** + * Returns the point along this ray that is closest to the given point. + * + * @param {Vector3} point - A point in 3D space to get the closet location on the ray for. + * @param {Vector3} target - The target vector that is used to store the method's result. + * @return {Vector3} The closest point on this ray. + */ + closestPointToPoint(point: Vector3, target: Vector3): Vector3; + /** + * Returns the distance of the closest approach between this ray and the given point. + * + * @param {Vector3} point - A point in 3D space to compute the distance to. + * @return {number} The distance. + */ + distanceToPoint(point: Vector3): number; + /** + * Returns the squared distance of the closest approach between this ray and the given point. + * + * @param {Vector3} point - A point in 3D space to compute the distance to. + * @return {number} The squared distance. + */ + distanceSqToPoint(point: Vector3): number; + /** + * Returns the squared distance between this ray and the given line segment. + * + * @param {Vector3} v0 - The start point of the line segment. + * @param {Vector3} v1 - The end point of the line segment. + * @param {Vector3} [optionalPointOnRay] - When provided, it receives the point on this ray that is closest to the segment. + * @param {Vector3} [optionalPointOnSegment] - When provided, it receives the point on the line segment that is closest to this ray. + * @return {number} The squared distance. + */ + distanceSqToSegment(v0: Vector3, v1: Vector3, optionalPointOnRay?: Vector3, optionalPointOnSegment?: Vector3): number; + /** + * Intersects this ray with the given sphere, returning the intersection + * point or `null` if there is no intersection. + * + * @param {Sphere} sphere - The sphere to intersect. + * @param {Vector3} target - The target vector that is used to store the method's result. + * @return {?Vector3} The intersection point. + */ + intersectSphere(sphere: Sphere, target: Vector3): Vector3 | null; + /** + * Returns `true` if this ray intersects with the given sphere. + * + * @param {Sphere} sphere - The sphere to intersect. + * @return {boolean} Whether this ray intersects with the given sphere or not. + */ + intersectsSphere(sphere: Sphere): boolean; + /** + * Computes the distance from the ray's origin to the given plane. Returns `null` if the ray + * does not intersect with the plane. + * + * @param {Plane} plane - The plane to compute the distance to. + * @return {?number} Whether this ray intersects with the given sphere or not. + */ + distanceToPlane(plane: Plane): number | null; + /** + * Intersects this ray with the given plane, returning the intersection + * point or `null` if there is no intersection. + * + * @param {Plane} plane - The plane to intersect. + * @param {Vector3} target - The target vector that is used to store the method's result. + * @return {?Vector3} The intersection point. + */ + intersectPlane(plane: Plane, target: Vector3): Vector3 | null; + /** + * Returns `true` if this ray intersects with the given plane. + * + * @param {Plane} plane - The plane to intersect. + * @return {boolean} Whether this ray intersects with the given plane or not. + */ + intersectsPlane(plane: Plane): boolean; + /** + * Intersects this ray with the given bounding box, returning the intersection + * point or `null` if there is no intersection. + * + * @param {Box3} box - The box to intersect. + * @param {Vector3} target - The target vector that is used to store the method's result. + * @return {?Vector3} The intersection point. + */ + intersectBox(box: Box3, target: Vector3): Vector3 | null; + /** + * Returns `true` if this ray intersects with the given box. + * + * @param {Box3} box - The box to intersect. + * @return {boolean} Whether this ray intersects with the given box or not. + */ + intersectsBox(box: Box3): boolean; + /** + * Intersects this ray with the given triangle, returning the intersection + * point or `null` if there is no intersection. + * + * @param {Vector3} a - The first vertex of the triangle. + * @param {Vector3} b - The second vertex of the triangle. + * @param {Vector3} c - The third vertex of the triangle. + * @param {boolean} backfaceCulling - Whether to use backface culling or not. + * @param {Vector3} target - The target vector that is used to store the method's result. + * @return {?Vector3} The intersection point. + */ + intersectTriangle(a: Vector3, b: Vector3, c: Vector3, backfaceCulling: boolean, target: Vector3): Vector3 | null; + /** + * Transforms this ray with the given 4x4 transformation matrix. + * + * @param {Matrix4} matrix4 - The transformation matrix. + * @return {Ray} A reference to this ray. + */ + applyMatrix4(matrix4: Matrix4): Ray; + /** + * Returns `true` if this ray is equal with the given one. + * + * @param {Ray} ray - The ray to test for equality. + * @return {boolean} Whether this ray is equal with the given one. + */ + equals(ray: Ray): boolean; + /** + * Returns a new ray with copied values from this instance. + * + * @return {Ray} A clone of this instance. + */ + clone(): Ray; +} +import { Vector3 } from './Vector3.js'; diff --git a/jsdoc-testing/jsdoc/math/Sphere.d.ts b/jsdoc-testing/jsdoc/math/Sphere.d.ts new file mode 100644 index 000000000..5d7e4ac67 --- /dev/null +++ b/jsdoc-testing/jsdoc/math/Sphere.d.ts @@ -0,0 +1,185 @@ +/** + * An analytical 3D sphere defined by a center and radius. This class is mainly + * used as a Bounding Sphere for 3D objects. + */ +export class Sphere { + /** + * Constructs a new sphere. + * + * @param {Vector3} [center=(0,0,0)] - The center of the sphere + * @param {number} [radius=-1] - The radius of the sphere. + */ + constructor(center?: Vector3, radius?: number); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isSphere: boolean; + /** + * The center of the sphere + * + * @type {Vector3} + */ + center: Vector3; + /** + * The radius of the sphere. + * + * @type {number} + */ + radius: number; + /** + * Sets the sphere's components by copying the given values. + * + * @param {Vector3} center - The center. + * @param {number} radius - The radius. + * @return {Sphere} A reference to this sphere. + */ + set(center: Vector3, radius: number): Sphere; + /** + * Computes the minimum bounding sphere for list of points. + * If the optional center point is given, it is used as the sphere's + * center. Otherwise, the center of the axis-aligned bounding box + * encompassing the points is calculated. + * + * @param {Array} points - A list of points in 3D space. + * @param {Vector3} [optionalCenter] - The center of the sphere. + * @return {Sphere} A reference to this sphere. + */ + setFromPoints(points: Array, optionalCenter?: Vector3): Sphere; + /** + * Copies the values of the given sphere to this instance. + * + * @param {Sphere} sphere - The sphere to copy. + * @return {Sphere} A reference to this sphere. + */ + copy(sphere: Sphere): Sphere; + /** + * Returns `true` if the sphere is empty (the radius set to a negative number). + * + * Spheres with a radius of `0` contain only their center point and are not + * considered to be empty. + * + * @return {boolean} Whether this sphere is empty or not. + */ + isEmpty(): boolean; + /** + * Makes this sphere empty which means in encloses a zero space in 3D. + * + * @return {Sphere} A reference to this sphere. + */ + makeEmpty(): Sphere; + /** + * Returns `true` if this sphere contains the given point inclusive of + * the surface of the sphere. + * + * @param {Vector3} point - The point to check. + * @return {boolean} Whether this sphere contains the given point or not. + */ + containsPoint(point: Vector3): boolean; + /** + * Returns the closest distance from the boundary of the sphere to the + * given point. If the sphere contains the point, the distance will + * be negative. + * + * @param {Vector3} point - The point to compute the distance to. + * @return {number} The distance to the point. + */ + distanceToPoint(point: Vector3): number; + /** + * Returns `true` if this sphere intersects with the given one. + * + * @param {Sphere} sphere - The sphere to test. + * @return {boolean} Whether this sphere intersects with the given one or not. + */ + intersectsSphere(sphere: Sphere): boolean; + /** + * Returns `true` if this sphere intersects with the given box. + * + * @param {Box3} box - The box to test. + * @return {boolean} Whether this sphere intersects with the given box or not. + */ + intersectsBox(box: Box3): boolean; + /** + * Returns `true` if this sphere intersects with the given plane. + * + * @param {Plane} plane - The plane to test. + * @return {boolean} Whether this sphere intersects with the given plane or not. + */ + intersectsPlane(plane: Plane): boolean; + /** + * Clamps a point within the sphere. If the point is outside the sphere, it + * will clamp it to the closest point on the edge of the sphere. Points + * already inside the sphere will not be affected. + * + * @param {Vector3} point - The plane to clamp. + * @param {Vector3} target - The target vector that is used to store the method's result. + * @return {Vector3} The clamped point. + */ + clampPoint(point: Vector3, target: Vector3): Vector3; + /** + * Returns a bounding box that encloses this sphere. + * + * @param {Box3} target - The target box that is used to store the method's result. + * @return {Box3} The bounding box that encloses this sphere. + */ + getBoundingBox(target: Box3): Box3; + /** + * Transforms this sphere with the given 4x4 transformation matrix. + * + * @param {Matrix4} matrix - The transformation matrix. + * @return {Sphere} A reference to this sphere. + */ + applyMatrix4(matrix: Matrix4): Sphere; + /** + * Translates the sphere's center by the given offset. + * + * @param {Vector3} offset - The offset. + * @return {Sphere} A reference to this sphere. + */ + translate(offset: Vector3): Sphere; + /** + * Expands the boundaries of this sphere to include the given point. + * + * @param {Vector3} point - The point to include. + * @return {Sphere} A reference to this sphere. + */ + expandByPoint(point: Vector3): Sphere; + /** + * Expands this sphere to enclose both the original sphere and the given sphere. + * + * @param {Sphere} sphere - The sphere to include. + * @return {Sphere} A reference to this sphere. + */ + union(sphere: Sphere): Sphere; + /** + * Returns `true` if this sphere is equal with the given one. + * + * @param {Sphere} sphere - The sphere to test for equality. + * @return {boolean} Whether this bounding sphere is equal with the given one. + */ + equals(sphere: Sphere): boolean; + /** + * Returns a new sphere with copied values from this instance. + * + * @return {Sphere} A clone of this instance. + */ + clone(): Sphere; + /** + * Returns a serialized structure of the bounding sphere. + * + * @return {Object} Serialized structure with fields representing the object state. + */ + toJSON(): Object; + /** + * Returns a serialized structure of the bounding sphere. + * + * @param {Object} json - The serialized json to set the sphere from. + * @return {Sphere} A reference to this bounding sphere. + */ + fromJSON(json: Object): Sphere; +} +import { Vector3 } from './Vector3.js'; +import { Box3 } from './Box3.js'; diff --git a/jsdoc-testing/jsdoc/math/SphericalHarmonics3.d.ts b/jsdoc-testing/jsdoc/math/SphericalHarmonics3.d.ts new file mode 100644 index 000000000..307ff49fa --- /dev/null +++ b/jsdoc-testing/jsdoc/math/SphericalHarmonics3.d.ts @@ -0,0 +1,131 @@ +/** + * Represents a third-order spherical harmonics (SH). Light probes use this class + * to encode lighting information. + * + * - Primary reference: {@link https://graphics.stanford.edu/papers/envmap/envmap.pdf} + * - Secondary reference: {@link https://www.ppsloan.org/publications/StupidSH36.pdf} + */ +export class SphericalHarmonics3 { + /** + * Computes the SH basis for the given normal vector. + * + * @param {Vector3} normal - The normal. + * @param {Array} shBasis - The target array holding the SH basis. + */ + static getBasisAt(normal: Vector3, shBasis: Array): void; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isSphericalHarmonics3: boolean; + /** + * An array holding the (9) SH coefficients. + * + * @type {Array} + */ + coefficients: Array; + /** + * Sets the given SH coefficients to this instance by copying + * the values. + * + * @param {Array} coefficients - The SH coefficients. + * @return {SphericalHarmonics3} A reference to this spherical harmonics. + */ + set(coefficients: Array): SphericalHarmonics3; + /** + * Sets all SH coefficients to `0`. + * + * @return {SphericalHarmonics3} A reference to this spherical harmonics. + */ + zero(): SphericalHarmonics3; + /** + * Returns the radiance in the direction of the given normal. + * + * @param {Vector3} normal - The normal vector (assumed to be unit length) + * @param {Vector3} target - The target vector that is used to store the method's result. + * @return {Vector3} The radiance. + */ + getAt(normal: Vector3, target: Vector3): Vector3; + /** + * Returns the irradiance (radiance convolved with cosine lobe) in the + * direction of the given normal. + * + * @param {Vector3} normal - The normal vector (assumed to be unit length) + * @param {Vector3} target - The target vector that is used to store the method's result. + * @return {Vector3} The irradiance. + */ + getIrradianceAt(normal: Vector3, target: Vector3): Vector3; + /** + * Adds the given SH to this instance. + * + * @param {SphericalHarmonics3} sh - The SH to add. + * @return {SphericalHarmonics3} A reference to this spherical harmonics. + */ + add(sh: SphericalHarmonics3): SphericalHarmonics3; + /** + * A convenience method for performing {@link SphericalHarmonics3#add} and + * {@link SphericalHarmonics3#scale} at once. + * + * @param {SphericalHarmonics3} sh - The SH to add. + * @param {number} s - The scale factor. + * @return {SphericalHarmonics3} A reference to this spherical harmonics. + */ + addScaledSH(sh: SphericalHarmonics3, s: number): SphericalHarmonics3; + /** + * Scales this SH by the given scale factor. + * + * @param {number} s - The scale factor. + * @return {SphericalHarmonics3} A reference to this spherical harmonics. + */ + scale(s: number): SphericalHarmonics3; + /** + * Linear interpolates between the given SH and this instance by the given + * alpha factor. + * + * @param {SphericalHarmonics3} sh - The SH to interpolate with. + * @param {number} alpha - The alpha factor. + * @return {SphericalHarmonics3} A reference to this spherical harmonics. + */ + lerp(sh: SphericalHarmonics3, alpha: number): SphericalHarmonics3; + /** + * Returns `true` if this spherical harmonics is equal with the given one. + * + * @param {SphericalHarmonics3} sh - The spherical harmonics to test for equality. + * @return {boolean} Whether this spherical harmonics is equal with the given one. + */ + equals(sh: SphericalHarmonics3): boolean; + /** + * Copies the values of the given spherical harmonics to this instance. + * + * @param {SphericalHarmonics3} sh - The spherical harmonics to copy. + * @return {SphericalHarmonics3} A reference to this spherical harmonics. + */ + copy(sh: SphericalHarmonics3): SphericalHarmonics3; + /** + * Returns a new spherical harmonics with copied values from this instance. + * + * @return {SphericalHarmonics3} A clone of this instance. + */ + clone(): SphericalHarmonics3; + /** + * Sets the SH coefficients of this instance from the given array. + * + * @param {Array} array - An array holding the SH coefficients. + * @param {number} [offset=0] - The array offset where to start copying. + * @return {SphericalHarmonics3} A clone of this instance. + */ + fromArray(array: Array, offset?: number): SphericalHarmonics3; + /** + * Returns an array with the SH coefficients, or copies them into the provided + * array. The coefficients are represented as numbers. + * + * @param {Array} [array=[]] - The target array. + * @param {number} [offset=0] - The array offset where to start copying. + * @return {Array} An array with flat SH coefficients. + */ + toArray(array?: Array, offset?: number): Array; +} +import { Vector3 } from './Vector3.js'; diff --git a/jsdoc-testing/jsdoc/math/Triangle.d.ts b/jsdoc-testing/jsdoc/math/Triangle.d.ts new file mode 100644 index 000000000..3841d3852 --- /dev/null +++ b/jsdoc-testing/jsdoc/math/Triangle.d.ts @@ -0,0 +1,231 @@ +/** + * A geometric triangle as defined by three vectors representing its three corners. + */ +export class Triangle { + /** + * Computes the normal vector of a triangle. + * + * @param {Vector3} a - The first corner of the triangle. + * @param {Vector3} b - The second corner of the triangle. + * @param {Vector3} c - The third corner of the triangle. + * @param {Vector3} target - The target vector that is used to store the method's result. + * @return {Vector3} The triangle's normal. + */ + static getNormal(a: Vector3, b: Vector3, c: Vector3, target: Vector3): Vector3; + /** + * Computes a barycentric coordinates from the given vector. + * Returns `null` if the triangle is degenerate. + * + * @param {Vector3} point - A point in 3D space. + * @param {Vector3} a - The first corner of the triangle. + * @param {Vector3} b - The second corner of the triangle. + * @param {Vector3} c - The third corner of the triangle. + * @param {Vector3} target - The target vector that is used to store the method's result. + * @return {?Vector3} The barycentric coordinates for the given point + */ + static getBarycoord(point: Vector3, a: Vector3, b: Vector3, c: Vector3, target: Vector3): Vector3 | null; + /** + * Returns `true` if the given point, when projected onto the plane of the + * triangle, lies within the triangle. + * + * @param {Vector3} point - The point in 3D space to test. + * @param {Vector3} a - The first corner of the triangle. + * @param {Vector3} b - The second corner of the triangle. + * @param {Vector3} c - The third corner of the triangle. + * @return {boolean} Whether the given point, when projected onto the plane of the + * triangle, lies within the triangle or not. + */ + static containsPoint(point: Vector3, a: Vector3, b: Vector3, c: Vector3): boolean; + /** + * Computes the value barycentrically interpolated for the given point on the + * triangle. Returns `null` if the triangle is degenerate. + * + * @param {Vector3} point - Position of interpolated point. + * @param {Vector3} p1 - The first corner of the triangle. + * @param {Vector3} p2 - The second corner of the triangle. + * @param {Vector3} p3 - The third corner of the triangle. + * @param {Vector3} v1 - Value to interpolate of first vertex. + * @param {Vector3} v2 - Value to interpolate of second vertex. + * @param {Vector3} v3 - Value to interpolate of third vertex. + * @param {Vector3} target - The target vector that is used to store the method's result. + * @return {?Vector3} The interpolated value. + */ + static getInterpolation(point: Vector3, p1: Vector3, p2: Vector3, p3: Vector3, v1: Vector3, v2: Vector3, v3: Vector3, target: Vector3): Vector3 | null; + /** + * Computes the value barycentrically interpolated for the given attribute and indices. + * + * @param {BufferAttribute} attr - The attribute to interpolate. + * @param {number} i1 - Index of first vertex. + * @param {number} i2 - Index of second vertex. + * @param {number} i3 - Index of third vertex. + * @param {Vector3} barycoord - The barycoordinate value to use to interpolate. + * @param {Vector3} target - The target vector that is used to store the method's result. + * @return {Vector3} The interpolated attribute value. + */ + static getInterpolatedAttribute(attr: BufferAttribute, i1: number, i2: number, i3: number, barycoord: Vector3, target: Vector3): Vector3; + /** + * Returns `true` if the triangle is oriented towards the given direction. + * + * @param {Vector3} a - The first corner of the triangle. + * @param {Vector3} b - The second corner of the triangle. + * @param {Vector3} c - The third corner of the triangle. + * @param {Vector3} direction - The (normalized) direction vector. + * @return {boolean} Whether the triangle is oriented towards the given direction or not. + */ + static isFrontFacing(a: Vector3, b: Vector3, c: Vector3, direction: Vector3): boolean; + /** + * Constructs a new triangle. + * + * @param {Vector3} [a=(0,0,0)] - The first corner of the triangle. + * @param {Vector3} [b=(0,0,0)] - The second corner of the triangle. + * @param {Vector3} [c=(0,0,0)] - The third corner of the triangle. + */ + constructor(a?: Vector3, b?: Vector3, c?: Vector3); + /** + * The first corner of the triangle. + * + * @type {Vector3} + */ + a: Vector3; + /** + * The second corner of the triangle. + * + * @type {Vector3} + */ + b: Vector3; + /** + * The third corner of the triangle. + * + * @type {Vector3} + */ + c: Vector3; + /** + * Sets the triangle's vertices by copying the given values. + * + * @param {Vector3} a - The first corner of the triangle. + * @param {Vector3} b - The second corner of the triangle. + * @param {Vector3} c - The third corner of the triangle. + * @return {Triangle} A reference to this triangle. + */ + set(a: Vector3, b: Vector3, c: Vector3): Triangle; + /** + * Sets the triangle's vertices by copying the given array values. + * + * @param {Array} points - An array with 3D points. + * @param {number} i0 - The array index representing the first corner of the triangle. + * @param {number} i1 - The array index representing the second corner of the triangle. + * @param {number} i2 - The array index representing the third corner of the triangle. + * @return {Triangle} A reference to this triangle. + */ + setFromPointsAndIndices(points: Array, i0: number, i1: number, i2: number): Triangle; + /** + * Sets the triangle's vertices by copying the given attribute values. + * + * @param {BufferAttribute} attribute - A buffer attribute with 3D points data. + * @param {number} i0 - The attribute index representing the first corner of the triangle. + * @param {number} i1 - The attribute index representing the second corner of the triangle. + * @param {number} i2 - The attribute index representing the third corner of the triangle. + * @return {Triangle} A reference to this triangle. + */ + setFromAttributeAndIndices(attribute: BufferAttribute, i0: number, i1: number, i2: number): Triangle; + /** + * Returns a new triangle with copied values from this instance. + * + * @return {Triangle} A clone of this instance. + */ + clone(): Triangle; + /** + * Copies the values of the given triangle to this instance. + * + * @param {Triangle} triangle - The triangle to copy. + * @return {Triangle} A reference to this triangle. + */ + copy(triangle: Triangle): Triangle; + /** + * Computes the area of the triangle. + * + * @return {number} The triangle's area. + */ + getArea(): number; + /** + * Computes the midpoint of the triangle. + * + * @param {Vector3} target - The target vector that is used to store the method's result. + * @return {Vector3} The triangle's midpoint. + */ + getMidpoint(target: Vector3): Vector3; + /** + * Computes the normal of the triangle. + * + * @param {Vector3} target - The target vector that is used to store the method's result. + * @return {Vector3} The triangle's normal. + */ + getNormal(target: Vector3): Vector3; + /** + * Computes a plane the triangle lies within. + * + * @param {Plane} target - The target vector that is used to store the method's result. + * @return {Plane} The plane the triangle lies within. + */ + getPlane(target: Plane): Plane; + /** + * Computes a barycentric coordinates from the given vector. + * Returns `null` if the triangle is degenerate. + * + * @param {Vector3} point - A point in 3D space. + * @param {Vector3} target - The target vector that is used to store the method's result. + * @return {?Vector3} The barycentric coordinates for the given point + */ + getBarycoord(point: Vector3, target: Vector3): Vector3 | null; + /** + * Computes the value barycentrically interpolated for the given point on the + * triangle. Returns `null` if the triangle is degenerate. + * + * @param {Vector3} point - Position of interpolated point. + * @param {Vector3} v1 - Value to interpolate of first vertex. + * @param {Vector3} v2 - Value to interpolate of second vertex. + * @param {Vector3} v3 - Value to interpolate of third vertex. + * @param {Vector3} target - The target vector that is used to store the method's result. + * @return {?Vector3} The interpolated value. + */ + getInterpolation(point: Vector3, v1: Vector3, v2: Vector3, v3: Vector3, target: Vector3): Vector3 | null; + /** + * Returns `true` if the given point, when projected onto the plane of the + * triangle, lies within the triangle. + * + * @param {Vector3} point - The point in 3D space to test. + * @return {boolean} Whether the given point, when projected onto the plane of the + * triangle, lies within the triangle or not. + */ + containsPoint(point: Vector3): boolean; + /** + * Returns `true` if the triangle is oriented towards the given direction. + * + * @param {Vector3} direction - The (normalized) direction vector. + * @return {boolean} Whether the triangle is oriented towards the given direction or not. + */ + isFrontFacing(direction: Vector3): boolean; + /** + * Returns `true` if this triangle intersects with the given box. + * + * @param {Box3} box - The box to intersect. + * @return {boolean} Whether this triangle intersects with the given box or not. + */ + intersectsBox(box: Box3): boolean; + /** + * Returns the closest point on the triangle to the given point. + * + * @param {Vector3} p - The point to compute the closest point for. + * @param {Vector3} target - The target vector that is used to store the method's result. + * @return {Vector3} The closest point on the triangle. + */ + closestPointToPoint(p: Vector3, target: Vector3): Vector3; + /** + * Returns `true` if this triangle is equal with the given one. + * + * @param {Triangle} triangle - The triangle to test for equality. + * @return {boolean} Whether this triangle is equal with the given one. + */ + equals(triangle: Triangle): boolean; +} +import { Vector3 } from './Vector3.js'; diff --git a/jsdoc-testing/jsdoc/math/Vector2.d.ts b/jsdoc-testing/jsdoc/math/Vector2.d.ts new file mode 100644 index 000000000..aeaeb509d --- /dev/null +++ b/jsdoc-testing/jsdoc/math/Vector2.d.ts @@ -0,0 +1,440 @@ +/** + * Class representing a 2D vector. A 2D vector is an ordered pair of numbers + * (labeled x and y), which can be used to represent a number of things, such as: + * + * - A point in 2D space (i.e. a position on a plane). + * - A direction and length across a plane. In three.js the length will + * always be the Euclidean distance(straight-line distance) from `(0, 0)` to `(x, y)` + * and the direction is also measured from `(0, 0)` towards `(x, y)`. + * - Any arbitrary ordered pair of numbers. + * + * There are other things a 2D vector can be used to represent, such as + * momentum vectors, complex numbers and so on, however these are the most + * common uses in three.js. + * + * Iterating through a vector instance will yield its components `(x, y)` in + * the corresponding order. + * ```js + * const a = new THREE.Vector2( 0, 1 ); + * + * //no arguments; will be initialised to (0, 0) + * const b = new THREE.Vector2( ); + * + * const d = a.distanceTo( b ); + * ``` + */ +export class Vector2 { + /** + * Constructs a new 2D vector. + * + * @param {number} [x=0] - The x value of this vector. + * @param {number} [y=0] - The y value of this vector. + */ + constructor(x?: number, y?: number); + /** + * The x value of this vector. + * + * @type {number} + */ + x: number; + /** + * The y value of this vector. + * + * @type {number} + */ + y: number; + set width(value: number); + /** + * Alias for {@link Vector2#x}. + * + * @type {number} + */ + get width(): number; + set height(value: number); + /** + * Alias for {@link Vector2#y}. + * + * @type {number} + */ + get height(): number; + /** + * Sets the vector components. + * + * @param {number} x - The value of the x component. + * @param {number} y - The value of the y component. + * @return {Vector2} A reference to this vector. + */ + set(x: number, y: number): Vector2; + /** + * Sets the vector components to the same value. + * + * @param {number} scalar - The value to set for all vector components. + * @return {Vector2} A reference to this vector. + */ + setScalar(scalar: number): Vector2; + /** + * Sets the vector's x component to the given value + * + * @param {number} x - The value to set. + * @return {Vector2} A reference to this vector. + */ + setX(x: number): Vector2; + /** + * Sets the vector's y component to the given value + * + * @param {number} y - The value to set. + * @return {Vector2} A reference to this vector. + */ + setY(y: number): Vector2; + /** + * Allows to set a vector component with an index. + * + * @param {number} index - The component index. `0` equals to x, `1` equals to y. + * @param {number} value - The value to set. + * @return {Vector2} A reference to this vector. + */ + setComponent(index: number, value: number): Vector2; + /** + * Returns the value of the vector component which matches the given index. + * + * @param {number} index - The component index. `0` equals to x, `1` equals to y. + * @return {number} A vector component value. + */ + getComponent(index: number): number; + /** + * Returns a new vector with copied values from this instance. + * + * @return {Vector2} A clone of this instance. + */ + clone(): Vector2; + /** + * Copies the values of the given vector to this instance. + * + * @param {Vector2} v - The vector to copy. + * @return {Vector2} A reference to this vector. + */ + copy(v: Vector2): Vector2; + /** + * Adds the given vector to this instance. + * + * @param {Vector2} v - The vector to add. + * @return {Vector2} A reference to this vector. + */ + add(v: Vector2): Vector2; + /** + * Adds the given scalar value to all components of this instance. + * + * @param {number} s - The scalar to add. + * @return {Vector2} A reference to this vector. + */ + addScalar(s: number): Vector2; + /** + * Adds the given vectors and stores the result in this instance. + * + * @param {Vector2} a - The first vector. + * @param {Vector2} b - The second vector. + * @return {Vector2} A reference to this vector. + */ + addVectors(a: Vector2, b: Vector2): Vector2; + /** + * Adds the given vector scaled by the given factor to this instance. + * + * @param {Vector2} v - The vector. + * @param {number} s - The factor that scales `v`. + * @return {Vector2} A reference to this vector. + */ + addScaledVector(v: Vector2, s: number): Vector2; + /** + * Subtracts the given vector from this instance. + * + * @param {Vector2} v - The vector to subtract. + * @return {Vector2} A reference to this vector. + */ + sub(v: Vector2): Vector2; + /** + * Subtracts the given scalar value from all components of this instance. + * + * @param {number} s - The scalar to subtract. + * @return {Vector2} A reference to this vector. + */ + subScalar(s: number): Vector2; + /** + * Subtracts the given vectors and stores the result in this instance. + * + * @param {Vector2} a - The first vector. + * @param {Vector2} b - The second vector. + * @return {Vector2} A reference to this vector. + */ + subVectors(a: Vector2, b: Vector2): Vector2; + /** + * Multiplies the given vector with this instance. + * + * @param {Vector2} v - The vector to multiply. + * @return {Vector2} A reference to this vector. + */ + multiply(v: Vector2): Vector2; + /** + * Multiplies the given scalar value with all components of this instance. + * + * @param {number} scalar - The scalar to multiply. + * @return {Vector2} A reference to this vector. + */ + multiplyScalar(scalar: number): Vector2; + /** + * Divides this instance by the given vector. + * + * @param {Vector2} v - The vector to divide. + * @return {Vector2} A reference to this vector. + */ + divide(v: Vector2): Vector2; + /** + * Divides this vector by the given scalar. + * + * @param {number} scalar - The scalar to divide. + * @return {Vector2} A reference to this vector. + */ + divideScalar(scalar: number): Vector2; + /** + * Multiplies this vector (with an implicit 1 as the 3rd component) by + * the given 3x3 matrix. + * + * @param {Matrix3} m - The matrix to apply. + * @return {Vector2} A reference to this vector. + */ + applyMatrix3(m: Matrix3): Vector2; + /** + * If this vector's x or y value is greater than the given vector's x or y + * value, replace that value with the corresponding min value. + * + * @param {Vector2} v - The vector. + * @return {Vector2} A reference to this vector. + */ + min(v: Vector2): Vector2; + /** + * If this vector's x or y value is less than the given vector's x or y + * value, replace that value with the corresponding max value. + * + * @param {Vector2} v - The vector. + * @return {Vector2} A reference to this vector. + */ + max(v: Vector2): Vector2; + /** + * If this vector's x or y value is greater than the max vector's x or y + * value, it is replaced by the corresponding value. + * If this vector's x or y value is less than the min vector's x or y value, + * it is replaced by the corresponding value. + * + * @param {Vector2} min - The minimum x and y values. + * @param {Vector2} max - The maximum x and y values in the desired range. + * @return {Vector2} A reference to this vector. + */ + clamp(min: Vector2, max: Vector2): Vector2; + /** + * If this vector's x or y values are greater than the max value, they are + * replaced by the max value. + * If this vector's x or y values are less than the min value, they are + * replaced by the min value. + * + * @param {number} minVal - The minimum value the components will be clamped to. + * @param {number} maxVal - The maximum value the components will be clamped to. + * @return {Vector2} A reference to this vector. + */ + clampScalar(minVal: number, maxVal: number): Vector2; + /** + * If this vector's length is greater than the max value, it is replaced by + * the max value. + * If this vector's length is less than the min value, it is replaced by the + * min value. + * + * @param {number} min - The minimum value the vector length will be clamped to. + * @param {number} max - The maximum value the vector length will be clamped to. + * @return {Vector2} A reference to this vector. + */ + clampLength(min: number, max: number): Vector2; + /** + * The components of this vector are rounded down to the nearest integer value. + * + * @return {Vector2} A reference to this vector. + */ + floor(): Vector2; + /** + * The components of this vector are rounded up to the nearest integer value. + * + * @return {Vector2} A reference to this vector. + */ + ceil(): Vector2; + /** + * The components of this vector are rounded to the nearest integer value + * + * @return {Vector2} A reference to this vector. + */ + round(): Vector2; + /** + * The components of this vector are rounded towards zero (up if negative, + * down if positive) to an integer value. + * + * @return {Vector2} A reference to this vector. + */ + roundToZero(): Vector2; + /** + * Inverts this vector - i.e. sets x = -x and y = -y. + * + * @return {Vector2} A reference to this vector. + */ + negate(): Vector2; + /** + * Calculates the dot product of the given vector with this instance. + * + * @param {Vector2} v - The vector to compute the dot product with. + * @return {number} The result of the dot product. + */ + dot(v: Vector2): number; + /** + * Calculates the cross product of the given vector with this instance. + * + * @param {Vector2} v - The vector to compute the cross product with. + * @return {number} The result of the cross product. + */ + cross(v: Vector2): number; + /** + * Computes the square of the Euclidean length (straight-line length) from + * (0, 0) to (x, y). If you are comparing the lengths of vectors, you should + * compare the length squared instead as it is slightly more efficient to calculate. + * + * @return {number} The square length of this vector. + */ + lengthSq(): number; + /** + * Computes the Euclidean length (straight-line length) from (0, 0) to (x, y). + * + * @return {number} The length of this vector. + */ + length(): number; + /** + * Computes the Manhattan length of this vector. + * + * @return {number} The length of this vector. + */ + manhattanLength(): number; + /** + * Converts this vector to a unit vector - that is, sets it equal to a vector + * with the same direction as this one, but with a vector length of `1`. + * + * @return {Vector2} A reference to this vector. + */ + normalize(): Vector2; + /** + * Computes the angle in radians of this vector with respect to the positive x-axis. + * + * @return {number} The angle in radians. + */ + angle(): number; + /** + * Returns the angle between the given vector and this instance in radians. + * + * @param {Vector2} v - The vector to compute the angle with. + * @return {number} The angle in radians. + */ + angleTo(v: Vector2): number; + /** + * Computes the distance from the given vector to this instance. + * + * @param {Vector2} v - The vector to compute the distance to. + * @return {number} The distance. + */ + distanceTo(v: Vector2): number; + /** + * Computes the squared distance from the given vector to this instance. + * If you are just comparing the distance with another distance, you should compare + * the distance squared instead as it is slightly more efficient to calculate. + * + * @param {Vector2} v - The vector to compute the squared distance to. + * @return {number} The squared distance. + */ + distanceToSquared(v: Vector2): number; + /** + * Computes the Manhattan distance from the given vector to this instance. + * + * @param {Vector2} v - The vector to compute the Manhattan distance to. + * @return {number} The Manhattan distance. + */ + manhattanDistanceTo(v: Vector2): number; + /** + * Sets this vector to a vector with the same direction as this one, but + * with the specified length. + * + * @param {number} length - The new length of this vector. + * @return {Vector2} A reference to this vector. + */ + setLength(length: number): Vector2; + /** + * Linearly interpolates between the given vector and this instance, where + * alpha is the percent distance along the line - alpha = 0 will be this + * vector, and alpha = 1 will be the given one. + * + * @param {Vector2} v - The vector to interpolate towards. + * @param {number} alpha - The interpolation factor, typically in the closed interval `[0, 1]`. + * @return {Vector2} A reference to this vector. + */ + lerp(v: Vector2, alpha: number): Vector2; + /** + * Linearly interpolates between the given vectors, where alpha is the percent + * distance along the line - alpha = 0 will be first vector, and alpha = 1 will + * be the second one. The result is stored in this instance. + * + * @param {Vector2} v1 - The first vector. + * @param {Vector2} v2 - The second vector. + * @param {number} alpha - The interpolation factor, typically in the closed interval `[0, 1]`. + * @return {Vector2} A reference to this vector. + */ + lerpVectors(v1: Vector2, v2: Vector2, alpha: number): Vector2; + /** + * Returns `true` if this vector is equal with the given one. + * + * @param {Vector2} v - The vector to test for equality. + * @return {boolean} Whether this vector is equal with the given one. + */ + equals(v: Vector2): boolean; + /** + * Sets this vector's x value to be `array[ offset ]` and y + * value to be `array[ offset + 1 ]`. + * + * @param {Array} array - An array holding the vector component values. + * @param {number} [offset=0] - The offset into the array. + * @return {Vector2} A reference to this vector. + */ + fromArray(array: Array, offset?: number): Vector2; + /** + * Writes the components of this vector to the given array. If no array is provided, + * the method returns a new instance. + * + * @param {Array} [array=[]] - The target array holding the vector components. + * @param {number} [offset=0] - Index of the first element in the array. + * @return {Array} The vector components. + */ + toArray(array?: Array, offset?: number): Array; + /** + * Sets the components of this vector from the given buffer attribute. + * + * @param {BufferAttribute} attribute - The buffer attribute holding vector data. + * @param {number} index - The index into the attribute. + * @return {Vector2} A reference to this vector. + */ + fromBufferAttribute(attribute: BufferAttribute, index: number): Vector2; + /** + * Rotates this vector around the given center by the given angle. + * + * @param {Vector2} center - The point around which to rotate. + * @param {number} angle - The angle to rotate, in radians. + * @return {Vector2} A reference to this vector. + */ + rotateAround(center: Vector2, angle: number): Vector2; + /** + * Sets each component of this vector to a pseudo-random value between `0` and + * `1`, excluding `1`. + * + * @return {Vector2} A reference to this vector. + */ + random(): Vector2; + [Symbol.iterator](): Generator; +} diff --git a/jsdoc-testing/jsdoc/math/Vector3.d.ts b/jsdoc-testing/jsdoc/math/Vector3.d.ts new file mode 100644 index 000000000..df65f7998 --- /dev/null +++ b/jsdoc-testing/jsdoc/math/Vector3.d.ts @@ -0,0 +1,613 @@ +/** + * Class representing a 3D vector. A 3D vector is an ordered triplet of numbers + * (labeled x, y and z), which can be used to represent a number of things, such as: + * + * - A point in 3D space. + * - A direction and length in 3D space. In three.js the length will + * always be the Euclidean distance(straight-line distance) from `(0, 0, 0)` to `(x, y, z)` + * and the direction is also measured from `(0, 0, 0)` towards `(x, y, z)`. + * - Any arbitrary ordered triplet of numbers. + * + * There are other things a 3D vector can be used to represent, such as + * momentum vectors and so on, however these are the most + * common uses in three.js. + * + * Iterating through a vector instance will yield its components `(x, y, z)` in + * the corresponding order. + * ```js + * const a = new THREE.Vector3( 0, 1, 0 ); + * + * //no arguments; will be initialised to (0, 0, 0) + * const b = new THREE.Vector3( ); + * + * const d = a.distanceTo( b ); + * ``` + */ +export class Vector3 { + /** + * Constructs a new 3D vector. + * + * @param {number} [x=0] - The x value of this vector. + * @param {number} [y=0] - The y value of this vector. + * @param {number} [z=0] - The z value of this vector. + */ + constructor(x?: number, y?: number, z?: number); + /** + * The x value of this vector. + * + * @type {number} + */ + x: number; + /** + * The y value of this vector. + * + * @type {number} + */ + y: number; + /** + * The z value of this vector. + * + * @type {number} + */ + z: number; + /** + * Sets the vector components. + * + * @param {number} x - The value of the x component. + * @param {number} y - The value of the y component. + * @param {number} z - The value of the z component. + * @return {Vector3} A reference to this vector. + */ + set(x: number, y: number, z: number): Vector3; + /** + * Sets the vector components to the same value. + * + * @param {number} scalar - The value to set for all vector components. + * @return {Vector3} A reference to this vector. + */ + setScalar(scalar: number): Vector3; + /** + * Sets the vector's x component to the given value. + * + * @param {number} x - The value to set. + * @return {Vector3} A reference to this vector. + */ + setX(x: number): Vector3; + /** + * Sets the vector's y component to the given value. + * + * @param {number} y - The value to set. + * @return {Vector3} A reference to this vector. + */ + setY(y: number): Vector3; + /** + * Sets the vector's z component to the given value. + * + * @param {number} z - The value to set. + * @return {Vector3} A reference to this vector. + */ + setZ(z: number): Vector3; + /** + * Allows to set a vector component with an index. + * + * @param {number} index - The component index. `0` equals to x, `1` equals to y, `2` equals to z. + * @param {number} value - The value to set. + * @return {Vector3} A reference to this vector. + */ + setComponent(index: number, value: number): Vector3; + /** + * Returns the value of the vector component which matches the given index. + * + * @param {number} index - The component index. `0` equals to x, `1` equals to y, `2` equals to z. + * @return {number} A vector component value. + */ + getComponent(index: number): number; + /** + * Returns a new vector with copied values from this instance. + * + * @return {Vector3} A clone of this instance. + */ + clone(): Vector3; + /** + * Copies the values of the given vector to this instance. + * + * @param {Vector3} v - The vector to copy. + * @return {Vector3} A reference to this vector. + */ + copy(v: Vector3): Vector3; + /** + * Adds the given vector to this instance. + * + * @param {Vector3} v - The vector to add. + * @return {Vector3} A reference to this vector. + */ + add(v: Vector3): Vector3; + /** + * Adds the given scalar value to all components of this instance. + * + * @param {number} s - The scalar to add. + * @return {Vector3} A reference to this vector. + */ + addScalar(s: number): Vector3; + /** + * Adds the given vectors and stores the result in this instance. + * + * @param {Vector3} a - The first vector. + * @param {Vector3} b - The second vector. + * @return {Vector3} A reference to this vector. + */ + addVectors(a: Vector3, b: Vector3): Vector3; + /** + * Adds the given vector scaled by the given factor to this instance. + * + * @param {Vector3|Vector4} v - The vector. + * @param {number} s - The factor that scales `v`. + * @return {Vector3} A reference to this vector. + */ + addScaledVector(v: Vector3 | Vector4, s: number): Vector3; + /** + * Subtracts the given vector from this instance. + * + * @param {Vector3} v - The vector to subtract. + * @return {Vector3} A reference to this vector. + */ + sub(v: Vector3): Vector3; + /** + * Subtracts the given scalar value from all components of this instance. + * + * @param {number} s - The scalar to subtract. + * @return {Vector3} A reference to this vector. + */ + subScalar(s: number): Vector3; + /** + * Subtracts the given vectors and stores the result in this instance. + * + * @param {Vector3} a - The first vector. + * @param {Vector3} b - The second vector. + * @return {Vector3} A reference to this vector. + */ + subVectors(a: Vector3, b: Vector3): Vector3; + /** + * Multiplies the given vector with this instance. + * + * @param {Vector3} v - The vector to multiply. + * @return {Vector3} A reference to this vector. + */ + multiply(v: Vector3): Vector3; + /** + * Multiplies the given scalar value with all components of this instance. + * + * @param {number} scalar - The scalar to multiply. + * @return {Vector3} A reference to this vector. + */ + multiplyScalar(scalar: number): Vector3; + /** + * Multiplies the given vectors and stores the result in this instance. + * + * @param {Vector3} a - The first vector. + * @param {Vector3} b - The second vector. + * @return {Vector3} A reference to this vector. + */ + multiplyVectors(a: Vector3, b: Vector3): Vector3; + /** + * Applies the given Euler rotation to this vector. + * + * @param {Euler} euler - The Euler angles. + * @return {Vector3} A reference to this vector. + */ + applyEuler(euler: Euler): Vector3; + /** + * Applies a rotation specified by an axis and an angle to this vector. + * + * @param {Vector3} axis - A normalized vector representing the rotation axis. + * @param {number} angle - The angle in radians. + * @return {Vector3} A reference to this vector. + */ + applyAxisAngle(axis: Vector3, angle: number): Vector3; + /** + * Multiplies this vector with the given 3x3 matrix. + * + * @param {Matrix3} m - The 3x3 matrix. + * @return {Vector3} A reference to this vector. + */ + applyMatrix3(m: Matrix3): Vector3; + /** + * Multiplies this vector by the given normal matrix and normalizes + * the result. + * + * @param {Matrix3} m - The normal matrix. + * @return {Vector3} A reference to this vector. + */ + applyNormalMatrix(m: Matrix3): Vector3; + /** + * Multiplies this vector (with an implicit 1 in the 4th dimension) by m, and + * divides by perspective. + * + * @param {Matrix4} m - The matrix to apply. + * @return {Vector3} A reference to this vector. + */ + applyMatrix4(m: Matrix4): Vector3; + /** + * Applies the given Quaternion to this vector. + * + * @param {Quaternion} q - The Quaternion. + * @return {Vector3} A reference to this vector. + */ + applyQuaternion(q: Quaternion): Vector3; + /** + * Projects this vector from world space into the camera's normalized + * device coordinate (NDC) space. + * + * @param {Camera} camera - The camera. + * @return {Vector3} A reference to this vector. + */ + project(camera: Camera): Vector3; + /** + * Unprojects this vector from the camera's normalized device coordinate (NDC) + * space into world space. + * + * @param {Camera} camera - The camera. + * @return {Vector3} A reference to this vector. + */ + unproject(camera: Camera): Vector3; + /** + * Transforms the direction of this vector by a matrix (the upper left 3 x 3 + * subset of the given 4x4 matrix and then normalizes the result. + * + * @param {Matrix4} m - The matrix. + * @return {Vector3} A reference to this vector. + */ + transformDirection(m: Matrix4): Vector3; + /** + * Divides this instance by the given vector. + * + * @param {Vector3} v - The vector to divide. + * @return {Vector3} A reference to this vector. + */ + divide(v: Vector3): Vector3; + /** + * Divides this vector by the given scalar. + * + * @param {number} scalar - The scalar to divide. + * @return {Vector3} A reference to this vector. + */ + divideScalar(scalar: number): Vector3; + /** + * If this vector's x, y or z value is greater than the given vector's x, y or z + * value, replace that value with the corresponding min value. + * + * @param {Vector3} v - The vector. + * @return {Vector3} A reference to this vector. + */ + min(v: Vector3): Vector3; + /** + * If this vector's x, y or z value is less than the given vector's x, y or z + * value, replace that value with the corresponding max value. + * + * @param {Vector3} v - The vector. + * @return {Vector3} A reference to this vector. + */ + max(v: Vector3): Vector3; + /** + * If this vector's x, y or z value is greater than the max vector's x, y or z + * value, it is replaced by the corresponding value. + * If this vector's x, y or z value is less than the min vector's x, y or z value, + * it is replaced by the corresponding value. + * + * @param {Vector3} min - The minimum x, y and z values. + * @param {Vector3} max - The maximum x, y and z values in the desired range. + * @return {Vector3} A reference to this vector. + */ + clamp(min: Vector3, max: Vector3): Vector3; + /** + * If this vector's x, y or z values are greater than the max value, they are + * replaced by the max value. + * If this vector's x, y or z values are less than the min value, they are + * replaced by the min value. + * + * @param {number} minVal - The minimum value the components will be clamped to. + * @param {number} maxVal - The maximum value the components will be clamped to. + * @return {Vector3} A reference to this vector. + */ + clampScalar(minVal: number, maxVal: number): Vector3; + /** + * If this vector's length is greater than the max value, it is replaced by + * the max value. + * If this vector's length is less than the min value, it is replaced by the + * min value. + * + * @param {number} min - The minimum value the vector length will be clamped to. + * @param {number} max - The maximum value the vector length will be clamped to. + * @return {Vector3} A reference to this vector. + */ + clampLength(min: number, max: number): Vector3; + /** + * The components of this vector are rounded down to the nearest integer value. + * + * @return {Vector3} A reference to this vector. + */ + floor(): Vector3; + /** + * The components of this vector are rounded up to the nearest integer value. + * + * @return {Vector3} A reference to this vector. + */ + ceil(): Vector3; + /** + * The components of this vector are rounded to the nearest integer value + * + * @return {Vector3} A reference to this vector. + */ + round(): Vector3; + /** + * The components of this vector are rounded towards zero (up if negative, + * down if positive) to an integer value. + * + * @return {Vector3} A reference to this vector. + */ + roundToZero(): Vector3; + /** + * Inverts this vector - i.e. sets x = -x, y = -y and z = -z. + * + * @return {Vector3} A reference to this vector. + */ + negate(): Vector3; + /** + * Calculates the dot product of the given vector with this instance. + * + * @param {Vector3} v - The vector to compute the dot product with. + * @return {number} The result of the dot product. + */ + dot(v: Vector3): number; + /** + * Computes the square of the Euclidean length (straight-line length) from + * (0, 0, 0) to (x, y, z). If you are comparing the lengths of vectors, you should + * compare the length squared instead as it is slightly more efficient to calculate. + * + * @return {number} The square length of this vector. + */ + lengthSq(): number; + /** + * Computes the Euclidean length (straight-line length) from (0, 0, 0) to (x, y, z). + * + * @return {number} The length of this vector. + */ + length(): number; + /** + * Computes the Manhattan length of this vector. + * + * @return {number} The length of this vector. + */ + manhattanLength(): number; + /** + * Converts this vector to a unit vector - that is, sets it equal to a vector + * with the same direction as this one, but with a vector length of `1`. + * + * @return {Vector3} A reference to this vector. + */ + normalize(): Vector3; + /** + * Sets this vector to a vector with the same direction as this one, but + * with the specified length. + * + * @param {number} length - The new length of this vector. + * @return {Vector3} A reference to this vector. + */ + setLength(length: number): Vector3; + /** + * Linearly interpolates between the given vector and this instance, where + * alpha is the percent distance along the line - alpha = 0 will be this + * vector, and alpha = 1 will be the given one. + * + * @param {Vector3} v - The vector to interpolate towards. + * @param {number} alpha - The interpolation factor, typically in the closed interval `[0, 1]`. + * @return {Vector3} A reference to this vector. + */ + lerp(v: Vector3, alpha: number): Vector3; + /** + * Linearly interpolates between the given vectors, where alpha is the percent + * distance along the line - alpha = 0 will be first vector, and alpha = 1 will + * be the second one. The result is stored in this instance. + * + * @param {Vector3} v1 - The first vector. + * @param {Vector3} v2 - The second vector. + * @param {number} alpha - The interpolation factor, typically in the closed interval `[0, 1]`. + * @return {Vector3} A reference to this vector. + */ + lerpVectors(v1: Vector3, v2: Vector3, alpha: number): Vector3; + /** + * Calculates the cross product of the given vector with this instance. + * + * @param {Vector3} v - The vector to compute the cross product with. + * @return {Vector3} The result of the cross product. + */ + cross(v: Vector3): Vector3; + /** + * Calculates the cross product of the given vectors and stores the result + * in this instance. + * + * @param {Vector3} a - The first vector. + * @param {Vector3} b - The second vector. + * @return {Vector3} A reference to this vector. + */ + crossVectors(a: Vector3, b: Vector3): Vector3; + /** + * Projects this vector onto the given one. + * + * @param {Vector3} v - The vector to project to. + * @return {Vector3} A reference to this vector. + */ + projectOnVector(v: Vector3): Vector3; + /** + * Projects this vector onto a plane by subtracting this + * vector projected onto the plane's normal from this vector. + * + * @param {Vector3} planeNormal - The plane normal. + * @return {Vector3} A reference to this vector. + */ + projectOnPlane(planeNormal: Vector3): Vector3; + /** + * Reflects this vector off a plane orthogonal to the given normal vector. + * + * @param {Vector3} normal - The (normalized) normal vector. + * @return {Vector3} A reference to this vector. + */ + reflect(normal: Vector3): Vector3; + /** + * Returns the angle between the given vector and this instance in radians. + * + * @param {Vector3} v - The vector to compute the angle with. + * @return {number} The angle in radians. + */ + angleTo(v: Vector3): number; + /** + * Computes the distance from the given vector to this instance. + * + * @param {Vector3} v - The vector to compute the distance to. + * @return {number} The distance. + */ + distanceTo(v: Vector3): number; + /** + * Computes the squared distance from the given vector to this instance. + * If you are just comparing the distance with another distance, you should compare + * the distance squared instead as it is slightly more efficient to calculate. + * + * @param {Vector3} v - The vector to compute the squared distance to. + * @return {number} The squared distance. + */ + distanceToSquared(v: Vector3): number; + /** + * Computes the Manhattan distance from the given vector to this instance. + * + * @param {Vector3} v - The vector to compute the Manhattan distance to. + * @return {number} The Manhattan distance. + */ + manhattanDistanceTo(v: Vector3): number; + /** + * Sets the vector components from the given spherical coordinates. + * + * @param {Spherical} s - The spherical coordinates. + * @return {Vector3} A reference to this vector. + */ + setFromSpherical(s: Spherical): Vector3; + /** + * Sets the vector components from the given spherical coordinates. + * + * @param {number} radius - The radius. + * @param {number} phi - The phi angle in radians. + * @param {number} theta - The theta angle in radians. + * @return {Vector3} A reference to this vector. + */ + setFromSphericalCoords(radius: number, phi: number, theta: number): Vector3; + /** + * Sets the vector components from the given cylindrical coordinates. + * + * @param {Cylindrical} c - The cylindrical coordinates. + * @return {Vector3} A reference to this vector. + */ + setFromCylindrical(c: Cylindrical): Vector3; + /** + * Sets the vector components from the given cylindrical coordinates. + * + * @param {number} radius - The radius. + * @param {number} theta - The theta angle in radians. + * @param {number} y - The y value. + * @return {Vector3} A reference to this vector. + */ + setFromCylindricalCoords(radius: number, theta: number, y: number): Vector3; + /** + * Sets the vector components to the position elements of the + * given transformation matrix. + * + * @param {Matrix4} m - The 4x4 matrix. + * @return {Vector3} A reference to this vector. + */ + setFromMatrixPosition(m: Matrix4): Vector3; + /** + * Sets the vector components to the scale elements of the + * given transformation matrix. + * + * @param {Matrix4} m - The 4x4 matrix. + * @return {Vector3} A reference to this vector. + */ + setFromMatrixScale(m: Matrix4): Vector3; + /** + * Sets the vector components from the specified matrix column. + * + * @param {Matrix4} m - The 4x4 matrix. + * @param {number} index - The column index. + * @return {Vector3} A reference to this vector. + */ + setFromMatrixColumn(m: Matrix4, index: number): Vector3; + /** + * Sets the vector components from the specified matrix column. + * + * @param {Matrix3} m - The 3x3 matrix. + * @param {number} index - The column index. + * @return {Vector3} A reference to this vector. + */ + setFromMatrix3Column(m: Matrix3, index: number): Vector3; + /** + * Sets the vector components from the given Euler angles. + * + * @param {Euler} e - The Euler angles to set. + * @return {Vector3} A reference to this vector. + */ + setFromEuler(e: Euler): Vector3; + /** + * Sets the vector components from the RGB components of the + * given color. + * + * @param {Color} c - The color to set. + * @return {Vector3} A reference to this vector. + */ + setFromColor(c: Color): Vector3; + /** + * Returns `true` if this vector is equal with the given one. + * + * @param {Vector3} v - The vector to test for equality. + * @return {boolean} Whether this vector is equal with the given one. + */ + equals(v: Vector3): boolean; + /** + * Sets this vector's x value to be `array[ offset ]`, y value to be `array[ offset + 1 ]` + * and z value to be `array[ offset + 2 ]`. + * + * @param {Array} array - An array holding the vector component values. + * @param {number} [offset=0] - The offset into the array. + * @return {Vector3} A reference to this vector. + */ + fromArray(array: Array, offset?: number): Vector3; + /** + * Writes the components of this vector to the given array. If no array is provided, + * the method returns a new instance. + * + * @param {Array} [array=[]] - The target array holding the vector components. + * @param {number} [offset=0] - Index of the first element in the array. + * @return {Array} The vector components. + */ + toArray(array?: Array, offset?: number): Array; + /** + * Sets the components of this vector from the given buffer attribute. + * + * @param {BufferAttribute} attribute - The buffer attribute holding vector data. + * @param {number} index - The index into the attribute. + * @return {Vector3} A reference to this vector. + */ + fromBufferAttribute(attribute: BufferAttribute, index: number): Vector3; + /** + * Sets each component of this vector to a pseudo-random value between `0` and + * `1`, excluding `1`. + * + * @return {Vector3} A reference to this vector. + */ + random(): Vector3; + /** + * Sets this vector to a uniformly random point on a unit sphere. + * + * @return {Vector3} A reference to this vector. + */ + randomDirection(): Vector3; + [Symbol.iterator](): Generator; +} +import { Quaternion } from './Quaternion.js'; diff --git a/jsdoc-testing/jsdoc/math/Vector4.d.ts b/jsdoc-testing/jsdoc/math/Vector4.d.ts new file mode 100644 index 000000000..2360be77d --- /dev/null +++ b/jsdoc-testing/jsdoc/math/Vector4.d.ts @@ -0,0 +1,443 @@ +/** + * Class representing a 4D vector. A 4D vector is an ordered quadruplet of numbers + * (labeled x, y, z and w), which can be used to represent a number of things, such as: + * + * - A point in 4D space. + * - A direction and length in 4D space. In three.js the length will + * always be the Euclidean distance(straight-line distance) from `(0, 0, 0, 0)` to `(x, y, z, w)` + * and the direction is also measured from `(0, 0, 0, 0)` towards `(x, y, z, w)`. + * - Any arbitrary ordered quadruplet of numbers. + * + * There are other things a 4D vector can be used to represent, however these + * are the most common uses in *three.js*. + * + * Iterating through a vector instance will yield its components `(x, y, z, w)` in + * the corresponding order. + * ```js + * const a = new THREE.Vector4( 0, 1, 0, 0 ); + * + * //no arguments; will be initialised to (0, 0, 0, 1) + * const b = new THREE.Vector4( ); + * + * const d = a.dot( b ); + * ``` + */ +export class Vector4 { + /** + * Constructs a new 4D vector. + * + * @param {number} [x=0] - The x value of this vector. + * @param {number} [y=0] - The y value of this vector. + * @param {number} [z=0] - The z value of this vector. + * @param {number} [w=1] - The w value of this vector. + */ + constructor(x?: number, y?: number, z?: number, w?: number); + /** + * The x value of this vector. + * + * @type {number} + */ + x: number; + /** + * The y value of this vector. + * + * @type {number} + */ + y: number; + /** + * The z value of this vector. + * + * @type {number} + */ + z: number; + /** + * The w value of this vector. + * + * @type {number} + */ + w: number; + set width(value: number); + /** + * Alias for {@link Vector4#z}. + * + * @type {number} + */ + get width(): number; + set height(value: number); + /** + * Alias for {@link Vector4#w}. + * + * @type {number} + */ + get height(): number; + /** + * Sets the vector components. + * + * @param {number} x - The value of the x component. + * @param {number} y - The value of the y component. + * @param {number} z - The value of the z component. + * @param {number} w - The value of the w component. + * @return {Vector4} A reference to this vector. + */ + set(x: number, y: number, z: number, w: number): Vector4; + /** + * Sets the vector components to the same value. + * + * @param {number} scalar - The value to set for all vector components. + * @return {Vector4} A reference to this vector. + */ + setScalar(scalar: number): Vector4; + /** + * Sets the vector's x component to the given value + * + * @param {number} x - The value to set. + * @return {Vector4} A reference to this vector. + */ + setX(x: number): Vector4; + /** + * Sets the vector's y component to the given value + * + * @param {number} y - The value to set. + * @return {Vector4} A reference to this vector. + */ + setY(y: number): Vector4; + /** + * Sets the vector's z component to the given value + * + * @param {number} z - The value to set. + * @return {Vector4} A reference to this vector. + */ + setZ(z: number): Vector4; + /** + * Sets the vector's w component to the given value + * + * @param {number} w - The value to set. + * @return {Vector4} A reference to this vector. + */ + setW(w: number): Vector4; + /** + * Allows to set a vector component with an index. + * + * @param {number} index - The component index. `0` equals to x, `1` equals to y, + * `2` equals to z, `3` equals to w. + * @param {number} value - The value to set. + * @return {Vector4} A reference to this vector. + */ + setComponent(index: number, value: number): Vector4; + /** + * Returns the value of the vector component which matches the given index. + * + * @param {number} index - The component index. `0` equals to x, `1` equals to y, + * `2` equals to z, `3` equals to w. + * @return {number} A vector component value. + */ + getComponent(index: number): number; + /** + * Returns a new vector with copied values from this instance. + * + * @return {Vector4} A clone of this instance. + */ + clone(): Vector4; + /** + * Copies the values of the given vector to this instance. + * + * @param {Vector3|Vector4} v - The vector to copy. + * @return {Vector4} A reference to this vector. + */ + copy(v: Vector3 | Vector4): Vector4; + /** + * Adds the given vector to this instance. + * + * @param {Vector4} v - The vector to add. + * @return {Vector4} A reference to this vector. + */ + add(v: Vector4): Vector4; + /** + * Adds the given scalar value to all components of this instance. + * + * @param {number} s - The scalar to add. + * @return {Vector4} A reference to this vector. + */ + addScalar(s: number): Vector4; + /** + * Adds the given vectors and stores the result in this instance. + * + * @param {Vector4} a - The first vector. + * @param {Vector4} b - The second vector. + * @return {Vector4} A reference to this vector. + */ + addVectors(a: Vector4, b: Vector4): Vector4; + /** + * Adds the given vector scaled by the given factor to this instance. + * + * @param {Vector4} v - The vector. + * @param {number} s - The factor that scales `v`. + * @return {Vector4} A reference to this vector. + */ + addScaledVector(v: Vector4, s: number): Vector4; + /** + * Subtracts the given vector from this instance. + * + * @param {Vector4} v - The vector to subtract. + * @return {Vector4} A reference to this vector. + */ + sub(v: Vector4): Vector4; + /** + * Subtracts the given scalar value from all components of this instance. + * + * @param {number} s - The scalar to subtract. + * @return {Vector4} A reference to this vector. + */ + subScalar(s: number): Vector4; + /** + * Subtracts the given vectors and stores the result in this instance. + * + * @param {Vector4} a - The first vector. + * @param {Vector4} b - The second vector. + * @return {Vector4} A reference to this vector. + */ + subVectors(a: Vector4, b: Vector4): Vector4; + /** + * Multiplies the given vector with this instance. + * + * @param {Vector4} v - The vector to multiply. + * @return {Vector4} A reference to this vector. + */ + multiply(v: Vector4): Vector4; + /** + * Multiplies the given scalar value with all components of this instance. + * + * @param {number} scalar - The scalar to multiply. + * @return {Vector4} A reference to this vector. + */ + multiplyScalar(scalar: number): Vector4; + /** + * Multiplies this vector with the given 4x4 matrix. + * + * @param {Matrix4} m - The 4x4 matrix. + * @return {Vector4} A reference to this vector. + */ + applyMatrix4(m: Matrix4): Vector4; + /** + * Divides this instance by the given vector. + * + * @param {Vector4} v - The vector to divide. + * @return {Vector4} A reference to this vector. + */ + divide(v: Vector4): Vector4; + /** + * Divides this vector by the given scalar. + * + * @param {number} scalar - The scalar to divide. + * @return {Vector4} A reference to this vector. + */ + divideScalar(scalar: number): Vector4; + /** + * Sets the x, y and z components of this + * vector to the quaternion's axis and w to the angle. + * + * @param {Quaternion} q - The Quaternion to set. + * @return {Vector4} A reference to this vector. + */ + setAxisAngleFromQuaternion(q: Quaternion): Vector4; + /** + * Sets the x, y and z components of this + * vector to the axis of rotation and w to the angle. + * + * @param {Matrix4} m - A 4x4 matrix of which the upper left 3x3 matrix is a pure rotation matrix. + * @return {Vector4} A reference to this vector. + */ + setAxisAngleFromRotationMatrix(m: Matrix4): Vector4; + /** + * Sets the vector components to the position elements of the + * given transformation matrix. + * + * @param {Matrix4} m - The 4x4 matrix. + * @return {Vector4} A reference to this vector. + */ + setFromMatrixPosition(m: Matrix4): Vector4; + /** + * If this vector's x, y, z or w value is greater than the given vector's x, y, z or w + * value, replace that value with the corresponding min value. + * + * @param {Vector4} v - The vector. + * @return {Vector4} A reference to this vector. + */ + min(v: Vector4): Vector4; + /** + * If this vector's x, y, z or w value is less than the given vector's x, y, z or w + * value, replace that value with the corresponding max value. + * + * @param {Vector4} v - The vector. + * @return {Vector4} A reference to this vector. + */ + max(v: Vector4): Vector4; + /** + * If this vector's x, y, z or w value is greater than the max vector's x, y, z or w + * value, it is replaced by the corresponding value. + * If this vector's x, y, z or w value is less than the min vector's x, y, z or w value, + * it is replaced by the corresponding value. + * + * @param {Vector4} min - The minimum x, y and z values. + * @param {Vector4} max - The maximum x, y and z values in the desired range. + * @return {Vector4} A reference to this vector. + */ + clamp(min: Vector4, max: Vector4): Vector4; + /** + * If this vector's x, y, z or w values are greater than the max value, they are + * replaced by the max value. + * If this vector's x, y, z or w values are less than the min value, they are + * replaced by the min value. + * + * @param {number} minVal - The minimum value the components will be clamped to. + * @param {number} maxVal - The maximum value the components will be clamped to. + * @return {Vector4} A reference to this vector. + */ + clampScalar(minVal: number, maxVal: number): Vector4; + /** + * If this vector's length is greater than the max value, it is replaced by + * the max value. + * If this vector's length is less than the min value, it is replaced by the + * min value. + * + * @param {number} min - The minimum value the vector length will be clamped to. + * @param {number} max - The maximum value the vector length will be clamped to. + * @return {Vector4} A reference to this vector. + */ + clampLength(min: number, max: number): Vector4; + /** + * The components of this vector are rounded down to the nearest integer value. + * + * @return {Vector4} A reference to this vector. + */ + floor(): Vector4; + /** + * The components of this vector are rounded up to the nearest integer value. + * + * @return {Vector4} A reference to this vector. + */ + ceil(): Vector4; + /** + * The components of this vector are rounded to the nearest integer value + * + * @return {Vector4} A reference to this vector. + */ + round(): Vector4; + /** + * The components of this vector are rounded towards zero (up if negative, + * down if positive) to an integer value. + * + * @return {Vector4} A reference to this vector. + */ + roundToZero(): Vector4; + /** + * Inverts this vector - i.e. sets x = -x, y = -y, z = -z, w = -w. + * + * @return {Vector4} A reference to this vector. + */ + negate(): Vector4; + /** + * Calculates the dot product of the given vector with this instance. + * + * @param {Vector4} v - The vector to compute the dot product with. + * @return {number} The result of the dot product. + */ + dot(v: Vector4): number; + /** + * Computes the square of the Euclidean length (straight-line length) from + * (0, 0, 0, 0) to (x, y, z, w). If you are comparing the lengths of vectors, you should + * compare the length squared instead as it is slightly more efficient to calculate. + * + * @return {number} The square length of this vector. + */ + lengthSq(): number; + /** + * Computes the Euclidean length (straight-line length) from (0, 0, 0, 0) to (x, y, z, w). + * + * @return {number} The length of this vector. + */ + length(): number; + /** + * Computes the Manhattan length of this vector. + * + * @return {number} The length of this vector. + */ + manhattanLength(): number; + /** + * Converts this vector to a unit vector - that is, sets it equal to a vector + * with the same direction as this one, but with a vector length of `1`. + * + * @return {Vector4} A reference to this vector. + */ + normalize(): Vector4; + /** + * Sets this vector to a vector with the same direction as this one, but + * with the specified length. + * + * @param {number} length - The new length of this vector. + * @return {Vector4} A reference to this vector. + */ + setLength(length: number): Vector4; + /** + * Linearly interpolates between the given vector and this instance, where + * alpha is the percent distance along the line - alpha = 0 will be this + * vector, and alpha = 1 will be the given one. + * + * @param {Vector4} v - The vector to interpolate towards. + * @param {number} alpha - The interpolation factor, typically in the closed interval `[0, 1]`. + * @return {Vector4} A reference to this vector. + */ + lerp(v: Vector4, alpha: number): Vector4; + /** + * Linearly interpolates between the given vectors, where alpha is the percent + * distance along the line - alpha = 0 will be first vector, and alpha = 1 will + * be the second one. The result is stored in this instance. + * + * @param {Vector4} v1 - The first vector. + * @param {Vector4} v2 - The second vector. + * @param {number} alpha - The interpolation factor, typically in the closed interval `[0, 1]`. + * @return {Vector4} A reference to this vector. + */ + lerpVectors(v1: Vector4, v2: Vector4, alpha: number): Vector4; + /** + * Returns `true` if this vector is equal with the given one. + * + * @param {Vector4} v - The vector to test for equality. + * @return {boolean} Whether this vector is equal with the given one. + */ + equals(v: Vector4): boolean; + /** + * Sets this vector's x value to be `array[ offset ]`, y value to be `array[ offset + 1 ]`, + * z value to be `array[ offset + 2 ]`, w value to be `array[ offset + 3 ]`. + * + * @param {Array} array - An array holding the vector component values. + * @param {number} [offset=0] - The offset into the array. + * @return {Vector4} A reference to this vector. + */ + fromArray(array: Array, offset?: number): Vector4; + /** + * Writes the components of this vector to the given array. If no array is provided, + * the method returns a new instance. + * + * @param {Array} [array=[]] - The target array holding the vector components. + * @param {number} [offset=0] - Index of the first element in the array. + * @return {Array} The vector components. + */ + toArray(array?: Array, offset?: number): Array; + /** + * Sets the components of this vector from the given buffer attribute. + * + * @param {BufferAttribute} attribute - The buffer attribute holding vector data. + * @param {number} index - The index into the attribute. + * @return {Vector4} A reference to this vector. + */ + fromBufferAttribute(attribute: BufferAttribute, index: number): Vector4; + /** + * Sets each component of this vector to a pseudo-random value between `0` and + * `1`, excluding `1`. + * + * @return {Vector4} A reference to this vector. + */ + random(): Vector4; + [Symbol.iterator](): Generator; +} diff --git a/jsdoc-testing/jsdoc/math/interpolants/BezierInterpolant.d.ts b/jsdoc-testing/jsdoc/math/interpolants/BezierInterpolant.d.ts new file mode 100644 index 000000000..445b0e1f5 --- /dev/null +++ b/jsdoc-testing/jsdoc/math/interpolants/BezierInterpolant.d.ts @@ -0,0 +1,22 @@ +/** + * A Bezier interpolant using cubic Bezier curves with 2D control points. + * + * This interpolant supports the COLLADA/Maya style of Bezier animation where + * each keyframe has explicit in/out tangent control points specified as + * 2D coordinates (time, value). + * + * The tangent data must be provided via the `settings` object: + * - `settings.inTangents`: Float32Array with [time, value] pairs per keyframe per component + * - `settings.outTangents`: Float32Array with [time, value] pairs per keyframe per component + * + * For a track with N keyframes and stride S: + * - Each tangent array has N * S * 2 values + * - Layout: [k0_c0_time, k0_c0_value, k0_c1_time, k0_c1_value, ..., k0_cS_time, k0_cS_value, + * k1_c0_time, k1_c0_value, ...] + * + * @augments Interpolant + */ +export class BezierInterpolant extends Interpolant { + interpolate_(i1: any, t0: any, t: any, t1: any): TypedArray; +} +import { Interpolant } from '../Interpolant.js'; diff --git a/jsdoc-testing/jsdoc/math/interpolants/CubicInterpolant.d.ts b/jsdoc-testing/jsdoc/math/interpolants/CubicInterpolant.d.ts new file mode 100644 index 000000000..ca53c5e9a --- /dev/null +++ b/jsdoc-testing/jsdoc/math/interpolants/CubicInterpolant.d.ts @@ -0,0 +1,22 @@ +/** + * Fast and simple cubic spline interpolant. + * + * It was derived from a Hermitian construction setting the first derivative + * at each sample position to the linear slope between neighboring positions + * over their parameter interval. + * + * @augments Interpolant + */ +export class CubicInterpolant extends Interpolant { + _weightPrev: number; + _offsetPrev: number; + _weightNext: number; + _offsetNext: number; + DefaultSettings_: { + endingStart: number; + endingEnd: number; + }; + intervalChanged_(i1: any, t0: any, t1: any): void; + interpolate_(i1: any, t0: any, t: any, t1: any): TypedArray; +} +import { Interpolant } from '../Interpolant.js'; diff --git a/jsdoc-testing/jsdoc/math/interpolants/DiscreteInterpolant.d.ts b/jsdoc-testing/jsdoc/math/interpolants/DiscreteInterpolant.d.ts new file mode 100644 index 000000000..04ce01eb6 --- /dev/null +++ b/jsdoc-testing/jsdoc/math/interpolants/DiscreteInterpolant.d.ts @@ -0,0 +1,10 @@ +/** + * Interpolant that evaluates to the sample value at the position preceding + * the parameter. + * + * @augments Interpolant + */ +export class DiscreteInterpolant extends Interpolant { + interpolate_(i1: any): TypedArray; +} +import { Interpolant } from '../Interpolant.js'; diff --git a/jsdoc-testing/jsdoc/math/interpolants/LinearInterpolant.d.ts b/jsdoc-testing/jsdoc/math/interpolants/LinearInterpolant.d.ts new file mode 100644 index 000000000..d36003868 --- /dev/null +++ b/jsdoc-testing/jsdoc/math/interpolants/LinearInterpolant.d.ts @@ -0,0 +1,9 @@ +/** + * A basic linear interpolant. + * + * @augments Interpolant + */ +export class LinearInterpolant extends Interpolant { + interpolate_(i1: any, t0: any, t: any, t1: any): TypedArray; +} +import { Interpolant } from '../Interpolant.js'; diff --git a/jsdoc-testing/jsdoc/math/interpolants/QuaternionLinearInterpolant.d.ts b/jsdoc-testing/jsdoc/math/interpolants/QuaternionLinearInterpolant.d.ts new file mode 100644 index 000000000..e8ddddc6e --- /dev/null +++ b/jsdoc-testing/jsdoc/math/interpolants/QuaternionLinearInterpolant.d.ts @@ -0,0 +1,9 @@ +/** + * Spherical linear unit quaternion interpolant. + * + * @augments Interpolant + */ +export class QuaternionLinearInterpolant extends Interpolant { + interpolate_(i1: any, t0: any, t: any, t1: any): TypedArray; +} +import { Interpolant } from '../Interpolant.js'; diff --git a/jsdoc-testing/jsdoc/nodes/Nodes.d.ts b/jsdoc-testing/jsdoc/nodes/Nodes.d.ts new file mode 100644 index 000000000..5fb46b9ae --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/Nodes.d.ts @@ -0,0 +1,140 @@ +export * from "./core/constants.js"; +export { default as ArrayNode } from "./core/ArrayNode.js"; +export { default as AssignNode } from "./core/AssignNode.js"; +export { default as AttributeNode } from "./core/AttributeNode.js"; +export { default as BypassNode } from "./core/BypassNode.js"; +export { default as ConstNode } from "./core/ConstNode.js"; +export { default as ContextNode } from "./core/ContextNode.js"; +export { default as IndexNode } from "./core/IndexNode.js"; +export { default as InputNode } from "./core/InputNode.js"; +export { default as InspectorNode } from "./core/InspectorNode.js"; +export { default as IsolateNode } from "./core/IsolateNode.js"; +export { default as LightingModel } from "./core/LightingModel.js"; +export { default as MRTNode } from "./core/MRTNode.js"; +export { default as Node } from "./core/Node.js"; +export { default as NodeAttribute } from "./core/NodeAttribute.js"; +export { default as NodeBuilder } from "./core/NodeBuilder.js"; +export { default as NodeCache } from "./core/NodeCache.js"; +export { default as NodeCode } from "./core/NodeCode.js"; +export { default as NodeError } from "./core/NodeError.js"; +export { default as NodeFrame } from "./core/NodeFrame.js"; +export { default as NodeFunctionInput } from "./core/NodeFunctionInput.js"; +export { default as NodeUniform } from "./core/NodeUniform.js"; +export { default as NodeVar } from "./core/NodeVar.js"; +export { default as NodeVarying } from "./core/NodeVarying.js"; +export { default as OutputStructNode } from "./core/OutputStructNode.js"; +export { default as ParameterNode } from "./core/ParameterNode.js"; +export { default as PropertyNode } from "./core/PropertyNode.js"; +export { default as StackNode } from "./core/StackNode.js"; +export { default as StackTrace } from "./core/StackTrace.js"; +export { default as StructNode } from "./core/StructNode.js"; +export { default as StructTypeNode } from "./core/StructTypeNode.js"; +export { default as SubBuildNode } from "./core/SubBuildNode.js"; +export { default as TempNode } from "./core/TempNode.js"; +export { default as UniformGroupNode } from "./core/UniformGroupNode.js"; +export { default as UniformNode } from "./core/UniformNode.js"; +export { default as VarNode } from "./core/VarNode.js"; +export { default as VaryingNode } from "./core/VaryingNode.js"; +export { NodeUtils }; +export { default as BatchNode } from "./accessors/BatchNode.js"; +export { default as BufferAttributeNode } from "./accessors/BufferAttributeNode.js"; +export { default as BufferNode } from "./accessors/BufferNode.js"; +export { default as BuiltinNode } from "./accessors/BuiltinNode.js"; +export { default as ClippingNode } from "./accessors/ClippingNode.js"; +export { default as CubeTextureNode } from "./accessors/CubeTextureNode.js"; +export { default as InstanceNode } from "./accessors/InstanceNode.js"; +export { default as InstancedMeshNode } from "./accessors/InstancedMeshNode.js"; +export { default as MaterialNode } from "./accessors/MaterialNode.js"; +export { default as MaterialReferenceNode } from "./accessors/MaterialReferenceNode.js"; +export { default as ModelNode } from "./accessors/ModelNode.js"; +export { default as MorphNode } from "./accessors/MorphNode.js"; +export { default as Object3DNode } from "./accessors/Object3DNode.js"; +export { default as PointUVNode } from "./accessors/PointUVNode.js"; +export { default as ReferenceBaseNode } from "./accessors/ReferenceBaseNode.js"; +export { default as ReferenceNode } from "./accessors/ReferenceNode.js"; +export { default as RendererReferenceNode } from "./accessors/RendererReferenceNode.js"; +export { default as SkinningNode } from "./accessors/SkinningNode.js"; +export { default as StorageBufferNode } from "./accessors/StorageBufferNode.js"; +export { default as StorageTextureNode } from "./accessors/StorageTextureNode.js"; +export { default as Texture3DNode } from "./accessors/Texture3DNode.js"; +export { default as TextureNode } from "./accessors/TextureNode.js"; +export { default as TextureSizeNode } from "./accessors/TextureSizeNode.js"; +export { default as UniformArrayNode } from "./accessors/UniformArrayNode.js"; +export { default as UserDataNode } from "./accessors/UserDataNode.js"; +export { default as VelocityNode } from "./accessors/VelocityNode.js"; +export { default as VertexColorNode } from "./accessors/VertexColorNode.js"; +export { default as CodeNode } from "./code/CodeNode.js"; +export { default as ExpressionNode } from "./code/ExpressionNode.js"; +export { default as FunctionCallNode } from "./code/FunctionCallNode.js"; +export { default as FunctionNode } from "./code/FunctionNode.js"; +export { default as BumpMapNode } from "./display/BumpMapNode.js"; +export { default as ColorSpaceNode } from "./display/ColorSpaceNode.js"; +export { default as FrontFacingNode } from "./display/FrontFacingNode.js"; +export { default as NormalMapNode } from "./display/NormalMapNode.js"; +export { default as PassNode } from "./display/PassNode.js"; +export { default as RenderOutputNode } from "./display/RenderOutputNode.js"; +export { default as ScreenNode } from "./display/ScreenNode.js"; +export { default as ToneMappingNode } from "./display/ToneMappingNode.js"; +export { default as ToonOutlinePassNode } from "./display/ToonOutlinePassNode.js"; +export { default as ViewportDepthNode } from "./display/ViewportDepthNode.js"; +export { default as ViewportDepthTextureNode } from "./display/ViewportDepthTextureNode.js"; +export { default as ViewportSharedTextureNode } from "./display/ViewportSharedTextureNode.js"; +export { default as ViewportTextureNode } from "./display/ViewportTextureNode.js"; +export { default as RangeNode } from "./geometry/RangeNode.js"; +export { default as AtomicFunctionNode } from "./gpgpu/AtomicFunctionNode.js"; +export { default as BarrierNode } from "./gpgpu/BarrierNode.js"; +export { default as ComputeBuiltinNode } from "./gpgpu/ComputeBuiltinNode.js"; +export { default as ComputeNode } from "./gpgpu/ComputeNode.js"; +export { default as SubgroupFunctionNode } from "./gpgpu/SubgroupFunctionNode.js"; +export { default as WorkgroupInfoNode } from "./gpgpu/WorkgroupInfoNode.js"; +export { default as AmbientLightNode } from "./lighting/AmbientLightNode.js"; +export { default as AnalyticLightNode } from "./lighting/AnalyticLightNode.js"; +export { default as AONode } from "./lighting/AONode.js"; +export { default as BasicEnvironmentNode } from "./lighting/BasicEnvironmentNode.js"; +export { default as BasicLightMapNode } from "./lighting/BasicLightMapNode.js"; +export { default as DirectionalLightNode } from "./lighting/DirectionalLightNode.js"; +export { default as EnvironmentNode } from "./lighting/EnvironmentNode.js"; +export { default as HemisphereLightNode } from "./lighting/HemisphereLightNode.js"; +export { default as IESSpotLightNode } from "./lighting/IESSpotLightNode.js"; +export { default as IrradianceNode } from "./lighting/IrradianceNode.js"; +export { default as LightingContextNode } from "./lighting/LightingContextNode.js"; +export { default as LightingNode } from "./lighting/LightingNode.js"; +export { default as LightProbeNode } from "./lighting/LightProbeNode.js"; +export { default as LightsNode } from "./lighting/LightsNode.js"; +export { default as PointLightNode } from "./lighting/PointLightNode.js"; +export { default as PointShadowNode } from "./lighting/PointShadowNode.js"; +export { default as ProjectorLightNode } from "./lighting/ProjectorLightNode.js"; +export { default as RectAreaLightNode } from "./lighting/RectAreaLightNode.js"; +export { default as ShadowBaseNode } from "./lighting/ShadowBaseNode.js"; +export { default as ShadowNode } from "./lighting/ShadowNode.js"; +export { default as SpotLightNode } from "./lighting/SpotLightNode.js"; +export { default as BitcastNode } from "./math/BitcastNode.js"; +export { default as BitcountNode } from "./math/BitcountNode.js"; +export { default as ConditionalNode } from "./math/ConditionalNode.js"; +export { default as MathNode } from "./math/MathNode.js"; +export { default as OperatorNode } from "./math/OperatorNode.js"; +export { default as PackFloatNode } from "./math/PackFloatNode.js"; +export { default as UnpackFloatNode } from "./math/UnpackFloatNode.js"; +export { default as GLSLNodeParser } from "./parsers/GLSLNodeParser.js"; +export { default as PMREMNode } from "./pmrem/PMREMNode.js"; +export { default as ArrayElementNode } from "./utils/ArrayElementNode.js"; +export { default as ConvertNode } from "./utils/ConvertNode.js"; +export { default as CubeMapNode } from "./utils/CubeMapNode.js"; +export { default as DebugNode } from "./utils/DebugNode.js"; +export { default as EventNode } from "./utils/EventNode.js"; +export { default as FlipNode } from "./utils/FlipNode.js"; +export { default as FunctionOverloadingNode } from "./utils/FunctionOverloadingNode.js"; +export { default as JoinNode } from "./utils/JoinNode.js"; +export { default as LoopNode } from "./utils/LoopNode.js"; +export { default as MaxMipLevelNode } from "./utils/MaxMipLevelNode.js"; +export { default as MemberNode } from "./utils/MemberNode.js"; +export { default as ReflectorNode } from "./utils/ReflectorNode.js"; +export { default as RotateNode } from "./utils/RotateNode.js"; +export { default as RTTNode } from "./utils/RTTNode.js"; +export { default as SampleNode } from "./utils/SampleNode.js"; +export { default as SetNode } from "./utils/SetNode.js"; +export { default as SplitNode } from "./utils/SplitNode.js"; +export { default as StorageArrayElementNode } from "./utils/StorageArrayElementNode.js"; +export { default as PhongLightingModel } from "./functions/PhongLightingModel.js"; +export { default as PhysicalLightingModel } from "./functions/PhysicalLightingModel.js"; +import * as NodeUtils from './core/NodeUtils.js'; diff --git a/jsdoc-testing/jsdoc/nodes/TSL.d.ts b/jsdoc-testing/jsdoc/nodes/TSL.d.ts new file mode 100644 index 000000000..05540a297 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/TSL.d.ts @@ -0,0 +1,136 @@ +export * from "./core/constants.js"; +export * from "./core/AssignNode.js"; +export * from "./core/AttributeNode.js"; +export * from "./core/BypassNode.js"; +export * from "./core/IsolateNode.js"; +export * from "./core/ContextNode.js"; +export * from "./core/IndexNode.js"; +export * from "./core/ParameterNode.js"; +export * from "./core/PropertyNode.js"; +export * from "./core/StackNode.js"; +export * from "./core/StructNode.js"; +export * from "./core/UniformGroupNode.js"; +export * from "./core/UniformNode.js"; +export * from "./core/VaryingNode.js"; +export * from "./core/OutputStructNode.js"; +export * from "./core/MRTNode.js"; +export * from "./math/BitcastNode.js"; +export * from "./math/BitcountNode.js"; +export * from "./math/Hash.js"; +export * from "./math/MathUtils.js"; +export * from "./math/PackFloatNode.js"; +export * from "./math/UnpackFloatNode.js"; +export * from "./math/TriNoise3D.js"; +export * from "./utils/EquirectUV.js"; +export * from "./utils/FunctionOverloadingNode.js"; +export * from "./utils/LoopNode.js"; +export * from "./utils/MatcapUV.js"; +export * from "./utils/MaxMipLevelNode.js"; +export * from "./utils/Oscillators.js"; +export * from "./utils/Packing.js"; +export * from "./utils/Remap.js"; +export * from "./utils/UVUtils.js"; +export * from "./utils/SpriteUtils.js"; +export * from "./utils/ViewportUtils.js"; +export * from "./utils/RotateNode.js"; +export * from "./utils/SpriteSheetUV.js"; +export * from "./utils/Timer.js"; +export * from "./utils/TriplanarTextures.js"; +export * from "./utils/ReflectorNode.js"; +export * from "./utils/RTTNode.js"; +export * from "./utils/PostProcessingUtils.js"; +export * from "./utils/SampleNode.js"; +export * from "./utils/EventNode.js"; +export * from "./tsl/TSLBase.js"; +export * from "./accessors/AccessorsUtils.js"; +export * from "./accessors/Arrays.js"; +export * from "./accessors/UniformArrayNode.js"; +export * from "./accessors/Bitangent.js"; +export * from "./accessors/BufferAttributeNode.js"; +export * from "./accessors/BufferNode.js"; +export * from "./accessors/BuiltinNode.js"; +export * from "./accessors/Camera.js"; +export * from "./accessors/VertexColorNode.js"; +export * from "./accessors/CubeTextureNode.js"; +export * from "./accessors/InstanceNode.js"; +export * from "./accessors/InstancedMeshNode.js"; +export * from "./accessors/BatchNode.js"; +export * from "./accessors/MaterialNode.js"; +export * from "./accessors/MaterialProperties.js"; +export * from "./accessors/MaterialReferenceNode.js"; +export * from "./accessors/RendererReferenceNode.js"; +export * from "./accessors/MorphNode.js"; +export * from "./accessors/TextureBicubic.js"; +export * from "./accessors/ModelNode.js"; +export * from "./accessors/ModelViewProjectionNode.js"; +export * from "./accessors/Normal.js"; +export * from "./accessors/Object3DNode.js"; +export * from "./accessors/PointUVNode.js"; +export * from "./accessors/Position.js"; +export * from "./accessors/ReferenceNode.js"; +export * from "./accessors/ReflectVector.js"; +export * from "./accessors/SkinningNode.js"; +export * from "./accessors/SceneProperties.js"; +export * from "./accessors/StorageBufferNode.js"; +export * from "./accessors/Tangent.js"; +export * from "./accessors/TextureNode.js"; +export * from "./accessors/TextureSizeNode.js"; +export * from "./accessors/StorageTextureNode.js"; +export * from "./accessors/Texture3DNode.js"; +export * from "./accessors/UV.js"; +export * from "./accessors/UserDataNode.js"; +export * from "./accessors/VelocityNode.js"; +export * from "./display/BlendModes.js"; +export * from "./display/BumpMapNode.js"; +export * from "./display/ColorAdjustment.js"; +export * from "./display/ColorSpaceNode.js"; +export * from "./display/FrontFacingNode.js"; +export * from "./display/NormalMapNode.js"; +export * from "./display/ToneMappingNode.js"; +export * from "./display/ScreenNode.js"; +export * from "./display/ViewportTextureNode.js"; +export * from "./display/ViewportSharedTextureNode.js"; +export * from "./display/ViewportDepthTextureNode.js"; +export * from "./display/ViewportDepthNode.js"; +export * from "./display/RenderOutputNode.js"; +export * from "./display/ToonOutlinePassNode.js"; +export * from "./display/PassNode.js"; +export * from "./display/ColorSpaceFunctions.js"; +export * from "./display/ToneMappingFunctions.js"; +export * from "./code/ExpressionNode.js"; +export * from "./code/CodeNode.js"; +export * from "./code/FunctionCallNode.js"; +export * from "./code/FunctionNode.js"; +export * from "./fog/Fog.js"; +export * from "./geometry/RangeNode.js"; +export * from "./gpgpu/ComputeNode.js"; +export * from "./gpgpu/ComputeBuiltinNode.js"; +export * from "./gpgpu/BarrierNode.js"; +export * from "./gpgpu/WorkgroupInfoNode.js"; +export * from "./gpgpu/AtomicFunctionNode.js"; +export * from "./gpgpu/SubgroupFunctionNode.js"; +export * from "./accessors/Lights.js"; +export * from "./lighting/LightsNode.js"; +export * from "./lighting/LightingContextNode.js"; +export * from "./lighting/ShadowBaseNode.js"; +export * from "./lighting/ShadowNode.js"; +export * from "./lighting/ShadowFilterNode.js"; +export * from "./lighting/PointShadowNode.js"; +export * from "./lighting/PointLightNode.js"; +export * from "./pmrem/PMREMNode.js"; +export * from "./pmrem/PMREMUtils.js"; +export * from "./procedural/Checker.js"; +export * from "./shapes/Shapes.js"; +export * from "./materialx/MaterialXNodes.js"; +export * from "./lighting/LightUtils.js"; +export { default as BRDF_GGX } from "./functions/BSDF/BRDF_GGX.js"; +export { default as BRDF_Lambert } from "./functions/BSDF/BRDF_Lambert.js"; +export { default as D_GGX } from "./functions/BSDF/D_GGX.js"; +export { default as DFGLUT } from "./functions/BSDF/DFGLUT.js"; +export { default as F_Schlick } from "./functions/BSDF/F_Schlick.js"; +export { default as Schlick_to_F0 } from "./functions/BSDF/Schlick_to_F0.js"; +export { default as V_GGX_SmithCorrelated } from "./functions/BSDF/V_GGX_SmithCorrelated.js"; +export { default as getGeometryRoughness } from "./functions/material/getGeometryRoughness.js"; +export { default as getParallaxCorrectNormal } from "./functions/material/getParallaxCorrectNormal.js"; +export { default as getRoughness } from "./functions/material/getRoughness.js"; +export { default as getShIrradianceAt } from "./functions/material/getShIrradianceAt.js"; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/AccessorsUtils.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/AccessorsUtils.d.ts new file mode 100644 index 000000000..07177caec --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/AccessorsUtils.d.ts @@ -0,0 +1,23 @@ +/** + * TSL object that represents the TBN matrix in view space. + * + * @tsl + * @type {Node} + */ +export const TBNViewMatrix: Node; +/** + * TSL object that represents the parallax direction. + * + * @tsl + * @type {Node} + */ +export const parallaxDirection: Node; +export function parallaxUV(uv: Node, scale: Node): Node; +/** + * TSL function for computing bent normals. + * + * @tsl + * @function + * @returns {Node} Bent normals. + */ +export const bentNormalView: any; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/Arrays.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/Arrays.d.ts new file mode 100644 index 000000000..6c9184803 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/Arrays.d.ts @@ -0,0 +1,2 @@ +export function attributeArray(count: number | TypedArray, type?: string | Struct): StorageBufferNode; +export function instancedArray(count: number | TypedArray, type?: string | Struct): StorageBufferNode; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/BatchNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/BatchNode.d.ts new file mode 100644 index 000000000..1fa7fd4cc --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/BatchNode.d.ts @@ -0,0 +1,47 @@ +export default BatchNode; +/** + * TSL function for creating a batch node. + * + * @tsl + * @function + * @param {BatchedMesh} batchMesh - A reference to batched mesh. + * @returns {BatchNode} + */ +export const batch: any; +/** + * This node implements the vertex shader logic which is required + * when rendering 3D objects via batching. `BatchNode` must be used + * with instances of {@link BatchedMesh}. + * + * @augments Node + */ +declare class BatchNode extends Node { + /** + * Constructs a new batch node. + * + * @param {BatchedMesh} batchMesh - A reference to batched mesh. + */ + constructor(batchMesh: BatchedMesh); + /** + * A reference to batched mesh. + * + * @type {BatchedMesh} + */ + batchMesh: BatchedMesh; + /** + * The batching index node. + * + * @type {?IndexNode} + * @default null + */ + batchingIdNode: IndexNode | null; + /** + * Setups the internal buffers and nodes and assigns the transformed vertex data + * to predefined node variables for accumulation. That follows the same patterns + * like with morph and skinning nodes. + * + * @param {NodeBuilder} builder - The current node builder. + */ + setup(builder: NodeBuilder): void; +} +import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/Bitangent.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/Bitangent.d.ts new file mode 100644 index 000000000..7694a53fc --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/Bitangent.d.ts @@ -0,0 +1,28 @@ +/** + * TSL object that represents the bitangent attribute of the current rendered object. + * + * @tsl + * @type {Node} + */ +export const bitangentGeometry: Node; +/** + * TSL object that represents the vertex bitangent in local space of the current rendered object. + * + * @tsl + * @type {Node} + */ +export const bitangentLocal: Node; +/** + * TSL object that represents the vertex bitangent in view space of the current rendered object. + * + * @tsl + * @type {Node} + */ +export const bitangentView: Node; +/** + * TSL object that represents the vertex bitangent in world space of the current rendered object. + * + * @tsl + * @type {Node} + */ +export const bitangentWorld: Node; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/BufferAttributeNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/BufferAttributeNode.d.ts new file mode 100644 index 000000000..60775a2a1 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/BufferAttributeNode.d.ts @@ -0,0 +1,143 @@ +export default BufferAttributeNode; +export function bufferAttribute(array: BufferAttribute | InterleavedBuffer | TypedArray, type?: string | null, stride?: number, offset?: number): BufferAttributeNode | Node; +export function dynamicBufferAttribute(array: BufferAttribute | InterleavedBuffer | TypedArray, type?: string | null, stride?: number, offset?: number): BufferAttributeNode | Node; +export function instancedBufferAttribute(array: BufferAttribute | InterleavedBuffer | TypedArray, type?: string | null, stride?: number, offset?: number): BufferAttributeNode | Node; +export function instancedDynamicBufferAttribute(array: BufferAttribute | InterleavedBuffer | TypedArray, type?: string | null, stride?: number, offset?: number): BufferAttributeNode | Node; +/** + * In earlier `three.js` versions it was only possible to define attribute data + * on geometry level. With `BufferAttributeNode`, it is also possible to do this + * on the node level. + * ```js + * const geometry = new THREE.PlaneGeometry(); + * const positionAttribute = geometry.getAttribute( 'position' ); + * + * const colors = []; + * for ( let i = 0; i < position.count; i ++ ) { + * colors.push( 1, 0, 0 ); + * } + * + * material.colorNode = bufferAttribute( new THREE.Float32BufferAttribute( colors, 3 ) ); + * ``` + * This new approach is especially interesting when geometry data are generated via + * compute shaders. The below line converts a storage buffer into an attribute node. + * ```js + * material.positionNode = positionBuffer.toAttribute(); + * ``` + * @augments InputNode + */ +declare class BufferAttributeNode extends InputNode { + /** + * Constructs a new buffer attribute node. + * + * @param {BufferAttribute|InterleavedBuffer|TypedArray} value - The attribute data. + * @param {?string} [bufferType=null] - The buffer type (e.g. `'vec3'`). + * @param {number} [bufferStride=0] - The buffer stride. + * @param {number} [bufferOffset=0] - The buffer offset. + */ + constructor(value: BufferAttribute | InterleavedBuffer | TypedArray, bufferType?: string | null, bufferStride?: number, bufferOffset?: number); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isBufferNode: boolean; + /** + * The buffer type (e.g. `'vec3'`). + * + * @type {?string} + * @default null + */ + bufferType: string | null; + /** + * The buffer stride. + * + * @type {number} + * @default 0 + */ + bufferStride: number; + /** + * The buffer offset. + * + * @type {number} + * @default 0 + */ + bufferOffset: number; + /** + * The usage property. Set this to `THREE.DynamicDrawUsage` via `.setUsage()`, + * if you are planning to update the attribute data per frame. + * + * @type {number} + * @default StaticDrawUsage + */ + usage: number; + /** + * Whether the attribute is instanced or not. + * + * @type {boolean} + * @default false + */ + instanced: boolean; + /** + * A reference to the buffer attribute. + * + * @type {?BufferAttribute} + * @default null + */ + attribute: BufferAttribute | null; + /** + * This method is overwritten since the attribute data might be shared + * and thus the hash should be shared as well. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The hash. + */ + getHash(builder: NodeBuilder): string; + /** + * This method is overwritten since the node type is inferred from + * the buffer attribute. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The node type. + */ + generateNodeType(builder: NodeBuilder): string; + /** + * Depending on which value was passed to the node, `setup()` behaves + * differently. If no instance of `BufferAttribute` was passed, the method + * creates an internal attribute and configures it respectively. + * + * @param {NodeBuilder} builder - The current node builder. + */ + setup(builder: NodeBuilder): void; + /** + * Generates the code snippet of the buffer attribute node. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The generated code snippet. + */ + generate(builder: NodeBuilder): string; + /** + * Overwrites the default implementation to return a fixed value `'bufferAttribute'`. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The input type. + */ + getInputType(): string; + /** + * Sets the `usage` property to the given value. + * + * @param {number} value - The usage to set. + * @return {BufferAttributeNode} A reference to this node. + */ + setUsage(value: number): BufferAttributeNode; + /** + * Sets the `instanced` property to the given value. + * + * @param {boolean} value - The value to set. + * @return {BufferAttributeNode} A reference to this node. + */ + setInstanced(value: boolean): BufferAttributeNode; +} +import { InterleavedBuffer } from '../../core/InterleavedBuffer.js'; +import InputNode from '../core/InputNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/BufferNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/BufferNode.d.ts new file mode 100644 index 000000000..a0765ba1c --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/BufferNode.d.ts @@ -0,0 +1,75 @@ +export default BufferNode; +export function buffer(value: Array, type: string, count: number): BufferNode; +/** + * A special type of uniform node which represents array-like data + * as uniform buffers. The access usually happens via `element()` + * which returns an instance of {@link ArrayElementNode}. For example: + * + * ```js + * const bufferNode = buffer( array, 'mat4', count ); + * const matrixNode = bufferNode.element( index ); // access a matrix from the buffer + * ``` + * In general, it is recommended to use the more managed {@link UniformArrayNode} + * since it handles more input types and automatically cares about buffer paddings. + * + * @augments UniformNode + */ +declare class BufferNode extends UniformNode { + /** + * Constructs a new buffer node. + * + * @param {Array} value - Array-like buffer data. + * @param {string} bufferType - The data type of the buffer. + * @param {number} [bufferCount=0] - The count of buffer elements. + */ + constructor(value: Array, bufferType: string, bufferCount?: number); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isBufferNode: boolean; + /** + * The data type of the buffer. + * + * @type {string} + */ + bufferType: string; + /** + * The uniform node that holds the value of the reference node. + * + * @type {number} + * @default 0 + */ + bufferCount: number; + /** + * An array of update ranges. + * + * @type {Array<{start: number, count: number}>} + */ + updateRanges: Array<{ + start: number; + count: number; + }>; + /** + * Adds a range of data in the data array to be updated on the GPU. + * + * @param {number} start - Position at which to start update. + * @param {number} count - The number of components to update. + */ + addUpdateRange(start: number, count: number): void; + /** + * Clears the update ranges. + */ + clearUpdateRanges(): void; + /** + * Overwrites the default implementation to return a fixed value `'buffer'`. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The input type. + */ + getInputType(): string; +} +import UniformNode from '../core/UniformNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/BuiltinNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/BuiltinNode.d.ts new file mode 100644 index 000000000..1081d0ec4 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/BuiltinNode.d.ts @@ -0,0 +1,40 @@ +export default BuiltinNode; +/** + * TSL function for creating a builtin node. + * + * @tsl + * @function + * @param {string} name - The name of the built-in shader variable. + * @returns {BuiltinNode} + */ +export const builtin: any; +/** + * The node allows to set values for built-in shader variables. That is + * required for features like hardware-accelerated vertex clipping. + * + * @augments Node + */ +declare class BuiltinNode extends Node { + /** + * Constructs a new builtin node. + * + * @param {string} name - The name of the built-in shader variable. + */ + constructor(name: string); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isBuiltinNode: boolean; + /** + * Generates the code snippet of the builtin node. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The generated code snippet. + */ + generate(): string; +} +import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/Camera.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/Camera.d.ts new file mode 100644 index 000000000..1af86bd26 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/Camera.d.ts @@ -0,0 +1,70 @@ +/** + * TSL object that represents the current `index` value of the camera if used ArrayCamera. + * + * @tsl + * @type {UniformNode} + */ +export const cameraIndex: UniformNode; +/** + * TSL object that represents the `near` value of the camera used for the current render. + * + * @tsl + * @type {UniformNode} + */ +export const cameraNear: UniformNode; +/** + * TSL object that represents the `far` value of the camera used for the current render. + * + * @tsl + * @type {UniformNode} + */ +export const cameraFar: UniformNode; +/** + * TSL object that represents the projection matrix of the camera used for the current render. + * + * @tsl + * @type {UniformNode} + */ +export const cameraProjectionMatrix: UniformNode; +/** + * TSL object that represents the inverse projection matrix of the camera used for the current render. + * + * @tsl + * @type {UniformNode} + */ +export const cameraProjectionMatrixInverse: UniformNode; +/** + * TSL object that represents the view matrix of the camera used for the current render. + * + * @tsl + * @type {UniformNode} + */ +export const cameraViewMatrix: UniformNode; +/** + * TSL object that represents the world matrix of the camera used for the current render. + * + * @tsl + * @type {UniformNode} + */ +export const cameraWorldMatrix: UniformNode; +/** + * TSL object that represents the normal matrix of the camera used for the current render. + * + * @tsl + * @type {UniformNode} + */ +export const cameraNormalMatrix: UniformNode; +/** + * TSL object that represents the position in world space of the camera used for the current render. + * + * @tsl + * @type {UniformNode} + */ +export const cameraPosition: UniformNode; +/** + * TSL object that represents the viewport of the camera used for the current render. + * + * @tsl + * @type {UniformNode} + */ +export const cameraViewport: UniformNode; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/ClippingNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/ClippingNode.d.ts new file mode 100644 index 000000000..5ee80d125 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/ClippingNode.d.ts @@ -0,0 +1,65 @@ +export default ClippingNode; +export function clipping(): ClippingNode; +export function clippingAlpha(): ClippingNode; +export function hardwareClipping(): ClippingNode; +/** + * This node is used in {@link NodeMaterial} to setup the clipping + * which can happen hardware-accelerated (if supported) and optionally + * use alpha-to-coverage for anti-aliasing clipped edges. + * + * @augments Node + */ +declare class ClippingNode extends Node { + /** + * Constructs a new clipping node. + * + * @param {('default'|'hardware'|'alphaToCoverage')} [scope='default'] - The node's scope. Similar to other nodes, + * the selected scope influences the behavior of the node and what type of code is generated. + */ + constructor(scope?: ("default" | "hardware" | "alphaToCoverage")); + /** + * The node's scope. Similar to other nodes, the selected scope influences + * the behavior of the node and what type of code is generated. + * + * @type {('default'|'hardware'|'alphaToCoverage')} + */ + scope: ("default" | "hardware" | "alphaToCoverage"); + /** + * Setups the node depending on the selected scope. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {Node} The result node. + */ + setup(builder: NodeBuilder): Node; + hardwareClipping: any; + /** + * Setups alpha to coverage. + * + * @param {Array} intersectionPlanes - The intersection planes. + * @param {Array} unionPlanes - The union planes. + * @return {Node} The result node. + */ + setupAlphaToCoverage(intersectionPlanes: Array, unionPlanes: Array): Node; + /** + * Setups the default clipping. + * + * @param {Array} intersectionPlanes - The intersection planes. + * @param {Array} unionPlanes - The union planes. + * @return {Node} The result node. + */ + setupDefault(intersectionPlanes: Array, unionPlanes: Array): Node; + /** + * Setups hardware clipping. + * + * @param {Array} unionPlanes - The union planes. + * @param {NodeBuilder} builder - The current node builder. + * @return {Node} The result node. + */ + setupHardwareClipping(unionPlanes: Array, builder: NodeBuilder): Node; +} +declare namespace ClippingNode { + let ALPHA_TO_COVERAGE: string; + let DEFAULT: string; + let HARDWARE: string; +} +import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/CubeTextureNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/CubeTextureNode.d.ts new file mode 100644 index 000000000..23a01c90a --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/CubeTextureNode.d.ts @@ -0,0 +1,48 @@ +export default CubeTextureNode; +/** + * TSL function for creating a cube texture node. + * + * @tsl + * @function + * @param {CubeTexture} value - The cube texture. + * @param {?Node} [uvNode=null] - The uv node. + * @param {?Node} [levelNode=null] - The level node. + * @param {?Node} [biasNode=null] - The bias node. + * @returns {CubeTextureNode} + */ +export const cubeTextureBase: any; +export function cubeTexture(value?: (CubeTexture | CubeTextureNode) | null, uvNode?: Node | null, levelNode?: Node | null, biasNode?: Node | null): CubeTextureNode; +export function uniformCubeTexture(value?: CubeTexture | null): CubeTextureNode; +/** + * This type of uniform node represents a cube texture. + * + * @augments TextureNode + */ +declare class CubeTextureNode extends TextureNode { + /** + * Constructs a new cube texture node. + * + * @param {CubeTexture} value - The cube texture. + * @param {?Node} [uvNode=null] - The uv node. + * @param {?Node} [levelNode=null] - The level node. + * @param {?Node} [biasNode=null] - The bias node. + */ + constructor(value: CubeTexture, uvNode?: Node | null, levelNode?: Node | null, biasNode?: Node | null); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isCubeTextureNode: boolean; + /** + * Overwritten with an empty implementation since the `updateMatrix` flag is ignored + * for cube textures. The uv transformation matrix is not applied to cube textures. + * + * @param {boolean} value - The update toggle. + */ + setUpdateMatrix(): void; +} +import { CubeTexture } from '../../textures/CubeTexture.js'; +import TextureNode from './TextureNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/InstanceNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/InstanceNode.d.ts new file mode 100644 index 000000000..818fd503c --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/InstanceNode.d.ts @@ -0,0 +1,125 @@ +export default InstanceNode; +/** + * TSL function for creating an instance node. + * + * @tsl + * @function + * @param {number} count - The number of instances. + * @param {InstancedBufferAttribute|StorageInstancedBufferAttribute} instanceMatrix - Instanced buffer attribute representing the instance transformations. + * @param {?InstancedBufferAttribute|StorageInstancedBufferAttribute} instanceColor - Instanced buffer attribute representing the instance colors. + * @returns {InstanceNode} + */ +export const instance: any; +/** + * This node implements the vertex shader logic which is required + * when rendering 3D objects via instancing. The code makes sure + * vertex positions, normals and colors can be modified via instanced + * data. + * + * @augments Node + */ +declare class InstanceNode extends Node { + /** + * Constructs a new instance node. + * + * @param {number} count - The number of instances. + * @param {InstancedBufferAttribute|StorageInstancedBufferAttribute} instanceMatrix - Instanced buffer attribute representing the instance transformations. + * @param {?InstancedBufferAttribute|StorageInstancedBufferAttribute} instanceColor - Instanced buffer attribute representing the instance colors. + */ + constructor(count: number, instanceMatrix: InstancedBufferAttribute | StorageInstancedBufferAttribute, instanceColor?: (InstancedBufferAttribute | StorageInstancedBufferAttribute) | null); + /** + * The number of instances. + * + * @type {number} + */ + count: number; + /** + * Instanced buffer attribute representing the transformation of instances. + * + * @type {InstancedBufferAttribute} + */ + instanceMatrix: InstancedBufferAttribute; + /** + * Instanced buffer attribute representing the color of instances. + * + * @type {InstancedBufferAttribute} + */ + instanceColor: InstancedBufferAttribute; + /** + * The node that represents the instance matrix data. + * + * @type {?Node} + */ + instanceMatrixNode: Node | null; + /** + * The node that represents the instance color data. + * + * @type {?Node} + * @default null + */ + instanceColorNode: Node | null; + /** + * A reference to a buffer that is used by `instanceMatrixNode`. + * + * @type {?InstancedInterleavedBuffer} + */ + buffer: InstancedInterleavedBuffer | null; + /** + * A reference to a buffer that is used by `instanceColorNode`. + * + * @type {?InstancedBufferAttribute} + */ + bufferColor: InstancedBufferAttribute | null; + /** + * The previous instance matrices. Required for computing motion vectors. + * + * @type {?Node} + * @default null + */ + previousInstanceMatrixNode: Node | null; + /** + * Tracks whether the matrix data is provided via a storage buffer. + * + * @type {boolean} + */ + get isStorageMatrix(): boolean; + /** + * Tracks whether the color data is provided via a storage buffer. + * + * @type {boolean} + */ + get isStorageColor(): boolean; + /** + * Setups the internal buffers and nodes and assigns the transformed vertex data + * to predefined node variables for accumulation. That follows the same patterns + * like with morph and skinning nodes. + * + * @param {NodeBuilder} builder - The current node builder. + */ + setup(builder: NodeBuilder): void; + /** + * Checks if the internal buffers require an update. + * + * @param {NodeFrame} frame - The current node frame. + */ + update(frame: NodeFrame): void; + /** + * Computes the transformed/instanced vertex position of the previous frame. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {Node} The instanced position from the previous frame. + */ + getPreviousInstancedPosition(builder: NodeBuilder): Node; + /** + * Creates a node representing the instance matrix data. + * + * @private + * @param {boolean} assignBuffer - Whether the created interleaved buffer should be assigned to the `buffer` member or not. + * @param {NodeBuilder} builder - A reference to the current node builder. + * @return {Node} The instance matrix node. + */ + private _createInstanceMatrixNode; +} +import Node from '../core/Node.js'; +import { InstancedBufferAttribute } from '../../core/InstancedBufferAttribute.js'; +import { InstancedInterleavedBuffer } from '../../core/InstancedInterleavedBuffer.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/InstancedMeshNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/InstancedMeshNode.d.ts new file mode 100644 index 000000000..d9619f9e8 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/InstancedMeshNode.d.ts @@ -0,0 +1,31 @@ +export default InstancedMeshNode; +/** + * TSL function for creating an instanced mesh node. + * + * @tsl + * @function + * @param {InstancedMesh} instancedMesh - The instancedMesh. + * @returns {InstancedMeshNode} + */ +export const instancedMesh: any; +/** + * This is a special version of `InstanceNode` which requires the usage of {@link InstancedMesh}. + * It allows an easier setup of the instance node. + * + * @augments InstanceNode + */ +declare class InstancedMeshNode extends InstanceNode { + /** + * Constructs a new instanced mesh node. + * + * @param {InstancedMesh} instancedMesh - The instanced mesh. + */ + constructor(instancedMesh: InstancedMesh); + /** + * A reference to the instanced mesh. + * + * @type {InstancedMesh} + */ + instancedMesh: InstancedMesh; +} +import InstanceNode from './InstanceNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/Lights.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/Lights.d.ts new file mode 100644 index 000000000..1639939c2 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/Lights.d.ts @@ -0,0 +1,48 @@ +/** + * TSL function for getting a shadow matrix uniform node for the given light. + * + * @tsl + * @function + * @param {Light} light -The light source. + * @returns {UniformNode} The shadow matrix uniform node. + */ +export function lightShadowMatrix(light: Light): UniformNode; +/** + * TSL function for getting projected uv coordinates for the given light. + * Relevant when using maps with spot lights. + * + * @tsl + * @function + * @param {Light} light -The light source. + * @param {Node} [position=positionWorld] -The position to project. + * @returns {Node} The projected uvs. + */ +export function lightProjectionUV(light: Light, position?: Node): Node; +/** + * TSL function for getting the position in world space for the given light. + * + * @tsl + * @function + * @param {Light} light -The light source. + * @returns {UniformNode} The light's position in world space. + */ +export function lightPosition(light: Light): UniformNode; +/** + * TSL function for getting the light target position in world space for the given light. + * + * @tsl + * @function + * @param {Light} light -The light source. + * @returns {UniformNode} The light target position in world space. + */ +export function lightTargetPosition(light: Light): UniformNode; +/** + * TSL function for getting the position in view space for the given light. + * + * @tsl + * @function + * @param {Light} light - The light source. + * @returns {UniformNode} The light's position in view space. + */ +export function lightViewPosition(light: Light): UniformNode; +export function lightTargetDirection(light: Light): Node; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/MaterialNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/MaterialNode.d.ts new file mode 100644 index 000000000..3bfbe299d --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/MaterialNode.d.ts @@ -0,0 +1,384 @@ +export default MaterialNode; +/** + * TSL object that represents alpha test of the current material. + * + * @tsl + * @type {Node} + */ +export const materialAlphaTest: Node; +/** + * TSL object that represents the diffuse color of the current material. + * The value is composed via `color` * `map`. + * + * @tsl + * @type {Node} + */ +export const materialColor: Node; +/** + * TSL object that represents the shininess of the current material. + * + * @tsl + * @type {Node} + */ +export const materialShininess: Node; +/** + * TSL object that represents the emissive color of the current material. + * The value is composed via `emissive` * `emissiveIntensity` * `emissiveMap`. + * + * @tsl + * @type {Node} + */ +export const materialEmissive: Node; +/** + * TSL object that represents the opacity of the current material. + * The value is composed via `opacity` * `alphaMap`. + * + * @tsl + * @type {Node} + */ +export const materialOpacity: Node; +/** + * TSL object that represents the specular of the current material. + * + * @tsl + * @type {Node} + */ +export const materialSpecular: Node; +/** + * TSL object that represents the specular intensity of the current material. + * The value is composed via `specularIntensity` * `specularMap.a`. + * + * @tsl + * @type {Node} + */ +export const materialSpecularIntensity: Node; +/** + * TSL object that represents the specular color of the current material. + * The value is composed via `specularColor` * `specularMap.rgb`. + * + * @tsl + * @type {Node} + */ +export const materialSpecularColor: Node; +/** + * TSL object that represents the specular strength of the current material. + * The value is composed via `specularMap.r`. + * + * @tsl + * @type {Node} + */ +export const materialSpecularStrength: Node; +/** + * TSL object that represents the reflectivity of the current material. + * + * @tsl + * @type {Node} + */ +export const materialReflectivity: Node; +/** + * TSL object that represents the roughness of the current material. + * The value is composed via `roughness` * `roughnessMap.g`. + * + * @tsl + * @type {Node} + */ +export const materialRoughness: Node; +/** + * TSL object that represents the metalness of the current material. + * The value is composed via `metalness` * `metalnessMap.b`. + * + * @tsl + * @type {Node} + */ +export const materialMetalness: Node; +/** + * TSL object that represents the normal of the current material. + * The value will be either `normalMap` * `normalScale`, `bumpMap` * `bumpScale` or `normalView`. + * + * @tsl + * @type {Node} + */ +export const materialNormal: Node; +/** + * TSL object that represents the clearcoat of the current material. + * The value is composed via `clearcoat` * `clearcoatMap.r` + * + * @tsl + * @type {Node} + */ +export const materialClearcoat: Node; +/** + * TSL object that represents the clearcoat roughness of the current material. + * The value is composed via `clearcoatRoughness` * `clearcoatRoughnessMap.r`. + * + * @tsl + * @type {Node} + */ +export const materialClearcoatRoughness: Node; +/** + * TSL object that represents the clearcoat normal of the current material. + * The value will be either `clearcoatNormalMap` or `normalView`. + * + * @tsl + * @type {Node} + */ +export const materialClearcoatNormal: Node; +/** + * TSL object that represents the rotation of the current sprite material. + * + * @tsl + * @type {Node} + */ +export const materialRotation: Node; +/** + * TSL object that represents the sheen color of the current material. + * The value is composed via `sheen` * `sheenColor` * `sheenColorMap`. + * + * @tsl + * @type {Node} + */ +export const materialSheen: Node; +/** + * TSL object that represents the sheen roughness of the current material. + * The value is composed via `sheenRoughness` * `sheenRoughnessMap.a`. + * + * @tsl + * @type {Node} + */ +export const materialSheenRoughness: Node; +/** + * TSL object that represents the anisotropy of the current material. + * + * @tsl + * @type {Node} + */ +export const materialAnisotropy: Node; +/** + * TSL object that represents the iridescence of the current material. + * + * @tsl + * @type {Node} + */ +export const materialIridescence: Node; +/** + * TSL object that represents the iridescence IOR of the current material. + * + * @tsl + * @type {Node} + */ +export const materialIridescenceIOR: Node; +/** + * TSL object that represents the iridescence thickness of the current material. + * + * @tsl + * @type {Node} + */ +export const materialIridescenceThickness: Node; +/** + * TSL object that represents the transmission of the current material. + * The value is composed via `transmission` * `transmissionMap.r`. + * + * @tsl + * @type {Node} + */ +export const materialTransmission: Node; +/** + * TSL object that represents the thickness of the current material. + * The value is composed via `thickness` * `thicknessMap.g`. + * + * @tsl + * @type {Node} + */ +export const materialThickness: Node; +/** + * TSL object that represents the IOR of the current material. + * + * @tsl + * @type {Node} + */ +export const materialIOR: Node; +/** + * TSL object that represents the attenuation distance of the current material. + * + * @tsl + * @type {Node} + */ +export const materialAttenuationDistance: Node; +/** + * TSL object that represents the attenuation color of the current material. + * + * @tsl + * @type {Node} + */ +export const materialAttenuationColor: Node; +/** + * TSL object that represents the scale of the current dashed line material. + * + * @tsl + * @type {Node} + */ +export const materialLineScale: Node; +/** + * TSL object that represents the dash size of the current dashed line material. + * + * @tsl + * @type {Node} + */ +export const materialLineDashSize: Node; +/** + * TSL object that represents the gap size of the current dashed line material. + * + * @tsl + * @type {Node} + */ +export const materialLineGapSize: Node; +/** + * TSL object that represents the line width of the current line material. + * + * @tsl + * @type {Node} + */ +export const materialLineWidth: Node; +/** + * TSL object that represents the dash offset of the current line material. + * + * @tsl + * @type {Node} + */ +export const materialLineDashOffset: Node; +/** + * TSL object that represents the point size of the current points material. + * + * @tsl + * @type {Node} + */ +export const materialPointSize: Node; +/** + * TSL object that represents the dispersion of the current material. + * + * @tsl + * @type {Node} + */ +export const materialDispersion: Node; +/** + * TSL object that represents the light map of the current material. + * The value is composed via `lightMapIntensity` * `lightMap.rgb`. + * + * @tsl + * @type {Node} + */ +export const materialLightMap: Node; +/** + * TSL object that represents the ambient occlusion map of the current material. + * The value is composed via `aoMap.r` - 1 * `aoMapIntensity` + 1. + * + * @tsl + * @type {Node} + */ +export const materialAO: Node; +/** + * TSL object that represents the anisotropy vector of the current material. + * + * @tsl + * @type {Node} + */ +export const materialAnisotropyVector: Node; +/** + * This class should simplify the node access to material properties. + * It internal uses reference nodes to make sure changes to material + * properties are automatically reflected to predefined TSL objects + * like e.g. `materialColor`. + * + * @augments Node + */ +declare class MaterialNode extends Node { + /** + * Constructs a new material node. + * + * @param {string} scope - The scope defines what kind of material property is referred by the node. + */ + constructor(scope: string); + /** + * The scope defines what material property is referred by the node. + * + * @type {string} + */ + scope: string; + /** + * Returns a cached reference node for the given property and type. + * + * @param {string} property - The name of the material property. + * @param {string} type - The uniform type of the property. + * @return {MaterialReferenceNode} A material reference node representing the property access. + */ + getCache(property: string, type: string): MaterialReferenceNode; + /** + * Returns a float-typed material reference node for the given property name. + * + * @param {string} property - The name of the material property. + * @return {MaterialReferenceNode} A material reference node representing the property access. + */ + getFloat(property: string): MaterialReferenceNode; + /** + * Returns a color-typed material reference node for the given property name. + * + * @param {string} property - The name of the material property. + * @return {MaterialReferenceNode} A material reference node representing the property access. + */ + getColor(property: string): MaterialReferenceNode; + /** + * Returns a texture-typed material reference node for the given property name. + * + * @param {string} property - The name of the material property. + * @return {MaterialReferenceNode} A material reference node representing the property access. + */ + getTexture(property: string): MaterialReferenceNode; + /** + * The node setup is done depending on the selected scope. Multiple material properties + * might be grouped into a single node composition if they logically belong together. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {Node} The node representing the selected scope. + */ + setup(builder: NodeBuilder): Node; +} +declare namespace MaterialNode { + let ALPHA_TEST: string; + let COLOR: string; + let OPACITY: string; + let SHININESS: string; + let SPECULAR: string; + let SPECULAR_STRENGTH: string; + let SPECULAR_INTENSITY: string; + let SPECULAR_COLOR: string; + let REFLECTIVITY: string; + let ROUGHNESS: string; + let METALNESS: string; + let NORMAL: string; + let CLEARCOAT: string; + let CLEARCOAT_ROUGHNESS: string; + let CLEARCOAT_NORMAL: string; + let EMISSIVE: string; + let ROTATION: string; + let SHEEN: string; + let SHEEN_ROUGHNESS: string; + let ANISOTROPY: string; + let IRIDESCENCE: string; + let IRIDESCENCE_IOR: string; + let IRIDESCENCE_THICKNESS: string; + let IOR: string; + let TRANSMISSION: string; + let THICKNESS: string; + let ATTENUATION_DISTANCE: string; + let ATTENUATION_COLOR: string; + let LINE_SCALE: string; + let LINE_DASH_SIZE: string; + let LINE_GAP_SIZE: string; + let LINE_WIDTH: string; + let LINE_DASH_OFFSET: string; + let POINT_SIZE: string; + let DISPERSION: string; + let LIGHT_MAP: string; + let AO: string; +} +import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/MaterialProperties.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/MaterialProperties.d.ts new file mode 100644 index 000000000..0525adf5a --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/MaterialProperties.d.ts @@ -0,0 +1,24 @@ +/** + * TSL object that represents the refraction ratio of the material used for rendering the current object. + * + * @tsl + * @type {UniformNode} + */ +export const materialRefractionRatio: UniformNode; +/** + * TSL object that represents the intensity of environment maps of PBR materials. + * When `material.envMap` is set, the value is `material.envMapIntensity` otherwise `scene.environmentIntensity`. + * + * @tsl + * @type {Node} + */ +export const materialEnvIntensity: Node; +/** + * TSL object that represents the rotation of environment maps. + * When `material.envMap` is set, the value is `material.envMapRotation`. `scene.environmentRotation` controls the + * rotation of `scene.environment` instead. + * + * @tsl + * @type {Node} + */ +export const materialEnvRotation: Node; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/MaterialReferenceNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/MaterialReferenceNode.d.ts new file mode 100644 index 000000000..7a6029df8 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/MaterialReferenceNode.d.ts @@ -0,0 +1,41 @@ +export default MaterialReferenceNode; +export function materialReference(name: string, type: string, material?: Material | null): MaterialReferenceNode; +/** + * This node is a special type of reference node which is intended + * for linking material properties with node values. + * ```js + * const opacityNode = materialReference( 'opacity', 'float', material ); + * ``` + * When changing `material.opacity`, the node value of `opacityNode` will + * automatically be updated. + * + * @augments ReferenceNode + */ +declare class MaterialReferenceNode extends ReferenceNode { + /** + * Constructs a new material reference node. + * + * @param {string} property - The name of the property the node refers to. + * @param {string} inputType - The uniform type that should be used to represent the property value. + * @param {?Material} [material=null] - The material the property belongs to. When no material is set, + * the node refers to the material of the current rendered object. + */ + constructor(property: string, inputType: string, material?: Material | null); + /** + * The material the property belongs to. When no material is set, + * the node refers to the material of the current rendered object. + * + * @type {?Material} + * @default null + */ + material: Material | null; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isMaterialReferenceNode: boolean; +} +import ReferenceNode from './ReferenceNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/ModelNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/ModelNode.d.ts new file mode 100644 index 000000000..b5523dfa3 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/ModelNode.d.ts @@ -0,0 +1,104 @@ +export default ModelNode; +/** + * TSL object that represents the object's direction in world space. + * + * @tsl + * @type {ModelNode} + */ +export const modelDirection: ModelNode; +/** + * TSL object that represents the object's world matrix. + * + * @tsl + * @type {ModelNode} + */ +export const modelWorldMatrix: ModelNode; +/** + * TSL object that represents the object's position in world space. + * + * @tsl + * @type {ModelNode} + */ +export const modelPosition: ModelNode; +/** + * TSL object that represents the object's scale in world space. + * + * @tsl + * @type {ModelNode} + */ +export const modelScale: ModelNode; +/** + * TSL object that represents the object's position in view/camera space. + * + * @tsl + * @type {ModelNode} + */ +export const modelViewPosition: ModelNode; +/** + * TSL object that represents the object's radius. + * + * @tsl + * @type {ModelNode} + */ +export const modelRadius: ModelNode; +/** + * TSL object that represents the object's normal matrix. + * + * @tsl + * @type {UniformNode} + */ +export const modelNormalMatrix: UniformNode; +/** + * TSL object that represents the object's inverse world matrix. + * + * @tsl + * @type {UniformNode} + */ +export const modelWorldMatrixInverse: UniformNode; +/** + * TSL object that represents the object's model view matrix. + * + * @tsl + * @type {Node} + */ +export const modelViewMatrix: Node; +/** + * TSL object that represents the object's model view in `mediump` precision. + * + * @tsl + * @type {Node} + */ +export const mediumpModelViewMatrix: Node; +/** + * TSL object that represents the object's model view in `highp` precision + * which is achieved by computing the matrix in JS and not in the shader. + * + * @tsl + * @type {Node} + */ +export const highpModelViewMatrix: Node; +/** + * TSL object that represents the object's model normal view in `highp` precision + * which is achieved by computing the matrix in JS and not in the shader. + * + * @tsl + * @type {Node} + */ +export const highpModelNormalViewMatrix: Node; +/** + * This type of node is a specialized version of `Object3DNode` + * with larger set of model related metrics. Unlike `Object3DNode`, + * `ModelNode` extracts the reference to the 3D object from the + * current node frame state. + * + * @augments Object3DNode + */ +declare class ModelNode extends Object3DNode { + /** + * Constructs a new object model node. + * + * @param {('position'|'viewPosition'|'direction'|'scale'|'worldMatrix')} scope - The node represents a different type of transformation depending on the scope. + */ + constructor(scope: ("position" | "viewPosition" | "direction" | "scale" | "worldMatrix")); +} +import Object3DNode from './Object3DNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/ModelViewProjectionNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/ModelViewProjectionNode.d.ts new file mode 100644 index 000000000..40d0ac691 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/ModelViewProjectionNode.d.ts @@ -0,0 +1,7 @@ +/** + * TSL object that represents the position in clip space after the model-view-projection transform of the current rendered object. + * + * @tsl + * @type {VaryingNode} + */ +export const modelViewProjection: VaryingNode; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/MorphNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/MorphNode.d.ts new file mode 100644 index 000000000..70c2b991f --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/MorphNode.d.ts @@ -0,0 +1,49 @@ +export default MorphNode; +/** + * TSL function for creating a morph node. + * + * @tsl + * @function + * @param {Mesh} mesh - The mesh holding the morph targets. + * @returns {MorphNode} + */ +export const morphReference: any; +/** + * This node implements the vertex transformation shader logic which is required + * for morph target animation. + * + * @augments Node + */ +declare class MorphNode extends Node { + /** + * Constructs a new morph node. + * + * @param {Mesh} mesh - The mesh holding the morph targets. + */ + constructor(mesh: Mesh); + /** + * The mesh holding the morph targets. + * + * @type {Mesh} + */ + mesh: Mesh; + /** + * A uniform node which represents the morph base influence value. + * + * @type {UniformNode} + */ + morphBaseInfluence: UniformNode; + /** + * Setups the morph node by assigning the transformed vertex data to predefined node variables. + * + * @param {NodeBuilder} builder - The current node builder. + */ + setup(builder: NodeBuilder): void; + /** + * Updates the state of the morphed mesh by updating the base influence. + * + * @param {NodeFrame} frame - The current node frame. + */ + update(): void; +} +import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/Normal.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/Normal.d.ts new file mode 100644 index 000000000..b75ce8778 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/Normal.d.ts @@ -0,0 +1,100 @@ +/** + * TSL object that represents the normal attribute of the current rendered object in local space. + * + * @tsl + * @type {Node} + */ +export const normalGeometry: Node; +/** + * TSL object that represents the vertex normal of the current rendered object in local space. + * + * @tsl + * @type {Node} + */ +export const normalLocal: Node; +/** + * TSL object that represents the flat vertex normal of the current rendered object in view space. + * + * @tsl + * @type {Node} + */ +export const normalFlat: Node; +/** + * TSL object that represents the vertex normal of the current rendered object in view space. + * + * @tsl + * @type {Node} + */ +export const normalViewGeometry: Node; +/** + * TSL object that represents the vertex normal of the current rendered object in world space. + * + * @tsl + * @type {Node} + */ +export const normalWorldGeometry: Node; +/** + * TSL object that represents the vertex normal of the current rendered object in view space. + * + * @tsl + * @type {Node} + */ +export const normalView: Node; +/** + * TSL object that represents the vertex normal of the current rendered object in world space. + * + * @tsl + * @type {Node} + */ +export const normalWorld: Node; +/** + * TSL object that represents the clearcoat vertex normal of the current rendered object in view space. + * + * @tsl + * @type {Node} + */ +export const clearcoatNormalView: Node; +/** + * Transforms the normal with the given matrix. + * + * @tsl + * @function + * @param {Node} normal - The normal. + * @param {Node} [matrix=modelWorldMatrix] - The matrix. + * @return {Node} The transformed normal. + */ +export const transformNormal: () => void; +/** + * Transforms the given normal from local to view space. + * + * @tsl + * @function + * @param {Node} normal - The normal. + * @param {NodeBuilder} builder - The current node builder. + * @return {Node} The transformed normal. + */ +export const transformNormalToView: () => void; +/** + * TSL object that represents the transformed vertex normal of the current rendered object in view space. + * + * @tsl + * @type {Node} + * @deprecated since r178. Use `normalView` instead. + */ +export const transformedNormalView: Node; +/** + * TSL object that represents the transformed vertex normal of the current rendered object in world space. + * + * @tsl + * @type {Node} + * @deprecated since r178. Use `normalWorld` instead. + */ +export const transformedNormalWorld: Node; +/** + * TSL object that represents the transformed clearcoat vertex normal of the current rendered object in view space. + * + * @tsl + * @type {Node} + * @deprecated since r178. Use `clearcoatNormalView` instead. + */ +export const transformedClearcoatNormalView: Node; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/Object3DNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/Object3DNode.d.ts new file mode 100644 index 000000000..99b15b948 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/Object3DNode.d.ts @@ -0,0 +1,128 @@ +export default Object3DNode; +/** + * TSL function for creating an object 3D node that represents the object's direction in world space. + * + * @tsl + * @function + * @param {?Object3D} [object3d] - The 3D object. + * @returns {Object3DNode} + */ +export const objectDirection: any; +/** + * TSL function for creating an object 3D node that represents the object's world matrix. + * + * @tsl + * @function + * @param {?Object3D} [object3d] - The 3D object. + * @returns {Object3DNode} + */ +export const objectWorldMatrix: any; +/** + * TSL function for creating an object 3D node that represents the object's position in world space. + * + * @tsl + * @function + * @param {?Object3D} [object3d] - The 3D object. + * @returns {Object3DNode} + */ +export const objectPosition: any; +/** + * TSL function for creating an object 3D node that represents the object's scale in world space. + * + * @tsl + * @function + * @param {?Object3D} [object3d] - The 3D object. + * @returns {Object3DNode} + */ +export const objectScale: any; +/** + * TSL function for creating an object 3D node that represents the object's position in view/camera space. + * + * @tsl + * @function + * @param {?Object3D} [object3d] - The 3D object. + * @returns {Object3DNode} + */ +export const objectViewPosition: any; +/** + * TSL function for creating an object 3D node that represents the object's radius. + * + * @tsl + * @function + * @param {?Object3D} [object3d] - The 3D object. + * @returns {Object3DNode} + */ +export const objectRadius: any; +/** + * This node can be used to access transformation related metrics of 3D objects. + * Depending on the selected scope, a different metric is represented as a uniform + * in the shader. The following scopes are supported: + * + * - `POSITION`: The object's position in world space. + * - `VIEW_POSITION`: The object's position in view/camera space. + * - `DIRECTION`: The object's direction in world space. + * - `SCALE`: The object's scale in world space. + * - `WORLD_MATRIX`: The object's matrix in world space. + * + * @augments Node + */ +declare class Object3DNode extends Node { + /** + * Constructs a new object 3D node. + * + * @param {('position'|'viewPosition'|'direction'|'scale'|'worldMatrix')} scope - The node represents a different type of transformation depending on the scope. + * @param {?Object3D} [object3d=null] - The 3D object. + */ + constructor(scope: ("position" | "viewPosition" | "direction" | "scale" | "worldMatrix"), object3d?: Object3D | null); + /** + * The node reports a different type of transformation depending on the scope. + * + * @type {('position'|'viewPosition'|'direction'|'scale'|'worldMatrix')} + */ + scope: ("position" | "viewPosition" | "direction" | "scale" | "worldMatrix"); + /** + * The 3D object. + * + * @type {?Object3D} + * @default null + */ + object3d: Object3D | null; + /** + * Holds the value of the node as a uniform. + * + * @type {UniformNode} + */ + uniformNode: UniformNode; + /** + * Overwritten since the node type is inferred from the scope. + * + * @return {('mat4'|'vec3'|'float')} The node type. + */ + generateNodeType(): ("mat4" | "vec3" | "float"); + /** + * Updates the uniform value depending on the scope. + * + * @param {NodeFrame} frame - The current node frame. + */ + update(frame: NodeFrame): void; + /** + * Generates the code snippet of the uniform node. The node type of the uniform + * node also depends on the selected scope. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The generated code snippet. + */ + generate(builder: NodeBuilder): string; + serialize(data: any): void; + deserialize(data: any): void; +} +declare namespace Object3DNode { + let WORLD_MATRIX: string; + let POSITION: string; + let SCALE: string; + let VIEW_POSITION: string; + let DIRECTION: string; + let RADIUS: string; +} +import Node from '../core/Node.js'; +import UniformNode from '../core/UniformNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/PointUVNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/PointUVNode.d.ts new file mode 100644 index 000000000..67872c0e7 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/PointUVNode.d.ts @@ -0,0 +1,33 @@ +export default PointUVNode; +/** + * TSL object that represents the uv coordinates of points. + * + * @tsl + * @type {PointUVNode} + */ +export const pointUV: PointUVNode; +/** + * A node for representing the uv coordinates of points. + * + * Can only be used with a WebGL backend. In WebGPU, point + * primitives always have the size of one pixel and can thus + * can't be used as sprite-like objects that display textures. + * + * @augments Node + */ +declare class PointUVNode extends Node { + /** + * Constructs a new point uv node. + */ + constructor(); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isPointUVNode: boolean; + generate(): string; +} +import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/Position.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/Position.d.ts new file mode 100644 index 000000000..4562c2971 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/Position.d.ts @@ -0,0 +1,57 @@ +/** + * TSL object that represents the clip space position of the current rendered object. + * + * @tsl + * @type {VaryingNode} + */ +export const clipSpace: VaryingNode; +/** + * TSL object that represents the position attribute of the current rendered object. + * + * @tsl + * @type {AttributeNode} + */ +export const positionGeometry: AttributeNode; +/** + * TSL object that represents the vertex position in local space of the current rendered object. + * + * @tsl + * @type {AttributeNode} + */ +export const positionLocal: AttributeNode; +/** + * TSL object that represents the previous vertex position in local space of the current rendered object. + * Used in context of {@link VelocityNode} for rendering motion vectors. + * + * @tsl + * @type {AttributeNode} + */ +export const positionPrevious: AttributeNode; +/** + * TSL object that represents the vertex position in world space of the current rendered object. + * + * @tsl + * @type {VaryingNode} + */ +export const positionWorld: VaryingNode; +/** + * TSL object that represents the position world direction of the current rendered object. + * + * @tsl + * @type {Node} + */ +export const positionWorldDirection: Node; +/** + * TSL object that represents the vertex position in view space of the current rendered object. + * + * @tsl + * @type {VaryingNode} + */ +export const positionView: VaryingNode; +/** + * TSL object that represents the position view direction of the current rendered object. + * + * @tsl + * @type {VaryingNode} + */ +export const positionViewDirection: VaryingNode; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/ReferenceBaseNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/ReferenceBaseNode.d.ts new file mode 100644 index 000000000..413924422 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/ReferenceBaseNode.d.ts @@ -0,0 +1,181 @@ +export default ReferenceBaseNode; +export function reference(name: string, type: string, object: Object): ReferenceBaseNode; +export function referenceBuffer(name: string, type: string, count: number, object?: Object): ReferenceBaseNode; +/** + * Base class for nodes which establishes a reference to a property of another object. + * In this way, the value of the node is automatically linked to the value of + * referenced object. Reference nodes internally represent the linked value + * as a uniform. + * + * @augments Node + */ +declare class ReferenceBaseNode extends Node { + /** + * Constructs a new reference base node. + * + * @param {string} property - The name of the property the node refers to. + * @param {string} uniformType - The uniform type that should be used to represent the property value. + * @param {?Object} [object=null] - The object the property belongs to. + * @param {?number} [count=null] - When the linked property is an array-like, this parameter defines its length. + */ + constructor(property: string, uniformType: string, object?: Object | null, count?: number | null); + /** + * The name of the property the node refers to. + * + * @type {string} + */ + property: string; + /** + * The uniform type that should be used to represent the property value. + * + * @type {string} + */ + uniformType: string; + /** + * The object the property belongs to. + * + * @type {?Object} + * @default null + */ + object: Object | null; + /** + * When the linked property is an array, this parameter defines its length. + * + * @type {?number} + * @default null + */ + count: number | null; + /** + * The property name might have dots so nested properties can be referred. + * The hierarchy of the names is stored inside this array. + * + * @type {Array} + */ + properties: Array; + /** + * Points to the current referred object. This property exists next to {@link ReferenceNode#object} + * since the final reference might be updated from calling code. + * + * @type {?Object} + * @default null + */ + reference: Object | null; + /** + * The uniform node that holds the value of the reference node. + * + * @type {UniformNode} + * @default null + */ + node: UniformNode; + /** + * The uniform group of the internal uniform. + * + * @type {UniformGroupNode} + * @default null + */ + group: UniformGroupNode; + /** + * Sets the uniform group for this reference node. + * + * @param {UniformGroupNode} group - The uniform group to set. + * @return {ReferenceBaseNode} A reference to this node. + */ + setGroup(group: UniformGroupNode): ReferenceBaseNode; + /** + * When the referred property is array-like, this method can be used + * to access elements via an index node. + * + * @param {IndexNode} indexNode - indexNode. + * @return {ReferenceElementNode} A reference to an element. + */ + element(indexNode: IndexNode): ReferenceElementNode; + /** + * Sets the node type which automatically defines the internal + * uniform type. + * + * @param {string} uniformType - The type to set. + */ + setNodeType(uniformType: string): void; + /** + * This method is overwritten since the node type is inferred from + * the type of the reference node. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The node type. + */ + generateNodeType(builder: NodeBuilder): string; + /** + * Returns the property value from the given referred object. + * + * @param {Object} [object=this.reference] - The object to retrieve the property value from. + * @return {any} The value. + */ + getValueFromReference(object?: Object): any; + /** + * Allows to update the reference based on the given state. The state is only + * evaluated {@link ReferenceBaseNode#object} is not set. + * + * @param {(NodeFrame|NodeBuilder)} state - The current state. + * @return {Object} The updated reference. + */ + updateReference(state: (NodeFrame | NodeBuilder)): Object; + /** + * The output of the reference node is the internal uniform node. + * + * @return {UniformNode} The output node. + */ + setup(): UniformNode; + /** + * Overwritten to update the internal uniform value. + * + * @param {NodeFrame} frame - A reference to the current node frame. + */ + update(): void; + /** + * Retrieves the value from the referred object property and uses it + * to updated the internal uniform. + */ + updateValue(): void; +} +import Node from '../core/Node.js'; +/** + * This class is only relevant if the referenced property is array-like. + * In this case, `ReferenceElementNode` allows to refer to a specific + * element inside the data structure via an index. + * + * @augments ArrayElementNode + */ +declare class ReferenceElementNode extends ArrayElementNode { + /** + * Constructs a new reference element node. + * + * @param {ReferenceBaseNode} referenceNode - The reference node. + * @param {Node} indexNode - The index node that defines the element access. + */ + constructor(referenceNode: ReferenceBaseNode, indexNode: Node); + /** + * Similar to {@link ReferenceBaseNode#reference}, an additional + * property references to the current node. + * + * @type {?ReferenceBaseNode} + * @default null + */ + referenceNode: ReferenceBaseNode | null; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isReferenceElementNode: boolean; + /** + * This method is overwritten since the node type is inferred from + * the uniform type of the reference node. + * + * @return {string} The node type. + */ + generateNodeType(): string; + generate(builder: any): any; +} +import ArrayElementNode from '../utils/ArrayElementNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/ReferenceNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/ReferenceNode.d.ts new file mode 100644 index 000000000..7476c25c4 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/ReferenceNode.d.ts @@ -0,0 +1,197 @@ +export default ReferenceNode; +export function reference(name: string, type: string, object?: Object | null): ReferenceNode; +export function referenceBuffer(name: string, type: string, count: number, object: Object): ReferenceNode; +/** + * This type of node establishes a reference to a property of another object. + * In this way, the value of the node is automatically linked to the value of + * referenced object. Reference nodes internally represent the linked value + * as a uniform. + * + * @augments Node + */ +declare class ReferenceNode extends Node { + /** + * Constructs a new reference node. + * + * @param {string} property - The name of the property the node refers to. + * @param {string} uniformType - The uniform type that should be used to represent the property value. + * @param {?Object} [object=null] - The object the property belongs to. + * @param {?number} [count=null] - When the linked property is an array-like, this parameter defines its length. + */ + constructor(property: string, uniformType: string, object?: Object | null, count?: number | null); + /** + * The name of the property the node refers to. + * + * @type {string} + */ + property: string; + /** + * The uniform type that should be used to represent the property value. + * + * @type {string} + */ + uniformType: string; + /** + * The object the property belongs to. + * + * @type {?Object} + * @default null + */ + object: Object | null; + /** + * When the linked property is an array, this parameter defines its length. + * + * @type {?number} + * @default null + */ + count: number | null; + /** + * The property name might have dots so nested properties can be referred. + * The hierarchy of the names is stored inside this array. + * + * @type {Array} + */ + properties: Array; + /** + * Points to the current referred object. This property exists next to {@link ReferenceNode#object} + * since the final reference might be updated from calling code. + * + * @type {?Object} + * @default null + */ + reference: Object | null; + /** + * The uniform node that holds the value of the reference node. + * + * @type {UniformNode} + * @default null + */ + node: UniformNode; + /** + * The uniform group of the internal uniform. + * + * @type {UniformGroupNode} + * @default null + */ + group: UniformGroupNode; + /** + * When the referred property is array-like, this method can be used + * to access elements via an index node. + * + * @param {IndexNode} indexNode - indexNode. + * @return {ReferenceElementNode} A reference to an element. + */ + element(indexNode: IndexNode): ReferenceElementNode; + /** + * Sets the uniform group for this reference node. + * + * @param {UniformGroupNode} group - The uniform group to set. + * @return {ReferenceNode} A reference to this node. + */ + setGroup(group: UniformGroupNode): ReferenceNode; + /** + * Sets the name for the internal uniform. + * + * @param {string} name - The label to set. + * @return {ReferenceNode} A reference to this node. + */ + setName(name: string): ReferenceNode; + /** + * Sets the label for the internal uniform. + * + * @deprecated + * @param {string} name - The label to set. + * @return {ReferenceNode} A reference to this node. + */ + label(name: string): ReferenceNode; + /** + * Sets the node type which automatically defines the internal + * uniform type. + * + * @param {string} uniformType - The type to set. + */ + setNodeType(uniformType: string): void; + /** + * This method is overwritten since the node type is inferred from + * the type of the reference node. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The node type. + */ + generateNodeType(builder: NodeBuilder): string; + /** + * Returns the property value from the given referred object. + * + * @param {Object} [object=this.reference] - The object to retrieve the property value from. + * @return {any} The value. + */ + getValueFromReference(object?: Object): any; + /** + * Allows to update the reference based on the given state. The state is only + * evaluated {@link ReferenceNode#object} is not set. + * + * @param {(NodeFrame|NodeBuilder)} state - The current state. + * @return {Object} The updated reference. + */ + updateReference(state: (NodeFrame | NodeBuilder)): Object; + /** + * The output of the reference node is the internal uniform node. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {UniformNode} The output node. + */ + setup(): UniformNode; + /** + * Overwritten to update the internal uniform value. + * + * @param {NodeFrame} frame - A reference to the current node frame. + */ + update(): void; + /** + * Retrieves the value from the referred object property and uses it + * to updated the internal uniform. + */ + updateValue(): void; +} +import Node from '../core/Node.js'; +/** + * This class is only relevant if the referenced property is array-like. + * In this case, `ReferenceElementNode` allows to refer to a specific + * element inside the data structure via an index. + * + * @augments ArrayElementNode + */ +declare class ReferenceElementNode extends ArrayElementNode { + /** + * Constructs a new reference element node. + * + * @param {?ReferenceNode} referenceNode - The reference node. + * @param {Node} indexNode - The index node that defines the element access. + */ + constructor(referenceNode: ReferenceNode | null, indexNode: Node); + /** + * Similar to {@link ReferenceNode#reference}, an additional + * property references to the current node. + * + * @type {?ReferenceNode} + * @default null + */ + referenceNode: ReferenceNode | null; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isReferenceElementNode: boolean; + /** + * This method is overwritten since the node type is inferred from + * the uniform type of the reference node. + * + * @return {string} The node type. + */ + generateNodeType(): string; + generate(builder: any): any; +} +import ArrayElementNode from '../utils/ArrayElementNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/ReflectVector.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/ReflectVector.d.ts new file mode 100644 index 000000000..6cf15717c --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/ReflectVector.d.ts @@ -0,0 +1,28 @@ +/** + * The reflect vector in view space. + * + * @tsl + * @type {Node} + */ +export const reflectView: Node; +/** + * The refract vector in view space. + * + * @tsl + * @type {Node} + */ +export const refractView: Node; +/** + * Used for sampling cube maps when using cube reflection mapping. + * + * @tsl + * @type {Node} + */ +export const reflectVector: Node; +/** + * Used for sampling cube maps when using cube refraction mapping. + * + * @tsl + * @type {Node} + */ +export const refractVector: Node; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/RendererReferenceNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/RendererReferenceNode.d.ts new file mode 100644 index 000000000..43bd3b071 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/RendererReferenceNode.d.ts @@ -0,0 +1,33 @@ +export default RendererReferenceNode; +export function rendererReference(name: string, type: string, renderer?: Renderer | null): RendererReferenceNode; +/** + * This node is a special type of reference node which is intended + * for linking renderer properties with node values. + * ```js + * const exposureNode = rendererReference( 'toneMappingExposure', 'float', renderer ); + * ``` + * When changing `renderer.toneMappingExposure`, the node value of `exposureNode` will + * automatically be updated. + * + * @augments ReferenceBaseNode + */ +declare class RendererReferenceNode extends ReferenceBaseNode { + /** + * Constructs a new renderer reference node. + * + * @param {string} property - The name of the property the node refers to. + * @param {string} inputType - The uniform type that should be used to represent the property value. + * @param {?Renderer} [renderer=null] - The renderer the property belongs to. When no renderer is set, + * the node refers to the renderer of the current state. + */ + constructor(property: string, inputType: string, renderer?: Renderer | null); + /** + * The renderer the property belongs to. When no renderer is set, + * the node refers to the renderer of the current state. + * + * @type {?Renderer} + * @default null + */ + renderer: Renderer | null; +} +import ReferenceBaseNode from './ReferenceBaseNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/SceneProperties.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/SceneProperties.d.ts new file mode 100644 index 000000000..12f6b0aef --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/SceneProperties.d.ts @@ -0,0 +1,21 @@ +/** + * TSL object that represents the scene's background blurriness. + * + * @tsl + * @type {Node} + */ +export const backgroundBlurriness: Node; +/** + * TSL object that represents the scene's background intensity. + * + * @tsl + * @type {Node} + */ +export const backgroundIntensity: Node; +/** + * TSL object that represents the scene's background rotation. + * + * @tsl + * @type {Node} + */ +export const backgroundRotation: Node; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/SkinningNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/SkinningNode.d.ts new file mode 100644 index 000000000..d649f273b --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/SkinningNode.d.ts @@ -0,0 +1,122 @@ +export default SkinningNode; +export function skinning(skinnedMesh: SkinnedMesh): SkinningNode; +export function computeSkinning(skinnedMesh: SkinnedMesh, toPosition?: Node): SkinningNode; +/** + * This node implements the vertex transformation shader logic which is required + * for skinning/skeletal animation. + * + * @augments Node + */ +declare class SkinningNode extends Node { + /** + * Constructs a new skinning node. + * + * @param {SkinnedMesh} skinnedMesh - The skinned mesh. + */ + constructor(skinnedMesh: SkinnedMesh); + /** + * The skinned mesh. + * + * @type {SkinnedMesh} + */ + skinnedMesh: SkinnedMesh; + /** + * The skin index attribute. + * + * @type {AttributeNode} + */ + skinIndexNode: AttributeNode; + /** + * The skin weight attribute. + * + * @type {AttributeNode} + */ + skinWeightNode: AttributeNode; + /** + * The bind matrix node. + * + * @type {Node} + */ + bindMatrixNode: Node; + /** + * The bind matrix inverse node. + * + * @type {Node} + */ + bindMatrixInverseNode: Node; + /** + * The bind matrices as a uniform buffer node. + * + * @type {Node} + */ + boneMatricesNode: Node; + /** + * The current vertex position in local space. + * + * @type {Node} + */ + positionNode: Node; + /** + * The result of vertex position in local space. + * + * @type {Node} + */ + toPositionNode: Node; + /** + * The previous bind matrices as a uniform buffer node. + * Required for computing motion vectors. + * + * @type {?Node} + * @default null + */ + previousBoneMatricesNode: Node | null; + /** + * Transforms the given vertex position via skinning. + * + * @param {Node} [boneMatrices=this.boneMatricesNode] - The bone matrices + * @param {Node} [position=this.positionNode] - The vertex position in local space. + * @return {Node} The transformed vertex position. + */ + getSkinnedPosition(boneMatrices?: Node, position?: Node): Node; + /** + * Transforms the given vertex normal and tangent via skinning. + * + * @param {Node} [boneMatrices=this.boneMatricesNode] - The bone matrices + * @param {Node} [normal=normalLocal] - The vertex normal in local space. + * @param {Node} [tangent=tangentLocal] - The vertex tangent in local space. + * @return {{skinNormal: Node, skinTangent:Node}} The transformed vertex normal and tangent. + */ + getSkinnedNormalAndTangent(boneMatrices?: Node, normal?: Node, tangent?: Node): { + skinNormal: Node; + skinTangent: Node; + }; + /** + * Computes the transformed/skinned vertex position of the previous frame. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {Node} The skinned position from the previous frame. + */ + getPreviousSkinnedPosition(builder: NodeBuilder): Node; + /** + * Setups the skinning node by assigning the transformed vertex data to predefined node variables. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {Node} The transformed vertex position. + */ + setup(builder: NodeBuilder): Node; + /** + * Generates the code snippet of the skinning node. + * + * @param {NodeBuilder} builder - The current node builder. + * @param {string} output - The current output. + * @return {string} The generated code snippet. + */ + generate(builder: NodeBuilder, output: string): string; + /** + * Updates the state of the skinned mesh by updating the skeleton once per frame. + * + * @param {NodeFrame} frame - The current node frame. + */ + update(frame: NodeFrame): void; +} +import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/StorageBufferNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/StorageBufferNode.d.ts new file mode 100644 index 000000000..fea4f9cd4 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/StorageBufferNode.d.ts @@ -0,0 +1,183 @@ +export default StorageBufferNode; +export function storage(value: StorageBufferAttribute | StorageInstancedBufferAttribute | BufferAttribute, type?: (string | Struct) | null, count?: number): StorageBufferNode; +/** + * This node is used in context of compute shaders and allows to define a + * storage buffer for data. A typical workflow is to create instances of + * this node with the convenience functions `attributeArray()` or `instancedArray()`, + * setup up a compute shader that writes into the buffers and then convert + * the storage buffers to attribute nodes for rendering. + * + * ```js + * const positionBuffer = instancedArray( particleCount, 'vec3' ); // the storage buffer node + * + * const computeInit = Fn( () => { // the compute shader + * + * const position = positionBuffer.element( instanceIndex ); + * + * // compute position data + * + * position.x = 1; + * position.y = 1; + * position.z = 1; + * + * } )().compute( particleCount ); + * + * const particleMaterial = new THREE.SpriteNodeMaterial(); + * particleMaterial.positionNode = positionBuffer.toAttribute(); + * + * renderer.computeAsync( computeInit ); + * + * ``` + * + * @augments BufferNode + */ +declare class StorageBufferNode extends BufferNode { + /** + * Constructs a new storage buffer node. + * + * @param {StorageBufferAttribute|StorageInstancedBufferAttribute|BufferAttribute} value - The buffer data. + * @param {?(string|Struct)} [bufferType=null] - The buffer type (e.g. `'vec3'`). + * @param {number} [bufferCount=0] - The buffer count. + */ + constructor(value: StorageBufferAttribute | StorageInstancedBufferAttribute | BufferAttribute, bufferType?: (string | Struct) | null, bufferCount?: number); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isStorageBufferNode: boolean; + /** + * The buffer struct type. + * + * @type {?StructTypeNode} + * @default null + */ + structTypeNode: StructTypeNode | null; + /** + * The access type of the texture node. + * + * @type {string} + * @default 'readWrite' + */ + access: string; + /** + * Whether the node is atomic or not. + * + * @type {boolean} + * @default false + */ + isAtomic: boolean; + /** + * Whether the node represents a PBO or not. + * Only relevant for WebGL. + * + * @type {boolean} + * @default false + */ + isPBO: boolean; + /** + * A reference to the internal buffer attribute node. + * + * @private + * @type {?BufferAttributeNode} + * @default null + */ + private _attribute; + /** + * A reference to the internal varying node. + * + * @private + * @type {?VaryingNode} + * @default null + */ + private _varying; + /** + * This method is overwritten since the buffer data might be shared + * and thus the hash should be shared as well. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The hash. + */ + getHash(builder: NodeBuilder): string; + /** + * Enables element access with the given index node. + * + * @param {IndexNode} indexNode - The index node. + * @return {StorageArrayElementNode} A node representing the element access. + */ + element(indexNode: IndexNode): StorageArrayElementNode; + /** + * Defines whether this node is a PBO or not. Only relevant for WebGL. + * + * @param {boolean} value - The value so set. + * @return {StorageBufferNode} A reference to this node. + */ + setPBO(value: boolean): StorageBufferNode; + /** + * Returns the `isPBO` value. + * + * @return {boolean} Whether the node represents a PBO or not. + */ + getPBO(): boolean; + /** + * Defines the node access. + * + * @param {string} value - The node access. + * @return {StorageBufferNode} A reference to this node. + */ + setAccess(value: string): StorageBufferNode; + /** + * Convenience method for configuring a read-only node access. + * + * @return {StorageBufferNode} A reference to this node. + */ + toReadOnly(): StorageBufferNode; + /** + * Defines whether the node is atomic or not. + * + * @param {boolean} value - The atomic flag. + * @return {StorageBufferNode} A reference to this node. + */ + setAtomic(value: boolean): StorageBufferNode; + /** + * Convenience method for making this node atomic. + * + * @return {StorageBufferNode} A reference to this node. + */ + toAtomic(): StorageBufferNode; + /** + * Returns attribute data for this storage buffer node. + * + * @return {{attribute: BufferAttributeNode, varying: VaryingNode}} The attribute data. + */ + getAttributeData(): { + attribute: BufferAttributeNode; + varying: VaryingNode; + }; + /** + * This method is overwritten since the node type from the availability of storage buffers + * and the attribute data. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The node type. + */ + generateNodeType(builder: NodeBuilder): string; + /** + * Returns the type of a member of the struct. + * + * @param {NodeBuilder} builder - The current node builder. + * @param {string} name - The name of the member. + * @return {string} The type of the member. + */ + getMemberType(builder: NodeBuilder, name: string): string; + /** + * Generates the code snippet of the storage buffer node. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The generated code snippet. + */ + generate(builder: NodeBuilder): string; +} +import BufferNode from './BufferNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/StorageTextureNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/StorageTextureNode.d.ts new file mode 100644 index 000000000..ad559e11f --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/StorageTextureNode.d.ts @@ -0,0 +1,123 @@ +export default StorageTextureNode; +/** + * TSL function for creating a storage texture node. + * + * @tsl + * @function + * @param {StorageTexture} value - The storage texture. + * @param {?Node} uvNode - The uv node. + * @param {?Node} [storeNode=null] - The value node that should be stored in the texture. + * @returns {StorageTextureNode} + */ +export const storageTexture: any; +export function textureStore(value: StorageTexture, uvNode: Node, storeNode?: Node | null): StorageTextureNode; +/** + * This special version of a texture node can be used to + * write data into a storage texture with a compute shader. + * + * ```js + * const storageTexture = new THREE.StorageTexture( width, height ); + * + * const computeTexture = Fn( ( { storageTexture } ) => { + * + * const posX = instanceIndex.mod( width ); + * const posY = instanceIndex.div( width ); + * const indexUV = uvec2( posX, posY ); + * + * // generate RGB values + * + * const r = 1; + * const g = 1; + * const b = 1; + * + * textureStore( storageTexture, indexUV, vec4( r, g, b, 1 ) ).toWriteOnly(); + * + * } ); + * + * const computeNode = computeTexture( { storageTexture } ).compute( width * height ); + * renderer.computeAsync( computeNode ); + * ``` + * + * This node can only be used with a WebGPU backend. + * + * @augments TextureNode + */ +declare class StorageTextureNode extends TextureNode { + /** + * Constructs a new storage texture node. + * + * @param {StorageTexture} value - The storage texture. + * @param {Node} uvNode - The uv node. + * @param {?Node} [storeNode=null] - The value node that should be stored in the texture. + */ + constructor(value: StorageTexture, uvNode: Node, storeNode?: Node | null); + /** + * The value node that should be stored in the texture. + * + * @type {?Node} + * @default null + */ + storeNode: Node | null; + /** + * The mip level to write to for storage textures. + * + * @type {number} + * @default 0 + */ + mipLevel: number; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isStorageTextureNode: boolean; + /** + * The access type of the texture node. + * + * @type {string} + * @default 'writeOnly' + */ + access: string; + setup(builder: any): any; + /** + * Defines the node access. + * + * @param {string} value - The node access. + * @return {StorageTextureNode} A reference to this node. + */ + setAccess(value: string): StorageTextureNode; + /** + * Sets the mip level to write to. + * + * @param {number} level - The mip level. + * @return {StorageTextureNode} A reference to this node. + */ + setMipLevel(level: number): StorageTextureNode; + /** + * Convenience method for configuring a read/write node access. + * + * @return {StorageTextureNode} A reference to this node. + */ + toReadWrite(): StorageTextureNode; + /** + * Convenience method for configuring a read-only node access. + * + * @return {StorageTextureNode} A reference to this node. + */ + toReadOnly(): StorageTextureNode; + /** + * Convenience method for configuring a write-only node access. + * + * @return {StorageTextureNode} A reference to this node. + */ + toWriteOnly(): StorageTextureNode; + /** + * Generates the code snippet of the storage texture node. + * + * @param {NodeBuilder} builder - The current node builder. + */ + generateStore(builder: NodeBuilder): void; +} +import TextureNode from './TextureNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/Tangent.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/Tangent.d.ts new file mode 100644 index 000000000..fa48ada28 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/Tangent.d.ts @@ -0,0 +1,28 @@ +/** + * TSL object that represents the tangent attribute of the current rendered object. + * + * @tsl + * @type {Node} + */ +export const tangentGeometry: Node; +/** + * TSL object that represents the vertex tangent in local space of the current rendered object. + * + * @tsl + * @type {Node} + */ +export const tangentLocal: Node; +/** + * TSL object that represents the vertex tangent in view space of the current rendered object. + * + * @tsl + * @type {Node} + */ +export const tangentView: Node; +/** + * TSL object that represents the vertex tangent in world space of the current rendered object. + * + * @tsl + * @type {Node} + */ +export const tangentWorld: Node; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/TangentUtils.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/TangentUtils.d.ts new file mode 100644 index 000000000..5ae231172 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/TangentUtils.d.ts @@ -0,0 +1,20 @@ +/** + * Tangent vector in view space, computed dynamically from geometry and UV derivatives. + * Useful for normal mapping without precomputed tangents. + * + * Reference: http://www.thetenthplanet.de/archives/1180 + * + * @tsl + * @type {Node} + */ +export const tangentViewFrame: Node; +/** + * Bitangent vector in view space, computed dynamically from geometry and UV derivatives. + * Complements the tangentViewFrame for constructing the tangent space basis. + * + * Reference: http://www.thetenthplanet.de/archives/1180 + * + * @tsl + * @type {Node} + */ +export const bitangentViewFrame: Node; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/Texture3DNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/Texture3DNode.d.ts new file mode 100644 index 000000000..1b1066b8b --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/Texture3DNode.d.ts @@ -0,0 +1,54 @@ +export default Texture3DNode; +/** + * TSL function for creating a 3D texture node. + * + * @tsl + * @function + * @param {Data3DTexture} value - The 3D texture. + * @param {?Node} [uvNode=null] - The uv node. + * @param {?Node} [levelNode=null] - The level node. + * @returns {Texture3DNode} + */ +export const texture3D: any; +export function texture3DLoad(...params: any[]): TextureNode; +export function texture3DLevel(value?: (Texture | TextureNode) | null, uvNode?: Node | null, levelNode?: Node | null): TextureNode; +/** + * This type of uniform node represents a 3D texture. + * + * @augments TextureNode + */ +declare class Texture3DNode extends TextureNode { + /** + * Constructs a new 3D texture node. + * + * @param {Data3DTexture} value - The 3D texture. + * @param {?Node} [uvNode=null] - The uv node. + * @param {?Node} [levelNode=null] - The level node. + */ + constructor(value: Data3DTexture, uvNode?: Node | null, levelNode?: Node | null); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isTexture3DNode: boolean; + /** + * Overwritten with an empty implementation since the `updateMatrix` flag is ignored + * for 3D textures. The uv transformation matrix is not applied to 3D textures. + * + * @param {boolean} value - The update toggle. + */ + setUpdateMatrix(): void; + /** + * Computes the normal for the given uv. These texture coordiantes represent a + * position inside the 3D texture. Unlike geometric normals, this normal + * represents a slope or gradient of scalar data inside the 3D texture. + * + * @param {Node} uvNode - The uv node that defines a position in the 3D texture. + * @return {Node} The normal representing the slope/gradient in the data. + */ + normal(uvNode: Node): Node; +} +import TextureNode from './TextureNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/TextureBicubic.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/TextureBicubic.d.ts new file mode 100644 index 000000000..ff3a05aad --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/TextureBicubic.d.ts @@ -0,0 +1,20 @@ +/** + * Applies mipped bicubic texture filtering to the given texture node. + * + * @tsl + * @function + * @param {TextureNode} textureNode - The texture node that should be filtered. + * @param {Node} lodNode - Defines the LOD to sample from. + * @return {Node} The filtered texture sample. + */ +export const textureBicubicLevel: () => void; +/** + * Applies mipped bicubic texture filtering to the given texture node. + * + * @tsl + * @function + * @param {TextureNode} textureNode - The texture node that should be filtered. + * @param {Node} [strength] - Defines the strength of the bicubic filtering. + * @return {Node} The filtered texture sample. + */ +export const textureBicubic: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/TextureNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/TextureNode.d.ts new file mode 100644 index 000000000..b7233be58 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/TextureNode.d.ts @@ -0,0 +1,337 @@ +export default TextureNode; +export function texture(value?: (Texture | TextureNode) | null, uvNode?: Node | null, levelNode?: Node | null, biasNode?: Node | null): TextureNode; +export function uniformTexture(value?: Texture | null): TextureNode; +export function textureLoad(...params: any[]): TextureNode; +export function textureLevel(value: any, uv: any, level: any): TextureNode; +export function sampler(value: TextureNode | Texture): Node; +export function samplerComparison(value: TextureNode | Texture): Node; +/** + * This type of uniform node represents a 2D texture. + * + * @augments UniformNode + */ +declare class TextureNode extends UniformNode { + /** + * Constructs a new texture node. + * + * @param {Texture} [value=EmptyTexture] - The texture. + * @param {?Node} [uvNode=null] - The uv node. + * @param {?Node} [levelNode=null] - The level node. + * @param {?Node} [biasNode=null] - The bias node. + */ + constructor(value?: Texture, uvNode?: Node | null, levelNode?: Node | null, biasNode?: Node | null); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isTextureNode: boolean; + /** + * Represents the texture coordinates. + * + * @type {?Node} + * @default null + */ + uvNode: Node | null; + /** + * Represents the mip level that should be selected. + * + * @type {?Node} + * @default null + */ + levelNode: Node | null; + /** + * Represents the bias to be applied during level-of-detail computation. + * + * @type {?Node} + * @default null + */ + biasNode: Node | null; + /** + * Represents a reference value a texture sample is compared to. + * + * @type {?Node} + * @default null + */ + compareNode: Node | null; + /** + * When using texture arrays, the depth node defines the layer to select. + * + * @type {?Node} + * @default null + */ + depthNode: Node | null; + /** + * When defined, a texture is sampled using explicit gradients. + * + * @type {?Array>} + * @default null + */ + gradNode: Array> | null; + /** + * Represents the optional texel offset applied to the unnormalized texture + * coordinate before sampling the texture. + * + * @type {?Node} + * @default null + */ + offsetNode: Node | null; + /** + * Whether texture values should be sampled or fetched. + * + * @type {boolean} + * @default true + */ + sampler: boolean; + /** + * Whether the uv transformation matrix should be + * automatically updated or not. Use `setUpdateMatrix()` + * if you want to change the value of the property. + * + * @type {boolean} + * @default false + */ + updateMatrix: boolean; + /** + * The reference node. + * + * @type {?Node} + * @default null + */ + referenceNode: Node | null; + /** + * The texture value is stored in a private property. + * + * @private + * @type {Texture} + */ + private _value; + /** + * The uniform node that represents the uv transformation matrix. + * + * @private + * @type {?UniformNode} + * @default null + */ + private _matrixUniform; + /** + * The uniform node that represents the y-flip. Only required for WebGL. + * + * @private + * @type {?UniformNode} + * @default null + */ + private _flipYUniform; + set value(value: Texture); + /** + * The texture value. + * + * @type {Texture} + */ + get value(): Texture; + /** + * Overwritten since the uniform hash is defined by the texture's UUID. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The uniform hash. + */ + getUniformHash(): string; + /** + * Overwritten since the node type is inferred from the texture type. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The node type. + */ + generateNodeType(): string; + /** + * Overwrites the default implementation to return a fixed value `'texture'`. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The input type. + */ + getInputType(): string; + /** + * Returns a default uvs based on the current texture's channel. + * + * @return {AttributeNode} The default uvs. + */ + getDefaultUV(): AttributeNode; + /** + * Overwritten to always return the texture reference of the node. + * + * @param {any} state - This method can be invocated in different contexts so `state` can refer to any object type. + * @return {Texture} The texture reference. + */ + updateReference(): Texture; + /** + * Transforms the given uv node with the texture transformation matrix. + * + * @param {Node} uvNode - The uv node to transform. + * @return {Node} The transformed uv node. + */ + getTransformedUV(uvNode: Node): Node; + /** + * Defines whether the uv transformation matrix should automatically be updated or not. + * + * @param {boolean} value - The update toggle. + * @return {TextureNode} A reference to this node. + */ + setUpdateMatrix(value: boolean): TextureNode; + /** + * Setups the uv node. Depending on the backend as well as texture's image and type, it might be necessary + * to modify the uv node for correct sampling. + * + * @param {NodeBuilder} builder - The current node builder. + * @param {Node} uvNode - The uv node to setup. + * @return {Node} The updated uv node. + */ + setupUV(builder: NodeBuilder, uvNode: Node): Node; + /** + * Setups texture node by preparing the internal nodes for code generation. + * + * @param {NodeBuilder} builder - The current node builder. + */ + setup(builder: NodeBuilder): void; + /** + * Generates the uv code snippet. + * + * @param {NodeBuilder} builder - The current node builder. + * @param {Node} uvNode - The uv node to generate code for. + * @return {string} The generated code snippet. + */ + generateUV(builder: NodeBuilder, uvNode: Node): string; + /** + * Generates the offset code snippet. + * + * @param {NodeBuilder} builder - The current node builder. + * @param {Node} offsetNode - The offset node to generate code for. + * @return {string} The generated code snippet. + */ + generateOffset(builder: NodeBuilder, offsetNode: Node): string; + /** + * Generates the snippet for the texture sampling. + * + * @param {NodeBuilder} builder - The current node builder. + * @param {string} textureProperty - The texture property. + * @param {string} uvSnippet - The uv snippet. + * @param {?string} levelSnippet - The level snippet. + * @param {?string} biasSnippet - The bias snippet. + * @param {?string} depthSnippet - The depth snippet. + * @param {?string} compareSnippet - The compare snippet. + * @param {?Array} gradSnippet - The grad snippet. + * @param {?string} offsetSnippet - The offset snippet. + * @return {string} The generated code snippet. + */ + generateSnippet(builder: NodeBuilder, textureProperty: string, uvSnippet: string, levelSnippet: string | null, biasSnippet: string | null, depthSnippet: string | null, compareSnippet: string | null, gradSnippet: Array | null, offsetSnippet: string | null): string; + /** + * Generates the code snippet of the texture node. + * + * @param {NodeBuilder} builder - The current node builder. + * @param {string} output - The current output. + * @return {string} The generated code snippet. + */ + generate(builder: NodeBuilder, output: string): string; + /** + * Sets the sampler value. + * + * @param {boolean} value - The sampler value to set. + * @return {TextureNode} A reference to this texture node. + */ + setSampler(value: boolean): TextureNode; + /** + * Returns the sampler value. + * + * @return {boolean} The sampler value. + */ + getSampler(): boolean; + /** + * Samples the texture with the given uv node. + * + * @param {Node} uvNode - The uv node. + * @return {TextureNode} A texture node representing the texture sample. + */ + sample(uvNode: Node): TextureNode; + /** + * TSL function for creating a texture node that fetches/loads texels without interpolation. + * + * @param {Node} uvNode - The uv node. + * @returns {TextureNode} A texture node representing the texture load. + */ + load(uvNode: Node): TextureNode; + /** + * Samples a blurred version of the texture by defining an internal bias. + * + * @param {Node} amountNode - How blurred the texture should be. + * @return {TextureNode} A texture node representing the texture sample. + */ + blur(amountNode: Node): TextureNode; + /** + * Samples a specific mip of the texture. + * + * @param {Node} levelNode - The mip level to sample. + * @return {TextureNode} A texture node representing the texture sample. + */ + level(levelNode: Node): TextureNode; + /** + * Returns the texture size of the requested level. + * + * @param {Node} levelNode - The level to compute the size for. + * @return {TextureSizeNode} The texture size. + */ + size(levelNode: Node): TextureSizeNode; + /** + * Samples the texture with the given bias. + * + * @param {Node} biasNode - The bias node. + * @return {TextureNode} A texture node representing the texture sample. + */ + bias(biasNode: Node): TextureNode; + /** + * Returns the base texture of this node. + * @return {TextureNode} The base texture node. + */ + getBase(): TextureNode; + /** + * Samples the texture by executing a compare operation. + * + * @param {Node} compareNode - The node that defines the compare value. + * @return {TextureNode} A texture node representing the texture sample. + */ + compare(compareNode: Node): TextureNode; + /** + * Samples the texture using an explicit gradient. + * + * @param {Node} gradNodeX - The gradX node. + * @param {Node} gradNodeY - The gradY node. + * @return {TextureNode} A texture node representing the texture sample. + */ + grad(gradNodeX: Node, gradNodeY: Node): TextureNode; + /** + * Samples the texture by defining a depth node. + * + * @param {Node} depthNode - The depth node. + * @return {TextureNode} A texture node representing the texture sample. + */ + depth(depthNode: Node): TextureNode; + /** + * Samples the texture by defining an offset node. + * + * @param {Node} offsetNode - The offset node. + * @return {TextureNode} A texture node representing the texture sample. + */ + offset(offsetNode: Node): TextureNode; + /** + * The update is used to implement the update of the uv transformation matrix. + */ + update(): void; + /** + * Clones the texture node. + * + * @return {TextureNode} The cloned texture node. + */ + clone(): TextureNode; +} +import { Texture } from '../../textures/Texture.js'; +import UniformNode from '../core/UniformNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/TextureSizeNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/TextureSizeNode.d.ts new file mode 100644 index 000000000..994971036 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/TextureSizeNode.d.ts @@ -0,0 +1,50 @@ +export default TextureSizeNode; +/** + * TSL function for creating a texture size node. + * + * @tsl + * @function + * @param {TextureNode} textureNode - A texture node which size should be retrieved. + * @param {?Node} [levelNode=null] - A level node which defines the requested mip. + * @returns {TextureSizeNode} + */ +export const textureSize: any; +/** + * A node that represents the dimensions of a texture. The texture size is + * retrieved in the shader via built-in shader functions like `textureDimensions()` + * or `textureSize()`. + * + * @augments Node + */ +declare class TextureSizeNode extends Node { + /** + * Constructs a new texture size node. + * + * @param {TextureNode} textureNode - A texture node which size should be retrieved. + * @param {?Node} [levelNode=null] - A level node which defines the requested mip. + */ + constructor(textureNode: TextureNode, levelNode?: Node | null); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isTextureSizeNode: boolean; + /** + * A texture node which size should be retrieved. + * + * @type {TextureNode} + */ + textureNode: TextureNode; + /** + * A level node which defines the requested mip. + * + * @type {Node} + * @default null + */ + levelNode: Node; + generate(builder: any, output: any): any; +} +import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/UV.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/UV.d.ts new file mode 100644 index 000000000..959b2be65 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/UV.d.ts @@ -0,0 +1 @@ +export function uv(index?: number): AttributeNode; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/UniformArrayNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/UniformArrayNode.d.ts new file mode 100644 index 000000000..290ab3d93 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/UniformArrayNode.d.ts @@ -0,0 +1,125 @@ +export default UniformArrayNode; +export function uniformArray(values: Array, nodeType?: string | null): UniformArrayNode; +/** + * Similar to {@link BufferNode} this module represents array-like data as + * uniform buffers. Unlike {@link BufferNode}, it can handle more common + * data types in the array (e.g `three.js` primitives) and automatically + * manage buffer padding. It should be the first choice when working with + * uniforms buffers. + * ```js + * const tintColors = uniformArray( [ + * new Color( 1, 0, 0 ), + * new Color( 0, 1, 0 ), + * new Color( 0, 0, 1 ) + * ], 'color' ); + * + * const redColor = tintColors.element( 0 ); + * + * @augments BufferNode + */ +declare class UniformArrayNode extends BufferNode { + /** + * Constructs a new uniform array node. + * + * @param {Array} value - Array holding the buffer data. + * @param {?string} [elementType=null] - The data type of a buffer element. + */ + constructor(value: Array, elementType?: string | null); + /** + * Array holding the buffer data. Unlike {@link BufferNode}, the array can + * hold number primitives as well as three.js objects like vectors, matrices + * or colors. + * + * @type {Array} + */ + array: Array; + /** + * The data type of an array element. + * + * @type {string} + */ + elementType: string; + /** + * The padded type. Uniform buffers must conform to a certain buffer layout + * so a separate type is computed to ensure correct buffer size. + * + * @type {string} + */ + paddedType: string; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isArrayBufferNode: boolean; + /** + * This method is overwritten since the node type is inferred from the + * {@link UniformArrayNode#paddedType}. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The node type. + */ + generateNodeType(): string; + /** + * The data type of the array elements. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The element type. + */ + getElementType(): string; + /** + * Returns the padded type based on the element type. + * + * @return {string} The padded type. + */ + getPaddedType(): string; + /** + * The update makes sure to correctly transfer the data from the (complex) objects + * in the array to the internal, correctly padded value buffer. + * + * @param {NodeFrame} frame - A reference to the current node frame. + */ + update(): void; + /** + * Implement the value buffer creation based on the array data. + * + * @param {NodeBuilder} builder - A reference to the current node builder. + * @return {null} + */ + setup(builder: NodeBuilder): null; + /** + * Overwrites the default `element()` method to provide element access + * based on {@link UniformArrayNode}. + * + * @param {IndexNode} indexNode - The index node. + * @return {UniformArrayElementNode} + */ + element(indexNode: IndexNode): UniformArrayElementNode; +} +import BufferNode from './BufferNode.js'; +/** + * Represents the element access on uniform array nodes. + * + * @augments ArrayElementNode + */ +declare class UniformArrayElementNode extends ArrayElementNode { + /** + * Constructs a new buffer node. + * + * @param {UniformArrayNode} uniformArrayNode - The uniform array node to access. + * @param {IndexNode} indexNode - The index data that define the position of the accessed element in the array. + */ + constructor(uniformArrayNode: UniformArrayNode, indexNode: IndexNode); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isArrayBufferElementNode: boolean; + generate(builder: any): any; +} +import ArrayElementNode from '../utils/ArrayElementNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/UserDataNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/UserDataNode.d.ts new file mode 100644 index 000000000..e526f57c7 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/UserDataNode.d.ts @@ -0,0 +1,35 @@ +export default UserDataNode; +export function userData(name: string, inputType: string, userData: Object | null): UserDataNode; +/** + * A special type of reference node that allows to link values in + * `userData` fields to node objects. + * ```js + * sprite.userData.rotation = 1; // stores individual rotation per sprite + * + * const material = new THREE.SpriteNodeMaterial(); + * material.rotationNode = userData( 'rotation', 'float' ); + * ``` + * Since `UserDataNode` is extended from {@link ReferenceNode}, the node value + * will automatically be updated when the `rotation` user data field changes. + * + * @augments ReferenceNode + */ +declare class UserDataNode extends ReferenceNode { + /** + * Constructs a new user data node. + * + * @param {string} property - The property name that should be referenced by the node. + * @param {string} inputType - The node data type of the reference. + * @param {?Object} [userData=null] - A reference to the `userData` object. If not provided, the `userData` property of the 3D object that uses the node material is evaluated. + */ + constructor(property: string, inputType: string, userData?: Object | null); + /** + * A reference to the `userData` object. If not provided, the `userData` + * property of the 3D object that uses the node material is evaluated. + * + * @type {?Object} + * @default null + */ + userData: Object | null; +} +import ReferenceNode from './ReferenceNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/VelocityNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/VelocityNode.d.ts new file mode 100644 index 000000000..476ee206d --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/VelocityNode.d.ts @@ -0,0 +1,79 @@ +export default VelocityNode; +/** + * TSL object that represents the velocity of a render pass. + * + * @tsl + * @type {VelocityNode} + */ +export const velocity: VelocityNode; +/** + * A node for representing motion or velocity vectors. Foundation + * for advanced post processing effects like motion blur or TRAA. + * + * The node keeps track of the model, view and projection matrices + * of the previous frame and uses them to compute offsets in NDC space. + * These offsets represent the final velocity. + * + * @augments TempNode + */ +declare class VelocityNode extends TempNode { + /** + * Constructs a new vertex color node. + */ + constructor(); + /** + * The current projection matrix. + * + * @type {?Matrix4} + * @default null + */ + projectionMatrix: Matrix4 | null; + /** + * Uniform node representing the previous model matrix in world space. + * + * @type {UniformNode} + * @default null + */ + previousModelWorldMatrix: UniformNode; + /** + * Uniform node representing the previous projection matrix. + * + * @type {UniformNode} + * @default null + */ + previousProjectionMatrix: UniformNode; + /** + * Uniform node representing the previous view matrix. + * + * @type {UniformNode} + * @default null + */ + previousCameraViewMatrix: UniformNode; + /** + * Sets the given projection matrix. + * + * @param {Matrix4} projectionMatrix - The projection matrix to set. + */ + setProjectionMatrix(projectionMatrix: Matrix4): void; + /** + * Updates velocity specific uniforms. + * + * @param {NodeFrame} frame - A reference to the current node frame. + */ + update({ frameId, camera, object }: NodeFrame): void; + /** + * Overwritten to updated velocity specific uniforms. + * + * @param {NodeFrame} frame - A reference to the current node frame. + */ + updateAfter({ object }: NodeFrame): void; + /** + * Implements the velocity computation based on the previous and current vertex data. + * + * @param {NodeBuilder} builder - A reference to the current node builder. + * @return {Node} The motion vector. + */ + setup(): Node; +} +import TempNode from '../core/TempNode.js'; +import { Matrix4 } from '../../math/Matrix4.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/VertexColorNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/VertexColorNode.d.ts new file mode 100644 index 000000000..c55c763bd --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/accessors/VertexColorNode.d.ts @@ -0,0 +1,31 @@ +export default VertexColorNode; +export function vertexColor(index?: number): VertexColorNode; +/** + * An attribute node for representing vertex colors. + * + * @augments AttributeNode + */ +declare class VertexColorNode extends AttributeNode { + /** + * Constructs a new vertex color node. + * + * @param {number} index - The attribute index. + */ + constructor(index: number); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isVertexColorNode: boolean; + /** + * The attribute index to enable more than one sets of vertex colors. + * + * @type {number} + * @default 0 + */ + index: number; +} +import AttributeNode from '../core/AttributeNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/code/CodeNode.d.ts b/jsdoc-testing/jsdoc/nodes/code/CodeNode.d.ts new file mode 100644 index 000000000..13ca56a3d --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/code/CodeNode.d.ts @@ -0,0 +1,79 @@ +export default CodeNode; +/** + * TSL function for creating a code node. + * + * @tsl + * @function + * @param {string} [code] - The native code. + * @param {?Array} [includes=[]] - An array of includes. + * @param {?('js'|'wgsl'|'glsl')} [language=''] - The used language. + * @returns {CodeNode} + */ +export const code: any; +export function js(src: string, includes: Array): CodeNode; +export function wgsl(src: string, includes: Array): CodeNode; +export function glsl(src: string, includes: Array): CodeNode; +/** + * This class represents native code sections. It is the base + * class for modules like {@link FunctionNode} which allows to implement + * functions with native shader languages. + * + * @augments Node + */ +declare class CodeNode extends Node { + /** + * Constructs a new code node. + * + * @param {string} [code=''] - The native code. + * @param {Array} [includes=[]] - An array of includes. + * @param {('js'|'wgsl'|'glsl')} [language=''] - The used language. + */ + constructor(code?: string, includes?: Array, language?: ("js" | "wgsl" | "glsl")); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isCodeNode: boolean; + /** + * The native code. + * + * @type {string} + * @default '' + */ + code: string; + /** + * An array of includes + * + * @type {Array} + * @default [] + */ + includes: Array; + /** + * The used language. + * + * @type {('js'|'wgsl'|'glsl')} + * @default '' + */ + language: ("js" | "wgsl" | "glsl"); + /** + * Sets the includes of this code node. + * + * @param {Array} includes - The includes to set. + * @return {CodeNode} A reference to this node. + */ + setIncludes(includes: Array): CodeNode; + /** + * Returns the includes of this code node. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {Array} The includes. + */ + getIncludes(): Array; + generate(builder: any): any; + serialize(data: any): void; + deserialize(data: any): void; +} +import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/code/ExpressionNode.d.ts b/jsdoc-testing/jsdoc/nodes/code/ExpressionNode.d.ts new file mode 100644 index 000000000..47f1180ff --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/code/ExpressionNode.d.ts @@ -0,0 +1,35 @@ +export default ExpressionNode; +/** + * TSL function for creating an expression node. + * + * @tsl + * @function + * @param {string} [snippet] - The native code snippet. + * @param {?string} [nodeType='void'] - The node type. + * @returns {ExpressionNode} + */ +export const expression: any; +/** + * This class can be used to implement basic expressions in shader code. + * Basic examples for that are `return`, `continue` or `discard` statements. + * + * @augments Node + */ +declare class ExpressionNode extends Node { + /** + * Constructs a new expression node. + * + * @param {string} [snippet=''] - The native code snippet. + * @param {string} [nodeType='void'] - The node type. + */ + constructor(snippet?: string, nodeType?: string); + /** + * The native code snippet. + * + * @type {string} + * @default '' + */ + snippet: string; + generate(builder: any, output: any): any; +} +import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/code/FunctionCallNode.d.ts b/jsdoc-testing/jsdoc/nodes/code/FunctionCallNode.d.ts new file mode 100644 index 000000000..38783b5a5 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/code/FunctionCallNode.d.ts @@ -0,0 +1,70 @@ +export default FunctionCallNode; +export function call(func: any, ...params: any[]): FunctionCallNode; +/** + * This module represents the call of a {@link FunctionNode}. Developers are usually not confronted + * with this module since they use the predefined TSL syntax `wgslFn` and `glslFn` which encapsulate + * this logic. + * + * @augments TempNode + */ +declare class FunctionCallNode extends TempNode { + /** + * Constructs a new function call node. + * + * @param {?FunctionNode} functionNode - The function node. + * @param {Object} [parameters={}] - The parameters for the function call. + */ + constructor(functionNode?: FunctionNode | null, parameters?: { + [x: string]: Node; + }); + /** + * The function node. + * + * @type {?FunctionNode} + * @default null + */ + functionNode: FunctionNode | null; + /** + * The parameters of the function call. + * + * @type {Object} + * @default {} + */ + parameters: { + [x: string]: Node; + }; + /** + * Sets the parameters of the function call node. + * + * @param {Object} parameters - The parameters to set. + * @return {FunctionCallNode} A reference to this node. + */ + setParameters(parameters: { + [x: string]: Node; + }): FunctionCallNode; + /** + * Returns the parameters of the function call node. + * + * @return {Object} The parameters of this node. + */ + getParameters(): { + [x: string]: Node; + }; + /** + * Returns the type of this function call node. + * + * @param {NodeBuilder} builder - The current node builder. + * @returns {string} The type of this node. + */ + generateNodeType(builder: NodeBuilder): string; + /** + * Returns the function node of this function call node. + * + * @param {NodeBuilder} builder - The current node builder. + * @param {string} [name] - The name of the member. + * @returns {string} The type of the member. + */ + getMemberType(builder: NodeBuilder, name?: string): string; + generate(builder: any): string; +} +import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/code/FunctionNode.d.ts b/jsdoc-testing/jsdoc/nodes/code/FunctionNode.d.ts new file mode 100644 index 000000000..60a1aba65 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/code/FunctionNode.d.ts @@ -0,0 +1,76 @@ +export default FunctionNode; +export function glslFn(code: any, includes: any): { + (...params: any[]): any; + functionNode: FunctionNode; +}; +export function wgslFn(code: any, includes: any): { + (...params: any[]): any; + functionNode: FunctionNode; +}; +/** + * This class represents a native shader function. It can be used to implement + * certain aspects of a node material with native shader code. There are two predefined + * TSL functions for easier usage. + * + * - `wgslFn`: Creates a WGSL function node. + * - `glslFn`: Creates a GLSL function node. + * + * A basic example with one include looks like so: + * + * ```js + * const desaturateWGSLFn = wgslFn( ` + * fn desaturate( color:vec3 ) -> vec3 { + * let lum = vec3( 0.299, 0.587, 0.114 ); + * return vec3( dot( lum, color ) ); + * }` + *); + * const someWGSLFn = wgslFn( ` + * fn someFn( color:vec3 ) -> vec3 { + * return desaturate( color ); + * } + * `, [ desaturateWGSLFn ] ); + * material.colorNode = someWGSLFn( { color: texture( map ) } ); + *``` + * @augments CodeNode + */ +declare class FunctionNode extends CodeNode { + /** + * Constructs a new function node. + * + * @param {string} [code=''] - The native code. + * @param {Array} [includes=[]] - An array of includes. + * @param {('js'|'wgsl'|'glsl')} [language=''] - The used language. + */ + constructor(code?: string, includes?: Array, language?: ("js" | "wgsl" | "glsl")); + /** + * Returns the type of this function node. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The type. + */ + generateNodeType(builder: NodeBuilder): string; + /** + * Returns the type of a member of this function node. + * + * @param {NodeBuilder} builder - The current node builder. + * @param {string} name - The name of the member. + * @return {string} The type of the member. + */ + getMemberType(builder: NodeBuilder, name: string): string; + /** + * Returns the inputs of this function node. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {Array} The inputs. + */ + getInputs(builder: NodeBuilder): Array; + /** + * Returns the node function for this function node. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {NodeFunction} The node function. + */ + getNodeFunction(builder: NodeBuilder): NodeFunction; + generate(builder: any, output: any): any; +} +import CodeNode from './CodeNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/ArrayNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/ArrayNode.d.ts new file mode 100644 index 000000000..41339a0bd --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/ArrayNode.d.ts @@ -0,0 +1,76 @@ +export default ArrayNode; +export function array(...params: any[]): ArrayNode; +/** + * ArrayNode represents a collection of nodes, typically created using the {@link array} function. + * ```js + * const colors = array( [ + * vec3( 1, 0, 0 ), + * vec3( 0, 1, 0 ), + * vec3( 0, 0, 1 ) + * ] ); + * + * const redColor = tintColors.element( 0 ); + * ``` + * + * @augments TempNode + */ +declare class ArrayNode extends TempNode { + /** + * Constructs a new array node. + * + * @param {?string} nodeType - The data type of the elements. + * @param {number} count - Size of the array. + * @param {?Array} [values=null] - Array default values. + */ + constructor(nodeType: string | null, count: number, values?: Array | null); + /** + * Array size. + * + * @type {number} + */ + count: number; + /** + * Array default values. + * + * @type {?Array} + */ + values: Array | null; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isArrayNode: boolean; + /** + * Returns the number of elements in the node array. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {number} The number of elements in the node array. + */ + getArrayCount(): number; + /** + * Returns the node's type. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The type of the node. + */ + generateNodeType(builder: NodeBuilder): string; + /** + * Returns the type of a member variable. + * + * @param {NodeBuilder} builder - The current node builder. + * @param {string} name - The name of the member variable. + * @return {string} The type of the member variable. + */ + getMemberType(builder: NodeBuilder, name: string): string; + /** + * This method builds the output node and returns the resulting array as a shader string. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The generated shader string. + */ + generate(builder: NodeBuilder): string; +} +import TempNode from './TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/AssignNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/AssignNode.d.ts new file mode 100644 index 000000000..3f1ab4808 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/AssignNode.d.ts @@ -0,0 +1,65 @@ +export default AssignNode; +/** + * TSL function for creating an assign node. + * + * @tsl + * @function + * @param {Node} targetNode - The target node. + * @param {Node} sourceNode - The source type. + * @returns {AssignNode} + */ +export const assign: any; +/** + * These node represents an assign operation. Meaning a node is assigned + * to another node. + * + * @augments TempNode + */ +declare class AssignNode extends TempNode { + /** + * Constructs a new assign node. + * + * @param {Node} targetNode - The target node. + * @param {Node} sourceNode - The source type. + */ + constructor(targetNode: Node, sourceNode: Node); + /** + * The target node. + * + * @type {Node} + */ + targetNode: Node; + /** + * The source node. + * + * @type {Node} + */ + sourceNode: Node; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isAssignNode: boolean; + /** + * Whether this node is used more than once in context of other nodes. This method + * is overwritten since it always returns `false` (assigns are unique). + * + * @return {boolean} A flag that indicates if there is more than one dependency to other nodes. Always `false`. + */ + hasDependencies(): boolean; + generateNodeType(builder: any, output: any): any; + /** + * Whether a split is required when assigning source to target. This can happen when the component length of + * target and source data type does not match. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {boolean} Whether a split is required when assigning source to target. + */ + needsSplitAssign(builder: NodeBuilder): boolean; + setup(builder: any): void; + generate(builder: any, output: any): any; +} +import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/AttributeNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/AttributeNode.d.ts new file mode 100644 index 000000000..0f8b0bf15 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/AttributeNode.d.ts @@ -0,0 +1,41 @@ +export default AttributeNode; +export function attribute(name: string, nodeType?: string | null): AttributeNode; +/** + * Base class for representing shader attributes as nodes. + * + * @augments Node + */ +declare class AttributeNode extends Node { + /** + * Constructs a new attribute node. + * + * @param {string} attributeName - The name of the attribute. + * @param {?string} nodeType - The node type. + */ + constructor(attributeName: string, nodeType?: string | null); + _attributeName: string; + getHash(builder: any): string; + generateNodeType(builder: any): string | null; + /** + * Sets the attribute name to the given value. The method can be + * overwritten in derived classes if the final name must be computed + * analytically. + * + * @param {string} attributeName - The name of the attribute. + * @return {AttributeNode} A reference to this node. + */ + setAttributeName(attributeName: string): AttributeNode; + /** + * Returns the attribute name of this node. The method can be + * overwritten in derived classes if the final name must be computed + * analytically. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The attribute name. + */ + getAttributeName(): string; + generate(builder: any): any; + serialize(data: any): void; + deserialize(data: any): void; +} +import Node from './Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/BypassNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/BypassNode.d.ts new file mode 100644 index 000000000..db68f52f5 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/BypassNode.d.ts @@ -0,0 +1,54 @@ +export default BypassNode; +/** + * TSL function for creating a bypass node. + * + * @tsl + * @function + * @param {Node} outputNode - The output node. + * @param {Node} callNode - The call node. + * @returns {BypassNode} + */ +export const bypass: any; +/** + * The class generates the code of a given node but returns another node in the output. + * This can be used to call a method or node that does not return a value, i.e. + * type `void` on an input where returning a value is required. Example: + * + * ```js + * material.colorNode = myColor.bypass( runVoidFn() ) + *``` + * + * @augments Node + */ +declare class BypassNode extends Node { + /** + * Constructs a new bypass node. + * + * @param {Node} outputNode - The output node. + * @param {Node} callNode - The call node. + */ + constructor(outputNode: Node, callNode: Node); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isBypassNode: boolean; + /** + * The output node. + * + * @type {Node} + */ + outputNode: Node; + /** + * The call node. + * + * @type {Node} + */ + callNode: Node; + generateNodeType(builder: any): string; + generate(builder: any): string | Node | null; +} +import Node from './Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/ConstNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/ConstNode.d.ts new file mode 100644 index 000000000..f26ae9eb3 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/ConstNode.d.ts @@ -0,0 +1,25 @@ +export default ConstNode; +/** + * Class for representing a constant value in the shader. + * + * @augments InputNode + */ +declare class ConstNode extends InputNode { + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isConstNode: boolean; + /** + * Generates the shader string of the value with the current node builder. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The generated value as a shader string. + */ + generateConst(builder: NodeBuilder): string; + generate(builder: any, output: any): any; +} +import InputNode from './InputNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/ContextNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/ContextNode.d.ts new file mode 100644 index 000000000..40becdbad --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/ContextNode.d.ts @@ -0,0 +1,107 @@ +/** + * TSL function for defining a built-in shadow context for a given node. + * + * @tsl + * @function + * @param {ShadowNode} shadowNode - The shadow node representing the light's shadow. + * @param {Light} light - The light associated with the shadow. + * @param {Node} [node=null] - The node whose context should be modified. + * @returns {ContextNode} + */ +export function builtinShadowContext(shadowNode: ShadowNode, light: Light, node?: Node): ContextNode; +/** + * TSL function for defining a built-in ambient occlusion context for a given node. + * + * @tsl + * @function + * @param {Node} aoNode - The ambient occlusion value node to apply. + * @param {Node} [node=null] - The node whose context should be modified. + * @returns {ContextNode} + */ +export function builtinAOContext(aoNode: Node, node?: Node): ContextNode; +/** + * TSL function for defining a label context value for a given node. + * + * @tsl + * @function + * @deprecated + * @param {Node} node - The node whose context should be modified. + * @param {string} name - The name/label to set. + * @returns {ContextNode} + */ +export function label(node: Node, name: string): ContextNode; +export default ContextNode; +export function context(nodeOrValue?: Node | Object, value?: Object): ContextNode; +export function uniformFlow(node: Node): ContextNode; +export function setName(node: Node, name: string): ContextNode; +import Node from './Node.js'; +/** + * This node can be used as a context management component for another node. + * {@link NodeBuilder} performs its node building process in a specific context and + * this node allows the modify the context. A typical use case is to overwrite `getUV()` e.g.: + * + * ```js + *node.context( { getUV: () => customCoord } ); + *\// or + *material.contextNode = context( { getUV: () => customCoord } ); + *\// or + *renderer.contextNode = context( { getUV: () => customCoord } ); + *\// or + *scenePass.contextNode = context( { getUV: () => customCoord } ); + *``` + * @augments Node + */ +declare class ContextNode extends Node { + /** + * Constructs a new context node. + * + * @param {Node} node - The node whose context should be modified. + * @param {Object} [value={}] - The modified context data. + */ + constructor(node?: Node, value?: Object); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isContextNode: boolean; + /** + * The node whose context should be modified. + * + * @type {Node} + */ + node: Node; + /** + * The modified context data. + * + * @type {Object} + * @default {} + */ + value: Object; + /** + * This method is overwritten to ensure it returns the type of {@link ContextNode#node}. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The node type. + */ + generateNodeType(builder: NodeBuilder): string; + /** + * Gathers the context data from all parent context nodes. + * + * @return {Object} The gathered context data. + */ + getFlowContextData(): Object; + /** + * This method is overwritten to ensure it returns the member type of {@link ContextNode#node}. + * + * @param {NodeBuilder} builder - The current node builder. + * @param {string} name - The member name. + * @returns {string} The member type. + */ + getMemberType(builder: NodeBuilder, name: string): string; + analyze(builder: any): void; + setup(builder: any): void; + generate(builder: any, output: any): string | Node | null; +} diff --git a/jsdoc-testing/jsdoc/nodes/core/IndexNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/IndexNode.d.ts new file mode 100644 index 000000000..6117487c5 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/IndexNode.d.ts @@ -0,0 +1,88 @@ +export default IndexNode; +/** + * TSL object that represents the index of a vertex within a mesh. + * + * @tsl + * @type {IndexNode} + */ +export const vertexIndex: IndexNode; +/** + * TSL object that represents the index of either a mesh instance or an invocation of a compute shader. + * + * @tsl + * @type {IndexNode} + */ +export const instanceIndex: IndexNode; +/** + * TSL object that represents the index of the subgroup the current compute invocation belongs to. + * + * @tsl + * @type {IndexNode} + */ +export const subgroupIndex: IndexNode; +/** + * TSL object that represents the index of a compute invocation within the scope of a subgroup. + * + * @tsl + * @type {IndexNode} + */ +export const invocationSubgroupIndex: IndexNode; +/** + * TSL object that represents the index of a compute invocation within the scope of a workgroup load. + * + * @tsl + * @type {IndexNode} + */ +export const invocationLocalIndex: IndexNode; +/** + * TSL object that represents the index of a draw call. + * + * @tsl + * @type {IndexNode} + */ +export const drawIndex: IndexNode; +/** + * This class represents shader indices of different types. The following predefined node + * objects cover frequent use cases: + * + * - `vertexIndex`: The index of a vertex within a mesh. + * - `instanceIndex`: The index of either a mesh instance or an invocation of a compute shader. + * - `drawIndex`: The index of a draw call. + * - `invocationLocalIndex`: The index of a compute invocation within the scope of a workgroup load. + * - `invocationSubgroupIndex`: The index of a compute invocation within the scope of a subgroup. + * - `subgroupIndex`: The index of a compute invocation's subgroup within its workgroup. + * + * @augments Node + */ +declare class IndexNode extends Node { + /** + * Constructs a new index node. + * + * @param {('vertex'|'instance'|'subgroup'|'invocationLocal'|'invocationGlobal'|'invocationSubgroup'|'draw')} scope - The scope of the index node. + */ + constructor(scope: ("vertex" | "instance" | "subgroup" | "invocationLocal" | "invocationGlobal" | "invocationSubgroup" | "draw")); + /** + * The scope of the index node. + * + * @type {string} + */ + scope: string; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isIndexNode: boolean; + generate(builder: any): any; +} +declare namespace IndexNode { + let VERTEX: string; + let INSTANCE: string; + let SUBGROUP: string; + let INVOCATION_LOCAL: string; + let INVOCATION_SUBGROUP: string; + let DRAW: string; +} +import Node from './Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/InputNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/InputNode.d.ts new file mode 100644 index 000000000..fc285a964 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/InputNode.d.ts @@ -0,0 +1,61 @@ +export default InputNode; +/** + * Base class for representing data input nodes. + * + * @augments Node + */ +declare class InputNode extends Node { + /** + * Constructs a new input node. + * + * @param {any} value - The value of this node. This can be any JS primitive, functions, array buffers or even three.js objects (vector, matrices, colors). + * @param {?string} nodeType - The node type. If no explicit type is defined, the node tries to derive the type from its value. + */ + constructor(value: any, nodeType?: string | null); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isInputNode: boolean; + /** + * The value of this node. This can be any JS primitive, functions, array buffers or even three.js objects (vector, matrices, colors). + * + * @type {any} + */ + value: any; + /** + * The precision of the value in the shader. + * + * @type {?('low'|'medium'|'high')} + * @default null + */ + precision: ("low" | "medium" | "high") | null; + generateNodeType(): string | null; + /** + * Returns the input type of the node which is by default the node type. Derived modules + * might overwrite this method and use a fixed type or compute one analytically. + * + * A typical example for different input and node types are textures. The input type of a + * normal RGBA texture is `texture` whereas its node type is `vec4`. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The input type. + */ + getInputType(builder: NodeBuilder): string; + /** + * Sets the precision to the given value. The method can be + * overwritten in derived classes if the final precision must be computed + * analytically. + * + * @param {('low'|'medium'|'high')} precision - The precision of the input value in the shader. + * @return {InputNode} A reference to this node. + */ + setPrecision(precision: ("low" | "medium" | "high")): InputNode; + serialize(data: any): void; + deserialize(data: any): void; + generate(): void; +} +import Node from './Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/InspectorNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/InspectorNode.d.ts new file mode 100644 index 000000000..7fd327733 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/InspectorNode.d.ts @@ -0,0 +1,57 @@ +/** + * Creates an inspector node to wrap around a given node for inspection purposes. + * + * @tsl + * @param {Node} node - The node to inspect. + * @param {string} [name=''] - Optional name for the inspector node. + * @param {Function|null} [callback=null] - Optional callback to modify the node during setup. + * @returns {Node} The inspector node. + */ +export function inspector(node: Node, name?: string, callback?: Function | null): Node; +export default InspectorNode; +import Node from './Node.js'; +/** + * InspectorNode is a wrapper node that allows inspection of node values during rendering. + * It can be used to debug or analyze node outputs in the rendering pipeline. + * + * @augments Node + */ +declare class InspectorNode extends Node { + /** + * Creates an InspectorNode. + * + * @param {Node} node - The node to inspect. + * @param {string} [name=''] - Optional name for the inspector node. + * @param {Function|null} [callback=null] - Optional callback to modify the node during setup. + */ + constructor(node: Node, name?: string, callback?: Function | null); + node: Node; + callback: Function | null; + isInspectorNode: boolean; + /** + * Returns the name of the inspector node. + * + * @returns {string} + */ + getName(): string; + /** + * Updates the inspector node, allowing inspection of the wrapped node. + * + * @param {NodeFrame} frame - A reference to the current node frame. + */ + update(frame: NodeFrame): void; + /** + * Returns the type of the wrapped node. + * + * @param {NodeBuilder} builder - The node builder. + * @returns {string} + */ + generateNodeType(builder: NodeBuilder): string; + /** + * Sets up the inspector node. + * + * @param {NodeBuilder} builder - The node builder. + * @returns {Node} The setup node. + */ + setup(builder: NodeBuilder): Node; +} diff --git a/jsdoc-testing/jsdoc/nodes/core/IsolateNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/IsolateNode.d.ts new file mode 100644 index 000000000..23e65acba --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/IsolateNode.d.ts @@ -0,0 +1,55 @@ +/** + * TSL function for creating a cache node. + * + * @tsl + * @function + * @deprecated + * @param {Node} node - The node that should be cached. + * @param {boolean} [parent=true] - Whether this node refers to a shared parent cache or not. + * @returns {IsolateNode} + */ +export function cache(node: Node, parent?: boolean): IsolateNode; +export default IsolateNode; +export function isolate(node: Node): IsolateNode; +import Node from './Node.js'; +/** + * This node can be used as a cache management component for another node. + * Caching is in general used by default in {@link NodeBuilder} but this node + * allows the usage of a shared parent cache during the build process. + * + * @augments Node + */ +declare class IsolateNode extends Node { + /** + * Constructs a new cache node. + * + * @param {Node} node - The node that should be cached. + * @param {boolean} [parent=true] - Whether this node refers to a shared parent cache or not. + */ + constructor(node: Node, parent?: boolean); + /** + * The node that should be cached. + * + * @type {Node} + */ + node: Node; + /** + * Whether this node refers to a shared parent cache or not. + * + * @type {boolean} + * @default true + */ + parent: boolean; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isIsolateNode: boolean; + generateNodeType(builder: any): string; + build(builder: any, ...params: any[]): string | Node | null; + setParent(parent: any): this; + getParent(): boolean; +} diff --git a/jsdoc-testing/jsdoc/nodes/core/LightingModel.d.ts b/jsdoc-testing/jsdoc/nodes/core/LightingModel.d.ts new file mode 100644 index 000000000..e281d8a3c --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/LightingModel.d.ts @@ -0,0 +1,59 @@ +export default LightingModel; +/** + * Abstract class for implementing lighting models. The module defines + * multiple methods that concrete lighting models can implement. These + * methods are executed at different points during the light evaluation + * process. + */ +declare class LightingModel { + /** + * This method is intended for setting up lighting model and context data + * which are later used in the evaluation process. + * + * @abstract + * @param {NodeBuilder} builder - The current node builder. + */ + start(builder: NodeBuilder): void; + /** + * This method is intended for executing final tasks like final updates + * to the outgoing light. + * + * @abstract + * @param {NodeBuilder} builder - The current node builder. + */ + finish(): void; + /** + * This method is intended for implementing the direct light term and + * executed during the build process of directional, point and spot light nodes. + * + * @abstract + * @param {Object} lightData - The light data. + * @param {NodeBuilder} builder - The current node builder. + */ + direct(): void; + /** + * This method is intended for implementing the direct light term for + * rect area light nodes. + * + * @abstract + * @param {Object} lightData - The light data. + * @param {NodeBuilder} builder - The current node builder. + */ + directRectArea(): void; + /** + * This method is intended for implementing the indirect light term. + * + * @abstract + * @param {NodeBuilder} builder - The current node builder. + */ + indirect(): void; + /** + * This method is intended for implementing the ambient occlusion term. + * Unlike other methods, this method must be called manually by the lighting + * model in its indirect term. + * + * @abstract + * @param {NodeBuilder} builder - The current node builder. + */ + ambientOcclusion(): void; +} diff --git a/jsdoc-testing/jsdoc/nodes/core/MRTNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/MRTNode.d.ts new file mode 100644 index 000000000..8d1b4d0be --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/MRTNode.d.ts @@ -0,0 +1,106 @@ +/** + * Returns the MRT texture index for the given name. + * + * @param {Array} textures - The textures of a MRT-configured render target. + * @param {string} name - The name of the MRT texture which index is requested. + * @return {number} The texture index. + */ +export function getTextureIndex(textures: Array, name: string): number; +export default MRTNode; +/** + * TSL function for creating a MRT node. + * + * @tsl + * @function + * @param {Object} outputNodes - The MRT outputs. + * @returns {MRTNode} + */ +export const mrt: any; +/** + * This node can be used setup a MRT context for rendering. A typical MRT setup for + * post-processing is shown below: + * ```js + * const mrtNode = mrt( { + * output: output, + * normal: normalView + * } ) ; + * ``` + * The MRT output is defined as a dictionary. + * + * @augments OutputStructNode + */ +declare class MRTNode extends OutputStructNode { + /** + * Constructs a new output struct node. + * + * @param {Object} outputNodes - The MRT outputs. + */ + constructor(outputNodes: { + [x: string]: Node; + }); + /** + * A dictionary representing the MRT outputs. The key + * is the name of the output, the value the node which produces + * the output result. + * + * @type {Object} + */ + outputNodes: { + [x: string]: Node; + }; + /** + * A dictionary storing the blend modes for each output. + * + * @type {Object} + */ + blendModes: { + [x: string]: BlendMode; + }; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isMRTNode: boolean; + /** + * Sets the blend mode for the given output name. + * + * @param {string} name - The name of the output. + * @param {BlendMode} blend - The blending mode. + * @return {MRTNode} The current MRT node. + */ + setBlendMode(name: string, blend: BlendMode): MRTNode; + /** + * Returns the blend mode for the given output name. + * + * @param {string} name - The name of the output. + * @return {BlendMode} The blend mode. + */ + getBlendMode(name: string): BlendMode; + /** + * Returns `true` if the MRT node has an output with the given name. + * + * @param {string} name - The name of the output. + * @return {NodeBuilder} Whether the MRT node has an output for the given name or not. + */ + has(name: string): NodeBuilder; + /** + * Returns the output node for the given name. + * + * @param {string} name - The name of the output. + * @return {Node} The output node. + */ + get(name: string): Node; + /** + * Merges the outputs of the given MRT node with the outputs of this node. + * + * @param {MRTNode} mrtNode - The MRT to merge. + * @return {MRTNode} A new MRT node with merged outputs.. + */ + merge(mrtNode: MRTNode): MRTNode; + setup(builder: any): import("./Node.js").default | null; +} +import OutputStructNode from './OutputStructNode.js'; +import BlendMode from '../../renderers/common/BlendMode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/Node.d.ts b/jsdoc-testing/jsdoc/nodes/core/Node.d.ts new file mode 100644 index 000000000..8299d6c54 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/Node.d.ts @@ -0,0 +1,437 @@ +export default Node; +/** + * Base class for all nodes. + * + * @augments EventDispatcher + */ +declare class Node extends EventDispatcher { + static get type(): string; + /** + * Constructs a new node. + * + * @param {?string} nodeType - The node type. + */ + constructor(nodeType?: string | null); + /** + * The node type. This represents the result type of the node (e.g. `float` or `vec3`). + * + * @type {?string} + * @default null + */ + nodeType: string | null; + /** + * The update type of the node's {@link Node#update} method. Possible values are listed in {@link NodeUpdateType}. + * + * @type {string} + * @default 'none' + */ + updateType: string; + /** + * The update type of the node's {@link Node#updateBefore} method. Possible values are listed in {@link NodeUpdateType}. + * + * @type {string} + * @default 'none' + */ + updateBeforeType: string; + /** + * The update type of the node's {@link Node#updateAfter} method. Possible values are listed in {@link NodeUpdateType}. + * + * @type {string} + * @default 'none' + */ + updateAfterType: string; + /** + * The version of the node. The version automatically is increased when {@link Node#needsUpdate} is set to `true`. + * + * @type {number} + * @readonly + * @default 0 + */ + readonly version: number; + /** + * The name of the node. + * + * @type {string} + * @default '' + */ + name: string; + /** + * Whether this node is global or not. This property is relevant for the internal + * node caching system. All nodes which should be declared just once should + * set this flag to `true` (a typical example is {@link AttributeNode}). + * + * @type {boolean} + * @default false + */ + global: boolean; + /** + * Create a list of parents for this node during the build process. + * + * @type {boolean} + * @default false + */ + parents: boolean; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isNode: boolean; + _beforeNodes: any; + /** + * The cache key of this node. + * + * @private + * @type {?number} + * @default null + */ + private _cacheKey; + /** + * The UUID of the node. + * + * @type {string} + * @default null + * @private + */ + private _uuid; + /** + * The cache key's version. + * + * @private + * @type {number} + * @default 0 + */ + private _cacheKeyVersion; + /** + * The unique ID of the node. + * + * @type {number} + * @readonly + */ + readonly id: number; + /** + * The stack trace of the node for debugging purposes. + * + * @type {?string} + * @default null + */ + stackTrace: string | null; + /** + * Set this property to `true` when the node should be regenerated. + * + * @type {boolean} + * @default false + * @param {boolean} value + */ + set needsUpdate(value: boolean); + /** + * The UUID of the node. + * + * @type {string} + * @readonly + */ + readonly get uuid(): string; + /** + * The type of the class. The value is usually the constructor name. + * + * @type {string} + * @readonly + */ + readonly get type(): string; + /** + * Convenient method for defining {@link Node#update}. + * + * @param {Function} callback - The update method. + * @param {string} updateType - The update type. + * @return {Node} A reference to this node. + */ + onUpdate(callback: Function, updateType: string): Node; + /** + * The method can be implemented to update the node's internal state when it is used to render an object. + * The {@link Node#updateType} property defines how often the update is executed. + * + * @abstract + * @param {NodeFrame} frame - A reference to the current node frame. + * @return {?boolean} An optional bool that indicates whether the implementation actually performed an update or not (e.g. due to caching). + */ + update(): boolean | null; + /** + * Convenient method for defining {@link Node#update}. Similar to {@link Node#onUpdate}, but + * this method automatically sets the update type to `FRAME`. + * + * @param {Function} callback - The update method. + * @return {Node} A reference to this node. + */ + onFrameUpdate(callback: Function): Node; + /** + * Convenient method for defining {@link Node#update}. Similar to {@link Node#onUpdate}, but + * this method automatically sets the update type to `RENDER`. + * + * @param {Function} callback - The update method. + * @return {Node} A reference to this node. + */ + onRenderUpdate(callback: Function): Node; + /** + * Convenient method for defining {@link Node#update}. Similar to {@link Node#onUpdate}, but + * this method automatically sets the update type to `OBJECT`. + * + * @param {Function} callback - The update method. + * @return {Node} A reference to this node. + */ + onObjectUpdate(callback: Function): Node; + /** + * Convenient method for defining {@link Node#updateReference}. + * + * @param {Function} callback - The update method. + * @return {Node} A reference to this node. + */ + onReference(callback: Function): Node; + /** + * Nodes might refer to other objects like materials. This method allows to dynamically update the reference + * to such objects based on a given state (e.g. the current node frame or builder). + * + * @param {any} state - This method can be invocated in different contexts so `state` can refer to any object type. + * @return {any} The updated reference. + */ + updateReference(): any; + /** + * By default this method returns the value of the {@link Node#global} flag. This method + * can be overwritten in derived classes if an analytical way is required to determine the + * global cache referring to the current shader-stage. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {boolean} Whether this node is global or not. + */ + isGlobal(): boolean; + /** + * Generator function that can be used to iterate over the child nodes. + * + * @generator + * @yields {Node} A child node. + */ + getChildren(): Generator; + /** + * Calling this method dispatches the `dispose` event. This event can be used + * to register event listeners for clean up tasks. + */ + dispose(): void; + /** + * Callback for {@link Node#traverse}. + * + * @callback traverseCallback + * @param {Node} node - The current node. + */ + /** + * Can be used to traverse through the node's hierarchy. + * + * @param {traverseCallback} callback - A callback that is executed per node. + */ + traverse(callback: (node: Node) => any): void; + /** + * Returns the child nodes of this node. + * + * @private + * @param {Set} [ignores=new Set()] - A set of nodes to ignore during the search to avoid circular references. + * @returns {Array} An array of objects describing the child nodes. + */ + private _getChildren; + /** + * Returns the cache key for this node. + * + * @param {boolean} [force=false] - When set to `true`, a recomputation of the cache key is forced. + * @param {Set} [ignores=null] - A set of nodes to ignore during the computation of the cache key. + * @return {number} The cache key of the node. + */ + getCacheKey(force?: boolean, ignores?: Set): number; + /** + * Generate a custom cache key for this node. + * + * @return {number} The cache key of the node. + */ + customCacheKey(): number; + /** + * Returns the references to this node which is by default `this`. + * + * @return {Node} A reference to this node. + */ + getScope(): Node; + /** + * Returns the hash of the node which is used to identify the node. By default it's + * the {@link Node#uuid} however derived node classes might have to overwrite this method + * depending on their implementation. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The hash. + */ + getHash(): string; + /** + * Returns the update type of {@link Node#update}. + * + * @return {NodeUpdateType} The update type. + */ + getUpdateType(): { + NONE: string; + FRAME: string; + RENDER: string; + OBJECT: string; + }; + /** + * Returns the update type of {@link Node#updateBefore}. + * + * @return {NodeUpdateType} The update type. + */ + getUpdateBeforeType(): { + NONE: string; + FRAME: string; + RENDER: string; + OBJECT: string; + }; + /** + * Returns the update type of {@link Node#updateAfter}. + * + * @return {NodeUpdateType} The update type. + */ + getUpdateAfterType(): { + NONE: string; + FRAME: string; + RENDER: string; + OBJECT: string; + }; + /** + * Certain types are composed of multiple elements. For example a `vec3` + * is composed of three `float` values. This method returns the type of + * these elements. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The type of the node. + */ + getElementType(builder: NodeBuilder): string; + /** + * Returns the node member type for the given name. + * + * @param {NodeBuilder} builder - The current node builder. + * @param {string} name - The name of the member. + * @return {string} The type of the node. + */ + getMemberType(): string; + /** + * Returns the node's type. + * + * @param {NodeBuilder} builder - The current node builder. + * @param {string} [output=null] - The output of the node. + * @return {string} The type of the node. + */ + getNodeType(builder: NodeBuilder, output?: string): string; + /** + * Returns the node's type. + * + * @param {NodeBuilder} builder - The current node builder. + * @param {string} [output=null] - The output of the node. + * @return {string} The type of the node. + */ + generateNodeType(builder: NodeBuilder, output?: string): string; + /** + * This method is used during the build process of a node and ensures + * equal nodes are not built multiple times but just once. For example if + * `attribute( 'uv' )` is used multiple times by the user, the build + * process makes sure to process just the first node. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {Node} The shared node if possible. Otherwise `this` is returned. + */ + getShared(builder: NodeBuilder): Node; + /** + * Returns the number of elements in the node array. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {?number} The number of elements in the node array. + */ + getArrayCount(): number | null; + /** + * Represents the setup stage which is the first step of the build process, see {@link Node#build} method. + * This method is often overwritten in derived modules to prepare the node which is used as a node's output/result. + * If an output node is prepared, then it must be returned in the `return` statement of the derived module's setup function. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {?Node} The output node. + */ + setup(builder: NodeBuilder): Node | null; + /** + * Represents the analyze stage which is the second step of the build process, see {@link Node#build} method. + * This stage analyzes the node hierarchy and ensures descendent nodes are built. + * + * @param {NodeBuilder} builder - The current node builder. + * @param {?Node} output - The target output node. + */ + analyze(builder: NodeBuilder, output?: Node | null): void; + /** + * Represents the generate stage which is the third step of the build process, see {@link Node#build} method. + * This state builds the output node and returns the resulting shader string. + * + * @param {NodeBuilder} builder - The current node builder. + * @param {?string} [output] - Can be used to define the output type. + * @return {?string} The generated shader string. + */ + generate(builder: NodeBuilder, output?: string | null): string | null; + /** + * The method can be implemented to update the node's internal state before it is used to render an object. + * The {@link Node#updateBeforeType} property defines how often the update is executed. + * + * @abstract + * @param {NodeFrame} frame - A reference to the current node frame. + * @return {?boolean} An optional bool that indicates whether the implementation actually performed an update or not (e.g. due to caching). + */ + updateBefore(): boolean | null; + /** + * The method can be implemented to update the node's internal state after it was used to render an object. + * The {@link Node#updateAfterType} property defines how often the update is executed. + * + * @abstract + * @param {NodeFrame} frame - A reference to the current node frame. + * @return {?boolean} An optional bool that indicates whether the implementation actually performed an update or not (e.g. due to caching). + */ + updateAfter(): boolean | null; + before(node: any): this; + /** + * This method performs the build of a node. The behavior and return value depend on the current build stage: + * - **setup**: Prepares the node and its children for the build process. This process can also create new nodes. Returns the node itself or a variant. + * - **analyze**: Analyzes the node hierarchy for optimizations in the code generation stage. Returns `null`. + * - **generate**: Generates the shader code for the node. Returns the generated shader string. + * + * @param {NodeBuilder} builder - The current node builder. + * @param {?(string|Node)} [output=null] - Can be used to define the output type. + * @return {?(Node|string)} The result of the build process, depending on the build stage. + */ + build(builder: NodeBuilder, output?: (string | Node) | null): (Node | string) | null; + /** + * Returns the child nodes as a JSON object. + * + * @return {Generator} An iterable list of serialized child objects as JSON. + */ + getSerializeChildren(): Generator; + /** + * Serializes the node to JSON. + * + * @param {Object} json - The output JSON object. + */ + serialize(json: Object): void; + /** + * Deserializes the node from the given JSON. + * + * @param {Object} json - The JSON object. + */ + deserialize(json: Object): void; + /** + * Serializes the node into the three.js JSON Object/Scene format. + * + * @param {?Object} meta - An optional JSON object that already holds serialized data from other scene objects. + * @return {Object} The serialized node. + */ + toJSON(meta: Object | null): Object; +} +declare namespace Node { + let captureStackTrace: boolean; +} +import { EventDispatcher } from '../../core/EventDispatcher.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/NodeAttribute.d.ts b/jsdoc-testing/jsdoc/nodes/core/NodeAttribute.d.ts new file mode 100644 index 000000000..d6414185f --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/NodeAttribute.d.ts @@ -0,0 +1,44 @@ +export default NodeAttribute; +/** + * {@link NodeBuilder} is going to create instances of this class during the build process + * of nodes. They represent the final shader attributes that are going to be generated + * by the builder. Arrays of node attributes is maintained in {@link NodeBuilder#attributes} + * and {@link NodeBuilder#bufferAttributes} for this purpose. + */ +declare class NodeAttribute { + /** + * Constructs a new node attribute. + * + * @param {string} name - The name of the attribute. + * @param {string} type - The type of the attribute. + * @param {?Node} node - An optional reference to the node. + */ + constructor(name: string, type: string, node?: Node | null); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isNodeAttribute: boolean; + /** + * The name of the attribute. + * + * @type {string} + */ + name: string; + /** + * The type of the attribute. + * + * @type {string} + */ + type: string; + /** + * An optional reference to the node. + * + * @type {?Node} + * @default null + */ + node: Node | null; +} diff --git a/jsdoc-testing/jsdoc/nodes/core/NodeBuilder.d.ts b/jsdoc-testing/jsdoc/nodes/core/NodeBuilder.d.ts new file mode 100644 index 000000000..7cccc1b1f --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/NodeBuilder.d.ts @@ -0,0 +1,1322 @@ +export default NodeBuilder; +/** + * Base class for builders which generate a shader program based + * on a 3D object and its node material definition. + */ +declare class NodeBuilder { + /** + * Constructs a new node builder. + * + * @param {Object3D} object - The 3D object. + * @param {Renderer} renderer - The current renderer. + * @param {NodeParser} parser - A reference to a node parser. + */ + constructor(object: Object3D, renderer: Renderer, parser: NodeParser); + /** + * The 3D object. + * + * @type {Object3D} + */ + object: Object3D; + /** + * The material of the 3D object. + * + * @type {?Material} + */ + material: Material | null; + /** + * The geometry of the 3D object. + * + * @type {?BufferGeometry} + */ + geometry: BufferGeometry | null; + /** + * The current renderer. + * + * @type {Renderer} + */ + renderer: Renderer; + /** + * A reference to a node parser. + * + * @type {NodeParser} + */ + parser: NodeParser; + /** + * The scene the 3D object belongs to. + * + * @type {?Scene} + * @default null + */ + scene: Scene | null; + /** + * The camera the 3D object is rendered with. + * + * @type {?Camera} + * @default null + */ + camera: Camera | null; + /** + * A list of all nodes the builder is processing + * for this 3D object. + * + * @type {Array} + */ + nodes: Array; + /** + * A list of all nodes the builder is processing in sequential order. + * + * This is used to determine the update order of nodes, which is important for + * {@link NodeUpdateType#UPDATE_BEFORE} and {@link NodeUpdateType#UPDATE_AFTER}. + * + * @type {Array} + */ + sequentialNodes: Array; + /** + * A list of all nodes which {@link Node#update} method should be executed. + * + * @type {Array} + */ + updateNodes: Array; + /** + * A list of all nodes which {@link Node#updateBefore} method should be executed. + * + * @type {Array} + */ + updateBeforeNodes: Array; + /** + * A list of all nodes which {@link Node#updateAfter} method should be executed. + * + * @type {Array} + */ + updateAfterNodes: Array; + /** + * A dictionary that assigns each node to a unique hash. + * + * @type {Object} + */ + hashNodes: { + [x: number]: Node; + }; + /** + * A reference to a node material observer. + * + * @type {?NodeMaterialObserver} + * @default null + */ + observer: NodeMaterialObserver | null; + /** + * A reference to the current lights node. + * + * @type {?LightsNode} + * @default null + */ + lightsNode: LightsNode | null; + /** + * A reference to the current environment node. + * + * @type {?Node} + * @default null + */ + environmentNode: Node | null; + /** + * A reference to the current fog node. + * + * @type {?Node} + * @default null + */ + fogNode: Node | null; + /** + * The current clipping context. + * + * @type {?ClippingContext} + */ + clippingContext: ClippingContext | null; + /** + * The generated vertex shader. + * + * @type {?string} + */ + vertexShader: string | null; + /** + * The generated fragment shader. + * + * @type {?string} + */ + fragmentShader: string | null; + /** + * The generated compute shader. + * + * @type {?string} + */ + computeShader: string | null; + /** + * Nodes used in the primary flow of code generation. + * + * @type {Object>} + */ + flowNodes: { + [x: string]: Node[]; + }; + /** + * Nodes code from `.flowNodes`. + * + * @type {Object} + */ + flowCode: { + [x: string]: string; + }; + /** + * This dictionary holds the node uniforms of the builder. + * The uniforms are maintained in an array for each shader stage. + * + * @type {Object} + */ + uniforms: Object; + /** + * This dictionary holds the output structs of the builder. + * The structs are maintained in an array for each shader stage. + * + * @type {Object} + */ + structs: Object; + /** + * This dictionary holds the types of the builder. + * + * @type {Object} + */ + types: Object; + /** + * This dictionary holds the bindings for each shader stage. + * + * @type {Object} + */ + bindings: Object; + /** + * This dictionary maintains the binding indices per bind group. + * + * @type {Object} + */ + bindingsIndexes: Object; + /** + * Reference to the array of bind groups. + * + * @type {?Array} + */ + bindGroups: Array | null; + /** + * This array holds the node attributes of this builder + * created via {@link AttributeNode}. + * + * @type {Array} + */ + attributes: Array; + /** + * This array holds the node attributes of this builder + * created via {@link BufferAttributeNode}. + * + * @type {Array} + */ + bufferAttributes: Array; + /** + * This array holds the node varyings of this builder. + * + * @type {Array} + */ + varyings: Array; + /** + * This dictionary holds the (native) node codes of this builder. + * The codes are maintained in an array for each shader stage. + * + * @type {Object>} + */ + codes: { + [x: string]: NodeCode[]; + }; + /** + * This dictionary holds the node variables of this builder. + * The variables are maintained in an array for each shader stage. + * This dictionary is also used to count the number of variables + * according to their type (const, vars). + * + * @type {Object|number>} + */ + vars: { + [x: string]: number | NodeVar[]; + }; + /** + * This dictionary holds the declarations for each shader stage. + * + * @type {Object} + */ + declarations: Object; + /** + * Current code flow. + * All code generated in this stack will be stored in `.flow`. + * + * @type {{code: string}} + */ + flow: { + code: string; + }; + /** + * A chain of nodes. + * Used to check recursive calls in node-graph. + * + * @type {Array} + */ + chaining: Array; + /** + * The current stack. + * This reflects the current process in the code block hierarchy, + * it is useful to know if the current process is inside a conditional for example. + * + * @type {StackNode} + */ + stack: StackNode; + /** + * List of stack nodes. + * The current stack hierarchy is stored in an array. + * + * @type {Array} + */ + stacks: Array; + /** + * A tab value. Used for shader string generation. + * + * @type {string} + * @default '\t' + */ + tab: string; + /** + * Reference to the current function node. + * + * @type {?FunctionNode} + * @default null + */ + currentFunctionNode: FunctionNode | null; + /** + * The builder's context. + * + * @type {Object} + */ + context: Object; + /** + * The builder's cache. + * + * @type {NodeCache} + */ + cache: NodeCache; + /** + * Since the {@link NodeBuilder#cache} might be temporarily + * overwritten by other caches, this member retains the reference + * to the builder's own cache. + * + * @type {NodeCache} + * @default this.cache + */ + globalCache: NodeCache; + flowsData: WeakMap; + /** + * The current shader stage. + * + * @type {?('vertex'|'fragment'|'compute'|'any')} + */ + shaderStage: ("vertex" | "fragment" | "compute" | "any") | null; + /** + * The current build stage. + * + * @type {?('setup'|'analyze'|'generate')} + */ + buildStage: ("setup" | "analyze" | "generate") | null; + /** + * The sub-build layers. + * + * @type {Array} + * @default [] + */ + subBuildLayers: Array; + /** + * The active stack nodes. + * + * @type {Array} + */ + activeStacks: Array; + /** + * The current sub-build TSL function(Fn). + * + * @type {?string} + * @default null + */ + subBuildFn: string | null; + /** + * The current TSL function(Fn) call node. + * + * @type {?Node} + * @default null + */ + fnCall: Node | null; + /** + * Whether the material is using flat shading or not. + * + * @returns {boolean} Whether the material is using flat shading or not. + */ + isFlatShading(): boolean; + /** + * Whether the material is opaque or not. + * + * @return {boolean} Whether the material is opaque or not. + */ + isOpaque(): boolean; + /** + * Factory method for creating an instance of {@link RenderTarget} with the given + * dimensions and options. + * + * @param {number} width - The width of the render target. + * @param {number} height - The height of the render target. + * @param {Object} options - The options of the render target. + * @return {RenderTarget} The render target. + */ + createRenderTarget(width: number, height: number, options: Object): RenderTarget; + /** + * Factory method for creating an instance of {@link CubeRenderTarget} with the given + * dimensions and options. + * + * @param {number} size - The size of the cube render target. + * @param {Object} options - The options of the cube render target. + * @return {CubeRenderTarget} The cube render target. + */ + createCubeRenderTarget(size: number, options: Object): CubeRenderTarget; + /** + * Whether the given node is included in the internal array of nodes or not. + * + * @param {Node} node - The node to test. + * @return {boolean} Whether the given node is included in the internal array of nodes or not. + */ + includes(node: Node): boolean; + /** + * Returns the output struct name which is required by + * {@link OutputStructNode}. + * + * @abstract + * @return {string} The name of the output struct. + */ + getOutputStructName(): string; + /** + * Returns a bind group for the given group name and binding. + * + * @private + * @param {string} groupName - The group name. + * @param {Array} bindings - List of bindings. + * @return {BindGroup} The bind group + */ + private _getBindGroup; + /** + * Returns an array of node uniform groups for the given group name and shader stage. + * + * @param {string} groupName - The group name. + * @param {('vertex'|'fragment'|'compute'|'any')} shaderStage - The shader stage. + * @return {Array} The array of node uniform groups. + */ + getBindGroupArray(groupName: string, shaderStage: ("vertex" | "fragment" | "compute" | "any")): Array; + /** + * Returns a list bindings of all shader stages separated by groups. + * + * @return {Array} The list of bindings. + */ + getBindings(): Array; + /** + * Sorts the bind groups and updates {@link NodeBuilder#bindingsIndexes}. + */ + sortBindingGroups(): void; + /** + * The builder maintains each node in a hash-based dictionary. + * This method sets the given node (value) with the given hash (key) into this dictionary. + * + * @param {Node} node - The node to add. + * @param {number} hash - The hash of the node. + */ + setHashNode(node: Node, hash: number): void; + /** + * Adds a node to this builder. + * + * @param {Node} node - The node to add. + */ + addNode(node: Node): void; + /** + * It is used to add Nodes that will be used as FRAME and RENDER events, + * and need to follow a certain sequence in the calls to work correctly. + * This function should be called after 'setup()' in the 'build()' process to ensure that the child nodes are processed first. + * + * @param {Node} node - The node to add. + */ + addSequentialNode(node: Node): void; + /** + * Checks the update types of nodes + */ + buildUpdateNodes(): void; + /** + * A reference the current node which is the + * last node in the chain of nodes. + * + * @type {Node} + */ + get currentNode(): Node; + /** + * Whether the given texture is filtered or not. + * + * @param {Texture} texture - The texture to check. + * @return {boolean} Whether the given texture is filtered or not. + */ + isFilteredTexture(texture: Texture): boolean; + /** + * Returns the maximum number of bytes available for uniform buffers. + * + * @return {number} The maximum number of bytes available for uniform buffers. + */ + getUniformBufferLimit(): number; + /** + * Adds the given node to the internal node chain. + * This is used to check recursive calls in node-graph. + * + * @param {Node} node - The node to add. + */ + addChain(node: Node): void; + /** + * Removes the given node from the internal node chain. + * + * @param {Node} node - The node to remove. + */ + removeChain(node: Node): void; + /** + * Returns the native shader method name for a given generic name. E.g. + * the method name `textureDimensions` matches the WGSL name but must be + * resolved to `textureSize` in GLSL. + * + * @abstract + * @param {string} method - The method name to resolve. + * @return {string} The resolved method name. + */ + getMethod(method: string): string; + /** + * Returns the native snippet for a ternary operation. E.g. GLSL would output + * a ternary op as `cond ? x : y` whereas WGSL would output it as `select(y, x, cond)` + * + * @abstract + * @param {string} condSnippet - The condition determining which expression gets resolved. + * @param {string} ifSnippet - The expression to resolve to if the condition is true. + * @param {string} elseSnippet - The expression to resolve to if the condition is false. + * @return {string} The resolved method name. + */ + getTernary(): string; + /** + * Returns a node for the given hash, see {@link NodeBuilder#setHashNode}. + * + * @param {number} hash - The hash of the node. + * @return {Node} The found node. + */ + getNodeFromHash(hash: number): Node; + /** + * Adds the Node to a target flow so that it can generate code in the 'generate' process. + * + * @param {('vertex'|'fragment'|'compute')} shaderStage - The shader stage. + * @param {Node} node - The node to add. + * @return {Node} The node. + */ + addFlow(shaderStage: ("vertex" | "fragment" | "compute"), node: Node): Node; + /** + * Sets builder's context. + * + * @param {Object} context - The context to set. + */ + setContext(context: Object): void; + /** + * Returns the builder's current context. + * + * @return {Object} The builder's current context. + */ + getContext(): Object; + /** + * Adds context data to the builder's current context. + * + * @param {Object} context - The context to add. + * @return {Object} The previous context. + */ + addContext(context: Object): Object; + /** + * Gets a context used in shader construction that can be shared across different materials. + * This is necessary since the renderer cache can reuse shaders generated in one material and use them in another. + * + * @return {Object} The builder's current context without material. + */ + getSharedContext(): Object; + /** + * Sets builder's cache. + * + * @param {NodeCache} cache - The cache to set. + */ + setCache(cache: NodeCache): void; + /** + * Returns the builder's current cache. + * + * @return {NodeCache} The builder's current cache. + */ + getCache(): NodeCache; + /** + * Returns a cache for the given node. + * + * @param {Node} node - The node. + * @param {boolean} [parent=true] - Whether this node refers to a shared parent cache or not. + * @return {NodeCache} The cache. + */ + getCacheFromNode(node: Node, parent?: boolean): NodeCache; + /** + * Whether the requested feature is available or not. + * + * @abstract + * @param {string} name - The requested feature. + * @return {boolean} Whether the requested feature is supported or not. + */ + isAvailable(): boolean; + /** + * Returns the vertexIndex input variable as a native shader string. + * + * @abstract + * @return {string} The instanceIndex shader string. + */ + getVertexIndex(): string; + /** + * Contextually returns either the vertex stage instance index builtin + * or the linearized index of an compute invocation within a grid of workgroups. + * + * @abstract + * @return {string} The instanceIndex shader string. + */ + getInstanceIndex(): string; + /** + * Returns the drawIndex input variable as a native shader string. + * Only relevant for WebGL and its `WEBGL_multi_draw` extension. + * + * @abstract + * @return {?string} The drawIndex shader string. + */ + getDrawIndex(): string | null; + /** + * Returns the frontFacing input variable as a native shader string. + * + * @abstract + * @return {string} The frontFacing shader string. + */ + getFrontFacing(): string; + /** + * Returns the fragCoord input variable as a native shader string. + * + * @abstract + * @return {string} The fragCoord shader string. + */ + getFragCoord(): string; + /** + * Whether to flip texture data along its vertical axis or not. WebGL needs + * this method evaluate to `true`, WebGPU to `false`. + * + * @abstract + * @return {boolean} Whether to flip texture data along its vertical axis or not. + */ + isFlipY(): boolean; + /** + * Calling this method increases the usage count for the given node by one. + * + * @param {Node} node - The node to increase the usage count for. + * @return {number} The updated usage count. + */ + increaseUsage(node: Node): number; + /** + * Generates a texture sample shader string for the given texture data. + * + * @abstract + * @param {Texture} texture - The texture. + * @param {string} textureProperty - The texture property name. + * @param {string} uvSnippet - Snippet defining the texture coordinates. + * @return {string} The generated shader string. + */ + generateTexture(): string; + /** + * Generates a texture LOD shader string for the given texture data. + * + * @abstract + * @param {Texture} texture - The texture. + * @param {string} textureProperty - The texture property name. + * @param {string} uvSnippet - Snippet defining the texture coordinates. + * @param {?string} depthSnippet - Snippet defining the 0-based texture array index to sample. + * @param {string} levelSnippet - Snippet defining the mip level. + * @return {string} The generated shader string. + */ + generateTextureLod(): string; + /** + * Generates the array declaration string. + * + * @param {string} type - The type. + * @param {?number} [count] - The count. + * @return {string} The generated value as a shader string. + */ + generateArrayDeclaration(type: string, count?: number | null): string; + /** + * Generates the array shader string for the given type and value. + * + * @param {string} type - The type. + * @param {?number} [count] - The count. + * @param {?Array} [values=null] - The default values. + * @return {string} The generated value as a shader string. + */ + generateArray(type: string, count?: number | null, values?: Array | null): string; + /** + * Generates the struct shader string. + * + * @param {string} type - The type. + * @param {Array} [membersLayout] - The count. + * @param {?Array} [values=null] - The default values. + * @return {string} The generated value as a shader string. + */ + generateStruct(type: string, membersLayout?: Array, values?: Array | null): string; + /** + * Generates the shader string for the given type and value. + * + * @param {string} type - The type. + * @param {?any} [value=null] - The value. + * @return {string} The generated value as a shader string. + */ + generateConst(type: string, value?: any | null): string; + /** + * It might be necessary to convert certain data types to different ones + * so this method can be used to hide the conversion. + * + * @param {string} type - The type. + * @return {string} The updated type. + */ + getType(type: string): string; + /** + * Whether the given attribute name is defined in the geometry or not. + * + * @param {string} name - The attribute name. + * @return {boolean} Whether the given attribute name is defined in the geometry. + */ + hasGeometryAttribute(name: string): boolean; + /** + * Returns a node attribute for the given name and type. + * + * @param {string} name - The attribute's name. + * @param {string} type - The attribute's type. + * @return {NodeAttribute} The node attribute. + */ + getAttribute(name: string, type: string): NodeAttribute; + /** + * Returns for the given node and shader stage the property name for the shader. + * + * @param {Node} node - The node. + * @param {('vertex'|'fragment'|'compute'|'any')} shaderStage - The shader stage. + * @return {string} The property name. + */ + getPropertyName(node: Node): string; + /** + * Whether the given type is a vector type or not. + * + * @param {string} type - The type to check. + * @return {boolean} Whether the given type is a vector type or not. + */ + isVector(type: string): boolean; + /** + * Whether the given type is a matrix type or not. + * + * @param {string} type - The type to check. + * @return {boolean} Whether the given type is a matrix type or not. + */ + isMatrix(type: string): boolean; + /** + * Whether the given type is a reference type or not. + * + * @param {string} type - The type to check. + * @return {boolean} Whether the given type is a reference type or not. + */ + isReference(type: string): boolean; + /** + * Checks if the given texture requires a manual conversion to the working color space. + * + * @abstract + * @param {Texture} texture - The texture to check. + * @return {boolean} Whether the given texture requires a conversion to working color space or not. + */ + needsToWorkingColorSpace(): boolean; + /** + * Returns the component type of a given texture. + * + * @param {Texture} texture - The texture. + * @return {string} The component type. + */ + getComponentTypeFromTexture(texture: Texture): string; + /** + * Returns the element type for a given type. + * + * @param {string} type - The type. + * @return {string} The element type. + */ + getElementType(type: string): string; + /** + * Returns the component type for a given type. + * + * @param {string} type - The type. + * @return {string} The component type. + */ + getComponentType(type: string): string; + /** + * Returns the vector type for a given type. + * + * @param {string} type - The type. + * @return {string} The vector type. + */ + getVectorType(type: string): string; + /** + * Returns the data type for the given the length and component type. + * + * @param {number} length - The length. + * @param {string} [componentType='float'] - The component type. + * @return {string} The type. + */ + getTypeFromLength(length: number, componentType?: string): string; + /** + * Returns the type for a given typed array. + * + * @param {TypedArray} array - The typed array. + * @return {string} The type. + */ + getTypeFromArray(array: TypedArray): string; + /** + * Returns the type is an integer type. + * + * @param {string} type - The type. + * @return {boolean} Whether the type is an integer type or not. + */ + isInteger(type: string): boolean; + /** + * Returns the type for a given buffer attribute. + * + * @param {BufferAttribute} attribute - The buffer attribute. + * @return {string} The type. + */ + getTypeFromAttribute(attribute: BufferAttribute): string; + /** + * Returns the length for the given data type. + * + * @param {string} type - The data type. + * @return {number} The length. + */ + getTypeLength(type: string): number; + /** + * Returns the vector type for a given matrix type. + * + * @param {string} type - The matrix type. + * @return {string} The vector type. + */ + getVectorFromMatrix(type: string): string; + /** + * For a given type this method changes the component type to the + * given value. E.g. `vec4` should be changed to the new component type + * `uint` which results in `uvec4`. + * + * @param {string} type - The type. + * @param {string} newComponentType - The new component type. + * @return {string} The new type. + */ + changeComponentType(type: string, newComponentType: string): string; + /** + * Returns the integer type pendant for the given type. + * + * @param {string} type - The type. + * @return {string} The integer type. + */ + getIntegerType(type: string): string; + /** + * Adds an active stack to the internal stack. + * + * @param {StackNode} stack - The stack node to add. + */ + setActiveStack(stack: StackNode): void; + /** + * Removes the active stack from the internal stack. + * + * @param {StackNode} stack - The stack node to remove. + */ + removeActiveStack(stack: StackNode): void; + /** + * Returns the active stack. + * + * @return {StackNode} The active stack. + */ + getActiveStack(): StackNode; + /** + * Returns the base stack. + * + * @return {StackNode} The base stack. + */ + getBaseStack(): StackNode; + /** + * Adds a stack node to the internal stack. + * + * @return {StackNode} The added stack node. + */ + addStack(): StackNode; + /** + * Removes the last stack node from the internal stack. + * + * @return {StackNode} The removed stack node. + */ + removeStack(): StackNode; + /** + * The builder maintains (cached) data for each node during the building process. This method + * can be used to get these data for a specific shader stage and cache. + * + * @param {Node} node - The node to get the data for. + * @param {('vertex'|'fragment'|'compute'|'any')} [shaderStage=this.shaderStage] - The shader stage. + * @param {?NodeCache} cache - An optional cache. + * @return {Object} The node data. + */ + getDataFromNode(node: Node, shaderStage?: ("vertex" | "fragment" | "compute" | "any"), cache?: NodeCache | null): Object; + /** + * Returns the properties for the given node and shader stage. + * + * Properties are typically used within a build stage to reference a node's + * child node or nodes manually assigned to the properties in a separate build stage. + * A typical usage pattern for defining nodes manually would be assigning dependency nodes + * to the current node's properties in the setup stage and building those properties in the generate stage. + * + * @param {Node} node - The node to get the properties for. + * @param {('vertex'|'fragment'|'compute'|'any')} [shaderStage='any'] - The shader stage. + * @return {Object} The node properties. + */ + getNodeProperties(node: Node, shaderStage?: ("vertex" | "fragment" | "compute" | "any")): Object; + /** + * Returns an instance of {@link NodeAttribute} for the given buffer attribute node. + * + * @param {BufferAttributeNode} node - The buffer attribute node. + * @param {string} type - The node type. + * @return {NodeAttribute} The node attribute. + */ + getBufferAttributeFromNode(node: BufferAttributeNode, type: string): NodeAttribute; + /** + * Returns an instance of {@link StructType} for the given struct name and shader stage + * or null if not found. + * + * @param {string} name - The name of the struct. + * @param {('vertex'|'fragment'|'compute'|'any')} [shaderStage=this.shaderStage] - The shader stage. + * @return {?StructType} The struct type or null if not found. + */ + getStructTypeNode(name: string, shaderStage?: ("vertex" | "fragment" | "compute" | "any")): StructType | null; + /** + * Returns an instance of {@link StructType} for the given output struct node. + * + * @param {OutputStructNode} node - The output struct node. + * @param {Array} membersLayout - The output struct types. + * @param {?string} [name=null] - The name of the struct. + * @param {('vertex'|'fragment'|'compute'|'any')} [shaderStage=this.shaderStage] - The shader stage. + * @return {StructType} The struct type attribute. + */ + getStructTypeFromNode(node: OutputStructNode, membersLayout: Array, name?: string | null, shaderStage?: ("vertex" | "fragment" | "compute" | "any")): StructType; + /** + * Returns an instance of {@link StructType} for the given output struct node. + * + * @param {OutputStructNode} node - The output struct node. + * @param {Array} membersLayout - The output struct types. + * @return {StructType} The struct type attribute. + */ + getOutputStructTypeFromNode(node: OutputStructNode, membersLayout: Array): StructType; + /** + * Returns an instance of {@link NodeUniform} for the given uniform node. + * + * @param {UniformNode} node - The uniform node. + * @param {string} type - The uniform type. + * @param {('vertex'|'fragment'|'compute'|'any')} [shaderStage=this.shaderStage] - The shader stage. + * @param {?string} name - The name of the uniform. + * @return {NodeUniform} The node uniform. + */ + getUniformFromNode(node: UniformNode, type: string, shaderStage?: ("vertex" | "fragment" | "compute" | "any"), name?: string | null): NodeUniform; + /** + * Returns an instance of {@link NodeVar} for the given variable node. + * + * @param {VarNode} node - The variable node. + * @param {?string} name - The variable's name. + * @param {string} [type=node.getNodeType( this )] - The variable's type. + * @param {('vertex'|'fragment'|'compute'|'any')} [shaderStage=this.shaderStage] - The shader stage. + * @param {boolean} [readOnly=false] - Whether the variable is read-only or not. + * + * @return {NodeVar} The node variable. + */ + getVarFromNode(node: VarNode, name?: string | null, type?: string, shaderStage?: ("vertex" | "fragment" | "compute" | "any"), readOnly?: boolean): NodeVar; + /** + * Returns whether a Node or its flow is deterministic, useful for use in `const`. + * + * @param {Node} node - The varying node. + * @return {boolean} Returns true if deterministic. + */ + isDeterministic(node: Node): boolean; + /** + * Returns an instance of {@link NodeVarying} for the given varying node. + * + * @param {(VaryingNode|PropertyNode)} node - The varying node. + * @param {?string} name - The varying's name. + * @param {string} [type=node.getNodeType( this )] - The varying's type. + * @param {?string} interpolationType - The interpolation type of the varying. + * @param {?string} interpolationSampling - The interpolation sampling type of the varying. + * @return {NodeVar} The node varying. + */ + getVaryingFromNode(node: (VaryingNode | PropertyNode), name?: string | null, type?: string, interpolationType?: string | null, interpolationSampling?: string | null): NodeVar; + /** + * Registers a node declaration in the current shader stage. + * + * @param {Object} node - The node to be registered. + */ + registerDeclaration(node: Object): void; + /** + * Returns an instance of {@link NodeCode} for the given code node. + * + * @param {CodeNode} node - The code node. + * @param {string} type - The node type. + * @param {('vertex'|'fragment'|'compute'|'any')} [shaderStage=this.shaderStage] - The shader stage. + * @return {NodeCode} The node code. + */ + getCodeFromNode(node: CodeNode, type: string, shaderStage?: ("vertex" | "fragment" | "compute" | "any")): NodeCode; + /** + * Adds a code flow based on the code-block hierarchy. + + * This is used so that code-blocks like If,Else create their variables locally if the Node + * is only used inside one of these conditionals in the current shader stage. + * + * @param {Node} node - The node to add. + * @param {Node} nodeBlock - Node-based code-block. Usually 'ConditionalNode'. + */ + addFlowCodeHierarchy(node: Node, nodeBlock: Node): void; + /** + * Add a inline-code to the current flow code-block. + * + * @param {Node} node - The node to add. + * @param {string} code - The code to add. + * @param {Node} nodeBlock - Current ConditionalNode + */ + addLineFlowCodeBlock(node: Node, code: string, nodeBlock: Node): void; + /** + * Add a inline-code to the current flow. + * + * @param {string} code - The code to add. + * @param {?Node} [node= null] - Optional Node, can help the system understand if the Node is part of a code-block. + * @return {NodeBuilder} A reference to this node builder. + */ + addLineFlowCode(code: string, node?: Node | null): NodeBuilder; + /** + * Adds a code to the current code flow. + * + * @param {string} code - Shader code. + * @return {NodeBuilder} A reference to this node builder. + */ + addFlowCode(code: string): NodeBuilder; + /** + * Add tab in the code that will be generated so that other snippets respect the current tabulation. + * Typically used in codes with If,Else. + * + * @return {NodeBuilder} A reference to this node builder. + */ + addFlowTab(): NodeBuilder; + /** + * Removes a tab. + * + * @return {NodeBuilder} A reference to this node builder. + */ + removeFlowTab(): NodeBuilder; + /** + * Gets the current flow data based on a Node. + * + * @param {Node} node - Node that the flow was started. + * @param {('vertex'|'fragment'|'compute'|'any')} shaderStage - The shader stage. + * @return {Object} The flow data. + */ + getFlowData(node: Node): Object; + /** + * Executes the node flow based on a root node to generate the final shader code. + * + * @param {Node} node - The node to execute. + * @return {Object} The code flow. + */ + flowNode(node: Node): Object; + /** + * Includes a node in the current function node. + * + * @param {Node} node - The node to include. + * @returns {void} + */ + addInclude(node: Node): void; + /** + * Returns the native shader operator name for a given generic name. + * It is a similar type of method like {@link NodeBuilder#getMethod}. + * + * @param {ShaderNodeInternal} shaderNode - The shader node to build the function node with. + * @return {FunctionNode} The build function node. + */ + buildFunctionNode(shaderNode: ShaderNodeInternal): FunctionNode; + /** + * Generates a code flow based on a TSL function: Fn(). + * + * @param {ShaderNodeInternal} shaderNode - A function code will be generated based on the input. + * @return {Object} + */ + flowShaderNode(shaderNode: ShaderNodeInternal): Object; + /** + * Executes the node in a specific build stage. + * + * This function can be used to arbitrarily execute the specified build stage + * outside of the standard build process. For instance, if a node's type depends + * on properties created by the 'setup' stage, then flowBuildStage(node, 'setup') + * can be used to execute the setup build stage and access its generated nodes + * before the standard build process begins. + * + * @param {Node} node - The node to execute. + * @param {string} buildStage - The build stage to execute the node in. + * @param {?(Node|string)} [output=null] - Expected output type. For example 'vec3'. + * @return {?(Node|string)} The result of the node build. + */ + flowBuildStage(node: Node, buildStage: string, output?: (Node | string) | null): (Node | string) | null; + /** + * Runs the node flow through all the steps of creation, 'setup', 'analyze', 'generate'. + * + * @param {Node} node - The node to execute. + * @param {?string} output - Expected output type. For example 'vec3'. + * @return {Object} + */ + flowStagesNode(node: Node, output?: string | null): Object; + /** + * Returns the native shader operator name for a given generic name. + * It is a similar type of method like {@link NodeBuilder#getMethod}. + * + * @abstract + * @param {string} op - The operator name to resolve. + * @return {?string} The resolved operator name. + */ + getFunctionOperator(): string | null; + /** + * Builds the given shader node. + * + * @abstract + * @param {ShaderNodeInternal} shaderNode - The shader node. + * @return {string} The function code. + */ + buildFunctionCode(): string; + /** + * Generates a code flow based on a child Node. + * + * @param {Node} node - The node to execute. + * @param {?string} output - Expected output type. For example 'vec3'. + * @return {Object} The code flow. + */ + flowChildNode(node: Node, output?: string | null): Object; + /** + * Executes a flow of code in a different stage. + * + * Some nodes like `varying()` have the ability to compute code in vertex-stage and + * return the value in fragment-stage even if it is being executed in an input fragment. + * + * @param {('vertex'|'fragment'|'compute'|'any')} shaderStage - The shader stage. + * @param {Node} node - The node to execute. + * @param {?string} output - Expected output type. For example 'vec3'. + * @param {?string} propertyName - The property name to assign the result. + * @return {?(Object|Node)} The code flow or node.build() result. + */ + flowNodeFromShaderStage(shaderStage: ("vertex" | "fragment" | "compute" | "any"), node: Node, output?: string | null, propertyName?: string | null): (Object | Node) | null; + /** + * Returns an array holding all node attributes of this node builder. + * + * @return {Array} The node attributes of this builder. + */ + getAttributesArray(): Array; + /** + * Returns the attribute definitions as a shader string for the given shader stage. + * + * @abstract + * @param {('vertex'|'fragment'|'compute'|'any')} shaderStage - The shader stage. + * @return {string} The attribute code section. + */ + getAttributes(): string; + /** + * Returns the varying definitions as a shader string for the given shader stage. + * + * @abstract + * @param {('vertex'|'fragment'|'compute'|'any')} shaderStage - The shader stage. + * @return {string} The varying code section. + */ + getVaryings(): string; + /** + * Returns a single variable definition as a shader string for the given variable type and name. + * + * @param {string} type - The variable's type. + * @param {string} name - The variable's name. + * @param {?number} [count=null] - The array length. + * @return {string} The shader string. + */ + getVar(type: string, name: string, count?: number | null): string; + /** + * Returns the variable definitions as a shader string for the given shader stage. + * + * @param {('vertex'|'fragment'|'compute'|'any')} shaderStage - The shader stage. + * @return {string} The variable code section. + */ + getVars(shaderStage: ("vertex" | "fragment" | "compute" | "any")): string; + /** + * Returns the uniform definitions as a shader string for the given shader stage. + * + * @abstract + * @param {('vertex'|'fragment'|'compute'|'any')} shaderStage - The shader stage. + * @return {string} The uniform code section. + */ + getUniforms(): string; + /** + * Returns the native code definitions as a shader string for the given shader stage. + * + * @param {('vertex'|'fragment'|'compute'|'any')} shaderStage - The shader stage. + * @return {string} The native code section. + */ + getCodes(shaderStage: ("vertex" | "fragment" | "compute" | "any")): string; + /** + * Returns the hash of this node builder. + * + * @return {string} The hash. + */ + getHash(): string; + /** + * Sets the current shader stage. + * + * @param {?('vertex'|'fragment'|'compute'|'any')} shaderStage - The shader stage to set. + */ + setShaderStage(shaderStage: ("vertex" | "fragment" | "compute" | "any") | null): void; + /** + * Returns the current shader stage. + * + * @return {?('vertex'|'fragment'|'compute'|'any')} The current shader stage. + */ + getShaderStage(): ("vertex" | "fragment" | "compute" | "any") | null; + /** + * Sets the current build stage. + * + * @param {?('setup'|'analyze'|'generate')} buildStage - The build stage to set. + */ + setBuildStage(buildStage: ("setup" | "analyze" | "generate") | null): void; + /** + * Returns the current build stage. + * + * @return {?('setup'|'analyze'|'generate')} The current build stage. + */ + getBuildStage(): ("setup" | "analyze" | "generate") | null; + /** + * Controls the code build of the shader stages. + * + * @abstract + */ + buildCode(): void; + /** + * Returns the current sub-build layer. + * + * @return {SubBuildNode} The current sub-build layers. + */ + get subBuild(): SubBuildNode; + /** + * Adds a sub-build layer to the node builder. + * + * @param {SubBuildNode} subBuild - The sub-build layer to add. + */ + addSubBuild(subBuild: SubBuildNode): void; + /** + * Removes the last sub-build layer from the node builder. + * + * @return {SubBuildNode} The removed sub-build layer. + */ + removeSubBuild(): SubBuildNode; + /** + * Returns the closest sub-build layer for the given data. + * + * @param {Node|Set|Array} data - The data to get the closest sub-build layer from. + * @return {?string} The closest sub-build name or null if none found. + */ + getClosestSubBuild(data: Node | Set | Array): string | null; + /** + * Returns the output node of a sub-build layer. + * + * @param {Node} node - The node to get the output from. + * @return {string} The output node name. + */ + getSubBuildOutput(node: Node): string; + /** + * Returns the sub-build property name for the given property and node. + * + * @param {string} [property=''] - The property name. + * @param {?Node} [node=null] - The node to get the sub-build from. + * @return {string} The sub-build property name. + */ + getSubBuildProperty(property?: string, node?: Node | null): string; + /** + * Central build method which controls the build for the given object. + * + * @return {NodeBuilder} A reference to this node builder. + */ + build(): NodeBuilder; + /** + * Async version of build() that yields to main thread between shader stages. + * Use this in compileAsync() to prevent blocking the main thread. + * + * @return {Promise} A promise that resolves to this node builder. + */ + buildAsync(): Promise; + /** + * Returns shared data object for the given node. + * + * @param {Node} node - The node to get shared data from. + * @return {Object} The shared data. + */ + getSharedDataFromNode(node: Node): Object; + /** + * Returns a uniform representation which is later used for UBO generation and rendering. + * + * @param {NodeUniform} uniformNode - The uniform node. + * @param {string} type - The requested type. + * @return {Uniform} The uniform. + */ + getNodeUniform(uniformNode: NodeUniform, type: string): Uniform; + /** + * Formats the given shader snippet from a given type into another one. E.g. + * this method might be used to convert a simple float string `"1.0"` into a + * `vec3` representation: `"vec3( 1.0 )"`. + * + * @param {string} snippet - The shader snippet. + * @param {string} fromType - The source type. + * @param {string} toType - The target type. + * @return {string} The updated shader string. + */ + format(snippet: string, fromType: string, toType: string): string; + /** + * Returns a signature with the engine's current revision. + * + * @return {string} The signature. + */ + getSignature(): string; + /** + * Returns `true` if data from the previous frame are required. Relevant + * when computing motion vectors with {@link VelocityNode}. + * + * @return {boolean} Whether data from the previous frame are required or not. + */ + needsPreviousData(): boolean; +} +import BindGroup from '../../renderers/common/BindGroup.js'; +import NodeAttribute from './NodeAttribute.js'; +import NodeVarying from './NodeVarying.js'; +import NodeCode from './NodeCode.js'; +import NodeVar from './NodeVar.js'; +import FunctionNode from '../code/FunctionNode.js'; +import NodeCache from './NodeCache.js'; +import { RenderTarget } from '../../core/RenderTarget.js'; +import CubeRenderTarget from '../../renderers/common/CubeRenderTarget.js'; +import StructType from './StructType.js'; +import NodeUniform from './NodeUniform.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/NodeCache.d.ts b/jsdoc-testing/jsdoc/nodes/core/NodeCache.d.ts new file mode 100644 index 000000000..0c192004d --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/NodeCache.d.ts @@ -0,0 +1,47 @@ +export default NodeCache; +/** + * This utility class is used in {@link NodeBuilder} as an internal + * cache data structure for node data. + */ +declare class NodeCache { + /** + * Constructs a new node cache. + * + * @param {?NodeCache} parent - A reference to a parent cache. + */ + constructor(parent?: NodeCache | null); + /** + * The id of the cache. + * + * @type {number} + * @readonly + */ + readonly id: number; + /** + * A weak map for managing node data. + * + * @type {WeakMap} + */ + nodesData: WeakMap; + /** + * Reference to a parent node cache. + * + * @type {?NodeCache} + * @default null + */ + parent: NodeCache | null; + /** + * Returns the data for the given node. + * + * @param {Node} node - The node. + * @return {?Object} The data for the node. + */ + getData(node: Node): Object | null; + /** + * Sets the data for a given node. + * + * @param {Node} node - The node. + * @param {Object} data - The data that should be cached. + */ + setData(node: Node, data: Object): void; +} diff --git a/jsdoc-testing/jsdoc/nodes/core/NodeCode.d.ts b/jsdoc-testing/jsdoc/nodes/core/NodeCode.d.ts new file mode 100644 index 000000000..f96665f26 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/NodeCode.d.ts @@ -0,0 +1,36 @@ +export default NodeCode; +/** + * {@link NodeBuilder} is going to create instances of this class during the build process + * of nodes. They represent user-defined, native shader code portions that are going to be + * injected by the builder. A dictionary of node codes is maintained in {@link NodeBuilder#codes} + * for this purpose. + */ +declare class NodeCode { + /** + * Constructs a new code node. + * + * @param {string} name - The name of the code. + * @param {string} type - The node type. + * @param {string} [code=''] - The native shader code. + */ + constructor(name: string, type: string, code?: string); + /** + * The name of the code. + * + * @type {string} + */ + name: string; + /** + * The node type. + * + * @type {string} + */ + type: string; + /** + * The native shader code. + * + * @type {string} + * @default '' + */ + code: string; +} diff --git a/jsdoc-testing/jsdoc/nodes/core/NodeError.d.ts b/jsdoc-testing/jsdoc/nodes/core/NodeError.d.ts new file mode 100644 index 000000000..71d14d55f --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/NodeError.d.ts @@ -0,0 +1,13 @@ +export default NodeError; +/** + * Custom error class for node-related errors, including stack trace information. + */ +declare class NodeError extends Error { + constructor(message: any, stackTrace?: null); + /** + * The stack trace associated with the error. + * + * @type {?StackTrace} + */ + stackTrace: StackTrace | null; +} diff --git a/jsdoc-testing/jsdoc/nodes/core/NodeFrame.d.ts b/jsdoc-testing/jsdoc/nodes/core/NodeFrame.d.ts new file mode 100644 index 000000000..afaee4fe4 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/NodeFrame.d.ts @@ -0,0 +1,133 @@ +export default NodeFrame; +/** + * Management class for updating nodes. The module tracks metrics like + * the elapsed time, delta time, the render and frame ID to correctly + * call the node update methods {@link Node#updateBefore}, {@link Node#update} + * and {@link Node#updateAfter} depending on the node's configuration. + */ +declare class NodeFrame { + /** + * The elapsed time in seconds. + * + * @type {number} + * @default 0 + */ + time: number; + /** + * The delta time in seconds. + * + * @type {number} + * @default 0 + */ + deltaTime: number; + /** + * The frame ID. + * + * @type {number} + * @default 0 + */ + frameId: number; + /** + * The render ID. + * + * @type {number} + * @default 0 + */ + renderId: number; + /** + * Used to control the {@link Node#update} call. + * + * @type {WeakMap} + */ + updateMap: WeakMap; + /** + * Used to control the {@link Node#updateBefore} call. + * + * @type {WeakMap} + */ + updateBeforeMap: WeakMap; + /** + * Used to control the {@link Node#updateAfter} call. + * + * @type {WeakMap} + */ + updateAfterMap: WeakMap; + /** + * A reference to the current renderer. + * + * @type {?Renderer} + * @default null + */ + renderer: Renderer | null; + /** + * A reference to the current material. + * + * @type {?Material} + * @default null + */ + material: Material | null; + /** + * A reference to the current camera. + * + * @type {?Camera} + * @default null + */ + camera: Camera | null; + /** + * A reference to the current 3D object. + * + * @type {?Object3D} + * @default null + */ + object: Object3D | null; + /** + * A reference to the current scene. + * + * @type {?Scene} + * @default null + */ + scene: Scene | null; + /** + * Returns a dictionary for a given node and update map which + * is used to correctly call node update methods per frame or render. + * + * @private + * @param {WeakMap} referenceMap - The reference weak map. + * @param {Node} nodeRef - The reference to the current node. + * @return {Object>} The dictionary. + */ + private _getMaps; + /** + * This method executes the {@link Node#updateBefore} for the given node. + * It makes sure {@link Node#updateBeforeType} is honored meaning the update + * is only executed once per frame, render or object depending on the update + * type. + * + * @param {Node} node - The node that should be updated. + */ + updateBeforeNode(node: Node): void; + /** + * This method executes the {@link Node#updateAfter} for the given node. + * It makes sure {@link Node#updateAfterType} is honored meaning the update + * is only executed once per frame, render or object depending on the update + * type. + * + * @param {Node} node - The node that should be updated. + */ + updateAfterNode(node: Node): void; + /** + * This method executes the {@link Node#update} for the given node. + * It makes sure {@link Node#updateType} is honored meaning the update + * is only executed once per frame, render or object depending on the update + * type. + * + * @param {Node} node - The node that should be updated. + */ + updateNode(node: Node): void; + /** + * Updates the internal state of the node frame. This method is + * called by the renderer in its internal animation loop. + */ + update(): void; + lastTime: number | undefined; +} diff --git a/jsdoc-testing/jsdoc/nodes/core/NodeFunction.d.ts b/jsdoc-testing/jsdoc/nodes/core/NodeFunction.d.ts new file mode 100644 index 000000000..ef2cdbc0a --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/NodeFunction.d.ts @@ -0,0 +1,55 @@ +export default NodeFunction; +/** + * Base class for node functions. A derived module must be implemented + * for each supported native shader language. Similar to other `Node*` modules, + * this class is only relevant during the building process and not used + * in user-level code. + */ +declare class NodeFunction { + /** + * Constructs a new node function. + * + * @param {string} type - The node type. This type is the return type of the node function. + * @param {Array} inputs - The function's inputs. + * @param {string} [name=''] - The function's name. + * @param {string} [precision=''] - The precision qualifier. + */ + constructor(type: string, inputs: Array, name?: string, precision?: string); + /** + * The node type. This type is the return type of the node function. + * + * @type {string} + */ + type: string; + /** + * The function's inputs. + * + * @type {Array} + */ + inputs: Array; + /** + * The name of the uniform. + * + * @type {string} + * @default '' + */ + name: string; + /** + * The precision qualifier. + * + * @type {string} + * @default '' + */ + precision: string; + /** + * This method returns the native code of the node function. + * + * @abstract + * @param {string} name - The function's name. + * @return {string} A shader code. + */ + getCode(): string; +} +declare namespace NodeFunction { + let isNodeFunction: boolean; +} diff --git a/jsdoc-testing/jsdoc/nodes/core/NodeFunctionInput.d.ts b/jsdoc-testing/jsdoc/nodes/core/NodeFunctionInput.d.ts new file mode 100644 index 000000000..3df5a1b75 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/NodeFunctionInput.d.ts @@ -0,0 +1,52 @@ +export default NodeFunctionInput; +/** + * Describes the input of a {@link NodeFunction}. + */ +declare class NodeFunctionInput { + /** + * Constructs a new node function input. + * + * @param {string} type - The input type. + * @param {string} name - The input name. + * @param {?number} [count=null] - If the input is an Array, count will be the length. + * @param {('in'|'out'|'inout')} [qualifier=''] - The parameter qualifier (only relevant for GLSL). + * @param {boolean} [isConst=false] - Whether the input uses a const qualifier or not (only relevant for GLSL). + */ + constructor(type: string, name: string, count?: number | null, qualifier?: ("in" | "out" | "inout"), isConst?: boolean); + /** + * The input type. + * + * @type {string} + */ + type: string; + /** + * The input name. + * + * @type {string} + */ + name: string; + /** + * If the input is an Array, count will be the length. + * + * @type {?number} + * @default null + */ + count: number | null; + /** + *The parameter qualifier (only relevant for GLSL). + * + * @type {('in'|'out'|'inout')} + * @default '' + */ + qualifier: ("in" | "out" | "inout"); + /** + * Whether the input uses a const qualifier or not (only relevant for GLSL). + * + * @type {boolean} + * @default false + */ + isConst: boolean; +} +declare namespace NodeFunctionInput { + let isNodeFunctionInput: boolean; +} diff --git a/jsdoc-testing/jsdoc/nodes/core/NodeParser.d.ts b/jsdoc-testing/jsdoc/nodes/core/NodeParser.d.ts new file mode 100644 index 000000000..f15875899 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/NodeParser.d.ts @@ -0,0 +1,15 @@ +export default NodeParser; +/** + * Base class for node parsers. A derived parser must be implemented + * for each supported native shader language. + */ +declare class NodeParser { + /** + * The method parses the given native code an returns a node function. + * + * @abstract + * @param {string} source - The native shader code. + * @return {NodeFunction} A node function. + */ + parseFunction(): NodeFunction; +} diff --git a/jsdoc-testing/jsdoc/nodes/core/NodeUniform.d.ts b/jsdoc-testing/jsdoc/nodes/core/NodeUniform.d.ts new file mode 100644 index 000000000..3f872f033 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/NodeUniform.d.ts @@ -0,0 +1,62 @@ +export default NodeUniform; +/** + * {@link NodeBuilder} is going to create instances of this class during the build process + * of nodes. They represent the final shader uniforms that are going to be generated + * by the builder. A dictionary of node uniforms is maintained in {@link NodeBuilder#uniforms} + * for this purpose. + */ +declare class NodeUniform { + /** + * Constructs a new node uniform. + * + * @param {string} name - The name of the uniform. + * @param {string} type - The type of the uniform. + * @param {UniformNode} node - An reference to the node. + */ + constructor(name: string, type: string, node: UniformNode); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isNodeUniform: boolean; + /** + * The name of the uniform. + * + * @type {string} + */ + name: string; + /** + * The type of the uniform. + * + * @type {string} + */ + type: string; + /** + * An reference to the node. + * + * @type {UniformNode} + */ + node: UniformNode; + set value(val: any); + /** + * The value of the uniform node. + * + * @type {any} + */ + get value(): any; + /** + * The id of the uniform node. + * + * @type {number} + */ + get id(): number; + /** + * The uniform node's group. + * + * @type {UniformGroupNode} + */ + get groupNode(): UniformGroupNode; +} diff --git a/jsdoc-testing/jsdoc/nodes/core/NodeUtils.d.ts b/jsdoc-testing/jsdoc/nodes/core/NodeUtils.d.ts new file mode 100644 index 000000000..08c841662 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/NodeUtils.d.ts @@ -0,0 +1,93 @@ +/** + * Returns the data type for the given the length. + * + * @private + * @method + * @param {number} length - The length. + * @return {string} The data type. + */ +export function getTypeFromLength(length: number): string; +/** + * Returns the typed array for the given data type. + * + * @private + * @method + * @param {string} type - The data type. + * @return {TypedArray} The typed array. + */ +export function getTypedArrayFromType(type: string): TypedArray; +/** + * Returns the length for the given data type. + * + * @private + * @method + * @param {string} type - The data type. + * @return {number} The length. + */ +export function getLengthFromType(type: string): number; +/** + * Returns the gpu memory length for the given data type. + * + * @private + * @method + * @param {string} type - The data type. + * @return {number} The length. + */ +export function getMemoryLengthFromType(type: string): number; +/** + * Returns the alignment requirement for the given data type. + * + * @private + * @method + * @param {string} type - The data type. + * @return {number} The alignment requirement in bytes. + */ +export function getAlignmentFromType(type: string): number; +/** + * Returns the data type for the given value. + * + * @private + * @method + * @param {any} value - The value. + * @return {?string} The data type. + */ +export function getValueType(value: any): string | null; +/** + * Returns the value/object for the given data type and parameters. + * + * @private + * @method + * @param {string} type - The given type. + * @param {...any} params - A parameter list. + * @return {any} The value/object. + */ +export function getValueFromType(type: string, ...params: any[]): any; +/** + * Gets the object data that can be shared between different rendering steps. + * + * @private + * @param {Object} object - The object to get the data for. + * @return {Object} The object data. + */ +export function getDataFromObject(object: Object): Object; +/** + * Converts the given array buffer to a Base64 string. + * + * @private + * @method + * @param {ArrayBuffer} arrayBuffer - The array buffer. + * @return {string} The Base64 string. + */ +export function arrayBufferToBase64(arrayBuffer: ArrayBuffer): string; +/** + * Converts the given Base64 string to an array buffer. + * + * @private + * @method + * @param {string} base64 - The Base64 string. + * @return {ArrayBuffer} The array buffer. + */ +export function base64ToArrayBuffer(base64: string): ArrayBuffer; +export function hashString(str: string): number; +export function hashArray(array: Array): number; +export function hash(...params: number[]): number; diff --git a/jsdoc-testing/jsdoc/nodes/core/NodeVar.d.ts b/jsdoc-testing/jsdoc/nodes/core/NodeVar.d.ts new file mode 100644 index 000000000..43e82262f --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/NodeVar.d.ts @@ -0,0 +1,50 @@ +export default NodeVar; +/** + * {@link NodeBuilder} is going to create instances of this class during the build process + * of nodes. They represent the final shader variables that are going to be generated + * by the builder. A dictionary of node variables is maintained in {@link NodeBuilder#vars} for + * this purpose. + */ +declare class NodeVar { + /** + * Constructs a new node variable. + * + * @param {string} name - The name of the variable. + * @param {string} type - The type of the variable. + * @param {boolean} [readOnly=false] - The read-only flag. + * @param {?number} [count=null] - The size. + */ + constructor(name: string, type: string, readOnly?: boolean, count?: number | null); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isNodeVar: boolean; + /** + * The name of the variable. + * + * @type {string} + */ + name: string; + /** + * The type of the variable. + * + * @type {string} + */ + type: string; + /** + * The read-only flag. + * + * @type {boolean} + */ + readOnly: boolean; + /** + * The size. + * + * @type {?number} + */ + count: number | null; +} diff --git a/jsdoc-testing/jsdoc/nodes/core/NodeVarying.d.ts b/jsdoc-testing/jsdoc/nodes/core/NodeVarying.d.ts new file mode 100644 index 000000000..587fb0896 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/NodeVarying.d.ts @@ -0,0 +1,51 @@ +export default NodeVarying; +/** + * {@link NodeBuilder} is going to create instances of this class during the build process + * of nodes. They represent the final shader varyings that are going to be generated + * by the builder. An array of node varyings is maintained in {@link NodeBuilder#varyings} for + * this purpose. + * + * @augments NodeVar + */ +declare class NodeVarying extends NodeVar { + /** + * Constructs a new node varying. + * + * @param {string} name - The name of the varying. + * @param {string} type - The type of the varying. + * @param {?string} interpolationType - The interpolation type of the varying. + * @param {?string} interpolationSampling - The interpolation sampling type of the varying. + */ + constructor(name: string, type: string, interpolationType?: string | null, interpolationSampling?: string | null); + /** + * Whether this varying requires interpolation or not. This property can be used + * to check if the varying can be optimized for a variable. + * + * @type {boolean} + * @default false + */ + needsInterpolation: boolean; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isNodeVarying: boolean; + /** + * The interpolation type of the varying data. + * + * @type {?string} + * @default null + */ + interpolationType: string | null; + /** + * The interpolation sampling type of varying data. + * + * @type {?string} + * @default null + */ + interpolationSampling: string | null; +} +import NodeVar from './NodeVar.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/OutputStructNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/OutputStructNode.d.ts new file mode 100644 index 000000000..ea5448089 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/OutputStructNode.d.ts @@ -0,0 +1,41 @@ +export default OutputStructNode; +/** + * TSL function for creating an output struct node. + * + * @tsl + * @function + * @param {...Node} members - A parameter list of nodes. + * @returns {OutputStructNode} + */ +export const outputStruct: any; +/** + * This node can be used to define multiple outputs in a shader programs. + * + * @augments Node + */ +declare class OutputStructNode extends Node { + /** + * Constructs a new output struct node. The constructor can be invoked with an + * arbitrary number of nodes representing the members. + * + * @param {...Node} members - A parameter list of nodes. + */ + constructor(...members: Node[]); + /** + * An array of nodes which defines the output. + * + * @type {Array} + */ + members: Array; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isOutputStructNode: boolean; + generateNodeType(): string; + generate(builder: any): any; +} +import Node from './Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/ParameterNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/ParameterNode.d.ts new file mode 100644 index 000000000..6ab531096 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/ParameterNode.d.ts @@ -0,0 +1,35 @@ +export default ParameterNode; +export function parameter(type: string, name: string | null): ParameterNode; +/** + * Special version of {@link PropertyNode} which is used for parameters. + * + * @augments PropertyNode + */ +declare class ParameterNode extends PropertyNode { + /** + * Constructs a new parameter node. + * + * @param {string} nodeType - The type of the node. + * @param {?string} [name=null] - The name of the parameter in the shader. + */ + constructor(nodeType: string, name?: string | null); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isParameterNode: boolean; + /** + * Gets the type of a member variable in the parameter node. + * + * @param {NodeBuilder} builder - The node builder. + * @param {string} name - The name of the member variable. + * @returns {string} + */ + getMemberType(builder: NodeBuilder, name: string): string; + getHash(): string; + generate(): string; +} +import PropertyNode from './PropertyNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/PropertyNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/PropertyNode.d.ts new file mode 100644 index 000000000..ec863359d --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/PropertyNode.d.ts @@ -0,0 +1,253 @@ +export default PropertyNode; +export function property(type: string, name?: string | null): PropertyNode; +export function varyingProperty(type: string, name?: string | null): PropertyNode; +/** + * TSL object that represents the shader variable `DiffuseColor`. + * + * @tsl + * @type {PropertyNode} + */ +export const diffuseColor: PropertyNode; +/** + * TSL object that represents the shader variable `DiffuseContribution`. + * + * @tsl + * @type {PropertyNode} + */ +export const diffuseContribution: PropertyNode; +/** + * TSL object that represents the shader variable `EmissiveColor`. + * + * @tsl + * @type {PropertyNode} + */ +export const emissive: PropertyNode; +/** + * TSL object that represents the shader variable `Roughness`. + * + * @tsl + * @type {PropertyNode} + */ +export const roughness: PropertyNode; +/** + * TSL object that represents the shader variable `Metalness`. + * + * @tsl + * @type {PropertyNode} + */ +export const metalness: PropertyNode; +/** + * TSL object that represents the shader variable `Clearcoat`. + * + * @tsl + * @type {PropertyNode} + */ +export const clearcoat: PropertyNode; +/** + * TSL object that represents the shader variable `ClearcoatRoughness`. + * + * @tsl + * @type {PropertyNode} + */ +export const clearcoatRoughness: PropertyNode; +/** + * TSL object that represents the shader variable `Sheen`. + * + * @tsl + * @type {PropertyNode} + */ +export const sheen: PropertyNode; +/** + * TSL object that represents the shader variable `SheenRoughness`. + * + * @tsl + * @type {PropertyNode} + */ +export const sheenRoughness: PropertyNode; +/** + * TSL object that represents the shader variable `Iridescence`. + * + * @tsl + * @type {PropertyNode} + */ +export const iridescence: PropertyNode; +/** + * TSL object that represents the shader variable `IridescenceIOR`. + * + * @tsl + * @type {PropertyNode} + */ +export const iridescenceIOR: PropertyNode; +/** + * TSL object that represents the shader variable `IridescenceThickness`. + * + * @tsl + * @type {PropertyNode} + */ +export const iridescenceThickness: PropertyNode; +/** + * TSL object that represents the shader variable `AlphaT`. + * + * @tsl + * @type {PropertyNode} + */ +export const alphaT: PropertyNode; +/** + * TSL object that represents the shader variable `Anisotropy`. + * + * @tsl + * @type {PropertyNode} + */ +export const anisotropy: PropertyNode; +/** + * TSL object that represents the shader variable `AnisotropyT`. + * + * @tsl + * @type {PropertyNode} + */ +export const anisotropyT: PropertyNode; +/** + * TSL object that represents the shader variable `AnisotropyB`. + * + * @tsl + * @type {PropertyNode} + */ +export const anisotropyB: PropertyNode; +/** + * TSL object that represents the shader variable `SpecularColor`. + * + * @tsl + * @type {PropertyNode} + */ +export const specularColor: PropertyNode; +/** + * TSL object that represents the shader variable `SpecularColorBlended`. + * + * @tsl + * @type {PropertyNode} + */ +export const specularColorBlended: PropertyNode; +/** + * TSL object that represents the shader variable `SpecularF90`. + * + * @tsl + * @type {PropertyNode} + */ +export const specularF90: PropertyNode; +/** + * TSL object that represents the shader variable `Shininess`. + * + * @tsl + * @type {PropertyNode} + */ +export const shininess: PropertyNode; +/** + * TSL object that represents the shader variable `Output`. + * + * @tsl + * @type {PropertyNode} + */ +export const output: PropertyNode; +/** + * TSL object that represents the shader variable `dashSize`. + * + * @tsl + * @type {PropertyNode} + */ +export const dashSize: PropertyNode; +/** + * TSL object that represents the shader variable `gapSize`. + * + * @tsl + * @type {PropertyNode} + */ +export const gapSize: PropertyNode; +/** + * TSL object that represents the shader variable `pointWidth`. + * + * @tsl + * @type {PropertyNode} + */ +export const pointWidth: PropertyNode; +/** + * TSL object that represents the shader variable `IOR`. + * + * @tsl + * @type {PropertyNode} + */ +export const ior: PropertyNode; +/** + * TSL object that represents the shader variable `Transmission`. + * + * @tsl + * @type {PropertyNode} + */ +export const transmission: PropertyNode; +/** + * TSL object that represents the shader variable `Thickness`. + * + * @tsl + * @type {PropertyNode} + */ +export const thickness: PropertyNode; +/** + * TSL object that represents the shader variable `AttenuationDistance`. + * + * @tsl + * @type {PropertyNode} + */ +export const attenuationDistance: PropertyNode; +/** + * TSL object that represents the shader variable `AttenuationColor`. + * + * @tsl + * @type {PropertyNode} + */ +export const attenuationColor: PropertyNode; +/** + * TSL object that represents the shader variable `Dispersion`. + * + * @tsl + * @type {PropertyNode} + */ +export const dispersion: PropertyNode; +/** + * This class represents a shader property. It can be used + * to explicitly define a property and assign a value to it. + * + * ```js + * const threshold = property( 'float', 'threshold' ).assign( THRESHOLD ); + *``` + * `PropertyNode` is used by the engine to predefined common material properties + * for TSL code. + * + * @augments Node + */ +declare class PropertyNode extends Node { + /** + * Constructs a new property node. + * + * @param {string} nodeType - The type of the node. + * @param {?string} [name=null] - The name of the property in the shader. + * @param {boolean} [varying=false] - Whether this property is a varying or not. + */ + constructor(nodeType: string, name?: string | null, varying?: boolean); + /** + * Whether this property is a varying or not. + * + * @type {boolean} + * @default false + */ + varying: boolean; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isPropertyNode: boolean; + getHash(builder: any): string; + generate(builder: any): any; +} +import Node from './Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/StackNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/StackNode.d.ts new file mode 100644 index 000000000..d3e391573 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/StackNode.d.ts @@ -0,0 +1,145 @@ +export default StackNode; +/** + * TSL function for creating a stack node. + * + * @tsl + * @function + * @param {?StackNode} [parent=null] - The parent stack node. + * @returns {StackNode} + */ +export const stack: any; +/** + * Stack is a helper for Nodes that need to produce stack-based code instead of continuous flow. + * They are usually needed in cases like `If`, `Else`. + * + * @augments Node + */ +declare class StackNode extends Node { + /** + * Constructs a new stack node. + * + * @param {?StackNode} [parent=null] - The parent stack node. + */ + constructor(parent?: StackNode | null); + /** + * List of nodes. + * + * @type {Array} + */ + nodes: Array; + /** + * The output node. + * + * @type {?Node} + * @default null + */ + outputNode: Node | null; + /** + * The parent stack node. + * + * @type {?StackNode} + * @default null + */ + parent: StackNode | null; + /** + * The current conditional node. + * + * @private + * @type {ConditionalNode} + * @default null + */ + private _currentCond; + /** + * The expression node. Only + * relevant for Switch/Case. + * + * @private + * @type {Node} + * @default null + */ + private _expressionNode; + /** + * The current node being processed. + * + * @private + * @type {Node} + * @default null + */ + private _currentNode; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isStackNode: boolean; + getElementType(builder: any): string; + generateNodeType(builder: any): string; + getMemberType(builder: any, name: any): string; + /** + * Adds a node to this stack. + * + * @param {Node} node - The node to add. + * @param {number} [index=this.nodes.length] - The index where the node should be added. + * @return {StackNode} A reference to this stack node. + */ + addToStack(node: Node, index?: number): StackNode; + /** + * Adds a node to the stack before the current node. + * + * @param {Node} node - The node to add. + * @return {StackNode} A reference to this stack node. + */ + addToStackBefore(node: Node): StackNode; + /** + * Represent an `if` statement in TSL. + * + * @param {Node} boolNode - Represents the condition. + * @param {Function} method - TSL code which is executed if the condition evaluates to `true`. + * @return {StackNode} A reference to this stack node. + */ + If(boolNode: Node, method: Function): StackNode; + /** + * Represent an `elseif` statement in TSL. + * + * @param {Node} boolNode - Represents the condition. + * @param {Function} method - TSL code which is executed if the condition evaluates to `true`. + * @return {StackNode} A reference to this stack node. + */ + ElseIf(boolNode: Node, method: Function): StackNode; + /** + * Represent an `else` statement in TSL. + * + * @param {Function} method - TSL code which is executed in the `else` case. + * @return {StackNode} A reference to this stack node. + */ + Else(method: Function): StackNode; + /** + * Represents a `switch` statement in TSL. + * + * @param {any} expression - Represents the expression. + * @param {Function} method - TSL code which is executed if the condition evaluates to `true`. + * @return {StackNode} A reference to this stack node. + */ + Switch(expression: any): StackNode; + /** + * Represents a `case` statement in TSL. The TSL version accepts an arbitrary numbers of values. + * The last parameter must be the callback method that should be executed in the `true` case. + * + * @param {...any} params - The values of the `Case()` statement as well as the callback method. + * @return {StackNode} A reference to this stack node. + */ + Case(...params: any[]): StackNode; + /** + * Represents the default code block of a Switch/Case statement. + * + * @param {Function} method - TSL code which is executed in the `else` case. + * @return {StackNode} A reference to this stack node. + */ + Default(method: Function): StackNode; + setup(builder: any): any; + hasOutput(builder: any): boolean | null; + build(builder: any, ...params: any[]): string | Node | null; +} +import Node from './Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/StackTrace.d.ts b/jsdoc-testing/jsdoc/nodes/core/StackTrace.d.ts new file mode 100644 index 000000000..d870b1d2f --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/StackTrace.d.ts @@ -0,0 +1,44 @@ +export default StackTrace; +/** + * Class representing a stack trace for debugging purposes. + */ +declare class StackTrace { + /** + * Creates a StackTrace instance by capturing and filtering the current stack trace. + * + * @param {Error|string|null} stackMessage - An optional stack trace to use instead of capturing a new one. + */ + constructor(stackMessage?: Error | string | null); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isStackTrace: boolean; + /** + * The stack trace. + * + * @type {Array<{fn: string, file: string, line: number, column: number}>} + */ + stack: Array<{ + fn: string; + file: string; + line: number; + column: number; + }>; + /** + * Returns a formatted location string of the top stack frame. + * + * @returns {string} The formatted stack trace message. + */ + getLocation(): string; + /** + * Returns the full error message including the stack trace. + * + * @param {string} message - The error message. + * @returns {string} The full error message with stack trace. + */ + getError(message: string): string; +} diff --git a/jsdoc-testing/jsdoc/nodes/core/StructNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/StructNode.d.ts new file mode 100644 index 000000000..0b9c6e2d8 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/StructNode.d.ts @@ -0,0 +1,33 @@ +export default StructNode; +export function struct(membersLayout: Object, name?: string | null): Function; +/** + * StructNode allows to create custom structures with multiple members. + * This can also be used to define structures in attribute and uniform data. + * + * ```js + * // Define a custom struct + * const BoundingBox = struct( { min: 'vec3', max: 'vec3' } ); + * + * // Create a new instance of the struct + * const bb = BoundingBox( vec3( 0 ), vec3( 1 ) ); // style 1 + * const bb = BoundingBox( { min: vec3( 0 ), max: vec3( 1 ) } ); // style 2 + * + * // Access the struct members + * const min = bb.get( 'min' ); + * + * // Assign a new value to a member + * min.assign( vec3() ); + * ``` + * @augments Node + */ +declare class StructNode extends Node { + constructor(structTypeNode: any, values: any); + structTypeNode: any; + values: any; + isStructNode: boolean; + generateNodeType(builder: any): any; + getMemberType(builder: any, name: any): any; + _getChildren(): Object[]; + generate(builder: any): any; +} +import Node from './Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/StructType.d.ts b/jsdoc-testing/jsdoc/nodes/core/StructType.d.ts new file mode 100644 index 000000000..af08042f6 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/StructType.d.ts @@ -0,0 +1,7 @@ +export default StructType; +declare class StructType { + constructor(name: any, members: any); + name: any; + members: any; + output: boolean; +} diff --git a/jsdoc-testing/jsdoc/nodes/core/StructTypeNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/StructTypeNode.d.ts new file mode 100644 index 000000000..5e54e0387 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/StructTypeNode.d.ts @@ -0,0 +1,48 @@ +export default StructTypeNode; +/** + * Represents a struct type node in the node-based system. + * This class is used to define and manage the layout and types of struct members. + * It extends the base Node class and provides methods to get the length of the struct, + * retrieve member types, and generate the struct type for a builder. + * + * @augments Node + */ +declare class StructTypeNode extends Node { + /** + * Creates an instance of StructTypeNode. + * + * @param {Object} membersLayout - The layout of the members for the struct. + * @param {?string} [name=null] - The optional name of the struct. + */ + constructor(membersLayout: Object, name?: string | null); + /** + * The layout of the members for the struct + * + * @type {Array.<{name: string, type: string, atomic: boolean}>} + */ + membersLayout: Array<{ + name: string; + type: string; + atomic: boolean; + }>; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isStructLayoutNode: boolean; + /** + * Returns the length of the struct. + * The length is calculated by summing the lengths of the struct's members. + * + * @returns {number} The length of the struct. + */ + getLength(): number; + getMemberType(builder: any, name: any): string; + generateNodeType(builder: any): any; + setup(builder: any): void; + generate(builder: any): string; +} +import Node from './Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/SubBuildNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/SubBuildNode.d.ts new file mode 100644 index 000000000..a5227f1b6 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/SubBuildNode.d.ts @@ -0,0 +1,30 @@ +export default SubBuildNode; +export function subBuild(node: Node, name: string, type?: string | null): Node; +/** + * This node is used to build a sub-build in the node system. + * + * @augments Node + * @param {Node} node - The node to be built in the sub-build. + * @param {string} name - The name of the sub-build. + * @param {?string} [nodeType=null] - The type of the node, if known. + */ +declare class SubBuildNode extends Node { + constructor(node: any, name: any, nodeType?: null); + /** + * The node to be built in the sub-build. + * + * @type {Node} + */ + node: Node; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isSubBuildNode: boolean; + generateNodeType(builder: any): string; + build(builder: any, ...params: any[]): string | Node | null; +} +import Node from './Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/TempNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/TempNode.d.ts new file mode 100644 index 000000000..ed3119f09 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/TempNode.d.ts @@ -0,0 +1,28 @@ +export default TempNode; +/** + * This module uses cache management to create temporary variables + * if the node is used more than once to prevent duplicate calculations. + * + * The class acts as a base class for many other nodes types. + * + * @augments Node + */ +declare class TempNode extends Node { + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isTempNode: boolean; + /** + * Whether this node is used more than once in context of other nodes. + * + * @param {NodeBuilder} builder - The node builder. + * @return {boolean} A flag that indicates if there is more than one dependency to other nodes. + */ + hasDependencies(builder: NodeBuilder): boolean; + build(builder: any, output: any): any; +} +import Node from './Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/UniformGroupNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/UniformGroupNode.d.ts new file mode 100644 index 000000000..f61fdbe5b --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/UniformGroupNode.d.ts @@ -0,0 +1,77 @@ +export default UniformGroupNode; +export function uniformGroup(name: string, order?: number, updateType?: null): UniformGroupNode; +export function sharedUniformGroup(name: string, order?: number, updateType?: null): UniformGroupNode; +/** + * TSL object that represents a shared uniform group node which is updated once per frame. + * + * @tsl + * @type {UniformGroupNode} + */ +export const frameGroup: UniformGroupNode; +/** + * TSL object that represents a shared uniform group node which is updated once per render. + * + * @tsl + * @type {UniformGroupNode} + */ +export const renderGroup: UniformGroupNode; +/** + * TSL object that represents a uniform group node which is updated once per object. + * + * @tsl + * @type {UniformGroupNode} + */ +export const objectGroup: UniformGroupNode; +/** + * This node can be used to group single instances of {@link UniformNode} + * and manage them as a uniform buffer. + * + * In most cases, the predefined nodes `objectGroup`, `renderGroup` and `frameGroup` + * will be used when defining the {@link UniformNode#groupNode} property. + * + * - `objectGroup`: Uniform buffer per object. + * - `renderGroup`: Shared uniform buffer, updated once per render call. + * - `frameGroup`: Shared uniform buffer, updated once per frame. + * + * @augments Node + */ +declare class UniformGroupNode extends Node { + /** + * Constructs a new uniform group node. + * + * @param {string} name - The name of the uniform group node. + * @param {boolean} [shared=false] - Whether this uniform group node is shared or not. + * @param {number} [order=1] - Influences the internal sorting. + * @param {string|null} [updateType=null] - The update type of the uniform group node. + */ + constructor(name: string, shared?: boolean, order?: number, updateType?: string | null); + /** + * Whether this uniform group node is shared or not. + * + * @type {boolean} + * @default false + */ + shared: boolean; + /** + * Influences the internal sorting. + * TODO: Add details when this property should be changed. + * + * @type {number} + * @default 1 + */ + order: number; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isUniformGroup: boolean; + /** + * Marks the uniform group node as needing an update. + * This will trigger the necessary updates in the rendering process. + */ + update(): void; +} +import Node from './Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/UniformNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/UniformNode.d.ts new file mode 100644 index 000000000..f4cb493fb --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/UniformNode.d.ts @@ -0,0 +1,65 @@ +export default UniformNode; +export function uniform(value: any | string, type?: string): UniformNode; +/** + * Class for representing a uniform. + * + * @augments InputNode + */ +declare class UniformNode extends InputNode { + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isUniformNode: boolean; + /** + * The uniform group of this uniform. By default, uniforms are + * managed per object but they might belong to a shared group + * which is updated per frame or render call. + * + * @type {UniformGroupNode} + */ + groupNode: UniformGroupNode; + /** + * Sets the {@link UniformNode#name} property. + * + * @param {string} name - The name of the uniform. + * @return {UniformNode} A reference to this node. + */ + setName(name: string): UniformNode; + /** + * Sets the {@link UniformNode#name} property. + * + * @deprecated + * @param {string} name - The name of the uniform. + * @return {UniformNode} A reference to this node. + */ + label(name: string): UniformNode; + /** + * Sets the {@link UniformNode#groupNode} property. + * + * @param {UniformGroupNode} group - The uniform group. + * @return {UniformNode} A reference to this node. + */ + setGroup(group: UniformGroupNode): UniformNode; + /** + * Returns the {@link UniformNode#groupNode}. + * + * @return {UniformGroupNode} The uniform group. + */ + getGroup(): UniformGroupNode; + /** + * By default, this method returns the result of {@link Node#getHash} but derived + * classes might overwrite this method with a different implementation. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The uniform hash. + */ + getUniformHash(builder: NodeBuilder): string; + onUpdate(callback: any, updateType: any): import("./Node.js").default; + getInputType(builder: any): string; + generate(builder: any, output: any): any; +} +import InputNode from './InputNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/VarNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/VarNode.d.ts new file mode 100644 index 000000000..5e200133c --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/VarNode.d.ts @@ -0,0 +1,88 @@ +export default VarNode; +export function Var(node: Node, name?: string | null): VarNode; +export function Const(node: Node, name?: string | null): VarNode; +export function VarIntent(node: Node): VarNode; +/** + * Class for representing shader variables as nodes. Variables are created from + * existing nodes like the following: + * + * ```js + * const depth = sampleDepth( uvNode ).toVar( 'depth' ); + * ``` + * + * @augments Node + */ +declare class VarNode extends Node { + /** + * Constructs a new variable node. + * + * @param {Node} node - The node for which a variable should be created. + * @param {?string} [name=null] - The name of the variable in the shader. + * @param {boolean} [readOnly=false] - The read-only flag. + */ + constructor(node: Node, name?: string | null, readOnly?: boolean); + /** + * The node for which a variable should be created. + * + * @type {Node} + */ + node: Node; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isVarNode: boolean; + /** + * + * The read-only flag. + * + * @type {boolean} + * @default false + */ + readOnly: boolean; + /** + * This flag is used to indicate that this node is used for intent. + * + * @type {boolean} + * @default false + */ + intent: boolean; + /** + * Sets the intent flag for this node. + * + * This flag is used to indicate that this node is used for intent + * and should not be built directly. Instead, it is used to indicate that + * the node should be treated as a variable intent. + * + * It's useful for assigning variables without needing creating a new variable node. + * + * @param {boolean} value - The value to set for the intent flag. + * @returns {VarNode} This node. + */ + setIntent(value: boolean): VarNode; + /** + * Checks if this node is used for intent. + * + * @param {NodeBuilder} builder - The node builder. + * @returns {boolean} Whether this node is used for intent. + */ + isIntent(builder: NodeBuilder): boolean; + /** + * Returns the intent flag of this node. + * + * @return {boolean} The intent flag. + */ + getIntent(): boolean; + getMemberType(builder: any, name: any): string; + getElementType(builder: any): string; + generateNodeType(builder: any): string; + getArrayCount(builder: any): number | null; + isAssign(builder: any): any; + build(...params: any[]): string | Node | null; + generate(builder: any): any; + _hasStack(builder: any): boolean; +} +import Node from './Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/VaryingNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/VaryingNode.d.ts new file mode 100644 index 000000000..4833ad311 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/VaryingNode.d.ts @@ -0,0 +1,80 @@ +export default VaryingNode; +/** + * TSL function for creating a varying node. + * + * @tsl + * @function + * @param {Node} node - The node for which a varying should be created. + * @param {?string} name - The name of the varying in the shader. + * @returns {VaryingNode} + */ +export const varying: any; +export function vertexStage(node: Node): VaryingNode; +/** + * Class for representing shader varyings as nodes. Varyings are create from + * existing nodes like the following: + * + * ```js + * const positionLocal = positionGeometry.toVarying( 'vPositionLocal' ); + * ``` + * + * @augments Node + */ +declare class VaryingNode extends Node { + /** + * Constructs a new varying node. + * + * @param {Node} node - The node for which a varying should be created. + * @param {?string} name - The name of the varying in the shader. + */ + constructor(node: Node, name?: string | null); + /** + * The node for which a varying should be created. + * + * @type {Node} + */ + node: Node; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isVaryingNode: boolean; + /** + * The interpolation type of the varying data. + * + * @type {?string} + * @default null + */ + interpolationType: string | null; + /** + * The interpolation sampling type of varying data. + * + * @type {?string} + * @default null + */ + interpolationSampling: string | null; + /** + * Defines the interpolation type of the varying. + * + * @param {string} type - The interpolation type. + * @param {?string} sampling - The interpolation sampling type + * @return {VaryingNode} A reference to this node. + */ + setInterpolation(type: string, sampling?: string | null): VaryingNode; + getHash(builder: any): string; + generateNodeType(builder: any): string; + /** + * This method performs the setup of a varying node with the current node builder. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {NodeVarying} The node varying from the node builder. + */ + setupVarying(builder: NodeBuilder): NodeVarying; + setup(builder: any): void; + analyze(builder: any): void; + generate(builder: any): any; +} +import Node from './Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/constants.d.ts b/jsdoc-testing/jsdoc/nodes/core/constants.d.ts new file mode 100644 index 000000000..5d342ff3a --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/core/constants.d.ts @@ -0,0 +1,30 @@ +export namespace NodeShaderStage { + let VERTEX: string; + let FRAGMENT: string; +} +export namespace NodeUpdateType { + let NONE: string; + let FRAME: string; + let RENDER: string; + let OBJECT: string; +} +export namespace NodeType { + let BOOLEAN: string; + let INTEGER: string; + let FLOAT: string; + let VECTOR2: string; + let VECTOR3: string; + let VECTOR4: string; + let MATRIX2: string; + let MATRIX3: string; + let MATRIX4: string; +} +export namespace NodeAccess { + let READ_ONLY: string; + let WRITE_ONLY: string; + let READ_WRITE: string; +} +export const defaultShaderStages: string[]; +export const defaultBuildStages: string[]; +export const shaderStages: string[]; +export const vectorComponents: string[]; diff --git a/jsdoc-testing/jsdoc/nodes/display/BlendModes.d.ts b/jsdoc-testing/jsdoc/nodes/display/BlendModes.d.ts new file mode 100644 index 000000000..244185457 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/display/BlendModes.d.ts @@ -0,0 +1,95 @@ +/** + * Represents a "Color Burn" blend mode. + * + * It's designed to darken the base layer's colors based on the color of the blend layer. + * It significantly increases the contrast of the base layer, making the colors more vibrant and saturated. + * The darker the color in the blend layer, the stronger the darkening and contrast effect on the base layer. + * + * @tsl + * @function + * @param {Node} base - The base color. + * @param {Node} blend - The blend color. A white (#ffffff) blend color does not alter the base color. + * @return {Node} The result. + */ +export const blendBurn: any; +/** + * Represents a "Color Dodge" blend mode. + * + * It's designed to lighten the base layer's colors based on the color of the blend layer. + * It significantly increases the brightness of the base layer, making the colors lighter and more vibrant. + * The brighter the color in the blend layer, the stronger the lightening and contrast effect on the base layer. + * + * @tsl + * @function + * @param {Node} base - The base color. + * @param {Node} blend - The blend color. A black (#000000) blend color does not alter the base color. + * @return {Node} The result. + */ +export const blendDodge: any; +/** + * Represents a "Screen" blend mode. + * + * Similar to `blendDodge()`, this mode also lightens the base layer's colors based on the color of the blend layer. + * The "Screen" blend mode is better for general brightening whereas the "Dodge" results in more subtle and nuanced + * effects. + * + * @tsl + * @function + * @param {Node} base - The base color. + * @param {Node} blend - The blend color. A black (#000000) blend color does not alter the base color. + * @return {Node} The result. + */ +export const blendScreen: any; +/** + * Represents a "Overlay" blend mode. + * + * It's designed to increase the contrast of the base layer based on the color of the blend layer. + * It amplifies the existing colors and contrast in the base layer, making lighter areas lighter and darker areas darker. + * The color of the blend layer significantly influences the resulting contrast and color shift in the base layer. + * + * @tsl + * @function + * @param {Node} base - The base color. + * @param {Node} blend - The blend color + * @return {Node} The result. + */ +export const blendOverlay: any; +/** + * This function blends two color based on their alpha values by replicating the behavior of `THREE.NormalBlending`. + * It assumes both input colors have non-premultiplied alpha. + * + * @tsl + * @function + * @param {Node} base - The base color. + * @param {Node} blend - The blend color + * @return {Node} The result. + */ +export const blendColor: any; +/** + * Premultiplies the RGB channels of a color by its alpha channel. + * + * This function is useful for converting a non-premultiplied alpha color + * into a premultiplied alpha format, where the RGB values are scaled + * by the alpha value. Premultiplied alpha is often used in graphics + * rendering for certain operations, such as compositing and image processing. + * + * @tsl + * @function + * @param {Node} color - The input color with non-premultiplied alpha. + * @return {Node} The color with premultiplied alpha. + */ +export const premultiplyAlpha: () => void; +/** + * Unpremultiplies the RGB channels of a color by its alpha channel. + * + * This function is useful for converting a premultiplied alpha color + * back into a non-premultiplied alpha format, where the RGB values are + * divided by the alpha value. Unpremultiplied alpha is often used in graphics + * rendering for certain operations, such as compositing and image processing. + * + * @tsl + * @function + * @param {Node} color - The input color with premultiplied alpha. + * @return {Node} The color with non-premultiplied alpha. + */ +export const unpremultiplyAlpha: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/display/BumpMapNode.d.ts b/jsdoc-testing/jsdoc/nodes/display/BumpMapNode.d.ts new file mode 100644 index 000000000..08aa47f62 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/display/BumpMapNode.d.ts @@ -0,0 +1,44 @@ +export default BumpMapNode; +/** + * TSL function for creating a bump map node. + * + * @tsl + * @function + * @param {Node} textureNode - Represents the bump map data. + * @param {?Node} [scaleNode=null] - Controls the intensity of the bump effect. + * @returns {BumpMapNode} + */ +export const bumpMap: any; +/** + * This class can be used for applying bump maps to materials. + * + * ```js + * material.normalNode = bumpMap( texture( bumpTex ) ); + * ``` + * + * @augments TempNode + */ +declare class BumpMapNode extends TempNode { + /** + * Constructs a new bump map node. + * + * @param {Node} textureNode - Represents the bump map data. + * @param {?Node} [scaleNode=null] - Controls the intensity of the bump effect. + */ + constructor(textureNode: Node, scaleNode?: Node | null); + /** + * Represents the bump map data. + * + * @type {Node} + */ + textureNode: Node; + /** + * Controls the intensity of the bump effect. + * + * @type {?Node} + * @default null + */ + scaleNode: Node | null; + setup(): void; +} +import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/display/ColorAdjustment.d.ts b/jsdoc-testing/jsdoc/nodes/display/ColorAdjustment.d.ts new file mode 100644 index 000000000..342c82742 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/display/ColorAdjustment.d.ts @@ -0,0 +1,76 @@ +/** + * Computes a grayscale value for the given RGB color value. + * + * @tsl + * @function + * @param {Node} color - The color value to compute the grayscale for. + * @return {Node} The grayscale color. + */ +export const grayscale: () => void; +/** + * Super-saturates or desaturates the given RGB color. + * + * @tsl + * @function + * @param {Node} color - The input color. + * @param {Node} [adjustment=1] - Specifies the amount of the conversion. A value under `1` desaturates the color, a value over `1` super-saturates it. + * @return {Node} The saturated color. + */ +export const saturation: () => void; +/** + * Selectively enhance the intensity of less saturated RGB colors. Can result + * in a more natural and visually appealing image with enhanced color depth + * compared to {@link ColorAdjustment#saturation}. + * + * @tsl + * @function + * @param {Node} color - The input color. + * @param {Node} [adjustment=1] - Controls the intensity of the vibrance effect. + * @return {Node} The updated color. + */ +export const vibrance: () => void; +/** + * Updates the hue component of the given RGB color while preserving its luminance and saturation. + * + * @tsl + * @function + * @param {Node} color - The input color. + * @param {Node} [adjustment=1] - Defines the degree of hue rotation in radians. A positive value rotates the hue clockwise, while a negative value rotates it counterclockwise. + * @return {Node} The updated color. + */ +export const hue: () => void; +export function luminance(color: Node, luminanceCoefficients?: Node | null): Node; +/** + * Color Decision List (CDL) v1.2 + * + * Compact representation of color grading information, defined by slope, offset, power, and + * saturation. The CDL should be typically be given input in a log space (such as LogC, ACEScc, + * or AgX Log), and will return output in the same space. Output may require clamping >=0. + * + * @tsl + * @function + * @param {Node} color Input (-Infinity < input < +Infinity) + * @param {Node} slope Slope (0 ≤ slope < +Infinity) + * @param {Node} offset Offset (-Infinity < offset < +Infinity; typically -1 < offset < 1) + * @param {Node} power Power (0 < power < +Infinity) + * @param {Node} saturation Saturation (0 ≤ saturation < +Infinity; typically 0 ≤ saturation < 4) + * @param {Node} luminanceCoefficients Luminance coefficients for saturation term, typically Rec. 709 + * @return {Node} Output, -Infinity < output < +Infinity + * + * References: + * - ASC CDL v1.2 + * - {@link https://blender.stackexchange.com/a/55239/43930} + * - {@link https://docs.acescentral.com/specifications/acescc/} + */ +export const cdl: () => void; +/** + * TSL function for creating a posterize effect which reduces the number of colors + * in an image, resulting in a more blocky and stylized appearance. + * + * @tsl + * @function + * @param {Node} sourceNode - The input color. + * @param {Node} stepsNode - Controls the intensity of the posterization effect. A lower number results in a more blocky appearance. + * @returns {Node} The posterized color. + */ +export const posterize: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/display/ColorSpaceFunctions.d.ts b/jsdoc-testing/jsdoc/nodes/display/ColorSpaceFunctions.d.ts new file mode 100644 index 000000000..2677fb978 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/display/ColorSpaceFunctions.d.ts @@ -0,0 +1,18 @@ +/** + * Converts the given color value from sRGB to linear-sRGB color space. + * + * @tsl + * @function + * @param {Node} color - The sRGB color. + * @return {Node} The linear-sRGB color. + */ +export const sRGBTransferEOTF: any; +/** + * Converts the given color value from linear-sRGB to sRGB color space. + * + * @tsl + * @function + * @param {Node} color - The linear-sRGB color. + * @return {Node} The sRGB color. + */ +export const sRGBTransferOETF: any; diff --git a/jsdoc-testing/jsdoc/nodes/display/ColorSpaceNode.d.ts b/jsdoc-testing/jsdoc/nodes/display/ColorSpaceNode.d.ts new file mode 100644 index 000000000..37eaac303 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/display/ColorSpaceNode.d.ts @@ -0,0 +1,50 @@ +export default ColorSpaceNode; +export function workingToColorSpace(node: Node, targetColorSpace: string): ColorSpaceNode; +export function colorSpaceToWorking(node: Node, sourceColorSpace: string): ColorSpaceNode; +export function convertColorSpace(node: Node, sourceColorSpace: string, targetColorSpace: string): ColorSpaceNode; +/** + * This node represents a color space conversion. Meaning it converts + * a color value from a source to a target color space. + * + * @augments TempNode + */ +declare class ColorSpaceNode extends TempNode { + /** + * Constructs a new color space node. + * + * @param {Node} colorNode - Represents the color to convert. + * @param {string} source - The source color space. + * @param {string} target - The target color space. + */ + constructor(colorNode: Node, source: string, target: string); + /** + * Represents the color to convert. + * + * @type {Node} + */ + colorNode: Node; + /** + * The source color space. + * + * @type {string} + */ + source: string; + /** + * The target color space. + * + * @type {string} + */ + target: string; + /** + * This method resolves the constants `WORKING_COLOR_SPACE` and + * `OUTPUT_COLOR_SPACE` based on the current configuration of the + * color management and renderer. + * + * @param {NodeBuilder} builder - The current node builder. + * @param {string} colorSpace - The color space to resolve. + * @return {string} The resolved color space. + */ + resolveColorSpace(builder: NodeBuilder, colorSpace: string): string; + setup(builder: any): Node; +} +import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/display/FrontFacingNode.d.ts b/jsdoc-testing/jsdoc/nodes/display/FrontFacingNode.d.ts new file mode 100644 index 000000000..8a54e2d33 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/display/FrontFacingNode.d.ts @@ -0,0 +1,48 @@ +export default FrontFacingNode; +/** + * TSL object that represents whether a primitive is front or back facing + * + * @tsl + * @type {FrontFacingNode} + */ +export const frontFacing: FrontFacingNode; +/** + * TSL object that represents the front facing status as a number instead of a bool. + * `1` means front facing, `-1` means back facing. + * + * @tsl + * @type {Node} + */ +export const faceDirection: Node; +/** + * Converts a direction vector to a face direction vector based on the material's side. + * + * If the material is set to `BackSide`, the direction is inverted. + * If the material is set to `DoubleSide`, the direction is multiplied by `faceDirection`. + * + * @tsl + * @param {Node} direction - The direction vector to convert. + * @returns {Node} The converted direction vector. + */ +export const directionToFaceDirection: () => void; +/** + * This node can be used to evaluate whether a primitive is front or back facing. + * + * @augments Node + */ +declare class FrontFacingNode extends Node { + /** + * Constructs a new front facing node. + */ + constructor(); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isFrontFacingNode: boolean; + generate(builder: any): any; +} +import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/display/NormalMapNode.d.ts b/jsdoc-testing/jsdoc/nodes/display/NormalMapNode.d.ts new file mode 100644 index 000000000..a87be475f --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/display/NormalMapNode.d.ts @@ -0,0 +1,58 @@ +export default NormalMapNode; +/** + * TSL function for creating a normal map node. + * + * @tsl + * @function + * @param {Node} node - Represents the normal map data. + * @param {?Node} [scaleNode=null] - Controls the intensity of the effect. + * @returns {NormalMapNode} + */ +export const normalMap: any; +/** + * This class can be used for applying normals maps to materials. + * + * ```js + * material.normalNode = normalMap( texture( normalTex ) ); + * ``` + * + * @augments TempNode + */ +declare class NormalMapNode extends TempNode { + /** + * Constructs a new normal map node. + * + * @param {Node} node - Represents the normal map data. + * @param {?Node} [scaleNode=null] - Controls the intensity of the effect. + */ + constructor(node: Node, scaleNode?: Node | null); + /** + * Represents the normal map data. + * + * @type {Node} + */ + node: Node; + /** + * Controls the intensity of the effect. + * + * @type {?Node} + * @default null + */ + scaleNode: Node | null; + /** + * The normal map type. + * + * @type {(TangentSpaceNormalMap|ObjectSpaceNormalMap)} + * @default TangentSpaceNormalMap + */ + normalMapType: (number | number); + /** + * Controls how to unpack the sampled normal map values. + * + * @type {string} + * @default NoNormalPacking + */ + unpackNormalMode: string; + setup(builder: any): any; +} +import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/display/PassNode.d.ts b/jsdoc-testing/jsdoc/nodes/display/PassNode.d.ts new file mode 100644 index 000000000..bd6dfbb24 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/display/PassNode.d.ts @@ -0,0 +1,417 @@ +export default PassNode; +export function pass(scene: Scene, camera: Camera, options: Object): PassNode; +export function passTexture(pass: PassNode, texture: Texture): PassTextureNode; +export function depthPass(scene: Scene, camera: Camera, options: Object): PassNode; +/** + * Represents a render pass (sometimes called beauty pass) in context of post processing. + * This pass produces a render for the given scene and camera and can provide multiple outputs + * via MRT for further processing. + * + * ```js + * const postProcessing = new RenderPipeline( renderer ); + * + * const scenePass = pass( scene, camera ); + * + * postProcessing.outputNode = scenePass; + * ``` + * + * @augments TempNode + */ +declare class PassNode extends TempNode { + /** + * Constructs a new pass node. + * + * @param {('color'|'depth')} scope - The scope of the pass. The scope determines whether the node outputs color or depth. + * @param {Scene} scene - A reference to the scene. + * @param {Camera} camera - A reference to the camera. + * @param {Object} options - Options for the internal render target. + */ + constructor(scope: ("color" | "depth"), scene: Scene, camera: Camera, options?: Object); + /** + * The scope of the pass. The scope determines whether the node outputs color or depth. + * + * @type {('color'|'depth')} + */ + scope: ("color" | "depth"); + /** + * A reference to the scene. + * + * @type {Scene} + */ + scene: Scene; + /** + * A reference to the camera. + * + * @type {Camera} + */ + camera: Camera; + /** + * Options for the internal render target. + * + * @type {Object} + */ + options: Object; + /** + * The pass's pixel ratio. Will be kept automatically kept in sync with the renderer's pixel ratio. + * + * @private + * @type {number} + * @default 1 + */ + private _pixelRatio; + /** + * The pass's pixel width. Will be kept automatically kept in sync with the renderer's width. + * @private + * @type {number} + * @default 1 + */ + private _width; + /** + * The pass's pixel height. Will be kept automatically kept in sync with the renderer's height. + * @private + * @type {number} + * @default 1 + */ + private _height; + /** + * The pass's render target. + * + * @type {RenderTarget} + */ + renderTarget: RenderTarget; + /** + * An optional override material for the pass. + * + * @type {Material|null} + */ + overrideMaterial: Material | null; + /** + * Whether the pass is transparent. + * + * @type {boolean} + * @default false + */ + transparent: boolean; + /** + * Whether the pass is opaque. + * + * @type {boolean} + * @default true + */ + opaque: boolean; + /** + * An optional global context for the pass. + * + * @type {ContextNode|null} + */ + contextNode: ContextNode | null; + /** + * A cache for the context node. + * + * @private + * @type {?Object} + * @default null + */ + private _contextNodeCache; + /** + * A dictionary holding the internal result textures. + * + * @private + * @type {Object} + */ + private _textures; + /** + * A dictionary holding the internal texture nodes. + * + * @private + * @type {Object} + */ + private _textureNodes; + /** + * A dictionary holding the internal depth nodes. + * + * @private + * @type {Object} + */ + private _linearDepthNodes; + /** + * A dictionary holding the internal viewZ nodes. + * + * @private + * @type {Object} + */ + private _viewZNodes; + /** + * A dictionary holding the texture data of the previous frame. + * Used for computing velocity/motion vectors. + * + * @private + * @type {Object} + */ + private _previousTextures; + /** + * A dictionary holding the texture nodes of the previous frame. + * Used for computing velocity/motion vectors. + * + * @private + * @type {Object} + */ + private _previousTextureNodes; + /** + * The `near` property of the camera as a uniform. + * + * @private + * @type {UniformNode} + */ + private _cameraNear; + /** + * The `far` property of the camera as a uniform. + * + * @private + * @type {UniformNode} + */ + private _cameraFar; + /** + * A MRT node configuring the MRT settings. + * + * @private + * @type {?MRTNode} + * @default null + */ + private _mrt; + /** + * Layer object for configuring the camera that is used + * to produce the pass. + * + * @private + * @type {?Layers} + * @default null + */ + private _layers; + /** + * Scales the resolution of the internal render target. + * + * @private + * @type {number} + * @default 1 + */ + private _resolutionScale; + /** + * Custom viewport definition. + * + * @private + * @type {?Vector4} + * @default null + */ + private _viewport; + /** + * Custom scissor definition. + * + * @private + * @type {?Vector4} + * @default null + */ + private _scissor; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isPassNode: boolean; + /** + * Sets the resolution scale for the pass. + * The resolution scale is a factor that is multiplied with the renderer's width and height. + * + * @param {number} resolutionScale - The resolution scale to set. A value of `1` means full resolution. + * @return {PassNode} A reference to this pass. + */ + setResolutionScale(resolutionScale: number): PassNode; + /** + * Gets the current resolution scale of the pass. + * + * @return {number} The current resolution scale. A value of `1` means full resolution. + */ + getResolutionScale(): number; + /** + * Sets the resolution for the pass. + * The resolution is a factor that is multiplied with the renderer's width and height. + * + * @param {number} resolution - The resolution to set. A value of `1` means full resolution. + * @return {PassNode} A reference to this pass. + * @deprecated since r181. Use {@link PassNode#setResolutionScale `setResolutionScale()`} instead. + */ + setResolution(resolution: number): PassNode; + /** + * Gets the current resolution of the pass. + * + * @return {number} The current resolution. A value of `1` means full resolution. + * @deprecated since r181. Use {@link PassNode#getResolutionScale `getResolutionScale()`} instead. + */ + getResolution(): number; + /** + * Sets the layer configuration that should be used when rendering the pass. + * + * @param {Layers} layers - The layers object to set. + * @return {PassNode} A reference to this pass. + */ + setLayers(layers: Layers): PassNode; + /** + * Gets the current layer configuration of the pass. + * + * @return {?Layers} . + */ + getLayers(): Layers | null; + /** + * Sets the given MRT node to setup MRT for this pass. + * + * @param {MRTNode} mrt - The MRT object. + * @return {PassNode} A reference to this pass. + */ + setMRT(mrt: MRTNode): PassNode; + /** + * Returns the current MRT node. + * + * @return {MRTNode} The current MRT node. + */ + getMRT(): MRTNode; + /** + * Returns the texture for the given output name. + * + * @param {string} name - The output name to get the texture for. + * @return {Texture} The texture. + */ + getTexture(name: string): Texture; + /** + * Returns the texture holding the data of the previous frame for the given output name. + * + * @param {string} name - The output name to get the texture for. + * @return {Texture} The texture holding the data of the previous frame. + */ + getPreviousTexture(name: string): Texture; + /** + * Switches current and previous textures for the given output name. + * + * @param {string} name - The output name. + */ + toggleTexture(name: string): void; + /** + * Returns the texture node for the given output name. + * + * @param {string} [name='output'] - The output name to get the texture node for. + * @return {TextureNode} The texture node. + */ + getTextureNode(name?: string): TextureNode; + /** + * Returns the previous texture node for the given output name. + * + * @param {string} [name='output'] - The output name to get the previous texture node for. + * @return {TextureNode} The previous texture node. + */ + getPreviousTextureNode(name?: string): TextureNode; + /** + * Returns a viewZ node of this pass. + * + * @param {string} [name='depth'] - The output name to get the viewZ node for. In most cases the default `'depth'` can be used however the parameter exists for custom depth outputs. + * @return {Node} The viewZ node. + */ + getViewZNode(name?: string): Node; + /** + * Returns a linear depth node of this pass. + * + * @param {string} [name='depth'] - The output name to get the linear depth node for. In most cases the default `'depth'` can be used however the parameter exists for custom depth outputs. + * @return {Node} The linear depth node. + */ + getLinearDepthNode(name?: string): Node; + /** + * Precompiles the pass. + * + * Note that this method must be called after the pass configuration is complete. + * So calls like `setMRT()` and `getTextureNode()` must proceed the precompilation. + * + * @async + * @param {Renderer} renderer - The renderer. + * @return {Promise} A Promise that resolves when the compile has been finished. + * @see {@link Renderer#compileAsync} + */ + compileAsync(renderer: Renderer): Promise; + setup({ renderer }: { + renderer: any; + }): Node | TextureNode; + updateBefore(frame: any): void; + /** + * Sets the size of the pass's render target. Honors the pixel ratio. + * + * @param {number} width - The width to set. + * @param {number} height - The height to set. + */ + setSize(width: number, height: number): void; + /** + * This method allows to define the pass's scissor rectangle. By default, the scissor rectangle is kept + * in sync with the pass's dimensions. To reverse the process and use auto-sizing again, call the method + * with `null` as the single argument. + * + * @param {?(number | Vector4)} x - The horizontal coordinate for the lower left corner of the box in logical pixel unit. + * Instead of passing four arguments, the method also works with a single four-dimensional vector. + * @param {number} y - The vertical coordinate for the lower left corner of the box in logical pixel unit. + * @param {number} width - The width of the scissor box in logical pixel unit. + * @param {number} height - The height of the scissor box in logical pixel unit. + */ + setScissor(x: (number | Vector4) | null, y: number, width: number, height: number): void; + /** + * This method allows to define the pass's viewport. By default, the viewport is kept in sync + * with the pass's dimensions. To reverse the process and use auto-sizing again, call the method + * with `null` as the single argument. + * + * @param {number | Vector4} x - The horizontal coordinate for the lower left corner of the viewport origin in logical pixel unit. + * @param {number} y - The vertical coordinate for the lower left corner of the viewport origin in logical pixel unit. + * @param {number} width - The width of the viewport in logical pixel unit. + * @param {number} height - The height of the viewport in logical pixel unit. + */ + setViewport(x: number | Vector4, y: number, width: number, height: number): void; + /** + * Sets the pixel ratio the pass's render target and updates the size. + * + * @param {number} pixelRatio - The pixel ratio to set. + */ + setPixelRatio(pixelRatio: number): void; +} +declare namespace PassNode { + let COLOR: "color"; + let DEPTH: "depth"; +} +/** + * Represents the texture of a pass node. + * + * @augments TextureNode + */ +declare class PassTextureNode extends TextureNode { + /** + * Constructs a new pass texture node. + * + * @param {PassNode} passNode - The pass node. + * @param {Texture} texture - The output texture. + */ + constructor(passNode: PassNode, texture: Texture); + /** + * A reference to the pass node. + * + * @type {PassNode} + */ + passNode: PassNode; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @default true + * @readonly + */ + readonly isPassTextureNode: boolean; + setup(builder: any): void; + clone(): any; +} +import TempNode from '../core/TempNode.js'; +import { RenderTarget } from '../../core/RenderTarget.js'; +import { default as TextureNode } from '../accessors/TextureNode.js'; +import { Vector4 } from '../../math/Vector4.js'; diff --git a/jsdoc-testing/jsdoc/nodes/display/RenderOutputNode.d.ts b/jsdoc-testing/jsdoc/nodes/display/RenderOutputNode.d.ts new file mode 100644 index 000000000..d469787e9 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/display/RenderOutputNode.d.ts @@ -0,0 +1,79 @@ +export default RenderOutputNode; +export function renderOutput(color: Node, toneMapping?: number | null, outputColorSpace?: string | null): RenderOutputNode; +/** + * Normally, tone mapping and color conversion happens automatically just + * before outputting a pixel to the default (screen) framebuffer. In certain + * post processing setups this is too late because some effects such as FXAA + * require e.g. sRGB input. For such scenarios, `RenderOutputNode` can be used + * to apply tone mapping and color space conversion at an arbitrary point + * in the effect chain. + * + * When applying tone mapping and color space conversion manually with this node, + * you have to set {@link RenderPipeline#outputColorTransform} to `false`. + * + * ```js + * const postProcessing = new RenderPipeline( renderer ); + * postProcessing.outputColorTransform = false; + * + * const scenePass = pass( scene, camera ); + * const outputPass = renderOutput( scenePass ); + * + * postProcessing.outputNode = outputPass; + * ``` + * + * @augments TempNode + */ +declare class RenderOutputNode extends TempNode { + /** + * Constructs a new render output node. + * + * @param {Node} colorNode - The color node to process. + * @param {?number} toneMapping - The tone mapping type. + * @param {?string} outputColorSpace - The output color space. + */ + constructor(colorNode: Node, toneMapping: number | null, outputColorSpace: string | null); + /** + * The color node to process. + * + * @type {Node} + */ + colorNode: Node; + /** + * The tone mapping type. + * + * @private + * @type {?number} + */ + private _toneMapping; + /** + * The output color space. + * + * @type {?string} + */ + outputColorSpace: string | null; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isRenderOutputNode: boolean; + /** + * Sets the tone mapping type. + * + * @param {number} value - The tone mapping type. + * @return {ToneMappingNode} A reference to this node. + */ + setToneMapping(value: number): ToneMappingNode; + /** + * Gets the tone mapping type. + * + * @returns {number} The tone mapping type. + */ + getToneMapping(): number; + setup({ context }: { + context: any; + }): Node; +} +import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/display/ScreenNode.d.ts b/jsdoc-testing/jsdoc/nodes/display/ScreenNode.d.ts new file mode 100644 index 000000000..b721d4072 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/display/ScreenNode.d.ts @@ -0,0 +1,127 @@ +export default ScreenNode; +/** + * TSL object that represents the current DPR. + * + * @tsl + * @type {ScreenNode} + */ +export const screenDPR: ScreenNode; +/** + * TSL object that represents normalized screen coordinates, unitless in `[0, 1]`. + * + * @tsl + * @type {ScreenNode} + */ +export const screenUV: ScreenNode; +/** + * TSL object that represents the screen resolution in physical pixel units. + * + * @tsl + * @type {ScreenNode} + */ +export const screenSize: ScreenNode; +/** + * TSL object that represents the current `x`/`y` pixel position on the screen in physical pixel units. + * + * @tsl + * @type {ScreenNode} + */ +export const screenCoordinate: ScreenNode; +/** + * TSL object that represents the viewport rectangle as `x`, `y`, `width` and `height` in physical pixel units. + * + * @tsl + * @type {ScreenNode} + */ +export const viewport: ScreenNode; +/** + * TSL object that represents the viewport resolution in physical pixel units. + * + * @tsl + * @type {ScreenNode} + */ +export const viewportSize: ScreenNode; +/** + * TSL object that represents the current `x`/`y` pixel position on the viewport in physical pixel units. + * + * @tsl + * @type {ScreenNode} + */ +export const viewportCoordinate: ScreenNode; +/** + * TSL object that represents normalized viewport coordinates, unitless in `[0, 1]`. + * + * @tsl + * @type {ScreenNode} + */ +export const viewportUV: ScreenNode; +/** + * @deprecated since r169. Use {@link screenSize} instead. + */ +export const viewportResolution: any; +/** + * This node provides a collection of screen related metrics. + * Depending on {@link ScreenNode#scope}, the nodes can represent + * resolution or viewport data as well as fragment or uv coordinates. + * + * @augments Node + */ +declare class ScreenNode extends Node { + /** + * Constructs a new screen node. + * + * @param {('coordinate'|'viewport'|'size'|'uv'|'dpr')} scope - The node's scope. + */ + constructor(scope: ("coordinate" | "viewport" | "size" | "uv" | "dpr")); + /** + * The node represents different metric depending on which scope is selected. + * + * - `ScreenNode.COORDINATE`: Window-relative coordinates of the current fragment according to WebGPU standards. + * - `ScreenNode.VIEWPORT`: The current viewport defined as a four-dimensional vector. + * - `ScreenNode.SIZE`: The dimensions of the current bound framebuffer. + * - `ScreenNode.UV`: Normalized coordinates. + * - `ScreenNode.DPR`: Device pixel ratio. + * + * @type {('coordinate'|'viewport'|'size'|'uv'|'dpr')} + */ + scope: ("coordinate" | "viewport" | "size" | "uv" | "dpr"); + /** + * This output node. + * + * @private + * @type {?Node} + * @default null + */ + private _output; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isViewportNode: boolean; + /** + * This method is overwritten since the node type depends on the selected scope. + * + * @return {('float'|'vec2'|'vec4')} The node type. + */ + generateNodeType(): ("float" | "vec2" | "vec4"); + /** + * `ScreenNode` implements {@link Node#update} to retrieve viewport and size information + * from the current renderer. + * + * @param {NodeFrame} frame - A reference to the current node frame. + */ + update({ renderer }: NodeFrame): void; + setup(): any; + generate(builder: any): any; +} +declare namespace ScreenNode { + let COORDINATE: string; + let VIEWPORT: string; + let SIZE: string; + let UV: string; + let DPR: string; +} +import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/display/ToneMappingFunctions.d.ts b/jsdoc-testing/jsdoc/nodes/display/ToneMappingFunctions.d.ts new file mode 100644 index 000000000..2d04148f4 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/display/ToneMappingFunctions.d.ts @@ -0,0 +1,68 @@ +/** + * Linear tone mapping, exposure only. + * + * @tsl + * @function + * @param {Node} color - The color that should be tone mapped. + * @param {Node} exposure - The exposure. + * @return {Node} The tone mapped color. + */ +export const linearToneMapping: any; +/** + * Reinhard tone mapping. + * + * Reference: {@link https://www.cs.utah.edu/docs/techreports/2002/pdf/UUCS-02-001.pdf} + * + * @tsl + * @function + * @param {Node} color - The color that should be tone mapped. + * @param {Node} exposure - The exposure. + * @return {Node} The tone mapped color. + */ +export const reinhardToneMapping: any; +/** + * Cineon tone mapping. + * + * Reference: {@link http://filmicworlds.com/blog/filmic-tonemapping-operators/} + * + * @tsl + * @function + * @param {Node} color - The color that should be tone mapped. + * @param {Node} exposure - The exposure. + * @return {Node} The tone mapped color. + */ +export const cineonToneMapping: any; +/** + * ACESFilmic tone mapping. + * + * Reference: {@link https://github.com/selfshadow/ltc_code/blob/master/webgl/shaders/ltc/ltc_blit.fs} + * + * @tsl + * @function + * @param {Node} color - The color that should be tone mapped. + * @param {Node} exposure - The exposure. + * @return {Node} The tone mapped color. + */ +export const acesFilmicToneMapping: any; +/** + * AgX tone mapping. + * + * @tsl + * @function + * @param {Node} color - The color that should be tone mapped. + * @param {Node} exposure - The exposure. + * @return {Node} The tone mapped color. + */ +export const agxToneMapping: any; +/** + * Neutral tone mapping. + * + * Reference: {@link https://modelviewer.dev/examples/tone-mapping} + * + * @tsl + * @function + * @param {Node} color - The color that should be tone mapped. + * @param {Node} exposure - The exposure. + * @return {Node} The tone mapped color. + */ +export const neutralToneMapping: any; diff --git a/jsdoc-testing/jsdoc/nodes/display/ToneMappingNode.d.ts b/jsdoc-testing/jsdoc/nodes/display/ToneMappingNode.d.ts new file mode 100644 index 000000000..7e8ca1871 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/display/ToneMappingNode.d.ts @@ -0,0 +1,60 @@ +export default ToneMappingNode; +export function toneMapping(mapping: number, exposure: Node | number, color: Node | Color): ToneMappingNode; +/** + * TSL object that represents the global tone mapping exposure of the renderer. + * + * @tsl + * @type {RendererReferenceNode} + */ +export const toneMappingExposure: RendererReferenceNode; +/** + * This node represents a tone mapping operation. + * + * @augments TempNode + */ +declare class ToneMappingNode extends TempNode { + /** + * Constructs a new tone mapping node. + * + * @param {number} toneMapping - The tone mapping type. + * @param {Node} exposureNode - The tone mapping exposure. + * @param {Node} [colorNode=null] - The color node to process. + */ + constructor(toneMapping: number, exposureNode?: Node, colorNode?: Node); + /** + * The tone mapping type. + * + * @private + * @type {number} + */ + private _toneMapping; + /** + * The tone mapping exposure. + * + * @type {Node} + * @default null + */ + exposureNode: Node; + /** + * Represents the color to process. + * + * @type {?Node} + * @default null + */ + colorNode: Node | null; + /** + * Sets the tone mapping type. + * + * @param {number} value - The tone mapping type. + * @return {ToneMappingNode} A reference to this node. + */ + setToneMapping(value: number): ToneMappingNode; + /** + * Gets the tone mapping type. + * + * @returns {number} The tone mapping type. + */ + getToneMapping(): number; + setup(builder: any): any; +} +import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/display/ToonOutlinePassNode.d.ts b/jsdoc-testing/jsdoc/nodes/display/ToonOutlinePassNode.d.ts new file mode 100644 index 000000000..cb934f4cb --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/display/ToonOutlinePassNode.d.ts @@ -0,0 +1,71 @@ +export default ToonOutlinePassNode; +export function toonOutlinePass(scene: Scene, camera: Camera, color?: Color, thickness?: number, alpha?: number): ToonOutlinePassNode; +/** + * Represents a render pass for producing a toon outline effect on compatible objects. + * Only 3D objects with materials of type `MeshToonMaterial` and `MeshToonNodeMaterial` + * will receive the outline. + * + * ```js + * const postProcessing = new RenderPipeline( renderer ); + * + * const scenePass = toonOutlinePass( scene, camera ); + * + * postProcessing.outputNode = scenePass; + * ``` + * @augments PassNode + */ +declare class ToonOutlinePassNode extends PassNode { + /** + * Constructs a new outline pass node. + * + * @param {Scene} scene - A reference to the scene. + * @param {Camera} camera - A reference to the camera. + * @param {Node} colorNode - Defines the outline's color. + * @param {Node} thicknessNode - Defines the outline's thickness. + * @param {Node} alphaNode - Defines the outline's alpha. + */ + constructor(scene: Scene, camera: Camera, colorNode: Node, thicknessNode: Node, alphaNode: Node); + /** + * Defines the outline's color. + * + * @type {Node} + */ + colorNode: Node; + /** + * Defines the outline's thickness. + * + * @type {Node} + */ + thicknessNode: Node; + /** + * Defines the outline's alpha. + * + * @type {Node} + */ + alphaNode: Node; + /** + * An internal material cache. + * + * @private + * @type {WeakMap} + */ + private _materialCache; + /** + * Creates the material used for outline rendering. + * + * @private + * @return {NodeMaterial} The outline material. + */ + private _createMaterial; + /** + * For the given toon material, this method returns a corresponding + * outline material. + * + * @private + * @param {(MeshToonMaterial|MeshToonNodeMaterial)} originalMaterial - The toon material. + * @return {NodeMaterial} The outline material. + */ + private _getOutlineMaterial; +} +import { Color } from '../../math/Color.js'; +import PassNode from './PassNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/display/ViewportDepthNode.d.ts b/jsdoc-testing/jsdoc/nodes/display/ViewportDepthNode.d.ts new file mode 100644 index 000000000..6b0693f40 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/display/ViewportDepthNode.d.ts @@ -0,0 +1,105 @@ +export default ViewportDepthNode; +export function viewZToOrthographicDepth(viewZ: Node, near: Node, far: Node): Node; +export function viewZToReversedOrthographicDepth(viewZ: Node, near: Node, far: Node): Node; +/** + * TSL function for converting an orthographic depth value to a viewZ value. + * + * @tsl + * @function + * @param {Node} depth - The orthographic depth. + * @param {Node} near - The camera's near value. + * @param {Node} far - The camera's far value. + * @returns {Node} + */ +export const orthographicDepthToViewZ: () => void; +export function viewZToPerspectiveDepth(viewZ: Node, near: Node, far: Node): Node; +export function viewZToReversedPerspectiveDepth(viewZ: Node, near: Node, far: Node): Node; +/** + * TSL function for converting a perspective depth value to a viewZ value. + * + * @tsl + * @function + * @param {Node} depth - The perspective depth. + * @param {Node} near - The camera's near value. + * @param {Node} far - The camera's far value. + * @returns {Node} + */ +export const perspectiveDepthToViewZ: () => void; +export function viewZToLogarithmicDepth(viewZ: Node, near: Node, far: Node): Node; +export function logarithmicDepthToViewZ(depth: Node, near: Node, far: Node): Node; +/** + * TSL object that represents the depth value for the current fragment. + * + * @tsl + * @type {ViewportDepthNode} + */ +export const depth: ViewportDepthNode; +/** + * TSL function for converting a perspective depth value to linear depth. + * + * @tsl + * @function + * @param {?Node} [value=null] - The perspective depth. If `null` is provided, the current fragment's depth is used. + * @returns {ViewportDepthNode} + */ +export const linearDepth: any; +/** + * TSL object that represents the linear (orthographic) depth value of the current fragment + * + * @tsl + * @type {ViewportDepthNode} + */ +export const viewportLinearDepth: ViewportDepthNode; +/** + * This node offers a collection of features in context of the depth logic in the fragment shader. + * Depending on {@link ViewportDepthNode#scope}, it can be used to define a depth value for the current + * fragment or for depth evaluation purposes. + * + * @augments Node + */ +declare class ViewportDepthNode extends Node { + /** + * Constructs a new viewport depth node. + * + * @param {('depth'|'depthBase'|'linearDepth')} scope - The node's scope. + * @param {?Node} [valueNode=null] - The value node. + */ + constructor(scope: ("depth" | "depthBase" | "linearDepth"), valueNode?: Node | null); + /** + * The node behaves differently depending on which scope is selected. + * + * - `ViewportDepthNode.DEPTH_BASE`: Allows to define a value for the current fragment's depth. + * - `ViewportDepthNode.DEPTH`: Represents the depth value for the current fragment (`valueNode` is ignored). + * - `ViewportDepthNode.LINEAR_DEPTH`: Represents the linear (orthographic) depth value of the current fragment. + * If a `valueNode` is set, the scope can be used to convert perspective depth data to linear data. + * + * @type {('depth'|'depthBase'|'linearDepth')} + */ + scope: ("depth" | "depthBase" | "linearDepth"); + /** + * Can be used to define a custom depth value. + * The property is ignored in the `ViewportDepthNode.DEPTH` scope. + * + * @type {?Node} + * @default null + */ + valueNode: Node | null; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isViewportDepthNode: boolean; + generate(builder: any): any; + setup({ camera }: { + camera: any; + }): any; +} +declare namespace ViewportDepthNode { + let DEPTH_BASE: string; + let DEPTH: string; + let LINEAR_DEPTH: string; +} +import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/display/ViewportDepthTextureNode.d.ts b/jsdoc-testing/jsdoc/nodes/display/ViewportDepthTextureNode.d.ts new file mode 100644 index 000000000..c70252a7e --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/display/ViewportDepthTextureNode.d.ts @@ -0,0 +1,31 @@ +export default ViewportDepthTextureNode; +/** + * TSL function for a viewport depth texture node. + * + * @tsl + * @function + * @param {?Node} [uvNode=screenUV] - The uv node. + * @param {?Node} [levelNode=null] - The level node. + * @param {?DepthTexture} [depthTexture=null] - A depth texture. If not provided, a depth texture is created automatically. + * @returns {ViewportDepthTextureNode} + */ +export const viewportDepthTexture: any; +/** + * Represents the depth of the current viewport as a texture. This module + * can be used in combination with viewport texture to achieve effects + * that require depth evaluation. + * + * @augments ViewportTextureNode + */ +declare class ViewportDepthTextureNode extends ViewportTextureNode { + /** + * Constructs a new viewport depth texture node. + * + * @param {Node} [uvNode=screenUV] - The uv node. + * @param {?Node} [levelNode=null] - The level node. + * @param {?DepthTexture} [depthTexture=null] - A depth texture. If not provided, uses a shared depth texture. + */ + constructor(uvNode?: Node, levelNode?: Node | null, depthTexture?: DepthTexture | null); +} +import ViewportTextureNode from './ViewportTextureNode.js'; +import { DepthTexture } from '../../textures/DepthTexture.js'; diff --git a/jsdoc-testing/jsdoc/nodes/display/ViewportSharedTextureNode.d.ts b/jsdoc-testing/jsdoc/nodes/display/ViewportSharedTextureNode.d.ts new file mode 100644 index 000000000..46859c337 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/display/ViewportSharedTextureNode.d.ts @@ -0,0 +1,37 @@ +export default ViewportSharedTextureNode; +/** + * TSL function for creating a shared viewport texture node. + * + * @tsl + * @function + * @param {?Node} [uvNode=screenUV] - The uv node. + * @param {?Node} [levelNode=null] - The level node. + * @returns {ViewportSharedTextureNode} + */ +export const viewportSharedTexture: any; +/** + * `ViewportTextureNode` creates an internal texture for each node instance. This module + * shares a texture across all instances of `ViewportSharedTextureNode`. It should + * be the first choice when using data of the default/screen framebuffer for performance reasons. + * + * @augments ViewportTextureNode + */ +declare class ViewportSharedTextureNode extends ViewportTextureNode { + /** + * Constructs a new viewport shared texture node. + * + * @param {Node} [uvNode=screenUV] - The uv node. + * @param {?Node} [levelNode=null] - The level node. + */ + constructor(uvNode?: Node, levelNode?: Node | null); + /** + * Overwritten so the method always returns the unique shared + * framebuffer texture. + * + * @return {FramebufferTexture} The shared framebuffer texture. + */ + getTextureForReference(): FramebufferTexture; + updateReference(): this; +} +import ViewportTextureNode from './ViewportTextureNode.js'; +import { FramebufferTexture } from '../../textures/FramebufferTexture.js'; diff --git a/jsdoc-testing/jsdoc/nodes/display/ViewportTextureNode.d.ts b/jsdoc-testing/jsdoc/nodes/display/ViewportTextureNode.d.ts new file mode 100644 index 000000000..328a03fb0 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/display/ViewportTextureNode.d.ts @@ -0,0 +1,89 @@ +export default ViewportTextureNode; +/** + * TSL function for creating a viewport texture node. + * + * @tsl + * @function + * @param {?Node} [uvNode=screenUV] - The uv node. + * @param {?Node} [levelNode=null] - The level node. + * @param {?Texture} [framebufferTexture=null] - A framebuffer texture holding the viewport data. If not provided, a framebuffer texture is created automatically. + * @returns {ViewportTextureNode} + */ +export const viewportTexture: any; +/** + * TSL function for creating a viewport texture node with enabled mipmap generation. + * + * @tsl + * @function + * @param {?Node} [uvNode=screenUV] - The uv node. + * @param {?Node} [levelNode=null] - The level node. + * @param {?Texture} [framebufferTexture=null] - A framebuffer texture holding the viewport data. If not provided, a framebuffer texture is created automatically. + * @returns {ViewportTextureNode} + */ +export const viewportMipTexture: any; +export function viewportOpaqueMipTexture(uv?: Node | null, level?: Node | null): ViewportTextureNode; +/** + * A special type of texture node which represents the data of the current viewport + * as a texture. The module extracts data from the current bound framebuffer with + * a copy operation so no extra render pass is required to produce the texture data + * (which is good for performance). `ViewportTextureNode` can be used as an input for a + * variety of effects like refractive or transmissive materials. + * + * @augments TextureNode + */ +declare class ViewportTextureNode extends TextureNode { + /** + * Constructs a new viewport texture node. + * + * @param {Node} [uvNode=screenUV] - The uv node. + * @param {?Node} [levelNode=null] - The level node. + * @param {?Texture} [framebufferTexture=null] - A framebuffer texture holding the viewport data. If not provided, a framebuffer texture is created automatically. + */ + constructor(uvNode?: Node, levelNode?: Node | null, framebufferTexture?: Texture | null); + /** + * Whether to generate mipmaps or not. + * + * @type {boolean} + * @default false + */ + generateMipmaps: boolean; + /** + * The reference framebuffer texture. This is used to store the framebuffer texture + * for the current render target. If the render target changes, a new framebuffer texture + * is created automatically. + * + * @type {FramebufferTexture} + * @default null + */ + defaultFramebuffer: FramebufferTexture; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isOutputTextureNode: boolean; + /** + * The framebuffer texture for the current renderer context. + * + * @type {WeakMap} + * @private + */ + private _cacheTextures; + /** + * This methods returns a texture for the given render target or canvas target reference. + * + * To avoid rendering errors, `ViewportTextureNode` must use unique framebuffer textures + * for different render contexts. + * + * @param {?(RenderTarget|CanvasTarget)} [reference=null] - The render target or canvas target reference. + * @return {Texture} The framebuffer texture. + */ + getTextureForReference(reference?: (RenderTarget | CanvasTarget) | null): Texture; + updateReference(frame: any): import("../../textures/Texture.js").Texture; + updateBefore(frame: any): void; + clone(): any; +} +import TextureNode from '../accessors/TextureNode.js'; +import { FramebufferTexture } from '../../textures/FramebufferTexture.js'; diff --git a/jsdoc-testing/jsdoc/nodes/fog/Fog.d.ts b/jsdoc-testing/jsdoc/nodes/fog/Fog.d.ts new file mode 100644 index 000000000..34f7636b6 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/fog/Fog.d.ts @@ -0,0 +1,38 @@ +/** + * Constructs a new range factor node. + * + * @tsl + * @function + * @param {Node} near - Defines the near value. + * @param {Node} far - Defines the far value. + */ +export const rangeFogFactor: () => void; +/** + * Represents an exponential squared fog. This type of fog gives + * a clear view near the camera and a faster than exponentially + * densening fog farther from the camera. + * + * @tsl + * @function + * @param {Node} density - Defines the fog density. + */ +export const densityFogFactor: () => void; +/** + * Constructs a new height fog factor node. This fog factor requires a Y-up coordinate system. + * + * @tsl + * @function + * @param {Node} density - Defines the fog density. + * @param {Node} height - The height threshold in world space. Everything below this y-coordinate is affected by fog. + */ +export const exponentialHeightFogFactor: () => void; +/** + * This class can be used to configure a fog for the scene. + * Nodes of this type are assigned to `Scene.fogNode`. + * + * @tsl + * @function + * @param {Node} color - Defines the color of the fog. + * @param {Node} factor - Defines how the fog is factored in the scene. + */ +export const fog: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/functions/BSDF/BRDF_GGX.d.ts b/jsdoc-testing/jsdoc/nodes/functions/BSDF/BRDF_GGX.d.ts new file mode 100644 index 000000000..c47f5559a --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/functions/BSDF/BRDF_GGX.d.ts @@ -0,0 +1,2 @@ +export default BRDF_GGX; +declare const BRDF_GGX: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/functions/BSDF/BRDF_GGX_Multiscatter.d.ts b/jsdoc-testing/jsdoc/nodes/functions/BSDF/BRDF_GGX_Multiscatter.d.ts new file mode 100644 index 000000000..7da6ffd76 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/functions/BSDF/BRDF_GGX_Multiscatter.d.ts @@ -0,0 +1,2 @@ +export default BRDF_GGX_Multiscatter; +declare const BRDF_GGX_Multiscatter: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/functions/BSDF/BRDF_Lambert.d.ts b/jsdoc-testing/jsdoc/nodes/functions/BSDF/BRDF_Lambert.d.ts new file mode 100644 index 000000000..71b76485d --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/functions/BSDF/BRDF_Lambert.d.ts @@ -0,0 +1,2 @@ +export default BRDF_Lambert; +declare const BRDF_Lambert: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/functions/BSDF/BRDF_Sheen.d.ts b/jsdoc-testing/jsdoc/nodes/functions/BSDF/BRDF_Sheen.d.ts new file mode 100644 index 000000000..eb31b60ad --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/functions/BSDF/BRDF_Sheen.d.ts @@ -0,0 +1,2 @@ +export default BRDF_Sheen; +declare const BRDF_Sheen: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/functions/BSDF/DFGLUT.d.ts b/jsdoc-testing/jsdoc/nodes/functions/BSDF/DFGLUT.d.ts new file mode 100644 index 000000000..5a20667ef --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/functions/BSDF/DFGLUT.d.ts @@ -0,0 +1,2 @@ +export default DFGLUT; +declare const DFGLUT: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/functions/BSDF/D_GGX.d.ts b/jsdoc-testing/jsdoc/nodes/functions/BSDF/D_GGX.d.ts new file mode 100644 index 000000000..ee1081261 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/functions/BSDF/D_GGX.d.ts @@ -0,0 +1,2 @@ +export default D_GGX; +declare const D_GGX: any; diff --git a/jsdoc-testing/jsdoc/nodes/functions/BSDF/D_GGX_Anisotropic.d.ts b/jsdoc-testing/jsdoc/nodes/functions/BSDF/D_GGX_Anisotropic.d.ts new file mode 100644 index 000000000..788dd6c3b --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/functions/BSDF/D_GGX_Anisotropic.d.ts @@ -0,0 +1,2 @@ +export default D_GGX_Anisotropic; +declare const D_GGX_Anisotropic: any; diff --git a/jsdoc-testing/jsdoc/nodes/functions/BSDF/EnvironmentBRDF.d.ts b/jsdoc-testing/jsdoc/nodes/functions/BSDF/EnvironmentBRDF.d.ts new file mode 100644 index 000000000..ebc316a79 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/functions/BSDF/EnvironmentBRDF.d.ts @@ -0,0 +1,2 @@ +export default EnvironmentBRDF; +declare const EnvironmentBRDF: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/functions/BSDF/F_Schlick.d.ts b/jsdoc-testing/jsdoc/nodes/functions/BSDF/F_Schlick.d.ts new file mode 100644 index 000000000..a1d2caea7 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/functions/BSDF/F_Schlick.d.ts @@ -0,0 +1,2 @@ +export default F_Schlick; +declare const F_Schlick: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/functions/BSDF/LTC.d.ts b/jsdoc-testing/jsdoc/nodes/functions/BSDF/LTC.d.ts new file mode 100644 index 000000000..3f41af9a6 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/functions/BSDF/LTC.d.ts @@ -0,0 +1,3 @@ +export const LTC_Evaluate: any; +export const LTC_Evaluate_Volume: any; +export const LTC_Uv: any; diff --git a/jsdoc-testing/jsdoc/nodes/functions/BSDF/Schlick_to_F0.d.ts b/jsdoc-testing/jsdoc/nodes/functions/BSDF/Schlick_to_F0.d.ts new file mode 100644 index 000000000..316542c93 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/functions/BSDF/Schlick_to_F0.d.ts @@ -0,0 +1,2 @@ +export default Schlick_to_F0; +declare const Schlick_to_F0: any; diff --git a/jsdoc-testing/jsdoc/nodes/functions/BSDF/V_GGX_SmithCorrelated.d.ts b/jsdoc-testing/jsdoc/nodes/functions/BSDF/V_GGX_SmithCorrelated.d.ts new file mode 100644 index 000000000..aeaeb6109 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/functions/BSDF/V_GGX_SmithCorrelated.d.ts @@ -0,0 +1,2 @@ +export default V_GGX_SmithCorrelated; +declare const V_GGX_SmithCorrelated: any; diff --git a/jsdoc-testing/jsdoc/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.d.ts b/jsdoc-testing/jsdoc/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.d.ts new file mode 100644 index 000000000..7c2c87243 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.d.ts @@ -0,0 +1,2 @@ +export default V_GGX_SmithCorrelated_Anisotropic; +declare const V_GGX_SmithCorrelated_Anisotropic: any; diff --git a/jsdoc-testing/jsdoc/nodes/functions/BasicLightingModel.d.ts b/jsdoc-testing/jsdoc/nodes/functions/BasicLightingModel.d.ts new file mode 100644 index 000000000..3db9024d7 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/functions/BasicLightingModel.d.ts @@ -0,0 +1,23 @@ +export default BasicLightingModel; +/** + * Represents the lighting model for unlit materials. The only light contribution + * is baked indirect lighting modulated with ambient occlusion and the material's + * diffuse color. Environment mapping is supported. Used in {@link MeshBasicNodeMaterial}. + * + * @augments LightingModel + */ +declare class BasicLightingModel extends LightingModel { + /** + * Implements the baked indirect lighting with its modulation. + * + * @param {NodeBuilder} builder - The current node builder. + */ + indirect({ context }: NodeBuilder): void; + /** + * Implements the environment mapping. + * + * @param {NodeBuilder} builder - The current node builder. + */ + finish(builder: NodeBuilder): void; +} +import LightingModel from '../core/LightingModel.js'; diff --git a/jsdoc-testing/jsdoc/nodes/functions/PhongLightingModel.d.ts b/jsdoc-testing/jsdoc/nodes/functions/PhongLightingModel.d.ts new file mode 100644 index 000000000..8d016e0a0 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/functions/PhongLightingModel.d.ts @@ -0,0 +1,31 @@ +export default PhongLightingModel; +/** + * Represents the lighting model for a phong material. Used in {@link MeshPhongNodeMaterial}. + * + * @augments BasicLightingModel + */ +declare class PhongLightingModel extends BasicLightingModel { + /** + * Constructs a new phong lighting model. + * + * @param {boolean} [specular=true] - Whether specular is supported or not. + */ + constructor(specular?: boolean); + /** + * Whether specular is supported or not. Set this to `false` if you are + * looking for a Lambert-like material meaning a material for non-shiny + * surfaces, without specular highlights. + * + * @type {boolean} + * @default true + */ + specular: boolean; + /** + * Implements the direct lighting. The specular portion is optional an can be controlled + * with the {@link PhongLightingModel#specular} flag. + * + * @param {Object} lightData - The light data. + */ + direct({ lightDirection, lightColor, reflectedLight }: Object): void; +} +import BasicLightingModel from './BasicLightingModel.js'; diff --git a/jsdoc-testing/jsdoc/nodes/functions/PhysicalLightingModel.d.ts b/jsdoc-testing/jsdoc/nodes/functions/PhysicalLightingModel.d.ts new file mode 100644 index 000000000..3b3294a26 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/functions/PhysicalLightingModel.d.ts @@ -0,0 +1,171 @@ +export default PhysicalLightingModel; +/** + * Represents the lighting model for a PBR material. + * + * @augments LightingModel + */ +declare class PhysicalLightingModel extends LightingModel { + /** + * Constructs a new physical lighting model. + * + * @param {boolean} [clearcoat=false] - Whether clearcoat is supported or not. + * @param {boolean} [sheen=false] - Whether sheen is supported or not. + * @param {boolean} [iridescence=false] - Whether iridescence is supported or not. + * @param {boolean} [anisotropy=false] - Whether anisotropy is supported or not. + * @param {boolean} [transmission=false] - Whether transmission is supported or not. + * @param {boolean} [dispersion=false] - Whether dispersion is supported or not. + */ + constructor(clearcoat?: boolean, sheen?: boolean, iridescence?: boolean, anisotropy?: boolean, transmission?: boolean, dispersion?: boolean); + /** + * Whether clearcoat is supported or not. + * + * @type {boolean} + * @default false + */ + clearcoat: boolean; + /** + * Whether sheen is supported or not. + * + * @type {boolean} + * @default false + */ + sheen: boolean; + /** + * Whether iridescence is supported or not. + * + * @type {boolean} + * @default false + */ + iridescence: boolean; + /** + * Whether anisotropy is supported or not. + * + * @type {boolean} + * @default false + */ + anisotropy: boolean; + /** + * Whether transmission is supported or not. + * + * @type {boolean} + * @default false + */ + transmission: boolean; + /** + * Whether dispersion is supported or not. + * + * @type {boolean} + * @default false + */ + dispersion: boolean; + /** + * The clear coat radiance. + * + * @type {?Node} + * @default null + */ + clearcoatRadiance: Node | null; + /** + * The clear coat specular direct. + * + * @type {?Node} + * @default null + */ + clearcoatSpecularDirect: Node | null; + /** + * The clear coat specular indirect. + * + * @type {?Node} + * @default null + */ + clearcoatSpecularIndirect: Node | null; + /** + * The sheen specular direct. + * + * @type {?Node} + * @default null + */ + sheenSpecularDirect: Node | null; + /** + * The sheen specular indirect. + * + * @type {?Node} + * @default null + */ + sheenSpecularIndirect: Node | null; + /** + * The iridescence Fresnel. + * + * @type {?Node} + * @default null + */ + iridescenceFresnel: Node | null; + /** + * The iridescence F0. + * + * @type {?Node} + * @default null + */ + iridescenceF0: Node | null; + /** + * The iridescence F0 dielectric. + * + * @type {?Node} + * @default null + */ + iridescenceF0Dielectric: Node | null; + /** + * The iridescence F0 metallic. + * + * @type {?Node} + * @default null + */ + iridescenceF0Metallic: Node | null; + computeMultiscattering(singleScatter: any, multiScatter: any, specularF90: any, f0: any, iridescenceF0?: null): void; + /** + * Implements the direct light. + * + * @param {Object} lightData - The light data. + * @param {NodeBuilder} builder - The current node builder. + */ + direct({ lightDirection, lightColor, reflectedLight }: Object): void; + /** + * This method is intended for implementing the direct light term for + * rect area light nodes. + * + * @param {Object} input - The input data. + * @param {NodeBuilder} builder - The current node builder. + */ + directRectArea({ lightColor, lightPosition, halfWidth, halfHeight, reflectedLight, ltc_1, ltc_2 }: Object): void; + /** + * Implements the indirect lighting. + * + * @param {NodeBuilder} builder - The current node builder. + */ + indirect(builder: NodeBuilder): void; + /** + * Implements the indirect diffuse term. + * + * @param {NodeBuilder} builder - The current node builder. + */ + indirectDiffuse(builder: NodeBuilder): void; + /** + * Implements the indirect specular term. + * + * @param {NodeBuilder} builder - The current node builder. + */ + indirectSpecular(builder: NodeBuilder): void; + /** + * Implements the ambient occlusion term. + * + * @param {NodeBuilder} builder - The current node builder. + */ + ambientOcclusion(builder: NodeBuilder): void; + /** + * Used for final lighting accumulations depending on the requested features. + * + * @param {NodeBuilder} builder - The current node builder. + */ + finish({ context }: NodeBuilder): void; +} +import LightingModel from '../core/LightingModel.js'; diff --git a/jsdoc-testing/jsdoc/nodes/functions/ShadowMaskModel.d.ts b/jsdoc-testing/jsdoc/nodes/functions/ShadowMaskModel.d.ts new file mode 100644 index 000000000..84e3d6ecf --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/functions/ShadowMaskModel.d.ts @@ -0,0 +1,27 @@ +export default ShadowMaskModel; +/** + * Represents lighting model for a shadow material. Used in {@link ShadowNodeMaterial}. + * + * @augments LightingModel + */ +declare class ShadowMaskModel extends LightingModel { + /** + * The shadow mask node. + * + * @type {Node} + */ + shadowNode: Node; + /** + * Only used to save the shadow mask. + * + * @param {Object} input - The input data. + */ + direct({ lightNode }: Object): void; + /** + * Uses the shadow mask to produce the final color. + * + * @param {NodeBuilder} builder - The current node builder. + */ + finish({ context }: NodeBuilder): void; +} +import LightingModel from '../core/LightingModel.js'; diff --git a/jsdoc-testing/jsdoc/nodes/functions/ToonLightingModel.d.ts b/jsdoc-testing/jsdoc/nodes/functions/ToonLightingModel.d.ts new file mode 100644 index 000000000..420e9ee87 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/functions/ToonLightingModel.d.ts @@ -0,0 +1,23 @@ +export default ToonLightingModel; +/** + * Represents the lighting model for a toon material. Used in {@link MeshToonNodeMaterial}. + * + * @augments LightingModel + */ +declare class ToonLightingModel extends LightingModel { + /** + * Implements the direct lighting. Instead of using a conventional smooth irradiance, the irradiance is + * reduced to a small number of discrete shades to create a comic-like, flat look. + * + * @param {Object} lightData - The light data. + * @param {NodeBuilder} builder - The current node builder. + */ + direct({ lightDirection, lightColor, reflectedLight }: Object, builder: NodeBuilder): void; + /** + * Implements the indirect lighting. + * + * @param {NodeBuilder} builder - The current node builder. + */ + indirect(builder: NodeBuilder): void; +} +import LightingModel from '../core/LightingModel.js'; diff --git a/jsdoc-testing/jsdoc/nodes/functions/VolumetricLightingModel.d.ts b/jsdoc-testing/jsdoc/nodes/functions/VolumetricLightingModel.d.ts new file mode 100644 index 000000000..1cf33cba5 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/functions/VolumetricLightingModel.d.ts @@ -0,0 +1,25 @@ +export default VolumetricLightingModel; +/** + * VolumetricLightingModel class extends the LightingModel to implement volumetric lighting effects. + * This model calculates the scattering and transmittance of light through a volumetric medium. + * It dynamically adjusts the direction of the ray based on the camera and object positions. + * The model supports custom scattering and depth nodes to enhance the lighting effects. + * + * @augments LightingModel + */ +declare class VolumetricLightingModel extends LightingModel { + start(builder: any): void; + scatteringLight(lightColor: any, builder: any): void; + direct({ lightNode, lightColor }: { + lightNode: any; + lightColor: any; + }, builder: any): void; + directRectArea({ lightColor, lightPosition, halfWidth, halfHeight }: { + lightColor: any; + lightPosition: any; + halfWidth: any; + halfHeight: any; + }, builder: any): void; + finish(builder: any): void; +} +import LightingModel from '../core/LightingModel.js'; diff --git a/jsdoc-testing/jsdoc/nodes/functions/material/getAlphaHashThreshold.d.ts b/jsdoc-testing/jsdoc/nodes/functions/material/getAlphaHashThreshold.d.ts new file mode 100644 index 000000000..30b15c98e --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/functions/material/getAlphaHashThreshold.d.ts @@ -0,0 +1,2 @@ +export default getAlphaHashThreshold; +declare const getAlphaHashThreshold: any; diff --git a/jsdoc-testing/jsdoc/nodes/functions/material/getGeometryRoughness.d.ts b/jsdoc-testing/jsdoc/nodes/functions/material/getGeometryRoughness.d.ts new file mode 100644 index 000000000..30ea57be5 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/functions/material/getGeometryRoughness.d.ts @@ -0,0 +1,2 @@ +export default getGeometryRoughness; +declare const getGeometryRoughness: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/functions/material/getParallaxCorrectNormal.d.ts b/jsdoc-testing/jsdoc/nodes/functions/material/getParallaxCorrectNormal.d.ts new file mode 100644 index 000000000..4c4a103a4 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/functions/material/getParallaxCorrectNormal.d.ts @@ -0,0 +1,19 @@ +export default getParallaxCorrectNormal; +/** + * This computes a parallax corrected normal which is used for box-projected cube mapping (BPCEM). + * + * Reference: {@link https://devlog-martinsh.blogspot.com/2011/09/box-projected-cube-environment-mapping.html} + * + * ```js + * const uvNode = getParallaxCorrectNormal( reflectVector, vec3( 200, 100, 100 ), vec3( 0, - 50, 0 ) ); + * material.envNode = pmremTexture( renderTarget.texture, uvNode ); + * ``` + * + * @tsl + * @function + * @param {Node} normal - The normal to correct. + * @param {Node} cubeSize - The cube size should reflect the size of the environment (BPCEM is usually applied in closed environments like rooms). + * @param {Node} cubePos - The cube position. + * @return {Node} The parallax corrected normal. + */ +declare const getParallaxCorrectNormal: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/functions/material/getRoughness.d.ts b/jsdoc-testing/jsdoc/nodes/functions/material/getRoughness.d.ts new file mode 100644 index 000000000..18eff5982 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/functions/material/getRoughness.d.ts @@ -0,0 +1,2 @@ +export default getRoughness; +declare const getRoughness: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/functions/material/getShIrradianceAt.d.ts b/jsdoc-testing/jsdoc/nodes/functions/material/getShIrradianceAt.d.ts new file mode 100644 index 000000000..627b15982 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/functions/material/getShIrradianceAt.d.ts @@ -0,0 +1,2 @@ +export default getShIrradianceAt; +declare const getShIrradianceAt: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/geometry/RangeNode.d.ts b/jsdoc-testing/jsdoc/nodes/geometry/RangeNode.d.ts new file mode 100644 index 000000000..3630a9978 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/geometry/RangeNode.d.ts @@ -0,0 +1,68 @@ +export default RangeNode; +/** + * TSL function for creating a range node. + * + * @tsl + * @function + * @param {Node} [minNode=float()] - A node defining the lower bound of the range. + * @param {Node} [maxNode=float()] - A node defining the upper bound of the range. + * @returns {RangeNode} + */ +export const range: any; +/** + * `RangeNode` generates random instanced attribute data in a defined range. + * An exemplary use case for this utility node is to generate random per-instance + * colors: + * ```js + * const material = new MeshBasicNodeMaterial(); + * material.colorNode = range( new Color( 0x000000 ), new Color( 0xFFFFFF ) ); + * const mesh = new InstancedMesh( geometry, material, count ); + * ``` + * @augments Node + */ +declare class RangeNode extends Node { + /** + * Constructs a new range node. + * + * @param {Node} [minNode=float()] - A node defining the lower bound of the range. + * @param {Node} [maxNode=float()] - A node defining the upper bound of the range. + */ + constructor(minNode?: Node, maxNode?: Node); + /** + * A node defining the lower bound of the range. + * + * @type {Node} + * @default float() + */ + minNode: Node; + /** + * A node defining the upper bound of the range. + * + * @type {Node} + * @default float() + */ + maxNode: Node; + /** + * Returns the vector length which is computed based on the range definition. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {number} The vector length. + */ + getVectorLength(builder: NodeBuilder): number; + /** + * This method is overwritten since the node type is inferred from range definition. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The node type. + */ + generateNodeType(builder: NodeBuilder): string; + /** + * Returns a constant node from the given node by traversing it. + * + * @param {Node} node - The node to traverse. + * @returns {Node} The constant node, if found. + */ + getConstNode(node: Node): Node; + setup(builder: any): any; +} +import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/gpgpu/AtomicFunctionNode.d.ts b/jsdoc-testing/jsdoc/nodes/gpgpu/AtomicFunctionNode.d.ts new file mode 100644 index 000000000..956f26c33 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/gpgpu/AtomicFunctionNode.d.ts @@ -0,0 +1,78 @@ +export default AtomicFunctionNode; +export function atomicFunc(method: string, pointerNode: Node, valueNode: Node): AtomicFunctionNode; +export function atomicLoad(pointerNode: Node): AtomicFunctionNode; +export function atomicStore(pointerNode: Node, valueNode: Node): AtomicFunctionNode; +export function atomicAdd(pointerNode: Node, valueNode: Node): AtomicFunctionNode; +export function atomicSub(pointerNode: Node, valueNode: Node): AtomicFunctionNode; +export function atomicMax(pointerNode: Node, valueNode: Node): AtomicFunctionNode; +export function atomicMin(pointerNode: Node, valueNode: Node): AtomicFunctionNode; +export function atomicAnd(pointerNode: Node, valueNode: Node): AtomicFunctionNode; +export function atomicOr(pointerNode: Node, valueNode: Node): AtomicFunctionNode; +export function atomicXor(pointerNode: Node, valueNode: Node): AtomicFunctionNode; +/** + * `AtomicFunctionNode` represents any function that can operate on atomic variable types + * within a shader. In an atomic function, any modification to an atomic variable will + * occur as an indivisible step with a defined order relative to other modifications. + * Accordingly, even if multiple atomic functions are modifying an atomic variable at once + * atomic operations will not interfere with each other. + * + * This node can only be used with a WebGPU backend. + * + * @augments Node + */ +declare class AtomicFunctionNode extends Node { + /** + * Constructs a new atomic function node. + * + * @param {string} method - The signature of the atomic function to construct. + * @param {Node} pointerNode - An atomic variable or element of an atomic buffer. + * @param {Node} valueNode - The value that mutates the atomic variable. + */ + constructor(method: string, pointerNode: Node, valueNode: Node); + /** + * The signature of the atomic function to construct. + * + * @type {string} + */ + method: string; + /** + * An atomic variable or element of an atomic buffer. + * + * @type {Node} + */ + pointerNode: Node; + /** + * A value that modifies the atomic variable. + * + * @type {Node} + */ + valueNode: Node; + /** + * Overwrites the default implementation to return the type of + * the pointer node. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The input type. + */ + getInputType(builder: NodeBuilder): string; + /** + * Overwritten since the node type is inferred from the input type. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The node type. + */ + generateNodeType(builder: NodeBuilder): string; + generate(builder: any): any; +} +declare namespace AtomicFunctionNode { + let ATOMIC_LOAD: string; + let ATOMIC_STORE: string; + let ATOMIC_ADD: string; + let ATOMIC_SUB: string; + let ATOMIC_MAX: string; + let ATOMIC_MIN: string; + let ATOMIC_AND: string; + let ATOMIC_OR: string; + let ATOMIC_XOR: string; +} +import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/gpgpu/BarrierNode.d.ts b/jsdoc-testing/jsdoc/nodes/gpgpu/BarrierNode.d.ts new file mode 100644 index 000000000..2f799556f --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/gpgpu/BarrierNode.d.ts @@ -0,0 +1,23 @@ +export default BarrierNode; +export function workgroupBarrier(): BarrierNode; +export function storageBarrier(): BarrierNode; +export function textureBarrier(): BarrierNode; +/** + * Represents a GPU control barrier that synchronizes compute operations within a given scope. + * + * This node can only be used with a WebGPU backend. + * + * @augments Node + */ +declare class BarrierNode extends Node { + /** + * Constructs a new barrier node. + * + * @param {string} scope - The scope defines the behavior of the node. + */ + constructor(scope: string); + scope: string; + isBarrierNode: boolean; + generate(builder: any): void; +} +import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/gpgpu/ComputeBuiltinNode.d.ts b/jsdoc-testing/jsdoc/nodes/gpgpu/ComputeBuiltinNode.d.ts new file mode 100644 index 000000000..d5dbfe59e --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/gpgpu/ComputeBuiltinNode.d.ts @@ -0,0 +1,135 @@ +export default ComputeBuiltinNode; +/** + * Represents the number of workgroups dispatched by the compute shader. + * ```js + * // Run 512 invocations/threads with a workgroup size of 128. + * const computeFn = Fn(() => { + * + * // numWorkgroups.x = 4 + * storageBuffer.element(0).assign(numWorkgroups.x) + * + * })().compute(512, [128]); + * + * // Run 512 invocations/threads with the default workgroup size of 64. + * const computeFn = Fn(() => { + * + * // numWorkgroups.x = 8 + * storageBuffer.element(0).assign(numWorkgroups.x) + * + * })().compute(512); + * ``` + * + * @tsl + * @type {ComputeBuiltinNode} + */ +export const numWorkgroups: ComputeBuiltinNode; +/** + * Represents the 3-dimensional index of the workgroup the current compute invocation belongs to. + * ```js + * // Execute 12 compute threads with a workgroup size of 3. + * const computeFn = Fn( () => { + * + * If( workgroupId.x.mod( 2 ).equal( 0 ), () => { + * + * storageBuffer.element( instanceIndex ).assign( instanceIndex ); + * + * } ).Else( () => { + * + * storageBuffer.element( instanceIndex ).assign( 0 ); + * + * } ); + * + * } )().compute( 12, [ 3 ] ); + * + * // workgroupId.x = [0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3]; + * // Buffer Output = [0, 1, 2, 0, 0, 0, 6, 7, 8, 0, 0, 0]; + * ``` + * + * @tsl + * @type {ComputeBuiltinNode} + */ +export const workgroupId: ComputeBuiltinNode; +/** + * A non-linearized 3-dimensional representation of the current invocation's position within a 3D global grid. + * + * @tsl + * @type {ComputeBuiltinNode} + */ +export const globalId: ComputeBuiltinNode; +/** + * A non-linearized 3-dimensional representation of the current invocation's position within a 3D workgroup grid. + * + * @tsl + * @type {ComputeBuiltinNode} + */ +export const localId: ComputeBuiltinNode; +/** + * A device dependent variable that exposes the size of the current invocation's subgroup. + * + * @tsl + * @type {ComputeBuiltinNode} + */ +export const subgroupSize: ComputeBuiltinNode; +/** + * `ComputeBuiltinNode` represents a compute-scope builtin value that expose information + * about the currently running dispatch and/or the device it is running on. + * + * This node can only be used with a WebGPU backend. + * + * @augments Node + */ +declare class ComputeBuiltinNode extends Node { + /** + * Constructs a new compute builtin node. + * + * @param {string} builtinName - The built-in name. + * @param {string} nodeType - The node type. + */ + constructor(builtinName: string, nodeType: string); + /** + * The built-in name. + * + * @private + * @type {string} + */ + private _builtinName; + /** + * This method is overwritten since hash is derived from the built-in name. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The hash. + */ + getHash(builder: NodeBuilder): string; + /** + * This method is overwritten since the node type is simply derived from `nodeType`.. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The node type. + */ + generateNodeType(): string; + /** + * Sets the builtin name. + * + * @param {string} builtinName - The built-in name. + * @return {ComputeBuiltinNode} A reference to this node. + */ + setBuiltinName(builtinName: string): ComputeBuiltinNode; + /** + * Returns the builtin name. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The builtin name. + */ + getBuiltinName(): string; + /** + * Whether the current node builder has the builtin or not. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {boolean} Whether the builder has the builtin or not. + */ + hasBuiltin(builder: NodeBuilder): boolean; + generate(builder: any, output: any): any; + serialize(data: any): void; + deserialize(data: any): void; +} +import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/gpgpu/ComputeNode.d.ts b/jsdoc-testing/jsdoc/nodes/gpgpu/ComputeNode.d.ts new file mode 100644 index 000000000..66213c478 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/gpgpu/ComputeNode.d.ts @@ -0,0 +1,96 @@ +export default ComputeNode; +export function computeKernel(node: Node, workgroupSize?: Array): ComputeNode; +export function compute(node: Node, count: number | Array, workgroupSize?: Array): ComputeNode; +/** + * Represents a compute shader node. + * + * @augments Node + */ +declare class ComputeNode extends Node { + /** + * Constructs a new compute node. + * + * @param {Node} computeNode - The node that defines the compute shader logic. + * @param {Array} workgroupSize - An array defining the X, Y, and Z dimensions of the workgroup for compute shader execution. + */ + constructor(computeNode: Node, workgroupSize: Array); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isComputeNode: boolean; + /** + * The node that defines the compute shader logic. + * + * @type {Node} + */ + computeNode: Node; + /** + * An array defining the X, Y, and Z dimensions of the workgroup for compute shader execution. + * + * @type {Array} + * @default [ 64 ] + */ + workgroupSize: Array; + /** + * The total number of threads (invocations) to execute. If it is a number, it will be used + * to automatically generate bounds checking against `instanceIndex`. + * + * @type {number|Array} + */ + count: number | Array; + /** + * The dispatch size for workgroups on X, Y, and Z axes. + * Used directly if `count` is not provided. + * + * @type {number|Array} + */ + dispatchSize: number | Array; + /** + * A callback executed when the compute node finishes initialization. + * + * @type {?Function} + */ + onInitFunction: Function | null; + /** + * A uniform node holding the dispatch count for bounds checking. + * Created automatically when `count` is a number. + * + * @type {?UniformNode} + */ + countNode: UniformNode | null; + /** + * Sets the {@link ComputeNode#name} property. + * + * @param {string} name - The name of the uniform. + * @return {ComputeNode} A reference to this node. + */ + setName(name: string): ComputeNode; + /** + * Sets the {@link ComputeNode#name} property. + * + * @deprecated + * @param {string} name - The name of the uniform. + * @return {ComputeNode} A reference to this node. + */ + label(name: string): ComputeNode; + /** + * Sets the callback to run during initialization. + * + * @param {Function} callback - The callback function. + * @return {ComputeNode} A reference to this node. + */ + onInit(callback: Function): ComputeNode; + /** + * The method execute the compute for this node. + * + * @param {NodeFrame} frame - A reference to the current node frame. + */ + updateBefore({ renderer }: NodeFrame): void; + setup(builder: any): string | Node | null; + generate(builder: any, output: any): any; +} +import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/gpgpu/SubgroupFunctionNode.d.ts b/jsdoc-testing/jsdoc/nodes/gpgpu/SubgroupFunctionNode.d.ts new file mode 100644 index 000000000..19c603f9b --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/gpgpu/SubgroupFunctionNode.d.ts @@ -0,0 +1,303 @@ +export default SubgroupFunctionNode; +/** + * Returns true if this invocation has the lowest subgroup_invocation_id + * among active invocations in the subgroup. + * + * @tsl + * @method + * @return {bool} The result of the computation. + */ +export const subgroupElect: any; +/** + * Returns a set of bitfields where the bit corresponding to subgroup_invocation_id + * is 1 if pred is true for that active invocation and 0 otherwise. + * + * @tsl + * @method + * @param {bool} pred - A boolean that sets the bit corresponding to the invocations subgroup invocation id. + * @return {vec4}- A bitfield corresponding to the pred value of each subgroup invocation. + */ +export const subgroupBallot: any; +/** + * A reduction that adds e among all active invocations and returns that result. + * + * @tsl + * @method + * @param {number} e - The value provided to the reduction by the current invocation. + * @return {number} The accumulated result of the reduction operation. + */ +export const subgroupAdd: any; +/** + * An inclusive scan returning the sum of e for all active invocations with subgroup_invocation_id less than or equal to this invocation. + * + * @tsl + * @method + * @param {number} e - The value provided to the inclusive scan by the current invocation. + * @return {number} The accumulated result of the inclusive scan operation. + */ +export const subgroupInclusiveAdd: any; +/** + * An exclusive scan that returns the sum of e for all active invocations with subgroup_invocation_id less than this invocation. + * + * @tsl + * @method + * @param {number} e - The value provided to the exclusive scan by the current invocation. + * @return {number} The accumulated result of the exclusive scan operation. + */ +export const subgroupExclusiveAdd: any; +/** + * A reduction that multiplies e among all active invocations and returns that result. + * + * @tsl + * @method + * @param {number} e - The value provided to the reduction by the current invocation. + * @return {number} The accumulated result of the reduction operation. + */ +export const subgroupMul: any; +/** + * An inclusive scan returning the product of e for all active invocations with subgroup_invocation_id less than or equal to this invocation. + * + * @tsl + * @method + * @param {number} e - The value provided to the inclusive scan by the current invocation. + * @return {number} The accumulated result of the inclusive scan operation. + */ +export const subgroupInclusiveMul: any; +/** + * An exclusive scan that returns the product of e for all active invocations with subgroup_invocation_id less than this invocation. + * + * @tsl + * @method + * @param {number} e - The value provided to the exclusive scan by the current invocation. + * @return {number} The accumulated result of the exclusive scan operation. + */ +export const subgroupExclusiveMul: any; +/** + * A reduction that performs a bitwise and of e among all active invocations and returns that result. + * + * @tsl + * @method + * @param {number} e - The value provided to the reduction by the current invocation. + * @return {number} The result of the reduction operation. + */ +export const subgroupAnd: any; +/** + * A reduction that performs a bitwise or of e among all active invocations and returns that result. + * + * @tsl + * @method + * @param {number} e - The value provided to the reduction by the current invocation. + * @return {number} The result of the reduction operation. + */ +export const subgroupOr: any; +/** + * A reduction that performs a bitwise xor of e among all active invocations and returns that result. + * + * @tsl + * @method + * @param {number} e - The value provided to the reduction by the current invocation. + * @return {number} The result of the reduction operation. + */ +export const subgroupXor: any; +/** + * A reduction that performs a min of e among all active invocations and returns that result. + * + * @tsl + * @method + * @param {number} e - The value provided to the reduction by the current invocation. + * @return {number} The result of the reduction operation. + */ +export const subgroupMin: any; +/** + * A reduction that performs a max of e among all active invocations and returns that result. + * + * @tsl + * @method + * @param {number} e - The value provided to the reduction by the current invocation. + * @return {number} The result of the reduction operation. + */ +export const subgroupMax: any; +/** + * Returns true if e is true for all active invocations in the subgroup. + * + * @tsl + * @method + * @return {bool} The result of the computation. + */ +export const subgroupAll: any; +/** + * Returns true if e is true for any active invocation in the subgroup + * + * @tsl + * @method + * @return {bool} The result of the computation. + */ +export const subgroupAny: any; +/** + * Broadcasts e from the active invocation with the lowest subgroup_invocation_id in the subgroup to all other active invocations. + * + * @tsl + * @method + * @param {number} e - The value to broadcast from the lowest subgroup invocation. + * @param {number} id - The subgroup invocation to broadcast from. + * @return {number} The broadcast value. + */ +export const subgroupBroadcastFirst: any; +/** + * Swaps e between invocations in the quad in the X direction. + * + * @tsl + * @method + * @param {number} e - The value to swap from the current invocation. + * @return {number} The value received from the swap operation. + */ +export const quadSwapX: any; +/** + * Swaps e between invocations in the quad in the Y direction. + * + * @tsl + * @method + * @param {number} e - The value to swap from the current invocation. + * @return {number} The value received from the swap operation. + */ +export const quadSwapY: any; +/** + * Swaps e between invocations in the quad diagonally. + * + * @tsl + * @method + * @param {number} e - The value to swap from the current invocation. + * @return {number} The value received from the swap operation. + */ +export const quadSwapDiagonal: any; +/** + * Broadcasts e from the invocation whose subgroup_invocation_id matches id, to all active invocations. + * + * @tsl + * @method + * @param {number} e - The value to broadcast from subgroup invocation 'id'. + * @param {number} id - The subgroup invocation to broadcast from. + * @return {number} The broadcast value. + */ +export const subgroupBroadcast: any; +/** + * Returns v from the active invocation whose subgroup_invocation_id matches id + * + * @tsl + * @method + * @param {number} v - The value to return from subgroup invocation id^mask. + * @param {number} id - The subgroup invocation which returns the value v. + * @return {number} The broadcast value. + */ +export const subgroupShuffle: any; +/** + * Returns v from the active invocation whose subgroup_invocation_id matches subgroup_invocation_id ^ mask. + * + * @tsl + * @method + * @param {number} v - The value to return from subgroup invocation id^mask. + * @param {number} mask - A bitmask that determines the target invocation via a XOR operation. + * @return {number} The broadcast value. + */ +export const subgroupShuffleXor: any; +/** + * Returns v from the active invocation whose subgroup_invocation_id matches subgroup_invocation_id - delta + * + * @tsl + * @method + * @param {number} v - The value to return from subgroup invocation id^mask. + * @param {number} delta - A value that offsets the current in. + * @return {number} The broadcast value. + */ +export const subgroupShuffleUp: any; +/** + * Returns v from the active invocation whose subgroup_invocation_id matches subgroup_invocation_id + delta + * + * @tsl + * @method + * @param {number} v - The value to return from subgroup invocation id^mask. + * @param {number} delta - A value that offsets the current subgroup invocation. + * @return {number} The broadcast value. + */ +export const subgroupShuffleDown: any; +/** + * Broadcasts e from the quad invocation with id equal to id. + * + * @tsl + * @method + * @param {number} e - The value to broadcast. + * @return {number} The broadcast value. + */ +export const quadBroadcast: any; +/** + * This class represents a set of built in WGSL shader functions that sync + * synchronously execute an operation across a subgroup, or 'warp', of compute + * or fragment shader invocations within a workgroup. Typically, these functions + * will synchronously execute an operation using data from all active invocations + * within the subgroup, then broadcast that result to all active invocations. In + * other graphics APIs, subgroup functions are also referred to as wave intrinsics + * (DirectX/HLSL) or warp intrinsics (CUDA). + * + * @augments TempNode + */ +declare class SubgroupFunctionNode extends TempNode { + /** + * Constructs a new function node. + * + * @param {string} method - The subgroup/wave intrinsic method to construct. + * @param {Node} [aNode=null] - The method's first argument. + * @param {Node} [bNode=null] - The method's second argument. + */ + constructor(method: string, aNode?: Node, bNode?: Node); + /** + * The subgroup/wave intrinsic method to construct. + * + * @type {string} + */ + method: string; + /** + * The method's first argument. + * + * @type {Node} + */ + aNode: Node; + /** + * The method's second argument. + * + * @type {Node} + */ + bNode: Node; + getInputType(builder: any): any; + generateNodeType(builder: any): any; + generate(builder: any, output: any): any; + serialize(data: any): void; + deserialize(data: any): void; +} +declare namespace SubgroupFunctionNode { + let SUBGROUP_ELECT: string; + let SUBGROUP_BALLOT: string; + let SUBGROUP_ADD: string; + let SUBGROUP_INCLUSIVE_ADD: string; + let SUBGROUP_EXCLUSIVE_AND: string; + let SUBGROUP_MUL: string; + let SUBGROUP_INCLUSIVE_MUL: string; + let SUBGROUP_EXCLUSIVE_MUL: string; + let SUBGROUP_AND: string; + let SUBGROUP_OR: string; + let SUBGROUP_XOR: string; + let SUBGROUP_MIN: string; + let SUBGROUP_MAX: string; + let SUBGROUP_ALL: string; + let SUBGROUP_ANY: string; + let SUBGROUP_BROADCAST_FIRST: string; + let QUAD_SWAP_X: string; + let QUAD_SWAP_Y: string; + let QUAD_SWAP_DIAGONAL: string; + let SUBGROUP_BROADCAST: string; + let SUBGROUP_SHUFFLE: string; + let SUBGROUP_SHUFFLE_XOR: string; + let SUBGROUP_SHUFFLE_UP: string; + let SUBGROUP_SHUFFLE_DOWN: string; + let QUAD_BROADCAST: string; +} +import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/gpgpu/WorkgroupInfoNode.d.ts b/jsdoc-testing/jsdoc/nodes/gpgpu/WorkgroupInfoNode.d.ts new file mode 100644 index 000000000..2d1de77bc --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/gpgpu/WorkgroupInfoNode.d.ts @@ -0,0 +1,119 @@ +export default WorkgroupInfoNode; +export function workgroupArray(type: string, count?: number): WorkgroupInfoNode; +/** + * A node allowing the user to create a 'workgroup' scoped buffer within the + * context of a compute shader. Typically, workgroup scoped buffers are + * created to hold data that is transferred from a global storage scope into + * a local workgroup scope. For invocations within a workgroup, data + * access speeds on 'workgroup' scoped buffers can be significantly faster + * than similar access operations on globally accessible storage buffers. + * + * This node can only be used with a WebGPU backend. + * + * @augments Node + */ +declare class WorkgroupInfoNode extends Node { + /** + * Constructs a new buffer scoped to type scope. + * + * @param {string} scope - TODO. + * @param {string} bufferType - The data type of a 'workgroup' scoped buffer element. + * @param {number} [bufferCount=0] - The number of elements in the buffer. + */ + constructor(scope: string, bufferType: string, bufferCount?: number); + /** + * The buffer type. + * + * @type {string} + */ + bufferType: string; + /** + * The buffer count. + * + * @type {number} + * @default 0 + */ + bufferCount: number; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isWorkgroupInfoNode: boolean; + /** + * The data type of the array buffer. + * + * @type {string} + */ + elementType: string; + /** + * TODO. + * + * @type {string} + */ + scope: string; + /** + * Sets the name of this node. + * + * @param {string} name - The name to set. + * @return {WorkgroupInfoNode} A reference to this node. + */ + setName(name: string): WorkgroupInfoNode; + /** + * Sets the name/label of this node. + * + * @deprecated + * @param {string} name - The name to set. + * @return {WorkgroupInfoNode} A reference to this node. + */ + label(name: string): WorkgroupInfoNode; + /** + * Sets the scope of this node. + * + * @param {string} scope - The scope to set. + * @return {WorkgroupInfoNode} A reference to this node. + */ + setScope(scope: string): WorkgroupInfoNode; + /** + * The data type of the array buffer. + * + * @return {string} The element type. + */ + getElementType(): string; + /** + * Overwrites the default implementation since the input type + * is inferred from the scope. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The input type. + */ + getInputType(): string; + /** + * This method can be used to access elements via an index node. + * + * @param {IndexNode} indexNode - indexNode. + * @return {WorkgroupInfoElementNode} A reference to an element. + */ + element(indexNode: IndexNode): WorkgroupInfoElementNode; + generate(builder: any): any; +} +import Node from '../core/Node.js'; +/** + * Represents an element of a 'workgroup' scoped buffer. + * + * @augments ArrayElementNode + */ +declare class WorkgroupInfoElementNode extends ArrayElementNode { + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isWorkgroupInfoElementNode: boolean; + generate(builder: any, output: any): any; +} +import ArrayElementNode from '../utils/ArrayElementNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/AONode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/AONode.d.ts new file mode 100644 index 000000000..5c4e49ae2 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/lighting/AONode.d.ts @@ -0,0 +1,25 @@ +export default AONode; +/** + * A generic class that can be used by nodes which contribute + * ambient occlusion to the scene. E.g. an ambient occlusion map + * node can be used as input for this module. Used in {@link NodeMaterial}. + * + * @augments LightingNode + */ +declare class AONode extends LightingNode { + /** + * Constructs a new AO node. + * + * @param {?Node} [aoNode=null] - The ambient occlusion node. + */ + constructor(aoNode?: Node | null); + /** + * The ambient occlusion node. + * + * @type {?Node} + * @default null + */ + aoNode: Node | null; + setup(builder: any): void; +} +import LightingNode from './LightingNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/AmbientLightNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/AmbientLightNode.d.ts new file mode 100644 index 000000000..5705b1d91 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/lighting/AmbientLightNode.d.ts @@ -0,0 +1,12 @@ +export default AmbientLightNode; +/** + * Module for representing ambient lights as nodes. + * + * @augments AnalyticLightNode + */ +declare class AmbientLightNode extends AnalyticLightNode { + setup({ context }: { + context: any; + }): void; +} +import AnalyticLightNode from './AnalyticLightNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/AnalyticLightNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/AnalyticLightNode.d.ts new file mode 100644 index 000000000..e1c0209aa --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/lighting/AnalyticLightNode.d.ts @@ -0,0 +1,127 @@ +export default AnalyticLightNode; +/** + * Base class for analytic light nodes. + * + * @augments LightingNode + */ +declare class AnalyticLightNode extends LightingNode { + /** + * Constructs a new analytic light node. + * + * @param {?Light} [light=null] - The light source. + */ + constructor(light?: Light | null); + /** + * The light source. + * + * @type {?Light} + * @default null + */ + light: Light | null; + /** + * The light's color value. + * + * @type {Color} + */ + color: Color; + /** + * The light's color node. Points to `colorNode` of the light source, if set. Otherwise + * it creates a uniform node based on {@link AnalyticLightNode#color}. + * + * @type {Node} + */ + colorNode: Node; + /** + * This property is used to retain a reference to the original value of {@link AnalyticLightNode#colorNode}. + * The final color node is represented by a different node when using shadows. + * + * @type {?Node} + * @default null + */ + baseColorNode: Node | null; + /** + * Represents the light's shadow. + * + * @type {?ShadowNode} + * @default null + */ + shadowNode: ShadowNode | null; + /** + * Represents the light's shadow color. + * + * @type {?Node} + * @default null + */ + shadowColorNode: Node | null; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isAnalyticLightNode: boolean; + _shadowDisposeListener: (() => void) | undefined; + /** + * Frees internal resources related to shadows. + */ + disposeShadow(): void; + getHash(): any; + /** + * Returns a node representing a direction vector which points from the current + * position in view space to the light's position in view space. + * + * @param {NodeBuilder} builder - The builder object used for setting up the light. + * @return {Node} The light vector node. + */ + getLightVector(builder: NodeBuilder): Node; + /** + * Sets up the direct lighting for the analytic light node. + * + * @abstract + * @param {NodeBuilder} builder - The builder object used for setting up the light. + * @return {Object|undefined} The direct light data (color and direction). + */ + setupDirect(): Object | undefined; + /** + * Sets up the direct rect area lighting for the analytic light node. + * + * @abstract + * @param {NodeBuilder} builder - The builder object used for setting up the light. + * @return {Object|undefined} The direct rect area light data. + */ + setupDirectRectArea(): Object | undefined; + /** + * Setups the shadow node for this light. The method exists so concrete light classes + * can setup different types of shadow nodes. + * + * @return {ShadowNode} The created shadow node. + */ + setupShadowNode(): ShadowNode; + /** + * Setups the shadow for this light. This method is only executed if the light + * cast shadows and the current build object receives shadows. It incorporates + * shadows into the lighting computation. + * + * @param {NodeBuilder} builder - The current node builder. + */ + setupShadow(builder: NodeBuilder): void; + /** + * Unlike most other nodes, lighting nodes do not return a output node in {@link Node#setup}. + * The main purpose of lighting nodes is to configure the current {@link LightingModel} and/or + * invocate the respective interface methods. + * + * @param {NodeBuilder} builder - The current node builder. + */ + setup(builder: NodeBuilder): void; + /** + * The update method is used to update light uniforms per frame. + * Potentially overwritten in concrete light nodes to update light + * specific uniforms. + * + * @param {NodeFrame} frame - A reference to the current node frame. + */ + update(): void; +} +import LightingNode from './LightingNode.js'; +import { Color } from '../../math/Color.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/BasicEnvironmentNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/BasicEnvironmentNode.d.ts new file mode 100644 index 000000000..701118341 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/lighting/BasicEnvironmentNode.d.ts @@ -0,0 +1,26 @@ +export default BasicEnvironmentNode; +/** + * Represents a basic model for Image-based lighting (IBL). The environment + * is defined via environment maps in the equirectangular or cube map format. + * `BasicEnvironmentNode` is intended for non-PBR materials like {@link MeshBasicNodeMaterial} + * or {@link MeshPhongNodeMaterial}. + * + * @augments LightingNode + */ +declare class BasicEnvironmentNode extends LightingNode { + /** + * Constructs a new basic environment node. + * + * @param {Node} [envNode=null] - A node representing the environment. + */ + constructor(envNode?: Node); + /** + * A node representing the environment. + * + * @type {Node} + * @default null + */ + envNode: Node; + setup(builder: any): void; +} +import LightingNode from './LightingNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/BasicLightMapNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/BasicLightMapNode.d.ts new file mode 100644 index 000000000..b5173c497 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/lighting/BasicLightMapNode.d.ts @@ -0,0 +1,24 @@ +export default BasicLightMapNode; +/** + * A specific version of {@link IrradianceNode} that is only relevant + * for {@link MeshBasicNodeMaterial}. Since the material is unlit, it + * requires a special scaling factor for the light map. + * + * @augments LightingNode + */ +declare class BasicLightMapNode extends LightingNode { + /** + * Constructs a new basic light map node. + * + * @param {?Node} [lightMapNode=null] - The light map node. + */ + constructor(lightMapNode?: Node | null); + /** + * The light map node. + * + * @type {?Node} + */ + lightMapNode: Node | null; + setup(builder: any): void; +} +import LightingNode from './LightingNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/DirectionalLightNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/DirectionalLightNode.d.ts new file mode 100644 index 000000000..723a2afc6 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/lighting/DirectionalLightNode.d.ts @@ -0,0 +1,13 @@ +export default DirectionalLightNode; +/** + * Module for representing directional lights as nodes. + * + * @augments AnalyticLightNode + */ +declare class DirectionalLightNode extends AnalyticLightNode { + setupDirect(): { + lightDirection: any; + lightColor: Node; + }; +} +import AnalyticLightNode from './AnalyticLightNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/EnvironmentNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/EnvironmentNode.d.ts new file mode 100644 index 000000000..6b87431fc --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/lighting/EnvironmentNode.d.ts @@ -0,0 +1,33 @@ +export default EnvironmentNode; +/** + * Represents a physical model for Image-based lighting (IBL). The environment + * is defined via environment maps in the equirectangular, cube map or cubeUV (PMREM) format. + * `EnvironmentNode` is intended for PBR materials like {@link MeshStandardNodeMaterial}. + * + * @augments LightingNode + */ +declare class EnvironmentNode extends LightingNode { + /** + * Constructs a new environment node. + * + * @param {Node} [envNode=null] - A node representing the environment. + */ + constructor(envNode?: Node); + /** + * A node representing the environment. + * + * @type {?Node} + * @default null + */ + envNode: Node | null; + setup(builder: any): void; + /** + * Returns the PMREM node cache of the current renderer. + * + * @private + * @param {Renderer} renderer - The current renderer. + * @return {WeakMap} The node cache. + */ + private _getPMREMNodeCache; +} +import LightingNode from './LightingNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/HemisphereLightNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/HemisphereLightNode.d.ts new file mode 100644 index 000000000..6612f6067 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/lighting/HemisphereLightNode.d.ts @@ -0,0 +1,34 @@ +export default HemisphereLightNode; +/** + * Module for representing hemisphere lights as nodes. + * + * @augments AnalyticLightNode + */ +declare class HemisphereLightNode extends AnalyticLightNode { + /** + * Uniform node representing the light's position. + * + * @type {UniformNode} + */ + lightPositionNode: UniformNode; + /** + * A node representing the light's direction. + * + * @type {Node} + */ + lightDirectionNode: Node; + /** + * Uniform node representing the light's ground color. + * + * @type {UniformNode} + */ + groundColorNode: UniformNode; + /** + * Overwritten to updated hemisphere light specific uniforms. + * + * @param {NodeFrame} frame - A reference to the current node frame. + */ + update(frame: NodeFrame): void; + setup(builder: any): void; +} +import AnalyticLightNode from './AnalyticLightNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/IESSpotLightNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/IESSpotLightNode.d.ts new file mode 100644 index 000000000..ae6eeffb5 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/lighting/IESSpotLightNode.d.ts @@ -0,0 +1,9 @@ +export default IESSpotLightNode; +/** + * An IES version of the default spot light node. + * + * @augments SpotLightNode + */ +declare class IESSpotLightNode extends SpotLightNode { +} +import SpotLightNode from './SpotLightNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/IrradianceNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/IrradianceNode.d.ts new file mode 100644 index 000000000..0498aea05 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/lighting/IrradianceNode.d.ts @@ -0,0 +1,24 @@ +export default IrradianceNode; +/** + * A generic class that can be used by nodes which contribute + * irradiance to the scene. E.g. a light map node can be used + * as input for this module. Used in {@link NodeMaterial}. + * + * @augments LightingNode + */ +declare class IrradianceNode extends LightingNode { + /** + * Constructs a new irradiance node. + * + * @param {Node} node - A node contributing irradiance. + */ + constructor(node: Node); + /** + * A node contributing irradiance. + * + * @type {Node} + */ + node: Node; + setup(builder: any): void; +} +import LightingNode from './LightingNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/LightProbeNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/LightProbeNode.d.ts new file mode 100644 index 000000000..02fd000fd --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/lighting/LightProbeNode.d.ts @@ -0,0 +1,22 @@ +export default LightProbeNode; +/** + * Module for representing light probes as nodes. + * + * @augments AnalyticLightNode + */ +declare class LightProbeNode extends AnalyticLightNode { + /** + * Light probe represented as a uniform of spherical harmonics. + * + * @type {UniformArrayNode} + */ + lightProbe: UniformArrayNode; + /** + * Overwritten to updated light probe specific uniforms. + * + * @param {NodeFrame} frame - A reference to the current node frame. + */ + update(frame: NodeFrame): void; + setup(builder: any): void; +} +import AnalyticLightNode from './AnalyticLightNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/LightUtils.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/LightUtils.d.ts new file mode 100644 index 000000000..9a60548b3 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/lighting/LightUtils.d.ts @@ -0,0 +1,11 @@ +/** + * Represents a `discard` shader operation in TSL. + * + * @method + * @param {Object} inputs - The input parameter object. + * @param {Node} inputs.lightDistance - The distance of the light's position to the current fragment position. + * @param {Node} inputs.cutoffDistance - The light's cutoff distance. + * @param {Node} inputs.decayExponent - The light's decay exponent. + * @return {Node} The distance falloff. + */ +export const getDistanceAttenuation: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/LightingContextNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/LightingContextNode.d.ts new file mode 100644 index 000000000..2917f05e4 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/lighting/LightingContextNode.d.ts @@ -0,0 +1,83 @@ +export default LightingContextNode; +export const lightingContext: any; +/** + * `LightingContextNode` represents an extension of the {@link ContextNode} module + * by adding lighting specific context data. It represents the runtime context of + * {@link LightsNode}. + * + * @augments ContextNode + */ +declare class LightingContextNode extends ContextNode { + /** + * Constructs a new lighting context node. + * + * @param {LightsNode} lightsNode - The lights node. + * @param {?LightingModel} [lightingModel=null] - The current lighting model. + * @param {?Node} [backdropNode=null] - A backdrop node. + * @param {?Node} [backdropAlphaNode=null] - A backdrop alpha node. + */ + constructor(lightsNode: LightsNode, lightingModel?: LightingModel | null, backdropNode?: Node | null, backdropAlphaNode?: Node | null); + /** + * The current lighting model. + * + * @type {?LightingModel} + * @default null + */ + lightingModel: LightingModel | null; + /** + * A backdrop node. + * + * @type {?Node} + * @default null + */ + backdropNode: Node | null; + /** + * A backdrop alpha node. + * + * @type {?Node} + * @default null + */ + backdropAlphaNode: Node | null; + _value: { + radiance: Node; + irradiance: Node; + iblIrradiance: Node; + ambientOcclusion: Node; + reflectedLight: { + directDiffuse: Node; + directSpecular: Node; + indirectDiffuse: Node; + indirectSpecular: Node; + }; + backdrop: Node; + backdropAlpha: Node; + } | null; + /** + * Returns a lighting context object. + * + * @return {{ + * radiance: Node, + * irradiance: Node, + * iblIrradiance: Node, + * ambientOcclusion: Node, + * reflectedLight: {directDiffuse: Node, directSpecular: Node, indirectDiffuse: Node, indirectSpecular: Node}, + * backdrop: Node, + * backdropAlpha: Node + * }} The lighting context object. + */ + getContext(): { + radiance: Node; + irradiance: Node; + iblIrradiance: Node; + ambientOcclusion: Node; + reflectedLight: { + directDiffuse: Node; + directSpecular: Node; + indirectDiffuse: Node; + indirectSpecular: Node; + }; + backdrop: Node; + backdropAlpha: Node; + }; +} +import ContextNode from '../core/ContextNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/LightingNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/LightingNode.d.ts new file mode 100644 index 000000000..adc145155 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/lighting/LightingNode.d.ts @@ -0,0 +1,21 @@ +export default LightingNode; +/** + * Base class for lighting nodes. + * + * @augments Node + */ +declare class LightingNode extends Node { + /** + * Constructs a new lighting node. + */ + constructor(); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isLightingNode: boolean; +} +import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/LightsNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/LightsNode.d.ts new file mode 100644 index 000000000..6ecec5a31 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/lighting/LightsNode.d.ts @@ -0,0 +1,119 @@ +export default LightsNode; +export function lights(lights?: Array): LightsNode; +/** + * This node represents the scene's lighting and manages the lighting model's life cycle + * for the current build 3D object. It is responsible for computing the total outgoing + * light in a given lighting context. + * + * @augments Node + */ +declare class LightsNode extends Node { + /** + * Constructs a new lights node. + */ + constructor(); + /** + * A node representing the total diffuse light. + * + * @type {Node} + */ + totalDiffuseNode: Node; + /** + * A node representing the total specular light. + * + * @type {Node} + */ + totalSpecularNode: Node; + /** + * A node representing the outgoing light. + * + * @type {Node} + */ + outgoingLightNode: Node; + /** + * An array representing the lights in the scene. + * + * @private + * @type {Array} + */ + private _lights; + /** + * For each light in the scene, this node will create a + * corresponding light node. + * + * @private + * @type {?Array} + * @default null + */ + private _lightNodes; + /** + * A hash for identifying the current light nodes setup. + * + * @private + * @type {?string} + * @default null + */ + private _lightNodesHash; + /** + * Computes a hash value for identifying the current light nodes setup. + * + * @param {NodeBuilder} builder - A reference to the current node builder. + * @return {string} The computed hash. + */ + getHash(builder: NodeBuilder): string; + analyze(builder: any): void; + /** + * Creates lighting nodes for each scene light. This makes it possible to further + * process lights in the node system. + * + * @param {NodeBuilder} builder - A reference to the current node builder. + */ + setupLightsNode(builder: NodeBuilder): void; + /** + * Sets up a direct light in the lighting model. + * + * @param {Object} builder - The builder object containing the context and stack. + * @param {Object} lightNode - The light node. + * @param {Object} lightData - The light object containing color and direction properties. + */ + setupDirectLight(builder: Object, lightNode: Object, lightData: Object): void; + setupDirectRectAreaLight(builder: any, lightNode: any, lightData: any): void; + /** + * Setups the internal lights by building all respective + * light nodes. + * + * @param {NodeBuilder} builder - A reference to the current node builder. + * @param {Array} lightNodes - An array of lighting nodes. + */ + setupLights(builder: NodeBuilder, lightNodes: Array): void; + getLightNodes(builder: any): LightingNode[] | null; + /** + * The implementation makes sure that for each light in the scene + * there is a corresponding light node. By building the light nodes + * and evaluating the lighting model the outgoing light is computed. + * + * @param {NodeBuilder} builder - A reference to the current node builder. + * @return {Node} A node representing the outgoing light. + */ + setup(builder: NodeBuilder): Node; + /** + * Configures this node with an array of lights. + * + * @param {Array} lights - An array of lights. + * @return {LightsNode} A reference to this node. + */ + setLights(lights: Array): LightsNode; + /** + * Returns an array of the scene's lights. + * + * @return {Array} The scene's lights. + */ + getLights(): Array; + /** + * Whether the scene has lights or not. + * + * @type {boolean} + */ + get hasLights(): boolean; +} +import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/PointLightNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/PointLightNode.d.ts new file mode 100644 index 000000000..4dee5e49c --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/lighting/PointLightNode.d.ts @@ -0,0 +1,40 @@ +export function directPointLight({ color, lightVector, cutoffDistance, decayExponent }: { + color: any; + lightVector: any; + cutoffDistance: any; + decayExponent: any; +}): { + lightDirection: any; + lightColor: any; +}; +export default PointLightNode; +/** + * Module for representing point lights as nodes. + * + * @augments AnalyticLightNode + */ +declare class PointLightNode extends AnalyticLightNode { + /** + * Uniform node representing the cutoff distance. + * + * @type {UniformNode} + */ + cutoffDistanceNode: UniformNode; + /** + * Uniform node representing the decay exponent. + * + * @type {UniformNode} + */ + decayExponentNode: UniformNode; + /** + * Overwritten to updated point light specific uniforms. + * + * @param {NodeFrame} frame - A reference to the current node frame. + */ + update(frame: NodeFrame): void; + setupDirect(builder: any): { + lightDirection: any; + lightColor: any; + }; +} +import AnalyticLightNode from './AnalyticLightNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/PointShadowNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/PointShadowNode.d.ts new file mode 100644 index 000000000..6215b48a3 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/lighting/PointShadowNode.d.ts @@ -0,0 +1,52 @@ +export const BasicPointShadowFilter: () => void; +/** + * A shadow filtering function for point lights using Vogel disk sampling and IGN. + * + * Uses 5 samples distributed via Vogel disk pattern in tangent space around the + * sample direction, rotated per-pixel using Interleaved Gradient Noise (IGN). + * + * @method + * @param {Object} inputs - The input parameter object. + * @param {CubeDepthTexture} inputs.depthTexture - A reference to the shadow cube map. + * @param {Node} inputs.bd3D - The normalized direction from light to fragment. + * @param {Node} inputs.dp - The depth value to compare against. + * @param {LightShadow} inputs.shadow - The light shadow. + * @return {Node} The filtering result. + */ +export const PointShadowFilter: () => void; +export default PointShadowNode; +export function pointShadow(light: PointLight, shadow?: PointLightShadow | null): PointShadowNode; +/** + * Represents the shadow implementation for point light nodes. + * + * @augments ShadowNode + */ +declare class PointShadowNode extends ShadowNode { + /** + * Overwrites the default implementation to only use point light specific + * shadow filter functions. + * + * @param {NodeBuilder} builder - A reference to the current node builder. + * @param {Object} inputs - A configuration object that defines the shadow filtering. + * @param {Function} inputs.filterFn - This function defines the filtering type of the shadow map e.g. PCF. + * @param {DepthTexture} inputs.depthTexture - A reference to the shadow map's depth texture. + * @param {Node} inputs.shadowCoord - Shadow coordinates which are used to sample from the shadow map. + * @param {LightShadow} inputs.shadow - The light shadow. + * @return {Node} The result node of the shadow filtering. + */ + setupShadowFilter(builder: NodeBuilder, { filterFn, depthTexture, shadowCoord, shadow }: { + filterFn: Function; + depthTexture: DepthTexture; + shadowCoord: Node; + shadow: LightShadow; + }): Node; + /** + * Overwrites the default implementation to create a CubeRenderTarget with CubeDepthTexture. + * + * @param {LightShadow} shadow - The light shadow object. + * @param {NodeBuilder} builder - A reference to the current node builder. + * @return {Object} An object containing the shadow map and depth texture. + */ + setupRenderTarget(shadow: LightShadow, builder: NodeBuilder): Object; +} +import ShadowNode from './ShadowNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/ProjectorLightNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/ProjectorLightNode.d.ts new file mode 100644 index 000000000..22f3ffe8b --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/lighting/ProjectorLightNode.d.ts @@ -0,0 +1,17 @@ +export default ProjectorLightNode; +/** + * An implementation of a projector light node. + * + * @augments SpotLightNode + */ +declare class ProjectorLightNode extends SpotLightNode { + update(frame: any): void; + /** + * Overwrites the default implementation to compute projection attenuation. + * + * @param {NodeBuilder} builder - The node builder. + * @return {Node} The spot attenuation. + */ + getSpotAttenuation(builder: NodeBuilder): Node; +} +import SpotLightNode from './SpotLightNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/RectAreaLightNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/RectAreaLightNode.d.ts new file mode 100644 index 000000000..0b4d56420 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/lighting/RectAreaLightNode.d.ts @@ -0,0 +1,41 @@ +export default RectAreaLightNode; +/** + * Module for representing rect area lights as nodes. + * + * @augments AnalyticLightNode + */ +declare class RectAreaLightNode extends AnalyticLightNode { + /** + * Used to configure the internal BRDF approximation texture data. + * + * @param {RectAreaLightTexturesLib} ltc - The BRDF approximation texture data. + */ + static setLTC(ltc: RectAreaLightTexturesLib): void; + /** + * Uniform node representing the half height of the are light. + * + * @type {UniformNode} + */ + halfHeight: UniformNode; + /** + * Uniform node representing the half width of the are light. + * + * @type {UniformNode} + */ + halfWidth: UniformNode; + /** + * Overwritten to updated rect area light specific uniforms. + * + * @param {NodeFrame} frame - A reference to the current node frame. + */ + update(frame: NodeFrame): void; + setupDirectRectArea(builder: any): { + lightColor: Node; + lightPosition: UniformNode; + halfWidth: UniformNode; + halfHeight: UniformNode; + ltc_1: import("../accessors/TextureNode.js").default; + ltc_2: import("../accessors/TextureNode.js").default; + }; +} +import AnalyticLightNode from './AnalyticLightNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/ShadowBaseNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/ShadowBaseNode.d.ts new file mode 100644 index 000000000..fbbfa5fd2 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/lighting/ShadowBaseNode.d.ts @@ -0,0 +1,46 @@ +/** + * TSL object that represents the vertex position in world space during the shadow pass. + * + * @tsl + * @type {Node} + */ +export const shadowPositionWorld: Node; +export default ShadowBaseNode; +import Node from '../core/Node.js'; +/** + * Base class for all shadow nodes. + * + * Shadow nodes encapsulate shadow related logic and are always coupled to lighting nodes. + * Lighting nodes might share the same shadow node type or use specific ones depending on + * their requirements. + * + * @augments Node + */ +declare class ShadowBaseNode extends Node { + /** + * Constructs a new shadow base node. + * + * @param {Light} light - The shadow casting light. + */ + constructor(light: Light); + /** + * The shadow casting light. + * + * @type {Light} + */ + light: Light; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isShadowBaseNode: boolean; + /** + * Setups the shadow position node which is by default the predefined TSL node object `shadowPositionWorld`. + * + * @param {NodeBuilder} object - A configuration object that must at least hold a material reference. + */ + setupShadowPosition({ context, material }: NodeBuilder): void; +} diff --git a/jsdoc-testing/jsdoc/nodes/lighting/ShadowFilterNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/ShadowFilterNode.d.ts new file mode 100644 index 000000000..2fb0664f6 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/lighting/ShadowFilterNode.d.ts @@ -0,0 +1,50 @@ +/** + * A shadow filtering function performing basic filtering. This is in fact an unfiltered version of the shadow map + * with a binary `[0,1]` result. + * + * @method + * @param {Object} inputs - The input parameter object. + * @param {DepthTexture} inputs.depthTexture - A reference to the shadow map's texture data. + * @param {Node} inputs.shadowCoord - The shadow coordinates. + * @return {Node} The filtering result. + */ +export const BasicShadowFilter: () => void; +/** + * A shadow filtering function performing PCF filtering with Vogel disk sampling and IGN. + * + * Uses 5 samples distributed via Vogel disk pattern, rotated per-pixel using Interleaved + * Gradient Noise (IGN) to break up banding artifacts. Combined with hardware PCF (4-tap + * filtering per sample), this effectively provides 20 filtered taps with better distribution. + * + * @method + * @param {Object} inputs - The input parameter object. + * @param {DepthTexture} inputs.depthTexture - A reference to the shadow map's texture data. + * @param {Node} inputs.shadowCoord - The shadow coordinates. + * @param {LightShadow} inputs.shadow - The light shadow. + * @return {Node} The filtering result. + */ +export const PCFShadowFilter: () => void; +/** + * A shadow filtering function performing PCF soft filtering. + * + * @method + * @param {Object} inputs - The input parameter object. + * @param {DepthTexture} inputs.depthTexture - A reference to the shadow map's texture data. + * @param {Node} inputs.shadowCoord - The shadow coordinates. + * @param {LightShadow} inputs.shadow - The light shadow. + * @return {Node} The filtering result. + */ +export const PCFSoftShadowFilter: () => void; +/** + * A shadow filtering function performing VSM filtering. + * + * @method + * @param {Object} inputs - The input parameter object. + * @param {DepthTexture} inputs.depthTexture - A reference to the shadow map's texture data. + * @param {Node} inputs.shadowCoord - The shadow coordinates. + * @return {Node} The filtering result. + */ +export const VSMShadowFilter: () => void; +export function getShadowMaterial(light: Light): NodeMaterial; +export function disposeShadowMaterial(light: Light): void; +import NodeMaterial from '../../materials/nodes/NodeMaterial.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/ShadowNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/ShadowNode.d.ts new file mode 100644 index 000000000..d98fa7418 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/lighting/ShadowNode.d.ts @@ -0,0 +1,193 @@ +export function getShadowRenderObjectFunction(renderer: Renderer, shadow: LightShadow, shadowType: number, useVelocity: boolean): shadowRenderObjectFunction; +export default ShadowNode; +export function shadow(light: Light, shadow?: LightShadow | null): ShadowNode; +/** + * Represents the default shadow implementation for lighting nodes. + * + * @augments ShadowBaseNode + */ +declare class ShadowNode extends ShadowBaseNode { + /** + * Constructs a new shadow node. + * + * @param {Light} light - The shadow casting light. + * @param {?LightShadow} [shadow=null] - An optional light shadow. + */ + constructor(light: Light, shadow?: LightShadow | null); + /** + * The light shadow which defines the properties light's + * shadow. + * + * @type {?LightShadow} + * @default null + */ + shadow: LightShadow | null; + /** + * A reference to the shadow map which is a render target. + * + * @type {?RenderTarget} + * @default null + */ + shadowMap: RenderTarget | null; + /** + * Only relevant for VSM shadows. Render target for the + * first VSM render pass. + * + * @type {?RenderTarget} + * @default null + */ + vsmShadowMapVertical: RenderTarget | null; + /** + * Only relevant for VSM shadows. Render target for the + * second VSM render pass. + * + * @type {?RenderTarget} + * @default null + */ + vsmShadowMapHorizontal: RenderTarget | null; + /** + * Only relevant for VSM shadows. Node material which + * is used to render the first VSM pass. + * + * @type {?NodeMaterial} + * @default null + */ + vsmMaterialVertical: NodeMaterial | null; + /** + * Only relevant for VSM shadows. Node material which + * is used to render the second VSM pass. + * + * @type {?NodeMaterial} + * @default null + */ + vsmMaterialHorizontal: NodeMaterial | null; + /** + * A reference to the output node which defines the + * final result of this shadow node. + * + * @type {?Node} + * @private + * @default null + */ + private _node; + /** + * The current shadow map type of this shadow node. + * + * @type {?number} + * @private + * @default null + */ + private _currentShadowType; + /** + * A Weak Map holding the current frame ID per camera. Used + * to control the update of shadow maps. + * + * @type {WeakMap} + * @private + */ + private _cameraFrameId; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isShadowNode: boolean; + /** + * This index can be used when overriding setupRenderTarget with a RenderTarget Array to specify the depth layer. + * + * @type {number} + * @readonly + * @default true + */ + readonly depthLayer: number; + /** + * Setups the shadow filtering. + * + * @param {NodeBuilder} builder - A reference to the current node builder. + * @param {Object} inputs - A configuration object that defines the shadow filtering. + * @param {Function} inputs.filterFn - This function defines the filtering type of the shadow map e.g. PCF. + * @param {DepthTexture} inputs.depthTexture - A reference to the shadow map's texture data. + * @param {Node} inputs.shadowCoord - Shadow coordinates which are used to sample from the shadow map. + * @param {LightShadow} inputs.shadow - The light shadow. + * @return {Node} The result node of the shadow filtering. + */ + setupShadowFilter(builder: NodeBuilder, { filterFn, depthTexture, shadowCoord, shadow, depthLayer }: { + filterFn: Function; + depthTexture: DepthTexture; + shadowCoord: Node; + shadow: LightShadow; + }): Node; + /** + * Setups the shadow coordinates. + * + * @param {NodeBuilder} builder - A reference to the current node builder. + * @param {Node} shadowPosition - A node representing the shadow position. + * @return {Node} The shadow coordinates. + */ + setupShadowCoord(builder: NodeBuilder, shadowPosition: Node): Node; + /** + * Returns the shadow filtering function for the given shadow type. + * + * @param {number} type - The shadow type. + * @return {Function} The filtering function. + */ + getShadowFilterFn(type: number): Function; + setupRenderTarget(shadow: any, builder: any): { + shadowMap: any; + depthTexture: DepthTexture; + }; + /** + * Setups the shadow output node. + * + * @param {NodeBuilder} builder - A reference to the current node builder. + * @return {Node} The shadow output node. + */ + setupShadow(builder: NodeBuilder): Node; + /** + * The implementation performs the setup of the output node. An output is only + * produces if shadow mapping is globally enabled in the renderer. + * + * @param {NodeBuilder} builder - A reference to the current node builder. + * @return {ShaderCallNodeInternal} The output node. + */ + setup(builder: NodeBuilder): ShaderCallNodeInternal; + /** + * Renders the shadow. The logic of this function could be included + * into {@link ShadowNode#updateShadow} however more specialized shadow + * nodes might require a custom shadow map rendering. By having a + * dedicated method, it's easier to overwrite the default behavior. + * + * @param {NodeFrame} frame - A reference to the current node frame. + */ + renderShadow(frame: NodeFrame): void; + /** + * Updates the shadow. + * + * @param {NodeFrame} frame - A reference to the current node frame. + */ + updateShadow(frame: NodeFrame): void; + _depthVersionCached: any; + /** + * For VSM additional render passes are required. + * + * @param {Renderer} renderer - A reference to the current renderer. + */ + vsmPass(renderer: Renderer): void; + /** + * Resets the resouce state of this shadow node. + * + * @private + */ + private _reset; + /** + * The implementation performs the update of the shadow map if necessary. + * + * @param {NodeFrame} frame - A reference to the current node frame. + */ + updateBefore(frame: NodeFrame): void; +} +import ShadowBaseNode from './ShadowBaseNode.js'; +import NodeMaterial from '../../materials/nodes/NodeMaterial.js'; +import { DepthTexture } from '../../textures/DepthTexture.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/SpotLightNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/SpotLightNode.d.ts new file mode 100644 index 000000000..84f17e937 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/lighting/SpotLightNode.d.ts @@ -0,0 +1,52 @@ +export default SpotLightNode; +/** + * Module for representing spot lights as nodes. + * + * @augments AnalyticLightNode + */ +declare class SpotLightNode extends AnalyticLightNode { + /** + * Uniform node representing the cone cosine. + * + * @type {UniformNode} + */ + coneCosNode: UniformNode; + /** + * Uniform node representing the penumbra cosine. + * + * @type {UniformNode} + */ + penumbraCosNode: UniformNode; + /** + * Uniform node representing the cutoff distance. + * + * @type {UniformNode} + */ + cutoffDistanceNode: UniformNode; + /** + * Uniform node representing the decay exponent. + * + * @type {UniformNode} + */ + decayExponentNode: UniformNode; + /** + * Overwritten to updated spot light specific uniforms. + * + * @param {NodeFrame} frame - A reference to the current node frame. + */ + update(frame: NodeFrame): void; + /** + * Computes the spot attenuation for the given angle. + * + * @param {NodeBuilder} builder - The node builder. + * @param {Node} angleCosine - The angle to compute the spot attenuation for. + * @return {Node} The spot attenuation. + */ + getSpotAttenuation(builder: NodeBuilder, angleCosine: Node): Node; + getLightCoord(builder: any): any; + setupDirect(builder: any): { + lightColor: any; + lightDirection: any; + }; +} +import AnalyticLightNode from './AnalyticLightNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/materialx/MaterialXNodes.d.ts b/jsdoc-testing/jsdoc/nodes/materialx/MaterialXNodes.d.ts new file mode 100644 index 000000000..c994857f8 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/materialx/MaterialXNodes.d.ts @@ -0,0 +1,44 @@ +export function mx_aastep(threshold: any, value: any): any; +export function mx_ramplr(valuel: any, valuer: any, texcoord?: AttributeNode): any; +export function mx_ramptb(valuet: any, valueb: any, texcoord?: AttributeNode): any; +export function mx_ramp4(valuetl: any, valuetr: any, valuebl: any, valuebr: any, texcoord?: AttributeNode): any; +export function mx_splitlr(valuel: any, valuer: any, center: any, texcoord?: AttributeNode): any; +export function mx_splittb(valuet: any, valueb: any, center: any, texcoord?: AttributeNode): any; +export function mx_transform_uv(uv_scale?: number, uv_offset?: number, uv_geo?: AttributeNode): any; +export function mx_safepower(in1: any, in2?: number): any; +export function mx_contrast(input: any, amount?: number, pivot?: number): any; +export function mx_noise_float(texcoord?: AttributeNode, amplitude?: number, pivot?: number): any; +export function mx_noise_vec3(texcoord?: AttributeNode, amplitude?: number, pivot?: number): any; +export function mx_noise_vec4(texcoord?: AttributeNode, amplitude?: number, pivot?: number): any; +export function mx_unifiednoise2d(noiseType: any, texcoord?: AttributeNode, freq?: any, offset?: any, jitter?: number, outmin?: number, outmax?: number, clampoutput?: boolean, octaves?: number, lacunarity?: number, diminish?: number): any; +export function mx_unifiednoise3d(noiseType: any, texcoord?: AttributeNode, freq?: any, offset?: any, jitter?: number, outmin?: number, outmax?: number, clampoutput?: boolean, octaves?: number, lacunarity?: number, diminish?: number): any; +export function mx_worley_noise_float(texcoord?: AttributeNode, jitter?: number): any; +export function mx_worley_noise_vec2(texcoord?: AttributeNode, jitter?: number): any; +export function mx_worley_noise_vec3(texcoord?: AttributeNode, jitter?: number): any; +export function mx_cell_noise_float(texcoord?: AttributeNode): any; +export function mx_fractal_noise_float(position?: AttributeNode, octaves?: number, lacunarity?: number, diminish?: number, amplitude?: number): any; +export function mx_fractal_noise_vec2(position?: AttributeNode, octaves?: number, lacunarity?: number, diminish?: number, amplitude?: number): any; +export function mx_fractal_noise_vec3(position?: AttributeNode, octaves?: number, lacunarity?: number, diminish?: number, amplitude?: number): any; +export function mx_fractal_noise_vec4(position?: AttributeNode, octaves?: number, lacunarity?: number, diminish?: number, amplitude?: number): any; +export function mx_add(in1: any, in2?: any): any; +export function mx_subtract(in1: any, in2?: any): any; +export function mx_multiply(in1: any, in2?: any): any; +export function mx_divide(in1: any, in2?: any): any; +export function mx_modulo(in1: any, in2?: any): any; +export function mx_power(in1: any, in2?: any): any; +export function mx_atan2(in1?: any, in2?: any): any; +export function mx_timer(): UniformNode; +export function mx_frame(): UniformNode; +export function mx_invert(in1: any, amount?: any): any; +export function mx_ifgreater(value1: any, value2: any, in1: any, in2: any): any; +export function mx_ifgreatereq(value1: any, value2: any, in1: any, in2: any): any; +export function mx_ifequal(value1: any, value2: any, in1: any, in2: any): any; +export function mx_separate(in1: any, channelOrOut?: null): any; +export function mx_place2d(texcoord: any, pivot?: any, scale?: any, rotate?: any, offset?: any): any; +export function mx_rotate2d(input: any, amount: any): any; +export function mx_rotate3d(input: any, amount: any, axis: any): any; +export function mx_heighttonormal(input: any, scale: any): any; +import { mx_hsvtorgb } from './lib/mx_hsv.js'; +import { mx_rgbtohsv } from './lib/mx_hsv.js'; +import { mx_srgb_texture_to_lin_rec709 } from './lib/mx_transform_color.js'; +export { mx_hsvtorgb, mx_rgbtohsv, mx_srgb_texture_to_lin_rec709 }; diff --git a/jsdoc-testing/jsdoc/nodes/materialx/lib/mx_hsv.d.ts b/jsdoc-testing/jsdoc/nodes/materialx/lib/mx_hsv.d.ts new file mode 100644 index 000000000..27d194964 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/materialx/lib/mx_hsv.d.ts @@ -0,0 +1,2 @@ +export const mx_hsvtorgb: any; +export const mx_rgbtohsv: any; diff --git a/jsdoc-testing/jsdoc/nodes/materialx/lib/mx_noise.d.ts b/jsdoc-testing/jsdoc/nodes/materialx/lib/mx_noise.d.ts new file mode 100644 index 000000000..d22a57d41 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/materialx/lib/mx_noise.d.ts @@ -0,0 +1,70 @@ +export const mx_select: any; +export const mx_negate_if: any; +export const mx_floor: any; +export const mx_floorfrac: () => void; +export const mx_bilerp_0: any; +export const mx_bilerp_1: any; +export const mx_bilerp: import("../../utils/FunctionOverloadingNode.js").default; +export const mx_trilerp_0: any; +export const mx_trilerp_1: any; +export const mx_trilerp: import("../../utils/FunctionOverloadingNode.js").default; +export const mx_gradient_float_0: any; +export const mx_gradient_float_1: any; +export const mx_gradient_float: import("../../utils/FunctionOverloadingNode.js").default; +export const mx_gradient_vec3_0: any; +export const mx_gradient_vec3_1: any; +export const mx_gradient_vec3: import("../../utils/FunctionOverloadingNode.js").default; +export const mx_gradient_scale2d_0: any; +export const mx_gradient_scale3d_0: any; +export const mx_gradient_scale2d_1: any; +export const mx_gradient_scale2d: import("../../utils/FunctionOverloadingNode.js").default; +export const mx_gradient_scale3d_1: any; +export const mx_gradient_scale3d: import("../../utils/FunctionOverloadingNode.js").default; +export const mx_rotl32: any; +export const mx_bjmix: () => void; +export const mx_bjfinal: any; +export const mx_bits_to_01: any; +export const mx_fade: any; +export const mx_hash_int_0: any; +export const mx_hash_int_1: any; +export const mx_hash_int_2: any; +export const mx_hash_int_3: any; +export const mx_hash_int_4: any; +export const mx_hash_int: import("../../utils/FunctionOverloadingNode.js").default; +export const mx_hash_vec3_0: any; +export const mx_hash_vec3_1: any; +export const mx_hash_vec3: import("../../utils/FunctionOverloadingNode.js").default; +export const mx_perlin_noise_float_0: any; +export const mx_perlin_noise_float_1: any; +export const mx_perlin_noise_float: import("../../utils/FunctionOverloadingNode.js").default; +export const mx_perlin_noise_vec3_0: any; +export const mx_perlin_noise_vec3_1: any; +export const mx_perlin_noise_vec3: import("../../utils/FunctionOverloadingNode.js").default; +export const mx_cell_noise_float_0: any; +export const mx_cell_noise_float_1: any; +export const mx_cell_noise_float_2: any; +export const mx_cell_noise_float_3: any; +export const mx_cell_noise_float: import("../../utils/FunctionOverloadingNode.js").default; +export const mx_cell_noise_vec3_0: any; +export const mx_cell_noise_vec3_1: any; +export const mx_cell_noise_vec3_2: any; +export const mx_cell_noise_vec3_3: any; +export const mx_cell_noise_vec3: import("../../utils/FunctionOverloadingNode.js").default; +export const mx_fractal_noise_float: any; +export const mx_fractal_noise_vec3: any; +export const mx_fractal_noise_vec2: any; +export const mx_fractal_noise_vec4: any; +export const mx_worley_distance_0: any; +export const mx_worley_distance_1: any; +export const mx_worley_distance: import("../../utils/FunctionOverloadingNode.js").default; +export const mx_worley_noise_float_0: any; +export const mx_worley_noise_vec2_0: any; +export const mx_worley_noise_vec3_0: any; +export const mx_worley_noise_float_1: any; +export const mx_worley_noise_float: import("../../utils/FunctionOverloadingNode.js").default; +export const mx_worley_noise_vec2_1: any; +export const mx_worley_noise_vec2: import("../../utils/FunctionOverloadingNode.js").default; +export const mx_worley_noise_vec3_1: any; +export const mx_worley_noise_vec3: import("../../utils/FunctionOverloadingNode.js").default; +export const mx_unifiednoise2d: any; +export const mx_unifiednoise3d: any; diff --git a/jsdoc-testing/jsdoc/nodes/materialx/lib/mx_transform_color.d.ts b/jsdoc-testing/jsdoc/nodes/materialx/lib/mx_transform_color.d.ts new file mode 100644 index 000000000..521d93346 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/materialx/lib/mx_transform_color.d.ts @@ -0,0 +1 @@ +export const mx_srgb_texture_to_lin_rec709: any; diff --git a/jsdoc-testing/jsdoc/nodes/math/BitcastNode.d.ts b/jsdoc-testing/jsdoc/nodes/math/BitcastNode.d.ts new file mode 100644 index 000000000..f15d7989b --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/math/BitcastNode.d.ts @@ -0,0 +1,62 @@ +export default BitcastNode; +/** + * Reinterpret the bit representation of a value in one type as a value in another type. + * + * @tsl + * @function + * @param {Node | number} x - The parameter. + * @param {string} y - The new type. + * @returns {Node} + */ +export const bitcast: any; +export function floatBitsToInt(value: Node): BitcastNode; +export function floatBitsToUint(value: Node): BitcastNode; +export function intBitsToFloat(value: Node): BitcastNode; +export function uintBitsToFloat(value: Node): BitcastNode; +/** + * This node represents an operation that reinterprets the bit representation of a value + * in one type as a value in another type. + * + * @augments TempNode + */ +declare class BitcastNode extends TempNode { + /** + * Constructs a new bitcast node. + * + * @param {Node} valueNode - The value to convert. + * @param {string} conversionType - The type to convert to. + * @param {?string} [inputType = null] - The expected input data type of the bitcast operation. + */ + constructor(valueNode: Node, conversionType: string, inputType?: string | null); + /** + * The data to bitcast to a new type. + * + * @type {Node} + */ + valueNode: Node; + /** + * The type the value will be converted to. + * + * @type {string} + */ + conversionType: string; + /** + * The expected input data type of the bitcast operation. + * + * + * @type {string} + * @default null + */ + inputType: string; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isBitcastNode: boolean; + generateNodeType(builder: any): any; + generate(builder: any): string; +} +import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/math/BitcountNode.d.ts b/jsdoc-testing/jsdoc/nodes/math/BitcountNode.d.ts new file mode 100644 index 000000000..5a85b0585 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/math/BitcountNode.d.ts @@ -0,0 +1,111 @@ +export default BitcountNode; +/** + * Finds the number of consecutive 0 bits from the least significant bit of the input value, + * which is also the index of the least significant bit of the input value. + * + * Can only be used with {@link WebGPURenderer} and a WebGPU backend. + * + * @tsl + * @function + * @param {Node | number} x - The input value. + * @returns {Node} + */ +export const countTrailingZeros: any; +/** + * Finds the number of consecutive 0 bits starting from the most significant bit of the input value. + * + * Can only be used with {@link WebGPURenderer} and a WebGPU backend. + * + * @tsl + * @function + * @param {Node | number} x - The input value. + * @returns {Node} + */ +export const countLeadingZeros: any; +/** + * Finds the number of '1' bits set in the input value + * + * Can only be used with {@link WebGPURenderer} and a WebGPU backend. + * + * @tsl + * @function + * @returns {Node} + */ +export const countOneBits: any; +/** + * This node represents an operation that counts the bits of a piece of shader data. + * + * @augments MathNode + */ +declare class BitcountNode extends MathNode { + /** + * Constructs a new math node. + * + * @param {'countTrailingZeros'|'countLeadingZeros'|'countOneBits'} method - The method name. + * @param {Node} aNode - The first input. + */ + constructor(method: "countTrailingZeros" | "countLeadingZeros" | "countOneBits", aNode: Node); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isBitcountNode: boolean; + /** + * Casts the input value of the function to an integer if necessary. + * + * @private + * @param {Node|Node} inputNode - The input value. + * @param {Node} outputNode - The output value. + * @param {string} elementType - The type of the input value. + */ + private _resolveElementType; + _returnDataNode(inputType: any): any; + /** + * Creates and registers a reusable GLSL function that emulates the behavior of countTrailingZeros. + * + * @private + * @param {string} method - The name of the function to create. + * @param {string} elementType - The type of the input value. + * @returns {Function} - The generated function + */ + private _createTrailingZerosBaseLayout; + /** + * Creates and registers a reusable GLSL function that emulates the behavior of countLeadingZeros. + * + * @private + * @param {string} method - The name of the function to create. + * @param {string} elementType - The type of the input value. + * @returns {Function} - The generated function + */ + private _createLeadingZerosBaseLayout; + /** + * Creates and registers a reusable GLSL function that emulates the behavior of countOneBits. + * + * @private + * @param {string} method - The name of the function to create. + * @param {string} elementType - The type of the input value. + * @returns {Function} - The generated function + */ + private _createOneBitsBaseLayout; + /** + * Creates and registers a reusable GLSL function that emulates the behavior of the specified bitcount function. + * including considerations for component-wise bitcounts on vector type inputs. + * + * @private + * @param {string} method - The name of the function to create. + * @param {string} inputType - The type of the input value. + * @param {number} typeLength - The vec length of the input value. + * @param {Function} baseFn - The base function that operates on an individual component of the vector. + * @returns {Function} - The alias function for the specified bitcount method. + */ + private _createMainLayout; +} +declare namespace BitcountNode { + let COUNT_TRAILING_ZEROS: string; + let COUNT_LEADING_ZEROS: string; + let COUNT_ONE_BITS: string; +} +import MathNode from './MathNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/math/ConditionalNode.d.ts b/jsdoc-testing/jsdoc/nodes/math/ConditionalNode.d.ts new file mode 100644 index 000000000..660aa3fb6 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/math/ConditionalNode.d.ts @@ -0,0 +1,65 @@ +export default ConditionalNode; +/** + * TSL function for creating a conditional node. + * + * @tsl + * @function + * @param {Node} condNode - The node that defines the condition. + * @param {Node} ifNode - The node that is evaluate when the condition ends up `true`. + * @param {?Node} [elseNode=null] - The node that is evaluate when the condition ends up `false`. + * @returns {ConditionalNode} + */ +export const select: any; +/** + * Represents a logical `if/else` statement. Can be used as an alternative + * to the `If()`/`Else()` syntax. + * + * The corresponding TSL `select()` looks like so: + * ```js + * velocity = position.greaterThanEqual( limit ).select( velocity.negate(), velocity ); + * ``` + * The `select()` method is called in a chaining fashion on a condition. The parameter nodes of `select()` + * determine the outcome of the entire statement. + * + * @augments Node + */ +declare class ConditionalNode extends Node { + /** + * Constructs a new conditional node. + * + * @param {Node} condNode - The node that defines the condition. + * @param {Node} ifNode - The node that is evaluate when the condition ends up `true`. + * @param {?Node} [elseNode=null] - The node that is evaluate when the condition ends up `false`. + */ + constructor(condNode: Node, ifNode: Node, elseNode?: Node | null); + /** + * The node that defines the condition. + * + * @type {Node} + */ + condNode: Node; + /** + * The node that is evaluate when the condition ends up `true`. + * + * @type {Node} + */ + ifNode: Node; + /** + * The node that is evaluate when the condition ends up `false`. + * + * @type {?Node} + * @default null + */ + elseNode: Node | null; + /** + * This method is overwritten since the node type is inferred from the if/else + * nodes. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The node type. + */ + generateNodeType(builder: NodeBuilder): string; + setup(builder: any): void; + generate(builder: any, output: any): any; +} +import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/math/Hash.d.ts b/jsdoc-testing/jsdoc/nodes/math/Hash.d.ts new file mode 100644 index 000000000..e42866ba8 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/math/Hash.d.ts @@ -0,0 +1,9 @@ +/** + * Generates a hash value in the range `[0, 1]` from the given seed. + * + * @tsl + * @function + * @param {Node} seed - The seed. + * @return {Node} The hash value. + */ +export const hash: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/math/MathNode.d.ts b/jsdoc-testing/jsdoc/nodes/math/MathNode.d.ts new file mode 100644 index 000000000..8cdc4720d --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/math/MathNode.d.ts @@ -0,0 +1,701 @@ +export default MathNode; +/** + * A small value used to handle floating-point precision errors. + * + * @tsl + * @type {Node} + */ +export const EPSILON: Node; +/** + * Represents infinity. + * + * @tsl + * @type {Node} + */ +export const INFINITY: Node; +/** + * Represents PI. + * + * @tsl + * @type {Node} + */ +export const PI: Node; +/** + * Represents PI * 2. Please use the non-deprecated version `TWO_PI`. + * + * @tsl + * @deprecated + * @type {Node} + */ +export const PI2: Node; +/** + * Represents PI * 2. + * + * @tsl + * @type {Node} + */ +export const TWO_PI: Node; +/** + * Represents PI / 2. + * + * @tsl + * @type {Node} + */ +export const HALF_PI: Node; +/** + * Returns `true` if all components of `x` are `true`. + * + * @tsl + * @function + * @param {Node | number} x - The parameter. + * @returns {Node} + */ +export const all: any; +/** + * Returns `true` if any components of `x` are `true`. + * + * @tsl + * @function + * @param {Node | number} x - The parameter. + * @returns {Node} + */ +export const any: any; +/** + * Converts a quantity in degrees to radians. + * + * @tsl + * @function + * @param {Node | number} x - The input in degrees. + * @returns {Node} + */ +export const radians: any; +/** + * Convert a quantity in radians to degrees. + * + * @tsl + * @function + * @param {Node | number} x - The input in radians. + * @returns {Node} + */ +export const degrees: any; +/** + * Returns the natural exponentiation of the parameter. + * + * @tsl + * @function + * @param {Node | number} x - The parameter. + * @returns {Node} + */ +export const exp: any; +/** + * Returns 2 raised to the power of the parameter. + * + * @tsl + * @function + * @param {Node | number} x - The parameter. + * @returns {Node} + */ +export const exp2: any; +/** + * Returns the natural logarithm of the parameter. + * + * @tsl + * @function + * @param {Node | number} x - The parameter. + * @returns {Node} + */ +export const log: any; +/** + * Returns the base 2 logarithm of the parameter. + * + * @tsl + * @function + * @param {Node | number} x - The parameter. + * @returns {Node} + */ +export const log2: any; +/** + * Returns the square root of the parameter. + * + * @tsl + * @function + * @param {Node | number} x - The parameter. + * @returns {Node} + */ +export const sqrt: any; +/** + * Returns the inverse of the square root of the parameter. + * + * @tsl + * @function + * @param {Node | number} x - The parameter. + * @returns {Node} + */ +export const inverseSqrt: any; +/** + * Finds the nearest integer less than or equal to the parameter. + * + * @tsl + * @function + * @param {Node | number} x - The parameter. + * @returns {Node} + */ +export const floor: any; +/** + * Finds the nearest integer that is greater than or equal to the parameter. + * + * @tsl + * @function + * @param {Node | number} x - The parameter. + * @returns {Node} + */ +export const ceil: any; +/** + * Calculates the unit vector in the same direction as the original vector. + * + * @tsl + * @function + * @param {Node} x - The input vector. + * @returns {Node} + */ +export const normalize: any; +/** + * Computes the fractional part of the parameter. + * + * @tsl + * @function + * @param {Node | number} x - The parameter. + * @returns {Node} + */ +export const fract: any; +/** + * Returns the sine of the parameter. + * + * @tsl + * @function + * @param {Node | number} x - The parameter. + * @returns {Node} + */ +export const sin: any; +/** + * Returns the hyperbolic sine of the parameter. + * + * @tsl + * @function + * @param {Node | number} x - The parameter. + * @returns {Node} + */ +export const sinh: any; +/** + * Returns the cosine of the parameter. + * + * @tsl + * @function + * @param {Node | number} x - The parameter. + * @returns {Node} + */ +export const cos: any; +/** + * Returns the hyperbolic cosine of the parameter. + * + * @tsl + * @function + * @param {Node | number} x - The parameter. + * @returns {Node} + */ +export const cosh: any; +/** + * Returns the tangent of the parameter. + * + * @tsl + * @function + * @param {Node | number} x - The parameter. + * @returns {Node} + */ +export const tan: any; +/** + * Returns the hyperbolic tangent of the parameter. + * + * @tsl + * @function + * @param {Node | number} x - The parameter. + * @returns {Node} + */ +export const tanh: any; +/** + * Returns the arcsine of the parameter. + * + * @tsl + * @function + * @param {Node | number} x - The parameter. + * @returns {Node} + */ +export const asin: any; +/** + * Returns the inverse hyperbolic sine of the parameter. + * + * @tsl + * @function + * @param {Node | number} x - The parameter. + * @returns {Node} + */ +export const asinh: any; +/** + * Returns the arccosine of the parameter. + * + * @tsl + * @function + * @param {Node | number} x - The parameter. + * @returns {Node} + */ +export const acos: any; +/** + * Returns the inverse hyperbolic cosine of the parameter. + * + * @tsl + * @function + * @param {Node | number} x - The parameter. + * @returns {Node} + */ +export const acosh: any; +/** + * Returns the arc-tangent of the parameter. + * If two parameters are provided, the result is `atan2(y/x)`. + * + * @tsl + * @function + * @param {Node | number} y - The y parameter. + * @param {?(Node | number)} x - The x parameter. + * @returns {Node} + */ +export const atan: any; +/** + * Returns the inverse hyperbolic tangent of the parameter. + * + * @tsl + * @function + * @param {Node | number} x - The parameter. + * @returns {Node} + */ +export const atanh: any; +/** + * Returns the absolute value of the parameter. + * + * @tsl + * @function + * @param {Node | number} x - The parameter. + * @returns {Node} + */ +export const abs: any; +/** + * Extracts the sign of the parameter. + * + * @tsl + * @function + * @param {Node | number} x - The parameter. + * @returns {Node} + */ +export const sign: any; +/** + * Calculates the length of a vector. + * + * @tsl + * @function + * @param {Node} x - The parameter. + * @returns {Node} + */ +export const length: any; +/** + * Negates the value of the parameter (-x). + * + * @tsl + * @function + * @param {Node | number} x - The parameter. + * @returns {Node} + */ +export const negate: any; +/** + * Return `1` minus the parameter. + * + * @tsl + * @function + * @param {Node | number} x - The parameter. + * @returns {Node} + */ +export const oneMinus: any; +/** + * Returns the partial derivative of the parameter with respect to x. + * + * @tsl + * @function + * @param {Node | number} x - The parameter. + * @returns {Node} + */ +export const dFdx: any; +/** + * Returns the partial derivative of the parameter with respect to y. + * + * @tsl + * @function + * @param {Node | number} x - The parameter. + * @returns {Node} + */ +export const dFdy: any; +/** + * Rounds the parameter to the nearest integer. + * + * @tsl + * @function + * @param {Node | number} x - The parameter. + * @returns {Node} + */ +export const round: any; +/** + * Returns the reciprocal of the parameter `(1/x)`. + * + * @tsl + * @function + * @param {Node | number} x - The parameter. + * @returns {Node} + */ +export const reciprocal: any; +/** + * Truncates the parameter, removing the fractional part. + * + * @tsl + * @function + * @param {Node | number} x - The parameter. + * @returns {Node} + */ +export const trunc: any; +/** + * Returns the sum of the absolute derivatives in x and y. + * + * @tsl + * @function + * @param {Node | number} x - The parameter. + * @returns {Node} + */ +export const fwidth: any; +/** + * Returns the transpose of a matrix. + * + * @tsl + * @function + * @param {Node} x - The parameter. + * @returns {Node} + */ +export const transpose: any; +/** + * Returns the determinant of a matrix. + * + * @tsl + * @function + * @param {Node} x - The parameter. + * @returns {Node} + */ +export const determinant: any; +/** + * Returns the inverse of a matrix. + * + * @tsl + * @function + * @param {Node} x - The parameter. + * @returns {Node} + */ +export const inverse: any; +/** + * Returns the least of the given values. + * + * @tsl + * @function + * @param {...(Node | number)} values - The values to compare. + * @returns {Node} + */ +export const min: any; +/** + * Returns the greatest of the given values. + * + * @tsl + * @function + * @param {...(Node | number)} values - The values to compare. + * @returns {Node} + */ +export const max: any; +/** + * Generate a step function by comparing two values. + * + * @tsl + * @function + * @param {Node | number} x - The y parameter. + * @param {Node | number} y - The x parameter. + * @returns {Node} + */ +export const step: any; +/** + * Calculates the reflection direction for an incident vector. + * + * @tsl + * @function + * @param {Node} I - The incident vector. + * @param {Node} N - The normal vector. + * @returns {Node} + */ +export const reflect: any; +/** + * Calculates the distance between two points. + * + * @tsl + * @function + * @param {Node} x - The first point. + * @param {Node} y - The second point. + * @returns {Node} + */ +export const distance: any; +/** + * Calculates the absolute difference between two values. + * + * @tsl + * @function + * @param {Node | number} x - The first parameter. + * @param {Node | number} y - The second parameter. + * @returns {Node} + */ +export const difference: any; +/** + * Calculates the dot product of two vectors. + * + * @tsl + * @function + * @param {Node} x - The first vector. + * @param {Node} y - The second vector. + * @returns {Node} + */ +export const dot: any; +/** + * Calculates the cross product of two vectors. + * + * @tsl + * @function + * @param {Node} x - The first vector. + * @param {Node} y - The second vector. + * @returns {Node} + */ +export const cross: any; +/** + * Return the value of the first parameter raised to the power of the second one. + * + * @tsl + * @function + * @param {Node | number} x - The first parameter. + * @param {Node | number} y - The second parameter. + * @returns {Node} + */ +export const pow: any; +export function pow2(x: Node | number): Node; +export function pow3(x: Node | number): Node; +export function pow4(x: Node | number): Node; +/** + * Transforms the direction of a vector by a matrix and then normalizes the result. + * + * @tsl + * @function + * @param {Node} direction - The direction vector. + * @param {Node} matrix - The transformation matrix. + * @returns {Node} + */ +export const transformDirection: any; +export function cbrt(a: Node | number): Node; +export function lengthSq(a: Node): Node; +/** + * Linearly interpolates between two values. + * + * @tsl + * @function + * @param {Node | number} a - The first parameter. + * @param {Node | number} b - The second parameter. + * @param {Node | number} t - The interpolation value. + * @returns {Node} + */ +export const mix: any; +export function clamp(value: Node | number, low?: Node | number, high?: Node | number): Node; +export function saturate(value: Node | number): Node; +/** + * Calculates the refraction direction for an incident vector. + * + * @tsl + * @function + * @param {Node} I - The incident vector. + * @param {Node} N - The normal vector. + * @param {Node} eta - The ratio of indices of refraction. + * @returns {Node} + */ +export const refract: any; +/** + * Performs a Hermite interpolation between two values. + * + * @tsl + * @function + * @param {Node | number} low - The value of the lower edge of the Hermite function. + * @param {Node | number} high - The value of the upper edge of the Hermite function. + * @param {Node | number} x - The source value for interpolation. + * @returns {Node} + */ +export const smoothstep: any; +/** + * Returns a vector pointing in the same direction as another. + * + * @tsl + * @function + * @param {Node} N - The vector to orient. + * @param {Node} I - The incident vector. + * @param {Node} Nref - The reference vector. + * @returns {Node} + */ +export const faceForward: any; +/** + * Returns a random value for the given uv. + * + * @tsl + * @function + * @param {Node} uv - The uv node. + * @returns {Node} + */ +export const rand: () => void; +export function mixElement(t: Node | number, e1: Node | number, e2: Node | number): Node; +export function smoothstepElement(x: Node | number, low: Node | number, high: Node | number): Node; +export function stepElement(x: Node | number, edge: Node | number): Node; +export const faceforward: any; +export const inversesqrt: any; +/** + * This node represents a variety of mathematical methods available in shaders. + * They are divided into three categories: + * + * - Methods with one input like `sin`, `cos` or `normalize`. + * - Methods with two inputs like `dot`, `cross` or `pow`. + * - Methods with three inputs like `mix`, `clamp` or `smoothstep`. + * + * @augments TempNode + */ +declare class MathNode extends TempNode { + /** + * Constructs a new math node. + * + * @param {string} method - The method name. + * @param {Node} aNode - The first input. + * @param {?Node} [bNode=null] - The second input. + * @param {?Node} [cNode=null] - The third input. + */ + constructor(method: string, aNode: Node, bNode?: Node | null, cNode?: Node | null, ...args: any[]); + /** + * The method name. + * + * @type {string} + */ + method: string; + /** + * The first input. + * + * @type {Node} + */ + aNode: Node; + /** + * The second input. + * + * @type {?Node} + * @default null + */ + bNode: Node | null; + /** + * The third input. + * + * @type {?Node} + * @default null + */ + cNode: Node | null; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isMathNode: boolean; + /** + * The input type is inferred from the node types of the input nodes. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The input type. + */ + getInputType(builder: NodeBuilder): string; + /** + * The selected method as well as the input type determine the node type of this node. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The node type. + */ + generateNodeType(builder: NodeBuilder): string; + setup(builder: any): any; + generate(builder: any, output: any): any; + serialize(data: any): void; + deserialize(data: any): void; +} +declare namespace MathNode { + let ALL: string; + let ANY: string; + let RADIANS: string; + let DEGREES: string; + let EXP: string; + let EXP2: string; + let LOG: string; + let LOG2: string; + let SQRT: string; + let INVERSE_SQRT: string; + let FLOOR: string; + let CEIL: string; + let NORMALIZE: string; + let FRACT: string; + let SIN: string; + let SINH: string; + let COS: string; + let COSH: string; + let TAN: string; + let TANH: string; + let ASIN: string; + let ASINH: string; + let ACOS: string; + let ACOSH: string; + let ATAN: string; + let ATANH: string; + let ABS: string; + let SIGN: string; + let LENGTH: string; + let NEGATE: string; + let ONE_MINUS: string; + let DFDX: string; + let DFDY: string; + let ROUND: string; + let RECIPROCAL: string; + let TRUNC: string; + let FWIDTH: string; + let TRANSPOSE: string; + let DETERMINANT: string; + let INVERSE: string; + let EQUALS: string; + let MIN: string; + let MAX: string; + let STEP: string; + let REFLECT: string; + let DISTANCE: string; + let DIFFERENCE: string; + let DOT: string; + let CROSS: string; + let POW: string; + let TRANSFORM_DIRECTION: string; + let MIX: string; + let CLAMP: string; + let REFRACT: string; + let SMOOTHSTEP: string; + let FACEFORWARD: string; +} +import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/math/MathUtils.d.ts b/jsdoc-testing/jsdoc/nodes/math/MathUtils.d.ts new file mode 100644 index 000000000..69ed7ec52 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/math/MathUtils.d.ts @@ -0,0 +1,4 @@ +export function parabola(x: Node, k: Node): Node; +export function gain(x: Node, k: Node): Node; +export function pcurve(x: Node, a: Node, b: Node): Node; +export function sinc(x: Node, k: Node): Node; diff --git a/jsdoc-testing/jsdoc/nodes/math/OperatorNode.d.ts b/jsdoc-testing/jsdoc/nodes/math/OperatorNode.d.ts new file mode 100644 index 000000000..6b14bf599 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/math/OperatorNode.d.ts @@ -0,0 +1,313 @@ +export default OperatorNode; +/** + * Returns the addition of two or more value. + * + * @tsl + * @function + * @param {Node} a - The first input. + * @param {Node} b - The second input. + * @param {...Node} params - Additional input parameters. + * @returns {OperatorNode} + */ +export const add: any; +/** + * Returns the subtraction of two or more value. + * + * @tsl + * @function + * @param {Node} a - The first input. + * @param {Node} b - The second input. + * @param {...Node} params - Additional input parameters. + * @returns {OperatorNode} + */ +export const sub: any; +/** + * Returns the multiplication of two or more value. + * + * @tsl + * @function + * @param {Node} a - The first input. + * @param {Node} b - The second input. + * @param {...Node} params - Additional input parameters. + * @returns {OperatorNode} + */ +export const mul: any; +/** + * Returns the division of two or more value. + * + * @tsl + * @function + * @param {Node} a - The first input. + * @param {Node} b - The second input. + * @param {...Node} params - Additional input parameters. + * @returns {OperatorNode} + */ +export const div: any; +/** + * Computes the remainder of dividing the first node by the second one. + * + * @tsl + * @function + * @param {Node} a - The first input. + * @param {Node} b - The second input. + * @returns {OperatorNode} + */ +export const mod: any; +/** + * Checks if two nodes are equal. + * + * @tsl + * @function + * @param {Node} a - The first input. + * @param {Node} b - The second input. + * @returns {OperatorNode} + */ +export const equal: any; +/** + * Checks if two nodes are not equal. + * + * @tsl + * @function + * @param {Node} a - The first input. + * @param {Node} b - The second input. + * @returns {OperatorNode} + */ +export const notEqual: any; +/** + * Checks if the first node is less than the second. + * + * @tsl + * @function + * @param {Node} a - The first input. + * @param {Node} b - The second input. + * @returns {OperatorNode} + */ +export const lessThan: any; +/** + * Checks if the first node is greater than the second. + * + * @tsl + * @function + * @param {Node} a - The first input. + * @param {Node} b - The second input. + * @returns {OperatorNode} + */ +export const greaterThan: any; +/** + * Checks if the first node is less than or equal to the second. + * + * @tsl + * @function + * @param {Node} a - The first input. + * @param {Node} b - The second input. + * @returns {OperatorNode} + */ +export const lessThanEqual: any; +/** + * Checks if the first node is greater than or equal to the second. + * + * @tsl + * @function + * @param {Node} a - The first input. + * @param {Node} b - The second input. + * @returns {OperatorNode} + */ +export const greaterThanEqual: any; +/** + * Performs a logical AND operation on multiple nodes. + * + * @tsl + * @function + * @param {...Node} nodes - The input nodes to be combined using AND. + * @returns {OperatorNode} + */ +export const and: any; +/** + * Performs a logical OR operation on multiple nodes. + * + * @tsl + * @function + * @param {...Node} nodes - The input nodes to be combined using OR. + * @returns {OperatorNode} + */ +export const or: any; +/** + * Performs logical NOT on a node. + * + * @tsl + * @function + * @param {Node} value - The value. + * @returns {OperatorNode} + */ +export const not: any; +/** + * Performs logical XOR on two nodes. + * + * @tsl + * @function + * @param {Node} a - The first input. + * @param {Node} b - The second input. + * @returns {OperatorNode} + */ +export const xor: any; +/** + * Performs bitwise AND on two nodes. + * + * @tsl + * @function + * @param {Node} a - The first input. + * @param {Node} b - The second input. + * @returns {OperatorNode} + */ +export const bitAnd: any; +/** + * Performs bitwise NOT on a node. + * + * @tsl + * @function + * @param {Node} a - The first input. + * @param {Node} b - The second input. + * @returns {OperatorNode} + */ +export const bitNot: any; +/** + * Performs bitwise OR on two nodes. + * + * @tsl + * @function + * @param {Node} a - The first input. + * @param {Node} b - The second input. + * @returns {OperatorNode} + */ +export const bitOr: any; +/** + * Performs bitwise XOR on two nodes. + * + * @tsl + * @function + * @param {Node} a - The first input. + * @param {Node} b - The second input. + * @returns {OperatorNode} + */ +export const bitXor: any; +/** + * Shifts a node to the left. + * + * @tsl + * @function + * @param {Node} a - The node to shift. + * @param {Node} b - The value to shift. + * @returns {OperatorNode} + */ +export const shiftLeft: any; +/** + * Shifts a node to the right. + * + * @tsl + * @function + * @param {Node} a - The node to shift. + * @param {Node} b - The value to shift. + * @returns {OperatorNode} + */ +export const shiftRight: any; +/** + * Increments a node by 1. + * + * @tsl + * @function + * @param {Node} a - The node to increment. + * @returns {OperatorNode} + */ +export const incrementBefore: () => void; +/** + * Decrements a node by 1. + * + * @tsl + * @function + * @param {Node} a - The node to decrement. + * @returns {OperatorNode} + */ +export const decrementBefore: () => void; +/** + * Increments a node by 1 and returns the previous value. + * + * @tsl + * @function + * @param {Node} a - The node to increment. + * @returns {OperatorNode} + */ +export const increment: () => void; +/** + * Decrements a node by 1 and returns the previous value. + * + * @tsl + * @function + * @param {Node} a - The node to decrement. + * @returns {OperatorNode} + */ +export const decrement: () => void; +export function modInt(a: Node, b: Node): OperatorNode; +/** + * This node represents basic mathematical and logical operations like addition, + * subtraction or comparisons (e.g. `equal()`). + * + * @augments TempNode + */ +declare class OperatorNode extends TempNode { + /** + * Constructs a new operator node. + * + * @param {string} op - The operator. + * @param {Node} aNode - The first input. + * @param {Node} bNode - The second input. + * @param {...Node} params - Additional input parameters. + */ + constructor(op: string, aNode: Node, bNode: Node, ...params: Node[]); + /** + * The operator. + * + * @type {string} + */ + op: string; + /** + * The first input. + * + * @type {Node} + */ + aNode: Node; + /** + * The second input. + * + * @type {Node} + */ + bNode: Node; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isOperatorNode: boolean; + /** + * Returns the operator method name. + * + * @param {NodeBuilder} builder - The current node builder. + * @param {string} output - The output type. + * @returns {string} The operator method name. + */ + getOperatorMethod(builder: NodeBuilder, output: string): string; + /** + * This method is overwritten since the node type is inferred from the operator + * and the input node types. + * + * @param {NodeBuilder} builder - The current node builder. + * @param {?string} [output=null] - The output type. + * @return {string} The node type. + */ + generateNodeType(builder: NodeBuilder, output?: string | null): string; + generate(builder: any, output: any): any; + serialize(data: any): void; + deserialize(data: any): void; +} +import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/math/PackFloatNode.d.ts b/jsdoc-testing/jsdoc/nodes/math/PackFloatNode.d.ts new file mode 100644 index 000000000..d59976ffb --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/math/PackFloatNode.d.ts @@ -0,0 +1,66 @@ +export default PackFloatNode; +/** + * Converts each component of the normalized float to 16-bit integer values. The results are packed into a single unsigned integer. + * round(clamp(c, -1, +1) * 32767.0) + * + * @tsl + * @function + * @param {Node} value - The 2-component vector to be packed + * @returns {Node} + */ +export const packSnorm2x16: any; +/** + * Converts each component of the normalized float to 16-bit integer values. The results are packed into a single unsigned integer. + * round(clamp(c, 0, +1) * 65535.0) + * + * @tsl + * @function + * @param {Node} value - The 2-component vector to be packed + * @returns {Node} + */ +export const packUnorm2x16: any; +/** + * Converts each component of the vec2 to 16-bit floating-point values. The results are packed into a single unsigned integer. + * + * @tsl + * @function + * @param {Node} value - The 2-component vector to be packed + * @returns {Node} + */ +export const packHalf2x16: any; +/** + * This node represents an operation that packs floating-point values of a vector into an unsigned 32-bit integer + * + * @augments TempNode + */ +declare class PackFloatNode extends TempNode { + /** + * + * @param {'snorm' | 'unorm' | 'float16'} encoding - The numeric encoding that describes how the float values are mapped to the integer range. + * @param {Node} vectorNode - The vector node to be packed + */ + constructor(encoding: "snorm" | "unorm" | "float16", vectorNode: Node); + /** + * The vector to be packed. + * + * @type {Node} + */ + vectorNode: Node; + /** + * The numeric encoding. + * + * @type {string} + */ + encoding: string; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isPackFloatNode: boolean; + generateNodeType(): string; + generate(builder: any): string; +} +import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/math/TriNoise3D.d.ts b/jsdoc-testing/jsdoc/nodes/math/TriNoise3D.d.ts new file mode 100644 index 000000000..15dad5e5f --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/math/TriNoise3D.d.ts @@ -0,0 +1,11 @@ +/** + * Generates a noise value from the given position, speed and time parameters. + * + * @tsl + * @function + * @param {Node} position - The position. + * @param {Node} speed - The speed. + * @param {Node} time - The time. + * @return {Node} The generated noise. + */ +export const triNoise3D: any; diff --git a/jsdoc-testing/jsdoc/nodes/math/UnpackFloatNode.d.ts b/jsdoc-testing/jsdoc/nodes/math/UnpackFloatNode.d.ts new file mode 100644 index 000000000..9a47ed9e4 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/math/UnpackFloatNode.d.ts @@ -0,0 +1,64 @@ +export default UnpackFloatNode; +/** + * Unpacks a 32-bit unsigned integer into two 16-bit values, interpreted as normalized signed integers. Returns a vec2 with both values. + * + * @tsl + * @function + * @param {Node} value - The unsigned integer to be unpacked + * @returns {Node} + */ +export const unpackSnorm2x16: any; +/** + * Unpacks a 32-bit unsigned integer into two 16-bit values, interpreted as normalized unsigned integers. Returns a vec2 with both values. + * + * @tsl + * @function + * @param {Node} value - The unsigned integer to be unpacked + * @returns {Node} + */ +export const unpackUnorm2x16: any; +/** + * Unpacks a 32-bit unsigned integer into two 16-bit values, interpreted as 16-bit floating-point numbers. Returns a vec2 with both values. + * + * @tsl + * @function + * @param {Node} value - The unsigned integer to be unpacked + * @returns {Node} + */ +export const unpackHalf2x16: any; +/** + * This node represents an operation that unpacks values from a 32-bit unsigned integer, reinterpreting the results as a floating-point vector + * + * @augments TempNode + */ +declare class UnpackFloatNode extends TempNode { + /** + * + * @param {'snorm' | 'unorm' | 'float16'} encoding - The numeric encoding that describes how the integer values are mapped to the float range + * @param {Node} uintNode - The uint node to be unpacked + */ + constructor(encoding: "snorm" | "unorm" | "float16", uintNode: Node); + /** + * The unsigned integer to be unpacked. + * + * @type {Node} + */ + uintNode: Node; + /** + * The numeric encoding. + * + * @type {string} + */ + encoding: string; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isUnpackFloatNode: boolean; + generateNodeType(): string; + generate(builder: any): string; +} +import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/parsers/GLSLNodeFunction.d.ts b/jsdoc-testing/jsdoc/nodes/parsers/GLSLNodeFunction.d.ts new file mode 100644 index 000000000..3b3ed5efe --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/parsers/GLSLNodeFunction.d.ts @@ -0,0 +1,25 @@ +export default GLSLNodeFunction; +/** + * This class represents a GLSL node function. + * + * @augments NodeFunction + */ +declare class GLSLNodeFunction extends NodeFunction { + /** + * Constructs a new GLSL node function. + * + * @param {string} source - The GLSL source. + */ + constructor(source: string); + inputsCode: any; + blockCode: any; + headerCode: any; + /** + * This method returns the GLSL code of the node function. + * + * @param {string} [name=this.name] - The function's name. + * @return {string} The shader code. + */ + getCode(name?: string): string; +} +import NodeFunction from '../core/NodeFunction.js'; diff --git a/jsdoc-testing/jsdoc/nodes/parsers/GLSLNodeParser.d.ts b/jsdoc-testing/jsdoc/nodes/parsers/GLSLNodeParser.d.ts new file mode 100644 index 000000000..4219e9d0e --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/parsers/GLSLNodeParser.d.ts @@ -0,0 +1,17 @@ +export default GLSLNodeParser; +/** + * A GLSL node parser. + * + * @augments NodeParser + */ +declare class GLSLNodeParser extends NodeParser { + /** + * The method parses the given GLSL code an returns a node function. + * + * @param {string} source - The GLSL code. + * @return {GLSLNodeFunction} A node function. + */ + parseFunction(source: string): GLSLNodeFunction; +} +import NodeParser from '../core/NodeParser.js'; +import GLSLNodeFunction from './GLSLNodeFunction.js'; diff --git a/jsdoc-testing/jsdoc/nodes/pmrem/PMREMNode.d.ts b/jsdoc-testing/jsdoc/nodes/pmrem/PMREMNode.d.ts new file mode 100644 index 000000000..0ddba7546 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/pmrem/PMREMNode.d.ts @@ -0,0 +1,113 @@ +export default PMREMNode; +/** + * TSL function for creating a PMREM node. + * + * @tsl + * @function + * @param {Texture} value - The input texture. + * @param {?Node} [uvNode=null] - The uv node. + * @param {?Node} [levelNode=null] - The level node. + * @returns {PMREMNode} + */ +export const pmremTexture: any; +/** + * This node represents a PMREM which is a special type of preprocessed + * environment map intended for PBR materials. + * + * ```js + * const material = new MeshStandardNodeMaterial(); + * material.envNode = pmremTexture( envMap ); + * ``` + * + * @augments TempNode + */ +declare class PMREMNode extends TempNode { + /** + * Constructs a new function overloading node. + * + * @param {Texture} value - The input texture. + * @param {Node} [uvNode=null] - The uv node. + * @param {Node} [levelNode=null] - The level node. + */ + constructor(value: Texture, uvNode?: Node, levelNode?: Node); + /** + * Reference to the input texture. + * + * @private + * @type {Texture} + */ + private _value; + /** + * Reference to the generated PMREM. + * + * @private + * @type {Texture | null} + * @default null + */ + private _pmrem; + /** + * The uv node. + * + * @type {Node} + */ + uvNode: Node; + /** + * The level node. + * + * @type {Node} + */ + levelNode: Node; + /** + * Reference to a PMREM generator. + * + * @private + * @type {?PMREMGenerator} + * @default null + */ + private _generator; + /** + * The texture node holding the generated PMREM. + * + * @private + * @type {TextureNode} + */ + private _texture; + /** + * A uniform representing the PMREM's width. + * + * @private + * @type {UniformNode} + */ + private _width; + /** + * A uniform representing the PMREM's height. + * + * @private + * @type {UniformNode} + */ + private _height; + /** + * A uniform representing the PMREM's max Mip. + * + * @private + * @type {UniformNode} + */ + private _maxMip; + set value(value: Texture); + /** + * The node's texture value. + * + * @type {Texture} + */ + get value(): Texture; + /** + * Uses the given PMREM texture to update internal values. + * + * @param {Texture} texture - The PMREM texture. + */ + updateFromTexture(texture: Texture): void; + updateBefore(frame: any): void; + setup(builder: any): void; +} +import TempNode from '../core/TempNode.js'; +import { Texture } from '../../textures/Texture.js'; diff --git a/jsdoc-testing/jsdoc/nodes/pmrem/PMREMUtils.d.ts b/jsdoc-testing/jsdoc/nodes/pmrem/PMREMUtils.d.ts new file mode 100644 index 000000000..8c287ef83 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/pmrem/PMREMUtils.d.ts @@ -0,0 +1,4 @@ +export const getDirection: any; +export const textureCubeUV: () => void; +export const blur: () => void; +export const ggxConvolution: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/procedural/Checker.d.ts b/jsdoc-testing/jsdoc/nodes/procedural/Checker.d.ts new file mode 100644 index 000000000..622cf3968 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/procedural/Checker.d.ts @@ -0,0 +1,9 @@ +/** + * Creates a 2x2 checkerboard pattern that can be used as procedural texture data. + * + * @tsl + * @function + * @param {Node} coord - The uv coordinates. + * @return {Node} The result data. + */ +export const checker: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/shapes/Shapes.d.ts b/jsdoc-testing/jsdoc/nodes/shapes/Shapes.d.ts new file mode 100644 index 000000000..0777cf76d --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/shapes/Shapes.d.ts @@ -0,0 +1,9 @@ +/** + * Generates a circle based on the uv coordinates. + * + * @tsl + * @function + * @param {Node} coord - The uv to generate the circle. + * @return {Node} The circle shape. + */ +export const shapeCircle: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/tsl/TSLBase.d.ts b/jsdoc-testing/jsdoc/nodes/tsl/TSLBase.d.ts new file mode 100644 index 000000000..cbad0a788 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/tsl/TSLBase.d.ts @@ -0,0 +1,26 @@ +export function addNodeElement(name: any): void; +export * from "./TSLCore.js"; +export * from "../core/ArrayNode.js"; +export * from "../core/UniformNode.js"; +export * from "../core/PropertyNode.js"; +export * from "../core/AssignNode.js"; +export * from "../code/FunctionCallNode.js"; +export * from "../math/OperatorNode.js"; +export * from "../math/MathNode.js"; +export * from "../math/ConditionalNode.js"; +export * from "../core/ContextNode.js"; +export * from "../core/VarNode.js"; +export * from "../core/VaryingNode.js"; +export * from "../display/ColorSpaceNode.js"; +export * from "../display/ToneMappingNode.js"; +export * from "../accessors/BufferAttributeNode.js"; +export * from "../gpgpu/ComputeNode.js"; +export * from "../core/IsolateNode.js"; +export * from "../core/BypassNode.js"; +export * from "../utils/Remap.js"; +export * from "../code/ExpressionNode.js"; +export * from "../utils/Discard.js"; +export * from "../display/RenderOutputNode.js"; +export * from "../utils/DebugNode.js"; +export * from "../core/SubBuildNode.js"; +export * from "../core/InspectorNode.js"; diff --git a/jsdoc-testing/jsdoc/nodes/tsl/TSLCore.d.ts b/jsdoc-testing/jsdoc/nodes/tsl/TSLCore.d.ts new file mode 100644 index 000000000..f9935cf11 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/tsl/TSLCore.d.ts @@ -0,0 +1,77 @@ +export function addMethodChaining(name: any, nodeElement: any): void; +export function defined(value: any): boolean; +export function ShaderNode(jsFunc: any, nodeType: any): ShaderNodeInternal; +export function Fn(jsFunc: any, layout?: null): () => void; +/** + * Add the given node to the current stack. + * + * @param {Node} node - The node to add. + * @returns {Node} The node that was added to the stack. + */ +export function Stack(node: Node): Node; +export function getConstNodeType(value: any): any; +export function nodeObject(val: any, altType?: null): any; +export function nodeObjectIntent(val: any, altType?: null): any; +export function nodeObjects(val: any, altType?: null): any; +export function nodeArray(val: any, altType?: null): any; +export function nodeProxy(NodeClass: any, scope?: null, factor?: null, settings?: null): any; +export function nodeImmutable(NodeClass: any, ...params: any[]): any; +export function nodeProxyIntent(NodeClass: any, scope?: null, factor?: null, settings?: {}): any; +export function setCurrentStack(stack: any): void; +export function getCurrentStack(): any; +export function If(...params: any[]): StackNode; +export function Switch(...params: any[]): StackNode; +export const color: any; +export const float: any; +export const int: any; +export const uint: any; +export const bool: any; +export const vec2: any; +export const ivec2: any; +export const uvec2: any; +export const bvec2: any; +export const vec3: any; +export const ivec3: any; +export const uvec3: any; +export const bvec3: any; +export const vec4: any; +export const ivec4: any; +export const uvec4: any; +export const bvec4: any; +export const mat2: any; +export const mat3: any; +export const mat4: any; +export function string(value?: string): ConstNode; +export function arrayBuffer(value: any): ConstNode; +export const element: any; +export function convert(node: any, types: any): ConvertNode; +export function split(node: any, channels: any): SplitNode; +export function append(node: Node): Function; +declare class ShaderNodeInternal extends Node { + constructor(jsFunc: any, nodeType: any); + jsFunc: any; + layout: any; + once: boolean; + setLayout(layout: any): this; + getLayout(): any; + call(rawInputs?: null): ShaderCallNodeInternal; + setup(): ShaderCallNodeInternal; +} +import Node from '../core/Node.js'; +import ConstNode from '../core/ConstNode.js'; +import ConvertNode from '../utils/ConvertNode.js'; +import SplitNode from '../utils/SplitNode.js'; +declare class ShaderCallNodeInternal extends Node { + constructor(shaderNode: any, rawInputs: any); + shaderNode: any; + rawInputs: any; + isShaderCallNodeInternal: boolean; + generateNodeType(builder: any): any; + getElementType(builder: any): any; + getMemberType(builder: any, name: any): any; + call(builder: any): any; + setupOutput(builder: any): any; + getOutputNode(builder: any): any; + build(builder: any, output?: null): any; +} +export {}; diff --git a/jsdoc-testing/jsdoc/nodes/utils/ArrayElementNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/ArrayElementNode.d.ts new file mode 100644 index 000000000..e5669d2f2 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/utils/ArrayElementNode.d.ts @@ -0,0 +1,53 @@ +export default ArrayElementNode; +/** + * Base class for representing element access on an array-like + * node data structures. + * + * @augments Node + */ +declare class ArrayElementNode extends Node { + /** + * Constructs an array element node. + * + * @param {Node} node - The array-like node. + * @param {Node} indexNode - The index node that defines the element access. + */ + constructor(node: Node, indexNode: Node); + /** + * The array-like node. + * + * @type {Node} + */ + node: Node; + /** + * The index node that defines the element access. + * + * @type {Node} + */ + indexNode: Node; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isArrayElementNode: boolean; + /** + * This method is overwritten since the node type is inferred from the array-like node. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The node type. + */ + generateNodeType(builder: NodeBuilder): string; + /** + * This method is overwritten since the member type is inferred from the array-like node. + * + * @param {NodeBuilder} builder - The current node builder. + * @param {string} name - The member name. + * @return {string} The member type. + */ + getMemberType(builder: NodeBuilder, name: string): string; + generate(builder: any): string; +} +import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/ConvertNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/ConvertNode.d.ts new file mode 100644 index 000000000..77f0ea2f7 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/utils/ConvertNode.d.ts @@ -0,0 +1,41 @@ +export default ConvertNode; +/** + * This module is part of the TSL core and usually not used in app level code. + * It represents a convert operation during the shader generation process + * meaning it converts the data type of a node to a target data type. + * + * @augments Node + */ +declare class ConvertNode extends Node { + /** + * Constructs a new convert node. + * + * @param {Node} node - The node which type should be converted. + * @param {string} convertTo - The target node type. Multiple types can be defined by separating them with a `|` sign. + */ + constructor(node: Node, convertTo: string); + /** + * The node which type should be converted. + * + * @type {Node} + */ + node: Node; + /** + * The target node type. Multiple types can be defined by separating them with a `|` sign. + * + * @type {string} + */ + convertTo: string; + /** + * This method is overwritten since the implementation tries to infer the best + * matching type from the {@link ConvertNode#convertTo} property. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The node type. + */ + generateNodeType(builder: NodeBuilder): string; + serialize(data: any): void; + deserialize(data: any): void; + generate(builder: any, output: any): any; +} +import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/CubeMapNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/CubeMapNode.d.ts new file mode 100644 index 000000000..a24a72427 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/utils/CubeMapNode.d.ts @@ -0,0 +1,57 @@ +export default CubeMapNode; +/** + * TSL function for creating a cube map node. + * + * @tsl + * @function + * @param {Node} envNode - The node representing the environment map. + * @returns {CubeMapNode} + */ +export const cubeMapNode: any; +/** + * This node can be used to automatically convert environment maps in the + * equirectangular format into the cube map format. + * + * @augments TempNode + */ +declare class CubeMapNode extends TempNode { + /** + * Constructs a new cube map node. + * + * @param {Node} envNode - The node representing the environment map. + */ + constructor(envNode: Node); + /** + * The node representing the environment map. + * + * @type {Node} + */ + envNode: Node; + /** + * A reference to the internal cube texture. + * + * @private + * @type {?CubeTexture} + * @default null + */ + private _cubeTexture; + /** + * A reference to the internal cube texture node. + * + * @private + * @type {CubeTextureNode} + */ + private _cubeTextureNode; + /** + * A default cube texture that acts as a placeholder. + * It is used when the conversion from equirectangular to cube + * map has not finished yet for a given texture. + * + * @private + * @type {CubeTexture} + */ + private _defaultTexture; + updateBefore(frame: any): void; + setup(builder: any): CubeTextureNode; +} +import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/DebugNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/DebugNode.d.ts new file mode 100644 index 000000000..526033e08 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/utils/DebugNode.d.ts @@ -0,0 +1,12 @@ +export default DebugNode; +export function debug(node: Node, callback?: Function | null): DebugNode; +declare class DebugNode extends TempNode { + constructor(node: any, callback?: null); + node: any; + callback: any; + generateNodeType(builder: any): any; + setup(builder: any): any; + analyze(builder: any): any; + generate(builder: any): any; +} +import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/Discard.d.ts b/jsdoc-testing/jsdoc/nodes/utils/Discard.d.ts new file mode 100644 index 000000000..2d21a4048 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/utils/Discard.d.ts @@ -0,0 +1,2 @@ +export function Discard(conditional: ConditionalNode | null): Node; +export function Return(): ExpressionNode; diff --git a/jsdoc-testing/jsdoc/nodes/utils/EquirectUV.d.ts b/jsdoc-testing/jsdoc/nodes/utils/EquirectUV.d.ts new file mode 100644 index 000000000..a3e78acf6 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/utils/EquirectUV.d.ts @@ -0,0 +1,17 @@ +/** + * TSL function for creating an equirect uv node. + * + * Can be used to compute texture coordinates for projecting an + * equirectangular texture onto a mesh for using it as the scene's + * background. + * + * ```js + * scene.backgroundNode = texture( equirectTexture, equirectUV() ); + * ``` + * + * @tsl + * @function + * @param {?Node} [dirNode=positionWorldDirection] - A direction vector for sampling which is by default `positionWorldDirection`. + * @returns {Node} + */ +export const equirectUV: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/utils/EventNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/EventNode.d.ts new file mode 100644 index 000000000..e0330e7a6 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/utils/EventNode.d.ts @@ -0,0 +1,30 @@ +export default EventNode; +export function OnObjectUpdate(callback: Function): EventNode; +export function OnMaterialUpdate(callback: Function): EventNode; +export function OnBeforeObjectUpdate(callback: Function): EventNode; +export function OnBeforeMaterialUpdate(callback: Function): EventNode; +/** + * EventNode is a node that executes a callback during specific update phases. + * + * @augments Node + */ +declare class EventNode extends Node { + /** + * Creates an EventNode. + * + * @param {string} eventType - The type of event + * @param {Function} callback - The callback to execute on update. + */ + constructor(eventType: string, callback: Function); + eventType: string; + callback: Function; + update(frame: any): void; + updateBefore(frame: any): void; +} +declare namespace EventNode { + let OBJECT: string; + let MATERIAL: string; + let BEFORE_OBJECT: string; + let BEFORE_MATERIAL: string; +} +import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/FlipNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/FlipNode.d.ts new file mode 100644 index 000000000..15e36f325 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/utils/FlipNode.d.ts @@ -0,0 +1,46 @@ +export default FlipNode; +/** + * This module is part of the TSL core and usually not used in app level code. + * It represents a flip operation during the shader generation process + * meaning it flips normalized values with the following formula: + * ``` + * x = 1 - x; + * ``` + * `FlipNode` is internally used to implement any `flipXYZW()`, `flipRGBA()` and + * `flipSTPQ()` method invocations on node objects. For example: + * ```js + * uvNode = uvNode.flipY(); + * ``` + * + * @augments TempNode + */ +declare class FlipNode extends TempNode { + /** + * Constructs a new flip node. + * + * @param {Node} sourceNode - The node which component(s) should be flipped. + * @param {string} components - The components that should be flipped e.g. `'x'` or `'xy'`. + */ + constructor(sourceNode: Node, components: string); + /** + * The node which component(s) should be flipped. + * + * @type {Node} + */ + sourceNode: Node; + /** + * The components that should be flipped e.g. `'x'` or `'xy'`. + * + * @type {string} + */ + components: string; + /** + * This method is overwritten since the node type is inferred from the source node. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The node type. + */ + generateNodeType(builder: NodeBuilder): string; + generate(builder: any): string; +} +import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/FunctionOverloadingNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/FunctionOverloadingNode.d.ts new file mode 100644 index 000000000..765ca535c --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/utils/FunctionOverloadingNode.d.ts @@ -0,0 +1,60 @@ +export default FunctionOverloadingNode; +export function overloadingFn(functionNodes: Array): FunctionOverloadingNode; +/** + * This class allows to define multiple overloaded versions + * of the same function. Depending on the parameters of the function + * call, the node picks the best-fit overloaded version. + * + * @augments Node + */ +declare class FunctionOverloadingNode extends Node { + /** + * Constructs a new function overloading node. + * + * @param {Array} functionNodes - Array of `Fn` function definitions. + * @param {...Node} parametersNodes - A list of parameter nodes. + */ + constructor(functionNodes?: Array, ...parametersNodes: Node[]); + /** + * Array of `Fn` function definitions. + * + * @type {Array} + */ + functionNodes: Array; + /** + * A list of parameter nodes. + * + * @type {Array} + */ + parametersNodes: Array; + /** + * The selected overloaded function call. + * + * @private + * @type {ShaderCallNodeInternal} + */ + private _candidateFn; + /** + * This method is overwritten since the node type is inferred from + * the function's return type. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The node type. + */ + generateNodeType(builder: NodeBuilder): string; + /** + * Returns the candidate function for the current parameters. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {FunctionNode} The candidate function. + */ + getCandidateFn(builder: NodeBuilder): FunctionNode; + /** + * Sets up the node for the current parameters. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {Node} The setup node. + */ + setup(builder: NodeBuilder): Node; +} +import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/JoinNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/JoinNode.d.ts new file mode 100644 index 000000000..70dfe5537 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/utils/JoinNode.d.ts @@ -0,0 +1,33 @@ +export default JoinNode; +/** + * This module is part of the TSL core and usually not used in app level code. + * It represents a join operation during the shader generation process. + * For example in can compose/join two single floats into a `vec2` type. + * + * @augments TempNode + */ +declare class JoinNode extends TempNode { + /** + * Constructs a new join node. + * + * @param {Array} nodes - An array of nodes that should be joined. + * @param {?string} [nodeType=null] - The node type. + */ + constructor(nodes?: Array, nodeType?: string | null); + /** + * An array of nodes that should be joined. + * + * @type {Array} + */ + nodes: Array; + /** + * This method is overwritten since the node type must be inferred from the + * joined data length if not explicitly defined. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The node type. + */ + generateNodeType(builder: NodeBuilder): string; + generate(builder: any, output: any): any; +} +import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/LoopNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/LoopNode.d.ts new file mode 100644 index 000000000..84ca0c5f4 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/utils/LoopNode.d.ts @@ -0,0 +1,67 @@ +export default LoopNode; +export function Loop(...params: any[]): LoopNode; +export function Continue(): ExpressionNode; +export function Break(): ExpressionNode; +/** + * This module offers a variety of ways to implement loops in TSL. In it's basic form it's: + * ```js + * Loop( count, ( { i } ) => { + * + * } ); + * ``` + * However, it is also possible to define a start and end ranges, data types and loop conditions: + * ```js + * Loop( { start: int( 0 ), end: int( 10 ), type: 'int', condition: '<' }, ( { i } ) => { + * + * } ); + *``` + * Nested loops can be defined in a compacted form: + * ```js + * Loop( 10, 5, ( { i, j } ) => { + * + * } ); + * ``` + * Loops that should run backwards can be defined like so: + * ```js + * Loop( { start: 10 }, () => {} ); + * ``` + * It is possible to execute with boolean values, similar to the `while` syntax. + * ```js + * const value = float( 0 ).toVar(); + * + * Loop( value.lessThan( 10 ), () => { + * + * value.addAssign( 1 ); + * + * } ); + * ``` + * The module also provides `Break()` and `Continue()` TSL expression for loop control. + * @augments Node + */ +declare class LoopNode extends Node { + /** + * Constructs a new loop node. + * + * @param {Array} params - Depending on the loop type, array holds different parameterization values for the loop. + */ + constructor(params?: Array); + params: any[]; + /** + * Returns a loop variable name based on an index. The pattern is + * `0` = `i`, `1`= `j`, `2`= `k` and so on. + * + * @param {number} index - The index. + * @return {string} The loop variable name. + */ + getVarName(index: number): string; + /** + * Returns properties about this node. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {Object} The node properties. + */ + getProperties(builder: NodeBuilder): Object; + setup(builder: any): void; + generate(builder: any): void; +} +import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/MatcapUV.d.ts b/jsdoc-testing/jsdoc/nodes/utils/MatcapUV.d.ts new file mode 100644 index 000000000..11ccf7d5a --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/utils/MatcapUV.d.ts @@ -0,0 +1,11 @@ +/** + * TSL function for creating a matcap uv node. + * + * Can be used to compute texture coordinates for projecting a + * matcap onto a mesh. Used by {@link MeshMatcapNodeMaterial}. + * + * @tsl + * @function + * @returns {Node} The matcap UV coordinates. + */ +export const matcapUV: any; diff --git a/jsdoc-testing/jsdoc/nodes/utils/MaxMipLevelNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/MaxMipLevelNode.d.ts new file mode 100644 index 000000000..a54346cc2 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/utils/MaxMipLevelNode.d.ts @@ -0,0 +1,51 @@ +export default MaxMipLevelNode; +/** + * TSL function for creating a max mip level node. + * + * @tsl + * @function + * @param {TextureNode} textureNode - The texture node to compute the max mip level for. + * @returns {MaxMipLevelNode} + */ +export const maxMipLevel: any; +/** + * A special type of uniform node that computes the + * maximum mipmap level for a given texture node. + * + * ```js + * const level = maxMipLevel( textureNode ); + * ``` + * + * @augments UniformNode + */ +declare class MaxMipLevelNode extends UniformNode { + /** + * Constructs a new max mip level node. + * + * @param {TextureNode} textureNode - The texture node to compute the max mip level for. + */ + constructor(textureNode: TextureNode); + /** + * The texture node to compute the max mip level for. + * + * @private + * @type {TextureNode} + */ + private _textureNode; + /** + * The texture node to compute the max mip level for. + * + * @readonly + * @type {TextureNode} + */ + readonly get textureNode(): TextureNode; + /** + * The texture. + * + * @readonly + * @type {Texture} + */ + readonly get texture(): Texture; + update(): void; +} +import UniformNode from '../core/UniformNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/MemberNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/MemberNode.d.ts new file mode 100644 index 000000000..45fabbe06 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/utils/MemberNode.d.ts @@ -0,0 +1,41 @@ +export default MemberNode; +/** + * Base class for representing member access on an object-like + * node data structures. + * + * @augments Node + */ +declare class MemberNode extends Node { + /** + * Constructs a member node. + * + * @param {Node} structNode - The struct node. + * @param {string} property - The property name. + */ + constructor(structNode: Node, property: string); + /** + * The struct node. + * + * @type {Node} + */ + structNode: Node; + /** + * The property name. + * + * @type {Node} + */ + property: Node; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isMemberNode: boolean; + hasMember(builder: any): boolean; + generateNodeType(builder: any): string; + getMemberType(builder: any, name: any): any; + generate(builder: any): any; +} +import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/Oscillators.d.ts b/jsdoc-testing/jsdoc/nodes/utils/Oscillators.d.ts new file mode 100644 index 000000000..08bd81824 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/utils/Oscillators.d.ts @@ -0,0 +1,4 @@ +export function oscSine(t?: Node): Node; +export function oscSquare(t?: Node): Node; +export function oscTriangle(t?: Node): Node; +export function oscSawtooth(t?: Node): Node; diff --git a/jsdoc-testing/jsdoc/nodes/utils/Packing.d.ts b/jsdoc-testing/jsdoc/nodes/utils/Packing.d.ts new file mode 100644 index 000000000..dcae33557 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/utils/Packing.d.ts @@ -0,0 +1,3 @@ +export function directionToColor(node: Node): Node; +export function colorToDirection(node: Node): Node; +export function unpackNormal(xy: Node): Node; diff --git a/jsdoc-testing/jsdoc/nodes/utils/PostProcessingUtils.d.ts b/jsdoc-testing/jsdoc/nodes/utils/PostProcessingUtils.d.ts new file mode 100644 index 000000000..2e88343c5 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/utils/PostProcessingUtils.d.ts @@ -0,0 +1,66 @@ +/** + * Computes a position in view space based on a fragment's screen position expressed as uv coordinates, the fragments + * depth value and the camera's inverse projection matrix. + * + * @tsl + * @function + * @param {Node} screenPosition - The fragment's screen position expressed as uv coordinates. + * @param {Node} depth - The fragment's depth value. + * @param {Node} projectionMatrixInverse - The camera's inverse projection matrix. + * @return {Node} The fragments position in view space. + */ +export const getViewPosition: () => void; +/** + * Computes a screen position expressed as uv coordinates based on a fragment's position in view space + * and the camera's projection matrix + * + * @tsl + * @function + * @param {Node} viewPosition - The fragments position in view space. + * @param {Node} projectionMatrix - The camera's projection matrix. + * @return {Node} The fragment's screen position expressed as uv coordinates. + */ +export const getScreenPosition: () => void; +/** + * Computes a normal vector based on depth data. Can be used as a fallback when no normal render + * target is available or if flat surface normals are required. + * + * @tsl + * @function + * @param {Node} uv - The texture coordinate. + * @param {DepthTexture} depthTexture - The depth texture. + * @param {Node} projectionMatrixInverse - The camera's inverse projection matrix. + * @return {Node} The computed normal vector. + */ +export const getNormalFromDepth: () => void; +/** + * Interleaved Gradient Noise (IGN) from Jimenez 2014. + * + * IGN has "low discrepancy" resulting in evenly distributed samples. It's superior compared to + * default white noise, blue noise or Bayer. + * + * References: + * - {@link https://www.iryoku.com/next-generation-post-processing-in-call-of-duty-advanced-warfare/} + * - {@link https://blog.demofox.org/2022/01/01/interleaved-gradient-noise-a-different-kind-of-low-discrepancy-sequence/} + * + * @tsl + * @function + * @param {Node} position - The input position, usually screen coordinates. + * @return {Node} The noise value. + */ +export const interleavedGradientNoise: any; +/** + * Vogel disk sampling for uniform circular distribution. + * + * This function generates sample points distributed uniformly on a disk using the golden angle, + * resulting in an efficient low-discrepancy sequence for sampling. The rotation parameter (phi) + * allows randomizing the pattern per-pixel when combined with IGN. + * + * @tsl + * @function + * @param {Node} sampleIndex - The index of the current sample (0-based). + * @param {Node} samplesCount - The total number of samples. + * @param {Node} phi - Rotation angle in radians (typically from IGN * 2π). + * @return {Node} A 2D point on the unit disk. + */ +export const vogelDiskSample: any; diff --git a/jsdoc-testing/jsdoc/nodes/utils/RTTNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/RTTNode.d.ts new file mode 100644 index 000000000..ed96e2902 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/utils/RTTNode.d.ts @@ -0,0 +1,120 @@ +export default RTTNode; +export function rtt(node: Node, ...params: any[]): RTTNode; +export function convertToTexture(node: Node, ...params: any[]): RTTNode; +/** + * `RTTNode` takes another node and uses it with a `QuadMesh` to render into a texture (RTT). + * This module is especially relevant in context of post processing where certain nodes require + * texture input for their effects. With the helper function `convertToTexture()` which is based + * on this module, the node system can automatically ensure texture input if required. + * + * @augments TextureNode + */ +declare class RTTNode extends TextureNode { + /** + * Constructs a new RTT node. + * + * @param {Node} node - The node to render a texture with. + * @param {?number} [width=null] - The width of the internal render target. If not width is applied, the render target is automatically resized. + * @param {?number} [height=null] - The height of the internal render target. + * @param {Object} [options={type:HalfFloatType}] - The options for the internal render target. + */ + constructor(node: Node, width?: number | null, height?: number | null, options?: Object); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isRTTNode: boolean; + /** + * The node to render a texture with. + * + * @type {Node} + */ + node: Node; + /** + * The width of the internal render target. + * If not width is applied, the render target is automatically resized. + * + * @type {?number} + * @default null + */ + width: number | null; + /** + * The height of the internal render target. + * + * @type {?number} + * @default null + */ + height: number | null; + /** + * The pixel ratio + * + * @type {number} + * @default 1 + */ + pixelRatio: number; + /** + * The render target + * + * @type {RenderTarget} + */ + renderTarget: RenderTarget; + /** + * Whether the texture requires an update or not. + * + * @type {boolean} + * @default true + */ + textureNeedsUpdate: boolean; + /** + * Whether the texture should automatically be updated or not. + * + * @type {boolean} + * @default true + */ + autoUpdate: boolean; + /** + * The node which is used with the quad mesh for RTT. + * + * @private + * @type {Node} + * @default null + */ + private _rttNode; + /** + * The internal quad mesh for RTT. + * + * @private + * @type {QuadMesh} + */ + private _quadMesh; + /** + * Whether the internal render target should automatically be resized or not. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly get autoResize(): boolean; + setup(builder: any): void; + /** + * Sets the size of the internal render target + * + * @param {number} width - The width to set. + * @param {number} height - The width to set. + */ + setSize(width: number, height: number): void; + /** + * Sets the pixel ratio. This will also resize the render target. + * + * @param {number} pixelRatio - The pixel ratio to set. + */ + setPixelRatio(pixelRatio: number): void; + updateBefore({ renderer }: { + renderer: any; + }): void; +} +import TextureNode from '../accessors/TextureNode.js'; +import { RenderTarget } from '../../core/RenderTarget.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/ReflectorNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/ReflectorNode.d.ts new file mode 100644 index 000000000..0ea38a3c6 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/utils/ReflectorNode.d.ts @@ -0,0 +1,233 @@ +export function reflector(parameters?: { + target?: Object3D | undefined; + resolution?: number | undefined; + generateMipmaps?: boolean | undefined; + bounces?: boolean | undefined; + depth?: boolean | undefined; + samples?: number | undefined; + defaultTexture?: TextureNode | undefined; + reflector?: ReflectorBaseNode | undefined; +}): ReflectorNode; +export default ReflectorNode; +import { Object3D } from '../../core/Object3D.js'; +import TextureNode from '../accessors/TextureNode.js'; +/** + * Holds the actual implementation of the reflector. + * + * TODO: Explain why `ReflectorBaseNode`. Originally the entire logic was implemented + * in `ReflectorNode`, see #29619. + * + * @private + * @augments Node + */ +declare class ReflectorBaseNode extends Node { + /** + * Constructs a new reflector base node. + * + * @param {TextureNode} textureNode - Represents the rendered reflections as a texture node. + * @param {Object} [parameters={}] - An object holding configuration parameters. + * @param {Object3D} [parameters.target=new Object3D()] - The 3D object the reflector is linked to. + * @param {number} [parameters.resolutionScale=1] - The resolution scale. + * @param {boolean} [parameters.generateMipmaps=false] - Whether mipmaps should be generated or not. + * @param {boolean} [parameters.bounces=true] - Whether reflectors can render other reflector nodes or not. + * @param {boolean} [parameters.depth=false] - Whether depth data should be generated or not. + * @param {number} [parameters.samples] - Anti-Aliasing samples of the internal render-target. + */ + constructor(textureNode: TextureNode, parameters?: { + target?: Object3D | undefined; + resolutionScale?: number | undefined; + generateMipmaps?: boolean | undefined; + bounces?: boolean | undefined; + depth?: boolean | undefined; + samples?: number | undefined; + }); + /** + * Represents the rendered reflections as a texture node. + * + * @type {TextureNode} + */ + textureNode: TextureNode; + /** + * The 3D object the reflector is linked to. + * + * @type {Object3D} + * @default {new Object3D()} + */ + target: Object3D; + /** + * The resolution scale. + * + * @type {number} + * @default {1} + */ + resolutionScale: number; + /** + * Whether mipmaps should be generated or not. + * + * @type {boolean} + * @default {false} + */ + generateMipmaps: boolean; + /** + * Whether reflectors can render other reflector nodes or not. + * + * @type {boolean} + * @default {true} + */ + bounces: boolean; + /** + * Whether depth data should be generated or not. + * + * @type {boolean} + * @default {false} + */ + depth: boolean; + /** + * The number of anti-aliasing samples for the render-target + * + * @type {number} + * @default {0} + */ + samples: number; + /** + * Weak map for managing virtual cameras. + * + * @type {WeakMap} + */ + virtualCameras: WeakMap; + /** + * Weak map for managing render targets. + * + * @type {Map} + */ + renderTargets: Map; + /** + * Force render even if reflector is facing away from camera. + * + * @type {boolean} + * @default {false} + */ + forceUpdate: boolean; + /** + * Whether the reflector has been rendered or not. + * + * When the reflector is facing away from the camera, + * this flag is set to `false` and the texture will be empty(black). + * + * @type {boolean} + * @default {false} + */ + hasOutput: boolean; + /** + * Updates the resolution of the internal render target. + * + * @private + * @param {RenderTarget} renderTarget - The render target to resize. + * @param {Renderer} renderer - The renderer that is used to determine the new size. + */ + private _updateResolution; + setup(builder: any): Node | null; + /** + * Returns a virtual camera for the given camera. The virtual camera is used to + * render the scene from the reflector's view so correct reflections can be produced. + * + * @param {Camera} camera - The scene's camera. + * @return {Camera} The corresponding virtual camera. + */ + getVirtualCamera(camera: Camera): Camera; + /** + * Returns a render target for the given camera. The reflections are rendered + * into this render target. + * + * @param {Camera} camera - The scene's camera. + * @return {RenderTarget} The render target. + */ + getRenderTarget(camera: Camera): RenderTarget; + updateBefore(frame: any): false | undefined; + set resolution(value: number); + /** + * The resolution scale. + * + * @deprecated + * @type {number} + * @default {1} + */ + get resolution(): number; +} +/** + * This node can be used to implement mirror-like flat reflective surfaces. + * + * ```js + * const groundReflector = reflector(); + * material.colorNode = groundReflector; + * + * const plane = new Mesh( geometry, material ); + * plane.add( groundReflector.target ); + * ``` + * + * @augments TextureNode + */ +declare class ReflectorNode extends TextureNode { + /** + * Constructs a new reflector node. + * + * @param {Object} [parameters={}] - An object holding configuration parameters. + * @param {Object3D} [parameters.target=new Object3D()] - The 3D object the reflector is linked to. + * @param {number} [parameters.resolutionScale=1] - The resolution scale. + * @param {boolean} [parameters.generateMipmaps=false] - Whether mipmaps should be generated or not. + * @param {boolean} [parameters.bounces=true] - Whether reflectors can render other reflector nodes or not. + * @param {boolean} [parameters.depth=false] - Whether depth data should be generated or not. + * @param {number} [parameters.samples] - Anti-Aliasing samples of the internal render-target. + * @param {TextureNode} [parameters.defaultTexture] - The default texture node. + * @param {ReflectorBaseNode} [parameters.reflector] - The reflector base node. + */ + constructor(parameters?: { + target?: Object3D | undefined; + resolutionScale?: number | undefined; + generateMipmaps?: boolean | undefined; + bounces?: boolean | undefined; + depth?: boolean | undefined; + samples?: number | undefined; + defaultTexture?: TextureNode | undefined; + reflector?: ReflectorBaseNode | undefined; + }); + /** + * A reference to the internal reflector base node which holds the actual implementation. + * + * @private + * @type {ReflectorBaseNode} + * @default ReflectorBaseNode + */ + private _reflectorBaseNode; + /** + * A reference to the internal depth node. + * + * @private + * @type {?Node} + * @default null + */ + private _depthNode; + /** + * A reference to the internal reflector node. + * + * @type {ReflectorBaseNode} + */ + get reflector(): ReflectorBaseNode; + /** + * A reference to 3D object the reflector is linked to. + * + * @type {Object3D} + */ + get target(): Object3D; + /** + * Returns a node representing the mirror's depth. That can be used + * to implement more advanced reflection effects like distance attenuation. + * + * @return {Node} The depth node. + */ + getDepthNode(): Node; + setup(builder: any): void; + clone(): any; +} +import Node from '../core/Node.js'; +import { RenderTarget } from '../../core/RenderTarget.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/Remap.d.ts b/jsdoc-testing/jsdoc/nodes/utils/Remap.d.ts new file mode 100644 index 000000000..b6aacd043 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/utils/Remap.d.ts @@ -0,0 +1,30 @@ +/** + * This node allows to remap a node value from one range into another but with enabled clamping. E.g a value of + * `0.4` in the range `[ 0.3, 0.5 ]` should be remapped into the normalized range `[ 0, 1 ]`. + * `remapClamp` takes care of that and converts the original value of `0.4` to `0.5`. + * + * @tsl + * @function + * @param {Node} node - The node that should be remapped. + * @param {Node} inLowNode - The source or current lower bound of the range. + * @param {Node} inHighNode - The source or current upper bound of the range. + * @param {?Node} [outLowNode=float(0)] - The target lower bound of the range. + * @param {?Node} [outHighNode=float(1)] - The target upper bound of the range. + * @returns {Node} + */ +export function remapClamp(node: Node, inLowNode: Node, inHighNode: Node, outLowNode?: Node | null, outHighNode?: Node | null): Node; +/** + * This node allows to remap a node value from one range into another. E.g a value of + * `0.4` in the range `[ 0.3, 0.5 ]` should be remapped into the normalized range `[ 0, 1 ]`. + * `remap` takes care of that and converts the original value of `0.4` to `0.5`. + * + * @tsl + * @function + * @param {Node} node - The node that should be remapped. + * @param {Node} inLowNode - The source or current lower bound of the range. + * @param {Node} inHighNode - The source or current upper bound of the range. + * @param {?Node} [outLowNode=float(0)] - The target lower bound of the range. + * @param {?Node} [outHighNode=float(1)] - The target upper bound of the range. + * @returns {Node} + */ +export const remap: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/utils/RotateNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/RotateNode.d.ts new file mode 100644 index 000000000..ed6dfe36b --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/utils/RotateNode.d.ts @@ -0,0 +1,49 @@ +export default RotateNode; +/** + * TSL function for creating a rotate node. + * + * @tsl + * @function + * @param {Node} positionNode - The position node. + * @param {Node} rotationNode - Represents the rotation that is applied to the position node. Depending + * on whether the position data are 2D or 3D, the rotation is expressed a single float value or an Euler value. + * @returns {RotateNode} + */ +export const rotate: any; +/** + * Applies a rotation to the given position node. + * + * @augments TempNode + */ +declare class RotateNode extends TempNode { + /** + * Constructs a new rotate node. + * + * @param {Node} positionNode - The position node. + * @param {Node} rotationNode - Represents the rotation that is applied to the position node. Depending + * on whether the position data are 2D or 3D, the rotation is expressed a single float value or an Euler value. + */ + constructor(positionNode: Node, rotationNode: Node); + /** + * The position node. + * + * @type {Node} + */ + positionNode: Node; + /** + * Represents the rotation that is applied to the position node. + * Depending on whether the position data are 2D or 3D, the rotation is expressed a single float value or an Euler value. + * + * @type {Node} + */ + rotationNode: Node; + /** + * The type of the {@link RotateNode#positionNode} defines the node's type. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The node's type. + */ + generateNodeType(builder: NodeBuilder): string; + setup(builder: any): any; +} +import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/SampleNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/SampleNode.d.ts new file mode 100644 index 000000000..6fb9d738c --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/utils/SampleNode.d.ts @@ -0,0 +1,46 @@ +export default SampleNode; +export function sample(callback: Function, uv?: Node | null): SampleNode; +/** + * Class representing a node that samples a value using a provided callback function. + * + * @extends Node + */ +declare class SampleNode extends Node { + /** + * Creates an instance of SampleNode. + * + * @param {Function} callback - The function to be called when sampling. Should accept a UV node and return a value. + * @param {?Node} [uvNode=null] - The UV node to be used in the texture sampling. + */ + constructor(callback: Function, uvNode?: Node | null); + callback: Function; + /** + * Represents the texture coordinates. + * + * @type {?Node} + * @default null + */ + uvNode: Node | null; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isSampleNode: boolean; + /** + * Sets up the node by sampling with the default UV accessor. + * + * @returns {Node} The result of the callback function when called with the UV node. + */ + setup(): Node; + /** + * Calls the callback function with the provided UV node. + * + * @param {Node} uv - The UV node or value to be passed to the callback. + * @returns {Node} The result of the callback function. + */ + sample(uv: Node): Node; +} +import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/SetNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/SetNode.d.ts new file mode 100644 index 000000000..4dcfbd1b9 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/utils/SetNode.d.ts @@ -0,0 +1,49 @@ +export default SetNode; +/** + * This module is part of the TSL core and usually not used in app level code. + * `SetNode` represents a set operation which means it is used to implement any + * `setXYZW()`, `setRGBA()` and `setSTPQ()` method invocations on node objects. + * For example: + * ```js + * materialLine.colorNode = color( 0, 0, 0 ).setR( float( 1 ) ); + * ``` + * + * @augments TempNode + */ +declare class SetNode extends TempNode { + /** + * Constructs a new set node. + * + * @param {Node} sourceNode - The node that should be updated. + * @param {string} components - The components that should be updated. + * @param {Node} targetNode - The value node. + */ + constructor(sourceNode: Node, components: string, targetNode: Node); + /** + * The node that should be updated. + * + * @type {Node} + */ + sourceNode: Node; + /** + * The components that should be updated. + * + * @type {string} + */ + components: string; + /** + * The value node. + * + * @type {Node} + */ + targetNode: Node; + /** + * This method is overwritten since the node type is inferred from {@link SetNode#sourceNode}. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The node type. + */ + generateNodeType(builder: NodeBuilder): string; + generate(builder: any): string; +} +import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/SplitNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/SplitNode.d.ts new file mode 100644 index 000000000..9941f1852 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/utils/SplitNode.d.ts @@ -0,0 +1,65 @@ +export default SplitNode; +/** + * This module is part of the TSL core and usually not used in app level code. + * `SplitNode` represents a property access operation which means it is + * used to implement any `.xyzw`, `.rgba` and `stpq` usage on node objects. + * For example: + * ```js + * const redValue = color.r; + * ``` + * + * @augments Node + */ +declare class SplitNode extends Node { + /** + * Constructs a new split node. + * + * @param {Node} node - The node that should be accessed. + * @param {string} [components='x'] - The components that should be accessed. + */ + constructor(node: Node, components?: string); + /** + * The node that should be accessed. + * + * @type {Node} + */ + node: Node; + /** + * The components that should be accessed. + * + * @type {string} + */ + components: string; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isSplitNode: boolean; + /** + * Returns the vector length which is computed based on the requested components. + * + * @return {number} The vector length. + */ + getVectorLength(): number; + /** + * Returns the component type of the node's type. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The component type. + */ + getComponentType(builder: NodeBuilder): string; + /** + * This method is overwritten since the node type is inferred from requested components. + * + * @param {NodeBuilder} builder - The current node builder. + * @return {string} The node type. + */ + generateNodeType(builder: NodeBuilder): string; + generate(builder: any, output: any): any; + serialize(data: any): void; + deserialize(data: any): void; +} +import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/SpriteSheetUV.d.ts b/jsdoc-testing/jsdoc/nodes/utils/SpriteSheetUV.d.ts new file mode 100644 index 000000000..572dccc2c --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/utils/SpriteSheetUV.d.ts @@ -0,0 +1,17 @@ +/** + * TSL function for computing texture coordinates for animated sprite sheets. + * + * ```js + * const uvNode = spritesheetUV( vec2( 6, 6 ), uv(), time.mul( animationSpeed ) ); + * + * material.colorNode = texture( spriteSheet, uvNode ); + * ``` + * + * @tsl + * @function + * @param {Node} countNode - The node that defines the number of sprites in the x and y direction (e.g 6x6). + * @param {?Node} [uvNode=uv()] - The uv node. + * @param {?Node} [frameNode=float(0)] - The node that defines the current frame/sprite. + * @returns {Node} + */ +export const spritesheetUV: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/utils/SpriteUtils.d.ts b/jsdoc-testing/jsdoc/nodes/utils/SpriteUtils.d.ts new file mode 100644 index 000000000..5350a7581 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/utils/SpriteUtils.d.ts @@ -0,0 +1,17 @@ +/** + * This can be used to achieve a billboarding behavior for flat meshes. That means they are + * oriented always towards the camera. + * + * ```js + * material.vertexNode = billboarding(); + * ``` + * + * @tsl + * @function + * @param {Object} config - The configuration object. + * @param {?Node} [config.position=null] - Can be used to define the vertex positions in world space. + * @param {boolean} [config.horizontal=true] - Whether to follow the camera rotation horizontally or not. + * @param {boolean} [config.vertical=false] - Whether to follow the camera rotation vertically or not. + * @return {Node} The updated vertex position in clip space. + */ +export const billboarding: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/utils/StorageArrayElementNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/StorageArrayElementNode.d.ts new file mode 100644 index 000000000..5257eebfd --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/utils/StorageArrayElementNode.d.ts @@ -0,0 +1,51 @@ +export default StorageArrayElementNode; +/** + * TSL function for creating a storage element node. + * + * @tsl + * @function + * @param {StorageBufferNode} storageBufferNode - The storage buffer node. + * @param {Node} indexNode - The index node that defines the element access. + * @returns {StorageArrayElementNode} + */ +export const storageElement: any; +/** + * This class enables element access on instances of {@link StorageBufferNode}. + * In most cases, it is indirectly used when accessing elements with the + * {@link StorageBufferNode#element} method. + * + * ```js + * const position = positionStorage.element( instanceIndex ); + * ``` + * + * @augments ArrayElementNode + */ +declare class StorageArrayElementNode extends ArrayElementNode { + /** + * Constructs storage buffer element node. + * + * @param {StorageBufferNode} storageBufferNode - The storage buffer node. + * @param {Node} indexNode - The index node that defines the element access. + */ + constructor(storageBufferNode: StorageBufferNode, indexNode: Node); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isStorageArrayElementNode: boolean; + /** + * The storage buffer node. + * + * @param {Node} value + * @type {StorageBufferNode} + */ + set storageBufferNode(value: Node); + get storageBufferNode(): Node; + getMemberType(builder: any, name: any): any; + setup(builder: any): import("../Nodes.js").Node | null; + generate(builder: any, output: any): any; +} +import ArrayElementNode from './ArrayElementNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/Timer.d.ts b/jsdoc-testing/jsdoc/nodes/utils/Timer.d.ts new file mode 100644 index 000000000..9131612ca --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/utils/Timer.d.ts @@ -0,0 +1,21 @@ +/** + * Represents the elapsed time in seconds. + * + * @tsl + * @type {UniformNode} + */ +export const time: UniformNode; +/** + * Represents the delta time in seconds. + * + * @tsl + * @type {UniformNode} + */ +export const deltaTime: UniformNode; +/** + * Represents the current frame ID. + * + * @tsl + * @type {UniformNode} + */ +export const frameId: UniformNode; diff --git a/jsdoc-testing/jsdoc/nodes/utils/TriplanarTextures.d.ts b/jsdoc-testing/jsdoc/nodes/utils/TriplanarTextures.d.ts new file mode 100644 index 000000000..df819d30b --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/utils/TriplanarTextures.d.ts @@ -0,0 +1,21 @@ +/** + * TSL function for creating a triplanar textures node. + * + * Can be used for triplanar texture mapping. + * + * ```js + * material.colorNode = triplanarTexture( texture( diffuseMap ) ); + * ``` + * + * @tsl + * @function + * @param {Node} textureXNode - First texture node. + * @param {?Node} [textureYNode=null] - Second texture node. When not set, the shader will sample from `textureXNode` instead. + * @param {?Node} [textureZNode=null] - Third texture node. When not set, the shader will sample from `textureXNode` instead. + * @param {?Node} [scaleNode=float(1)] - The scale node. + * @param {?Node} [positionNode=positionLocal] - Vertex positions in local space. + * @param {?Node} [normalNode=normalLocal] - Normals in local space. + * @returns {Node} + */ +export const triplanarTextures: () => void; +export function triplanarTexture(...params: any[]): Node; diff --git a/jsdoc-testing/jsdoc/nodes/utils/UVUtils.d.ts b/jsdoc-testing/jsdoc/nodes/utils/UVUtils.d.ts new file mode 100644 index 000000000..fb078e354 --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/utils/UVUtils.d.ts @@ -0,0 +1,42 @@ +/** + * Replaces the default UV coordinates used in texture lookups. + * + * ```js + *material.contextNode = replaceDefaultUV( ( textureNode ) => { + * + * // ... + * return customUVCoordinates; + * + *} ); + *``` + * + * @tsl + * @function + * @param {function(Node):Node|Node} callback - A callback that receives the texture node + * and must return the new uv coordinates. + * @param {Node} [node=null] - An optional node to which the context will be applied. + * @return {ContextNode} A context node that replaces the default UV coordinates. + */ +export function replaceDefaultUV(callback: (arg0: Node) => Node | Node, node?: Node): ContextNode; +/** + * Rotates the given uv coordinates around a center point + * + * @tsl + * @function + * @param {Node} uv - The uv coordinates. + * @param {Node} rotation - The rotation defined in radians. + * @param {Node} center - The center of rotation + * @return {Node} The rotated uv coordinates. + */ +export const rotateUV: () => void; +/** + * Applies a spherical warping effect to the given uv coordinates. + * + * @tsl + * @function + * @param {Node} uv - The uv coordinates. + * @param {Node} strength - The strength of the effect. + * @param {Node} center - The center point + * @return {Node} The updated uv coordinates. + */ +export const spherizeUV: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/utils/ViewportUtils.d.ts b/jsdoc-testing/jsdoc/nodes/utils/ViewportUtils.d.ts new file mode 100644 index 000000000..8622c377b --- /dev/null +++ b/jsdoc-testing/jsdoc/nodes/utils/ViewportUtils.d.ts @@ -0,0 +1,13 @@ +/** + * A special version of a screen uv function that involves a depth comparison + * when computing the final uvs. The function mitigates visual errors when + * using viewport texture nodes for refraction purposes. Without this function + * objects in front of a refractive surface might appear on the refractive surface + * which is incorrect. + * + * @tsl + * @function + * @param {?Node} uv - Optional uv coordinates. By default `screenUV` is used. + * @return {Node} The update uv coordinates. + */ +export const viewportSafeUV: () => void; diff --git a/jsdoc-testing/jsdoc/objects/Group.d.ts b/jsdoc-testing/jsdoc/objects/Group.d.ts new file mode 100644 index 000000000..4def40910 --- /dev/null +++ b/jsdoc-testing/jsdoc/objects/Group.d.ts @@ -0,0 +1,29 @@ +/** + * This is almost identical to an {@link Object3D}. Its purpose is to + * make working with groups of objects syntactically clearer. + * + * ```js + * // Create a group and add the two cubes. + * // These cubes can now be rotated / scaled etc as a group. + * const group = new THREE.Group(); + * + * group.add( meshA ); + * group.add( meshB ); + * + * scene.add( group ); + * ``` + * + * @augments Object3D + */ +export class Group extends Object3D { + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isGroup: boolean; + type: string; +} +import { Object3D } from '../core/Object3D.js'; diff --git a/jsdoc-testing/jsdoc/objects/Line.d.ts b/jsdoc-testing/jsdoc/objects/Line.d.ts new file mode 100644 index 000000000..204db3fa8 --- /dev/null +++ b/jsdoc-testing/jsdoc/objects/Line.d.ts @@ -0,0 +1,94 @@ +/** + * A continuous line. The line are rendered by connecting consecutive + * vertices with straight lines. + * + * ```js + * const material = new THREE.LineBasicMaterial( { color: 0x0000ff } ); + * + * const points = []; + * points.push( new THREE.Vector3( - 10, 0, 0 ) ); + * points.push( new THREE.Vector3( 0, 10, 0 ) ); + * points.push( new THREE.Vector3( 10, 0, 0 ) ); + * + * const geometry = new THREE.BufferGeometry().setFromPoints( points ); + * + * const line = new THREE.Line( geometry, material ); + * scene.add( line ); + * ``` + * + * @augments Object3D + */ +export class Line extends Object3D { + /** + * Constructs a new line. + * + * @param {BufferGeometry} [geometry] - The line geometry. + * @param {Material|Array} [material] - The line material. + */ + constructor(geometry?: BufferGeometry, material?: Material | Array); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isLine: boolean; + type: string; + /** + * The line geometry. + * + * @type {BufferGeometry} + */ + geometry: BufferGeometry; + /** + * The line material. + * + * @type {Material|Array} + * @default LineBasicMaterial + */ + material: Material | Array; + /** + * A dictionary representing the morph targets in the geometry. The key is the + * morph targets name, the value its attribute index. This member is `undefined` + * by default and only set when morph targets are detected in the geometry. + * + * @type {Object|undefined} + * @default undefined + */ + morphTargetDictionary: { + [x: string]: number; + } | undefined; + /** + * An array of weights typically in the range `[0,1]` that specify how much of the morph + * is applied. This member is `undefined` by default and only set when morph targets are + * detected in the geometry. + * + * @type {Array|undefined} + * @default undefined + */ + morphTargetInfluences: Array | undefined; + copy(source: any, recursive: any): this; + /** + * Computes an array of distance values which are necessary for rendering dashed lines. + * For each vertex in the geometry, the method calculates the cumulative length from the + * current point to the very beginning of the line. + * + * @return {Line} A reference to this line. + */ + computeLineDistances(): Line; + /** + * Computes intersection points between a casted ray and this line. + * + * @param {Raycaster} raycaster - The raycaster. + * @param {Array} intersects - The target array that holds the intersection points. + */ + raycast(raycaster: Raycaster, intersects: Array): void; + /** + * Sets the values of {@link Line#morphTargetDictionary} and {@link Line#morphTargetInfluences} + * to make sure existing morph targets can influence this 3D object. + */ + updateMorphTargets(): void; +} +import { Object3D } from '../core/Object3D.js'; +import { BufferGeometry } from '../core/BufferGeometry.js'; diff --git a/jsdoc-testing/jsdoc/objects/LineSegments.d.ts b/jsdoc-testing/jsdoc/objects/LineSegments.d.ts new file mode 100644 index 000000000..88df8f57f --- /dev/null +++ b/jsdoc-testing/jsdoc/objects/LineSegments.d.ts @@ -0,0 +1,24 @@ +/** + * A series of lines drawn between pairs of vertices. + * + * @augments Line + */ +export class LineSegments extends Line { + /** + * Constructs a new line segments. + * + * @param {BufferGeometry} [geometry] - The line geometry. + * @param {Material|Array} [material] - The line material. + */ + constructor(geometry?: BufferGeometry, material?: Material | Array); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isLineSegments: boolean; + computeLineDistances(): this; +} +import { Line } from './Line.js'; diff --git a/jsdoc-testing/jsdoc/objects/Mesh.d.ts b/jsdoc-testing/jsdoc/objects/Mesh.d.ts new file mode 100644 index 000000000..a377e9c7d --- /dev/null +++ b/jsdoc-testing/jsdoc/objects/Mesh.d.ts @@ -0,0 +1,97 @@ +/** + * Class representing triangular polygon mesh based objects. + * + * ```js + * const geometry = new THREE.BoxGeometry( 1, 1, 1 ); + * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } ); + * const mesh = new THREE.Mesh( geometry, material ); + * scene.add( mesh ); + * ``` + * + * @augments Object3D + */ +export class Mesh extends Object3D { + /** + * Constructs a new mesh. + * + * @param {BufferGeometry} [geometry] - The mesh geometry. + * @param {Material|Array} [material] - The mesh material. + */ + constructor(geometry?: BufferGeometry, material?: Material | Array); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isMesh: boolean; + type: string; + /** + * The mesh geometry. + * + * @type {BufferGeometry} + */ + geometry: BufferGeometry; + /** + * The mesh material. + * + * @type {Material|Array} + * @default MeshBasicMaterial + */ + material: Material | Array; + /** + * A dictionary representing the morph targets in the geometry. The key is the + * morph targets name, the value its attribute index. This member is `undefined` + * by default and only set when morph targets are detected in the geometry. + * + * @type {Object|undefined} + * @default undefined + */ + morphTargetDictionary: { + [x: string]: number; + } | undefined; + /** + * An array of weights typically in the range `[0,1]` that specify how much of the morph + * is applied. This member is `undefined` by default and only set when morph targets are + * detected in the geometry. + * + * @type {Array|undefined} + * @default undefined + */ + morphTargetInfluences: Array | undefined; + /** + * The number of instances of this mesh. + * Can only be used with {@link WebGPURenderer}. + * + * @type {number} + * @default 1 + */ + count: number; + copy(source: any, recursive: any): this; + /** + * Sets the values of {@link Mesh#morphTargetDictionary} and {@link Mesh#morphTargetInfluences} + * to make sure existing morph targets can influence this 3D object. + */ + updateMorphTargets(): void; + /** + * Returns the local-space position of the vertex at the given index, taking into + * account the current animation state of both morph targets and skinning. + * + * @param {number} index - The vertex index. + * @param {Vector3} target - The target object that is used to store the method's result. + * @return {Vector3} The vertex position in local space. + */ + getVertexPosition(index: number, target: Vector3): Vector3; + /** + * Computes intersection points between a casted ray and this line. + * + * @param {Raycaster} raycaster - The raycaster. + * @param {Array} intersects - The target array that holds the intersection points. + */ + raycast(raycaster: Raycaster, intersects: Array): void; + _computeIntersections(raycaster: any, intersects: any, rayLocalSpace: any): void; +} +import { Object3D } from '../core/Object3D.js'; +import { BufferGeometry } from '../core/BufferGeometry.js'; +import { Vector3 } from '../math/Vector3.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/Animation.d.ts b/jsdoc-testing/jsdoc/renderers/common/Animation.d.ts new file mode 100644 index 000000000..276e5a64c --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/Animation.d.ts @@ -0,0 +1,92 @@ +export default Animation; +/** + * This module manages the internal animation loop of the renderer. + * + * @private + */ +declare class Animation { + /** + * Constructs a new animation loop management component. + * + * @param {Renderer} renderer - A reference to the main renderer. + * @param {NodeManager} nodes - Renderer component for managing nodes related logic. + * @param {Info} info - Renderer component for managing metrics and monitoring data. + */ + constructor(renderer: Renderer, nodes: NodeManager, info: Info); + /** + * A reference to the main renderer. + * + * @type {Renderer} + */ + renderer: Renderer; + /** + * Renderer component for managing nodes related logic. + * + * @type {NodeManager} + */ + nodes: NodeManager; + /** + * Renderer component for managing metrics and monitoring data. + * + * @type {Info} + */ + info: Info; + /** + * A reference to the context from `requestAnimationFrame()` can + * be called (usually `window`). + * + * @type {?(Window|XRSession)} + */ + _context: (Window | XRSession) | null; + /** + * The user-defined animation loop. + * + * @type {?Function} + * @default null + */ + _animationLoop: Function | null; + /** + * The requestId which is returned from the `requestAnimationFrame()` call. + * Can be used to cancel the stop the animation loop. + * + * @type {?number} + * @default null + */ + _requestId: number | null; + /** + * Starts the internal animation loop. + */ + start(): void; + /** + * Stops the internal animation loop. + */ + stop(): void; + /** + * Returns the user-level animation loop. + * + * @return {?Function} The animation loop. + */ + getAnimationLoop(): Function | null; + /** + * Defines the user-level animation loop. + * + * @param {?Function} callback - The animation loop. + */ + setAnimationLoop(callback: Function | null): void; + /** + * Returns the animation context. + * + * @return {Window|XRSession} The animation context. + */ + getContext(): Window | XRSession; + /** + * Defines the context in which `requestAnimationFrame()` is executed. + * + * @param {Window|XRSession} context - The context to set. + */ + setContext(context: Window | XRSession): void; + /** + * Frees all internal resources and stops the animation loop. + */ + dispose(): void; +} diff --git a/jsdoc-testing/jsdoc/renderers/common/Attributes.d.ts b/jsdoc-testing/jsdoc/renderers/common/Attributes.d.ts new file mode 100644 index 000000000..40b80e84c --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/Attributes.d.ts @@ -0,0 +1,52 @@ +export default Attributes; +/** + * This renderer module manages geometry attributes. + * + * @private + * @augments DataMap + */ +declare class Attributes extends DataMap { + /** + * Constructs a new attribute management component. + * + * @param {Backend} backend - The renderer's backend. + * @param {Info} info - Renderer component for managing metrics and monitoring data. + */ + constructor(backend: Backend, info: Info); + /** + * The renderer's backend. + * + * @type {Backend} + */ + backend: Backend; + /** + * Renderer component for managing metrics and monitoring data. + * + * @type {Info} + */ + info: Info; + /** + * Deletes the data for the given attribute. + * + * @param {BufferAttribute} attribute - The attribute. + * @return {?Object} The deleted attribute data. + */ + delete(attribute: BufferAttribute): Object | null; + /** + * Updates the given attribute. This method creates attribute buffers + * for new attributes and updates data for existing ones. + * + * @param {BufferAttribute} attribute - The attribute to update. + * @param {number} type - The attribute type. + */ + update(attribute: BufferAttribute, type: number): void; + /** + * Utility method for handling interleaved buffer attributes correctly. + * To process them, their `InterleavedBuffer` is returned. + * + * @param {BufferAttribute} attribute - The attribute. + * @return {BufferAttribute|InterleavedBuffer} + */ + _getBufferAttribute(attribute: BufferAttribute): BufferAttribute | InterleavedBuffer; +} +import DataMap from './DataMap.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/Backend.d.ts b/jsdoc-testing/jsdoc/renderers/common/Backend.d.ts new file mode 100644 index 000000000..12bf8ae33 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/Backend.d.ts @@ -0,0 +1,531 @@ +export default Backend; +/** + * Most of the rendering related logic is implemented in the + * {@link Renderer} module and related management components. + * Sometimes it is required though to execute commands which are + * specific to the current 3D backend (which is WebGPU or WebGL 2). + * This abstract base class defines an interface that encapsulates + * all backend-related logic. Derived classes for each backend must + * implement the interface. + * + * @abstract + * @private + */ +declare class Backend { + /** + * Constructs a new backend. + * + * @param {Object} parameters - An object holding parameters for the backend. + */ + constructor(parameters?: Object); + /** + * The parameters of the backend. + * + * @type {Object} + */ + parameters: Object; + /** + * This weak map holds backend-specific data of objects + * like textures, attributes or render targets. + * + * @type {WeakMap} + */ + data: WeakMap; + /** + * A reference to the renderer. + * + * @type {?Renderer} + * @default null + */ + renderer: Renderer | null; + /** + * A reference to the canvas element the renderer is drawing to. + * + * @type {?(HTMLCanvasElement|OffscreenCanvas)} + * @default null + */ + domElement: (HTMLCanvasElement | OffscreenCanvas) | null; + /** + * A reference to the timestamp query pool. + * + * @type {{render: ?TimestampQueryPool, compute: ?TimestampQueryPool}} + */ + timestampQueryPool: { + render: TimestampQueryPool | null; + compute: TimestampQueryPool | null; + }; + /** + * Whether to track timestamps with a Timestamp Query API or not. + * + * @type {boolean} + * @default false + */ + trackTimestamp: boolean; + /** + * Initializes the backend so it is ready for usage. Concrete backends + * are supposed to implement their rendering context creation and related + * operations in this method. + * + * @async + * @param {Renderer} renderer - The renderer. + * @return {Promise} A Promise that resolves when the backend has been initialized. + */ + init(renderer: Renderer): Promise; + /** + * The coordinate system of the backend. + * + * @abstract + * @type {number} + * @readonly + */ + readonly get coordinateSystem(): number; + /** + * This method is executed at the beginning of a render call and + * can be used by the backend to prepare the state for upcoming + * draw calls. + * + * @abstract + * @param {RenderContext} renderContext - The render context. + */ + beginRender(): void; + /** + * This method is executed at the end of a render call and + * can be used by the backend to finalize work after draw + * calls. + * + * @abstract + * @param {RenderContext} renderContext - The render context. + */ + finishRender(): void; + /** + * This method is executed at the beginning of a compute call and + * can be used by the backend to prepare the state for upcoming + * compute tasks. + * + * @abstract + * @param {Node|Array} computeGroup - The compute node(s). + */ + beginCompute(): void; + /** + * This method is executed at the end of a compute call and + * can be used by the backend to finalize work after compute + * tasks. + * + * @abstract + * @param {Node|Array} computeGroup - The compute node(s). + */ + finishCompute(): void; + /** + * Executes a draw command for the given render object. + * + * @abstract + * @param {RenderObject} renderObject - The render object to draw. + * @param {Info} info - Holds a series of statistical information about the GPU memory and the rendering process. + */ + draw(): void; + /** + * Executes a compute command for the given compute node. + * + * @abstract + * @param {Node|Array} computeGroup - The group of compute nodes of a compute call. Can be a single compute node. + * @param {Node} computeNode - The compute node. + * @param {Array} bindings - The bindings. + * @param {ComputePipeline} computePipeline - The compute pipeline. + */ + compute(): void; + /** + * Creates a shader program from the given programmable stage. + * + * @abstract + * @param {ProgrammableStage} program - The programmable stage. + */ + createProgram(): void; + /** + * Destroys the shader program of the given programmable stage. + * + * @abstract + * @param {ProgrammableStage} program - The programmable stage. + */ + destroyProgram(): void; + /** + * Creates bindings from the given bind group definition. + * + * @abstract + * @param {BindGroup} bindGroup - The bind group. + * @param {Array} bindings - Array of bind groups. + * @param {number} cacheIndex - The cache index. + * @param {number} version - The version. + */ + createBindings(): void; + /** + * Updates the given bind group definition. + * + * @abstract + * @param {BindGroup} bindGroup - The bind group. + * @param {Array} bindings - Array of bind groups. + * @param {number} cacheIndex - The cache index. + * @param {number} version - The version. + */ + updateBindings(): void; + /** + * Updates a buffer binding. + * + * @abstract + * @param {Buffer} binding - The buffer binding to update. + */ + updateBinding(): void; + /** + * Creates a render pipeline for the given render object. + * + * @abstract + * @param {RenderObject} renderObject - The render object. + * @param {Array} promises - An array of compilation promises which are used in `compileAsync()`. + */ + createRenderPipeline(): void; + /** + * Creates a compute pipeline for the given compute node. + * + * @abstract + * @param {ComputePipeline} computePipeline - The compute pipeline. + * @param {Array} bindings - The bindings. + */ + createComputePipeline(): void; + /** + * Returns `true` if the render pipeline requires an update. + * + * @abstract + * @param {RenderObject} renderObject - The render object. + * @return {boolean} Whether the render pipeline requires an update or not. + */ + needsRenderUpdate(): boolean; + /** + * Returns a cache key that is used to identify render pipelines. + * + * @abstract + * @param {RenderObject} renderObject - The render object. + * @return {string} The cache key. + */ + getRenderCacheKey(): string; + /** + * Returns a node builder for the given render object. + * + * @abstract + * @param {RenderObject} renderObject - The render object. + * @param {Renderer} renderer - The renderer. + * @return {NodeBuilder} The node builder. + */ + createNodeBuilder(): NodeBuilder; + /** + * Updates a GPU sampler for the given texture. + * + * @abstract + * @param {Texture} texture - The texture to update the sampler for. + * @return {string} The current sampler key. + */ + updateSampler(): string; + /** + * Creates a default texture for the given texture that can be used + * as a placeholder until the actual texture is ready for usage. + * + * @abstract + * @param {Texture} texture - The texture to create a default texture for. + */ + createDefaultTexture(): void; + /** + * Defines a texture on the GPU for the given texture object. + * + * @abstract + * @param {Texture} texture - The texture. + * @param {Object} [options={}] - Optional configuration parameter. + */ + createTexture(): void; + /** + * Uploads the updated texture data to the GPU. + * + * @abstract + * @param {Texture} texture - The texture. + * @param {Object} [options={}] - Optional configuration parameter. + */ + updateTexture(): void; + /** + * Generates mipmaps for the given texture. + * + * @abstract + * @param {Texture} texture - The texture. + */ + generateMipmaps(): void; + /** + * Destroys the GPU data for the given texture object. + * + * @abstract + * @param {Texture} texture - The texture. + * @param {boolean} [isDefaultTexture=false] - Whether the texture uses a default GPU texture or not. + */ + destroyTexture(): void; + /** + * Returns texture data as a typed array. + * + * @abstract + * @async + * @param {Texture} texture - The texture to copy. + * @param {number} x - The x coordinate of the copy origin. + * @param {number} y - The y coordinate of the copy origin. + * @param {number} width - The width of the copy. + * @param {number} height - The height of the copy. + * @param {number} faceIndex - The face index. + * @return {Promise} A Promise that resolves with a typed array when the copy operation has finished. + */ + copyTextureToBuffer(): Promise; + /** + * Copies data of the given source texture to the given destination texture. + * + * @abstract + * @param {Texture} srcTexture - The source texture. + * @param {Texture} dstTexture - The destination texture. + * @param {?(Box3|Box2)} [srcRegion=null] - The region of the source texture to copy. + * @param {?(Vector2|Vector3)} [dstPosition=null] - The destination position of the copy. + * @param {number} [srcLevel=0] - The source mip level to copy from. + * @param {number} [dstLevel=0] - The destination mip level to copy to. + */ + copyTextureToTexture(): void; + /** + * Copies the current bound framebuffer to the given texture. + * + * @abstract + * @param {Texture} texture - The destination texture. + * @param {RenderContext} renderContext - The render context. + * @param {Vector4} rectangle - A four dimensional vector defining the origin and dimension of the copy. + */ + copyFramebufferToTexture(): void; + /** + * Creates the GPU buffer of a shader attribute. + * + * @abstract + * @param {BufferAttribute} attribute - The buffer attribute. + */ + createAttribute(): void; + /** + * Creates the GPU buffer of an indexed shader attribute. + * + * @abstract + * @param {BufferAttribute} attribute - The indexed buffer attribute. + */ + createIndexAttribute(): void; + /** + * Creates the GPU buffer of a storage attribute. + * + * @abstract + * @param {BufferAttribute} attribute - The buffer attribute. + */ + createStorageAttribute(): void; + /** + * Updates the GPU buffer of a shader attribute. + * + * @abstract + * @param {BufferAttribute} attribute - The buffer attribute to update. + */ + updateAttribute(): void; + /** + * Destroys the GPU buffer of a shader attribute. + * + * @abstract + * @param {BufferAttribute} attribute - The buffer attribute to destroy. + */ + destroyAttribute(): void; + /** + * Returns the backend's rendering context. + * + * @abstract + * @return {Object} The rendering context. + */ + getContext(): Object; + /** + * Backends can use this method if they have to run + * logic when the renderer gets resized. + * + * @abstract + */ + updateSize(): void; + /** + * Updates the viewport with the values from the given render context. + * + * @abstract + * @param {RenderContext} renderContext - The render context. + */ + updateViewport(): void; + /** + * Updates a unique identifier for the given render context that can be used + * to allocate resources like occlusion queries or timestamp queries. + * + * @param {RenderContext|ComputeNode} abstractRenderContext - The render context. + */ + updateTimeStampUID(abstractRenderContext: RenderContext | ComputeNode): void; + /** + * Returns a unique identifier for the given render context that can be used + * to allocate resources like occlusion queries or timestamp queries. + * + * @param {RenderContext|ComputeNode} abstractRenderContext - The render context. + * @return {string} The unique identifier. + */ + getTimestampUID(abstractRenderContext: RenderContext | ComputeNode): string; + /** + * Returns all timestamp frames for the given type. + * + * @param {string} type - The type of the time stamp. + * @return {Array} The timestamp frames. + */ + getTimestampFrames(type: string): Array; + /** + * Returns the query pool for the given uid. + * + * @param {string} uid - The unique identifier. + * @return {TimestampQueryPool} The query pool. + */ + _getQueryPool(uid: string): TimestampQueryPool; + /** + * Returns the timestamp for the given uid. + * + * @param {string} uid - The unique identifier. + * @return {number} The timestamp. + */ + getTimestamp(uid: string): number; + /** + * Returns `true` if a timestamp for the given uid is available. + * + * @param {string} uid - The unique identifier. + * @return {boolean} Whether the timestamp is available or not. + */ + hasTimestamp(uid: string): boolean; + /** + * Returns `true` if the given 3D object is fully occluded by other + * 3D objects in the scene. Backends must implement this method by using + * a Occlusion Query API. + * + * @abstract + * @param {RenderContext} renderContext - The render context. + * @param {Object3D} object - The 3D object to test. + * @return {boolean} Whether the 3D object is fully occluded or not. + */ + isOccluded(): boolean; + /** + * Resolves the time stamp for the given render context and type. + * + * @async + * @abstract + * @param {string} [type='render'] - The type of the time stamp. + * @return {Promise} A Promise that resolves with the time stamp. + */ + resolveTimestampsAsync(type?: string): Promise; + /** + * This method performs a readback operation by moving buffer data from + * a storage buffer attribute from the GPU to the CPU. + * + * @async + * @param {StorageBufferAttribute} attribute - The storage buffer attribute. + * @return {Promise} A promise that resolves with the buffer data when the data are ready. + */ + getArrayBufferAsync(): Promise; + /** + * Checks if the given feature is supported by the backend. + * + * @async + * @abstract + * @param {string} name - The feature's name. + * @return {Promise} A Promise that resolves with a bool that indicates whether the feature is supported or not. + */ + hasFeatureAsync(): Promise; + /** + * Checks if the given feature is supported by the backend. + * + * @abstract + * @param {string} name - The feature's name. + * @return {boolean} Whether the feature is supported or not. + */ + hasFeature(): boolean; + /** + * Returns the drawing buffer size. + * + * @return {Vector2} The drawing buffer size. + */ + getDrawingBufferSize(): Vector2; + /** + * Defines the scissor test. + * + * @abstract + * @param {boolean} boolean - Whether the scissor test should be enabled or not. + */ + setScissorTest(): void; + /** + * Returns the clear color and alpha into a single + * color object. + * + * @return {Color4} The clear color. + */ + getClearColor(): Color4; + /** + * Returns the DOM element. If no DOM element exists, the backend + * creates a new one. + * + * @return {HTMLCanvasElement} The DOM element. + */ + getDomElement(): HTMLCanvasElement; + /** + * Checks if the backend has the given compatibility. + * + * @abstract + * @param {string} name - The compatibility. + * @return {boolean} Whether the backend has the given compatibility or not. + */ + hasCompatibility(): boolean; + /** + * Initializes the render target defined in the given render context. + * + * @abstract + * @param {RenderContext} renderContext - The render context. + */ + initRenderTarget(): void; + /** + * Sets a dictionary for the given object into the + * internal data structure. + * + * @param {Object} object - The object. + * @param {Object} value - The dictionary to set. + */ + set(object: Object, value: Object): void; + /** + * Returns the dictionary for the given object. + * + * @param {Object} object - The object. + * @return {Object} The object's dictionary. + */ + get(object: Object): Object; + /** + * Checks if the given object has a dictionary + * with data defined. + * + * @param {Object} object - The object. + * @return {boolean} Whether a dictionary for the given object as been defined or not. + */ + has(object: Object): boolean; + /** + * Deletes an object from the internal data structure. + * + * @param {Object} object - The object to delete. + */ + delete(object: Object): void; + /** + * Delete GPU data associated with a bind group. + * + * @abstract + * @param {BindGroup} bindGroup - The bind group. + */ + deleteBindGroupData(): void; + /** + * Frees internal resources. + * + * @abstract + */ + dispose(): void; +} +import { Vector2 } from '../../math/Vector2.js'; +import Color4 from './Color4.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/Background.d.ts b/jsdoc-testing/jsdoc/renderers/common/Background.d.ts new file mode 100644 index 000000000..f8262c348 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/Background.d.ts @@ -0,0 +1,40 @@ +export default Background; +/** + * This renderer module manages the background. + * + * @private + * @augments DataMap + */ +declare class Background extends DataMap { + /** + * Constructs a new background management component. + * + * @param {Renderer} renderer - The renderer. + * @param {NodeManager} nodes - Renderer component for managing nodes related logic. + */ + constructor(renderer: Renderer, nodes: NodeManager); + /** + * The renderer. + * + * @type {Renderer} + */ + renderer: Renderer; + /** + * Renderer component for managing nodes related logic. + * + * @type {NodeManager} + */ + nodes: NodeManager; + /** + * Updates the background for the given scene. Depending on how `Scene.background` + * or `Scene.backgroundNode` are configured, this method might configure a simple clear + * or add a mesh to the render list for rendering the background as a textured plane + * or skybox. + * + * @param {Scene} scene - The scene. + * @param {RenderList} renderList - The current render list. + * @param {RenderContext} renderContext - The current render context. + */ + update(scene: Scene, renderList: RenderList, renderContext: RenderContext): void; +} +import DataMap from './DataMap.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/BindGroup.d.ts b/jsdoc-testing/jsdoc/renderers/common/BindGroup.d.ts new file mode 100644 index 000000000..b31f45e55 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/BindGroup.d.ts @@ -0,0 +1,36 @@ +export default BindGroup; +/** + * A bind group represents a collection of bindings and thus a collection + * or resources. Bind groups are assigned to pipelines to provide them + * with the required resources (like uniform buffers or textures). + * + * @private + */ +declare class BindGroup { + /** + * Constructs a new bind group. + * + * @param {string} name - The bind group's name. + * @param {Array} bindings - An array of bindings. + * @param {number} index - The group index. + */ + constructor(name?: string, bindings?: Array); + /** + * The bind group's name. + * + * @type {string} + */ + name: string; + /** + * An array of bindings. + * + * @type {Array} + */ + bindings: Array; + /** + * The group's ID. + * + * @type {number} + */ + id: number; +} diff --git a/jsdoc-testing/jsdoc/renderers/common/Binding.d.ts b/jsdoc-testing/jsdoc/renderers/common/Binding.d.ts new file mode 100644 index 000000000..46356fdc4 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/Binding.d.ts @@ -0,0 +1,49 @@ +export default Binding; +/** + * A binding represents the connection between a resource (like a texture, sampler + * or uniform buffer) and the resource definition in a shader stage. + * + * This module is an abstract base class for all concrete bindings types. + * + * @abstract + * @private + */ +declare class Binding { + /** + * Constructs a new binding. + * + * @param {string} [name=''] - The binding's name. + */ + constructor(name?: string); + /** + * The binding's name. + * + * @type {string} + */ + name: string; + /** + * A bitmask that defines in what shader stages the + * binding's resource is accessible. + * + * @type {number} + */ + visibility: number; + /** + * Makes sure binding's resource is visible for the given shader stage. + * + * @param {number} visibility - The shader stage. + */ + setVisibility(visibility: number): void; + /** + * The shader stages in which the binding's resource is visible. + * + * @return {number} The visibility bitmask. + */ + getVisibility(): number; + /** + * Clones the binding. + * + * @return {Binding} The cloned binding. + */ + clone(): Binding; +} diff --git a/jsdoc-testing/jsdoc/renderers/common/Bindings.d.ts b/jsdoc-testing/jsdoc/renderers/common/Bindings.d.ts new file mode 100644 index 000000000..ed9d0eca7 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/Bindings.d.ts @@ -0,0 +1,114 @@ +export default Bindings; +/** + * This renderer module manages the bindings of the renderer. + * + * @private + * @augments DataMap + */ +declare class Bindings extends DataMap { + /** + * Constructs a new bindings management component. + * + * @param {Backend} backend - The renderer's backend. + * @param {NodeManager} nodes - Renderer component for managing nodes related logic. + * @param {Textures} textures - Renderer component for managing textures. + * @param {Attributes} attributes - Renderer component for managing attributes. + * @param {Pipelines} pipelines - Renderer component for managing pipelines. + * @param {Info} info - Renderer component for managing metrics and monitoring data. + */ + constructor(backend: Backend, nodes: NodeManager, textures: Textures, attributes: Attributes, pipelines: Pipelines, info: Info); + /** + * The renderer's backend. + * + * @type {Backend} + */ + backend: Backend; + /** + * Renderer component for managing textures. + * + * @type {Textures} + */ + textures: Textures; + /** + * Renderer component for managing pipelines. + * + * @type {Pipelines} + */ + pipelines: Pipelines; + /** + * Renderer component for managing attributes. + * + * @type {Attributes} + */ + attributes: Attributes; + /** + * Renderer component for managing nodes related logic. + * + * @type {NodeManager} + */ + nodes: NodeManager; + /** + * Renderer component for managing metrics and monitoring data. + * + * @type {Info} + */ + info: Info; + /** + * Returns the bind groups for the given render object. + * + * @param {RenderObject} renderObject - The render object. + * @return {Array} The bind groups. + */ + getForRender(renderObject: RenderObject): Array; + /** + * Returns the bind groups for the given compute node. + * + * @param {Node} computeNode - The compute node. + * @return {Array} The bind groups. + */ + getForCompute(computeNode: Node): Array; + /** + * Updates the bindings for the given compute node. + * + * @param {Node} computeNode - The compute node. + */ + updateForCompute(computeNode: Node): void; + /** + * Updates the bindings for the given render object. + * + * @param {RenderObject} renderObject - The render object. + */ + updateForRender(renderObject: RenderObject): void; + /** + * Deletes the bindings for the given compute node. + * + * @param {Node} computeNode - The compute node. + */ + deleteForCompute(computeNode: Node): void; + /** + * Deletes the bindings for the given renderObject node. + * + * @param {RenderObject} renderObject - The renderObject. + */ + deleteForRender(renderObject: RenderObject): void; + /** + * Updates the given array of bindings. + * + * @param {Array} bindings - The bind groups. + */ + _updateBindings(bindings: Array): void; + /** + * Initializes the given bind group. + * + * @param {BindGroup} bindGroup - The bind group to initialize. + */ + _init(bindGroup: BindGroup): void; + /** + * Updates the given bind group. + * + * @param {BindGroup} bindGroup - The bind group to update. + * @param {Array} bindings - The bind groups. + */ + _update(bindGroup: BindGroup, bindings: Array): void; +} +import DataMap from './DataMap.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/BlendMode.d.ts b/jsdoc-testing/jsdoc/renderers/common/BlendMode.d.ts new file mode 100644 index 000000000..29223086e --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/BlendMode.d.ts @@ -0,0 +1,109 @@ +export default BlendMode; +/** + * Represents blending configuration. + * + * This class encapsulates all blending-related properties that control how + * a material's colors are combined with the colors already in the frame buffer. + */ +declare class BlendMode { + /** + * Constructs a new blending configuration. + * + * @param {(NoBlending|NormalBlending|AdditiveBlending|SubtractiveBlending|MultiplyBlending|CustomBlending|MaterialBlending)} [blending=NormalBlending] - The blending mode. + */ + constructor(blending?: (NoBlending | number | AdditiveBlending | SubtractiveBlending | MultiplyBlending | CustomBlending | MaterialBlending)); + /** + * Defines the blending type. + * + * It must be set to `CustomBlending` if custom blending properties like + * {@link BlendMode#blendSrc}, {@link BlendMode#blendDst} or {@link BlendMode#blendEquation} + * should have any effect. + * + * @type {(NoBlending|NormalBlending|AdditiveBlending|SubtractiveBlending|MultiplyBlending|CustomBlending|MaterialBlending)} + * @default NormalBlending + */ + blending: (NoBlending | number | AdditiveBlending | SubtractiveBlending | MultiplyBlending | CustomBlending | MaterialBlending); + /** + * Defines the blending source factor. + * + * This determines how the source (incoming) fragment color is factored before being added + * to the destination (existing) fragment color in the frame buffer. + * + * @type {(ZeroFactor|OneFactor|SrcColorFactor|OneMinusSrcColorFactor|SrcAlphaFactor|OneMinusSrcAlphaFactor|DstAlphaFactor|OneMinusDstAlphaFactor|DstColorFactor|OneMinusDstColorFactor|SrcAlphaSaturateFactor|ConstantColorFactor|OneMinusConstantColorFactor|ConstantAlphaFactor|OneMinusConstantAlphaFactor)} + * @default SrcAlphaFactor + */ + blendSrc: (ZeroFactor | OneFactor | SrcColorFactor | OneMinusSrcColorFactor | number | number | DstAlphaFactor | OneMinusDstAlphaFactor | DstColorFactor | OneMinusDstColorFactor | SrcAlphaSaturateFactor | ConstantColorFactor | OneMinusConstantColorFactor | ConstantAlphaFactor | OneMinusConstantAlphaFactor); + /** + * Defines the blending destination factor. + * + * This determines how the destination (existing) fragment color in the frame buffer + * is factored before being combined with the source (incoming) fragment color. + * + * @type {(ZeroFactor|OneFactor|SrcColorFactor|OneMinusSrcColorFactor|SrcAlphaFactor|OneMinusSrcAlphaFactor|DstAlphaFactor|OneMinusDstAlphaFactor|DstColorFactor|OneMinusDstColorFactor|SrcAlphaSaturateFactor|ConstantColorFactor|OneMinusConstantColorFactor|ConstantAlphaFactor|OneMinusConstantAlphaFactor)} + * @default OneMinusSrcAlphaFactor + */ + blendDst: (ZeroFactor | OneFactor | SrcColorFactor | OneMinusSrcColorFactor | number | number | DstAlphaFactor | OneMinusDstAlphaFactor | DstColorFactor | OneMinusDstColorFactor | SrcAlphaSaturateFactor | ConstantColorFactor | OneMinusConstantColorFactor | ConstantAlphaFactor | OneMinusConstantAlphaFactor); + /** + * Defines the blending equation. + * + * This determines how the source and destination colors are combined. + * + * @type {(AddEquation|SubtractEquation|ReverseSubtractEquation|MinEquation|MaxEquation)} + * @default AddEquation + */ + blendEquation: (number | SubtractEquation | ReverseSubtractEquation | MinEquation | MaxEquation); + /** + * Defines the blending source alpha factor. + * + * When set, this allows separate control of the alpha channel's source blending factor. + * If `null`, {@link BlendMode#blendSrc} is used for the alpha channel as well. + * + * @type {?(ZeroFactor|OneFactor|SrcColorFactor|OneMinusSrcColorFactor|SrcAlphaFactor|OneMinusSrcAlphaFactor|DstAlphaFactor|OneMinusDstAlphaFactor|DstColorFactor|OneMinusDstColorFactor|SrcAlphaSaturateFactor|ConstantColorFactor|OneMinusConstantColorFactor|ConstantAlphaFactor|OneMinusConstantAlphaFactor)} + * @default null + */ + blendSrcAlpha: (ZeroFactor | OneFactor | SrcColorFactor | OneMinusSrcColorFactor | number | number | DstAlphaFactor | OneMinusDstAlphaFactor | DstColorFactor | OneMinusDstColorFactor | SrcAlphaSaturateFactor | ConstantColorFactor | OneMinusConstantColorFactor | ConstantAlphaFactor | OneMinusConstantAlphaFactor) | null; + /** + * Defines the blending destination alpha factor. + * + * When set, this allows separate control of the alpha channel's destination blending factor. + * If `null`, {@link BlendMode#blendDst} is used for the alpha channel as well. + * + * @type {?(ZeroFactor|OneFactor|SrcColorFactor|OneMinusSrcColorFactor|SrcAlphaFactor|OneMinusSrcAlphaFactor|DstAlphaFactor|OneMinusDstAlphaFactor|DstColorFactor|OneMinusDstColorFactor|SrcAlphaSaturateFactor|ConstantColorFactor|OneMinusConstantColorFactor|ConstantAlphaFactor|OneMinusConstantAlphaFactor)} + * @default null + */ + blendDstAlpha: (ZeroFactor | OneFactor | SrcColorFactor | OneMinusSrcColorFactor | number | number | DstAlphaFactor | OneMinusDstAlphaFactor | DstColorFactor | OneMinusDstColorFactor | SrcAlphaSaturateFactor | ConstantColorFactor | OneMinusConstantColorFactor | ConstantAlphaFactor | OneMinusConstantAlphaFactor) | null; + /** + * Defines the blending equation of the alpha channel. + * + * When set, this allows separate control of the alpha channel's blending equation. + * If `null`, {@link BlendMode#blendEquation} is used for the alpha channel as well. + * + * @type {?(AddEquation|SubtractEquation|ReverseSubtractEquation|MinEquation|MaxEquation)} + * @default null + */ + blendEquationAlpha: (number | SubtractEquation | ReverseSubtractEquation | MinEquation | MaxEquation) | null; + /** + * Defines whether to premultiply the alpha (transparency) value. + * + * If `true`, the RGB color of the texture or material is multiplied by its alpha value. + * This is useful for transparent textures/materials where the color data + * should already include the transparency information. + * + * @type {boolean} + * @default false + */ + premultiplyAlpha: boolean; + /** + * Copies the blending properties from the given source to this instance. + * + * @param {BlendMode} source - The blending configuration to copy from. + * @return {BlendMode} A reference to this instance. + */ + copy(source: BlendMode): BlendMode; + /** + * Returns a clone of this blending configuration. + * + * @return {BlendMode} A new Blending instance with the same properties. + */ + clone(): BlendMode; +} diff --git a/jsdoc-testing/jsdoc/renderers/common/Buffer.d.ts b/jsdoc-testing/jsdoc/renderers/common/Buffer.d.ts new file mode 100644 index 000000000..79c9ae48f --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/Buffer.d.ts @@ -0,0 +1,87 @@ +export default Buffer; +/** + * Represents a buffer binding type. + * + * @private + * @abstract + * @augments Binding + */ +declare class Buffer extends Binding { + /** + * Constructs a new buffer. + * + * @param {string} name - The buffer's name. + * @param {TypedArray} [buffer=null] - The buffer. + */ + constructor(name: string, buffer?: TypedArray); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isBuffer: boolean; + /** + * The bytes per element. + * + * @type {number} + */ + bytesPerElement: number; + /** + * A reference to the internal buffer. + * + * @private + * @type {TypedArray} + */ + private _buffer; + /** + * An array of update ranges. + * + * @private + * @type {Array<{start: number, count: number}>} + */ + private _updateRanges; + /** + * The array of update ranges. + * + * @type {Array<{start: number, count: number}>} + */ + get updateRanges(): Array<{ + start: number; + count: number; + }>; + /** + * Adds an update range. + * + * @param {number} start - The start index. + * @param {number} count - The number of elements. + */ + addUpdateRange(start: number, count: number): void; + /** + * Clears all update ranges. + */ + clearUpdateRanges(): void; + /** + * The buffer's byte length. + * + * @type {number} + * @readonly + */ + readonly get byteLength(): number; + /** + * A reference to the internal buffer. + * + * @type {Float32Array} + * @readonly + */ + readonly get buffer(): Float32Array; + /** + * Updates the binding. + * + * @return {boolean} Whether the buffer has been updated and must be + * uploaded to the GPU. + */ + update(): boolean; +} +import Binding from './Binding.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/BufferUtils.d.ts b/jsdoc-testing/jsdoc/renderers/common/BufferUtils.d.ts new file mode 100644 index 000000000..4d149b3a7 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/BufferUtils.d.ts @@ -0,0 +1,28 @@ +/** + * This function is usually called with the length in bytes of an array buffer. + * It returns an padded value which ensure chunk size alignment according to STD140 layout. + * + * @function + * @param {number} floatLength - The buffer length. + * @return {number} The padded length. + */ +export function getFloatLength(floatLength: number): number; +/** + * Given the count of vectors and their vector length, this function computes + * a total length in bytes with buffer alignment according to STD140 layout. + * + * @function + * @param {number} count - The number of vectors. + * @param {number} [vectorLength=4] - The vector length. + * @return {number} The padded length. + */ +export function getVectorLength(count: number, vectorLength?: number): number; +/** + * This function is called with a vector length and ensure the computed length + * matches a predefined stride (in this case `4`). + * + * @function + * @param {number} vectorLength - The vector length. + * @return {number} The padded length. + */ +export function getStrideLength(vectorLength: number): number; diff --git a/jsdoc-testing/jsdoc/renderers/common/BundleGroup.d.ts b/jsdoc-testing/jsdoc/renderers/common/BundleGroup.d.ts new file mode 100644 index 000000000..90e98b1aa --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/BundleGroup.d.ts @@ -0,0 +1,40 @@ +export default BundleGroup; +/** + * A specialized group which enables applications access to the + * Render Bundle API of WebGPU. The group with all its descendant nodes + * are considered as one render bundle and processed as such by + * the renderer. + * + * This module is only fully supported by `WebGPURenderer` with a WebGPU backend. + * With a WebGL backend, the group can technically be rendered but without + * any performance improvements. + * + * @augments Group + */ +declare class BundleGroup extends Group { + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isBundleGroup: boolean; + /** + * The bundle group's version. + * + * @type {number} + * @readonly + * @default 0 + */ + readonly version: number; + /** + * Set this property to `true` when the bundle group has changed. + * + * @type {boolean} + * @default false + * @param {boolean} value + */ + set needsUpdate(value: boolean); +} +import { Group } from '../../objects/Group.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/CanvasTarget.d.ts b/jsdoc-testing/jsdoc/renderers/common/CanvasTarget.d.ts new file mode 100644 index 000000000..9932067a0 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/CanvasTarget.d.ts @@ -0,0 +1,189 @@ +export default CanvasTarget; +/** + * CanvasTarget is a class that represents the final output destination of the renderer. + * + * @augments EventDispatcher + */ +declare class CanvasTarget extends EventDispatcher { + /** + * Constructs a new CanvasTarget. + * + * @param {HTMLCanvasElement|OffscreenCanvas} domElement - The canvas element to render to. + */ + constructor(domElement: HTMLCanvasElement | OffscreenCanvas); + /** + * A reference to the canvas element the renderer is drawing to. + * This value of this property will automatically be created by + * the renderer. + * + * @type {HTMLCanvasElement|OffscreenCanvas} + */ + domElement: HTMLCanvasElement | OffscreenCanvas; + /** + * The renderer's pixel ratio. + * + * @private + * @type {number} + * @default 1 + */ + private _pixelRatio; + /** + * The width of the renderer's default framebuffer in logical pixel unit. + * + * @private + * @type {number} + */ + private _width; + /** + * The height of the renderer's default framebuffer in logical pixel unit. + * + * @private + * @type {number} + */ + private _height; + /** + * The viewport of the renderer in logical pixel unit. + * + * @private + * @type {Vector4} + */ + private _viewport; + /** + * The scissor rectangle of the renderer in logical pixel unit. + * + * @private + * @type {Vector4} + */ + private _scissor; + /** + * Whether the scissor test should be enabled or not. + * + * @private + * @type {boolean} + */ + private _scissorTest; + /** + * The color texture of the default framebuffer. + * + * @type {FramebufferTexture} + */ + colorTexture: FramebufferTexture; + /** + * The depth texture of the default framebuffer. + * + * @type {DepthTexture} + */ + depthTexture: DepthTexture; + /** + * Returns the pixel ratio. + * + * @return {number} The pixel ratio. + */ + getPixelRatio(): number; + /** + * Returns the drawing buffer size in physical pixels. This method honors the pixel ratio. + * + * @param {Vector2} target - The method writes the result in this target object. + * @return {Vector2} The drawing buffer size. + */ + getDrawingBufferSize(target: Vector2): Vector2; + /** + * Returns the renderer's size in logical pixels. This method does not honor the pixel ratio. + * + * @param {Vector2} target - The method writes the result in this target object. + * @return {Vector2} The renderer's size in logical pixels. + */ + getSize(target: Vector2): Vector2; + /** + * Sets the given pixel ratio and resizes the canvas if necessary. + * + * @param {number} [value=1] - The pixel ratio. + */ + setPixelRatio(value?: number): void; + /** + * This method allows to define the drawing buffer size by specifying + * width, height and pixel ratio all at once. The size of the drawing + * buffer is computed with this formula: + * ```js + * size.x = width * pixelRatio; + * size.y = height * pixelRatio; + * ``` + * + * @param {number} width - The width in logical pixels. + * @param {number} height - The height in logical pixels. + * @param {number} pixelRatio - The pixel ratio. + */ + setDrawingBufferSize(width: number, height: number, pixelRatio: number): void; + /** + * Sets the size of the renderer. + * + * @param {number} width - The width in logical pixels. + * @param {number} height - The height in logical pixels. + * @param {boolean} [updateStyle=true] - Whether to update the `style` attribute of the canvas or not. + */ + setSize(width: number, height: number, updateStyle?: boolean): void; + /** + * Returns the scissor rectangle. + * + * @param {Vector4} target - The method writes the result in this target object. + * @return {Vector4} The scissor rectangle. + */ + getScissor(target: Vector4): Vector4; + /** + * Defines the scissor rectangle. + * + * @param {number | Vector4} x - The horizontal coordinate for the lower left corner of the box in logical pixel unit. + * Instead of passing four arguments, the method also works with a single four-dimensional vector. + * @param {number} y - The vertical coordinate for the lower left corner of the box in logical pixel unit. + * @param {number} width - The width of the scissor box in logical pixel unit. + * @param {number} height - The height of the scissor box in logical pixel unit. + */ + setScissor(x: number | Vector4, y: number, width: number, height: number): void; + /** + * Returns the scissor test value. + * + * @return {boolean} Whether the scissor test should be enabled or not. + */ + getScissorTest(): boolean; + /** + * Defines the scissor test. + * + * @param {boolean} boolean - Whether the scissor test should be enabled or not. + */ + setScissorTest(boolean: boolean): void; + /** + * Returns the viewport definition. + * + * @param {Vector4} target - The method writes the result in this target object. + * @return {Vector4} The viewport definition. + */ + getViewport(target: Vector4): Vector4; + /** + * Defines the viewport. + * + * @param {number | Vector4} x - The horizontal coordinate for the lower left corner of the viewport origin in logical pixel unit. + * @param {number} y - The vertical coordinate for the lower left corner of the viewport origin in logical pixel unit. + * @param {number} width - The width of the viewport in logical pixel unit. + * @param {number} height - The height of the viewport in logical pixel unit. + * @param {number} minDepth - The minimum depth value of the viewport. WebGPU only. + * @param {number} maxDepth - The maximum depth value of the viewport. WebGPU only. + */ + setViewport(x: number | Vector4, y: number, width: number, height: number, minDepth?: number, maxDepth?: number): void; + /** + * Dispatches the resize event. + * + * @private + */ + private _dispatchResize; + /** + * Frees the GPU-related resources allocated by this instance. Call this + * method whenever this instance is no longer used in your app. + * + * @fires RenderTarget#dispose + */ + dispose(): void; +} +import { EventDispatcher } from '../../core/EventDispatcher.js'; +import { FramebufferTexture } from '../../textures/FramebufferTexture.js'; +import { DepthTexture } from '../../textures/DepthTexture.js'; +import { Vector4 } from '../../math/Vector4.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/ChainMap.d.ts b/jsdoc-testing/jsdoc/renderers/common/ChainMap.d.ts new file mode 100644 index 000000000..97e504734 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/ChainMap.d.ts @@ -0,0 +1,48 @@ +export default ChainMap; +/** + * Data structure for the renderer. It allows defining values + * with chained, hierarchical keys. Keys are meant to be + * objects since the module internally works with Weak Maps + * for performance reasons. + * + * @private + */ +declare class ChainMap { + /** + * A map of Weak Maps by their key length. + * + * @type {Object} + */ + weakMaps: { + [x: number]: WeakMap; + }; + /** + * Returns the Weak Map for the given keys. + * + * @param {Array} keys - List of keys. + * @return {WeakMap} The weak map. + */ + _getWeakMap(keys: Array): WeakMap; + /** + * Returns the value for the given array of keys. + * + * @param {Array} keys - List of keys. + * @return {any} The value. Returns `undefined` if no value was found. + */ + get(keys: Array): any; + /** + * Sets the value for the given keys. + * + * @param {Array} keys - List of keys. + * @param {any} value - The value to set. + * @return {ChainMap} A reference to this Chain Map. + */ + set(keys: Array, value: any): ChainMap; + /** + * Deletes a value for the given keys. + * + * @param {Array} keys - The keys. + * @return {boolean} Returns `true` if the value has been removed successfully and `false` if the value has not be found. + */ + delete(keys: Array): boolean; +} diff --git a/jsdoc-testing/jsdoc/renderers/common/ClippingContext.d.ts b/jsdoc-testing/jsdoc/renderers/common/ClippingContext.d.ts new file mode 100644 index 000000000..ab6124b41 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/ClippingContext.d.ts @@ -0,0 +1,116 @@ +export default ClippingContext; +/** + * Represents the state that is used to perform clipping via clipping planes. + * There is a default clipping context for each render context. When the + * scene holds instances of `ClippingGroup`, there will be a context for each + * group. + * + * @private + */ +declare class ClippingContext { + /** + * Constructs a new clipping context. + * + * @param {?ClippingContext} [parentContext=null] - A reference to the parent clipping context. + */ + constructor(parentContext?: ClippingContext | null); + /** + * The clipping context's version. + * + * @type {number} + * @readonly + */ + readonly version: number; + /** + * Whether the intersection of the clipping planes is used to clip objects, rather than their union. + * + * @type {?boolean} + * @default null + */ + clipIntersection: boolean | null; + /** + * The clipping context's cache key. + * + * @type {string} + */ + cacheKey: string; + /** + * Whether the shadow pass is active or not. + * + * @type {boolean} + * @default false + */ + shadowPass: boolean; + /** + * The view normal matrix. + * + * @type {Matrix3} + */ + viewNormalMatrix: Matrix3; + /** + * Internal cache for maintaining clipping contexts. + * + * @type {WeakMap} + */ + clippingGroupContexts: WeakMap; + /** + * The intersection planes. + * + * @type {Array} + */ + intersectionPlanes: Array; + /** + * The intersection planes. + * + * @type {Array} + */ + unionPlanes: Array; + /** + * The version of the clipping context's parent context. + * + * @type {?number} + * @readonly + */ + readonly parentVersion: number | null; + viewMatrix: any; + /** + * Projects the given source clipping planes and writes the result into the + * destination array. + * + * @param {Array} source - The source clipping planes. + * @param {Array} destination - The destination. + * @param {number} offset - The offset. + */ + projectPlanes(source: Array, destination: Array, offset: number): void; + /** + * Updates the root clipping context of a scene. + * + * @param {Scene} scene - The scene. + * @param {Camera} camera - The camera that is used to render the scene. + */ + updateGlobal(scene: Scene, camera: Camera): void; + /** + * Updates the clipping context. + * + * @param {ClippingContext} parentContext - The parent context. + * @param {ClippingGroup} clippingGroup - The clipping group this context belongs to. + */ + update(parentContext: ClippingContext, clippingGroup: ClippingGroup): void; + /** + * Returns a clipping context for the given clipping group. + * + * @param {ClippingGroup} clippingGroup - The clipping group. + * @return {ClippingContext} The clipping context. + */ + getGroupContext(clippingGroup: ClippingGroup): ClippingContext; + /** + * The count of union clipping planes. + * + * @type {number} + * @readonly + */ + readonly get unionClippingCount(): number; +} +import { Matrix3 } from '../../math/Matrix3.js'; +import { Vector4 } from '../../math/Vector4.js'; +import { Plane } from '../../math/Plane.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/Color4.d.ts b/jsdoc-testing/jsdoc/renderers/common/Color4.d.ts new file mode 100644 index 000000000..6f01003df --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/Color4.d.ts @@ -0,0 +1,49 @@ +export default Color4; +/** + * A four-component version of {@link Color} which is internally + * used by the renderer to represents clear color with alpha as + * one object. + * + * @private + * @augments Color + */ +declare class Color4 extends Color { + /** + * Constructs a new four-component color. + * You can also pass a single THREE.Color, hex or + * string argument to this constructor. + * + * @param {number|string} [r=1] - The red value. + * @param {number} [g=1] - The green value. + * @param {number} [b=1] - The blue value. + * @param {number} [a=1] - The alpha value. + */ + constructor(r?: number | string, g?: number, b?: number, a?: number); + a: number; + /** + * Overwrites the default to honor alpha. + * You can also pass a single THREE.Color, hex or + * string argument to this method. + * + * @param {number|string|Color} r - The red value. + * @param {number} [g] - The green value. + * @param {number} [b] - The blue value. + * @param {number} [a=1] - The alpha value. + * @return {Color4} A reference to this object. + */ + set(r: number | string | Color, g?: number, b?: number, a?: number): Color4; + /** + * Overwrites the default to honor alpha. + * + * @param {Color4} color - The color to copy. + * @return {Color4} A reference to this object. + */ + copy(color: Color4): Color4; + /** + * Overwrites the default to honor alpha. + * + * @return {Color4} The cloned color. + */ + clone(): Color4; +} +import { Color } from '../../math/Color.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/ComputePipeline.d.ts b/jsdoc-testing/jsdoc/renderers/common/ComputePipeline.d.ts new file mode 100644 index 000000000..c8740c38d --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/ComputePipeline.d.ts @@ -0,0 +1,31 @@ +export default ComputePipeline; +/** + * Class for representing compute pipelines. + * + * @private + * @augments Pipeline + */ +declare class ComputePipeline extends Pipeline { + /** + * Constructs a new compute pipeline. + * + * @param {string} cacheKey - The pipeline's cache key. + * @param {ProgrammableStage} computeProgram - The pipeline's compute shader. + */ + constructor(cacheKey: string, computeProgram: ProgrammableStage); + /** + * The pipeline's compute shader. + * + * @type {ProgrammableStage} + */ + computeProgram: ProgrammableStage; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isComputePipeline: boolean; +} +import Pipeline from './Pipeline.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/Constants.d.ts b/jsdoc-testing/jsdoc/renderers/common/Constants.d.ts new file mode 100644 index 000000000..cf3261af0 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/Constants.d.ts @@ -0,0 +1,9 @@ +export namespace AttributeType { + let VERTEX: number; + let INDEX: number; + let STORAGE: number; + let INDIRECT: number; +} +export const GPU_CHUNK_BYTES: 16; +export const BlendColorFactor: 211; +export const OneMinusBlendColorFactor: 212; diff --git a/jsdoc-testing/jsdoc/renderers/common/CubeRenderTarget.d.ts b/jsdoc-testing/jsdoc/renderers/common/CubeRenderTarget.d.ts new file mode 100644 index 000000000..e6cad71cf --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/CubeRenderTarget.d.ts @@ -0,0 +1,42 @@ +export default CubeRenderTarget; +/** + * This class represents a cube render target. It is a special version + * of `WebGLCubeRenderTarget` which is compatible with `WebGPURenderer`. + * + * @augments RenderTarget + */ +declare class CubeRenderTarget extends RenderTarget { + /** + * Constructs a new cube render target. + * + * @param {number} [size=1] - The size of the render target. + * @param {RenderTarget~Options} [options] - The configuration object. + */ + constructor(size?: number, options?: {}); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isCubeRenderTarget: boolean; + /** + * Converts the given equirectangular texture to a cube map. + * + * @param {Renderer} renderer - The renderer. + * @param {Texture} texture - The equirectangular texture. + * @return {CubeRenderTarget} A reference to this cube render target. + */ + fromEquirectangularTexture(renderer: Renderer, texture: Texture): CubeRenderTarget; + /** + * Clears this cube render target. + * + * @param {Renderer} renderer - The renderer. + * @param {boolean} [color=true] - Whether the color buffer should be cleared or not. + * @param {boolean} [depth=true] - Whether the depth buffer should be cleared or not. + * @param {boolean} [stencil=true] - Whether the stencil buffer should be cleared or not. + */ + clear(renderer: Renderer, color?: boolean, depth?: boolean, stencil?: boolean): void; +} +import { RenderTarget } from '../../core/RenderTarget.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/DataMap.d.ts b/jsdoc-testing/jsdoc/renderers/common/DataMap.d.ts new file mode 100644 index 000000000..5b407575a --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/DataMap.d.ts @@ -0,0 +1,41 @@ +export default DataMap; +/** + * Data structure for the renderer. It is intended to manage + * data of objects in dictionaries. + * + * @private + */ +declare class DataMap { + /** + * `DataMap` internally uses a weak map + * to manage its data. + * + * @type {WeakMap} + */ + data: WeakMap; + /** + * Returns the dictionary for the given object. + * + * @param {Object} object - The object. + * @return {Object} The dictionary. + */ + get(object: Object): Object; + /** + * Deletes the dictionary for the given object. + * + * @param {Object} object - The object. + * @return {?Object} The deleted dictionary. + */ + delete(object: Object): Object | null; + /** + * Returns `true` if the given object has a dictionary defined. + * + * @param {Object} object - The object to test. + * @return {boolean} Whether a dictionary is defined or not. + */ + has(object: Object): boolean; + /** + * Frees internal resources. + */ + dispose(): void; +} diff --git a/jsdoc-testing/jsdoc/renderers/common/Geometries.d.ts b/jsdoc-testing/jsdoc/renderers/common/Geometries.d.ts new file mode 100644 index 000000000..a1cd970c9 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/Geometries.d.ts @@ -0,0 +1,103 @@ +export default Geometries; +/** + * This renderer module manages geometries. + * + * @private + * @augments DataMap + */ +declare class Geometries extends DataMap { + /** + * Constructs a new geometry management component. + * + * @param {Attributes} attributes - Renderer component for managing attributes. + * @param {Info} info - Renderer component for managing metrics and monitoring data. + */ + constructor(attributes: Attributes, info: Info); + /** + * Renderer component for managing attributes. + * + * @type {Attributes} + */ + attributes: Attributes; + /** + * Renderer component for managing metrics and monitoring data. + * + * @type {Info} + */ + info: Info; + /** + * Weak Map for managing attributes for wireframe rendering. + * + * @type {WeakMap} + */ + wireframes: WeakMap; + /** + * This Weak Map is used to make sure buffer attributes are + * updated only once per render call. + * + * @type {WeakMap} + */ + attributeCall: WeakMap; + /** + * Stores the event listeners attached to geometries. + * + * @private + * @type {Map} + */ + private _geometryDisposeListeners; + /** + * Returns `true` if the given render object has an initialized geometry. + * + * @param {RenderObject} renderObject - The render object. + * @return {boolean} Whether if the given render object has an initialized geometry or not. + */ + has(renderObject: RenderObject): boolean; + /** + * Prepares the geometry of the given render object for rendering. + * + * @param {RenderObject} renderObject - The render object. + */ + updateForRender(renderObject: RenderObject): void; + /** + * Initializes the geometry of the given render object. + * + * @param {RenderObject} renderObject - The render object. + */ + initGeometry(renderObject: RenderObject): void; + /** + * Updates the geometry attributes of the given render object. + * + * @param {RenderObject} renderObject - The render object. + */ + updateAttributes(renderObject: RenderObject): void; + /** + * Updates the given attribute. + * + * @param {BufferAttribute} attribute - The attribute to update. + * @param {number} type - The attribute type. + */ + updateAttribute(attribute: BufferAttribute, type: number): void; + /** + * Returns the indirect buffer attribute of the given render object. + * + * @param {RenderObject} renderObject - The render object. + * @return {?BufferAttribute} The indirect attribute. `null` if no indirect drawing is used. + */ + getIndirect(renderObject: RenderObject): BufferAttribute | null; + /** + * Returns the byte offset into the indirect attribute buffer of the given render object. + * + * @param {RenderObject} renderObject - The render object. + * @return {number} The byte offset into the indirect attribute buffer. + */ + getIndirectOffset(renderObject: RenderObject): number; + /** + * Returns the index of the given render object's geometry. This is implemented + * in a method to return a wireframe index if necessary. + * + * @param {RenderObject} renderObject - The render object. + * @return {?BufferAttribute} The index. Returns `null` for non-indexed geometries. + */ + getIndex(renderObject: RenderObject): BufferAttribute | null; +} +import DataMap from './DataMap.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/IndirectStorageBufferAttribute.d.ts b/jsdoc-testing/jsdoc/renderers/common/IndirectStorageBufferAttribute.d.ts new file mode 100644 index 000000000..9084444e7 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/IndirectStorageBufferAttribute.d.ts @@ -0,0 +1,29 @@ +export default IndirectStorageBufferAttribute; +/** + * This special type of buffer attribute is intended for compute shaders. + * It can be used to encode draw parameters for indirect draw calls. + * + * Note: This type of buffer attribute can only be used with `WebGPURenderer` + * and a WebGPU backend. + * + * @augments StorageBufferAttribute + */ +declare class IndirectStorageBufferAttribute extends StorageBufferAttribute { + /** + * Constructs a new storage buffer attribute. + * + * @param {number|Uint32Array} count - The item count. It is also valid to pass a `Uint32Array` as an argument. + * The subsequent parameter is then obsolete. + * @param {number} itemSize - The item size. + */ + constructor(count: number | Uint32Array, itemSize: number); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isIndirectStorageBufferAttribute: boolean; +} +import StorageBufferAttribute from './StorageBufferAttribute.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/Info.d.ts b/jsdoc-testing/jsdoc/renderers/common/Info.d.ts new file mode 100644 index 000000000..4ea7e1d9f --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/Info.d.ts @@ -0,0 +1,183 @@ +export default Info; +/** + * This renderer module provides a series of statistical information + * about the GPU memory and the rendering process. Useful for debugging + * and monitoring. + */ +declare class Info { + /** + * Whether frame related metrics should automatically + * be resetted or not. This property should be set to `false` + * by apps which manage their own animation loop. They must + * then call `renderer.info.reset()` once per frame manually. + * + * @type {boolean} + * @default true + */ + autoReset: boolean; + /** + * The current frame ID. This ID is managed + * by `NodeFrame`. + * + * @type {number} + * @readonly + * @default 0 + */ + readonly frame: number; + /** + * The number of render calls since the + * app has been started. + * + * @type {number} + * @readonly + * @default 0 + */ + readonly calls: number; + /** + * Render related metrics. + * + * @type {Object} + * @readonly + * @property {number} calls - The number of render calls since the app has been started. + * @property {number} frameCalls - The number of render calls of the current frame. + * @property {number} drawCalls - The number of draw calls of the current frame. + * @property {number} triangles - The number of rendered triangle primitives of the current frame. + * @property {number} points - The number of rendered point primitives of the current frame. + * @property {number} lines - The number of rendered line primitives of the current frame. + * @property {number} timestamp - The timestamp of the frame. + */ + readonly render: Object; + /** + * Compute related metrics. + * + * @type {Object} + * @readonly + * @property {number} calls - The number of compute calls since the app has been started. + * @property {number} frameCalls - The number of compute calls of the current frame. + * @property {number} timestamp - The timestamp of the frame when using `renderer.computeAsync()`. + */ + readonly compute: Object; + /** + * Memory related metrics. + * + * @type {Object} + * @readonly + * @property {number} geometries - The number of active geometries. + * @property {number} textures - The number of active textures. + * @property {number} attributes - The number of active attributes. + * @property {number} indexAttributes - The number of active index attributes. + * @property {number} storageAttributes - The number of active storage attributes. + * @property {number} indirectStorageAttributes - The number of active indirect storage attributes. + * @property {number} programs - The number of active programs. + * @property {number} renderTargets - The number of active renderTargets. + * @property {number} total - The total memory size in bytes. + * @property {number} texturesSize - The memory size of active textures in bytes. + * @property {number} attributesSize - The memory size of active attributes in bytes. + * @property {number} indexAttributesSize - The memory size of active index attributes in bytes. + * @property {number} storageAttributesSize - The memory size of active storage attributes in bytes. + * @property {number} indirectStorageAttributesSize - The memory size of active indirect storage attributes in bytes. + * @property {number} programsSize - The memory size of active programs in bytes. + */ + readonly memory: Object; + /** + * Map for storing calculated byte sizes of tracked objects. + * + * @type {Map} + * @private + */ + private memoryMap; + /** + * This method should be executed per draw call and updates the corresponding metrics. + * + * @param {Object3D} object - The 3D object that is going to be rendered. + * @param {number} count - The vertex or index count. + * @param {number} instanceCount - The instance count. + */ + update(object: Object3D, count: number, instanceCount: number): void; + /** + * Resets frame related metrics. + */ + reset(): void; + /** + * Performs a complete reset of the object. + */ + dispose(): void; + /** + * Tracks texture memory explicitly, updating counts and byte tracking. + * + * @param {Texture} texture + */ + createTexture(texture: Texture): void; + /** + * Tracks texture memory explicitly, updating counts and byte tracking. + * + * @param {Texture} texture + */ + destroyTexture(texture: Texture): void; + /** + * Tracks attribute memory explicitly, updating counts and byte tracking. + * + * @param {BufferAttribute} attribute + * @param {string} type - type of attribute + * @private + */ + private _createAttribute; + /** + * Tracks a regular attribute memory explicitly. + * + * @param {BufferAttribute} attribute - The attribute to track. + */ + createAttribute(attribute: BufferAttribute): void; + /** + * Tracks an index attribute memory explicitly. + * + * @param {BufferAttribute} attribute - The index attribute to track. + */ + createIndexAttribute(attribute: BufferAttribute): void; + /** + * Tracks a storage attribute memory explicitly. + * + * @param {BufferAttribute} attribute - The storage attribute to track. + */ + createStorageAttribute(attribute: BufferAttribute): void; + /** + * Tracks an indirect storage attribute memory explicitly. + * + * @param {BufferAttribute} attribute - The indirect storage attribute to track. + */ + createIndirectStorageAttribute(attribute: BufferAttribute): void; + /** + * Tracks attribute memory explicitly, updating counts and byte tracking. + * + * @param {BufferAttribute} attribute + */ + destroyAttribute(attribute: BufferAttribute): void; + /** + * Tracks program memory explicitly, updating counts and byte tracking. + * + * @param {ProgrammableStage} program - The program to track. + */ + createProgram(program: ProgrammableStage): void; + /** + * Tracks program memory explicitly, updating counts and byte tracking. + * + * @param {Object} program - The program to track. + */ + destroyProgram(program: Object): void; + /** + * Calculates the memory size of a texture in bytes. + * + * @param {Texture} texture - The texture to calculate the size for. + * @return {number} The calculated size in bytes. + * @private + */ + private _getTextureMemorySize; + /** + * Calculates the memory size of an attribute in bytes. + * + * @param {BufferAttribute} attribute - The attribute to calculate the size for. + * @return {number} The calculated size in bytes. + * @private + */ + private _getAttributeMemorySize; +} diff --git a/jsdoc-testing/jsdoc/renderers/common/InspectorBase.d.ts b/jsdoc-testing/jsdoc/renderers/common/InspectorBase.d.ts new file mode 100644 index 000000000..7deedcbb7 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/InspectorBase.d.ts @@ -0,0 +1,109 @@ +export default InspectorBase; +/** + * InspectorBase is the base class for all inspectors. + * + * @class InspectorBase + * @augments EventDispatcher + */ +declare class InspectorBase extends EventDispatcher { + /** + * The renderer associated with this inspector. + * + * @type {WebGLRenderer} + * @private + */ + private _renderer; + /** + * The current frame being processed. + * + * @type {Object} + */ + currentFrame: Object; + /** + * Returns the node frame for the current renderer. + * + * @return {Object} The node frame. + */ + get nodeFrame(): Object; + /** + * Sets the renderer for this inspector. + * + * @param {WebGLRenderer} renderer - The renderer to associate with this inspector. + * @return {InspectorBase} This inspector instance. + */ + setRenderer(renderer: WebGLRenderer): InspectorBase; + /** + * Returns the renderer associated with this inspector. + * + * @return {WebGLRenderer} The associated renderer. + */ + getRenderer(): WebGLRenderer; + /** + * Initializes the inspector. + */ + init(): void; + /** + * Called when a frame begins. + */ + begin(): void; + /** + * Called when a frame ends. + */ + finish(): void; + /** + * Inspects a node. + * + * @param {Node} node - The node to inspect. + */ + inspect(): void; + /** + * When a compute operation is performed. + * + * @param {ComputeNode} computeNode - The compute node being executed. + * @param {number|Array} dispatchSizeOrCount - The dispatch size or count. + */ + computeAsync(): void; + /** + * Called when a compute operation begins. + * + * @param {string} uid - A unique identifier for the render context. + * @param {ComputeNode} computeNode - The compute node being executed. + */ + beginCompute(): void; + /** + * Called when a compute operation ends. + * + * @param {string} uid - A unique identifier for the render context. + * @param {ComputeNode} computeNode - The compute node being executed. + */ + finishCompute(): void; + /** + * Called when a render operation begins. + * + * @param {string} uid - A unique identifier for the render context. + * @param {Scene} scene - The scene being rendered. + * @param {Camera} camera - The camera being used for rendering. + * @param {?WebGLRenderTarget} renderTarget - The render target, if any. + */ + beginRender(): void; + /** + * Called when an animation loop ends. + * + * @param {string} uid - A unique identifier for the render context. + */ + finishRender(): void; + /** + * Called when a texture copy operation is performed. + * + * @param {Texture} srcTexture - The source texture. + * @param {Texture} dstTexture - The destination texture. + */ + copyTextureToTexture(): void; + /** + * Called when a framebuffer copy operation is performed. + * + * @param {Texture} framebufferTexture - The texture associated with the framebuffer. + */ + copyFramebufferToTexture(): void; +} +import { EventDispatcher } from '../../core/EventDispatcher.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/Lighting.d.ts b/jsdoc-testing/jsdoc/renderers/common/Lighting.d.ts new file mode 100644 index 000000000..b15d96025 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/Lighting.d.ts @@ -0,0 +1,28 @@ +export default Lighting; +/** + * This renderer module manages the lights nodes which are unique + * per scene and camera combination. + * + * The lights node itself is later configured in the render list + * with the actual lights from the scene. + * + * @private + */ +declare class Lighting { + /** + * Creates a new lights node for the given array of lights. + * + * @param {Array} lights - The render object. + * @return {LightsNode} The lights node. + */ + createNode(lights?: Array): LightsNode; + /** + * Returns a lights node for the given scene and camera. + * + * @param {Scene} scene - The scene. + * @param {Camera} camera - The camera. + * @return {LightsNode} The lights node. + */ + getNode(scene: Scene): LightsNode; +} +import { LightsNode } from '../../nodes/Nodes.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/Pipeline.d.ts b/jsdoc-testing/jsdoc/renderers/common/Pipeline.d.ts new file mode 100644 index 000000000..db30b30a6 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/Pipeline.d.ts @@ -0,0 +1,28 @@ +export default Pipeline; +/** + * Abstract class for representing pipelines. + * + * @private + * @abstract + */ +declare class Pipeline { + /** + * Constructs a new pipeline. + * + * @param {string} cacheKey - The pipeline's cache key. + */ + constructor(cacheKey: string); + /** + * The pipeline's cache key. + * + * @type {string} + */ + cacheKey: string; + /** + * How often the pipeline is currently in use. + * + * @type {number} + * @default 0 + */ + usedTimes: number; +} diff --git a/jsdoc-testing/jsdoc/renderers/common/Pipelines.d.ts b/jsdoc-testing/jsdoc/renderers/common/Pipelines.d.ts new file mode 100644 index 000000000..182374e08 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/Pipelines.d.ts @@ -0,0 +1,174 @@ +export default Pipelines; +/** + * This renderer module manages the pipelines of the renderer. + * + * @private + * @augments DataMap + */ +declare class Pipelines extends DataMap { + /** + * Constructs a new pipeline management component. + * + * @param {Backend} backend - The renderer's backend. + * @param {NodeManager} nodes - Renderer component for managing nodes related logic. + * @param {Info} info - Renderer component for managing metrics and monitoring data. + */ + constructor(backend: Backend, nodes: NodeManager, info: Info); + /** + * The renderer's backend. + * + * @type {Backend} + */ + backend: Backend; + /** + * Renderer component for managing nodes related logic. + * + * @type {NodeManager} + */ + nodes: NodeManager; + /** + * Renderer component for managing metrics and monitoring data. + * + * @type {Info} + */ + info: Info; + /** + * A references to the bindings management component. + * This reference will be set inside the `Bindings` + * constructor. + * + * @type {?Bindings} + * @default null + */ + bindings: Bindings | null; + /** + * Internal cache for maintaining pipelines. + * The key of the map is a cache key, the value the pipeline. + * + * @type {Map} + */ + caches: Map; + /** + * This dictionary maintains for each shader stage type (vertex, + * fragment and compute) the programmable stage objects which + * represent the actual shader code. + * + * @type {Object>} + */ + programs: { + [x: string]: Map; + }; + /** + * Returns a compute pipeline for the given compute node. + * + * @param {Node} computeNode - The compute node. + * @param {Array} bindings - The bindings. + * @return {ComputePipeline} The compute pipeline. + */ + getForCompute(computeNode: Node, bindings: Array): ComputePipeline; + /** + * Returns a render pipeline for the given render object. + * + * @param {RenderObject} renderObject - The render object. + * @param {?Array} [promises=null] - An array of compilation promises which is only relevant in context of `Renderer.compileAsync()`. + * @return {RenderObjectPipeline} The render pipeline. + */ + getForRender(renderObject: RenderObject, promises?: Array> | null): RenderObjectPipeline; + /** + * Checks if the render pipeline for the given render object is ready for drawing. + * Returns false if the GPU pipeline is still being compiled asynchronously. + * + * @param {RenderObject} renderObject - The render object. + * @return {boolean} True if the pipeline is ready for drawing. + */ + isReady(renderObject: RenderObject): boolean; + /** + * Deletes the pipeline for the given render object. + * + * @param {RenderObject} object - The render object. + * @return {?Object} The deleted dictionary. + */ + delete(object: RenderObject): Object | null; + /** + * Updates the pipeline for the given render object. + * + * @param {RenderObject} renderObject - The render object. + */ + updateForRender(renderObject: RenderObject): void; + /** + * Returns a compute pipeline for the given parameters. + * + * @private + * @param {Node} computeNode - The compute node. + * @param {ProgrammableStage} stageCompute - The programmable stage representing the compute shader. + * @param {string} cacheKey - The cache key. + * @param {Array} bindings - The bindings. + * @return {ComputePipeline} The compute pipeline. + */ + private _getComputePipeline; + /** + * Returns a render pipeline for the given parameters. + * + * @private + * @param {RenderObject} renderObject - The render object. + * @param {ProgrammableStage} stageVertex - The programmable stage representing the vertex shader. + * @param {ProgrammableStage} stageFragment - The programmable stage representing the fragment shader. + * @param {string} cacheKey - The cache key. + * @param {?Array} promises - An array of compilation promises which is only relevant in context of `Renderer.compileAsync()`. + * @return {RenderObjectPipeline} The render pipeline. + */ + private _getRenderPipeline; + /** + * Computes a cache key representing a compute pipeline. + * + * @private + * @param {Node} computeNode - The compute node. + * @param {ProgrammableStage} stageCompute - The programmable stage representing the compute shader. + * @return {string} The cache key. + */ + private _getComputeCacheKey; + /** + * Computes a cache key representing a render pipeline. + * + * @private + * @param {RenderObject} renderObject - The render object. + * @param {ProgrammableStage} stageVertex - The programmable stage representing the vertex shader. + * @param {ProgrammableStage} stageFragment - The programmable stage representing the fragment shader. + * @return {string} The cache key. + */ + private _getRenderCacheKey; + /** + * Releases the given pipeline. + * + * @private + * @param {Pipeline} pipeline - The pipeline to release. + */ + private _releasePipeline; + /** + * Releases the shader program. + * + * @private + * @param {Object} program - The shader program to release. + */ + private _releaseProgram; + /** + * Returns `true` if the compute pipeline for the given compute node requires an update. + * + * @private + * @param {Node} computeNode - The compute node. + * @return {boolean} Whether the compute pipeline for the given compute node requires an update or not. + */ + private _needsComputeUpdate; + /** + * Returns `true` if the render pipeline for the given render object requires an update. + * + * @private + * @param {RenderObject} renderObject - The render object. + * @return {boolean} Whether the render object for the given render object requires an update or not. + */ + private _needsRenderUpdate; +} +import DataMap from './DataMap.js'; +import ProgrammableStage from './ProgrammableStage.js'; +import ComputePipeline from './ComputePipeline.js'; +import RenderObjectPipeline from './RenderObjectPipeline.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/PostProcessing.d.ts b/jsdoc-testing/jsdoc/renderers/common/PostProcessing.d.ts new file mode 100644 index 000000000..7bf242f58 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/PostProcessing.d.ts @@ -0,0 +1,17 @@ +export default PostProcessing; +/** + * @deprecated since r183. Use {@link RenderPipeline} instead. PostProcessing has been renamed to RenderPipeline. + * + * This class is a wrapper for backward compatibility and will be removed in a future version. + */ +declare class PostProcessing extends RenderPipeline { + /** + * Constructs a new post processing management module. + * + * @param {Renderer} renderer - A reference to the renderer. + * @param {Node} outputNode - An optional output node. + * @deprecated since r183. Use {@link RenderPipeline} instead. + */ + constructor(renderer: Renderer, outputNode: Node); +} +import RenderPipeline from './RenderPipeline.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/ProgrammableStage.d.ts b/jsdoc-testing/jsdoc/renderers/common/ProgrammableStage.d.ts new file mode 100644 index 000000000..5fdbd4d68 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/ProgrammableStage.d.ts @@ -0,0 +1,64 @@ +export default ProgrammableStage; +/** + * Class for representing programmable stages which are vertex, + * fragment or compute shaders. Unlike fixed-function states (like blending), + * they represent the programmable part of a pipeline. + * + * @private + */ +declare class ProgrammableStage { + /** + * Constructs a new programmable stage. + * + * @param {string} code - The shader code. + * @param {('vertex'|'fragment'|'compute')} stage - The type of stage. + * @param {string} name - The name of the shader. + * @param {?Array} [transforms=null] - The transforms (only relevant for compute stages with WebGL 2 which uses Transform Feedback). + * @param {?Array} [attributes=null] - The attributes (only relevant for compute stages with WebGL 2 which uses Transform Feedback). + */ + constructor(code: string, stage: ("vertex" | "fragment" | "compute"), name: string, transforms?: Array | null, attributes?: Array | null); + /** + * The id of the programmable stage. + * + * @type {number} + */ + id: number; + /** + * The shader code. + * + * @type {string} + */ + code: string; + /** + * The type of stage. + * + * @type {string} + */ + stage: string; + /** + * The name of the stage. + * This is used for debugging purposes. + * + * @type {string} + */ + name: string; + /** + * The transforms (only relevant for compute stages with WebGL 2 which uses Transform Feedback). + * + * @type {?Array} + */ + transforms: Array | null; + /** + * The attributes (only relevant for compute stages with WebGL 2 which uses Transform Feedback). + * + * @type {?Array} + */ + attributes: Array | null; + /** + * How often the programmable stage is currently in use. + * + * @type {number} + * @default 0 + */ + usedTimes: number; +} diff --git a/jsdoc-testing/jsdoc/renderers/common/QuadMesh.d.ts b/jsdoc-testing/jsdoc/renderers/common/QuadMesh.d.ts new file mode 100644 index 000000000..5e42e77e0 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/QuadMesh.d.ts @@ -0,0 +1,52 @@ +export default QuadMesh; +/** + * This module is a helper for passes which need to render a full + * screen effect which is quite common in context of post processing. + * + * The intended usage is to reuse a single quad mesh for rendering + * subsequent passes by just reassigning the `material` reference. + * + * Note: This module can only be used with `WebGPURenderer`. + * + * @augments Mesh + */ +declare class QuadMesh extends Mesh { + /** + * Constructs a new quad mesh. + * + * @param {?Material} [material=null] - The material to render the quad mesh with. + */ + constructor(material?: Material | null); + /** + * The camera to render the quad mesh with. + * + * @type {OrthographicCamera} + * @readonly + */ + readonly camera: OrthographicCamera; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isQuadMesh: boolean; + /** + * Async version of `render()`. + * + * @async + * @deprecated + * @param {Renderer} renderer - The renderer. + * @return {Promise} A Promise that resolves when the render has been finished. + */ + renderAsync(renderer: Renderer): Promise; + /** + * Renders the quad mesh + * + * @param {Renderer} renderer - The renderer. + */ + render(renderer: Renderer): void; +} +import { Mesh } from '../../objects/Mesh.js'; +import { OrthographicCamera } from '../../cameras/OrthographicCamera.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/RenderBundle.d.ts b/jsdoc-testing/jsdoc/renderers/common/RenderBundle.d.ts new file mode 100644 index 000000000..52308ff19 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/RenderBundle.d.ts @@ -0,0 +1,18 @@ +export default RenderBundle; +/** + * This module is used to represent render bundles inside the renderer + * for further processing. + * + * @private + */ +declare class RenderBundle { + /** + * Constructs a new bundle group. + * + * @param {BundleGroup} bundleGroup - The bundle group. + * @param {Camera} camera - The camera the bundle group is rendered with. + */ + constructor(bundleGroup: BundleGroup, camera: Camera); + bundleGroup: BundleGroup; + camera: Camera; +} diff --git a/jsdoc-testing/jsdoc/renderers/common/RenderBundles.d.ts b/jsdoc-testing/jsdoc/renderers/common/RenderBundles.d.ts new file mode 100644 index 000000000..7919fc3ac --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/RenderBundles.d.ts @@ -0,0 +1,28 @@ +export default RenderBundles; +/** + * This renderer module manages render bundles. + * + * @private + */ +declare class RenderBundles { + /** + * A chain map for maintaining the render bundles. + * + * @type {ChainMap} + */ + bundles: ChainMap; + /** + * Returns a render bundle for the given bundle group and camera. + * + * @param {BundleGroup} bundleGroup - The bundle group. + * @param {Camera} camera - The camera the bundle group is rendered with. + * @return {RenderBundle} The render bundle. + */ + get(bundleGroup: BundleGroup, camera: Camera): RenderBundle; + /** + * Frees all internal resources. + */ + dispose(): void; +} +import ChainMap from './ChainMap.js'; +import RenderBundle from './RenderBundle.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/RenderContext.d.ts b/jsdoc-testing/jsdoc/renderers/common/RenderContext.d.ts new file mode 100644 index 000000000..f0ef10337 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/RenderContext.d.ts @@ -0,0 +1,221 @@ +/** + * Computes a cache key for the given render context. This key + * should identify the render target state so it is possible to + * configure the correct attachments in the respective backend. + * + * @param {RenderContext} renderContext - The render context. + * @return {number} The cache key. + */ +export function getCacheKey(renderContext: RenderContext): number; +export default RenderContext; +/** + * Any render or compute command is executed in a specific context that defines + * the state of the renderer and its backend. Typical examples for such context + * data are the current clear values or data from the active framebuffer. This + * module is used to represent these contexts as objects. + * + * @private + */ +declare class RenderContext { + /** + * The context's ID. + * + * @type {number} + */ + id: number; + /** + * The MRT configuration. + * + * @type {?MRTNode} + * @default null + */ + mrt: MRTNode | null; + /** + * Whether the current active framebuffer has a color attachment. + * + * @type {boolean} + * @default true + */ + color: boolean; + /** + * Whether the color attachment should be cleared or not. + * + * @type {boolean} + * @default true + */ + clearColor: boolean; + /** + * The clear color value. + * + * @type {Object} + * @default true + */ + clearColorValue: Object; + /** + * Whether the current active framebuffer has a depth attachment. + * + * @type {boolean} + * @default true + */ + depth: boolean; + /** + * Whether the depth attachment should be cleared or not. + * + * @type {boolean} + * @default true + */ + clearDepth: boolean; + /** + * The clear depth value. + * + * @type {number} + * @default 1 + */ + clearDepthValue: number; + /** + * Whether the current active framebuffer has a stencil attachment. + * + * @type {boolean} + * @default false + */ + stencil: boolean; + /** + * Whether the stencil attachment should be cleared or not. + * + * @type {boolean} + * @default true + */ + clearStencil: boolean; + /** + * The clear stencil value. + * + * @type {number} + * @default 1 + */ + clearStencilValue: number; + /** + * By default the viewport encloses the entire framebuffer If a smaller + * viewport is manually defined, this property is to `true` by the renderer. + * + * @type {boolean} + * @default false + */ + viewport: boolean; + /** + * The viewport value. This value is in physical pixels meaning it incorporates + * the renderer's pixel ratio. The viewport property of render targets or + * the renderer is in logical pixels. + * + * @type {Vector4} + */ + viewportValue: Vector4; + /** + * When the scissor test is active and scissor rectangle smaller than the + * framebuffers dimensions, this property is to `true` by the renderer. + * + * @type {boolean} + * @default false + */ + scissor: boolean; + /** + * The scissor rectangle. + * + * @type {Vector4} + */ + scissorValue: Vector4; + /** + * The active render target. + * + * @type {?RenderTarget} + * @default null + */ + renderTarget: RenderTarget | null; + /** + * The textures of the active render target. + * `null` when no render target is set. + * + * @type {?Array} + * @default null + */ + textures: Array | null; + /** + * The depth texture of the active render target. + * `null` when no render target is set. + * + * @type {?DepthTexture} + * @default null + */ + depthTexture: DepthTexture | null; + /** + * The active cube face. + * + * @type {number} + * @default 0 + */ + activeCubeFace: number; + /** + * The active mipmap level. + * + * @type {number} + * @default 0 + */ + activeMipmapLevel: number; + /** + * The number of MSAA samples. This value is always `1` when + * MSAA isn't used. + * + * @type {number} + * @default 1 + */ + sampleCount: number; + /** + * The active render target's width in physical pixels. + * + * @type {number} + * @default 0 + */ + width: number; + /** + * The active render target's height in physical pixels. + * + * @type {number} + * @default 0 + */ + height: number; + /** + * The occlusion query count. + * + * @type {number} + * @default 0 + */ + occlusionQueryCount: number; + /** + * The current clipping context. + * + * @type {?ClippingContext} + * @default null + */ + clippingContext: ClippingContext | null; + /** + * The current camera. + * + * @type {?Camera} + * @default null + */ + camera: Camera | null; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isRenderContext: boolean; + /** + * Returns the cache key of this render context. + * + * @return {number} The cache key. + */ + getCacheKey(): number; +} +import { Vector4 } from '../../math/Vector4.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/RenderContexts.d.ts b/jsdoc-testing/jsdoc/renderers/common/RenderContexts.d.ts new file mode 100644 index 000000000..ff6dfc870 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/RenderContexts.d.ts @@ -0,0 +1,42 @@ +export default RenderContexts; +/** + * This module manages the render contexts of the renderer. + * + * @private + */ +declare class RenderContexts { + /** + * Constructs a new render context management component. + * + * @param {Renderer} renderer - The renderer. + */ + constructor(renderer: Renderer); + /** + * The renderer. + * + * @type {Renderer} + */ + renderer: Renderer; + /** + * A dictionary that manages render contexts. + * + * @type {Object} + */ + _renderContexts: { + [x: string]: RenderContext; + }; + /** + * Returns a render context for the given scene, camera and render target. + * + * @param {?RenderTarget} [renderTarget=null] - The active render target. + * @param {?MRTNode} [mrt=null] - The MRT configuration + * @param {?number} [callDepth=0] - The call depth of the renderer. + * @return {RenderContext} The render context. + */ + get(renderTarget?: RenderTarget | null, mrt?: MRTNode | null, callDepth?: number | null): RenderContext; + /** + * Frees internal resources. + */ + dispose(): void; +} +import RenderContext from './RenderContext.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/RenderList.d.ts b/jsdoc-testing/jsdoc/renderers/common/RenderList.d.ts new file mode 100644 index 000000000..bc360b020 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/RenderList.d.ts @@ -0,0 +1,169 @@ +export default RenderList; +/** + * When the renderer analyzes the scene at the beginning of a render call, + * it stores 3D object for further processing in render lists. Depending on the + * properties of a 3D objects (like their transformation or material state), the + * objects are maintained in ordered lists for the actual rendering. + * + * Render lists are unique per scene and camera combination. + * + * @private + * @augments Pipeline + */ +declare class RenderList { + /** + * Constructs a render list. + * + * @param {Lighting} lighting - The lighting management component. + * @param {Scene} scene - The scene. + * @param {Camera} camera - The camera the scene is rendered with. + */ + constructor(lighting: Lighting, scene: Scene, camera: Camera); + /** + * 3D objects are transformed into render items and stored in this array. + * + * @type {Array} + */ + renderItems: Array; + /** + * The current render items index. + * + * @type {number} + * @default 0 + */ + renderItemsIndex: number; + /** + * A list with opaque render items. + * + * @type {Array} + */ + opaque: Array; + /** + * A list with transparent render items which require + * double pass rendering (e.g. transmissive objects). + * + * @type {Array} + */ + transparentDoublePass: Array; + /** + * A list with transparent render items. + * + * @type {Array} + */ + transparent: Array; + /** + * A list with transparent render bundle data. + * + * @type {Array} + */ + bundles: Array; + /** + * The render list's lights node. This node is later + * relevant for the actual analytical light nodes which + * compute the scene's lighting in the shader. + * + * @type {LightsNode} + */ + lightsNode: LightsNode; + /** + * The scene's lights stored in an array. This array + * is used to setup the lights node. + * + * @type {Array} + */ + lightsArray: Array; + /** + * The scene. + * + * @type {Scene} + */ + scene: Scene; + /** + * The camera the scene is rendered with. + * + * @type {Camera} + */ + camera: Camera; + /** + * How many objects perform occlusion query tests. + * + * @type {number} + * @default 0 + */ + occlusionQueryCount: number; + /** + * This method is called right at the beginning of a render call + * before the scene is analyzed. It prepares the internal data + * structures for the upcoming render lists generation. + * + * @return {RenderList} A reference to this render list. + */ + begin(): RenderList; + /** + * Returns a render item for the giving render item state. The state is defined + * by a series of object-related parameters. + * + * The method avoids object creation by holding render items and reusing them in + * subsequent render calls (just with different property values). + * + * @param {Object3D} object - The 3D object. + * @param {BufferGeometry} geometry - The 3D object's geometry. + * @param {Material} material - The 3D object's material. + * @param {number} groupOrder - The current group order. + * @param {number} z - Th 3D object's depth value (z value in clip space). + * @param {?number} group - {?Object} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. + * @param {ClippingContext} clippingContext - The current clipping context. + * @return {Object} The render item. + */ + getNextRenderItem(object: Object3D, geometry: BufferGeometry, material: Material, groupOrder: number, z: number, group: number | null, clippingContext: ClippingContext): Object; + /** + * Pushes the given object as a render item to the internal render lists. + * The selected lists depend on the object properties. + * + * @param {Object3D} object - The 3D object. + * @param {BufferGeometry} geometry - The 3D object's geometry. + * @param {Material} material - The 3D object's material. + * @param {number} groupOrder - The current group order. + * @param {number} z - Th 3D object's depth value (z value in clip space). + * @param {?number} group - {?Object} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. + * @param {ClippingContext} clippingContext - The current clipping context. + */ + push(object: Object3D, geometry: BufferGeometry, material: Material, groupOrder: number, z: number, group: number | null, clippingContext: ClippingContext): void; + /** + * Inserts the given object as a render item at the start of the internal render lists. + * The selected lists depend on the object properties. + * + * @param {Object3D} object - The 3D object. + * @param {BufferGeometry} geometry - The 3D object's geometry. + * @param {Material} material - The 3D object's material. + * @param {number} groupOrder - The current group order. + * @param {number} z - Th 3D object's depth value (z value in clip space). + * @param {?number} group - {?Object} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. + * @param {ClippingContext} clippingContext - The current clipping context. + */ + unshift(object: Object3D, geometry: BufferGeometry, material: Material, groupOrder: number, z: number, group: number | null, clippingContext: ClippingContext): void; + /** + * Pushes render bundle group data into the render list. + * + * @param {Object} group - Bundle group data. + */ + pushBundle(group: Object): void; + /** + * Pushes a light into the render list. + * + * @param {Light} light - The light. + */ + pushLight(light: Light): void; + /** + * Sorts the internal render lists. + * + * @param {?function(any, any): number} customOpaqueSort - A custom sort function for opaque objects. + * @param {?function(any, any): number} customTransparentSort - A custom sort function for transparent objects. + */ + sort(customOpaqueSort: ((arg0: any, arg1: any) => number) | null, customTransparentSort: ((arg0: any, arg1: any) => number) | null): void; + /** + * This method performs finalizing tasks right after the render lists + * have been generated. + */ + finish(): void; +} diff --git a/jsdoc-testing/jsdoc/renderers/common/RenderLists.d.ts b/jsdoc-testing/jsdoc/renderers/common/RenderLists.d.ts new file mode 100644 index 000000000..d8d26670c --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/RenderLists.d.ts @@ -0,0 +1,41 @@ +export default RenderLists; +/** + * This renderer module manages the render lists which are unique + * per scene and camera combination. + * + * @private + */ +declare class RenderLists { + /** + * Constructs a render lists management component. + * + * @param {Lighting} lighting - The lighting management component. + */ + constructor(lighting: Lighting); + /** + * The lighting management component. + * + * @type {Lighting} + */ + lighting: Lighting; + /** + * The internal chain map which holds the render lists. + * + * @type {ChainMap} + */ + lists: ChainMap; + /** + * Returns a render list for the given scene and camera. + * + * @param {Scene} scene - The scene. + * @param {Camera} camera - The camera. + * @return {RenderList} The render list. + */ + get(scene: Scene, camera: Camera): RenderList; + /** + * Frees all internal resources. + */ + dispose(): void; +} +import ChainMap from './ChainMap.js'; +import RenderList from './RenderList.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/RenderObject.d.ts b/jsdoc-testing/jsdoc/renderers/common/RenderObject.d.ts new file mode 100644 index 000000000..36c013119 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/RenderObject.d.ts @@ -0,0 +1,409 @@ +export default RenderObject; +/** + * A render object is the renderer's representation of single entity that gets drawn + * with a draw command. There is no unique mapping of render objects to 3D objects in the + * scene since render objects also depend from the used material, the current render context + * and the current scene's lighting. + * + * In general, the basic process of the renderer is: + * + * - Analyze the 3D objects in the scene and generate render lists containing render items. + * - Process the render lists by calling one or more render commands for each render item. + * - For each render command, request a render object and perform the draw. + * + * The module provides an interface to get data required for the draw command like the actual + * draw parameters or vertex buffers. It also holds a series of caching related methods since + * creating render objects should only be done when necessary. + * + * @private + */ +declare class RenderObject { + /** + * Constructs a new render object. + * + * @param {NodeManager} nodes - Renderer component for managing nodes related logic. + * @param {Geometries} geometries - Renderer component for managing geometries. + * @param {Renderer} renderer - The renderer. + * @param {Object3D} object - The 3D object. + * @param {Material} material - The 3D object's material. + * @param {Scene} scene - The scene the 3D object belongs to. + * @param {Camera} camera - The camera the object should be rendered with. + * @param {LightsNode} lightsNode - The lights node. + * @param {RenderContext} renderContext - The render context. + * @param {ClippingContext} clippingContext - The clipping context. + */ + constructor(nodes: NodeManager, geometries: Geometries, renderer: Renderer, object: Object3D, material: Material, scene: Scene, camera: Camera, lightsNode: LightsNode, renderContext: RenderContext, clippingContext: ClippingContext); + id: number; + /** + * Renderer component for managing nodes related logic. + * + * @type {NodeManager} + * @private + */ + private _nodes; + /** + * Renderer component for managing geometries. + * + * @type {Geometries} + * @private + */ + private _geometries; + /** + * The renderer. + * + * @type {Renderer} + */ + renderer: Renderer; + /** + * The 3D object. + * + * @type {Object3D} + */ + object: Object3D; + /** + * The 3D object's material. + * + * @type {Material} + */ + material: Material; + /** + * The scene the 3D object belongs to. + * + * @type {Scene} + */ + scene: Scene; + /** + * The camera the 3D object should be rendered with. + * + * @type {Camera} + */ + camera: Camera; + /** + * The lights node. + * + * @type {LightsNode} + */ + lightsNode: LightsNode; + /** + * The render context. + * + * @type {RenderContext} + */ + context: RenderContext; + /** + * The 3D object's geometry. + * + * @type {BufferGeometry} + */ + geometry: BufferGeometry; + /** + * The render object's version. + * + * @type {number} + */ + version: number; + /** + * The draw range of the geometry. + * + * @type {?Object} + * @default null + */ + drawRange: Object | null; + /** + * An array holding the buffer attributes + * of the render object. This entails attribute + * definitions on geometry and node level. + * + * @type {?Array} + * @default null + */ + attributes: Array | null; + /** + * An object holding the version of the + * attributes. The keys are the attribute names + * and the values are the attribute versions. + * + * @type {?Object} + * @default null + */ + attributesId: { + [x: string]: number; + } | null; + /** + * A reference to a render pipeline the render + * object is processed with. + * + * @type {RenderPipeline} + * @default null + */ + pipeline: RenderPipeline; + /** + * Only relevant for objects using + * multiple materials. This represents a group entry + * from the respective `BufferGeometry`. + * + * @type {?{start: number, count: number}} + * @default null + */ + group: { + start: number; + count: number; + } | null; + /** + * An array holding the vertex buffers which can + * be buffer attributes but also interleaved buffers. + * + * @type {?Array} + * @default null + */ + vertexBuffers: Array | null; + /** + * The parameters for the draw command. + * + * @type {?Object} + * @default null + */ + drawParams: Object | null; + /** + * If this render object is used inside a render bundle, + * this property points to the respective bundle group. + * + * @type {?BundleGroup} + * @default null + */ + bundle: BundleGroup | null; + /** + * The clipping context. + * + * @type {ClippingContext} + */ + clippingContext: ClippingContext; + /** + * The clipping context's cache key. + * + * @type {string} + */ + clippingContextCacheKey: string; + /** + * The initial node cache key. + * + * @type {number} + */ + initialNodesCacheKey: number; + /** + * The initial cache key. + * + * @type {number} + */ + initialCacheKey: number; + /** + * The node builder state. + * + * @type {?NodeBuilderState} + * @private + * @default null + */ + private _nodeBuilderState; + /** + * An array of bindings. + * + * @type {?Array} + * @private + * @default null + */ + private _bindings; + /** + * Reference to the node material observer. + * + * @type {?NodeMaterialObserver} + * @private + * @default null + */ + private _monitor; + /** + * An event listener which is defined by `RenderObjects`. It performs + * clean up tasks when `dispose()` on this render object. + * + * @method + */ + onDispose: any; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isRenderObject: boolean; + /** + * An event listener which is executed when `dispose()` is called on + * the material of this render object. + * + * @method + */ + onMaterialDispose: () => void; + /** + * An event listener which is executed when `dispose()` is called on + * the geometry of this render object. + * + * @method + */ + onGeometryDispose: () => void; + /** + * Updates the clipping context. + * + * @param {ClippingContext} context - The clipping context to set. + */ + updateClipping(context: ClippingContext): void; + /** + * Whether the clipping requires an update or not. + * + * @type {boolean} + * @readonly + */ + readonly get clippingNeedsUpdate(): boolean; + /** + * The number of clipping planes defined in context of hardware clipping. + * + * @type {number} + * @readonly + */ + readonly get hardwareClippingPlanes(): number; + /** + * Returns the node builder state of this render object. + * + * @return {NodeBuilderState} The node builder state. + */ + getNodeBuilderState(): NodeBuilderState; + /** + * Returns the node material observer of this render object. + * + * @return {NodeMaterialObserver} The node material observer. + */ + getMonitor(): NodeMaterialObserver; + /** + * Returns an array of bind groups of this render object. + * + * @return {Array} The bindings. + */ + getBindings(): Array; + /** + * Returns a binding group by group name of this render object. + * + * @param {string} name - The name of the binding group. + * @return {?BindGroup} The bindings. + */ + getBindingGroup(name: string): BindGroup | null; + /** + * Returns the index of the render object's geometry. + * + * @return {?BufferAttribute} The index. Returns `null` for non-indexed geometries. + */ + getIndex(): BufferAttribute | null; + /** + * Returns the indirect buffer attribute. + * + * @return {?BufferAttribute} The indirect attribute. `null` if no indirect drawing is used. + */ + getIndirect(): BufferAttribute | null; + /** + * Returns the byte offset into the indirect attribute buffer. + * + * @return {number|Array} The byte offset into the indirect attribute buffer. + */ + getIndirectOffset(): number | Array; + /** + * Returns an array that acts as a key for identifying the render object in a chain map. + * + * @return {Array} An array with object references. + */ + getChainArray(): Array; + /** + * This method is used when the geometry of a 3D object has been exchanged and the + * respective render object now requires an update. + * + * @param {BufferGeometry} geometry - The geometry to set. + */ + setGeometry(geometry: BufferGeometry): void; + /** + * Returns the buffer attributes of the render object. The returned array holds + * attribute definitions on geometry and node level. + * + * @return {Array} An array with buffer attributes. + */ + getAttributes(): Array; + /** + * Returns the vertex buffers of the render object. + * + * @return {Array} An array with buffer attribute or interleaved buffers. + */ + getVertexBuffers(): Array; + /** + * Returns the draw parameters for the render object. + * + * @return {?{vertexCount: number, firstVertex: number, instanceCount: number, firstInstance: number}} The draw parameters. + */ + getDrawParameters(): { + vertexCount: number; + firstVertex: number; + instanceCount: number; + firstInstance: number; + } | null; + /** + * Returns the render object's geometry cache key. + * + * The geometry cache key is part of the material cache key. + * + * @return {string} The geometry cache key. + */ + getGeometryCacheKey(): string; + /** + * Returns the render object's material cache key. + * + * The material cache key is part of the render object cache key. + * + * @return {number} The material cache key. + */ + getMaterialCacheKey(): number; + /** + * Whether the geometry requires an update or not. + * + * @type {boolean} + * @readonly + */ + readonly get needsGeometryUpdate(): boolean; + /** + * Whether the render object requires an update or not. + * + * Note: There are two distinct places where render objects are checked for an update. + * + * 1. In `RenderObjects.get()` which is executed when the render object is request. This + * method checks the `needsUpdate` flag and recreates the render object if necessary. + * 2. In `Renderer._renderObjectDirect()` right after getting the render object via + * `RenderObjects.get()`. The render object's NodeMaterialObserver is then used to detect + * a need for a refresh due to material, geometry or object related value changes. + * + * TODO: Investigate if it's possible to merge both steps so there is only a single place + * that performs the 'needsUpdate' check. + * + * @type {boolean} + * @readonly + */ + readonly get needsUpdate(): boolean; + /** + * Returns the dynamic cache key which represents a key that is computed per draw command. + * + * @return {number} The cache key. + */ + getDynamicCacheKey(): number; + /** + * Returns the render object's cache key. + * + * @return {number} The cache key. + */ + getCacheKey(): number; + /** + * Frees internal resources. + */ + dispose(): void; +} diff --git a/jsdoc-testing/jsdoc/renderers/common/RenderObjectPipeline.d.ts b/jsdoc-testing/jsdoc/renderers/common/RenderObjectPipeline.d.ts new file mode 100644 index 000000000..d9631c32e --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/RenderObjectPipeline.d.ts @@ -0,0 +1,30 @@ +export default RenderObjectPipeline; +/** + * Class for representing render pipelines. + * + * @private + * @augments Pipeline + */ +declare class RenderObjectPipeline extends Pipeline { + /** + * Constructs a new render object pipeline. + * + * @param {string} cacheKey - The pipeline's cache key. + * @param {ProgrammableStage} vertexProgram - The pipeline's vertex shader. + * @param {ProgrammableStage} fragmentProgram - The pipeline's fragment shader. + */ + constructor(cacheKey: string, vertexProgram: ProgrammableStage, fragmentProgram: ProgrammableStage); + /** + * The pipeline's vertex shader. + * + * @type {ProgrammableStage} + */ + vertexProgram: ProgrammableStage; + /** + * The pipeline's fragment shader. + * + * @type {ProgrammableStage} + */ + fragmentProgram: ProgrammableStage; +} +import Pipeline from './Pipeline.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/RenderObjects.d.ts b/jsdoc-testing/jsdoc/renderers/common/RenderObjects.d.ts new file mode 100644 index 000000000..fcb34a2e6 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/RenderObjects.d.ts @@ -0,0 +1,108 @@ +export default RenderObjects; +/** + * This module manages the render objects of the renderer. + * + * @private + */ +declare class RenderObjects { + /** + * Constructs a new render object management component. + * + * @param {Renderer} renderer - The renderer. + * @param {NodeManager} nodes - Renderer component for managing nodes related logic. + * @param {Geometries} geometries - Renderer component for managing geometries. + * @param {Pipelines} pipelines - Renderer component for managing pipelines. + * @param {Bindings} bindings - Renderer component for managing bindings. + * @param {Info} info - Renderer component for managing metrics and monitoring data. + */ + constructor(renderer: Renderer, nodes: NodeManager, geometries: Geometries, pipelines: Pipelines, bindings: Bindings, info: Info); + /** + * The renderer. + * + * @type {Renderer} + */ + renderer: Renderer; + /** + * Renderer component for managing nodes related logic. + * + * @type {NodeManager} + */ + nodes: NodeManager; + /** + * Renderer component for managing geometries. + * + * @type {Geometries} + */ + geometries: Geometries; + /** + * Renderer component for managing pipelines. + * + * @type {Pipelines} + */ + pipelines: Pipelines; + /** + * Renderer component for managing bindings. + * + * @type {Bindings} + */ + bindings: Bindings; + /** + * Renderer component for managing metrics and monitoring data. + * + * @type {Info} + */ + info: Info; + /** + * A dictionary that manages render contexts in chain maps + * for each pass ID. + * + * @type {Object} + */ + chainMaps: { + [x: string]: ChainMap; + }; + /** + * Returns a render object for the given object and state data. + * + * @param {Object3D} object - The 3D object. + * @param {Material} material - The 3D object's material. + * @param {Scene} scene - The scene the 3D object belongs to. + * @param {Camera} camera - The camera the 3D object should be rendered with. + * @param {LightsNode} lightsNode - The lights node. + * @param {RenderContext} renderContext - The render context. + * @param {ClippingContext} clippingContext - The clipping context. + * @param {string} [passId] - An optional ID for identifying the pass. + * @return {RenderObject} The render object. + */ + get(object: Object3D, material: Material, scene: Scene, camera: Camera, lightsNode: LightsNode, renderContext: RenderContext, clippingContext: ClippingContext, passId?: string): RenderObject; + /** + * Returns a chain map for the given pass ID. + * + * @param {string} [passId='default'] - The pass ID. + * @return {ChainMap} The chain map. + */ + getChainMap(passId?: string): ChainMap; + /** + * Frees internal resources. + */ + dispose(): void; + /** + * Factory method for creating render objects with the given list of parameters. + * + * @param {NodeManager} nodes - Renderer component for managing nodes related logic. + * @param {Geometries} geometries - Renderer component for managing geometries. + * @param {Renderer} renderer - The renderer. + * @param {Object3D} object - The 3D object. + * @param {Material} material - The object's material. + * @param {Scene} scene - The scene the 3D object belongs to. + * @param {Camera} camera - The camera the object should be rendered with. + * @param {LightsNode} lightsNode - The lights node. + * @param {RenderContext} renderContext - The render context. + * @param {ClippingContext} clippingContext - The clipping context. + * @param {string} [passId] - An optional ID for identifying the pass. + * @return {RenderObject} The render object. + */ + createRenderObject(nodes: NodeManager, geometries: Geometries, renderer: Renderer, object: Object3D, material: Material, scene: Scene, camera: Camera, lightsNode: LightsNode, renderContext: RenderContext, clippingContext: ClippingContext, passId?: string): RenderObject; +} +import ChainMap from './ChainMap.js'; +import RenderObject from './RenderObject.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/RenderPipeline.d.ts b/jsdoc-testing/jsdoc/renderers/common/RenderPipeline.d.ts new file mode 100644 index 000000000..51a232c3c --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/RenderPipeline.d.ts @@ -0,0 +1,126 @@ +export default RenderPipeline; +/** + * This module is responsible to manage the rendering pipeline setups in apps. + * You usually create a single instance of this class and use it to define + * the output of your render pipeline and post processing effect chain. + * ```js + * const renderPipeline = new RenderPipeline( renderer ); + * + * const scenePass = pass( scene, camera ); + * + * renderPipeline.outputNode = scenePass; + * ``` + * + * Note: This module can only be used with `WebGPURenderer`. + */ +declare class RenderPipeline { + /** + * Constructs a new render pipeline management module. + * + * @param {Renderer} renderer - A reference to the renderer. + * @param {Node} outputNode - An optional output node. + */ + constructor(renderer: Renderer, outputNode?: Node); + /** + * A reference to the renderer. + * + * @type {Renderer} + */ + renderer: Renderer; + /** + * A node which defines the final output of the rendering + * pipeline. This is usually the last node in a chain + * of effect nodes. + * + * @type {Node} + */ + outputNode: Node; + /** + * Whether the default output tone mapping and color + * space transformation should be enabled or not. + * + * This is enabled by default but it must be disabled for + * effects that expect to be executed after tone mapping and color + * space conversion. A typical example is FXAA which + * requires sRGB input. + * + * When set to `false`, the app must control the output + * transformation with `RenderOutputNode`. + * + * ```js + * const outputPass = renderOutput( scenePass ); + * ``` + * + * @type {boolean} + */ + outputColorTransform: boolean; + /** + * Must be set to `true` when the output node changes. + * + * @type {Node} + */ + needsUpdate: Node; + /** + * The full screen quad that is used to render + * the effects. + * + * @private + * @type {QuadMesh} + */ + private _quadMesh; + /** + * The context of the render pipeline stack. + * + * @private + * @type {?Object} + * @default null + */ + private _context; + /** + * The current tone mapping. + * + * @private + * @type {ToneMapping} + */ + private _toneMapping; + /** + * The current output color space. + * + * @private + * @type {ColorSpace} + */ + private _outputColorSpace; + /** + * When `RenderPipeline` is used to apply rendering pipeline and post processing effects, + * the application must use this version of `render()` inside + * its animation loop (not the one from the renderer). + */ + render(): void; + /** + * Returns the current context of the render pipeline stack. + * + * @readonly + * @type {?Object} + */ + readonly get context(): Object | null; + /** + * Frees internal resources. + */ + dispose(): void; + /** + * Updates the state of the module. + * + * @private + */ + private _update; + /** + * When `RenderPipeline` is used to apply rendering pipeline and post processing effects, + * the application must use this version of `renderAsync()` inside + * its animation loop (not the one from the renderer). + * + * @async + * @deprecated + * @return {Promise} A Promise that resolves when the render has been finished. + */ + renderAsync(): Promise; +} diff --git a/jsdoc-testing/jsdoc/renderers/common/Renderer.d.ts b/jsdoc-testing/jsdoc/renderers/common/Renderer.d.ts new file mode 100644 index 000000000..a43a970a5 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/Renderer.d.ts @@ -0,0 +1,1401 @@ +export default Renderer; +/** + * Animation loop parameter of `renderer.setAnimationLoop()`. + */ +export type onAnimationCallback = (time: DOMHighResTimeStamp, frame?: XRFrame) => any; +/** + * Base class for renderers. + */ +declare class Renderer { + /** + * Renderer options. + * + * @typedef {Object} Renderer~Options + * @property {boolean} [logarithmicDepthBuffer=false] - Whether logarithmic depth buffer is enabled or not. + * @property {boolean} [reversedDepthBuffer=false] - Whether reversed depth buffer is enabled or not. + * @property {boolean} [alpha=true] - Whether the default framebuffer (which represents the final contents of the canvas) should be transparent or opaque. + * @property {boolean} [depth=true] - Whether the default framebuffer should have a depth buffer or not. + * @property {boolean} [stencil=false] - Whether the default framebuffer should have a stencil buffer or not. + * @property {boolean} [antialias=false] - Whether MSAA as the default anti-aliasing should be enabled or not. + * @property {number} [samples=0] - When `antialias` is `true`, `4` samples are used by default. This parameter can set to any other integer value than 0 + * to overwrite the default. + * @property {?Function} [getFallback=null] - This callback function can be used to provide a fallback backend, if the primary backend can't be targeted. + * @property {number} [outputBufferType=HalfFloatType] - Defines the type of output buffers. The default `HalfFloatType` is recommend for best + * quality. To save memory and bandwidth, `UnsignedByteType` might be used. This will reduce rendering quality though. + * @property {boolean} [multiview=false] - If set to `true`, the renderer will use multiview during WebXR rendering if supported. + */ + /** + * Constructs a new renderer. + * + * @param {Backend} backend - The backend the renderer is targeting (e.g. WebGPU or WebGL 2). + * @param {Renderer~Options} [parameters] - The configuration parameter. + + */ + constructor(backend: Backend, parameters?: {}); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isRenderer: boolean; + /** + * A reference to the current backend. + * + * @type {Backend} + */ + backend: Backend; + /** + * Whether the renderer should automatically clear the current rendering target + * before execute a `render()` call. The target can be the canvas (default framebuffer) + * or the current bound render target (custom framebuffer). + * + * @type {boolean} + * @default true + */ + autoClear: boolean; + /** + * When `autoClear` is set to `true`, this property defines whether the renderer + * should clear the color buffer. + * + * @type {boolean} + * @default true + */ + autoClearColor: boolean; + /** + * When `autoClear` is set to `true`, this property defines whether the renderer + * should clear the depth buffer. + * + * @type {boolean} + * @default true + */ + autoClearDepth: boolean; + /** + * When `autoClear` is set to `true`, this property defines whether the renderer + * should clear the stencil buffer. + * + * @type {boolean} + * @default true + */ + autoClearStencil: boolean; + /** + * Whether the default framebuffer should be transparent or opaque. + * + * @type {boolean} + * @default true + */ + alpha: boolean; + /** + * Whether logarithmic depth buffer is enabled or not. + * + * @type {boolean} + * @default false + * @readonly + */ + readonly logarithmicDepthBuffer: boolean; + /** + * Whether reversed depth buffer is enabled or not. + * + * @type {boolean} + * @default false + * @readonly + */ + readonly reversedDepthBuffer: boolean; + /** + * Defines the output color space of the renderer. + * + * @type {string} + * @default SRGBColorSpace + */ + outputColorSpace: string; + /** + * Defines the tone mapping of the renderer. + * + * @type {number} + * @default NoToneMapping + */ + toneMapping: number; + /** + * Defines the tone mapping exposure. + * + * @type {number} + * @default 1 + */ + toneMappingExposure: number; + /** + * Whether the renderer should sort its render lists or not. + * + * Note: Sorting is used to attempt to properly render objects that have some degree of transparency. + * By definition, sorting objects may not work in all cases. Depending on the needs of application, + * it may be necessary to turn off sorting and use other methods to deal with transparency rendering + * e.g. manually determining each object's rendering order. + * + * @type {boolean} + * @default true + */ + sortObjects: boolean; + /** + * Whether the default framebuffer should have a depth buffer or not. + * + * @type {boolean} + * @default true + */ + depth: boolean; + /** + * Whether the default framebuffer should have a stencil buffer or not. + * + * @type {boolean} + * @default false + */ + stencil: boolean; + /** + * Holds a series of statistical information about the GPU memory + * and the rendering process. Useful for debugging and monitoring. + * + * @type {Info} + */ + info: Info; + /** + * A global context node that stores override nodes for specific transformations or calculations. + * These nodes can be used to replace default behavior in the rendering pipeline. + * + * @type {ContextNode} + * @property {Object} value - The context value object. + */ + contextNode: ContextNode; + /** + * The node library defines how certain library objects like materials, lights + * or tone mapping functions are mapped to node types. This is required since + * although instances of classes like `MeshBasicMaterial` or `PointLight` can + * be part of the scene graph, they are internally represented as nodes for + * further processing. + * + * @type {NodeLibrary} + */ + library: NodeLibrary; + /** + * A map-like data structure for managing lights. + * + * @type {Lighting} + */ + lighting: Lighting; + /** + * The number of MSAA samples. + * + * @private + * @type {number} + * @default 0 + */ + private _samples; + /** + * Callback when the canvas has been resized. + * + * @private + */ + private _onCanvasTargetResize; + /** + * The canvas target for rendering. + * + * @private + * @type {CanvasTarget} + */ + private _canvasTarget; + /** + * The inspector provides information about the internal renderer state. + * + * @private + * @type {InspectorBase} + */ + private _inspector; + /** + * This callback function can be used to provide a fallback backend, if the primary backend can't be targeted. + * + * @private + * @type {?Function} + */ + private _getFallback; + /** + * A reference to a renderer module for managing shader attributes. + * + * @private + * @type {?Attributes} + * @default null + */ + private _attributes; + /** + * A reference to a renderer module for managing geometries. + * + * @private + * @type {?Geometries} + * @default null + */ + private _geometries; + /** + * A reference to a renderer module for managing node related logic. + * + * @private + * @type {?NodeManager} + * @default null + */ + private _nodes; + /** + * A reference to a renderer module for managing the internal animation loop. + * + * @private + * @type {?Animation} + * @default null + */ + private _animation; + /** + * A reference to a renderer module for managing shader program bindings. + * + * @private + * @type {?Bindings} + * @default null + */ + private _bindings; + /** + * A reference to a renderer module for managing render objects. + * + * @private + * @type {?RenderObjects} + * @default null + */ + private _objects; + /** + * A reference to a renderer module for managing render and compute pipelines. + * + * @private + * @type {?Pipelines} + * @default null + */ + private _pipelines; + /** + * A reference to a renderer module for managing render bundles. + * + * @private + * @type {?RenderBundles} + * @default null + */ + private _bundles; + /** + * A reference to a renderer module for managing render lists. + * + * @private + * @type {?RenderLists} + * @default null + */ + private _renderLists; + /** + * A reference to a renderer module for managing render contexts. + * + * @private + * @type {?RenderContexts} + * @default null + */ + private _renderContexts; + /** + * A reference to a renderer module for managing textures. + * + * @private + * @type {?Textures} + * @default null + */ + private _textures; + /** + * A reference to a renderer module for backgrounds. + * + * @private + * @type {?Background} + * @default null + */ + private _background; + /** + * Cache for the fullscreen quad. + * This fullscreen quad is used for internal render passes + * like the tone mapping and color space output pass. + * + * @private + * @type {Map} + */ + private _quadCache; + /** + * A reference to the current render context. + * + * @private + * @type {?RenderContext} + * @default null + */ + private _currentRenderContext; + /** + * A custom sort function for the opaque render list. + * + * @private + * @type {?Function} + * @default null + */ + private _opaqueSort; + /** + * A custom sort function for the transparent render list. + * + * @private + * @type {?Function} + * @default null + */ + private _transparentSort; + /** + * Cache of framebuffer targets per canvas target. + * + * @private + * @type {Map} + */ + private _frameBufferTargets; + /** + * The clear color value. + * + * @private + * @type {Color4} + */ + private _clearColor; + /** + * The clear depth value. + * + * @private + * @type {number} + * @default 1 + */ + private _clearDepth; + /** + * The clear stencil value. + * + * @private + * @type {number} + * @default 0 + */ + private _clearStencil; + /** + * The current render target. + * + * @private + * @type {?RenderTarget} + * @default null + */ + private _renderTarget; + /** + * The active cube face. + * + * @private + * @type {number} + * @default 0 + */ + private _activeCubeFace; + /** + * The active mipmap level. + * + * @private + * @type {number} + * @default 0 + */ + private _activeMipmapLevel; + /** + * The current output render target. + * + * @private + * @type {?RenderTarget} + * @default null + */ + private _outputRenderTarget; + /** + * The MRT setting. + * + * @private + * @type {?MRTNode} + * @default null + */ + private _mrt; + /** + * This function defines how a render object is going + * to be rendered. + * + * @private + * @type {?Function} + * @default null + */ + private _renderObjectFunction; + /** + * Used to keep track of the current render object function. + * + * @private + * @type {?Function} + * @default null + */ + private _currentRenderObjectFunction; + /** + * Used to keep track of the current render bundle. + * + * @private + * @type {?RenderBundle} + * @default null + */ + private _currentRenderBundle; + /** + * Next to `_renderObjectFunction()`, this function provides another hook + * for influencing the render process of a render object. It is meant for internal + * use and only relevant for `compileAsync()` right now. Instead of using + * the default logic of `_renderObjectDirect()` which actually draws the render object, + * a different function might be used which performs no draw but just the node + * and pipeline updates. + * + * @private + * @type {Function} + */ + private _handleObjectFunction; + /** + * Indicates whether the device has been lost or not. In WebGL terms, the device + * lost is considered as a context lost. When this is set to `true`, rendering + * isn't possible anymore. + * + * @private + * @type {boolean} + * @default false + */ + private _isDeviceLost; + /** + * A callback function that defines what should happen when a device/context lost occurs. + * + * @type {Function} + */ + onDeviceLost: Function; + /** + * Defines the type of output buffers. The default `HalfFloatType` is recommend for + * best quality. To save memory and bandwidth, `UnsignedByteType` might be used. + * This will reduce rendering quality though. + * + * @private + * @type {number} + * @default HalfFloatType + */ + private _outputBufferType; + /** + * A cache for shadow nodes per material + * + * @private + * @type {WeakMap} + */ + private _cacheShadowNodes; + /** + * Whether the renderer has been initialized or not. + * + * @private + * @type {boolean} + * @default false + */ + private _initialized; + /** + * The call depth of the renderer. Counts the number of + * nested render calls. + * + * @private + * @type {number} + * @default - 1 + */ + private _callDepth; + /** + * A reference to the promise which initializes the renderer. + * + * @private + * @type {?Promise} + * @default null + */ + private _initPromise; + /** + * An array of compilation promises which are used in `compileAsync()`. + * + * @private + * @type {?Array} + * @default null + */ + private _compilationPromises; + /** + * Whether the renderer should render transparent render objects or not. + * + * @type {boolean} + * @default true + */ + transparent: boolean; + /** + * Whether the renderer should render opaque render objects or not. + * + * @type {boolean} + * @default true + */ + opaque: boolean; + /** + * Shadow map configuration + * @typedef {Object} ShadowMapConfig + * @property {boolean} enabled - Whether to globally enable shadows or not. + * @property {boolean} transmitted - Whether to enable light transmission through non-opaque materials. + * @property {number} type - The shadow map type. + */ + /** + * The renderer's shadow configuration. + * + * @type {ShadowMapConfig} + */ + shadowMap: { + /** + * - Whether to globally enable shadows or not. + */ + enabled: boolean; + /** + * - Whether to enable light transmission through non-opaque materials. + */ + transmitted: boolean; + /** + * - The shadow map type. + */ + type: number; + }; + /** + * XR configuration. + * @typedef {Object} XRConfig + * @property {boolean} enabled - Whether to globally enable XR or not. + */ + /** + * The renderer's XR manager. + * + * @type {XRManager} + */ + xr: XRManager; + /** + * Debug configuration. + * @typedef {Object} DebugConfig + * @property {boolean} checkShaderErrors - Whether shader errors should be checked or not. + * @property {?Function} onShaderError - A callback function that is executed when a shader error happens. Only supported with WebGL 2 right now. + * @property {Function} getShaderAsync - Allows the get the raw shader code for the given scene, camera and 3D object. + */ + /** + * The renderer's debug configuration. + * + * @type {DebugConfig} + */ + debug: { + /** + * - Whether shader errors should be checked or not. + */ + checkShaderErrors: boolean; + /** + * - A callback function that is executed when a shader error happens. Only supported with WebGL 2 right now. + */ + onShaderError: Function | null; + /** + * - Allows the get the raw shader code for the given scene, camera and 3D object. + */ + getShaderAsync: Function; + }; + /** + * Initializes the renderer so it is ready for usage. + * + * @async + * @return {Promise} A Promise that resolves when the renderer has been initialized. + */ + init(): Promise; + /** + * A reference to the canvas element the renderer is drawing to. + * This value of this property will automatically be created by + * the renderer. + * + * @type {HTMLCanvasElement|OffscreenCanvas} + */ + get domElement(): HTMLCanvasElement | OffscreenCanvas; + /** + * The coordinate system of the renderer. The value of this property + * depends on the selected backend. Either `THREE.WebGLCoordinateSystem` or + * `THREE.WebGPUCoordinateSystem`. + * + * @readonly + * @type {number} + */ + readonly get coordinateSystem(): number; + /** + * Compiles all materials in the given scene. This can be useful to avoid a + * phenomenon which is called "shader compilation stutter", which occurs when + * rendering an object with a new shader for the first time. + * + * If you want to add a 3D object to an existing scene, use the third optional + * parameter for applying the target scene. Note that the (target) scene's lighting + * and environment must be configured before calling this method. + * + * @async + * @param {Object3D} scene - The scene or 3D object to precompile. + * @param {Camera} camera - The camera that is used to render the scene. + * @param {?Scene} targetScene - If the first argument is a 3D object, this parameter must represent the scene the 3D object is going to be added. + * @return {Promise} A Promise that resolves when the compile has been finished. + */ + compileAsync(scene: Object3D, camera: Camera, targetScene?: Scene | null): Promise; + /** + * Renders the scene in an async fashion. + * + * @async + * @deprecated + * @param {Object3D} scene - The scene or 3D object to render. + * @param {Camera} camera - The camera. + * @return {Promise} A Promise that resolves when the render has been finished. + */ + renderAsync(scene: Object3D, camera: Camera): Promise; + /** + * Can be used to synchronize CPU operations with GPU tasks. So when this method is called, + * the CPU waits for the GPU to complete its operation (e.g. a compute task). + * + * @async + * @deprecated + * @return {Promise} A Promise that resolves when synchronization has been finished. + */ + waitForGPU(): Promise; + set inspector(value: InspectorBase); + /** + * The inspector instance. The inspector can be any class that extends from `InspectorBase`. + * + * @type {InspectorBase} + */ + get inspector(): InspectorBase; + /** + * Enables or disables high precision for model-view and normal-view matrices. + * When enabled, will use CPU 64-bit precision for higher precision instead of GPU 32-bit for higher performance. + * + * NOTE: 64-bit precision is not compatible with `InstancedMesh` and `SkinnedMesh`. + * + * @param {boolean} value - Whether to enable or disable high precision. + * @type {boolean} + */ + set highPrecision(value: boolean); + /** + * Returns whether high precision is enabled or not. + * + * @return {boolean} Whether high precision is enabled or not. + * @type {boolean} + */ + get highPrecision(): boolean; + /** + * Sets the given MRT configuration. + * + * @param {MRTNode} mrt - The MRT node to set. + * @return {Renderer} A reference to this renderer. + */ + setMRT(mrt: MRTNode): Renderer; + /** + * Returns the MRT configuration. + * + * @return {MRTNode} The MRT configuration. + */ + getMRT(): MRTNode; + /** + * Returns the output buffer type. + * + * @return {number} The output buffer type. + */ + getOutputBufferType(): number; + /** + * Returns the output buffer type. + * + * @deprecated since r182. Use `.getOutputBufferType()` instead. + * @return {number} The output buffer type. + */ + getColorBufferType(): number; + /** + * Default implementation of the device lost callback. + * + * @private + * @param {Object} info - Information about the context lost. + */ + private _onDeviceLost; + /** + * Renders the given render bundle. + * + * @private + * @param {Object} bundle - Render bundle data. + * @param {Scene} sceneRef - The scene the render bundle belongs to. + * @param {LightsNode} lightsNode - The lights node. + */ + private _renderBundle; + /** + * Renders the scene or 3D object with the given camera. This method can only be called + * if the renderer has been initialized. When using `render()` inside an animation loop, + * it's guaranteed the renderer will be initialized. The animation loop must be defined + * with {@link Renderer#setAnimationLoop} though. + * + * For all other use cases (like when using on-demand rendering), you must call + * {@link Renderer#init} before rendering. + * + * The target of the method is the default framebuffer (meaning the canvas) + * or alternatively a render target when specified via `setRenderTarget()`. + * + * @param {Object3D} scene - The scene or 3D object to render. + * @param {Camera} camera - The camera to render the scene with. + */ + render(scene: Object3D, camera: Camera): void; + /** + * Returns whether the renderer has been initialized or not. + * + * @readonly + * @return {boolean} Whether the renderer has been initialized or not. + */ + readonly get initialized(): boolean; + /** + * Returns an internal render target which is used when computing the output tone mapping + * and color space conversion. Unlike in `WebGLRenderer`, this is done in a separate render + * pass and not inline to achieve more correct results. + * + * @private + * @return {?RenderTarget} The render target. The method returns `null` if no output conversion should be applied. + */ + private _getFrameBufferTarget; + /** + * Renders the scene or 3D object with the given camera. + * + * @private + * @param {Object3D} scene - The scene or 3D object to render. + * @param {Camera} camera - The camera to render the scene with. + * @param {boolean} [useFrameBufferTarget=true] - Whether to use a framebuffer target or not. + * @return {RenderContext} The current render context. + */ + private _renderScene; + _setXRLayerSize(width: any, height: any): void; + /** + * The output pass performs tone mapping and color space conversion. + * + * @private + * @param {RenderTarget} renderTarget - The current render target. + */ + private _renderOutput; + /** + * Returns the maximum available anisotropy for texture filtering. + * + * @return {number} The maximum available anisotropy. + */ + getMaxAnisotropy(): number; + /** + * Returns the active cube face. + * + * @return {number} The active cube face. + */ + getActiveCubeFace(): number; + /** + * Returns the active mipmap level. + * + * @return {number} The active mipmap level. + */ + getActiveMipmapLevel(): number; + /** + * Applications are advised to always define the animation loop + * with this method and not manually with `requestAnimationFrame()` + * for best compatibility. + * + * @async + * @param {?onAnimationCallback} callback - The application's animation loop. + * @return {Promise} A Promise that resolves when the set has been executed. + */ + setAnimationLoop(callback: onAnimationCallback | null): Promise; + /** + * Returns the current animation loop callback. + * + * @return {?Function} The current animation loop callback. + */ + getAnimationLoop(): Function | null; + /** + * Can be used to transfer buffer data from a storage buffer attribute + * from the GPU to the CPU in context of compute shaders. + * + * @async + * @param {StorageBufferAttribute} attribute - The storage buffer attribute. + * @return {Promise} A promise that resolves with the buffer data when the data are ready. + */ + getArrayBufferAsync(attribute: StorageBufferAttribute): Promise; + /** + * Returns the rendering context. + * + * @return {GPUCanvasContext|WebGL2RenderingContext} The rendering context. + */ + getContext(): GPUCanvasContext | WebGL2RenderingContext; + /** + * Returns the pixel ratio. + * + * @return {number} The pixel ratio. + */ + getPixelRatio(): number; + /** + * Returns the drawing buffer size in physical pixels. This method honors the pixel ratio. + * + * @param {Vector2} target - The method writes the result in this target object. + * @return {Vector2} The drawing buffer size. + */ + getDrawingBufferSize(target: Vector2): Vector2; + /** + * Returns the renderer's size in logical pixels. This method does not honor the pixel ratio. + * + * @param {Vector2} target - The method writes the result in this target object. + * @return {Vector2} The renderer's size in logical pixels. + */ + getSize(target: Vector2): Vector2; + /** + * Sets the given pixel ratio and resizes the canvas if necessary. + * + * @param {number} [value=1] - The pixel ratio. + */ + setPixelRatio(value?: number): void; + /** + * This method allows to define the drawing buffer size by specifying + * width, height and pixel ratio all at once. The size of the drawing + * buffer is computed with this formula: + * ```js + * size.x = width * pixelRatio; + * size.y = height * pixelRatio; + * ``` + * + * @param {number} width - The width in logical pixels. + * @param {number} height - The height in logical pixels. + * @param {number} pixelRatio - The pixel ratio. + */ + setDrawingBufferSize(width: number, height: number, pixelRatio: number): void; + /** + * Sets the size of the renderer. + * + * @param {number} width - The width in logical pixels. + * @param {number} height - The height in logical pixels. + * @param {boolean} [updateStyle=true] - Whether to update the `style` attribute of the canvas or not. + */ + setSize(width: number, height: number, updateStyle?: boolean): void; + /** + * Defines a manual sort function for the opaque render list. + * Pass `null` to use the default sort. + * + * @param {Function} method - The sort function. + */ + setOpaqueSort(method: Function): void; + /** + * Defines a manual sort function for the transparent render list. + * Pass `null` to use the default sort. + * + * @param {Function} method - The sort function. + */ + setTransparentSort(method: Function): void; + /** + * Returns the scissor rectangle. + * + * @param {Vector4} target - The method writes the result in this target object. + * @return {Vector4} The scissor rectangle. + */ + getScissor(target: Vector4): Vector4; + /** + * Defines the scissor rectangle. + * + * @param {number | Vector4} x - The horizontal coordinate for the upper left corner of the box in logical pixel unit. + * Instead of passing four arguments, the method also works with a single four-dimensional vector. + * @param {number} y - The vertical coordinate for the upper left corner of the box in logical pixel unit. + * @param {number} width - The width of the scissor box in logical pixel unit. + * @param {number} height - The height of the scissor box in logical pixel unit. + */ + setScissor(x: number | Vector4, y: number, width: number, height: number): void; + /** + * Returns the scissor test value. + * + * @return {boolean} Whether the scissor test should be enabled or not. + */ + getScissorTest(): boolean; + /** + * Defines the scissor test. + * + * @param {boolean} boolean - Whether the scissor test should be enabled or not. + */ + setScissorTest(boolean: boolean): void; + /** + * Returns the viewport definition. + * + * @param {Vector4} target - The method writes the result in this target object. + * @return {Vector4} The viewport definition. + */ + getViewport(target: Vector4): Vector4; + /** + * Defines the viewport. + * + * @param {number | Vector4} x - The horizontal coordinate for the upper left corner of the viewport origin in logical pixel unit. + * @param {number} y - The vertical coordinate for the upper left corner of the viewport origin in logical pixel unit. + * @param {number} width - The width of the viewport in logical pixel unit. + * @param {number} height - The height of the viewport in logical pixel unit. + * @param {number} minDepth - The minimum depth value of the viewport. WebGPU only. + * @param {number} maxDepth - The maximum depth value of the viewport. WebGPU only. + */ + setViewport(x: number | Vector4, y: number, width: number, height: number, minDepth?: number, maxDepth?: number): void; + /** + * Returns the clear color. + * + * @param {Color} target - The method writes the result in this target object. + * @return {Color} The clear color. + */ + getClearColor(target: Color): Color; + /** + * Defines the clear color and optionally the clear alpha. + * + * @param {Color} color - The clear color. + * @param {number} [alpha=1] - The clear alpha. + */ + setClearColor(color: Color, alpha?: number): void; + /** + * Returns the clear alpha. + * + * @return {number} The clear alpha. + */ + getClearAlpha(): number; + /** + * Defines the clear alpha. + * + * @param {number} alpha - The clear alpha. + */ + setClearAlpha(alpha: number): void; + /** + * Returns the clear depth. + * + * @return {number} The clear depth. + */ + getClearDepth(): number; + /** + * Defines the clear depth. + * + * @param {number} depth - The clear depth. + */ + setClearDepth(depth: number): void; + /** + * Returns the clear stencil. + * + * @return {number} The clear stencil. + */ + getClearStencil(): number; + /** + * Defines the clear stencil. + * + * @param {number} stencil - The clear stencil. + */ + setClearStencil(stencil: number): void; + /** + * This method performs an occlusion query for the given 3D object. + * It returns `true` if the given 3D object is fully occluded by other + * 3D objects in the scene. + * + * @param {Object3D} object - The 3D object to test. + * @return {boolean} Whether the 3D object is fully occluded or not. + */ + isOccluded(object: Object3D): boolean; + /** + * Performs a manual clear operation. This method ignores `autoClear` properties. + * + * @param {boolean} [color=true] - Whether the color buffer should be cleared or not. + * @param {boolean} [depth=true] - Whether the depth buffer should be cleared or not. + * @param {boolean} [stencil=true] - Whether the stencil buffer should be cleared or not. + */ + clear(color?: boolean, depth?: boolean, stencil?: boolean): void; + /** + * Performs a manual clear operation of the color buffer. This method ignores `autoClear` properties. + */ + clearColor(): void; + /** + * Performs a manual clear operation of the depth buffer. This method ignores `autoClear` properties. + */ + clearDepth(): void; + /** + * Performs a manual clear operation of the stencil buffer. This method ignores `autoClear` properties. + */ + clearStencil(): void; + /** + * Async version of {@link Renderer#clear}. + * + * @async + * @deprecated + * @param {boolean} [color=true] - Whether the color buffer should be cleared or not. + * @param {boolean} [depth=true] - Whether the depth buffer should be cleared or not. + * @param {boolean} [stencil=true] - Whether the stencil buffer should be cleared or not. + * @return {Promise} A Promise that resolves when the clear operation has been executed. + */ + clearAsync(color?: boolean, depth?: boolean, stencil?: boolean): Promise; + /** + * Async version of {@link Renderer#clearColor}. + * + * @async + * @deprecated + * @return {Promise} A Promise that resolves when the clear operation has been executed. + */ + clearColorAsync(): Promise; + /** + * Async version of {@link Renderer#clearDepth}. + * + * @async + * @deprecated + * @return {Promise} A Promise that resolves when the clear operation has been executed. + */ + clearDepthAsync(): Promise; + /** + * Async version of {@link Renderer#clearStencil}. + * + * @async + * @deprecated + * @return {Promise} A Promise that resolves when the clear operation has been executed. + */ + clearStencilAsync(): Promise; + /** + * Returns `true` if a framebuffer target is needed to perform tone mapping or color space conversion. + * If this is the case, the renderer allocates an internal render target for that purpose. + * + */ + get needsFrameBufferTarget(): boolean; + /** + * The number of samples used for multi-sample anti-aliasing (MSAA). + * + * @type {number} + * @default 0 + */ + get samples(): number; + /** + * The current number of samples used for multi-sample anti-aliasing (MSAA). + * + * When rendering to a custom render target, the number of samples of that render target is used. + * If the renderer needs an internal framebuffer target for tone mapping or color space conversion, + * the number of samples is set to 0. + * + * @type {number} + */ + get currentSamples(): number; + /** + * The current tone mapping of the renderer. When not producing screen output, + * the tone mapping is always `NoToneMapping`. + * + * @type {number} + */ + get currentToneMapping(): number; + /** + * The current color space of the renderer. When not producing screen output, + * the color space is always the working color space. + * + * @type {string} + */ + get currentColorSpace(): string; + /** + * Returns `true` if the rendering settings are set to screen output. + * + * @returns {boolean} True if the current render target is the same of output render target or `null`, otherwise false. + */ + get isOutputTarget(): boolean; + /** + * Frees all internal resources of the renderer. Call this method if the renderer + * is no longer in use by your app. + */ + dispose(): void; + /** + * Sets the given render target. Calling this method means the renderer does not + * target the default framebuffer (meaning the canvas) anymore but a custom framebuffer. + * Use `null` as the first argument to reset the state. + * + * @param {?RenderTarget} renderTarget - The render target to set. + * @param {number} [activeCubeFace=0] - The active cube face. + * @param {number} [activeMipmapLevel=0] - The active mipmap level. + */ + setRenderTarget(renderTarget: RenderTarget | null, activeCubeFace?: number, activeMipmapLevel?: number): void; + /** + * Returns the current render target. + * + * @return {?RenderTarget} The render target. Returns `null` if no render target is set. + */ + getRenderTarget(): RenderTarget | null; + /** + * Sets the output render target for the renderer. + * + * @param {?RenderTarget} renderTarget - The render target to set as the output target. + */ + setOutputRenderTarget(renderTarget: RenderTarget | null): void; + /** + * Returns the current output target. + * + * @return {?RenderTarget} The current output render target. Returns `null` if no output target is set. + */ + getOutputRenderTarget(): RenderTarget | null; + /** + * Sets the canvas target. The canvas target manages the HTML canvas + * or the offscreen canvas the renderer draws into. + * + * @param {CanvasTarget} canvasTarget - The canvas target. + */ + setCanvasTarget(canvasTarget: CanvasTarget): void; + /** + * Returns the current canvas target. + * + * @return {CanvasTarget} The current canvas target. + */ + getCanvasTarget(): CanvasTarget; + /** + * Resets the renderer to the initial state before WebXR started. + * + * @private + */ + private _resetXRState; + /** + * Callback for {@link Renderer#setRenderObjectFunction}. + * + * @callback renderObjectFunction + * @param {Object3D} object - The 3D object. + * @param {Scene} scene - The scene the 3D object belongs to. + * @param {Camera} camera - The camera the object should be rendered with. + * @param {BufferGeometry} geometry - The object's geometry. + * @param {Material} material - The object's material. + * @param {?Object} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. + * @param {LightsNode} lightsNode - The current lights node. + * @param {ClippingContext} clippingContext - The clipping context. + * @param {?string} [passId=null] - An optional ID for identifying the pass. + */ + /** + * Sets the given render object function. Calling this method overwrites the default implementation + * which is {@link Renderer#renderObject}. Defining a custom function can be useful + * if you want to modify the way objects are rendered. For example you can define things like "every + * object that has material of a certain type should perform a pre-pass with a special overwrite material". + * The custom function must always call `renderObject()` in its implementation. + * + * Use `null` as the first argument to reset the state. + * + * @param {?renderObjectFunction} renderObjectFunction - The render object function. + */ + setRenderObjectFunction(renderObjectFunction: ((object: Object3D, scene: Scene, camera: Camera, geometry: BufferGeometry, material: Material, group: Object | null, lightsNode: LightsNode, clippingContext: ClippingContext, passId?: string | null | undefined) => any) | null): void; + /** + * Returns the current render object function. + * + * @return {?Function} The current render object function. Returns `null` if no function is set. + */ + getRenderObjectFunction(): Function | null; + /** + * Execute a single or an array of compute nodes. This method can only be called + * if the renderer has been initialized. + * + * @param {Node|Array} computeNodes - The compute node(s). + * @param {number|Array|IndirectStorageBufferAttribute} [dispatchSize=null] + * - A single number representing count, or + * - An array [x, y, z] representing dispatch size, or + * - A IndirectStorageBufferAttribute for indirect dispatch size. + * @return {Promise|undefined} A Promise that resolve when the compute has finished. Only returned when the renderer has not been initialized. + */ + compute(computeNodes: Node | Array, dispatchSize?: number | Array | IndirectStorageBufferAttribute): Promise | undefined; + /** + * Execute a single or an array of compute nodes. + * + * @async + * @param {Node|Array} computeNodes - The compute node(s). + * @param {number|Array|IndirectStorageBufferAttribute} [dispatchSize=null] + * - A single number representing count, or + * - An array [x, y, z] representing dispatch size, or + * - A IndirectStorageBufferAttribute for indirect dispatch size. + * @return {Promise} A Promise that resolve when the compute has finished. + */ + computeAsync(computeNodes: Node | Array, dispatchSize?: number | Array | IndirectStorageBufferAttribute): Promise; + /** + * Checks if the given feature is supported by the selected backend. + * + * @async + * @deprecated + * @param {string} name - The feature's name. + * @return {Promise} A Promise that resolves with a bool that indicates whether the feature is supported or not. + */ + hasFeatureAsync(name: string): Promise; + resolveTimestampsAsync(type?: string): Promise; + /** + * Checks if the given feature is supported by the selected backend. If the + * renderer has not been initialized, this method always returns `false`. + * + * @param {string} name - The feature's name. + * @return {boolean} Whether the feature is supported or not. + */ + hasFeature(name: string): boolean; + /** + * Returns `true` when the renderer has been initialized. + * + * @return {boolean} Whether the renderer has been initialized or not. + */ + hasInitialized(): boolean; + /** + * Initializes the given textures. Useful for preloading a texture rather than waiting until first render + * (which can cause noticeable lags due to decode and GPU upload overhead). + * + * @async + * @deprecated + * @param {Texture} texture - The texture. + * @return {Promise} A Promise that resolves when the texture has been initialized. + */ + initTextureAsync(texture: Texture): Promise; + /** + * Initializes the given texture. Useful for preloading a texture rather than waiting until first render + * (which can cause noticeable lags due to decode and GPU upload overhead). + * + * This method can only be used if the renderer has been initialized. + * + * @param {Texture} texture - The texture. + */ + initTexture(texture: Texture): void; + /** + * Initializes the given render target. + * + * @param {RenderTarget} renderTarget - The render target to intialize. + */ + initRenderTarget(renderTarget: RenderTarget): void; + /** + * Copies the current bound framebuffer into the given texture. + * + * @param {FramebufferTexture} framebufferTexture - The texture. + * @param {?(Vector2|Vector4)} [rectangle=null] - A two or four dimensional vector that defines the rectangular portion of the framebuffer that should be copied. + */ + copyFramebufferToTexture(framebufferTexture: FramebufferTexture, rectangle?: (Vector2 | Vector4) | null): void; + /** + * Copies data of the given source texture into a destination texture. + * + * @param {Texture} srcTexture - The source texture. + * @param {Texture} dstTexture - The destination texture. + * @param {Box2|Box3} [srcRegion=null] - A bounding box which describes the source region. Can be two or three-dimensional. + * @param {Vector2|Vector3} [dstPosition=null] - A vector that represents the origin of the destination region. Can be two or three-dimensional. + * @param {number} [srcLevel=0] - The source mip level to copy from. + * @param {number} [dstLevel=0] - The destination mip level to copy to. + */ + copyTextureToTexture(srcTexture: Texture, dstTexture: Texture, srcRegion?: Box2 | Box3, dstPosition?: Vector2 | Vector3, srcLevel?: number, dstLevel?: number): void; + /** + * Reads pixel data from the given render target. + * + * @async + * @param {RenderTarget} renderTarget - The render target to read from. + * @param {number} x - The `x` coordinate of the copy region's origin. + * @param {number} y - The `y` coordinate of the copy region's origin. + * @param {number} width - The width of the copy region. + * @param {number} height - The height of the copy region. + * @param {number} [textureIndex=0] - The texture index of a MRT render target. + * @param {number} [faceIndex=0] - The active cube face index. + * @return {Promise} A Promise that resolves when the read has been finished. The resolve provides the read data as a typed array. + */ + readRenderTargetPixelsAsync(renderTarget: RenderTarget, x: number, y: number, width: number, height: number, textureIndex?: number, faceIndex?: number): Promise; + /** + * Analyzes the given 3D object's hierarchy and builds render lists from the + * processed hierarchy. + * + * @private + * @param {Object3D} object - The 3D object to process (usually a scene). + * @param {Camera} camera - The camera the object is rendered with. + * @param {number} groupOrder - The group order is derived from the `renderOrder` of groups and is used to group 3D objects within groups. + * @param {RenderList} renderList - The current render list. + * @param {ClippingContext} clippingContext - The current clipping context. + */ + private _projectObject; + /** + * Renders the given render bundles. + * + * @private + * @param {Array} bundles - Array with render bundle data. + * @param {Scene} sceneRef - The scene the render bundles belong to. + * @param {LightsNode} lightsNode - The current lights node. + */ + private _renderBundles; + /** + * Renders the transparent objects from the given render lists. + * + * @private + * @param {Array} renderList - The transparent render list. + * @param {Array} doublePassList - The list of transparent objects which require a double pass (e.g. because of transmission). + * @param {Camera} camera - The camera the render list should be rendered with. + * @param {Scene} scene - The scene the render list belongs to. + * @param {LightsNode} lightsNode - The current lights node. + */ + private _renderTransparents; + /** + * Renders the objects from the given render list. + * + * @private + * @param {Array} renderList - The render list. + * @param {Camera} camera - The camera the render list should be rendered with. + * @param {Scene} scene - The scene the render list belongs to. + * @param {LightsNode} lightsNode - The current lights node. + * @param {?string} [passId=null] - An optional ID for identifying the pass. + */ + private _renderObjects; + /** + * Retrieves shadow nodes for the given material. This is used to setup shadow passes. + * The result is cached per material and updated when the material's version changes. + * + * @private + * @param {Material} material + * @returns {Object} - The shadow nodes for the material. + */ + private _getShadowNodes; + /** + * This method represents the default render object function that manages the render lifecycle + * of the object. + * + * @param {Object3D} object - The 3D object. + * @param {Scene} scene - The scene the 3D object belongs to. + * @param {Camera} camera - The camera the object should be rendered with. + * @param {BufferGeometry} geometry - The object's geometry. + * @param {Material} material - The object's material. + * @param {?Object} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. + * @param {LightsNode} lightsNode - The current lights node. + * @param {?ClippingContext} clippingContext - The clipping context. + * @param {?string} [passId=null] - An optional ID for identifying the pass. + */ + renderObject(object: Object3D, scene: Scene, camera: Camera, geometry: BufferGeometry, material: Material, group: Object | null, lightsNode: LightsNode, clippingContext?: ClippingContext | null, passId?: string | null): void; + /** + * Checks if the given compatibility is supported by the selected backend. + * + * @param {string} name - The compatibility's name. + * @return {boolean} Whether the compatibility is supported or not. + */ + hasCompatibility(name: string): boolean; + /** + * This method represents the default `_handleObjectFunction` implementation which creates + * a render object from the given data and performs the draw command with the selected backend. + * + * @private + * @param {Object3D} object - The 3D object. + * @param {Material} material - The object's material. + * @param {Scene} scene - The scene the 3D object belongs to. + * @param {Camera} camera - The camera the object should be rendered with. + * @param {LightsNode} lightsNode - The current lights node. + * @param {?{start: number, count: number}} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. + * @param {ClippingContext} clippingContext - The clipping context. + * @param {string} [passId] - An optional ID for identifying the pass. + */ + private _renderObjectDirect; + /** + * A different implementation for `_handleObjectFunction` which only makes sure the object is ready for rendering. + * Used in `compileAsync()`. + * + * @private + * @param {Object3D} object - The 3D object. + * @param {Material} material - The object's material. + * @param {Scene} scene - The scene the 3D object belongs to. + * @param {Camera} camera - The camera the object should be rendered with. + * @param {LightsNode} lightsNode - The current lights node. + * @param {?{start: number, count: number}} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. + * @param {ClippingContext} clippingContext - The clipping context. + * @param {string} [passId] - An optional ID for identifying the pass. + */ + private _createObjectPipeline; + /** + * Alias for `compileAsync()`. + * + * @method + * @param {Object3D} scene - The scene or 3D object to precompile. + * @param {Camera} camera - The camera that is used to render the scene. + * @param {Scene} targetScene - If the first argument is a 3D object, this parameter must represent the scene the 3D object is going to be added. + * @return {function(Object3D, Camera, ?Scene): Promise|undefined} A Promise that resolves when the compile has been finished. + */ + get compile(): (arg0: Object3D, arg1: Camera, arg2: Scene | null) => Promise | undefined; +} +import Info from './Info.js'; +import NodeLibrary from './nodes/NodeLibrary.js'; +import Lighting from './Lighting.js'; +import XRManager from './XRManager.js'; +import { Scene } from '../../scenes/Scene.js'; +import InspectorBase from './InspectorBase.js'; +import { Vector2 } from '../../math/Vector2.js'; +import { Vector4 } from '../../math/Vector4.js'; +import { RenderTarget } from '../../core/RenderTarget.js'; +import CanvasTarget from './CanvasTarget.js'; +import ClippingContext from './ClippingContext.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/RendererUtils.d.ts b/jsdoc-testing/jsdoc/renderers/common/RendererUtils.d.ts new file mode 100644 index 000000000..8809693b3 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/RendererUtils.d.ts @@ -0,0 +1,105 @@ +/** + * Saves the state of the given renderer and stores it into the given state object. + * + * If not state object is provided, the function creates one. + * + * @private + * @function + * @param {Renderer} renderer - The renderer. + * @param {Object} [state={}] - The state. + * @return {Object} The state. + */ +export function saveRendererState(renderer: Renderer, state?: Object): Object; +/** + * Saves the state of the given renderer and stores it into the given state object. + * Besides, the function also resets the state of the renderer to its default values. + * + * If not state object is provided, the function creates one. + * + * @private + * @function + * @param {Renderer} renderer - The renderer. + * @param {Object} [state={}] - The state. + * @return {Object} The state. + */ +export function resetRendererState(renderer: Renderer, state?: Object): Object; +/** + * Restores the state of the given renderer from the given state object. + * + * @private + * @function + * @param {Renderer} renderer - The renderer. + * @param {Object} state - The state to restore. + */ +export function restoreRendererState(renderer: Renderer, state: Object): void; +/** + * Saves the state of the given scene and stores it into the given state object. + * + * If not state object is provided, the function creates one. + * + * @private + * @function + * @param {Scene} scene - The scene. + * @param {Object} [state={}] - The state. + * @return {Object} The state. + */ +export function saveSceneState(scene: Scene, state?: Object): Object; +/** + * Saves the state of the given scene and stores it into the given state object. + * Besides, the function also resets the state of the scene to its default values. + * + * If not state object is provided, the function creates one. + * + * @private + * @function + * @param {Scene} scene - The scene. + * @param {Object} [state={}] - The state. + * @return {Object} The state. + */ +export function resetSceneState(scene: Scene, state?: Object): Object; +/** + * Restores the state of the given scene from the given state object. + * + * @private + * @function + * @param {Scene} scene - The scene. + * @param {Object} state - The state to restore. + */ +export function restoreSceneState(scene: Scene, state: Object): void; +/** + * Saves the state of the given renderer and scene and stores it into the given state object. + * + * If not state object is provided, the function creates one. + * + * @private + * @function + * @param {Renderer} renderer - The renderer. + * @param {Scene} scene - The scene. + * @param {Object} [state={}] - The state. + * @return {Object} The state. + */ +export function saveRendererAndSceneState(renderer: Renderer, scene: Scene, state?: Object): Object; +/** + * Saves the state of the given renderer and scene and stores it into the given state object. + * Besides, the function also resets the state of the renderer and scene to its default values. + * + * If not state object is provided, the function creates one. + * + * @private + * @function + * @param {Renderer} renderer - The renderer. + * @param {Scene} scene - The scene. + * @param {Object} [state={}] - The state. + * @return {Object} The state. + */ +export function resetRendererAndSceneState(renderer: Renderer, scene: Scene, state?: Object): Object; +/** + * Restores the state of the given renderer and scene from the given state object. + * + * @private + * @function + * @param {Renderer} renderer - The renderer. + * @param {Scene} scene - The scene. + * @param {Object} state - The state to restore. + */ +export function restoreRendererAndSceneState(renderer: Renderer, scene: Scene, state: Object): void; diff --git a/jsdoc-testing/jsdoc/renderers/common/SampledTexture.d.ts b/jsdoc-testing/jsdoc/renderers/common/SampledTexture.d.ts new file mode 100644 index 000000000..990534644 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/SampledTexture.d.ts @@ -0,0 +1,85 @@ +/** + * Represents a sampled texture binding type. + * + * @private + * @augments Sampler + */ +export class SampledTexture extends Sampler { + /** + * This identifier. + * + * @type {number} + */ + id: number; + /** + * Whether the texture is a storage texture or not. + * + * @type {boolean} + * @default false + */ + store: boolean; + /** + * The mip level to bind for storage textures. + * + * @type {number} + * @default 0 + */ + mipLevel: number; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isSampledTexture: boolean; +} +/** + * Represents a sampled array texture binding type. + * + * @private + * @augments SampledTexture + */ +export class SampledArrayTexture extends SampledTexture { + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isSampledArrayTexture: boolean; +} +/** + * Represents a sampled 3D texture binding type. + * + * @private + * @augments SampledTexture + */ +export class Sampled3DTexture extends SampledTexture { + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isSampled3DTexture: boolean; +} +/** + * Represents a sampled cube texture binding type. + * + * @private + * @augments SampledTexture + */ +export class SampledCubeTexture extends SampledTexture { + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isSampledCubeTexture: boolean; +} +import Sampler from './Sampler.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/Sampler.d.ts b/jsdoc-testing/jsdoc/renderers/common/Sampler.d.ts new file mode 100644 index 000000000..afde1540d --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/Sampler.d.ts @@ -0,0 +1,66 @@ +export default Sampler; +/** + * Represents a sampler binding type. + * + * @private + * @augments Binding + */ +declare class Sampler extends Binding { + /** + * Constructs a new sampler. + * + * @param {string} name - The samplers's name. + * @param {?Texture} texture - The texture this binding is referring to. + */ + constructor(name: string, texture: Texture | null); + /** + * The texture the sampler is referring to. + * + * @private + * @type {?Texture} + */ + private _texture; + /** + * An event listener which is added to {@link texture}'s dispose event. + * + * @private + * @type {Function} + */ + private _onTextureDispose; + generation: number | null; + version: number; + /** + * Sets the texture of this sampler. + * + * @param {Texture} value - The texture to set. + */ + set texture(value: Texture); + /** + * Gets the texture of this sampler. + * @return {?Texture} The texture. + */ + get texture(): Texture | null; + /** + * The binding's sampler key. + * + * @type {string} + * @default '' + */ + samplerKey: string; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isSampler: boolean; + /** + * Updates the binding. + * + * @return {boolean} Whether the texture has been updated and must be + * uploaded to the GPU. + */ + update(): boolean; +} +import Binding from './Binding.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/Storage3DTexture.d.ts b/jsdoc-testing/jsdoc/renderers/common/Storage3DTexture.d.ts new file mode 100644 index 000000000..5ea5a3e6b --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/Storage3DTexture.d.ts @@ -0,0 +1,52 @@ +export default Storage3DTexture; +/** + * This special type of texture is intended for compute shaders. + * It can be used to compute the data of a texture with a compute shader. + * + * Note: This type of texture can only be used with `WebGPURenderer` + * and a WebGPU backend. + * + * @augments Texture + */ +declare class Storage3DTexture extends Texture { + /** + * Constructs a new storage texture. + * + * @param {number} [width=1] - The storage texture's width. + * @param {number} [height=1] - The storage texture's height. + * @param {number} [depth=1] - The storage texture's depth. + */ + constructor(width?: number, height?: number, depth?: number); + isArrayTexture: boolean; + /** + * This defines how the texture is wrapped in the depth direction and corresponds to + * *W* in UVW mapping. + * + * @type {number} + */ + wrapR: number; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isStorageTexture: boolean; + /** + * Indicates whether this texture is a 3D texture. + * + * @type {boolean} + * + */ + is3DTexture: boolean; + /** + * Sets the size of the storage 3d texture. + * + * @param {number} width - The new width of the storage texture. + * @param {number} height - The new height of the storage texture. + * @param {number} depth - The new depth of the storage texture. + */ + setSize(width: number, height: number, depth: number): void; +} +import { Texture } from '../../textures/Texture.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/StorageArrayTexture.d.ts b/jsdoc-testing/jsdoc/renderers/common/StorageArrayTexture.d.ts new file mode 100644 index 000000000..27581e2fc --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/StorageArrayTexture.d.ts @@ -0,0 +1,38 @@ +export default StorageArrayTexture; +/** + * This special type of texture is intended for compute shaders. + * It can be used to compute the data of a texture with a compute shader. + * + * Note: This type of texture can only be used with `WebGPURenderer` + * and a WebGPU backend. + * + * @augments Texture + */ +declare class StorageArrayTexture extends Texture { + /** + * Constructs a new storage texture. + * + * @param {number} [width=1] - The storage texture's width. + * @param {number} [height=1] - The storage texture's height. + * @param {number} [depth=1] - The storage texture's depth. + */ + constructor(width?: number, height?: number, depth?: number); + isArrayTexture: boolean; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isStorageTexture: boolean; + /** + * Sets the size of the storage array texture. + * + * @param {number} width - The new width of the storage texture. + * @param {number} height - The new height of the storage texture. + * @param {number} depth - The new depth of the storage texture. + */ + setSize(width: number, height: number, depth: number): void; +} +import { Texture } from '../../textures/Texture.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/StorageBuffer.d.ts b/jsdoc-testing/jsdoc/renderers/common/StorageBuffer.d.ts new file mode 100644 index 000000000..d4de63398 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/StorageBuffer.d.ts @@ -0,0 +1,38 @@ +export default StorageBuffer; +/** + * Represents a storage buffer binding type. + * + * @private + * @augments Buffer + */ +declare class StorageBuffer extends Buffer { + /** + * Constructs a new uniform buffer. + * + * @param {string} name - The buffer's name. + * @param {BufferAttribute} attribute - The buffer attribute. + */ + constructor(name: string, attribute: BufferAttribute); + /** + * This flag can be used for type testing. + * + * @private + * @type {BufferAttribute} + */ + private _attribute; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isStorageBuffer: boolean; + /** + * The storage buffer attribute. + * + * @type {BufferAttribute} + */ + get attribute(): BufferAttribute; +} +import Buffer from './Buffer.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/StorageBufferAttribute.d.ts b/jsdoc-testing/jsdoc/renderers/common/StorageBufferAttribute.d.ts new file mode 100644 index 000000000..d53cac3dc --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/StorageBufferAttribute.d.ts @@ -0,0 +1,35 @@ +export default StorageBufferAttribute; +/** + * This special type of buffer attribute is intended for compute shaders. + * In earlier three.js versions it was only possible to update attribute data + * on the CPU via JavaScript and then upload the data to the GPU. With the + * new material system and renderer it is now possible to use compute shaders + * to compute the data for an attribute more efficiently on the GPU. + * + * The idea is to create an instance of this class and provide it as an input + * to {@link StorageBufferNode}. + * + * Note: This type of buffer attribute can only be used with `WebGPURenderer`. + * + * @augments BufferAttribute + */ +declare class StorageBufferAttribute extends BufferAttribute { + /** + * Constructs a new storage buffer attribute. + * + * @param {number|TypedArray} count - The item count. It is also valid to pass a typed array as an argument. + * The subsequent parameters are then obsolete. + * @param {number} itemSize - The item size. + * @param {TypedArray.constructor} [typeClass=Float32Array] - A typed array constructor. + */ + constructor(count: number | TypedArray, itemSize: number, typeClass?: TypedArray.constructor); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isStorageBufferAttribute: boolean; +} +import { BufferAttribute } from '../../core/BufferAttribute.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/StorageInstancedBufferAttribute.d.ts b/jsdoc-testing/jsdoc/renderers/common/StorageInstancedBufferAttribute.d.ts new file mode 100644 index 000000000..6f8614323 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/StorageInstancedBufferAttribute.d.ts @@ -0,0 +1,35 @@ +export default StorageInstancedBufferAttribute; +/** + * This special type of instanced buffer attribute is intended for compute shaders. + * In earlier three.js versions it was only possible to update attribute data + * on the CPU via JavaScript and then upload the data to the GPU. With the + * new material system and renderer it is now possible to use compute shaders + * to compute the data for an attribute more efficiently on the GPU. + * + * The idea is to create an instance of this class and provide it as an input + * to {@link StorageBufferNode}. + * + * Note: This type of buffer attribute can only be used with `WebGPURenderer`. + * + * @augments InstancedBufferAttribute + */ +declare class StorageInstancedBufferAttribute extends InstancedBufferAttribute { + /** + * Constructs a new storage instanced buffer attribute. + * + * @param {number|TypedArray} count - The item count. It is also valid to pass a typed array as an argument. + * The subsequent parameters are then obsolete. + * @param {number} itemSize - The item size. + * @param {TypedArray.constructor} [typeClass=Float32Array] - A typed array constructor. + */ + constructor(count: number | TypedArray, itemSize: number, typeClass?: TypedArray.constructor); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isStorageInstancedBufferAttribute: boolean; +} +import { InstancedBufferAttribute } from '../../core/InstancedBufferAttribute.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/StorageTexture.d.ts b/jsdoc-testing/jsdoc/renderers/common/StorageTexture.d.ts new file mode 100644 index 000000000..a369bd6e8 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/StorageTexture.d.ts @@ -0,0 +1,43 @@ +export default StorageTexture; +/** + * This special type of texture is intended for compute shaders. + * It can be used to compute the data of a texture with a compute shader. + * + * Note: This type of texture can only be used with `WebGPURenderer` + * and a WebGPU backend. + * + * @augments Texture + */ +declare class StorageTexture extends Texture { + /** + * Constructs a new storage texture. + * + * @param {number} [width=1] - The storage texture's width. + * @param {number} [height=1] - The storage texture's height. + */ + constructor(width?: number, height?: number); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isStorageTexture: boolean; + /** + * When `true`, mipmaps will be auto-generated after compute writes. + * When `false`, mipmaps must be written manually via compute shaders. + * + * @type {boolean} + * @default true + */ + mipmapsAutoUpdate: boolean; + /** + * Sets the size of the storage texture. + * + * @param {number} width - The new width of the storage texture. + * @param {number} height - The new height of the storage texture. + */ + setSize(width: number, height: number): void; +} +import { Texture } from '../../textures/Texture.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/Textures.d.ts b/jsdoc-testing/jsdoc/renderers/common/Textures.d.ts new file mode 100644 index 000000000..760132d9d --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/Textures.d.ts @@ -0,0 +1,110 @@ +export default Textures; +/** + * This module manages the textures of the renderer. + * + * @private + * @augments DataMap + */ +declare class Textures extends DataMap { + /** + * Constructs a new texture management component. + * + * @param {Renderer} renderer - The renderer. + * @param {Backend} backend - The renderer's backend. + * @param {Info} info - Renderer component for managing metrics and monitoring data. + */ + constructor(renderer: Renderer, backend: Backend, info: Info); + /** + * The renderer. + * + * @type {Renderer} + */ + renderer: Renderer; + /** + * The backend. + * + * @type {Backend} + */ + backend: Backend; + /** + * Renderer component for managing metrics and monitoring data. + * + * @type {Info} + */ + info: Info; + /** + * Updates the given render target. Based on the given render target configuration, + * it updates the texture states representing the attachments of the framebuffer. + * + * @param {RenderTarget} renderTarget - The render target to update. + * @param {number} [activeMipmapLevel=0] - The active mipmap level. + */ + updateRenderTarget(renderTarget: RenderTarget, activeMipmapLevel?: number): void; + /** + * Updates the given texture. Depending on the texture state, this method + * triggers the upload of texture data to the GPU memory. If the texture data are + * not yet ready for the upload, it uses default texture data for as a placeholder. + * + * @param {Texture} texture - The texture to update. + * @param {Object} [options={}] - The options. + */ + updateTexture(texture: Texture, options?: Object): void; + /** + * Updates the sampler for the given texture. This method has no effect + * for the WebGL backend since it has no concept of samplers. Texture + * parameters are configured with the `texParameter()` command for each + * texture. + * + * In WebGPU, samplers are objects like textures and it's possible to share + * them when the texture parameters match. + * + * @param {Texture} texture - The texture to update the sampler for. + * @return {string} The current sampler key. + */ + updateSampler(texture: Texture): string; + /** + * Computes the size of the given texture and writes the result + * into the target vector. This vector is also returned by the + * method. + * + * If no texture data are available for the compute yet, the method + * returns default size values. + * + * @param {Texture} texture - The texture to compute the size for. + * @param {Vector3} target - The target vector. + * @return {Vector3} The target vector. + */ + getSize(texture: Texture, target?: Vector3): Vector3; + /** + * Computes the number of mipmap levels for the given texture. + * + * @param {Texture} texture - The texture. + * @param {number} width - The texture's width. + * @param {number} height - The texture's height. + * @return {number} The number of mipmap levels. + */ + getMipLevels(texture: Texture, width: number, height: number): number; + /** + * Returns `true` if the given texture makes use of mipmapping. + * + * @param {Texture} texture - The texture. + * @return {boolean} Whether mipmaps are required or not. + */ + needsMipmaps(texture: Texture): boolean; + /** + * Frees internal resources when the given render target isn't + * required anymore. + * + * @param {RenderTarget} renderTarget - The render target to destroy. + */ + _destroyRenderTarget(renderTarget: RenderTarget): void; + /** + * Frees internal resource when the given texture isn't + * required anymore. + * + * @param {Texture} texture - The texture to destroy. + */ + _destroyTexture(texture: Texture): void; +} +import DataMap from './DataMap.js'; +import { Vector3 } from '../../math/Vector3.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/TimestampQueryPool.d.ts b/jsdoc-testing/jsdoc/renderers/common/TimestampQueryPool.d.ts new file mode 100644 index 000000000..82eedbdd9 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/TimestampQueryPool.d.ts @@ -0,0 +1,119 @@ +export default TimestampQueryPool; +/** + * Abstract base class of a timestamp query pool. + * + * @abstract + */ +declare class TimestampQueryPool { + /** + * Creates a new timestamp query pool. + * + * @param {number} [maxQueries=256] - Maximum number of queries this pool can hold. + */ + constructor(maxQueries?: number); + /** + * Whether to track timestamps or not. + * + * @type {boolean} + * @default true + */ + trackTimestamp: boolean; + /** + * Maximum number of queries this pool can hold. + * + * @type {number} + * @default 256 + */ + maxQueries: number; + /** + * How many queries allocated so far. + * + * @type {number} + * @default 0 + */ + currentQueryIndex: number; + /** + * Tracks offsets for different contexts. + * + * @type {Map} + */ + queryOffsets: Map; + /** + * Whether the pool has been disposed or not. + * + * @type {boolean} + * @default false + */ + isDisposed: boolean; + /** + * The total frame duration until the next update. + * + * @type {number} + * @default 0 + */ + lastValue: number; + /** + * Stores all timestamp frames. + * + * @type {Array} + */ + frames: Array; + /** + * This property is used to avoid multiple concurrent resolve operations. + * The WebGL backend uses it as a boolean flag. In context of WebGPU, it holds + * the promise of the current resolve operation. + * + * @type {boolean|Promise} + * @default false + */ + pendingResolve: boolean | Promise; + /** + * Stores the latest timestamp for each render context. + * + * @type {Map} + */ + timestamps: Map; + /** + * Returns all timestamp frames. + * + * @return {Array} The timestamp frames. + */ + getTimestampFrames(): Array; + /** + * Returns the timestamp for a given render context. + * + * @param {string} uid - A unique identifier for the render context. + * @return {?number} The timestamp, or undefined if not available. + */ + getTimestamp(uid: string): number | null; + /** + * Returns whether a timestamp is available for a given render context. + * + * @param {string} uid - A unique identifier for the render context. + * @return {boolean} True if a timestamp is available, false otherwise. + */ + hasTimestamp(uid: string): boolean; + /** + * Allocate queries for a specific uid. + * + * @abstract + * @param {string} uid - A unique identifier for the render context. + * @param {number} frameId - The current frame identifier. + * @returns {?number} + */ + allocateQueriesForContext(): number | null; + /** + * Resolve all timestamps and return data (or process them). + * + * @abstract + * @async + * @returns {Promise|number} The resolved timestamp value. + */ + resolveQueriesAsync(): Promise | number; + /** + * Dispose of the query pool. + * + * @abstract + */ + dispose(): void; +} diff --git a/jsdoc-testing/jsdoc/renderers/common/Uniform.d.ts b/jsdoc-testing/jsdoc/renderers/common/Uniform.d.ts new file mode 100644 index 000000000..d8d107299 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/Uniform.d.ts @@ -0,0 +1,260 @@ +/** + * Represents a Number uniform. + * + * @private + * @augments Uniform + */ +export class NumberUniform extends Uniform { + /** + * Constructs a new Number uniform. + * + * @param {string} name - The uniform's name. + * @param {number} value - The uniform's value. + */ + constructor(name: string, value?: number); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isNumberUniform: boolean; +} +/** + * Represents a Vector2 uniform. + * + * @private + * @augments Uniform + */ +export class Vector2Uniform extends Uniform { + /** + * Constructs a new Number uniform. + * + * @param {string} name - The uniform's name. + * @param {Vector2} value - The uniform's value. + */ + constructor(name: string, value?: Vector2); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isVector2Uniform: boolean; +} +/** + * Represents a Vector3 uniform. + * + * @private + * @augments Uniform + */ +export class Vector3Uniform extends Uniform { + /** + * Constructs a new Number uniform. + * + * @param {string} name - The uniform's name. + * @param {Vector3} value - The uniform's value. + */ + constructor(name: string, value?: Vector3); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isVector3Uniform: boolean; +} +/** + * Represents a Vector4 uniform. + * + * @private + * @augments Uniform + */ +export class Vector4Uniform extends Uniform { + /** + * Constructs a new Number uniform. + * + * @param {string} name - The uniform's name. + * @param {Vector4} value - The uniform's value. + */ + constructor(name: string, value?: Vector4); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isVector4Uniform: boolean; +} +/** + * Represents a Color uniform. + * + * @private + * @augments Uniform + */ +export class ColorUniform extends Uniform { + /** + * Constructs a new Number uniform. + * + * @param {string} name - The uniform's name. + * @param {Color} value - The uniform's value. + */ + constructor(name: string, value?: Color); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isColorUniform: boolean; +} +/** + * Represents a Matrix2 uniform. + * + * @private + * @augments Uniform + */ +export class Matrix2Uniform extends Uniform { + /** + * Constructs a new Number uniform. + * + * @param {string} name - The uniform's name. + * @param {Matrix2} value - The uniform's value. + */ + constructor(name: string, value?: Matrix2); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isMatrix2Uniform: boolean; +} +/** + * Represents a Matrix3 uniform. + * + * @private + * @augments Uniform + */ +export class Matrix3Uniform extends Uniform { + /** + * Constructs a new Number uniform. + * + * @param {string} name - The uniform's name. + * @param {Matrix3} value - The uniform's value. + */ + constructor(name: string, value?: Matrix3); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isMatrix3Uniform: boolean; +} +/** + * Represents a Matrix4 uniform. + * + * @private + * @augments Uniform + */ +export class Matrix4Uniform extends Uniform { + /** + * Constructs a new Number uniform. + * + * @param {string} name - The uniform's name. + * @param {Matrix4} value - The uniform's value. + */ + constructor(name: string, value?: Matrix4); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isMatrix4Uniform: boolean; +} +/** + * Abstract base class for uniforms. + * + * @abstract + * @private + */ +declare class Uniform { + /** + * Constructs a new uniform. + * + * @param {string} name - The uniform's name. + * @param {any} value - The uniform's value. + */ + constructor(name: string, value: any); + /** + * The uniform's name. + * + * @type {string} + */ + name: string; + /** + * The uniform's value. + * + * @type {any} + */ + value: any; + /** + * Used to build the uniform buffer according to the STD140 layout. + * Derived uniforms will set this property to a data type specific + * value. + * + * @type {number} + */ + boundary: number; + /** + * The item size. Derived uniforms will set this property to a data + * type specific value. + * + * @type {number} + */ + itemSize: number; + /** + * This property is set by {@link UniformsGroup} and marks + * the start position in the uniform buffer. + * + * @type {number} + */ + offset: number; + /** + * This property is set by {@link UniformsGroup} and marks + * the index position in the uniform array. + * + * @type {number} + */ + index: number; + /** + * Sets the uniform's value. + * + * @param {any} value - The value to set. + */ + setValue(value: any): void; + /** + * Returns the uniform's value. + * + * @return {any} The value. + */ + getValue(): any; +} +import { Vector2 } from '../../math/Vector2.js'; +import { Vector3 } from '../../math/Vector3.js'; +import { Vector4 } from '../../math/Vector4.js'; +import { Color } from '../../math/Color.js'; +import { Matrix2 } from '../../math/Matrix2.js'; +import { Matrix3 } from '../../math/Matrix3.js'; +import { Matrix4 } from '../../math/Matrix4.js'; +export {}; diff --git a/jsdoc-testing/jsdoc/renderers/common/UniformBuffer.d.ts b/jsdoc-testing/jsdoc/renderers/common/UniformBuffer.d.ts new file mode 100644 index 000000000..15af25d88 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/UniformBuffer.d.ts @@ -0,0 +1,18 @@ +export default UniformBuffer; +/** + * Represents a uniform buffer binding type. + * + * @private + * @augments Buffer + */ +declare class UniformBuffer extends Buffer { + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isUniformBuffer: boolean; +} +import Buffer from './Buffer.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/UniformsGroup.d.ts b/jsdoc-testing/jsdoc/renderers/common/UniformsGroup.d.ts new file mode 100644 index 000000000..4cf3fe53c --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/UniformsGroup.d.ts @@ -0,0 +1,139 @@ +export default UniformsGroup; +/** + * This class represents a uniform buffer binding but with + * an API that allows to maintain individual uniform objects. + * + * @private + * @augments UniformBuffer + */ +declare class UniformsGroup extends UniformBuffer { + /** + * Constructs a new uniforms group. + * + * @param {string} name - The group's name. + */ + constructor(name: string); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isUniformsGroup: boolean; + /** + * An array with the raw uniform values. + * + * @private + * @type {?Array} + * @default null + */ + private _values; + /** + * An array of uniform objects. + * + * The order of uniforms in this array must match the order of uniforms in the shader. + * + * @type {Array} + */ + uniforms: Array; + /** + * A cache for the uniform update ranges. + * + * @private + * @type {Map} + */ + private _updateRangeCache; + /** + * Adds a uniform's update range to this buffer. + * + * @param {Uniform} uniform - The uniform. + */ + addUniformUpdateRange(uniform: Uniform): void; + /** + * Adds a uniform to this group. + * + * @param {Uniform} uniform - The uniform to add. + * @return {UniformsGroup} A reference to this group. + */ + addUniform(uniform: Uniform): UniformsGroup; + /** + * Removes a uniform from this group. + * + * @param {Uniform} uniform - The uniform to remove. + * @return {UniformsGroup} A reference to this group. + */ + removeUniform(uniform: Uniform): UniformsGroup; + /** + * An array with the raw uniform values. + * + * @type {Array} + */ + get values(): Array; + /** + * Updates a given uniform by calling an update method matching + * the uniforms type. + * + * @param {Uniform} uniform - The uniform to update. + * @return {boolean} Whether the uniform has been updated or not. + */ + updateByType(uniform: Uniform): boolean; + /** + * Updates a given Number uniform. + * + * @param {NumberUniform} uniform - The Number uniform. + * @return {boolean} Whether the uniform has been updated or not. + */ + updateNumber(uniform: NumberUniform): boolean; + /** + * Updates a given Vector2 uniform. + * + * @param {Vector2Uniform} uniform - The Vector2 uniform. + * @return {boolean} Whether the uniform has been updated or not. + */ + updateVector2(uniform: Vector2Uniform): boolean; + /** + * Updates a given Vector3 uniform. + * + * @param {Vector3Uniform} uniform - The Vector3 uniform. + * @return {boolean} Whether the uniform has been updated or not. + */ + updateVector3(uniform: Vector3Uniform): boolean; + /** + * Updates a given Vector4 uniform. + * + * @param {Vector4Uniform} uniform - The Vector4 uniform. + * @return {boolean} Whether the uniform has been updated or not. + */ + updateVector4(uniform: Vector4Uniform): boolean; + /** + * Updates a given Color uniform. + * + * @param {ColorUniform} uniform - The Color uniform. + * @return {boolean} Whether the uniform has been updated or not. + */ + updateColor(uniform: ColorUniform): boolean; + /** + * Updates a given Matrix3 uniform. + * + * @param {Matrix3Uniform} uniform - The Matrix3 uniform. + * @return {boolean} Whether the uniform has been updated or not. + */ + updateMatrix3(uniform: Matrix3Uniform): boolean; + /** + * Updates a given Matrix4 uniform. + * + * @param {Matrix4Uniform} uniform - The Matrix4 uniform. + * @return {boolean} Whether the uniform has been updated or not. + */ + updateMatrix4(uniform: Matrix4Uniform): boolean; + /** + * Returns a typed array that matches the given data type. + * + * @private + * @param {string} type - The data type. + * @return {TypedArray} The typed array. + */ + private _getBufferForType; +} +import UniformBuffer from './UniformBuffer.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/XRManager.d.ts b/jsdoc-testing/jsdoc/renderers/common/XRManager.d.ts new file mode 100644 index 000000000..dafd87882 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/XRManager.d.ts @@ -0,0 +1,516 @@ +export default XRManager; +/** + * The XR manager is built on top of the WebXR Device API to + * manage XR sessions with `WebGPURenderer`. + * + * XR is currently only supported with a WebGL 2 backend. + * + * @augments EventDispatcher + */ +declare class XRManager extends EventDispatcher { + /** + * Constructs a new XR manager. + * + * @param {Renderer} renderer - The renderer. + * @param {boolean} [multiview=false] - Enables multiview if the device supports it. + */ + constructor(renderer: Renderer, multiview?: boolean); + /** + * This flag globally enables XR rendering. + * + * @type {boolean} + * @default false + */ + enabled: boolean; + /** + * Whether the XR device is currently presenting or not. + * + * @type {boolean} + * @default false + * @readonly + */ + readonly isPresenting: boolean; + /** + * Whether the XR camera should automatically be updated or not. + * + * @type {boolean} + * @default true + */ + cameraAutoUpdate: boolean; + /** + * The renderer. + * + * @private + * @type {Renderer} + */ + private _renderer; + /** + * Represents the camera for the left eye. + * + * @private + * @type {PerspectiveCamera} + */ + private _cameraL; + /** + * Represents the camera for the right eye. + * + * @private + * @type {PerspectiveCamera} + */ + private _cameraR; + /** + * A list of cameras used for rendering the XR views. + * + * @private + * @type {Array} + */ + private _cameras; + /** + * The main XR camera. + * + * @private + * @type {ArrayCamera} + */ + private _cameraXR; + /** + * The current near value of the XR camera. + * + * @private + * @type {?number} + * @default null + */ + private _currentDepthNear; + /** + * The current far value of the XR camera. + * + * @private + * @type {?number} + * @default null + */ + private _currentDepthFar; + /** + * A list of WebXR controllers requested by the application. + * + * @private + * @type {Array} + */ + private _controllers; + /** + * A list of XR input source. Each input source belongs to + * an instance of WebXRController. + * + * @private + * @type {Array} + */ + private _controllerInputSources; + /** + * The XR render target that represents the rendering destination + * during an active XR session. + * + * @private + * @type {?RenderTarget} + * @default null + */ + private _xrRenderTarget; + /** + * An array holding all the non-projection layers + * + * @private + * @type {Array} + * @default [] + */ + private _layers; + /** + * Whether the XR session uses layers. + * + * @private + * @type {boolean} + * @default false + */ + private _sessionUsesLayers; + /** + * Whether the device supports binding gl objects. + * + * @private + * @type {boolean} + * @readonly + */ + private readonly _supportsGlBinding; + /** + * Helper function to create native WebXR Layer. + * + * @private + * @type {Function} + */ + private _createXRLayer; + /** + * The current WebGL context. + * + * @private + * @type {?WebGL2RenderingContext} + * @default null + */ + private _gl; + /** + * The current animation context. + * + * @private + * @type {?Window} + * @default null + */ + private _currentAnimationContext; + /** + * The current animation loop. + * + * @private + * @type {?Function} + * @default null + */ + private _currentAnimationLoop; + /** + * The current pixel ratio. + * + * @private + * @type {?number} + * @default null + */ + private _currentPixelRatio; + /** + * The current size of the renderer's canvas + * in logical pixel unit. + * + * @private + * @type {Vector2} + */ + private _currentSize; + /** + * The default event listener for handling events inside a XR session. + * + * @private + * @type {Function} + */ + private _onSessionEvent; + /** + * The event listener for handling the end of a XR session. + * + * @private + * @type {Function} + */ + private _onSessionEnd; + /** + * The event listener for handling the `inputsourceschange` event. + * + * @private + * @type {Function} + */ + private _onInputSourcesChange; + /** + * The animation loop which is used as a replacement for the default + * animation loop of the application. It is only used when a XR session + * is active. + * + * @private + * @type {Function} + */ + private _onAnimationFrame; + /** + * The current XR reference space. + * + * @private + * @type {?XRReferenceSpace} + * @default null + */ + private _referenceSpace; + /** + * The current XR reference space type. + * + * @private + * @type {XRReferenceSpaceType} + * @default 'local-floor' + */ + private _referenceSpaceType; + /** + * A custom reference space defined by the application. + * + * @private + * @type {?XRReferenceSpace} + * @default null + */ + private _customReferenceSpace; + /** + * The framebuffer scale factor. + * + * @private + * @type {number} + * @default 1 + */ + private _framebufferScaleFactor; + /** + * The foveation factor. + * + * @private + * @type {number} + * @default 1 + */ + private _foveation; + /** + * A reference to the current XR session. + * + * @private + * @type {?XRSession} + * @default null + */ + private _session; + /** + * A reference to the current XR base layer. + * + * @private + * @type {?XRWebGLLayer} + * @default null + */ + private _glBaseLayer; + /** + * A reference to the current XR binding. + * + * @private + * @type {?XRWebGLBinding} + * @default null + */ + private _glBinding; + /** + * A reference to the current XR projection layer. + * + * @private + * @type {?XRProjectionLayer} + * @default null + */ + private _glProjLayer; + /** + * A reference to the current XR frame. + * + * @private + * @type {?XRFrame} + * @default null + */ + private _xrFrame; + /** + * Whether the browser supports the APIs necessary to use XRProjectionLayers. + * + * Note: this does not represent XRSession explicitly requesting + * `'layers'` as a feature - see `_sessionUsesLayers` and #30112 + * + * @private + * @type {boolean} + * @readonly + */ + private readonly _supportsLayers; + /** + * Whether the usage of multiview has been requested by the application or not. + * + * @private + * @type {boolean} + * @default false + * @readonly + */ + private readonly _useMultiviewIfPossible; + /** + * Whether the usage of multiview is actually enabled. This flag only evaluates to `true` + * if multiview has been requested by the application and the `OVR_multiview2` is available. + * + * @private + * @type {boolean} + * @readonly + */ + private readonly _useMultiview; + /** + * Returns an instance of `THREE.Group` that represents the transformation + * of a XR controller in target ray space. The requested controller is defined + * by the given index. + * + * @param {number} index - The index of the XR controller. + * @return {Group} A group that represents the controller's transformation. + */ + getController(index: number): Group; + /** + * Returns an instance of `THREE.Group` that represents the transformation + * of a XR controller in grip space. The requested controller is defined + * by the given index. + * + * @param {number} index - The index of the XR controller. + * @return {Group} A group that represents the controller's transformation. + */ + getControllerGrip(index: number): Group; + /** + * Returns an instance of `THREE.Group` that represents the transformation + * of a XR controller in hand space. The requested controller is defined + * by the given index. + * + * @param {number} index - The index of the XR controller. + * @return {Group} A group that represents the controller's transformation. + */ + getHand(index: number): Group; + /** + * Returns the foveation value. + * + * @return {number|undefined} The foveation value. Returns `undefined` if no base or projection layer is defined. + */ + getFoveation(): number | undefined; + /** + * Sets the foveation value. + * + * @param {number} foveation - A number in the range `[0,1]` where `0` means no foveation (full resolution) + * and `1` means maximum foveation (the edges render at lower resolution). + */ + setFoveation(foveation: number): void; + /** + * Returns the framebuffer scale factor. + * + * @return {number} The framebuffer scale factor. + */ + getFramebufferScaleFactor(): number; + /** + * Sets the framebuffer scale factor. + * + * This method can not be used during a XR session. + * + * @param {number} factor - The framebuffer scale factor. + */ + setFramebufferScaleFactor(factor: number): void; + /** + * Returns the reference space type. + * + * @return {XRReferenceSpaceType} The reference space type. + */ + getReferenceSpaceType(): XRReferenceSpaceType; + /** + * Sets the reference space type. + * + * This method can not be used during a XR session. + * + * @param {XRReferenceSpaceType} type - The reference space type. + */ + setReferenceSpaceType(type: XRReferenceSpaceType): void; + /** + * Returns the XR reference space. + * + * @return {XRReferenceSpace} The XR reference space. + */ + getReferenceSpace(): XRReferenceSpace; + /** + * Sets a custom XR reference space. + * + * @param {XRReferenceSpace} space - The XR reference space. + */ + setReferenceSpace(space: XRReferenceSpace): void; + /** + * Returns the XR camera. + * + * @return {ArrayCamera} The XR camera. + */ + getCamera(): ArrayCamera; + /** + * Returns the environment blend mode from the current XR session. + * + * @return {'opaque'|'additive'|'alpha-blend'|undefined} The environment blend mode. Returns `undefined` when used outside of a XR session. + */ + getEnvironmentBlendMode(): "opaque" | "additive" | "alpha-blend" | undefined; + /** + * Returns the current XR binding. + * + * Creates a new binding if needed and the browser is + * capable of doing so. + * + * @return {?XRWebGLBinding} The XR binding. Returns `null` if one cannot be created. + */ + getBinding(): XRWebGLBinding | null; + /** + * Returns the current XR frame. + * + * @return {?XRFrame} The XR frame. Returns `null` when used outside a XR session. + */ + getFrame(): XRFrame | null; + /** + * Returns `true` if the engine renders to a multiview target. + * + * @return {boolean} Whether the engine renders to a multiview render target or not. + */ + useMultiview(): boolean; + /** + * This method can be used in XR applications to create a quadratic layer that presents a separate + * rendered scene. + * + * @param {number} width - The width of the layer plane in world units. + * @param {number} height - The height of the layer plane in world units. + * @param {Vector3} translation - The position/translation of the layer plane in world units. + * @param {Quaternion} quaternion - The orientation of the layer plane expressed as a quaternion. + * @param {number} pixelwidth - The width of the layer's render target in pixels. + * @param {number} pixelheight - The height of the layer's render target in pixels. + * @param {Function} rendercall - A callback function that renders the layer. Similar to code in + * the default animation loop, this method can be used to update/transform 3D object in the layer's scene. + * @param {Object} [attributes={}] - Allows to configure the layer's render target. + * @return {Mesh} A mesh representing the quadratic XR layer. This mesh should be added to the XR scene. + */ + createQuadLayer(width: number, height: number, translation: Vector3, quaternion: Quaternion, pixelwidth: number, pixelheight: number, rendercall: Function, attributes?: Object): Mesh; + /** + * This method can be used in XR applications to create a cylindrical layer that presents a separate + * rendered scene. + * + * @param {number} radius - The radius of the cylinder in world units. + * @param {number} centralAngle - The central angle of the cylinder in radians. + * @param {number} aspectratio - The aspect ratio. + * @param {Vector3} translation - The position/translation of the layer plane in world units. + * @param {Quaternion} quaternion - The orientation of the layer plane expressed as a quaternion. + * @param {number} pixelwidth - The width of the layer's render target in pixels. + * @param {number} pixelheight - The height of the layer's render target in pixels. + * @param {Function} rendercall - A callback function that renders the layer. Similar to code in + * the default animation loop, this method can be used to update/transform 3D object in the layer's scene. + * @param {Object} [attributes={}] - Allows to configure the layer's render target. + * @return {Mesh} A mesh representing the cylindrical XR layer. This mesh should be added to the XR scene. + */ + createCylinderLayer(radius: number, centralAngle: number, aspectratio: number, translation: Vector3, quaternion: Quaternion, pixelwidth: number, pixelheight: number, rendercall: Function, attributes?: Object): Mesh; + /** + * Renders the XR layers that have been previously added to the scene. + * + * This method is usually called in your animation loop before rendering + * the actual scene via `renderer.render( scene, camera );`. + */ + renderLayers(): void; + /** + * Returns the current XR session. + * + * @return {?XRSession} The XR session. Returns `null` when used outside a XR session. + */ + getSession(): XRSession | null; + /** + * After a XR session has been requested usually with one of the `*Button` modules, it + * is injected into the renderer with this method. This method triggers the start of + * the actual XR rendering. + * + * @async + * @param {XRSession} session - The XR session to set. + * @return {Promise} A Promise that resolves when the session has been set. + */ + setSession(session: XRSession): Promise; + /** + * This method is called by the renderer per frame and updates the XR camera + * and it sub cameras based on the given camera. The given camera is the "user" + * camera created on application level and used for non-XR rendering. + * + * @param {PerspectiveCamera} camera - The camera. + */ + updateCamera(camera: PerspectiveCamera): void; + /** + * Returns a WebXR controller for the given controller index. + * + * @private + * @param {number} index - The controller index. + * @return {WebXRController} The XR controller. + */ + private _getController; +} +import { EventDispatcher } from '../../core/EventDispatcher.js'; +import { ArrayCamera } from '../../cameras/ArrayCamera.js'; +import { Vector3 } from '../../math/Vector3.js'; +import { Quaternion } from '../../math/Quaternion.js'; +import { Mesh } from '../../objects/Mesh.js'; +import { PerspectiveCamera } from '../../cameras/PerspectiveCamera.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/XRRenderTarget.d.ts b/jsdoc-testing/jsdoc/renderers/common/XRRenderTarget.d.ts new file mode 100644 index 000000000..e397d7c26 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/XRRenderTarget.d.ts @@ -0,0 +1,66 @@ +/** + * A special type of render target that is used when rendering + * with the WebXR Device API. + * + * @private + * @augments RenderTarget + */ +export class XRRenderTarget extends RenderTarget { + /** + * Constructs a new XR render target. + * + * @param {number} [width=1] - The width of the render target. + * @param {number} [height=1] - The height of the render target. + * @param {Object} [options={}] - The configuration options. + */ + constructor(width?: number, height?: number, options?: Object); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isXRRenderTarget: boolean; + /** + * Whether the attachments of the render target + * are defined by external textures. This flag is + * set to `true` when using the WebXR Layers API. + * + * @private + * @type {boolean} + * @default false + */ + private _hasExternalTextures; + /** + * Whether a depth buffer should automatically be allocated + * for this XR render target or not. + * + * Allocating a depth buffer is the default behavior of XR render + * targets. However, when using the WebXR Layers API, this flag + * must be set to `false` when the `ignoreDepthValues` property of + * the projection layers evaluates to `false`. + * + * Reference: {@link https://www.w3.org/TR/webxrlayers-1/#dom-xrprojectionlayer-ignoredepthvalues}. + * + * @private + * @type {boolean} + * @default true + */ + private _autoAllocateDepthBuffer; + /** + * Whether this render target is associated with a XRWebGLLayer. + * + * A XRWebGLLayer points to an opaque framebuffer. Basically, + * this means that you don't have access to its bound color, + * stencil and depth buffers. We need to handle this framebuffer + * differently since its textures are always bound. + * + * @private + * @type {boolean} + * @default false + * */ + private _isOpaqueFramebuffer; + copy(source: any): this; +} +import { RenderTarget } from '../../core/RenderTarget.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/extras/PMREMGenerator.d.ts b/jsdoc-testing/jsdoc/renderers/common/extras/PMREMGenerator.d.ts new file mode 100644 index 000000000..fec78edd5 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/extras/PMREMGenerator.d.ts @@ -0,0 +1,196 @@ +export default PMREMGenerator; +/** + * This class generates a Prefiltered, Mipmapped Radiance Environment Map + * (PMREM) from a cubeMap environment texture. This allows different levels of + * blur to be quickly accessed based on material roughness. It is packed into a + * special CubeUV format that allows us to perform custom interpolation so that + * we can support nonlinear formats such as RGBE. Unlike a traditional mipmap + * chain, it only goes down to the LOD_MIN level (above), and then creates extra + * even more filtered 'mips' at the same LOD_MIN resolution, associated with + * higher roughness levels. In this way we maintain resolution to smoothly + * interpolate diffuse lighting while limiting sampling computation. + * + * The prefiltering uses GGX VNDF (Visible Normal Distribution Function) + * importance sampling based on "Sampling the GGX Distribution of Visible Normals" + * (Heitz, 2018) to generate environment maps that accurately match the GGX BRDF + * used in material rendering for physically-based image-based lighting. + */ +declare class PMREMGenerator { + /** + * Constructs a new PMREM generator. + * + * @param {Renderer} renderer - The renderer. + */ + constructor(renderer: Renderer); + _renderer: Renderer; + _pingPongRenderTarget: RenderTarget | null; + _lodMax: number; + _cubeSize: number; + _sizeLods: any[]; + _sigmas: any[]; + _lodMeshes: any[]; + _blurMaterial: NodeMaterial | null; + _ggxMaterial: NodeMaterial | null; + _cubemapMaterial: NodeMaterial | null; + _equirectMaterial: NodeMaterial | null; + _backgroundBox: Mesh | null; + get _hasInitialized(): any; + /** + * Generates a PMREM from a supplied Scene, which can be faster than using an + * image if networking bandwidth is low. Optional sigma specifies a blur radius + * in radians to be applied to the scene before PMREM generation. Optional near + * and far planes ensure the scene is rendered in its entirety. + * + * @param {Scene} scene - The scene to be captured. + * @param {number} [sigma=0] - The blur radius in radians. + * @param {number} [near=0.1] - The near plane distance. + * @param {number} [far=100] - The far plane distance. + * @param {Object} [options={}] - The configuration options. + * @param {number} [options.size=256] - The texture size of the PMREM. + * @param {Vector3} [options.renderTarget=origin] - The position of the internal cube camera that renders the scene. + * @param {?RenderTarget} [options.renderTarget=null] - The render target to use. + * @return {RenderTarget} The resulting PMREM. + * @see {@link PMREMGenerator#fromScene} + */ + fromScene(scene: Scene, sigma?: number, near?: number, far?: number, options?: { + size?: number | undefined; + renderTarget?: Vector3 | undefined; + renderTarget?: Vector3 | undefined; + }): RenderTarget; + /** + * Generates a PMREM from a supplied Scene, which can be faster than using an + * image if networking bandwidth is low. Optional sigma specifies a blur radius + * in radians to be applied to the scene before PMREM generation. Optional near + * and far planes ensure the scene is rendered in its entirety (the cubeCamera + * is placed at the origin). + * + * @deprecated + * @param {Scene} scene - The scene to be captured. + * @param {number} [sigma=0] - The blur radius in radians. + * @param {number} [near=0.1] - The near plane distance. + * @param {number} [far=100] - The far plane distance. + * @param {Object} [options={}] - The configuration options. + * @param {number} [options.size=256] - The texture size of the PMREM. + * @param {Vector3} [options.position=origin] - The position of the internal cube camera that renders the scene. + * @param {?RenderTarget} [options.renderTarget=null] - The render target to use. + * @return {Promise} A Promise that resolve with the PMREM when the generation has been finished. + * @see {@link PMREMGenerator#fromScene} + */ + fromSceneAsync(scene: Scene, sigma?: number, near?: number, far?: number, options?: { + size?: number | undefined; + position?: Vector3 | undefined; + renderTarget?: RenderTarget | null | undefined; + }): Promise; + /** + * Generates a PMREM from an equirectangular texture, which can be either LDR + * or HDR. The ideal input image size is 1k (1024 x 512), + * as this matches best with the 256 x 256 cubemap output. + * + * @param {Texture} equirectangular - The equirectangular texture to be converted. + * @param {?RenderTarget} [renderTarget=null] - The render target to use. + * @return {RenderTarget} The resulting PMREM. + * @see {@link PMREMGenerator#fromEquirectangularAsync} + */ + fromEquirectangular(equirectangular: Texture, renderTarget?: RenderTarget | null): RenderTarget; + /** + * Generates a PMREM from an equirectangular texture, which can be either LDR + * or HDR. The ideal input image size is 1k (1024 x 512), + * as this matches best with the 256 x 256 cubemap output. + * + * @deprecated + * @param {Texture} equirectangular - The equirectangular texture to be converted. + * @param {?RenderTarget} [renderTarget=null] - The render target to use. + * @return {Promise} The resulting PMREM. + * @see {@link PMREMGenerator#fromEquirectangular} + */ + fromEquirectangularAsync(equirectangular: Texture, renderTarget?: RenderTarget | null): Promise; + /** + * Generates a PMREM from an cubemap texture, which can be either LDR + * or HDR. The ideal input cube size is 256 x 256, + * as this matches best with the 256 x 256 cubemap output. + * + * @param {Texture} cubemap - The cubemap texture to be converted. + * @param {?RenderTarget} [renderTarget=null] - The render target to use. + * @return {RenderTarget} The resulting PMREM. + * @see {@link PMREMGenerator#fromCubemapAsync} + */ + fromCubemap(cubemap: Texture, renderTarget?: RenderTarget | null): RenderTarget; + /** + * Generates a PMREM from an cubemap texture, which can be either LDR + * or HDR. The ideal input cube size is 256 x 256, + * with the 256 x 256 cubemap output. + * + * @deprecated + * @param {Texture} cubemap - The cubemap texture to be converted. + * @param {?RenderTarget} [renderTarget=null] - The render target to use. + * @return {Promise} The resulting PMREM. + * @see {@link PMREMGenerator#fromCubemap} + */ + fromCubemapAsync(cubemap: Texture, renderTarget?: RenderTarget | null): Promise; + /** + * Pre-compiles the cubemap shader. You can get faster start-up by invoking this method during + * your texture's network fetch for increased concurrency. + * + * @returns {Promise} + */ + compileCubemapShader(): Promise; + /** + * Pre-compiles the equirectangular shader. You can get faster start-up by invoking this method during + * your texture's network fetch for increased concurrency. + * + * @returns {Promise} + */ + compileEquirectangularShader(): Promise; + /** + * Disposes of the PMREMGenerator's internal memory. Note that PMREMGenerator is a static class, + * so you should not need more than one PMREMGenerator object. If you do, calling dispose() on + * one of them will cause any others to also become unusable. + */ + dispose(): void; + _setSizeFromTexture(texture: any): void; + _setSize(cubeSize: any): void; + _dispose(): void; + _cleanup(outputTarget: any): void; + _fromTexture(texture: any, renderTarget: any): any; + _allocateTarget(): RenderTarget; + _init(renderTarget: any): void; + _compileMaterial(material: any): Promise; + _sceneToCubeUV(scene: any, near: any, far: any, cubeUVRenderTarget: any, position: any): void; + _textureToCubeUV(texture: any, cubeUVRenderTarget: any): void; + _applyPMREM(cubeUVRenderTarget: any): void; + /** + * Applies GGX VNDF importance sampling filter to generate a prefiltered environment map. + * Uses Monte Carlo integration with VNDF importance sampling to accurately represent the + * GGX BRDF for physically-based rendering. Reads from the previous LOD level and + * applies incremental roughness filtering to avoid over-blurring. + * + * @private + * @param {RenderTarget} cubeUVRenderTarget + * @param {number} lodIn - Source LOD level to read from + * @param {number} lodOut - Target LOD level to write to + */ + private _applyGGXFilter; + /** + * This is a two-pass Gaussian blur for a cubemap. Normally this is done + * vertically and horizontally, but this breaks down on a cube. Here we apply + * the blur latitudinally (around the poles), and then longitudinally (towards + * the poles) to approximate the orthogonally-separable blur. It is least + * accurate at the poles, but still does a decent job. + * + * Used for initial scene blur in fromScene() method when sigma > 0. + * + * @private + * @param {RenderTarget} cubeUVRenderTarget - The cubemap render target. + * @param {number} lodIn - The input level-of-detail. + * @param {number} lodOut - The output level-of-detail. + * @param {number} sigma - The blur radius in radians. + * @param {Vector3} [poleAxis] - The pole axis. + */ + private _blur; + _halfBlur(targetIn: any, targetOut: any, lodIn: any, lodOut: any, sigmaRadians: any, direction: any, poleAxis: any): void; + _setViewport(target: any, x: any, y: any, width: any, height: any): void; +} +import { RenderTarget } from '../../../core/RenderTarget.js'; +import NodeMaterial from '../../../materials/nodes/NodeMaterial.js'; +import { Mesh } from '../../../objects/Mesh.js'; +import { Vector3 } from '../../../math/Vector3.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/nodes/NodeBuilderState.d.ts b/jsdoc-testing/jsdoc/renderers/common/nodes/NodeBuilderState.d.ts new file mode 100644 index 000000000..876698dc2 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/nodes/NodeBuilderState.d.ts @@ -0,0 +1,105 @@ +export default NodeBuilderState; +/** + * This module represents the state of a node builder after it was + * used to build the nodes for a render object. The state holds the + * results of the build for further processing in the renderer. + * + * Render objects with identical cache keys share the same node builder state. + * + * @private + */ +declare class NodeBuilderState { + /** + * Constructs a new node builder state. + * + * @param {string} vertexShader - The native vertex shader code. + * @param {string} fragmentShader - The native fragment shader code. + * @param {string} computeShader - The native compute shader code. + * @param {Array} nodeAttributes - An array of node attributes. + * @param {Array} bindings - An array of bind groups. + * @param {Array} updateNodes - An array of nodes that implement their `update()` method. + * @param {Array} updateBeforeNodes - An array of nodes that implement their `updateBefore()` method. + * @param {Array} updateAfterNodes - An array of nodes that implement their `updateAfter()` method. + * @param {NodeMaterialObserver} observer - A node material observer. + * @param {Array} transforms - An array with transform attribute objects. Only relevant when using compute shaders with WebGL 2. + */ + constructor(vertexShader: string, fragmentShader: string, computeShader: string, nodeAttributes: Array, bindings: Array, updateNodes: Array, updateBeforeNodes: Array, updateAfterNodes: Array, observer: NodeMaterialObserver, transforms?: Array); + /** + * The native vertex shader code. + * + * @type {string} + */ + vertexShader: string; + /** + * The native fragment shader code. + * + * @type {string} + */ + fragmentShader: string; + /** + * The native compute shader code. + * + * @type {string} + */ + computeShader: string; + /** + * An array with transform attribute objects. + * Only relevant when using compute shaders with WebGL 2. + * + * @type {Array} + */ + transforms: Array; + /** + * An array of node attributes representing + * the attributes of the shaders. + * + * @type {Array} + */ + nodeAttributes: Array; + /** + * An array of bind groups representing the uniform or storage + * buffers, texture or samplers of the shader. + * + * @type {Array} + */ + bindings: Array; + /** + * An array of nodes that implement their `update()` method. + * + * @type {Array} + */ + updateNodes: Array; + /** + * An array of nodes that implement their `updateBefore()` method. + * + * @type {Array} + */ + updateBeforeNodes: Array; + /** + * An array of nodes that implement their `updateAfter()` method. + * + * @type {Array} + */ + updateAfterNodes: Array; + /** + * A node material observer. + * + * @type {NodeMaterialObserver} + */ + observer: NodeMaterialObserver; + /** + * How often this state is used by render objects. + * + * @type {number} + */ + usedTimes: number; + /** + * This method is used to create a array of bind groups based + * on the existing bind groups of this state. Shared groups are + * not cloned. + * + * @return {Array} A array of bind groups. + */ + createBindings(): Array; +} +import BindGroup from '../BindGroup.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/nodes/NodeLibrary.d.ts b/jsdoc-testing/jsdoc/renderers/common/nodes/NodeLibrary.d.ts new file mode 100644 index 000000000..0121dd34b --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/nodes/NodeLibrary.d.ts @@ -0,0 +1,99 @@ +export default NodeLibrary; +/** + * The purpose of a node library is to assign node implementations + * to existing library features. In `WebGPURenderer` lights, materials + * which are not based on `NodeMaterial` as well as tone mapping techniques + * are implemented with node-based modules. + * + * @private + */ +declare class NodeLibrary { + /** + * A weak map that maps lights to light nodes. + * + * @type {WeakMap} + */ + lightNodes: WeakMap; + /** + * A map that maps materials to node materials. + * + * @type {Map} + */ + materialNodes: Map; + /** + * A map that maps tone mapping techniques (constants) + * to tone mapping node functions. + * + * @type {Map} + */ + toneMappingNodes: Map; + /** + * Returns a matching node material instance for the given material object. + * + * This method also assigns/copies the properties of the given material object + * to the node material. This is done to make sure the current material + * configuration carries over to the node version. + * + * @param {Material} material - A material. + * @return {NodeMaterial} The corresponding node material. + */ + fromMaterial(material: Material): NodeMaterial; + /** + * Adds a tone mapping node function for a tone mapping technique (constant). + * + * @param {Function} toneMappingNode - The tone mapping node function. + * @param {number} toneMapping - The tone mapping. + */ + addToneMapping(toneMappingNode: Function, toneMapping: number): void; + /** + * Returns a tone mapping node function for a tone mapping technique (constant). + * + * @param {number} toneMapping - The tone mapping. + * @return {?Function} The tone mapping node function. Returns `null` if no node function is found. + */ + getToneMappingFunction(toneMapping: number): Function | null; + /** + * Returns a node material class definition for a material type. + * + * @param {string} materialType - The material type. + * @return {?NodeMaterial.constructor} The node material class definition. Returns `null` if no node material is found. + */ + getMaterialNodeClass(materialType: string): NodeMaterial.constructor | null; + /** + * Adds a node material class definition for a given material type. + * + * @param {NodeMaterial.constructor} materialNodeClass - The node material class definition. + * @param {string} materialClassType - The material type. + */ + addMaterial(materialNodeClass: NodeMaterial.constructor, materialClassType: string): void; + /** + * Returns a light node class definition for a light class definition. + * + * @param {Light.constructor} light - The light class definition. + * @return {?AnalyticLightNode.constructor} The light node class definition. Returns `null` if no light node is found. + */ + getLightNodeClass(light: Light.constructor): AnalyticLightNode.constructor | null; + /** + * Adds a light node class definition for a given light class definition. + * + * @param {AnalyticLightNode.constructor} lightNodeClass - The light node class definition. + * @param {Light.constructor} lightClass - The light class definition. + */ + addLight(lightNodeClass: AnalyticLightNode.constructor, lightClass: Light.constructor): void; + /** + * Adds a node class definition for the given type to the provided type library. + * + * @param {Node.constructor} nodeClass - The node class definition. + * @param {number|string} type - The object type. + * @param {Map} library - The type library. + */ + addType(nodeClass: Node.constructor, type: number | string, library: Map): void; + /** + * Adds a node class definition for the given class definition to the provided type library. + * + * @param {Node.constructor} nodeClass - The node class definition. + * @param {Node.constructor} baseClass - The class definition. + * @param {WeakMap} library - The type library. + */ + addClass(nodeClass: Node.constructor, baseClass: Node.constructor, library: WeakMap): void; +} diff --git a/jsdoc-testing/jsdoc/renderers/common/nodes/NodeManager.d.ts b/jsdoc-testing/jsdoc/renderers/common/nodes/NodeManager.d.ts new file mode 100644 index 000000000..a7840ba9f --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/nodes/NodeManager.d.ts @@ -0,0 +1,280 @@ +export default NodeManager; +/** + * This renderer module manages node-related objects and is the + * primary interface between the renderer and the node system. + * + * @private + * @augments DataMap + */ +declare class NodeManager extends DataMap { + /** + * Constructs a new nodes management component. + * + * @param {Renderer} renderer - The renderer. + * @param {Backend} backend - The renderer's backend. + */ + constructor(renderer: Renderer, backend: Backend); + /** + * The renderer. + * + * @type {Renderer} + */ + renderer: Renderer; + /** + * The renderer's backend. + * + * @type {Backend} + */ + backend: Backend; + /** + * The node frame. + * + * @type {Renderer} + */ + nodeFrame: Renderer; + /** + * A cache for managing node builder states. + * + * @type {Map} + */ + nodeBuilderCache: Map; + /** + * A cache for managing data cache key data. + * + * @type {ChainMap} + */ + callHashCache: ChainMap; + /** + * A cache for managing node uniforms group data. + * + * @type {ChainMap} + */ + groupsData: ChainMap; + /** + * Queue for pending async builds to limit concurrent compilation. + * + * @private + * @type {Array} + */ + private _buildQueue; + /** + * Whether an async build is currently in progress. + * + * @private + * @type {boolean} + */ + private _buildInProgress; + /** + * A cache for managing node objects of + * scene properties like fog or environments. + * + * @type {Object} + */ + cacheLib: { + [x: string]: WeakMap; + }; + /** + * Returns `true` if the given node uniforms group must be updated or not. + * + * @param {NodeUniformsGroup} nodeUniformsGroup - The node uniforms group. + * @return {boolean} Whether the node uniforms group requires an update or not. + */ + updateGroup(nodeUniformsGroup: NodeUniformsGroup): boolean; + /** + * Returns the cache key for the given render object. + * + * @param {RenderObject} renderObject - The render object. + * @return {number} The cache key. + */ + getForRenderCacheKey(renderObject: RenderObject): number; + /** + * Creates a node builder configured for the given render object and material. + * + * @private + * @param {RenderObject} renderObject - The render object. + * @param {Material} material - The material to use. + * @return {NodeBuilder} The configured node builder. + */ + private _createNodeBuilder; + /** + * Returns a node builder state for the given render object. + * + * @param {RenderObject} renderObject - The render object. + * @param {boolean} [useAsync=false] - Whether to use async build with yielding. + * @return {NodeBuilderState|Promise} The node builder state (or Promise if async). + */ + getForRender(renderObject: RenderObject, useAsync?: boolean): NodeBuilderState | Promise; + /** + * Async version of getForRender() that yields to main thread during build. + * Use this in compileAsync() to prevent blocking the main thread. + * + * @param {RenderObject} renderObject - The render object. + * @return {Promise} A promise that resolves to the node builder state. + */ + getForRenderAsync(renderObject: RenderObject): Promise; + /** + * Returns nodeBuilderState if ready, null if pending async build. + * Queues async build on first call for cache miss. + * Use this in render() path to enable non-blocking compilation. + * + * @param {RenderObject} renderObject - The render object. + * @return {?NodeBuilderState} The node builder state, or null if still building. + */ + getForRenderDeferred(renderObject: RenderObject): NodeBuilderState | null; + /** + * Processes the build queue one item at a time. + * This ensures builds don't all run simultaneously and freeze the main thread. + * + * @private + */ + private _processBuildQueue; + /** + * Deletes the given object from the internal data map + * + * @param {any} object - The object to delete. + * @return {?Object} The deleted dictionary. + */ + delete(object: any): Object | null; + /** + * Returns a node builder state for the given compute node. + * + * @param {Node} computeNode - The compute node. + * @return {NodeBuilderState} The node builder state. + */ + getForCompute(computeNode: Node): NodeBuilderState; + /** + * Creates a node builder state for the given node builder. + * + * @private + * @param {NodeBuilder} nodeBuilder - The node builder. + * @return {NodeBuilderState} The node builder state. + */ + private _createNodeBuilderState; + /** + * Returns an environment node for the current configured + * scene environment. + * + * @param {Scene} scene - The scene. + * @return {Node} A node representing the current scene environment. + */ + getEnvironmentNode(scene: Scene): Node; + /** + * Returns a background node for the current configured + * scene background. + * + * @param {Scene} scene - The scene. + * @return {Node} A node representing the current scene background. + */ + getBackgroundNode(scene: Scene): Node; + /** + * Returns a fog node for the current configured scene fog. + * + * @param {Scene} scene - The scene. + * @return {Node} A node representing the current scene fog. + */ + getFogNode(scene: Scene): Node; + /** + * Returns a cache key for the given scene and lights node. + * This key is used by `RenderObject` as a part of the dynamic + * cache key (a key that must be checked every time the render + * objects is drawn). + * + * @param {Scene} scene - The scene. + * @param {LightsNode} lightsNode - The lights node. + * @return {number} The cache key. + */ + getCacheKey(scene: Scene, lightsNode: LightsNode): number; + /** + * A boolean that indicates whether tone mapping should be enabled + * or not. + * + * @type {boolean} + */ + get isToneMappingState(): boolean; + /** + * If a scene background is configured, this method makes sure to + * represent the background with a corresponding node-based implementation. + * + * @param {Scene} scene - The scene. + */ + updateBackground(scene: Scene): void; + /** + * This method is part of the caching of nodes which are used to represents the + * scene's background, fog or environment. + * + * @param {string} type - The type of object to cache. + * @param {Object} object - The object. + * @param {Function} callback - A callback that produces a node representation for the given object. + * @param {boolean} [forceUpdate=false] - Whether an update should be enforced or not. + * @return {Node} The node representation. + */ + getCacheNode(type: string, object: Object, callback: Function, forceUpdate?: boolean): Node; + /** + * If a scene fog is configured, this method makes sure to + * represent the fog with a corresponding node-based implementation. + * + * @param {Scene} scene - The scene. + */ + updateFog(scene: Scene): void; + /** + * If a scene environment is configured, this method makes sure to + * represent the environment with a corresponding node-based implementation. + * + * @param {Scene} scene - The scene. + */ + updateEnvironment(scene: Scene): void; + getNodeFrame(renderer?: Renderer, scene?: null, object?: null, camera?: null, material?: null): Renderer; + getNodeFrameForRender(renderObject: any): Renderer; + /** + * Returns the current output cache key. + * + * @return {string} The output cache key. + */ + getOutputCacheKey(): string; + /** + * Returns a node that represents the output configuration (tone mapping and + * color space) for the current target. + * + * @param {Texture} outputTarget - The output target. + * @return {Node} The output node. + */ + getOutputNode(outputTarget: Texture): Node; + /** + * Triggers the call of `updateBefore()` methods + * for all nodes of the given render object. + * + * @param {RenderObject} renderObject - The render object. + */ + updateBefore(renderObject: RenderObject): void; + /** + * Triggers the call of `updateAfter()` methods + * for all nodes of the given render object. + * + * @param {RenderObject} renderObject - The render object. + */ + updateAfter(renderObject: RenderObject): void; + /** + * Triggers the call of `update()` methods + * for all nodes of the given compute node. + * + * @param {Node} computeNode - The compute node. + */ + updateForCompute(computeNode: Node): void; + /** + * Triggers the call of `update()` methods + * for all nodes of the given render object. + * + * @param {RenderObject} renderObject - The render object. + */ + updateForRender(renderObject: RenderObject): void; + /** + * Returns `true` if the given render object requires a refresh. + * + * @param {RenderObject} renderObject - The render object. + * @return {boolean} Whether the given render object requires a refresh or not. + */ + needsRefresh(renderObject: RenderObject): boolean; +} +import DataMap from '../DataMap.js'; +import NodeBuilderState from './NodeBuilderState.js'; +import ChainMap from '../ChainMap.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/nodes/NodeSampledTexture.d.ts b/jsdoc-testing/jsdoc/renderers/common/nodes/NodeSampledTexture.d.ts new file mode 100644 index 000000000..3c380c248 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/nodes/NodeSampledTexture.d.ts @@ -0,0 +1,72 @@ +/** + * A special form of sampled texture binding type. + * It's texture value is managed by a node object. + * + * @private + * @augments SampledTexture + */ +export class NodeSampledTexture extends SampledTexture { + /** + * Constructs a new node-based sampled texture. + * + * @param {string} name - The textures's name. + * @param {TextureNode} textureNode - The texture node. + * @param {UniformGroupNode} groupNode - The uniform group node. + * @param {?string} [access=null] - The access type. + */ + constructor(name: string, textureNode: TextureNode, groupNode: UniformGroupNode, access?: string | null); + /** + * The texture node. + * + * @type {TextureNode} + */ + textureNode: TextureNode; + /** + * The uniform group node. + * + * @type {UniformGroupNode} + */ + groupNode: UniformGroupNode; + /** + * The access type. + * + * @type {?string} + * @default null + */ + access: string | null; +} +/** + * A special form of sampled cube texture binding type. + * It's texture value is managed by a node object. + * + * @private + * @augments NodeSampledTexture + */ +export class NodeSampledCubeTexture extends NodeSampledTexture { + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isSampledCubeTexture: boolean; +} +/** + * A special form of sampled 3D texture binding type. + * It's texture value is managed by a node object. + * + * @private + * @augments NodeSampledTexture + */ +export class NodeSampledTexture3D extends NodeSampledTexture { + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isSampledTexture3D: boolean; +} +import { SampledTexture } from '../SampledTexture.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/nodes/NodeSampler.d.ts b/jsdoc-testing/jsdoc/renderers/common/nodes/NodeSampler.d.ts new file mode 100644 index 000000000..b5ad4701d --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/nodes/NodeSampler.d.ts @@ -0,0 +1,31 @@ +export default NodeSampler; +/** + * A special form of sampler binding type. + * It's texture value is managed by a node object. + * + * @private + * @augments Sampler + */ +declare class NodeSampler extends Sampler { + /** + * Constructs a new node-based sampler. + * + * @param {string} name - The samplers's name. + * @param {TextureNode} textureNode - The texture node. + * @param {UniformGroupNode} groupNode - The uniform group node. + */ + constructor(name: string, textureNode: TextureNode, groupNode: UniformGroupNode); + /** + * The texture node. + * + * @type {TextureNode} + */ + textureNode: TextureNode; + /** + * The uniform group node. + * + * @type {UniformGroupNode} + */ + groupNode: UniformGroupNode; +} +import Sampler from '../Sampler.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/nodes/NodeStorageBuffer.d.ts b/jsdoc-testing/jsdoc/renderers/common/nodes/NodeStorageBuffer.d.ts new file mode 100644 index 000000000..ca5196126 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/nodes/NodeStorageBuffer.d.ts @@ -0,0 +1,36 @@ +export default NodeStorageBuffer; +/** + * A special form of storage buffer binding type. + * It's buffer value is managed by a node object. + * + * @private + * @augments StorageBuffer + */ +declare class NodeStorageBuffer extends StorageBuffer { + /** + * Constructs a new node-based storage buffer. + * + * @param {StorageBufferNode} nodeUniform - The storage buffer node. + * @param {UniformGroupNode} groupNode - The uniform group node. + */ + constructor(nodeUniform: StorageBufferNode, groupNode: UniformGroupNode); + /** + * The node uniform. + * + * @type {StorageBufferNode} + */ + nodeUniform: StorageBufferNode; + /** + * The access type. + * + * @type {string} + */ + access: string; + /** + * The uniform group node. + * + * @type {UniformGroupNode} + */ + groupNode: UniformGroupNode; +} +import StorageBuffer from '../StorageBuffer.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/nodes/NodeUniform.d.ts b/jsdoc-testing/jsdoc/renderers/common/nodes/NodeUniform.d.ts new file mode 100644 index 000000000..47673f68d --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/nodes/NodeUniform.d.ts @@ -0,0 +1,230 @@ +/** + * A special form of Number uniform binding type. + * It's value is managed by a node object. + * + * @private + * @augments NumberUniform + */ +export class NumberNodeUniform extends NumberUniform { + /** + * Constructs a new node-based Number uniform. + * + * @param {NodeUniform} nodeUniform - The node uniform. + */ + constructor(nodeUniform: NodeUniform); + /** + * The node uniform. + * + * @type {NodeUniform} + */ + nodeUniform: NodeUniform; + /** + * Overwritten to return the value of the node uniform. + * + * @return {number} The value. + */ + getValue(): number; + /** + * Returns the node uniform data type. + * + * @return {string} The data type. + */ + getType(): string; +} +/** + * A special form of Vector2 uniform binding type. + * It's value is managed by a node object. + * + * @private + * @augments Vector2Uniform + */ +export class Vector2NodeUniform extends Vector2Uniform { + /** + * Constructs a new node-based Vector2 uniform. + * + * @param {NodeUniform} nodeUniform - The node uniform. + */ + constructor(nodeUniform: NodeUniform); + /** + * The node uniform. + * + * @type {NodeUniform} + */ + nodeUniform: NodeUniform; + /** + * Returns the node uniform data type. + * + * @return {string} The data type. + */ + getType(): string; +} +/** + * A special form of Vector3 uniform binding type. + * It's value is managed by a node object. + * + * @private + * @augments Vector3Uniform + */ +export class Vector3NodeUniform extends Vector3Uniform { + /** + * Constructs a new node-based Vector3 uniform. + * + * @param {NodeUniform} nodeUniform - The node uniform. + */ + constructor(nodeUniform: NodeUniform); + /** + * The node uniform. + * + * @type {NodeUniform} + */ + nodeUniform: NodeUniform; + /** + * Returns the node uniform data type. + * + * @return {string} The data type. + */ + getType(): string; +} +/** + * A special form of Vector4 uniform binding type. + * It's value is managed by a node object. + * + * @private + * @augments Vector4Uniform + */ +export class Vector4NodeUniform extends Vector4Uniform { + /** + * Constructs a new node-based Vector4 uniform. + * + * @param {NodeUniform} nodeUniform - The node uniform. + */ + constructor(nodeUniform: NodeUniform); + /** + * The node uniform. + * + * @type {NodeUniform} + */ + nodeUniform: NodeUniform; + /** + * Returns the node uniform data type. + * + * @return {string} The data type. + */ + getType(): string; +} +/** + * A special form of Color uniform binding type. + * It's value is managed by a node object. + * + * @private + * @augments ColorUniform + */ +export class ColorNodeUniform extends ColorUniform { + /** + * Constructs a new node-based Color uniform. + * + * @param {NodeUniform} nodeUniform - The node uniform. + */ + constructor(nodeUniform: NodeUniform); + /** + * The node uniform. + * + * @type {NodeUniform} + */ + nodeUniform: NodeUniform; + /** + * Returns the node uniform data type. + * + * @return {string} The data type. + */ + getType(): string; +} +/** + * A special form of Matrix2 uniform binding type. + * It's value is managed by a node object. + * + * @private + * @augments Matrix2Uniform + */ +export class Matrix2NodeUniform extends Matrix2Uniform { + /** + * Constructs a new node-based Matrix2 uniform. + * + * @param {NodeUniform} nodeUniform - The node uniform. + */ + constructor(nodeUniform: NodeUniform); + /** + * The node uniform. + * + * @type {NodeUniform} + */ + nodeUniform: NodeUniform; + /** + * Returns the node uniform data type. + * + * @return {string} The data type. + */ + getType(): string; +} +/** + * A special form of Matrix3 uniform binding type. + * It's value is managed by a node object. + * + * @private + * @augments Matrix3Uniform + */ +export class Matrix3NodeUniform extends Matrix3Uniform { + /** + * Constructs a new node-based Matrix3 uniform. + * + * @param {NodeUniform} nodeUniform - The node uniform. + */ + constructor(nodeUniform: NodeUniform); + /** + * The node uniform. + * + * @type {NodeUniform} + */ + nodeUniform: NodeUniform; + /** + * Returns the node uniform data type. + * + * @return {string} The data type. + */ + getType(): string; +} +/** + * A special form of Matrix4 uniform binding type. + * It's value is managed by a node object. + * + * @private + * @augments Matrix4Uniform + */ +export class Matrix4NodeUniform extends Matrix4Uniform { + /** + * Constructs a new node-based Matrix4 uniform. + * + * @param {NodeUniform} nodeUniform - The node uniform. + */ + constructor(nodeUniform: NodeUniform); + /** + * The node uniform. + * + * @type {NodeUniform} + */ + nodeUniform: NodeUniform; + /** + * Returns the node uniform data type. + * + * @return {string} The data type. + */ + getType(): string; +} +import { NumberUniform } from '../Uniform.js'; +import { Vector2Uniform } from '../Uniform.js'; +import { Vector3Uniform } from '../Uniform.js'; +import { Vector4Uniform } from '../Uniform.js'; +import { ColorUniform } from '../Uniform.js'; +import { Matrix2Uniform } from '../Uniform.js'; +import { Matrix3Uniform } from '../Uniform.js'; +import { Matrix4Uniform } from '../Uniform.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/nodes/NodeUniformBuffer.d.ts b/jsdoc-testing/jsdoc/renderers/common/nodes/NodeUniformBuffer.d.ts new file mode 100644 index 000000000..495dc5d8c --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/nodes/NodeUniformBuffer.d.ts @@ -0,0 +1,56 @@ +export default NodeUniformBuffer; +/** + * A special form of uniform buffer binding type. + * It's buffer value is managed by a node object. + * + * @private + * @augments UniformBuffer + */ +declare class NodeUniformBuffer extends UniformBuffer { + /** + * Constructs a new node-based uniform buffer. + * + * @param {BufferNode} nodeUniform - The uniform buffer node. + * @param {UniformGroupNode} groupNode - The uniform group node. + */ + constructor(nodeUniform: BufferNode, groupNode: UniformGroupNode); + /** + * The uniform buffer node. + * + * @type {BufferNode} + */ + nodeUniform: BufferNode; + /** + * The uniform group node. + * + * @type {UniformGroupNode} + */ + groupNode: UniformGroupNode; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isNodeUniformBuffer: boolean; + /** + * The array of update ranges. + * + * @param {Array<{start: number, count: number}>} value - The update ranges. + */ + set updateRanges(value: Array<{ + start: number; + count: number; + }>); + /** + * The array of update ranges. + * + * @type {Array<{start: number, count: number}>} + */ + get updateRanges(): Array<{ + start: number; + count: number; + }>; +} +import UniformBuffer from '../UniformBuffer.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/nodes/NodeUniformsGroup.d.ts b/jsdoc-testing/jsdoc/renderers/common/nodes/NodeUniformsGroup.d.ts new file mode 100644 index 000000000..c196bbe56 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/common/nodes/NodeUniformsGroup.d.ts @@ -0,0 +1,38 @@ +export default NodeUniformsGroup; +/** + * A special form of uniforms group that represents + * the individual uniforms as node-based uniforms. + * + * @private + * @augments UniformsGroup + */ +declare class NodeUniformsGroup extends UniformsGroup { + /** + * Constructs a new node-based uniforms group. + * + * @param {string} name - The group's name. + * @param {UniformGroupNode} groupNode - The uniform group node. + */ + constructor(name: string, groupNode: UniformGroupNode); + /** + * The group's ID. + * + * @type {number} + */ + id: number; + /** + * The uniform group node. + * + * @type {UniformGroupNode} + */ + groupNode: UniformGroupNode; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isNodeUniformsGroup: boolean; +} +import UniformsGroup from '../UniformsGroup.js'; diff --git a/jsdoc-testing/jsdoc/renderers/shaders/ShaderChunk/default_fragment.glsl.d.ts b/jsdoc-testing/jsdoc/renderers/shaders/ShaderChunk/default_fragment.glsl.d.ts new file mode 100644 index 000000000..0ec477406 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/shaders/ShaderChunk/default_fragment.glsl.d.ts @@ -0,0 +1,2 @@ +declare const _default: "\nvoid main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}\n"; +export default _default; diff --git a/jsdoc-testing/jsdoc/renderers/shaders/ShaderChunk/default_vertex.glsl.d.ts b/jsdoc-testing/jsdoc/renderers/shaders/ShaderChunk/default_vertex.glsl.d.ts new file mode 100644 index 000000000..c8a2405ff --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/shaders/ShaderChunk/default_vertex.glsl.d.ts @@ -0,0 +1,2 @@ +declare const _default: "\nvoid main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n"; +export default _default; diff --git a/jsdoc-testing/jsdoc/renderers/shaders/UniformsUtils.d.ts b/jsdoc-testing/jsdoc/renderers/shaders/UniformsUtils.d.ts new file mode 100644 index 000000000..2789a045c --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/shaders/UniformsUtils.d.ts @@ -0,0 +1,29 @@ +/** + * Provides utility functions for managing uniforms. + * + * @module UniformsUtils + */ +/** + * Clones the given uniform definitions by performing a deep-copy. That means + * if the value of a uniform refers to an object like a Vector3 or Texture, + * the cloned uniform will refer to a new object reference. + * + * @param {Object} src - An object representing uniform definitions. + * @return {Object} The cloned uniforms. + */ +export function cloneUniforms(src: Object): Object; +/** + * Merges the given uniform definitions into a single object. Since the + * method internally uses cloneUniforms(), it performs a deep-copy when + * producing the merged uniform definitions. + * + * @param {Array} uniforms - An array of objects containing uniform definitions. + * @return {Object} The merged uniforms. + */ +export function mergeUniforms(uniforms: any[]): Object; +export function cloneUniformsGroups(src: any): any[]; +export function getUnlitUniformColorSpace(renderer: any): any; +export namespace UniformsUtils { + export { cloneUniforms as clone }; + export { mergeUniforms as merge }; +} diff --git a/jsdoc-testing/jsdoc/renderers/webgl-fallback/WebGLBackend.d.ts b/jsdoc-testing/jsdoc/renderers/webgl-fallback/WebGLBackend.d.ts new file mode 100644 index 000000000..cd1ee41da --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/webgl-fallback/WebGLBackend.d.ts @@ -0,0 +1,631 @@ +export default WebGLBackend; +/** + * A backend implementation targeting WebGL 2. + * + * @private + * @augments Backend + */ +declare class WebGLBackend extends Backend { + /** + * WebGLBackend options. + * + * @typedef {Object} WebGLBackend~Options + * @property {boolean} [logarithmicDepthBuffer=false] - Whether logarithmic depth buffer is enabled or not. + * @property {boolean} [reversedDepthBuffer=false] - Whether reversed depth buffer is enabled or not. + * @property {boolean} [alpha=true] - Whether the default framebuffer (which represents the final contents of the canvas) should be transparent or opaque. + * @property {boolean} [depth=true] - Whether the default framebuffer should have a depth buffer or not. + * @property {boolean} [stencil=false] - Whether the default framebuffer should have a stencil buffer or not. + * @property {boolean} [antialias=false] - Whether MSAA as the default anti-aliasing should be enabled or not. + * @property {number} [samples=0] - When `antialias` is `true`, `4` samples are used by default. Set this parameter to any other integer value than 0 to overwrite the default. + * @property {boolean} [forceWebGL=false] - If set to `true`, the renderer uses a WebGL 2 backend no matter if WebGPU is supported or not. + * @property {WebGL2RenderingContext} [context=undefined] - A WebGL 2 rendering context. + */ + /** + * Constructs a new WebGPU backend. + * + * @param {WebGLBackend~Options} [parameters] - The configuration parameter. + */ + constructor(parameters?: {}); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isWebGLBackend: boolean; + /** + * A reference to a backend module holding shader attribute-related + * utility functions. + * + * @type {?WebGLAttributeUtils} + * @default null + */ + attributeUtils: WebGLAttributeUtils | null; + /** + * A reference to a backend module holding extension-related + * utility functions. + * + * @type {?WebGLExtensions} + * @default null + */ + extensions: WebGLExtensions | null; + /** + * A reference to a backend module holding capability-related + * utility functions. + * + * @type {?WebGLCapabilities} + * @default null + */ + capabilities: WebGLCapabilities | null; + /** + * A reference to a backend module holding texture-related + * utility functions. + * + * @type {?WebGLTextureUtils} + * @default null + */ + textureUtils: WebGLTextureUtils | null; + /** + * A reference to a backend module holding renderer-related + * utility functions. + * + * @type {?WebGLBufferRenderer} + * @default null + */ + bufferRenderer: WebGLBufferRenderer | null; + /** + * A reference to the rendering context. + * + * @type {?WebGL2RenderingContext} + * @default null + */ + gl: WebGL2RenderingContext | null; + /** + * A reference to a backend module holding state-related + * utility functions. + * + * @type {?WebGLState} + * @default null + */ + state: WebGLState | null; + /** + * A reference to a backend module holding common + * utility functions. + * + * @type {?WebGLUtils} + * @default null + */ + utils: WebGLUtils | null; + /** + * Dictionary for caching VAOs. + * + * @type {Object} + */ + vaoCache: { + [x: string]: WebGLVertexArrayObject; + }; + /** + * Dictionary for caching transform feedback objects. + * + * @type {Object} + */ + transformFeedbackCache: { + [x: string]: WebGLTransformFeedback; + }; + /** + * Controls if `gl.RASTERIZER_DISCARD` should be enabled or not. + * Only relevant when using compute shaders. + * + * @type {boolean} + * @default false + */ + discard: boolean; + /** + * A reference to the `EXT_disjoint_timer_query_webgl2` extension. `null` if the + * device does not support the extension. + * + * @type {?EXTDisjointTimerQueryWebGL2} + * @default null + */ + disjoint: EXTDisjointTimerQueryWebGL2 | null; + /** + * A reference to the `KHR_parallel_shader_compile` extension. `null` if the + * device does not support the extension. + * + * @type {?KHRParallelShaderCompile} + * @default null + */ + parallel: KHRParallelShaderCompile | null; + /** + * A reference to the current render context. + * + * @private + * @type {RenderContext} + * @default null + */ + private _currentContext; + /** + * A unique collection of bindings. + * + * @private + * @type {WeakSet>} + */ + private _knownBindings; + /** + * Whether the device supports framebuffers invalidation or not. + * + * @private + * @type {boolean} + */ + private _supportsInvalidateFramebuffer; + /** + * The target framebuffer when rendering with + * the WebXR device API. + * + * @private + * @type {?WebGLFramebuffer} + * @default null + */ + private _xrFramebuffer; + /** + * Initializes the backend so it is ready for usage. + * + * @param {Renderer} renderer - The renderer. + */ + init(renderer: Renderer): void; + _onContextLost: ((event: any) => void) | undefined; + drawBuffersIndexedExt: Object | undefined; + /** + * This method performs a readback operation by moving buffer data from + * a storage buffer attribute from the GPU to the CPU. + * + * @async + * @param {StorageBufferAttribute} attribute - The storage buffer attribute. + * @return {Promise} A promise that resolves with the buffer data when the data are ready. + */ + getArrayBufferAsync(attribute: StorageBufferAttribute): Promise; + /** + * Ensures the backend is XR compatible. + * + * @async + * @return {Promise} A Promise that resolve when the renderer is XR compatible. + */ + makeXRCompatible(): Promise; + /** + * Sets the XR rendering destination. + * + * @param {WebGLFramebuffer} xrFramebuffer - The XR framebuffer. + */ + setXRTarget(xrFramebuffer: WebGLFramebuffer): void; + /** + * Configures the given XR render target with external textures. + * + * This method is only relevant when using the WebXR Layers API. + * + * @param {XRRenderTarget} renderTarget - The XR render target. + * @param {WebGLTexture} colorTexture - A native color texture. + * @param {?WebGLTexture} [depthTexture=null] - A native depth texture. + */ + setXRRenderTargetTextures(renderTarget: XRRenderTarget, colorTexture: WebGLTexture, depthTexture?: WebGLTexture | null): void; + /** + * Inits a time stamp query for the given render context. + * + * @param {string} type - The type of the timestamp query. + * @param {string} uid - A unique identifier for the timestamp query. + */ + initTimestampQuery(type: string, uid: string): void; + /** + * Prepares the timestamp buffer. + * + * @param {string} type - The type of the timestamp query. + * @param {string} uid - A unique identifier for the timestamp query. + */ + prepareTimestampBuffer(type: string, uid: string): void; + /** + * Returns the backend's rendering context. + * + * @return {WebGL2RenderingContext} The rendering context. + */ + getContext(): WebGL2RenderingContext; + /** + * This method is executed at the beginning of a render call and prepares + * the WebGL state for upcoming render calls + * + * @param {RenderContext} renderContext - The render context. + */ + beginRender(renderContext: RenderContext): void; + /** + * This method is executed at the end of a render call and finalizes work + * after draw calls. + * + * @param {RenderContext} renderContext - The render context. + */ + finishRender(renderContext: RenderContext): void; + /** + * This method processes the result of occlusion queries and writes it + * into render context data. + * + * @async + * @param {RenderContext} renderContext - The render context. + */ + resolveOccludedAsync(renderContext: RenderContext): void; + /** + * Returns `true` if the given 3D object is fully occluded by other + * 3D objects in the scene. + * + * @param {RenderContext} renderContext - The render context. + * @param {Object3D} object - The 3D object to test. + * @return {boolean} Whether the 3D object is fully occluded or not. + */ + isOccluded(renderContext: RenderContext, object: Object3D): boolean; + /** + * Updates the viewport with the values from the given render context. + * + * @param {RenderContext} renderContext - The render context. + */ + updateViewport(renderContext: RenderContext): void; + /** + * Updates the scissor with the values from the given render context. + * + * @param {RenderContext} renderContext - The render context. + */ + updateScissor(renderContext: RenderContext): void; + /** + * Defines the scissor test. + * + * @param {boolean} boolean - Whether the scissor test should be enabled or not. + */ + setScissorTest(boolean: boolean): void; + /** + * Returns the clear color and alpha into a single + * color object. + * + * @return {Color4} The clear color. + */ + getClearColor(): Color4; + /** + * Performs a clear operation. + * + * @param {boolean} color - Whether the color buffer should be cleared or not. + * @param {boolean} depth - Whether the depth buffer should be cleared or not. + * @param {boolean} stencil - Whether the stencil buffer should be cleared or not. + * @param {?Object} [descriptor=null] - The render context of the current set render target. + * @param {boolean} [setFrameBuffer=true] - Controls whether the intermediate framebuffer should be set or not. + * @param {boolean} [resolveRenderTarget=true] - Controls whether an active render target should be resolved + * or not. Only relevant for explicit clears. + */ + clear(color: boolean, depth: boolean, stencil: boolean, descriptor?: Object | null, setFrameBuffer?: boolean, resolveRenderTarget?: boolean): void; + /** + * This method is executed at the beginning of a compute call and + * prepares the state for upcoming compute tasks. + * + * @param {Node|Array} computeGroup - The compute node(s). + */ + beginCompute(computeGroup: Node | Array): void; + /** + * Executes a compute command for the given compute node. + * + * @param {Node|Array} computeGroup - The group of compute nodes of a compute call. Can be a single compute node. + * @param {Node} computeNode - The compute node. + * @param {Array} bindings - The bindings. + * @param {ComputePipeline} pipeline - The compute pipeline. + * @param {?number} [count=null] - The count of compute invocations. If `null`, the count is determined by the compute node. + */ + compute(computeGroup: Node | Array, computeNode: Node, bindings: Array, pipeline: ComputePipeline, count?: number | null): void; + /** + * This method is executed at the end of a compute call and + * finalizes work after compute tasks. + * + * @param {Node|Array} computeGroup - The compute node(s). + */ + finishCompute(computeGroup: Node | Array): void; + /** + * Internal to determine if the current render target is a render target array with depth 2D array texture. + * + * @param {RenderContext} renderContext - The render context. + * @return {boolean} Whether the render target is a render target array with depth 2D array texture. + * + * @private + */ + private _isRenderCameraDepthArray; + /** + * Internal draw function. + * + * @private + * @param {Object3D} object - The object to render. + * @param {WebGLBufferRenderer} renderer - The internal renderer. + * @param {number} firstVertex - The first vertex to render. + * @param {number} vertexCount - The vertex count. + * @param {number} instanceCount - The intance count. + */ + private _draw; + /** + * Executes a draw command for the given render object. + * + * @param {RenderObject} renderObject - The render object to draw. + * @param {Info} info - Holds a series of statistical information about the GPU memory and the rendering process. + */ + draw(renderObject: RenderObject): void; + /** + * Creates a default texture for the given texture that can be used + * as a placeholder until the actual texture is ready for usage. + * + * @param {Texture} texture - The texture to create a default texture for. + */ + createDefaultTexture(texture: Texture): void; + /** + * Defines a texture on the GPU for the given texture object. + * + * @param {Texture} texture - The texture. + * @param {Object} [options={}] - Optional configuration parameter. + */ + createTexture(texture: Texture, options?: Object): void; + /** + * Uploads the updated texture data to the GPU. + * + * @param {Texture} texture - The texture. + * @param {Object} [options={}] - Optional configuration parameter. + */ + updateTexture(texture: Texture, options?: Object): void; + /** + * Generates mipmaps for the given texture. + * + * @param {Texture} texture - The texture. + */ + generateMipmaps(texture: Texture): void; + /** + * Destroys the GPU data for the given texture object. + * + * @param {Texture} texture - The texture. + * @param {boolean} [isDefaultTexture=false] - Whether the texture uses a default GPU texture or not. + */ + destroyTexture(texture: Texture, isDefaultTexture?: boolean): void; + /** + * Returns texture data as a typed array. + * + * @async + * @param {Texture} texture - The texture to copy. + * @param {number} x - The x coordinate of the copy origin. + * @param {number} y - The y coordinate of the copy origin. + * @param {number} width - The width of the copy. + * @param {number} height - The height of the copy. + * @param {number} faceIndex - The face index. + * @return {Promise} A Promise that resolves with a typed array when the copy operation has finished. + */ + copyTextureToBuffer(texture: Texture, x: number, y: number, width: number, height: number, faceIndex: number): Promise; + /** + * Returns a node builder for the given render object. + * + * @param {RenderObject} object - The render object. + * @param {Renderer} renderer - The renderer. + * @return {GLSLNodeBuilder} The node builder. + */ + createNodeBuilder(object: RenderObject, renderer: Renderer): GLSLNodeBuilder; + /** + * Creates a shader program from the given programmable stage. + * + * @param {ProgrammableStage} program - The programmable stage. + */ + createProgram(program: ProgrammableStage): void; + /** + * Destroys the shader program of the given programmable stage. + * + * @param {ProgrammableStage} program - The programmable stage. + */ + destroyProgram(program: ProgrammableStage): void; + /** + * Creates a render pipeline for the given render object. + * + * @param {RenderObject} renderObject - The render object. + * @param {Array} promises - An array of compilation promises which are used in `compileAsync()`. + */ + createRenderPipeline(renderObject: RenderObject, promises: Array>): void; + /** + * Formats the source code of error messages. + * + * @private + * @param {string} string - The code. + * @param {number} errorLine - The error line. + * @return {string} The formatted code. + */ + private _handleSource; + /** + * Gets the shader compilation errors from the info log. + * + * @private + * @param {WebGL2RenderingContext} gl - The rendering context. + * @param {WebGLShader} shader - The WebGL shader object. + * @param {string} type - The shader type. + * @return {string} The shader errors. + */ + private _getShaderErrors; + /** + * Logs shader compilation errors. + * + * @private + * @param {WebGLProgram} programGPU - The WebGL program. + * @param {WebGLShader} glFragmentShader - The fragment shader as a native WebGL shader object. + * @param {WebGLShader} glVertexShader - The vertex shader as a native WebGL shader object. + */ + private _logProgramError; + /** + * Completes the shader program setup for the given render object. + * + * @private + * @param {RenderObject} renderObject - The render object. + * @param {RenderPipeline} pipeline - The render pipeline. + */ + private _completeCompile; + /** + * Creates a compute pipeline for the given compute node. + * + * @param {ComputePipeline} computePipeline - The compute pipeline. + * @param {Array} bindings - The bindings. + */ + createComputePipeline(computePipeline: ComputePipeline, bindings: Array): void; + /** + * Creates bindings from the given bind group definition. + * + * @param {BindGroup} bindGroup - The bind group. + * @param {Array} bindings - Array of bind groups. + * @param {number} cacheIndex - The cache index. + * @param {number} version - The version. + */ + createBindings(bindGroup: BindGroup, bindings: Array): void; + /** + * Updates the given bind group definition. + * + * @param {BindGroup} bindGroup - The bind group. + * @param {Array} bindings - Array of bind groups. + * @param {number} cacheIndex - The cache index. + * @param {number} version - The version. + */ + updateBindings(bindGroup: BindGroup): void; + /** + * Updates a buffer binding. + * + * @param {Buffer} binding - The buffer binding to update. + */ + updateBinding(binding: Buffer): void; + /** + * Creates the GPU buffer of an indexed shader attribute. + * + * @param {BufferAttribute} attribute - The indexed buffer attribute. + */ + createIndexAttribute(attribute: BufferAttribute): void; + /** + * Creates the GPU buffer of a shader attribute. + * + * @param {BufferAttribute} attribute - The buffer attribute. + */ + createAttribute(attribute: BufferAttribute): void; + /** + * Creates the GPU buffer of a storage attribute. + * + * @param {BufferAttribute} attribute - The buffer attribute. + */ + createStorageAttribute(attribute: BufferAttribute): void; + /** + * Updates the GPU buffer of a shader attribute. + * + * @param {BufferAttribute} attribute - The buffer attribute to update. + */ + updateAttribute(attribute: BufferAttribute): void; + /** + * Destroys the GPU buffer of a shader attribute. + * + * @param {BufferAttribute} attribute - The buffer attribute to destroy. + */ + destroyAttribute(attribute: BufferAttribute): void; + /** + * Checks if the given feature is supported by the backend. + * + * @param {string} name - The feature's name. + * @return {boolean} Whether the feature is supported or not. + */ + hasFeature(name: string): boolean; + /** + * Copies data of the given source texture to the given destination texture. + * + * @param {Texture} srcTexture - The source texture. + * @param {Texture} dstTexture - The destination texture. + * @param {?(Box3|Box2)} [srcRegion=null] - The region of the source texture to copy. + * @param {?(Vector2|Vector3)} [dstPosition=null] - The destination position of the copy. + * @param {number} [srcLevel=0] - The source mip level to copy from. + * @param {number} [dstLevel=0] - The destination mip level to copy to. + */ + copyTextureToTexture(srcTexture: Texture, dstTexture: Texture, srcRegion?: (Box3 | Box2) | null, dstPosition?: (Vector2 | Vector3) | null, srcLevel?: number, dstLevel?: number): void; + /** + * Copies the current bound framebuffer to the given texture. + * + * @param {Texture} texture - The destination texture. + * @param {RenderContext} renderContext - The render context. + * @param {Vector4} rectangle - A four dimensional vector defining the origin and dimension of the copy. + */ + copyFramebufferToTexture(texture: Texture, renderContext: RenderContext, rectangle: Vector4): void; + /** + * Checks if the given compatibility is supported by the backend. + * + * @param {string} name - The compatibility name. + * @return {boolean} Whether the compatibility is supported or not. + */ + hasCompatibility(name: string): boolean; + /** + * Initializes the render target defined in the given render context. + * + * @param {RenderContext} renderContext - The render context. + */ + initRenderTarget(renderContext: RenderContext): void; + /** + * Configures the active framebuffer from the given render context. + * + * @private + * @param {RenderContext} descriptor - The render context. + */ + private _setFramebuffer; + /** + * Computes the VAO key for the given index and attributes. + * + * @private + * @param {Array} attributes - An array of buffer attributes. + * @return {string} The VAO key. + */ + private _getVaoKey; + /** + * Creates a VAO from the index and attributes. + * + * @private + * @param {Array} attributes - An array of buffer attributes. + * @return {Object} The VAO data. + */ + private _createVao; + /** + * Creates a transform feedback from the given transform buffers. + * + * @private + * @param {Array} transformBuffers - The transform buffers. + * @return {WebGLTransformFeedback} The transform feedback. + */ + private _getTransformFeedback; + /** + * Setups the given bindings. + * + * @private + * @param {Array} bindings - The bindings. + * @param {WebGLProgram} programGPU - The WebGL program. + */ + private _setupBindings; + /** + * Binds the given uniforms. + * + * @private + * @param {Array} bindings - The bindings. + */ + private _bindUniforms; + /** + * The method ensures multisampled render targets are resolved. + * + * @private + * @param {RenderContext} renderContext - The render context. + */ + private _resolveRenderTarget; + /** + * Returns `true` if the `WEBGL_multisampled_render_to_texture` extension + * should be used when MSAA is enabled. + * + * @private + * @param {RenderTarget} renderTarget - The render target that should be multisampled. + * @return {boolean} Whether to use the `WEBGL_multisampled_render_to_texture` extension for MSAA or not. + */ + private _useMultisampledExtension; +} +import Backend from '../common/Backend.js'; +import WebGLAttributeUtils from './utils/WebGLAttributeUtils.js'; +import WebGLExtensions from './utils/WebGLExtensions.js'; +import WebGLCapabilities from './utils/WebGLCapabilities.js'; +import WebGLTextureUtils from './utils/WebGLTextureUtils.js'; +import { WebGLBufferRenderer } from './WebGLBufferRenderer.js'; +import WebGLState from './utils/WebGLState.js'; +import WebGLUtils from './utils/WebGLUtils.js'; +import GLSLNodeBuilder from './nodes/GLSLNodeBuilder.js'; diff --git a/jsdoc-testing/jsdoc/renderers/webgl-fallback/WebGLBufferRenderer.d.ts b/jsdoc-testing/jsdoc/renderers/webgl-fallback/WebGLBufferRenderer.d.ts new file mode 100644 index 000000000..c297252cb --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/webgl-fallback/WebGLBufferRenderer.d.ts @@ -0,0 +1,13 @@ +export class WebGLBufferRenderer { + constructor(backend: any); + gl: any; + extensions: any; + info: any; + mode: any; + index: number; + type: any; + object: any; + render(start: any, count: any): void; + renderInstances(start: any, count: any, primcount: any): void; + renderMultiDraw(starts: any, counts: any, drawCount: any): void; +} diff --git a/jsdoc-testing/jsdoc/renderers/webgl-fallback/nodes/GLSLNodeBuilder.d.ts b/jsdoc-testing/jsdoc/renderers/webgl-fallback/nodes/GLSLNodeBuilder.d.ts new file mode 100644 index 000000000..f1e09dc23 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/webgl-fallback/nodes/GLSLNodeBuilder.d.ts @@ -0,0 +1,365 @@ +export default GLSLNodeBuilder; +/** + * A node builder targeting GLSL. + * + * This module generates GLSL shader code from node materials and also + * generates the respective bindings and vertex buffer definitions. These + * data are later used by the renderer to create render and compute pipelines + * for render objects. + * + * @augments NodeBuilder + */ +declare class GLSLNodeBuilder extends NodeBuilder { + /** + * Constructs a new GLSL node builder renderer. + * + * @param {Object3D} object - The 3D object. + * @param {Renderer} renderer - The renderer. + */ + constructor(object: Object3D, renderer: Renderer); + /** + * A dictionary holds for each shader stage ('vertex', 'fragment', 'compute') + * another dictionary which manages UBOs per group ('render','frame','object'). + * + * @type {Object>} + */ + uniformGroups: { + [x: string]: { + [x: string]: NodeUniformsGroup; + }; + }; + /** + * An array that holds objects defining the varying and attribute data in + * context of Transform Feedback. + * + * @type {Array>} + */ + transforms: Array<{ + [x: string]: AttributeNode | string; + }>; + /** + * A dictionary that holds for each shader stage a Map of used extensions. + * + * @type {Object>} + */ + extensions: { + [x: string]: Map; + }; + /** + * A dictionary that holds for each shader stage an Array of used builtins. + * + * @type {Object>} + */ + builtins: { + [x: string]: string[]; + }; + /** + * Checks if the given texture requires a manual conversion to the working color space. + * + * @param {Texture} texture - The texture to check. + * @return {boolean} Whether the given texture requires a conversion to working color space or not. + */ + needsToWorkingColorSpace(texture: Texture): boolean; + /** + * Includes the given method name into the current + * function node. + * + * @private + * @param {string} name - The method name to include. + * @return {CodeNode} The respective code node. + */ + private _include; + /** + * Returns the bitcast method name for a given input and outputType. + * + * @param {string} type - The output type to bitcast to. + * @param {string} inputType - The input type of the. + * @return {string} The resolved WGSL bitcast invocation. + */ + getBitcastMethod(type: string, inputType: string): string; + /** + * Returns the float packing method name for a given numeric encoding. + * + * @param {string} encoding - The numeric encoding that describes how the float values are mapped to the integer range. + * @returns {string} The resolved GLSL float packing method name. + */ + getFloatPackingMethod(encoding: string): string; + /** + * Returns the float unpacking method name for a given numeric encoding. + * + * @param {string} encoding - The numeric encoding that describes how the integer values are mapped to the float range. + * @returns {string} The resolved GLSL float unpacking method name. + */ + getFloatUnpackingMethod(encoding: string): string; + /** + * Returns the native snippet for a ternary operation. + * + * @param {string} condSnippet - The condition determining which expression gets resolved. + * @param {string} ifSnippet - The expression to resolve to if the condition is true. + * @param {string} elseSnippet - The expression to resolve to if the condition is false. + * @return {string} The resolved method name. + */ + getTernary(condSnippet: string, ifSnippet: string, elseSnippet: string): string; + /** + * Builds the given shader node. + * + * @param {ShaderNodeInternal} shaderNode - The shader node. + * @return {string} The GLSL function code. + */ + buildFunctionCode(shaderNode: ShaderNodeInternal): string; + /** + * Setups the Pixel Buffer Object (PBO) for the given storage + * buffer node. + * + * @param {StorageBufferNode} storageBufferNode - The storage buffer node. + */ + setupPBO(storageBufferNode: StorageBufferNode): void; + /** + * Returns a GLSL snippet that represents the property name of the given node. + * + * @param {Node} node - The node. + * @param {string} [shaderStage=this.shaderStage] - The shader stage this code snippet is generated for. + * @return {string} The property name. + */ + getPropertyName(node: Node, shaderStage?: string): string; + /** + * Setups the Pixel Buffer Object (PBO) for the given storage + * buffer node. + * + * @param {StorageArrayElementNode} storageArrayElementNode - The storage array element node. + * @return {string} The property name. + */ + generatePBO(storageArrayElementNode: StorageArrayElementNode): string; + /** + * Generates the GLSL snippet that reads a single texel from a texture without sampling or filtering. + * + * @param {?Texture} texture - The texture. + * @param {string} textureProperty - The name of the texture uniform in the shader. + * @param {string} uvIndexSnippet - A GLSL snippet that represents texture coordinates used for sampling. + * @param {?string} levelSnippet - A GLSL snippet that represents the mip level, with level 0 containing a full size version of the texture. + * @param {?string} depthSnippet - A GLSL snippet that represents the 0-based texture array index to sample. + * @param {?string} offsetSnippet - A GLSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture. + * @return {string} The GLSL snippet. + */ + generateTextureLoad(texture: Texture | null, textureProperty: string, uvIndexSnippet: string, levelSnippet: string | null, depthSnippet: string | null, offsetSnippet: string | null): string; + /** + * Generates the GLSL snippet for sampling/loading the given texture. + * + * @param {Texture} texture - The texture. + * @param {string} textureProperty - The name of the texture uniform in the shader. + * @param {string} uvSnippet - A GLSL snippet that represents texture coordinates used for sampling. + * @param {?string} depthSnippet - A GLSL snippet that represents the 0-based texture array index to sample. + * @param {?string} offsetSnippet - A GLSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture. + * @return {string} The GLSL snippet. + */ + generateTexture(texture: Texture, textureProperty: string, uvSnippet: string, depthSnippet: string | null, offsetSnippet: string | null): string; + /** + * Generates the GLSL snippet when sampling textures with explicit mip level. + * + * @param {Texture} texture - The texture. + * @param {string} textureProperty - The name of the texture uniform in the shader. + * @param {string} uvSnippet - A GLSL snippet that represents texture coordinates used for sampling. + * @param {string} levelSnippet - A GLSL snippet that represents the mip level, with level 0 containing a full size version of the texture. + * @param {?string} depthSnippet - A GLSL snippet that represents 0-based texture array index to sample. + * @param {?string} offsetSnippet - A GLSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture. + * @return {string} The GLSL snippet. + */ + generateTextureLevel(texture: Texture, textureProperty: string, uvSnippet: string, levelSnippet: string, depthSnippet: string | null, offsetSnippet: string | null): string; + /** + * Generates the GLSL snippet when sampling textures with a bias to the mip level. + * + * @param {Texture} texture - The texture. + * @param {string} textureProperty - The name of the texture uniform in the shader. + * @param {string} uvSnippet - A GLSL snippet that represents texture coordinates used for sampling. + * @param {string} biasSnippet - A GLSL snippet that represents the bias to apply to the mip level before sampling. + * @param {?string} depthSnippet - A GLSL snippet that represents 0-based texture array index to sample. + * @param {?string} offsetSnippet - A GLSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture. + * @return {string} The GLSL snippet. + */ + generateTextureBias(texture: Texture, textureProperty: string, uvSnippet: string, biasSnippet: string, depthSnippet: string | null, offsetSnippet: string | null): string; + /** + * Generates the GLSL snippet for sampling/loading the given texture using explicit gradients. + * + * @param {Texture} texture - The texture. + * @param {string} textureProperty - The name of the texture uniform in the shader. + * @param {string} uvSnippet - A GLSL snippet that represents texture coordinates used for sampling. + * @param {Array} gradSnippet - An array holding both gradient GLSL snippets. + * @param {?string} depthSnippet - A GLSL snippet that represents 0-based texture array index to sample. + * @param {?string} offsetSnippet - A GLSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture. + * @return {string} The GLSL snippet. + */ + generateTextureGrad(texture: Texture, textureProperty: string, uvSnippet: string, gradSnippet: Array, depthSnippet: string | null, offsetSnippet: string | null): string; + /** + * Generates the GLSL snippet for sampling a depth texture and comparing the sampled depth values + * against a reference value. + * + * @param {Texture} texture - The texture. + * @param {string} textureProperty - The name of the texture uniform in the shader. + * @param {string} uvSnippet - A GLSL snippet that represents texture coordinates used for sampling. + * @param {string} compareSnippet - A GLSL snippet that represents the reference value. + * @param {?string} depthSnippet - A GLSL snippet that represents 0-based texture array index to sample. + * @param {?string} offsetSnippet - A GLSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture. + * @param {string} [shaderStage=this.shaderStage] - The shader stage this code snippet is generated for. + * @return {string} The GLSL snippet. + */ + generateTextureCompare(texture: Texture, textureProperty: string, uvSnippet: string, compareSnippet: string, depthSnippet: string | null, offsetSnippet: string | null, shaderStage?: string): string; + /** + * Returns the variables of the given shader stage as a GLSL string. + * + * @param {string} shaderStage - The shader stage. + * @return {string} The GLSL snippet that defines the variables. + */ + getVars(shaderStage: string): string; + /** + * Returns the uniforms of the given shader stage as a GLSL string. + * + * @param {string} shaderStage - The shader stage. + * @return {string} The GLSL snippet that defines the uniforms. + */ + getUniforms(shaderStage: string): string; + /** + * Returns the shader attributes of the given shader stage as a GLSL string. + * + * @param {string} shaderStage - The shader stage. + * @return {string} The GLSL snippet that defines the shader attributes. + */ + getAttributes(shaderStage: string): string; + /** + * Returns the members of the given struct type node as a GLSL string. + * + * @param {StructTypeNode} struct - The struct type node. + * @return {string} The GLSL snippet that defines the struct members. + */ + getStructMembers(struct: StructTypeNode): string; + /** + * Returns the structs of the given shader stage as a GLSL string. + * + * @param {string} shaderStage - The shader stage. + * @return {string} The GLSL snippet that defines the structs. + */ + getStructs(shaderStage: string): string; + /** + * Returns the varyings of the given shader stage as a GLSL string. + * + * @param {string} shaderStage - The shader stage. + * @return {string} The GLSL snippet that defines the varyings. + */ + getVaryings(shaderStage: string): string; + /** + * Returns a builtin representing the index of an invocation within its workgroup. + * + * @return {string} The invocation local index. + */ + getInvocationLocalIndex(): string; + /** + * Returns a builtin representing the size of a subgroup within the current shader. + */ + getSubgroupSize(): void; + /** + * Returns a builtin representing the index of an invocation within its subgroup. + */ + getInvocationSubgroupIndex(): void; + /** + * Returns a builtin representing the index of the current invocation's subgroup within its workgroup. + */ + getSubgroupIndex(): void; + /** + * Returns the frag depth builtin. + * + * @return {string} The frag depth builtin. + */ + getFragDepth(): string; + /** + * Enables the given extension. + * + * @param {string} name - The extension name. + * @param {string} behavior - The extension behavior. + * @param {string} [shaderStage=this.shaderStage] - The shader stage. + */ + enableExtension(name: string, behavior: string, shaderStage?: string): void; + /** + * Returns the enabled extensions of the given shader stage as a GLSL string. + * + * @param {string} shaderStage - The shader stage. + * @return {string} The GLSL snippet that defines the enabled extensions. + */ + getExtensions(shaderStage: string): string; + /** + * Returns the clip distances builtin. + * + * @return {string} The clip distances builtin. + */ + getClipDistance(): string; + /** + * Whether the requested feature is available or not. + * + * @param {string} name - The requested feature. + * @return {boolean} Whether the requested feature is supported or not. + */ + isAvailable(name: string): boolean; + /** + * Enables hardware clipping. + * + * @param {string} planeCount - The clipping plane count. + */ + enableHardwareClipping(planeCount: string): void; + /** + * Enables multiview. + */ + enableMultiview(): void; + /** + * Registers a transform in context of Transform Feedback. + * + * @param {string} varyingName - The varying name. + * @param {AttributeNode} attributeNode - The attribute node. + */ + registerTransform(varyingName: string, attributeNode: AttributeNode): void; + /** + * Returns the transforms of the given shader stage as a GLSL string. + * + * @param {string} shaderStage - The shader stage. + * @return {string} The GLSL snippet that defines the transforms. + */ + getTransforms(): string; + /** + * Returns a GLSL struct based on the given name and variables. + * + * @private + * @param {string} name - The struct name. + * @param {string} vars - The struct variables. + * @return {string} The GLSL snippet representing a struct. + */ + private _getGLSLUniformStruct; + /** + * Returns a GLSL vertex shader based on the given shader data. + * + * @private + * @param {Object} shaderData - The shader data. + * @return {string} The vertex shader. + */ + private _getGLSLVertexCode; + /** + * Returns a GLSL fragment shader based on the given shader data. + * + * @private + * @param {Object} shaderData - The shader data. + * @return {string} The vertex shader. + */ + private _getGLSLFragmentCode; + /** + * This method is one of the more important ones since it's responsible + * for generating a matching binding instance for the given uniform node. + * + * These bindings are later used in the renderer to create bind groups + * and layouts. + * + * @param {UniformNode} node - The uniform node. + * @param {string} type - The node data type. + * @param {string} shaderStage - The shader stage. + * @param {?string} [name=null] - An optional uniform name. + * @return {NodeUniform} The node uniform object. + */ + getUniformFromNode(node: UniformNode, type: string, shaderStage: string, name?: string | null): NodeUniform; +} +import { NodeBuilder } from '../../../nodes/Nodes.js'; +import NodeUniformsGroup from '../../common/nodes/NodeUniformsGroup.js'; diff --git a/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLAttributeUtils.d.ts b/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLAttributeUtils.d.ts new file mode 100644 index 000000000..7703a4235 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLAttributeUtils.d.ts @@ -0,0 +1,59 @@ +export default WebGLAttributeUtils; +/** + * A WebGL 2 backend utility module for managing shader attributes. + * + * @private + */ +declare class WebGLAttributeUtils { + /** + * Constructs a new utility object. + * + * @param {WebGLBackend} backend - The WebGL 2 backend. + */ + constructor(backend: WebGLBackend); + /** + * A reference to the WebGL 2 backend. + * + * @type {WebGLBackend} + */ + backend: WebGLBackend; + /** + * Creates the GPU buffer for the given buffer attribute. + * + * @param {BufferAttribute} attribute - The buffer attribute. + * @param {GLenum } bufferType - A flag that indicates the buffer type and thus binding point target. + */ + createAttribute(attribute: BufferAttribute, bufferType: GLenum): void; + /** + * Updates the GPU buffer of the given buffer attribute. + * + * @param {BufferAttribute} attribute - The buffer attribute. + */ + updateAttribute(attribute: BufferAttribute): void; + /** + * Destroys the GPU buffer of the given buffer attribute. + * + * @param {BufferAttribute} attribute - The buffer attribute. + */ + destroyAttribute(attribute: BufferAttribute): void; + /** + * This method performs a readback operation by moving buffer data from + * a storage buffer attribute from the GPU to the CPU. + * + * @async + * @param {StorageBufferAttribute} attribute - The storage buffer attribute. + * @return {Promise} A promise that resolves with the buffer data when the data are ready. + */ + getArrayBufferAsync(attribute: StorageBufferAttribute): Promise; + /** + * Creates a WebGL buffer with the given data. + * + * @private + * @param {WebGL2RenderingContext} gl - The rendering context. + * @param {GLenum } bufferType - A flag that indicates the buffer type and thus binding point target. + * @param {TypedArray} array - The array of the buffer attribute. + * @param {GLenum} usage - The usage. + * @return {WebGLBuffer} The WebGL buffer. + */ + private _createBuffer; +} diff --git a/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLCapabilities.d.ts b/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLCapabilities.d.ts new file mode 100644 index 000000000..095e4ee8c --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLCapabilities.d.ts @@ -0,0 +1,48 @@ +export default WebGLCapabilities; +/** + * A WebGL 2 backend utility module for managing the device's capabilities. + * + * @private + */ +declare class WebGLCapabilities { + /** + * Constructs a new utility object. + * + * @param {WebGLBackend} backend - The WebGL 2 backend. + */ + constructor(backend: WebGLBackend); + /** + * A reference to the WebGL 2 backend. + * + * @type {WebGLBackend} + */ + backend: WebGLBackend; + /** + * This value holds the cached max anisotropy value. + * + * @type {?number} + * @default null + */ + maxAnisotropy: number | null; + /** + * This value holds the cached max uniform block size value. + * + * @type {?number} + * @default null + */ + maxUniformBlockSize: number | null; + /** + * Returns the maximum anisotropy texture filtering value. This value + * depends on the device and is reported by the `EXT_texture_filter_anisotropic` + * WebGL extension. + * + * @return {number} The maximum anisotropy texture filtering value. + */ + getMaxAnisotropy(): number; + /** + * Returns the maximum number of bytes available for uniform buffers. + * + * @return {number} The maximum number of bytes available for uniform buffers. + */ + getUniformBufferLimit(): number; +} diff --git a/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLConstants.d.ts b/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLConstants.d.ts new file mode 100644 index 000000000..d8093bad2 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLConstants.d.ts @@ -0,0 +1,11 @@ +export namespace GLFeatureName { + let WEBGL_multi_draw: string; + let WEBGL_compressed_texture_astc: string; + let WEBGL_compressed_texture_etc: string; + let WEBGL_compressed_texture_etc1: string; + let WEBGL_compressed_texture_pvrtc: string; + let WEBGL_compressed_texture_s3tc: string; + let EXT_texture_compression_bptc: string; + let EXT_disjoint_timer_query_webgl2: string; + let OVR_multiview2: string; +} diff --git a/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLExtensions.d.ts b/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLExtensions.d.ts new file mode 100644 index 000000000..be5b14a6e --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLExtensions.d.ts @@ -0,0 +1,56 @@ +export default WebGLExtensions; +/** + * A WebGL 2 backend utility module for managing extensions. + * + * @private + */ +declare class WebGLExtensions { + /** + * Constructs a new utility object. + * + * @param {WebGLBackend} backend - The WebGL 2 backend. + */ + constructor(backend: WebGLBackend); + /** + * A reference to the WebGL 2 backend. + * + * @type {WebGLBackend} + */ + backend: WebGLBackend; + /** + * A reference to the rendering context. + * + * @type {WebGL2RenderingContext} + */ + gl: WebGL2RenderingContext; + /** + * A list with all the supported WebGL extensions. + * + * @type {Array} + */ + availableExtensions: Array; + /** + * A dictionary with requested WebGL extensions. + * The key is the name of the extension, the value + * the requested extension object. + * + * @type {Object} + */ + extensions: { + [x: string]: Object; + }; + /** + * Returns the extension object for the given extension name. + * + * @param {string} name - The extension name. + * @return {Object} The extension object. + */ + get(name: string): Object; + /** + * Returns `true` if the requested extension is available. + * + * @param {string} name - The extension name. + * @return {boolean} Whether the given extension is available or not. + */ + has(name: string): boolean; +} diff --git a/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLState.d.ts b/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLState.d.ts new file mode 100644 index 000000000..2aca5c6c5 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLState.d.ts @@ -0,0 +1,372 @@ +export default WebGLState; +/** + * A WebGL 2 backend utility module for managing the WebGL state. + * + * The major goal of this module is to reduce the number of state changes + * by caching the WEbGL state with a series of variables. In this way, the + * renderer only executes state change commands when necessary which + * improves the overall performance. + * + * @private + */ +declare class WebGLState { + /** + * Constructs a new utility object. + * + * @param {WebGLBackend} backend - The WebGL 2 backend. + */ + constructor(backend: WebGLBackend); + /** + * A reference to the WebGL 2 backend. + * + * @type {WebGLBackend} + */ + backend: WebGLBackend; + /** + * A reference to the rendering context. + * + * @type {WebGL2RenderingContext} + */ + gl: WebGL2RenderingContext; + enabled: {}; + parameters: {}; + currentFlipSided: any; + currentCullFace: any; + currentProgram: any; + currentBlendingEnabled: boolean; + currentBlending: any; + currentBlendSrc: any; + currentBlendDst: number | null; + currentBlendSrcAlpha: number | null; + currentBlendDstAlpha: number | null; + currentPremultipledAlpha: boolean | null; + currentPolygonOffsetFactor: any; + currentPolygonOffsetUnits: number | null; + currentColorMask: any; + currentDepthReversed: boolean; + currentDepthFunc: any; + currentDepthMask: any; + currentStencilFunc: any; + currentStencilRef: number | null; + currentStencilFuncMask: number | null; + currentStencilFail: any; + currentStencilZFail: number | null; + currentStencilZPass: number | null; + currentStencilMask: any; + currentLineWidth: any; + currentClippingPlanes: number; + currentVAO: any; + currentIndex: WebGLBuffer | null; + currentBoundFramebuffers: {}; + currentDrawbuffers: WeakMap; + maxTextures: any; + currentTextureSlot: any; + currentBoundTextures: {}; + currentBoundBufferBases: {}; + /** + * Inits the state of the utility. + * + * @private + */ + private _init; + currentScissor: Vector4 | undefined; + currentViewport: Vector4 | undefined; + _tempVec4: Vector4 | undefined; + /** + * Enables the given WebGL capability. + * + * This method caches the capability state so + * `gl.enable()` is only called when necessary. + * + * @param {GLenum} id - The capability to enable. + */ + enable(id: GLenum): void; + /** + * Disables the given WebGL capability. + * + * This method caches the capability state so + * `gl.disable()` is only called when necessary. + * + * @param {GLenum} id - The capability to enable. + */ + disable(id: GLenum): void; + /** + * Specifies whether polygons are front- or back-facing + * by setting the winding orientation. + * + * This method caches the state so `gl.frontFace()` is only + * called when necessary. + * + * @param {boolean} flipSided - Whether triangles flipped their sides or not. + */ + setFlipSided(flipSided: boolean): void; + /** + * Specifies whether or not front- and/or back-facing + * polygons can be culled. + * + * This method caches the state so `gl.cullFace()` is only + * called when necessary. + * + * @param {number} cullFace - Defines which polygons are candidates for culling. + */ + setCullFace(cullFace: number): void; + /** + * Specifies the width of line primitives. + * + * This method caches the state so `gl.lineWidth()` is only + * called when necessary. + * + * @param {number} width - The line width. + */ + setLineWidth(width: number): void; + setMRTBlending(textures: any, mrt: any, material: any): void; + /** + * Applies blending configuration for a specific draw buffer index. + * + * @private + * @param {number} index - The draw buffer index. + * @param {Object} blending - The blending configuration (material or BlendMode). + */ + private _setMRTBlendingIndex; + /** + * Defines the blending. + * + * This method caches the state so `gl.blendEquation()`, `gl.blendEquationSeparate()`, + * `gl.blendFunc()` and `gl.blendFuncSeparate()` are only called when necessary. + * + * @param {number} blending - The blending type. + * @param {number} blendEquation - The blending equation. + * @param {number} blendSrc - Only relevant for custom blending. The RGB source blending factor. + * @param {number} blendDst - Only relevant for custom blending. The RGB destination blending factor. + * @param {number} blendEquationAlpha - Only relevant for custom blending. The blending equation for alpha. + * @param {number} blendSrcAlpha - Only relevant for custom blending. The alpha source blending factor. + * @param {number} blendDstAlpha - Only relevant for custom blending. The alpha destination blending factor. + * @param {boolean} premultipliedAlpha - Whether premultiplied alpha is enabled or not. + */ + setBlending(blending: number, blendEquation: number, blendSrc: number, blendDst: number, blendEquationAlpha: number, blendSrcAlpha: number, blendDstAlpha: number, premultipliedAlpha: boolean): void; + currentBlendEquation: any; + currentBlendEquationAlpha: number | undefined; + /** + * Specifies whether colors can be written when rendering + * into a framebuffer or not. + * + * This method caches the state so `gl.colorMask()` is only + * called when necessary. + * + * @param {boolean} colorMask - The color mask. + */ + setColorMask(colorMask: boolean): void; + /** + * Specifies whether the depth test is enabled or not. + * + * @param {boolean} depthTest - Whether the depth test is enabled or not. + */ + setDepthTest(depthTest: boolean): void; + /** + * Configures the WebGL state to use a reversed depth buffer. + * + * @param {boolean} reversed - Whether the depth buffer is reversed or not. + */ + setReversedDepth(reversed: boolean): void; + /** + * Specifies whether depth values can be written when rendering + * into a framebuffer or not. + * + * This method caches the state so `gl.depthMask()` is only + * called when necessary. + * + * @param {boolean} depthMask - The depth mask. + */ + setDepthMask(depthMask: boolean): void; + /** + * Specifies the depth compare function. + * + * This method caches the state so `gl.depthFunc()` is only + * called when necessary. + * + * @param {number} depthFunc - The depth compare function. + */ + setDepthFunc(depthFunc: number): void; + /** + * Specifies the scissor box. + * + * @param {number} x - The x-coordinate of the lower left corner of the viewport. + * @param {number} y - The y-coordinate of the lower left corner of the viewport. + * @param {number} width - The width of the viewport. + * @param {number} height - The height of the viewport. + * + */ + scissor(x: number, y: number, width: number, height: number): void; + /** + * Specifies the viewport. + * + * @param {number} x - The x-coordinate of the lower left corner of the viewport. + * @param {number} y - The y-coordinate of the lower left corner of the viewport. + * @param {number} width - The width of the viewport. + * @param {number} height - The height of the viewport. + * + */ + viewport(x: number, y: number, width: number, height: number): void; + /** + * Defines the scissor test. + * + * @param {boolean} boolean - Whether the scissor test should be enabled or not. + */ + setScissorTest(boolean: boolean): void; + /** + * Specifies whether the stencil test is enabled or not. + * + * @param {boolean} stencilTest - Whether the stencil test is enabled or not. + */ + setStencilTest(stencilTest: boolean): void; + /** + * Specifies whether stencil values can be written when rendering + * into a framebuffer or not. + * + * This method caches the state so `gl.stencilMask()` is only + * called when necessary. + * + * @param {boolean} stencilMask - The stencil mask. + */ + setStencilMask(stencilMask: boolean): void; + /** + * Specifies whether the stencil test functions. + * + * This method caches the state so `gl.stencilFunc()` is only + * called when necessary. + * + * @param {number} stencilFunc - The stencil compare function. + * @param {number} stencilRef - The reference value for the stencil test. + * @param {number} stencilMask - A bit-wise mask that is used to AND the reference value and the stored stencil value when the test is done. + */ + setStencilFunc(stencilFunc: number, stencilRef: number, stencilMask: number): void; + /** + * Specifies whether the stencil test operation. + * + * This method caches the state so `gl.stencilOp()` is only + * called when necessary. + * + * @param {number} stencilFail - The function to use when the stencil test fails. + * @param {number} stencilZFail - The function to use when the stencil test passes, but the depth test fail. + * @param {number} stencilZPass - The function to use when both the stencil test and the depth test pass, + * or when the stencil test passes and there is no depth buffer or depth testing is disabled. + */ + setStencilOp(stencilFail: number, stencilZFail: number, stencilZPass: number): void; + /** + * Configures the WebGL state for the given material. + * + * @param {Material} material - The material to configure the state for. + * @param {number} frontFaceCW - Whether the front faces are counter-clockwise or not. + * @param {number} hardwareClippingPlanes - The number of hardware clipping planes. + */ + setMaterial(material: Material, frontFaceCW: number, hardwareClippingPlanes: number): void; + /** + * Specifies the polygon offset. + * + * This method caches the state so `gl.polygonOffset()` is only + * called when necessary. + * + * @param {boolean} polygonOffset - Whether polygon offset is enabled or not. + * @param {number} factor - The scale factor for the variable depth offset for each polygon. + * @param {number} units - The multiplier by which an implementation-specific value is multiplied with to create a constant depth offset. + */ + setPolygonOffset(polygonOffset: boolean, factor: number, units: number): void; + /** + * Defines the usage of the given WebGL program. + * + * This method caches the state so `gl.useProgram()` is only + * called when necessary. + * + * @param {WebGLProgram} program - The WebGL program to use. + * @return {boolean} Whether a program change has been executed or not. + */ + useProgram(program: WebGLProgram): boolean; + /** + * Sets the vertex state by binding the given VAO and element buffer. + * + * @param {WebGLVertexArrayObject} vao - The VAO. + * @param {?WebGLBuffer} indexBuffer - The index buffer. + * @return {boolean} Whether a vertex state has been changed or not. + */ + setVertexState(vao: WebGLVertexArrayObject, indexBuffer?: WebGLBuffer | null): boolean; + /** + * Resets the vertex array state by resetting the VAO and element buffer. + */ + resetVertexState(): void; + /** + * Binds the given framebuffer. + * + * This method caches the state so `gl.bindFramebuffer()` is only + * called when necessary. + * + * @param {number} target - The binding point (target). + * @param {WebGLFramebuffer} framebuffer - The WebGL framebuffer to bind. + * @return {boolean} Whether a bind has been executed or not. + */ + bindFramebuffer(target: number, framebuffer: WebGLFramebuffer): boolean; + /** + * Defines draw buffers to which fragment colors are written into. + * Configures the MRT setup of custom framebuffers. + * + * This method caches the state so `gl.drawBuffers()` is only + * called when necessary. + * + * @param {RenderContext} renderContext - The render context. + * @param {WebGLFramebuffer} framebuffer - The WebGL framebuffer. + */ + drawBuffers(renderContext: RenderContext, framebuffer: WebGLFramebuffer): void; + /** + * Makes the given texture unit active. + * + * This method caches the state so `gl.activeTexture()` is only + * called when necessary. + * + * @param {number} webglSlot - The texture unit to make active. + */ + activeTexture(webglSlot: number): void; + /** + * Binds the given WebGL texture to a target. + * + * This method caches the state so `gl.bindTexture()` is only + * called when necessary. + * + * @param {number} webglType - The binding point (target). + * @param {WebGLTexture} webglTexture - The WebGL texture to bind. + * @param {number} webglSlot - The texture. + */ + bindTexture(webglType: number, webglTexture: WebGLTexture, webglSlot: number): void; + /** + * Binds a given WebGL buffer to a given binding point (target) at a given index. + * + * This method caches the state so `gl.bindBufferBase()` is only + * called when necessary. + * + * @param {number} target - The target for the bind operation. + * @param {number} index - The index of the target. + * @param {WebGLBuffer} buffer - The WebGL buffer. + * @return {boolean} Whether a bind has been executed or not. + */ + bindBufferBase(target: number, index: number, buffer: WebGLBuffer): boolean; + /** + * Unbinds the current bound texture. + * + * This method caches the state so `gl.bindTexture()` is only + * called when necessary. + */ + unbindTexture(): void; + /** + * Returns the value for the given parameter. + * + * @param {number} name - The paramter to get the value for. + * @return {any} The value for the given parameter. + */ + getParameter(name: number): any; + /** + * Specifies a pixel storage mode. + * + * @param {number} name - The parameter to set. + * @param {any} value - A value to set the parameter to. + */ + pixelStorei(name: number, value: any): void; +} +import { Vector4 } from '../../../math/Vector4.js'; diff --git a/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLTextureUtils.d.ts b/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLTextureUtils.d.ts new file mode 100644 index 000000000..8f8378cc1 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLTextureUtils.d.ts @@ -0,0 +1,197 @@ +export default WebGLTextureUtils; +/** + * A WebGL 2 backend utility module for managing textures. + * + * @private + */ +declare class WebGLTextureUtils { + /** + * Constructs a new utility object. + * + * @param {WebGLBackend} backend - The WebGL 2 backend. + */ + constructor(backend: WebGLBackend); + /** + * A reference to the WebGL 2 backend. + * + * @type {WebGLBackend} + */ + backend: WebGLBackend; + /** + * A reference to the rendering context. + * + * @type {WebGL2RenderingContext} + */ + gl: WebGL2RenderingContext; + /** + * A reference to a backend module holding extension-related + * utility functions. + * + * @type {WebGLExtensions} + */ + extensions: WebGLExtensions; + /** + * A dictionary for managing default textures. The key + * is the binding point (target), the value the WEbGL texture object. + * + * @type {Object} + */ + defaultTextures: any; + /** + * A scratch framebuffer used for attaching the source texture in + * {@link copyTextureToTexture}. + * + * @private + * @type {?WebGLFramebuffer} + */ + private _srcFramebuffer; + /** + * A scratch framebuffer used for attaching the destination texture in + * {@link copyTextureToTexture}. + * + * @private + * @type {?WebGLFramebuffer} + */ + private _dstFramebuffer; + /** + * Inits the state of the utility. + * + * @private + */ + private _init; + /** + * Returns the native texture type for the given texture. + * + * @param {Texture} texture - The texture. + * @return {GLenum} The native texture type. + */ + getGLTextureType(texture: Texture): GLenum; + /** + * Returns the native texture type for the given texture. + * + * @param {?string} internalFormatName - The internal format name. When `null`, the internal format is derived from the subsequent parameters. + * @param {GLenum} glFormat - The WebGL format. + * @param {GLenum} glType - The WebGL type. + * @param {string} colorSpace - The texture's color space. + * @param {boolean} [forceLinearTransfer=false] - Whether to force a linear transfer or not. + * @return {GLenum} The internal format. + */ + getInternalFormat(internalFormatName: string | null, glFormat: GLenum, glType: GLenum, colorSpace: string, forceLinearTransfer?: boolean): GLenum; + /** + * Sets the texture parameters for the given texture. + * + * @param {GLenum} textureType - The texture type. + * @param {Texture} texture - The texture. + */ + setTextureParameters(textureType: GLenum, texture: Texture): void; + /** + * Creates a default texture for the given texture that can be used + * as a placeholder until the actual texture is ready for usage. + * + * @param {Texture} texture - The texture to create a default texture for. + */ + createDefaultTexture(texture: Texture): void; + /** + * Defines a texture on the GPU for the given texture object. + * + * @param {Texture} texture - The texture. + * @param {Object} [options={}] - Optional configuration parameter. + * @return {undefined} + */ + createTexture(texture: Texture, options?: Object): undefined; + /** + * Uploads texture buffer data to the GPU memory. + * + * @param {WebGLBuffer} buffer - The buffer data. + * @param {Texture} texture - The texture, + */ + copyBufferToTexture(buffer: WebGLBuffer, texture: Texture): void; + /** + * Uploads the updated texture data to the GPU. + * + * @param {Texture} texture - The texture. + * @param {Object} [options={}] - Optional configuration parameter. + */ + updateTexture(texture: Texture, options?: Object): void; + /** + * Generates mipmaps for the given texture. + * + * @param {Texture} texture - The texture. + */ + generateMipmaps(texture: Texture): void; + /** + * Deallocates the render buffers of the given render target. + * + * @param {RenderTarget} renderTarget - The render target. + */ + deallocateRenderBuffers(renderTarget: RenderTarget): void; + /** + * Destroys the GPU data for the given texture object. + * + * @param {Texture} texture - The texture. + * @param {boolean} [isDefaultTexture=false] - Whether the texture uses a default GPU texture or not. + */ + destroyTexture(texture: Texture, isDefaultTexture?: boolean): void; + /** + * Copies data of the given source texture to the given destination texture. + * + * @param {Texture} srcTexture - The source texture. + * @param {Texture} dstTexture - The destination texture. + * @param {?(Box3|Box2)} [srcRegion=null] - The region of the source texture to copy. + * @param {?(Vector2|Vector3)} [dstPosition=null] - The destination position of the copy. + * @param {number} [srcLevel=0] - The source mip level to copy from. + * @param {number} [dstLevel=0] - The destination mip level to copy to. + */ + copyTextureToTexture(srcTexture: Texture, dstTexture: Texture, srcRegion?: (Box3 | Box2) | null, dstPosition?: (Vector2 | Vector3) | null, srcLevel?: number, dstLevel?: number): void; + /** + * Copies the current bound framebuffer to the given texture. + * + * @param {Texture} texture - The destination texture. + * @param {RenderContext} renderContext - The render context. + * @param {Vector4} rectangle - A four dimensional vector defining the origin and dimension of the copy. + */ + copyFramebufferToTexture(texture: Texture, renderContext: RenderContext, rectangle: Vector4): void; + /** + * SetupS storage for internal depth/stencil buffers and bind to correct framebuffer. + * + * @param {WebGLRenderbuffer} renderbuffer - The render buffer. + * @param {RenderContext} renderContext - The render context. + * @param {number} samples - The MSAA sample count. + * @param {boolean} [useMultisampledRTT=false] - Whether to use WEBGL_multisampled_render_to_texture or not. + */ + setupRenderBufferStorage(renderbuffer: WebGLRenderbuffer, renderContext: RenderContext, samples: number, useMultisampledRTT?: boolean): void; + /** + * Returns texture data as a typed array. + * + * @async + * @param {Texture} texture - The texture to copy. + * @param {number} x - The x coordinate of the copy origin. + * @param {number} y - The y coordinate of the copy origin. + * @param {number} width - The width of the copy. + * @param {number} height - The height of the copy. + * @param {number} faceIndex - The face index. + * @return {Promise} A Promise that resolves with a typed array when the copy operation has finished. + */ + copyTextureToBuffer(texture: Texture, x: number, y: number, width: number, height: number, faceIndex: number): Promise; + /** + * Returns the corresponding typed array type for the given WebGL data type. + * + * @private + * @param {GLenum} glType - The WebGL data type. + * @return {TypedArray.constructor} The typed array type. + */ + private _getTypedArrayType; + /** + * Returns the bytes-per-texel value for the given WebGL data type and texture format. + * + * @private + * @param {GLenum} glType - The WebGL data type. + * @param {GLenum} glFormat - The WebGL texture format. + * @return {number} The bytes-per-texel. + */ + private _getBytesPerTexel; + /** + * Frees the internal resources. + */ + dispose(): void; +} diff --git a/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.d.ts b/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.d.ts new file mode 100644 index 000000000..c6a325c47 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.d.ts @@ -0,0 +1,58 @@ +export default WebGLTimestampQueryPool; +/** + * Manages a pool of WebGL timestamp queries for performance measurement. + * Handles creation, execution, and resolution of timer queries using WebGL extensions. + * + * @augments TimestampQueryPool + */ +declare class WebGLTimestampQueryPool extends TimestampQueryPool { + /** + * Creates a new WebGL timestamp query pool. + * + * @param {WebGLRenderingContext|WebGL2RenderingContext} gl - The WebGL context. + * @param {string} type - The type identifier for this query pool. + * @param {number} [maxQueries=2048] - Maximum number of queries this pool can hold. + */ + constructor(gl: WebGLRenderingContext | WebGL2RenderingContext, type: string, maxQueries?: number); + gl: WebGLRenderingContext | WebGL2RenderingContext; + type: string; + ext: any; + queries: any[] | undefined; + activeQuery: number | null; + queryStates: Map | undefined; + /** + * Allocates a pair of queries for a given render context. + * + * @param {string} uid - A unique identifier for the render context. + * @returns {?number} The base offset for the allocated queries, or null if allocation failed. + */ + allocateQueriesForContext(uid: string): number | null; + /** + * Begins a timestamp query for the specified render context. + * + * @param {string} uid - A unique identifier for the render context. + */ + beginQuery(uid: string): void; + /** + * Ends the active timestamp query for the specified render context. + * + * @param {string} uid - A unique identifier for the render context. + */ + endQuery(uid: string): void; + /** + * Asynchronously resolves all completed queries and returns the total duration. + * + * @async + * @returns {Promise} The total duration in milliseconds, or the last valid value if resolution fails. + */ + resolveQueriesAsync(): Promise; + /** + * Resolves a single query, checking for completion and disjoint operation. + * + * @async + * @param {WebGLQuery} query - The query object to resolve. + * @returns {Promise} The elapsed time in milliseconds. + */ + resolveQuery(query: WebGLQuery): Promise; +} +import TimestampQueryPool from '../../common/TimestampQueryPool.js'; diff --git a/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLUtils.d.ts b/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLUtils.d.ts new file mode 100644 index 000000000..1f75ec7e8 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLUtils.d.ts @@ -0,0 +1,51 @@ +export default WebGLUtils; +/** + * A WebGL 2 backend utility module with common helpers. + * + * @private + */ +declare class WebGLUtils { + /** + * Constructs a new utility object. + * + * @param {WebGLBackend} backend - The WebGL 2 backend. + */ + constructor(backend: WebGLBackend); + /** + * A reference to the WebGL 2 backend. + * + * @type {WebGLBackend} + */ + backend: WebGLBackend; + /** + * A reference to the rendering context. + * + * @type {WebGL2RenderingContext} + */ + gl: WebGL2RenderingContext; + /** + * A reference to a backend module holding extension-related + * utility functions. + * + * @type {WebGLExtensions} + */ + extensions: WebGLExtensions; + /** + * Converts the given three.js constant into a WebGL constant. + * The method currently supports the conversion of texture formats + * and types. + * + * @param {number} p - The three.js constant. + * @param {string} [colorSpace=NoColorSpace] - The color space. + * @return {?number} The corresponding WebGL constant. + */ + convert(p: number, colorSpace?: string): number | null; + /** + * This method can be used to synchronize the CPU with the GPU by waiting until + * ongoing GPU commands have been completed. + * + * @private + * @return {Promise} A promise that resolves when all ongoing GPU commands have been completed. + */ + private _clientWaitAsync; +} diff --git a/jsdoc-testing/jsdoc/renderers/webgpu/WebGPUBackend.d.ts b/jsdoc-testing/jsdoc/renderers/webgpu/WebGPUBackend.d.ts new file mode 100644 index 000000000..15058f911 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/webgpu/WebGPUBackend.d.ts @@ -0,0 +1,537 @@ +export default WebGPUBackend; +/** + * A backend implementation targeting WebGPU. + * + * @private + * @augments Backend + */ +declare class WebGPUBackend extends Backend { + /** + * WebGPUBackend options. + * + * @typedef {Object} WebGPUBackend~Options + * @property {boolean} [logarithmicDepthBuffer=false] - Whether logarithmic depth buffer is enabled or not. + * @property {boolean} [reversedDepthBuffer=false] - Whether reversed depth buffer is enabled or not. + * @property {boolean} [alpha=true] - Whether the default framebuffer (which represents the final contents of the canvas) should be transparent or opaque. + * @property {boolean} [depth=true] - Whether the default framebuffer should have a depth buffer or not. + * @property {boolean} [stencil=false] - Whether the default framebuffer should have a stencil buffer or not. + * @property {boolean} [antialias=false] - Whether MSAA as the default anti-aliasing should be enabled or not. + * @property {number} [samples=0] - When `antialias` is `true`, `4` samples are used by default. Set this parameter to any other integer value than 0 to overwrite the default. + * @property {boolean} [forceWebGL=false] - If set to `true`, the renderer uses a WebGL 2 backend no matter if WebGPU is supported or not. + * @property {boolean} [trackTimestamp=false] - Whether to track timestamps with a Timestamp Query API or not. + * @property {string} [powerPreference=undefined] - The power preference. + * @property {Object} [requiredLimits=undefined] - Specifies the limits that are required by the device request. The request will fail if the adapter cannot provide these limits. + * @property {GPUDevice} [device=undefined] - If there is an existing GPU device on app level, it can be passed to the renderer as a parameter. + * @property {number} [outputType=undefined] - Texture type for output to canvas. By default, device's preferred format is used; other formats may incur overhead. + */ + /** + * Constructs a new WebGPU backend. + * + * @param {WebGPUBackend~Options} [parameters] - The configuration parameter. + */ + constructor(parameters?: {}); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isWebGPUBackend: boolean; + /** + * Indicates whether the backend is in WebGPU compatibility mode or not. + * The backend must be initialized before the property can be evaluated. + * + * @type {?boolean} + * @readonly + * @default null + */ + readonly compatibilityMode: boolean | null; + /** + * A reference to the device. + * + * @type {?GPUDevice} + * @default null + */ + device: GPUDevice | null; + /** + * A reference to the default render pass descriptor. + * + * @type {?Object} + * @default null + */ + defaultRenderPassdescriptor: Object | null; + /** + * A reference to a backend module holding common utility functions. + * + * @type {WebGPUUtils} + */ + utils: WebGPUUtils; + /** + * A reference to a backend module holding shader attribute-related + * utility functions. + * + * @type {WebGPUAttributeUtils} + */ + attributeUtils: WebGPUAttributeUtils; + /** + * A reference to a backend module holding shader binding-related + * utility functions. + * + * @type {WebGPUBindingUtils} + */ + bindingUtils: WebGPUBindingUtils; + /** + * A reference to a backend module holding device capability related + * utility functions. + * + * @type {WebGPUCapabilities} + */ + capabilities: WebGPUCapabilities; + /** + * A reference to a backend module holding shader pipeline-related + * utility functions. + * + * @type {WebGPUPipelineUtils} + */ + pipelineUtils: WebGPUPipelineUtils; + /** + * A reference to a backend module holding shader texture-related + * utility functions. + * + * @type {WebGPUTextureUtils} + */ + textureUtils: WebGPUTextureUtils; + /** + * A map that manages the resolve buffers for occlusion queries. + * + * @type {Map} + */ + occludedResolveCache: Map; + /** + * A map of compatibility checks. + * + * @type {Object} + */ + _compatibility: Object; + /** + * A reference to the context. + * + * @type {?GPUCanvasContext} + * @default null + */ + get context(): GPUCanvasContext | null; + /** + * This method performs a readback operation by moving buffer data from + * a storage buffer attribute from the GPU to the CPU. + * + * @async + * @param {StorageBufferAttribute} attribute - The storage buffer attribute. + * @return {Promise} A promise that resolves with the buffer data when the data are ready. + */ + getArrayBufferAsync(attribute: StorageBufferAttribute): Promise; + /** + * Returns the backend's rendering context. + * + * @return {GPUCanvasContext} The rendering context. + */ + getContext(): GPUCanvasContext; + /** + * Returns the default render pass descriptor. + * + * In WebGPU, the default framebuffer must be configured + * like custom framebuffers so the backend needs a render + * pass descriptor even when rendering directly to screen. + * + * @private + * @return {Object} The render pass descriptor. + */ + private _getDefaultRenderPassDescriptor; + /** + * Internal to determine if the current render target is a render target array with depth 2D array texture. + * + * @param {RenderContext} renderContext - The render context. + * @return {boolean} Whether the render target is a render target array with depth 2D array texture. + * + * @private + */ + private _isRenderCameraDepthArray; + /** + * Returns the render pass descriptor for the given render context. + * + * @private + * @param {RenderContext} renderContext - The render context. + * @param {Object} colorAttachmentsConfig - Configuration object for the color attachments. + * @return {Object} The render pass descriptor. + */ + private _getRenderPassDescriptor; + /** + * This method is executed at the beginning of a render call and prepares + * the WebGPU state for upcoming render calls + * + * @param {RenderContext} renderContext - The render context. + */ + beginRender(renderContext: RenderContext): void; + /** + * This method creates layer descriptors for each camera in an array camera + * to prepare for rendering to a depth array texture. + * + * @param {RenderContext} renderContext - The render context. + * @param {Object} renderContextData - The render context data. + * @param {Object} descriptor - The render pass descriptor. + * @param {ArrayCamera} cameras - The array camera. + * + * @private + */ + private _createDepthLayerDescriptors; + /** + * This method updates the layer descriptors for each camera in an array camera + * to prepare for rendering to a depth array texture. + * + * @param {RenderContext} renderContext - The render context. + * @param {Object} renderContextData - The render context data. + * @param {ArrayCamera} cameras - The array camera. + * + */ + _updateDepthLayerDescriptors(renderContext: RenderContext, renderContextData: Object, cameras: ArrayCamera): void; + /** + * This method is executed at the end of a render call and finalizes work + * after draw calls. + * + * @param {RenderContext} renderContext - The render context. + */ + finishRender(renderContext: RenderContext): void; + /** + * Returns `true` if the given 3D object is fully occluded by other + * 3D objects in the scene. + * + * @param {RenderContext} renderContext - The render context. + * @param {Object3D} object - The 3D object to test. + * @return {boolean} Whether the 3D object is fully occluded or not. + */ + isOccluded(renderContext: RenderContext, object: Object3D): boolean; + /** + * This method processes the result of occlusion queries and writes it + * into render context data. + * + * @async + * @param {RenderContext} renderContext - The render context. + * @return {Promise} A Promise that resolves when the occlusion query results have been processed. + */ + resolveOccludedAsync(renderContext: RenderContext): Promise; + /** + * Updates the viewport with the values from the given render context. + * + * @param {RenderContext} renderContext - The render context. + */ + updateViewport(renderContext: RenderContext): void; + /** + * Updates the scissor with the values from the given render context. + * + * @param {RenderContext} renderContext - The render context. + */ + updateScissor(renderContext: RenderContext): void; + /** + * Returns the clear color and alpha into a single + * color object. + * + * @return {Color4} The clear color. + */ + getClearColor(): Color4; + /** + * Performs a clear operation. + * + * @param {boolean} color - Whether the color buffer should be cleared or not. + * @param {boolean} depth - Whether the depth buffer should be cleared or not. + * @param {boolean} stencil - Whether the stencil buffer should be cleared or not. + * @param {?RenderContext} [renderTargetContext=null] - The render context of the current set render target. + */ + clear(color: boolean, depth: boolean, stencil: boolean, renderTargetContext?: RenderContext | null): void; + /** + * This method is executed at the beginning of a compute call and + * prepares the state for upcoming compute tasks. + * + * @param {Node|Array} computeGroup - The compute node(s). + */ + beginCompute(computeGroup: Node | Array): void; + /** + * Executes a compute command for the given compute node. + * + * @param {Node|Array} computeGroup - The group of compute nodes of a compute call. Can be a single compute node. + * @param {Node} computeNode - The compute node. + * @param {Array} bindings - The bindings. + * @param {ComputePipeline} pipeline - The compute pipeline. + * @param {number|Array|IndirectStorageBufferAttribute} [dispatchSize=null] + * - A single number representing count, or + * - An array [x, y, z] representing dispatch size, or + * - A IndirectStorageBufferAttribute for indirect dispatch size. + */ + compute(computeGroup: Node | Array, computeNode: Node, bindings: Array, pipeline: ComputePipeline, dispatchSize?: number | Array | IndirectStorageBufferAttribute): void; + /** + * This method is executed at the end of a compute call and + * finalizes work after compute tasks. + * + * @param {Node|Array} computeGroup - The compute node(s). + */ + finishCompute(computeGroup: Node | Array): void; + /** + * Internal draw function that performs the draw with the given pass encoder. + * + * @private + * @param {RenderObject} renderObject - The render object. + * @param {Info} info - Holds a series of statistical information about the GPU memory and the rendering process. + * @param {Object} renderContextData - The render context data object, holding current pass state and occlusion query tracking. + * @param {GPURenderPipeline} pipelineGPU - The GPU render pipeline. + * @param {Array} bindings - The bind groups. + * @param {Array} vertexBuffers - The vertex buffers. + * @param {{vertexCount: number, firstVertex: number, instanceCount: number, firstInstance: number}} drawParams - The draw parameters. + * @param {GPURenderPassEncoder|GPURenderBundleEncoder} passEncoderGPU - The GPU pass encoder used for recording draw commands. + * @param {Object} currentSets - Tracking object for currently set pipeline, attributes, bind groups, and index state. + */ + private _draw; + /** + * Executes a draw command for the given render object. + * + * @param {RenderObject} renderObject - The render object to draw. + * @param {Info} info - Holds a series of statistical information about the GPU memory and the rendering process. + */ + draw(renderObject: RenderObject, info: Info): void; + /** + * Returns `true` if the render pipeline requires an update. + * + * @param {RenderObject} renderObject - The render object. + * @return {boolean} Whether the render pipeline requires an update or not. + */ + needsRenderUpdate(renderObject: RenderObject): boolean; + /** + * Returns a cache key that is used to identify render pipelines. + * + * @param {RenderObject} renderObject - The render object. + * @return {string} The cache key. + */ + getRenderCacheKey(renderObject: RenderObject): string; + /** + * Updates a GPU sampler for the given texture. + * + * @param {Texture} texture - The texture to update the sampler for. + * @return {string} The current sampler key. + */ + updateSampler(texture: Texture): string; + /** + * Creates a default texture for the given texture that can be used + * as a placeholder until the actual texture is ready for usage. + * + * @param {Texture} texture - The texture to create a default texture for. + * @return {boolean} Whether the sampler has been updated or not. + */ + createDefaultTexture(texture: Texture): boolean; + /** + * Defines a texture on the GPU for the given texture object. + * + * @param {Texture} texture - The texture. + * @param {Object} [options={}] - Optional configuration parameter. + */ + createTexture(texture: Texture, options?: Object): void; + /** + * Uploads the updated texture data to the GPU. + * + * @param {Texture} texture - The texture. + * @param {Object} [options={}] - Optional configuration parameter. + */ + updateTexture(texture: Texture, options?: Object): void; + /** + * Generates mipmaps for the given texture. + * + * @param {Texture} texture - The texture. + */ + generateMipmaps(texture: Texture): void; + /** + * Destroys the GPU data for the given texture object. + * + * @param {Texture} texture - The texture. + * @param {boolean} [isDefaultTexture=false] - Whether the texture uses a default GPU texture or not. + */ + destroyTexture(texture: Texture, isDefaultTexture?: boolean): void; + /** + * Returns texture data as a typed array. + * + * @async + * @param {Texture} texture - The texture to copy. + * @param {number} x - The x coordinate of the copy origin. + * @param {number} y - The y coordinate of the copy origin. + * @param {number} width - The width of the copy. + * @param {number} height - The height of the copy. + * @param {number} faceIndex - The face index. + * @return {Promise} A Promise that resolves with a typed array when the copy operation has finished. + */ + copyTextureToBuffer(texture: Texture, x: number, y: number, width: number, height: number, faceIndex: number): Promise; + /** + * Inits a time stamp query for the given render context. + * + * @param {string} type - The type of the timestamp query (e.g. 'render', 'compute'). + * @param {number} uid - Unique id for the context (e.g. render context id). + * @param {Object} descriptor - The query descriptor. + */ + initTimestampQuery(type: string, uid: number, descriptor: Object): void; + /** + * Returns a node builder for the given render object. + * + * @param {RenderObject} object - The render object. + * @param {Renderer} renderer - The renderer. + * @return {WGSLNodeBuilder} The node builder. + */ + createNodeBuilder(object: RenderObject, renderer: Renderer): WGSLNodeBuilder; + /** + * Creates a shader program from the given programmable stage. + * + * @param {ProgrammableStage} program - The programmable stage. + */ + createProgram(program: ProgrammableStage): void; + /** + * Destroys the shader program of the given programmable stage. + * + * @param {ProgrammableStage} program - The programmable stage. + */ + destroyProgram(program: ProgrammableStage): void; + /** + * Creates a render pipeline for the given render object. + * + * @param {RenderObject} renderObject - The render object. + * @param {Array} promises - An array of compilation promises which are used in `compileAsync()`. + */ + createRenderPipeline(renderObject: RenderObject, promises: Array>): void; + /** + * Creates a compute pipeline for the given compute node. + * + * @param {ComputePipeline} computePipeline - The compute pipeline. + * @param {Array} bindings - The bindings. + */ + createComputePipeline(computePipeline: ComputePipeline, bindings: Array): void; + /** + * Prepares the state for encoding render bundles. + * + * @param {RenderContext} renderContext - The render context. + */ + beginBundle(renderContext: RenderContext): void; + /** + * After processing render bundles this method finalizes related work. + * + * @param {RenderContext} renderContext - The render context. + * @param {RenderBundle} bundle - The render bundle. + */ + finishBundle(renderContext: RenderContext, bundle: RenderBundle): void; + /** + * Adds a render bundle to the render context data. + * + * @param {RenderContext} renderContext - The render context. + * @param {RenderBundle} bundle - The render bundle to add. + */ + addBundle(renderContext: RenderContext, bundle: RenderBundle): void; + /** + * Creates bindings from the given bind group definition. + * + * @param {BindGroup} bindGroup - The bind group. + * @param {Array} bindings - Array of bind groups. + * @param {number} cacheIndex - The cache index. + * @param {number} version - The version. + */ + createBindings(bindGroup: BindGroup, bindings: Array, cacheIndex: number, version: number): void; + /** + * Updates the given bind group definition. + * + * @param {BindGroup} bindGroup - The bind group. + * @param {Array} bindings - Array of bind groups. + * @param {number} cacheIndex - The cache index. + * @param {number} version - The version. + */ + updateBindings(bindGroup: BindGroup, bindings: Array, cacheIndex: number, version: number): void; + /** + * Updates a buffer binding. + * + * @param {Buffer} binding - The buffer binding to update. + */ + updateBinding(binding: Buffer): void; + /** + * Delete data associated with the current bind group. + * + * @param {BindGroup} bindGroup - The bind group. + */ + deleteBindGroupData(bindGroup: BindGroup): void; + /** + * Creates the buffer of an indexed shader attribute. + * + * @param {BufferAttribute} attribute - The indexed buffer attribute. + */ + createIndexAttribute(attribute: BufferAttribute): void; + /** + * Creates the GPU buffer of a shader attribute. + * + * @param {BufferAttribute} attribute - The buffer attribute. + */ + createAttribute(attribute: BufferAttribute): void; + /** + * Creates the GPU buffer of a storage attribute. + * + * @param {BufferAttribute} attribute - The buffer attribute. + */ + createStorageAttribute(attribute: BufferAttribute): void; + /** + * Creates the GPU buffer of an indirect storage attribute. + * + * @param {BufferAttribute} attribute - The buffer attribute. + */ + createIndirectStorageAttribute(attribute: BufferAttribute): void; + /** + * Updates the GPU buffer of a shader attribute. + * + * @param {BufferAttribute} attribute - The buffer attribute to update. + */ + updateAttribute(attribute: BufferAttribute): void; + /** + * Destroys the GPU buffer of a shader attribute. + * + * @param {BufferAttribute} attribute - The buffer attribute to destroy. + */ + destroyAttribute(attribute: BufferAttribute): void; + /** + * Checks if the given feature is supported by the backend. + * + * @param {string} name - The feature's name. + * @return {boolean} Whether the feature is supported or not. + */ + hasFeature(name: string): boolean; + /** + * Copies data of the given source texture to the given destination texture. + * + * @param {Texture} srcTexture - The source texture. + * @param {Texture} dstTexture - The destination texture. + * @param {?(Box3|Box2)} [srcRegion=null] - The region of the source texture to copy. + * @param {?(Vector2|Vector3)} [dstPosition=null] - The destination position of the copy. + * @param {number} [srcLevel=0] - The mipmap level to copy. + * @param {number} [dstLevel=0] - The destination mip level to copy to. + */ + copyTextureToTexture(srcTexture: Texture, dstTexture: Texture, srcRegion?: (Box3 | Box2) | null, dstPosition?: (Vector2 | Vector3) | null, srcLevel?: number, dstLevel?: number): void; + /** + * Copies the current bound framebuffer to the given texture. + * + * @param {Texture} texture - The destination texture. + * @param {RenderContext} renderContext - The render context. + * @param {Vector4} rectangle - A four dimensional vector defining the origin and dimension of the copy. + */ + copyFramebufferToTexture(texture: Texture, renderContext: RenderContext, rectangle: Vector4): void; + /** + * Checks if the given compatibility is supported by the backend. + * + * @param {string} name - The compatibility name. + * @return {boolean} Whether the compatibility is supported or not. + */ + hasCompatibility(name: string): boolean; +} +import Backend from '../common/Backend.js'; +import WebGPUUtils from './utils/WebGPUUtils.js'; +import WebGPUAttributeUtils from './utils/WebGPUAttributeUtils.js'; +import WebGPUBindingUtils from './utils/WebGPUBindingUtils.js'; +import WebGPUCapabilities from './utils/WebGPUCapabilities.js'; +import WebGPUPipelineUtils from './utils/WebGPUPipelineUtils.js'; +import WebGPUTextureUtils from './utils/WebGPUTextureUtils.js'; +import WGSLNodeBuilder from './nodes/WGSLNodeBuilder.js'; diff --git a/jsdoc-testing/jsdoc/renderers/webgpu/WebGPURenderer.Nodes.d.ts b/jsdoc-testing/jsdoc/renderers/webgpu/WebGPURenderer.Nodes.d.ts new file mode 100644 index 000000000..dfbe8d022 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/webgpu/WebGPURenderer.Nodes.d.ts @@ -0,0 +1,25 @@ +export default WebGPURenderer; +/** + * This alternative version of {@link WebGPURenderer} only supports node materials. + * So classes like `MeshBasicMaterial` are not compatible. + * + * @private + * @augments Renderer + */ +declare class WebGPURenderer extends Renderer { + /** + * Constructs a new WebGPU renderer. + * + * @param {WebGPURenderer~Options} [parameters] - The configuration parameter. + */ + constructor(parameters?: {}); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isWebGPURenderer: boolean; +} +import Renderer from '../common/Renderer.js'; diff --git a/jsdoc-testing/jsdoc/renderers/webgpu/WebGPURenderer.d.ts b/jsdoc-testing/jsdoc/renderers/webgpu/WebGPURenderer.d.ts new file mode 100644 index 000000000..546c6744b --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/webgpu/WebGPURenderer.d.ts @@ -0,0 +1,42 @@ +export default WebGPURenderer; +/** + * This renderer is the new alternative of `WebGLRenderer`. `WebGPURenderer` has the ability + * to target different backends. By default, the renderer tries to use a WebGPU backend if the + * browser supports WebGPU. If not, `WebGPURenderer` falls backs to a WebGL 2 backend. + * + * @augments Renderer + */ +declare class WebGPURenderer extends Renderer { + /** + * WebGPURenderer options. + * + * @typedef {Object} WebGPURenderer~Options + * @property {boolean} [logarithmicDepthBuffer=false] - Whether logarithmic depth buffer is enabled or not. + * @property {boolean} [reversedDepthBuffer=false] - Whether reversed depth buffer is enabled or not. + * @property {boolean} [alpha=true] - Whether the default framebuffer (which represents the final contents of the canvas) should be transparent or opaque. + * @property {boolean} [depth=true] - Whether the default framebuffer should have a depth buffer or not. + * @property {boolean} [stencil=false] - Whether the default framebuffer should have a stencil buffer or not. + * @property {boolean} [antialias=false] - Whether MSAA as the default anti-aliasing should be enabled or not. + * @property {number} [samples=0] - When `antialias` is `true`, `4` samples are used by default. Set this parameter to any other integer value than 0 to overwrite the default. + * @property {boolean} [forceWebGL=false] - If set to `true`, the renderer uses a WebGL 2 backend no matter if WebGPU is supported or not. + * @property {boolean} [multiview=false] - If set to `true`, the renderer will use multiview during WebXR rendering if supported. + * @property {number} [outputType=undefined] - Texture type for output to canvas. By default, device's preferred format is used; other formats may incur overhead. + * @property {number} [outputBufferType=HalfFloatType] - Defines the type of output buffers. The default `HalfFloatType` is recommend for best + * quality. To save memory and bandwidth, `UnsignedByteType` might be used. This will reduce rendering quality though. + */ + /** + * Constructs a new WebGPU renderer. + * + * @param {WebGPURenderer~Options} [parameters] - The configuration parameter. + */ + constructor(parameters?: {}); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isWebGPURenderer: boolean; +} +import Renderer from '../common/Renderer.js'; diff --git a/jsdoc-testing/jsdoc/renderers/webgpu/nodes/BasicNodeLibrary.d.ts b/jsdoc-testing/jsdoc/renderers/webgpu/nodes/BasicNodeLibrary.d.ts new file mode 100644 index 000000000..f6f699f14 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/webgpu/nodes/BasicNodeLibrary.d.ts @@ -0,0 +1,11 @@ +export default BasicNodeLibrary; +/** + * This version of a node library represents a basic version + * just focusing on lights and tone mapping techniques. + * + * @private + * @augments NodeLibrary + */ +declare class BasicNodeLibrary extends NodeLibrary { +} +import NodeLibrary from '../../common/nodes/NodeLibrary.js'; diff --git a/jsdoc-testing/jsdoc/renderers/webgpu/nodes/StandardNodeLibrary.d.ts b/jsdoc-testing/jsdoc/renderers/webgpu/nodes/StandardNodeLibrary.d.ts new file mode 100644 index 000000000..1d2893798 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/webgpu/nodes/StandardNodeLibrary.d.ts @@ -0,0 +1,12 @@ +export default StandardNodeLibrary; +/** + * This version of a node library represents the standard version + * used in {@link WebGPURenderer}. It maps lights, tone mapping + * techniques and materials to node-based implementations. + * + * @private + * @augments NodeLibrary + */ +declare class StandardNodeLibrary extends NodeLibrary { +} +import NodeLibrary from '../../common/nodes/NodeLibrary.js'; diff --git a/jsdoc-testing/jsdoc/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts b/jsdoc-testing/jsdoc/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts new file mode 100644 index 000000000..73b4c48ce --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts @@ -0,0 +1,590 @@ +export default WGSLNodeBuilder; +/** + * A node builder targeting WGSL. + * + * This module generates WGSL shader code from node materials and also + * generates the respective bindings and vertex buffer definitions. These + * data are later used by the renderer to create render and compute pipelines + * for render objects. + * + * @augments NodeBuilder + */ +declare class WGSLNodeBuilder extends NodeBuilder { + /** + * Constructs a new WGSL node builder renderer. + * + * @param {Object3D} object - The 3D object. + * @param {Renderer} renderer - The renderer. + */ + constructor(object: Object3D, renderer: Renderer); + /** + * A dictionary that holds for each shader stage ('vertex', 'fragment', 'compute') + * another dictionary which manages UBOs per group ('render','frame','object'). + * + * @type {Object>} + */ + uniformGroups: { + [x: string]: { + [x: string]: NodeUniformsGroup; + }; + }; + /** + * A dictionary that holds the assigned binding indices for each uniform group. + * This ensures the same binding index is used across all shader stages. + * + * @type {Object} + */ + uniformGroupsBindings: { + [x: string]: { + index: number; + id: number; + }; + }; + /** + * A dictionary that holds for each shader stage a Map of builtins. + * + * @type {Object>} + */ + builtins: { + [x: string]: Map; + }; + /** + * A dictionary that holds for each shader stage a Set of directives. + * + * @type {Object>} + */ + directives: { + [x: string]: Set; + }; + /** + * A map for managing scope arrays. Only relevant for when using + * {@link WorkgroupInfoNode} in context of compute shaders. + * + * @type {Map} + */ + scopedArrays: Map; + /** + * A flag that indicates that early returns are allowed. + * + * @type {boolean} + * @default true + */ + allowEarlyReturns: boolean; + /** + * Generates the WGSL snippet for sampled textures. + * + * @private + * @param {Texture} texture - The texture. + * @param {string} textureProperty - The name of the texture uniform in the shader. + * @param {string} uvSnippet - A WGSL snippet that represents texture coordinates used for sampling. + * @param {?string} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. + * @param {?string} offsetSnippet - A WGSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture. + * @param {string} [shaderStage=this.shaderStage] - The shader stage this code snippet is generated for. + * @return {string} The WGSL snippet. + */ + private _generateTextureSample; + /** + * Generates the WGSL snippet when sampling textures with explicit mip level. + * + * @private + * @param {Texture} texture - The texture. + * @param {string} textureProperty - The name of the texture uniform in the shader. + * @param {string} uvSnippet - A WGSL snippet that represents texture coordinates used for sampling. + * @param {string} levelSnippet - A WGSL snippet that represents the mip level, with level 0 containing a full size version of the texture. + * @param {string} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. + * @param {?string} offsetSnippet - A WGSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture. + * @return {string} The WGSL snippet. + */ + private generateTextureSampleLevel; + /** + * Generates a wrap function used in context of textures. + * + * @param {Texture} texture - The texture to generate the function for. + * @return {string} The name of the generated function. + */ + generateWrapFunction(texture: Texture): string; + /** + * Generates a WGSL variable that holds the texture dimension of the given texture. + * It also returns information about the number of layers (elements) of an arrayed + * texture as well as the cube face count of cube textures. + * + * @param {Texture} texture - The texture to generate the function for. + * @param {string} textureProperty - The name of the video texture uniform in the shader. + * @param {string} levelSnippet - A WGSL snippet that represents the mip level, with level 0 containing a full size version of the texture. + * @return {string} The name of the dimension variable. + */ + generateTextureDimension(texture: Texture, textureProperty: string, levelSnippet: string): string; + /** + * Generates the WGSL snippet for a manual filtered texture. + * + * @param {Texture} texture - The texture. + * @param {string} textureProperty - The name of the texture uniform in the shader. + * @param {string} uvSnippet - A WGSL snippet that represents texture coordinates used for sampling. + * @param {?string} offsetSnippet - A WGSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture. + * @param {string} [levelSnippet='0u'] - A WGSL snippet that represents the mip level, with level 0 containing a full size version of the texture. + * @param {?string} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. + * @return {string} The WGSL snippet. + */ + generateFilteredTexture(texture: Texture, textureProperty: string, uvSnippet: string, offsetSnippet: string | null, levelSnippet?: string, depthSnippet: string | null): string; + /** + * Generates the WGSL snippet for a texture lookup with explicit level-of-detail. + * Since it's a lookup, no sampling or filtering is applied. + * + * @param {Texture} texture - The texture. + * @param {string} textureProperty - The name of the texture uniform in the shader. + * @param {string} uvSnippet - A WGSL snippet that represents texture coordinates used for sampling. + * @param {?string} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. + * @param {?string} offsetSnippet - A WGSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture. + * @param {string} [levelSnippet='0u'] - A WGSL snippet that represents the mip level, with level 0 containing a full size version of the texture. + * @return {string} The WGSL snippet. + */ + generateTextureLod(texture: Texture, textureProperty: string, uvSnippet: string, depthSnippet: string | null, offsetSnippet: string | null, levelSnippet?: string): string; + /** + * Generates the WGSL snippet that reads a single texel from a storage texture. + * + * @param {Texture} texture - The texture. + * @param {string} textureProperty - The name of the texture uniform in the shader. + * @param {string} uvIndexSnippet - A WGSL snippet that represents texture coordinates used for sampling. + * @param {?string} levelSnippet - A WGSL snippet that represents the mip level, with level 0 containing a full size version of the texture. + * @param {?string} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. + * @param {?string} offsetSnippet - A WGSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture. + * @return {string} The WGSL snippet. + */ + generateStorageTextureLoad(texture: Texture, textureProperty: string, uvIndexSnippet: string, levelSnippet: string | null, depthSnippet: string | null, offsetSnippet: string | null): string; + /** + * Generates the WGSL snippet that reads a single texel from a texture without sampling or filtering. + * + * @param {Texture} texture - The texture. + * @param {string} textureProperty - The name of the texture uniform in the shader. + * @param {string} uvIndexSnippet - A WGSL snippet that represents texture coordinates used for sampling. + * @param {?string} levelSnippet - A WGSL snippet that represents the mip level, with level 0 containing a full size version of the texture. + * @param {?string} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. + * @param {?string} offsetSnippet - A WGSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture. + * @return {string} The WGSL snippet. + */ + generateTextureLoad(texture: Texture, textureProperty: string, uvIndexSnippet: string, levelSnippet: string | null, depthSnippet: string | null, offsetSnippet: string | null): string; + /** + * Generates the WGSL snippet that writes a single texel to a texture. + * + * @param {Texture} texture - The texture. + * @param {string} textureProperty - The name of the texture uniform in the shader. + * @param {string} uvIndexSnippet - A WGSL snippet that represents texture coordinates used for sampling. + * @param {?string} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. + * @param {string} valueSnippet - A WGSL snippet that represent the new texel value. + * @return {string} The WGSL snippet. + */ + generateTextureStore(texture: Texture, textureProperty: string, uvIndexSnippet: string, depthSnippet: string | null, valueSnippet: string): string; + /** + * Returns `true` if the sampled values of the given texture should be compared against a reference value. + * + * @param {Texture} texture - The texture. + * @return {boolean} Whether the sampled values of the given texture should be compared against a reference value or not. + */ + isSampleCompare(texture: Texture): boolean; + /** + * Returns `true` if the given texture is unfilterable. + * + * @param {Texture} texture - The texture. + * @return {boolean} Whether the given texture is unfilterable or not. + */ + isUnfilterable(texture: Texture): boolean; + /** + * Generates the WGSL snippet for sampling/loading the given texture. + * + * @param {Texture} texture - The texture. + * @param {string} textureProperty - The name of the texture uniform in the shader. + * @param {string} uvSnippet - A WGSL snippet that represents texture coordinates used for sampling. + * @param {?string} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. + * @param {?string} offsetSnippet - A WGSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture. + * @param {string} [shaderStage=this.shaderStage] - The shader stage this code snippet is generated for. + * @return {string} The WGSL snippet. + */ + generateTexture(texture: Texture, textureProperty: string, uvSnippet: string, depthSnippet: string | null, offsetSnippet: string | null, shaderStage?: string): string; + /** + * Generates the WGSL snippet for sampling/loading the given texture using explicit gradients. + * + * @param {Texture} texture - The texture. + * @param {string} textureProperty - The name of the texture uniform in the shader. + * @param {string} uvSnippet - A WGSL snippet that represents texture coordinates used for sampling. + * @param {Array} gradSnippet - An array holding both gradient WGSL snippets. + * @param {?string} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. + * @param {?string} offsetSnippet - A WGSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture. + * @param {string} [shaderStage=this.shaderStage] - The shader stage this code snippet is generated for. + * @return {string} The WGSL snippet. + */ + generateTextureGrad(texture: Texture, textureProperty: string, uvSnippet: string, gradSnippet: Array, depthSnippet: string | null, offsetSnippet: string | null, shaderStage?: string): string; + /** + * Generates the WGSL snippet for sampling a depth texture and comparing the sampled depth values + * against a reference value. + * + * @param {Texture} texture - The texture. + * @param {string} textureProperty - The name of the texture uniform in the shader. + * @param {string} uvSnippet - A WGSL snippet that represents texture coordinates used for sampling. + * @param {string} compareSnippet - A WGSL snippet that represents the reference value. + * @param {?string} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. + * @param {?string} offsetSnippet - A WGSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture. + * @param {string} [shaderStage=this.shaderStage] - The shader stage this code snippet is generated for. + * @return {string} The WGSL snippet. + */ + generateTextureCompare(texture: Texture, textureProperty: string, uvSnippet: string, compareSnippet: string, depthSnippet: string | null, offsetSnippet: string | null, shaderStage?: string): string; + /** + * Generates the WGSL snippet when sampling textures with explicit mip level. + * + * @param {Texture} texture - The texture. + * @param {string} textureProperty - The name of the texture uniform in the shader. + * @param {string} uvSnippet - A WGSL snippet that represents texture coordinates used for sampling. + * @param {string} levelSnippet - A WGSL snippet that represents the mip level, with level 0 containing a full size version of the texture. + * @param {?string} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. + * @param {?string} offsetSnippet - A WGSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture. + * @param {string} [shaderStage=this.shaderStage] - The shader stage this code snippet is generated for. + * @return {string} The WGSL snippet. + */ + generateTextureLevel(texture: Texture, textureProperty: string, uvSnippet: string, levelSnippet: string, depthSnippet: string | null, offsetSnippet: string | null): string; + /** + * Generates the WGSL snippet when sampling textures with a bias to the mip level. + * + * @param {Texture} texture - The texture. + * @param {string} textureProperty - The name of the texture uniform in the shader. + * @param {string} uvSnippet - A WGSL snippet that represents texture coordinates used for sampling. + * @param {string} biasSnippet - A WGSL snippet that represents the bias to apply to the mip level before sampling. + * @param {?string} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. + * @param {?string} offsetSnippet - A WGSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture. + * @param {string} [shaderStage=this.shaderStage] - The shader stage this code snippet is generated for. + * @return {string} The WGSL snippet. + */ + generateTextureBias(texture: Texture, textureProperty: string, uvSnippet: string, biasSnippet: string, depthSnippet: string | null, offsetSnippet: string | null, shaderStage?: string): string; + /** + * Returns a WGSL snippet that represents the property name of the given node. + * + * @param {Node} node - The node. + * @param {string} [shaderStage=this.shaderStage] - The shader stage this code snippet is generated for. + * @return {string} The property name. + */ + getPropertyName(node: Node, shaderStage?: string): string; + /** + * Returns the native shader operator name for a given generic name. + * + * @param {string} op - The operator name to resolve. + * @return {?string} The resolved operator name. + */ + getFunctionOperator(op: string): string | null; + /** + * Returns the node access for the given node and shader stage. + * + * @param {StorageTextureNode|StorageBufferNode} node - The storage node. + * @param {string} shaderStage - The shader stage. + * @return {string} The node access. + */ + getNodeAccess(node: StorageTextureNode | StorageBufferNode, shaderStage: string): string; + /** + * Returns A WGSL snippet representing the storage access. + * + * @param {StorageTextureNode|StorageBufferNode} node - The storage node. + * @param {string} shaderStage - The shader stage. + * @return {string} The WGSL snippet representing the storage access. + */ + getStorageAccess(node: StorageTextureNode | StorageBufferNode, shaderStage: string): string; + /** + * This method is one of the more important ones since it's responsible + * for generating a matching binding instance for the given uniform node. + * + * These bindings are later used in the renderer to create bind groups + * and layouts. + * + * @param {UniformNode} node - The uniform node. + * @param {string} type - The node data type. + * @param {string} shaderStage - The shader stage. + * @param {?string} [name=null] - An optional uniform name. + * @return {NodeUniform} The node uniform object. + */ + getUniformFromNode(node: UniformNode, type: string, shaderStage: string, name?: string | null): NodeUniform; + /** + * This method should be used whenever builtins are required in nodes. + * The internal builtins data structure will make sure builtins are + * defined in the WGSL source. + * + * @param {string} name - The builtin name. + * @param {string} property - The property name. + * @param {string} type - The node data type. + * @param {string} [shaderStage=this.shaderStage] - The shader stage this code snippet is generated for. + * @return {string} The property name. + */ + getBuiltin(name: string, property: string, type: string, shaderStage?: string): string; + /** + * Returns `true` if the given builtin is defined in the given shader stage. + * + * @param {string} name - The builtin name. + * @param {string} [shaderStage=this.shaderStage] - The shader stage this code snippet is generated for. + * @return {boolean} Whether the given builtin is defined in the given shader stage or not. + */ + hasBuiltin(name: string, shaderStage?: string): boolean; + /** + * Builds the given shader node. + * + * @param {ShaderNodeInternal} shaderNode - The shader node. + * @return {string} The WGSL function code. + */ + buildFunctionCode(shaderNode: ShaderNodeInternal): string; + /** + * Returns a builtin representing the index of a compute invocation within the scope of a workgroup load. + * + * @return {string} The invocation local index. + */ + getInvocationLocalIndex(): string; + /** + * Returns a builtin representing the size of a subgroup within the current shader. + * + * @return {string} The subgroup size. + */ + getSubgroupSize(): string; + /** + * Returns a builtin representing the index of a compute invocation within the scope of a subgroup. + * + * @return {string} The invocation subgroup index. + */ + getInvocationSubgroupIndex(): string; + /** + * Returns a builtin representing the index of a compute invocation's subgroup within its workgroup. + * + * @return {string} The subgroup index. + */ + getSubgroupIndex(): string; + /** + * Overwritten as a NOP since this method is intended for the WebGL 2 backend. + * + * @return {null} Null. + */ + getDrawIndex(): null; + /** + * Returns the frag depth builtin. + * + * @return {string} The frag depth builtin. + */ + getFragDepth(): string; + /** + * Returns the clip distances builtin. + * + * @return {string} The clip distances builtin. + */ + getClipDistance(): string; + /** + * Enables the given directive for the given shader stage. + * + * @param {string} name - The directive name. + * @param {string} [shaderStage=this.shaderStage] - The shader stage to enable the directive for. + */ + enableDirective(name: string, shaderStage?: string): void; + /** + * Returns the directives of the given shader stage as a WGSL string. + * + * @param {string} shaderStage - The shader stage. + * @return {string} A WGSL snippet that enables the directives of the given stage. + */ + getDirectives(shaderStage: string): string; + /** + * Enables the 'subgroups' directive. + */ + enableSubGroups(): void; + /** + * Enables the 'subgroups-f16' directive. + */ + enableSubgroupsF16(): void; + /** + * Enables the 'clip_distances' directive. + */ + enableClipDistances(): void; + /** + * Enables the 'f16' directive. + */ + enableShaderF16(): void; + /** + * Enables the 'dual_source_blending' directive. + */ + enableDualSourceBlending(): void; + /** + * Enables hardware clipping. + * + * @param {string} planeCount - The clipping plane count. + */ + enableHardwareClipping(planeCount: string): void; + /** + * Returns the builtins of the given shader stage as a WGSL string. + * + * @param {string} shaderStage - The shader stage. + * @return {string} A WGSL snippet that represents the builtins of the given stage. + */ + getBuiltins(shaderStage: string): string; + /** + * This method should be used when a new scoped buffer is used in context of + * compute shaders. It adds the array to the internal data structure which is + * later used to generate the respective WGSL. + * + * @param {string} name - The array name. + * @param {string} scope - The scope. + * @param {string} bufferType - The buffer type. + * @param {string} bufferCount - The buffer count. + * @return {string} The array name. + */ + getScopedArray(name: string, scope: string, bufferType: string, bufferCount: string): string; + /** + * Returns the scoped arrays of the given shader stage as a WGSL string. + * + * @param {string} shaderStage - The shader stage. + * @return {string|undefined} The WGSL snippet that defines the scoped arrays. + * Returns `undefined` when used in the vertex or fragment stage. + */ + getScopedArrays(shaderStage: string): string | undefined; + /** + * Returns the shader attributes of the given shader stage as a WGSL string. + * + * @param {string} shaderStage - The shader stage. + * @return {string} The WGSL snippet that defines the shader attributes. + */ + getAttributes(shaderStage: string): string; + /** + * Returns the members of the given struct type node as a WGSL string. + * + * @param {StructTypeNode} struct - The struct type node. + * @return {string} The WGSL snippet that defines the struct members. + */ + getStructMembers(struct: StructTypeNode): string; + /** + * Returns the structs of the given shader stage as a WGSL string. + * + * @param {string} shaderStage - The shader stage. + * @return {string} The WGSL snippet that defines the structs. + */ + getStructs(shaderStage: string): string; + /** + * Returns the variables of the given shader stage as a WGSL string. + * + * @param {string} shaderStage - The shader stage. + * @return {string} The WGSL snippet that defines the variables. + */ + getVars(shaderStage: string): string; + /** + * Returns the varyings of the given shader stage as a WGSL string. + * + * @param {string} shaderStage - The shader stage. + * @return {string} The WGSL snippet that defines the varyings. + */ + getVaryings(shaderStage: string): string; + isCustomStruct(nodeUniform: any): any; + /** + * Returns the uniforms of the given shader stage as a WGSL string. + * + * @param {string} shaderStage - The shader stage. + * @return {string} The WGSL snippet that defines the uniforms. + */ + getUniforms(shaderStage: string): string; + /** + * Returns the native shader method name for a given generic name. + * + * @param {string} method - The method name to resolve. + * @param {?string} [output=null] - An optional output. + * @return {string} The resolved WGSL method name. + */ + getMethod(method: string, output?: string | null): string; + /** + * Returns the bitcast method name for a given input and outputType. + * + * @param {string} type - The output type to bitcast to. + * @return {string} The resolved WGSL bitcast invocation. + */ + getBitcastMethod(type: string): string; + /** + * Returns the float packing method name for a given numeric encoding. + * + * @param {string} encoding - The numeric encoding that describes how the float values are mapped to the integer range. + * @returns {string} The resolve WGSL float packing method name. + */ + getFloatPackingMethod(encoding: string): string; + /** + * Returns the float unpacking method name for a given numeric encoding. + * + * @param {string} encoding - The numeric encoding that describes how the integer values are mapped to the float range. + * @returns {string} The resolve WGSL float unpacking method name. + */ + getFloatUnpackingMethod(encoding: string): string; + /** + * Returns the native snippet for a ternary operation. + * + * @param {string} condSnippet - The condition determining which expression gets resolved. + * @param {string} ifSnippet - The expression to resolve to if the condition is true. + * @param {string} elseSnippet - The expression to resolve to if the condition is false. + * @return {string} The resolved method name. + */ + getTernary(condSnippet: string, ifSnippet: string, elseSnippet: string): string; + /** + * Whether the requested feature is available or not. + * + * @param {string} name - The requested feature. + * @return {boolean} Whether the requested feature is supported or not. + */ + isAvailable(name: string): boolean; + /** + * Returns the native shader method name for a given generic name. + * + * @private + * @param {string} method - The method name to resolve. + * @return {string} The resolved WGSL method name. + */ + private _getWGSLMethod; + /** + * Includes the given method name into the current + * function node. + * + * @private + * @param {string} name - The method name to include. + * @return {CodeNode} The respective code node. + */ + private _include; + /** + * Returns a WGSL vertex shader based on the given shader data. + * + * @private + * @param {Object} shaderData - The shader data. + * @return {string} The vertex shader. + */ + private _getWGSLVertexCode; + /** + * Returns a WGSL fragment shader based on the given shader data. + * + * @private + * @param {Object} shaderData - The shader data. + * @return {string} The vertex shader. + */ + private _getWGSLFragmentCode; + /** + * Returns a WGSL compute shader based on the given shader data. + * + * @private + * @param {Object} shaderData - The shader data. + * @param {string} workgroupSize - The workgroup size. + * @return {string} The vertex shader. + */ + private _getWGSLComputeCode; + /** + * Returns a WGSL struct based on the given name and variables. + * + * @private + * @param {string} name - The struct name. + * @param {string} vars - The struct variables. + * @return {string} The WGSL snippet representing a struct. + */ + private _getWGSLStruct; + /** + * Returns a WGSL struct binding. + * + * @private + * @param {string} name - The struct name. + * @param {string} vars - The struct variables. + * @param {string} access - The access. + * @param {number} [binding=0] - The binding index. + * @param {number} [group=0] - The group index. + * @return {string} The WGSL snippet representing a struct binding. + */ + private _getWGSLStructBinding; +} +import { NodeBuilder } from '../../../nodes/Nodes.js'; +import NodeUniformsGroup from '../../common/nodes/NodeUniformsGroup.js'; diff --git a/jsdoc-testing/jsdoc/renderers/webgpu/nodes/WGSLNodeFunction.d.ts b/jsdoc-testing/jsdoc/renderers/webgpu/nodes/WGSLNodeFunction.d.ts new file mode 100644 index 000000000..3cbe9f2f5 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/webgpu/nodes/WGSLNodeFunction.d.ts @@ -0,0 +1,25 @@ +export default WGSLNodeFunction; +/** + * This class represents a WSL node function. + * + * @augments NodeFunction + */ +declare class WGSLNodeFunction extends NodeFunction { + /** + * Constructs a new WGSL node function. + * + * @param {string} source - The WGSL source. + */ + constructor(source: string); + inputsCode: any; + blockCode: any; + outputType: any; + /** + * This method returns the WGSL code of the node function. + * + * @param {string} [name=this.name] - The function's name. + * @return {string} The shader code. + */ + getCode(name?: string): string; +} +import NodeFunction from '../../../nodes/core/NodeFunction.js'; diff --git a/jsdoc-testing/jsdoc/renderers/webgpu/nodes/WGSLNodeParser.d.ts b/jsdoc-testing/jsdoc/renderers/webgpu/nodes/WGSLNodeParser.d.ts new file mode 100644 index 000000000..58ab25284 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/webgpu/nodes/WGSLNodeParser.d.ts @@ -0,0 +1,17 @@ +export default WGSLNodeParser; +/** + * A WGSL node parser. + * + * @augments NodeParser + */ +declare class WGSLNodeParser extends NodeParser { + /** + * The method parses the given WGSL code an returns a node function. + * + * @param {string} source - The WGSL code. + * @return {WGSLNodeFunction} A node function. + */ + parseFunction(source: string): WGSLNodeFunction; +} +import NodeParser from '../../../nodes/core/NodeParser.js'; +import WGSLNodeFunction from './WGSLNodeFunction.js'; diff --git a/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUAttributeUtils.d.ts b/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUAttributeUtils.d.ts new file mode 100644 index 000000000..0d27c5e0c --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUAttributeUtils.d.ts @@ -0,0 +1,73 @@ +export default WebGPUAttributeUtils; +/** + * A WebGPU backend utility module for managing shader attributes. + * + * @private + */ +declare class WebGPUAttributeUtils { + /** + * Constructs a new utility object. + * + * @param {WebGPUBackend} backend - The WebGPU backend. + */ + constructor(backend: WebGPUBackend); + /** + * A reference to the WebGPU backend. + * + * @type {WebGPUBackend} + */ + backend: WebGPUBackend; + /** + * Creates the GPU buffer for the given buffer attribute. + * + * @param {BufferAttribute} attribute - The buffer attribute. + * @param {GPUBufferUsage} usage - A flag that indicates how the buffer may be used after its creation. + */ + createAttribute(attribute: BufferAttribute, usage: GPUBufferUsage): void; + /** + * Updates the GPU buffer of the given buffer attribute. + * + * @param {BufferAttribute} attribute - The buffer attribute. + */ + updateAttribute(attribute: BufferAttribute): void; + /** + * This method creates the vertex buffer layout data which are + * require when creating a render pipeline for the given render object. + * + * @param {RenderObject} renderObject - The render object. + * @return {Array} An array holding objects which describe the vertex buffer layout. + */ + createShaderVertexBuffers(renderObject: RenderObject): Array; + /** + * Destroys the GPU buffer of the given buffer attribute. + * + * @param {BufferAttribute} attribute - The buffer attribute. + */ + destroyAttribute(attribute: BufferAttribute): void; + /** + * This method performs a readback operation by moving buffer data from + * a storage buffer attribute from the GPU to the CPU. + * + * @async + * @param {StorageBufferAttribute} attribute - The storage buffer attribute. + * @return {Promise} A promise that resolves with the buffer data when the data are ready. + */ + getArrayBufferAsync(attribute: StorageBufferAttribute): Promise; + /** + * Returns the vertex format of the given buffer attribute. + * + * @private + * @param {BufferAttribute} geometryAttribute - The buffer attribute. + * @return {string|undefined} The vertex format (e.g. 'float32x3'). + */ + private _getVertexFormat; + /** + * Utility method for handling interleaved buffer attributes correctly. + * To process them, their `InterleavedBuffer` is returned. + * + * @private + * @param {BufferAttribute} attribute - The attribute. + * @return {BufferAttribute|InterleavedBuffer} + */ + private _getBufferAttribute; +} diff --git a/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUBindingUtils.d.ts b/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUBindingUtils.d.ts new file mode 100644 index 000000000..9c5208097 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUBindingUtils.d.ts @@ -0,0 +1,88 @@ +export default WebGPUBindingUtils; +/** + * A WebGPU backend utility module for managing bindings. + * + * When reading the documentation it's helpful to keep in mind that + * all class definitions starting with 'GPU*' are modules from the + * WebGPU API. So for example `BindGroup` is a class from the engine + * whereas `GPUBindGroup` is a class from WebGPU. + * + * @private + */ +declare class WebGPUBindingUtils { + /** + * Constructs a new utility object. + * + * @param {WebGPUBackend} backend - The WebGPU backend. + */ + constructor(backend: WebGPUBackend); + /** + * A reference to the WebGPU backend. + * + * @type {WebGPUBackend} + */ + backend: WebGPUBackend; + /** + * A cache that maps combinations of layout entries to existing bind group layouts. + * + * @private + * @type {Map} + */ + private _bindGroupLayoutCache; + /** + * Creates a GPU bind group layout for the given bind group. + * + * @param {BindGroup} bindGroup - The bind group. + * @return {GPUBindGroupLayout} The GPU bind group layout. + */ + createBindingsLayout(bindGroup: BindGroup): GPUBindGroupLayout; + /** + * Creates bindings from the given bind group definition. + * + * @param {BindGroup} bindGroup - The bind group. + * @param {Array} bindings - Array of bind groups. + * @param {number} cacheIndex - The cache index. + * @param {number} version - The version. + */ + createBindings(bindGroup: BindGroup, bindings: Array, cacheIndex: number, version?: number): void; + /** + * Updates a buffer binding. + * + * @param {Buffer} binding - The buffer binding to update. + */ + updateBinding(binding: Buffer): void; + /** + * Creates a GPU bind group for the camera index. + * + * @param {Uint32Array} data - The index data. + * @param {GPUBindGroupLayout} layoutGPU - The GPU bind group layout. + * @return {GPUBindGroup} The GPU bind group. + */ + createBindGroupIndex(data: Uint32Array, layoutGPU: GPUBindGroupLayout): GPUBindGroup; + /** + * Creates a GPU bind group for the given bind group and GPU layout. + * + * @param {BindGroup} bindGroup - The bind group. + * @param {GPUBindGroupLayout} layoutGPU - The GPU bind group layout. + * @return {GPUBindGroup} The GPU bind group. + */ + createBindGroup(bindGroup: BindGroup, layoutGPU: GPUBindGroupLayout): GPUBindGroup; + /** + * Creates a GPU bind group layout entries for the given bind group. + * + * @private + * @param {BindGroup} bindGroup - The bind group. + * @return {Array} The GPU bind group layout entries. + */ + private _createLayoutEntries; + /** + * Delete the data associated with a bind group. + * + * @param {BindGroup} bindGroup - The bind group. + */ + deleteBindGroupData(bindGroup: BindGroup): void; + /** + * Frees internal resources. + */ + dispose(): void; +} diff --git a/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUCapabilities.d.ts b/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUCapabilities.d.ts new file mode 100644 index 000000000..c56d99d65 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUCapabilities.d.ts @@ -0,0 +1,32 @@ +export default WebGPUCapabilities; +/** + * A WebGPU backend utility module for managing the device's capabilities. + * + * @private + */ +declare class WebGPUCapabilities { + /** + * Constructs a new utility object. + * + * @param {WebGPUBackend} backend - The WebGPU backend. + */ + constructor(backend: WebGPUBackend); + /** + * A reference to the WebGPU backend. + * + * @type {WebGPUBackend} + */ + backend: WebGPUBackend; + /** + * Returns the maximum anisotropy texture filtering value. + * + * @return {number} The maximum anisotropy texture filtering value. + */ + getMaxAnisotropy(): number; + /** + * Returns the maximum number of bytes available for uniform buffers. + * + * @return {number} The maximum number of bytes available for uniform buffers. + */ + getUniformBufferLimit(): number; +} diff --git a/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUConstants.d.ts b/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUConstants.d.ts new file mode 100644 index 000000000..a610756f3 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUConstants.d.ts @@ -0,0 +1,295 @@ +export namespace GPUPrimitiveTopology { + let PointList: string; + let LineList: string; + let LineStrip: string; + let TriangleList: string; + let TriangleStrip: string; +} +export const GPUShaderStage: any; +export namespace GPUCompareFunction { + let Never: string; + let Less: string; + let Equal: string; + let LessEqual: string; + let Greater: string; + let NotEqual: string; + let GreaterEqual: string; + let Always: string; +} +export namespace GPUStoreOp { + let Store: string; + let Discard: string; +} +export namespace GPULoadOp { + let Load: string; + let Clear: string; +} +export namespace GPUFrontFace { + let CCW: string; + let CW: string; +} +export namespace GPUCullMode { + let None: string; + let Front: string; + let Back: string; +} +export namespace GPUIndexFormat { + let Uint16: string; + let Uint32: string; +} +export namespace GPUVertexFormat { + export let Uint8x2: string; + export let Uint8x4: string; + export let Sint8x2: string; + export let Sint8x4: string; + export let Unorm8x2: string; + export let Unorm8x4: string; + export let Snorm8x2: string; + export let Snorm8x4: string; + export let Uint16x2: string; + export let Uint16x4: string; + export let Sint16x2: string; + export let Sint16x4: string; + export let Unorm16x2: string; + export let Unorm16x4: string; + export let Snorm16x2: string; + export let Snorm16x4: string; + export let Float16x2: string; + export let Float16x4: string; + export let Float32: string; + export let Float32x2: string; + export let Float32x3: string; + export let Float32x4: string; + let Uint32_1: string; + export { Uint32_1 as Uint32 }; + export let Uint32x2: string; + export let Uint32x3: string; + export let Uint32x4: string; + export let Sint32: string; + export let Sint32x2: string; + export let Sint32x3: string; + export let Sint32x4: string; +} +export namespace GPUTextureFormat { + let R8Unorm: string; + let R8Snorm: string; + let R8Uint: string; + let R8Sint: string; + let R16Uint: string; + let R16Sint: string; + let R16Float: string; + let RG8Unorm: string; + let RG8Snorm: string; + let RG8Uint: string; + let RG8Sint: string; + let R32Uint: string; + let R32Sint: string; + let R32Float: string; + let RG16Uint: string; + let RG16Sint: string; + let RG16Float: string; + let RGBA8Unorm: string; + let RGBA8UnormSRGB: string; + let RGBA8Snorm: string; + let RGBA8Uint: string; + let RGBA8Sint: string; + let BGRA8Unorm: string; + let BGRA8UnormSRGB: string; + let RGB9E5UFloat: string; + let RGB10A2Unorm: string; + let RG11B10UFloat: string; + let RG32Uint: string; + let RG32Sint: string; + let RG32Float: string; + let RGBA16Uint: string; + let RGBA16Sint: string; + let RGBA16Float: string; + let RGBA32Uint: string; + let RGBA32Sint: string; + let RGBA32Float: string; + let Stencil8: string; + let Depth16Unorm: string; + let Depth24Plus: string; + let Depth24PlusStencil8: string; + let Depth32Float: string; + let Depth32FloatStencil8: string; + let BC1RGBAUnorm: string; + let BC1RGBAUnormSRGB: string; + let BC2RGBAUnorm: string; + let BC2RGBAUnormSRGB: string; + let BC3RGBAUnorm: string; + let BC3RGBAUnormSRGB: string; + let BC4RUnorm: string; + let BC4RSnorm: string; + let BC5RGUnorm: string; + let BC5RGSnorm: string; + let BC6HRGBUFloat: string; + let BC6HRGBFloat: string; + let BC7RGBAUnorm: string; + let BC7RGBAUnormSRGB: string; + let ETC2RGB8Unorm: string; + let ETC2RGB8UnormSRGB: string; + let ETC2RGB8A1Unorm: string; + let ETC2RGB8A1UnormSRGB: string; + let ETC2RGBA8Unorm: string; + let ETC2RGBA8UnormSRGB: string; + let EACR11Unorm: string; + let EACR11Snorm: string; + let EACRG11Unorm: string; + let EACRG11Snorm: string; + let ASTC4x4Unorm: string; + let ASTC4x4UnormSRGB: string; + let ASTC5x4Unorm: string; + let ASTC5x4UnormSRGB: string; + let ASTC5x5Unorm: string; + let ASTC5x5UnormSRGB: string; + let ASTC6x5Unorm: string; + let ASTC6x5UnormSRGB: string; + let ASTC6x6Unorm: string; + let ASTC6x6UnormSRGB: string; + let ASTC8x5Unorm: string; + let ASTC8x5UnormSRGB: string; + let ASTC8x6Unorm: string; + let ASTC8x6UnormSRGB: string; + let ASTC8x8Unorm: string; + let ASTC8x8UnormSRGB: string; + let ASTC10x5Unorm: string; + let ASTC10x5UnormSRGB: string; + let ASTC10x6Unorm: string; + let ASTC10x6UnormSRGB: string; + let ASTC10x8Unorm: string; + let ASTC10x8UnormSRGB: string; + let ASTC10x10Unorm: string; + let ASTC10x10UnormSRGB: string; + let ASTC12x10Unorm: string; + let ASTC12x10UnormSRGB: string; + let ASTC12x12Unorm: string; + let ASTC12x12UnormSRGB: string; +} +export namespace GPUAddressMode { + let ClampToEdge: string; + let Repeat: string; + let MirrorRepeat: string; +} +export namespace GPUFilterMode { + let Linear: string; + let Nearest: string; +} +export namespace GPUBlendFactor { + let Zero: string; + let One: string; + let Src: string; + let OneMinusSrc: string; + let SrcAlpha: string; + let OneMinusSrcAlpha: string; + let Dst: string; + let OneMinusDst: string; + let DstAlpha: string; + let OneMinusDstAlpha: string; + let SrcAlphaSaturated: string; + let Constant: string; + let OneMinusConstant: string; +} +export namespace GPUBlendOperation { + let Add: string; + let Subtract: string; + let ReverseSubtract: string; + let Min: string; + let Max: string; +} +export namespace GPUColorWriteFlags { + let None_1: number; + export { None_1 as None }; + export let Red: number; + export let Green: number; + export let Blue: number; + export let Alpha: number; + export let All: number; +} +export namespace GPUStencilOperation { + export let Keep: string; + let Zero_1: string; + export { Zero_1 as Zero }; + export let Replace: string; + export let Invert: string; + export let IncrementClamp: string; + export let DecrementClamp: string; + export let IncrementWrap: string; + export let DecrementWrap: string; +} +export namespace GPUBufferBindingType { + let Uniform: string; + let Storage: string; + let ReadOnlyStorage: string; +} +export namespace GPUStorageTextureAccess { + let WriteOnly: string; + let ReadOnly: string; + let ReadWrite: string; +} +export namespace GPUSamplerBindingType { + let Filtering: string; + let NonFiltering: string; + let Comparison: string; +} +export namespace GPUTextureSampleType { + let Float: string; + let UnfilterableFloat: string; + let Depth: string; + let SInt: string; + let UInt: string; +} +export namespace GPUTextureDimension { + let OneD: string; + let TwoD: string; + let ThreeD: string; +} +export namespace GPUTextureViewDimension { + let OneD_1: string; + export { OneD_1 as OneD }; + let TwoD_1: string; + export { TwoD_1 as TwoD }; + export let TwoDArray: string; + export let Cube: string; + export let CubeArray: string; + let ThreeD_1: string; + export { ThreeD_1 as ThreeD }; +} +export namespace GPUTextureAspect { + let All_1: string; + export { All_1 as All }; + export let StencilOnly: string; + export let DepthOnly: string; +} +export namespace GPUInputStepMode { + let Vertex: string; + let Instance: string; +} +export namespace GPUFeatureName { + export let CoreFeaturesAndLimits: string; + export let DepthClipControl: string; + let Depth32FloatStencil8_1: string; + export { Depth32FloatStencil8_1 as Depth32FloatStencil8 }; + export let TextureCompressionBC: string; + export let TextureCompressionBCSliced3D: string; + export let TextureCompressionETC2: string; + export let TextureCompressionASTC: string; + export let TextureCompressionASTCSliced3D: string; + export let TimestampQuery: string; + export let IndirectFirstInstance: string; + export let ShaderF16: string; + let RG11B10UFloat_1: string; + export { RG11B10UFloat_1 as RG11B10UFloat }; + export let BGRA8UNormStorage: string; + export let Float32Filterable: string; + export let Float32Blendable: string; + export let ClipDistances: string; + export let DualSourceBlending: string; + export let Subgroups: string; + export let TextureFormatsTier1: string; + export let TextureFormatsTier2: string; +} +export const GPUFeatureMap: { + 'texture-compression-s3tc': string; + 'texture-compression-etc1': string; +}; diff --git a/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUPipelineUtils.d.ts b/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUPipelineUtils.d.ts new file mode 100644 index 000000000..6db6ec9d1 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUPipelineUtils.d.ts @@ -0,0 +1,133 @@ +export default WebGPUPipelineUtils; +/** + * A WebGPU backend utility module for managing pipelines. + * + * @private + */ +declare class WebGPUPipelineUtils { + /** + * Constructs a new utility object. + * + * @param {WebGPUBackend} backend - The WebGPU backend. + */ + constructor(backend: WebGPUBackend); + /** + * A reference to the WebGPU backend. + * + * @type {WebGPUBackend} + */ + backend: WebGPUBackend; + /** + * A Weak Map that tracks the active pipeline for render or compute passes. + * + * @private + * @type {WeakMap<(GPURenderPassEncoder|GPUComputePassEncoder),(GPURenderPipeline|GPUComputePipeline)>} + */ + private _activePipelines; + /** + * Sets the given pipeline for the given pass. The method makes sure to only set the + * pipeline when necessary. + * + * @param {(GPURenderPassEncoder|GPUComputePassEncoder)} pass - The pass encoder. + * @param {(GPURenderPipeline|GPUComputePipeline)} pipeline - The pipeline. + */ + setPipeline(pass: (GPURenderPassEncoder | GPUComputePassEncoder), pipeline: (GPURenderPipeline | GPUComputePipeline)): void; + /** + * Returns the sample count derived from the given render context. + * + * @private + * @param {RenderContext} renderContext - The render context. + * @return {number} The sample count. + */ + private _getSampleCount; + /** + * Creates a render pipeline for the given render object. + * + * @param {RenderObject} renderObject - The render object. + * @param {Array} promises - An array of compilation promises which are used in `compileAsync()`. + */ + createRenderPipeline(renderObject: RenderObject, promises: Array>): void; + /** + * Creates GPU render bundle encoder for the given render context. + * + * @param {RenderContext} renderContext - The render context. + * @param {?string} [label='renderBundleEncoder'] - The label. + * @return {GPURenderBundleEncoder} The GPU render bundle encoder. + */ + createBundleEncoder(renderContext: RenderContext, label?: string | null): GPURenderBundleEncoder; + /** + * Creates a compute pipeline for the given compute node. + * + * @param {ComputePipeline} pipeline - The compute pipeline. + * @param {Array} bindings - The bindings. + */ + createComputePipeline(pipeline: ComputePipeline, bindings: Array): void; + /** + * Returns the blending state as a descriptor object required + * for the pipeline creation. + * + * @private + * @param {Material|BlendMode} object - The object containing blending information. + * @return {Object} The blending state. + */ + private _getBlending; + /** + * Returns the GPU blend factor which is required for the pipeline creation. + * + * @private + * @param {number} blend - The blend factor as a three.js constant. + * @return {string} The GPU blend factor. + */ + private _getBlendFactor; + /** + * Returns the GPU stencil compare function which is required for the pipeline creation. + * + * @private + * @param {Material} material - The material. + * @return {string} The GPU stencil compare function. + */ + private _getStencilCompare; + /** + * Returns the GPU stencil operation which is required for the pipeline creation. + * + * @private + * @param {number} op - A three.js constant defining the stencil operation. + * @return {string} The GPU stencil operation. + */ + private _getStencilOperation; + /** + * Returns the GPU blend operation which is required for the pipeline creation. + * + * @private + * @param {number} blendEquation - A three.js constant defining the blend equation. + * @return {string} The GPU blend operation. + */ + private _getBlendOperation; + /** + * Returns the primitive state as a descriptor object required + * for the pipeline creation. + * + * @private + * @param {Object3D} object - The 3D object. + * @param {BufferGeometry} geometry - The geometry. + * @param {Material} material - The material. + * @return {Object} The primitive state. + */ + private _getPrimitiveState; + /** + * Returns the GPU color write mask which is required for the pipeline creation. + * + * @private + * @param {Material} material - The material. + * @return {number} The GPU color write mask. + */ + private _getColorWriteMask; + /** + * Returns the GPU depth compare function which is required for the pipeline creation. + * + * @private + * @param {Material} material - The material. + * @return {string} The GPU depth compare function. + */ + private _getDepthCompare; +} diff --git a/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUTexturePassUtils.d.ts b/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUTexturePassUtils.d.ts new file mode 100644 index 000000000..5d39f8906 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUTexturePassUtils.d.ts @@ -0,0 +1,97 @@ +export default WebGPUTexturePassUtils; +/** + * A WebGPU backend utility module used by {@link WebGPUTextureUtils}. + * + * @private + */ +declare class WebGPUTexturePassUtils extends DataMap { + /** + * Constructs a new utility object. + * + * @param {GPUDevice} device - The WebGPU device. + */ + constructor(device: GPUDevice); + /** + * The WebGPU device. + * + * @type {GPUDevice} + */ + device: GPUDevice; + /** + * The mipmap GPU sampler. + * + * @type {GPUSampler} + */ + mipmapSampler: GPUSampler; + /** + * The flipY GPU sampler. + * + * @type {GPUSampler} + */ + flipYSampler: GPUSampler; + /** + * flip uniform buffer + * @type {GPUBuffer} + */ + flipUniformBuffer: GPUBuffer; + /** + * no flip uniform buffer + * @type {GPUBuffer} + */ + noFlipUniformBuffer: GPUBuffer; + /** + * A cache for GPU render pipelines used for copy/transfer passes. + * Every texture format and textureBindingViewDimension combo requires a unique pipeline. + * + * @type {Object} + */ + transferPipelines: { + [x: string]: GPURenderPipeline; + }; + /** + * The mipmap shader module. + * + * @type {GPUShaderModule} + */ + mipmapShaderModule: GPUShaderModule; + /** + * Returns a render pipeline for the internal copy render pass. The pass + * requires a unique render pipeline for each texture format. + * + * @param {string} format - The GPU texture format + * @param {string?} textureBindingViewDimension - The GPU texture binding view dimension + * @return {GPURenderPipeline} The GPU render pipeline. + */ + getTransferPipeline(format: string, textureBindingViewDimension: string | null): GPURenderPipeline; + /** + * Flip the contents of the given GPU texture along its vertical axis. + * + * @param {GPUTexture} textureGPU - The GPU texture object. + * @param {Object} textureGPUDescriptor - The texture descriptor. + * @param {number} [baseArrayLayer=0] - The index of the first array layer accessible to the texture view. + */ + flipY(textureGPU: GPUTexture, textureGPUDescriptor: Object, baseArrayLayer?: number): void; + /** + * Generates mipmaps for the given GPU texture. + * + * @param {GPUTexture} textureGPU - The GPU texture object. + * @param {?GPUCommandEncoder} [encoder=null] - An optional command encoder used to generate mipmaps. + */ + generateMipmaps(textureGPU: GPUTexture, encoder?: GPUCommandEncoder | null): void; + /** + * Since multiple copy render passes are required to generate mipmaps, the passes + * are managed as render bundles to improve performance. + * + * @param {GPUTexture} textureGPU - The GPU texture object. + * @return {Array} An array of render bundles. + */ + _mipmapCreateBundles(textureGPU: GPUTexture): Array; + /** + * Executes the render bundles. + * + * @param {GPUCommandEncoder} commandEncoder - The GPU command encoder. + * @param {Array} passes - An array of render bundles. + */ + _mipmapRunBundles(commandEncoder: GPUCommandEncoder, passes: Array): void; +} +import DataMap from '../../common/DataMap.js'; diff --git a/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUTextureUtils.d.ts b/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUTextureUtils.d.ts new file mode 100644 index 000000000..c7fd90459 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUTextureUtils.d.ts @@ -0,0 +1,278 @@ +/** + * Returns the GPU format for the given texture. + * + * @param {Texture} texture - The texture. + * @param {?GPUDevice} [device=null] - The GPU device which is used for feature detection. + * It is not necessary to apply the device for most formats. + * @return {string} The GPU format. + */ +export function getFormat(texture: Texture, device?: GPUDevice | null): string; +export default WebGPUTextureUtils; +import { Texture } from '../../../textures/Texture.js'; +/** + * A WebGPU backend utility module for managing textures. + * + * @private + */ +declare class WebGPUTextureUtils { + /** + * Constructs a new utility object. + * + * @param {WebGPUBackend} backend - The WebGPU backend. + */ + constructor(backend: WebGPUBackend); + /** + * A reference to the WebGPU backend. + * + * @type {WebGPUBackend} + */ + backend: WebGPUBackend; + /** + * A reference to the pass utils. + * + * @type {?WebGPUTexturePassUtils} + * @default null + */ + _passUtils: WebGPUTexturePassUtils | null; + /** + * A dictionary for managing default textures. The key + * is the texture format, the value the texture object. + * + * @type {Object} + */ + defaultTexture: { + [x: string]: Texture; + }; + /** + * A dictionary for managing default cube textures. The key + * is the texture format, the value the texture object. + * + * @type {Object} + */ + defaultCubeTexture: { + [x: string]: CubeTexture; + }; + /** + * A default video frame. + * + * @type {?VideoFrame} + * @default null + */ + defaultVideoFrame: VideoFrame | null; + /** + * A cache of shared texture samplers. + * + * @type {Map} + */ + _samplerCache: Map; + /** + * Creates a GPU sampler for the given texture. + * + * @param {Texture} texture - The texture to create the sampler for. + * @return {string} The current sampler key. + */ + updateSampler(texture: Texture): string; + /** + * Creates a default texture for the given texture that can be used + * as a placeholder until the actual texture is ready for usage. + * + * @param {Texture} texture - The texture to create a default texture for. + */ + createDefaultTexture(texture: Texture): void; + /** + * Defines a texture on the GPU for the given texture object. + * + * @param {Texture} texture - The texture. + * @param {Object} [options={}] - Optional configuration parameter. + */ + createTexture(texture: Texture, options?: Object): void; + /** + * Destroys the GPU data for the given texture object. + * + * @param {Texture} texture - The texture. + * @param {boolean} [isDefaultTexture=false] - Whether the texture uses a default GPU texture or not. + */ + destroyTexture(texture: Texture, isDefaultTexture?: boolean): void; + /** + * Generates mipmaps for the given texture. + * + * @param {Texture} texture - The texture. + * @param {?GPUCommandEncoder} [encoder=null] - An optional command encoder used to generate mipmaps. + */ + generateMipmaps(texture: Texture, encoder?: GPUCommandEncoder | null): void; + /** + * Returns the color buffer representing the color + * attachment of the default framebuffer. + * + * @return {GPUTexture} The color buffer. + */ + getColorBuffer(): GPUTexture; + /** + * Returns the depth buffer representing the depth + * attachment of the default framebuffer. + * + * @param {boolean} [depth=true] - Whether depth is enabled or not. + * @param {boolean} [stencil=false] - Whether stencil is enabled or not. + * @return {GPUTexture} The depth buffer. + */ + getDepthBuffer(depth?: boolean, stencil?: boolean): GPUTexture; + /** + * Uploads the updated texture data to the GPU. + * + * @param {Texture} texture - The texture. + * @param {Object} [options={}] - Optional configuration parameter. + */ + updateTexture(texture: Texture, options?: Object): void; + /** + * Returns texture data as a typed array. + * + * @async + * @param {Texture} texture - The texture to copy. + * @param {number} x - The x coordinate of the copy origin. + * @param {number} y - The y coordinate of the copy origin. + * @param {number} width - The width of the copy. + * @param {number} height - The height of the copy. + * @param {number} faceIndex - The face index. + * @return {Promise} A Promise that resolves with a typed array when the copy operation has finished. + */ + copyTextureToBuffer(texture: Texture, x: number, y: number, width: number, height: number, faceIndex: number): Promise; + /** + * Frees all internal resources. + */ + dispose(): void; + /** + * Returns the default GPU texture for the given format. + * + * @private + * @param {string} format - The GPU format. + * @return {GPUTexture} The GPU texture. + */ + private _getDefaultTextureGPU; + /** + * Returns the default GPU cube texture for the given format. + * + * @private + * @param {string} format - The GPU format. + * @return {GPUTexture} The GPU texture. + */ + private _getDefaultCubeTextureGPU; + /** + * Uploads cube texture image data to the GPU memory. + * + * @private + * @param {CubeTexture} texture - The cube texture. + * @param {GPUTexture} textureGPU - The GPU texture. + * @param {Object} textureDescriptorGPU - The GPU texture descriptor. + */ + private _copyCubeMapToTexture; + /** + * Uploads texture image data to the GPU memory. + * + * @private + * @param {HTMLImageElement|ImageBitmap|HTMLCanvasElement} image - The image data. + * @param {GPUTexture} textureGPU - The GPU texture. + * @param {Object} textureDescriptorGPU - The GPU texture descriptor. + * @param {number} originDepth - The origin depth. + * @param {boolean} flipY - Whether to flip texture data along their vertical axis or not. + * @param {boolean} premultiplyAlpha - Whether the texture should have its RGB channels premultiplied by the alpha channel or not. + * @param {number} [mipLevel=0] - The mip level where the data should be copied to. + */ + private _copyImageToTexture; + /** + * Returns the pass utils singleton. + * + * @private + * @return {WebGPUTexturePassUtils} The utils instance. + */ + private _getPassUtils; + /** + * Generates mipmaps for the given GPU texture. + * + * @private + * @param {GPUTexture} textureGPU - The GPU texture object. + * @param {?GPUCommandEncoder} [encoder=null] - An optional command encoder used to generate mipmaps. + */ + private _generateMipmaps; + /** + * Flip the contents of the given GPU texture along its vertical axis. + * + * @private + * @param {GPUTexture} textureGPU - The GPU texture object. + * @param {Object} textureDescriptorGPU - The texture descriptor. + * @param {number} [originDepth=0] - The origin depth. + */ + private _flipY; + /** + * Uploads texture buffer data to the GPU memory. + * + * @private + * @param {Object} image - An object defining the image buffer data. + * @param {GPUTexture} textureGPU - The GPU texture. + * @param {Object} textureDescriptorGPU - The GPU texture descriptor. + * @param {number} originDepth - The origin depth. + * @param {boolean} flipY - Whether to flip texture data along their vertical axis or not. + * @param {number} [depth=0] - The depth offset when copying array or 3D texture data. + * @param {number} [mipLevel=0] - The mip level where the data should be copied to. + */ + private _copyBufferToTexture; + /** + * Uploads compressed texture data to the GPU memory. + * + * @private + * @param {Array} mipmaps - An array with mipmap data. + * @param {GPUTexture} textureGPU - The GPU texture. + * @param {Object} textureDescriptorGPU - The GPU texture descriptor. + */ + private _copyCompressedBufferToTexture; + /** + * This method is only relevant for compressed texture formats. It returns a block + * data descriptor for the given GPU compressed texture format. + * + * @private + * @param {string} format - The GPU compressed texture format. + * @return {Object} The block data descriptor. + */ + private _getBlockData; + /** + * Converts the three.js uv wrapping constants to GPU address mode constants. + * + * @private + * @param {number} value - The three.js constant defining a uv wrapping mode. + * @return {string} The GPU address mode. + */ + private _convertAddressMode; + /** + * Converts the three.js filter constants to GPU filter constants. + * + * @private + * @param {number} value - The three.js constant defining a filter mode. + * @return {string} The GPU filter mode. + */ + private _convertFilterMode; + /** + * Returns the bytes-per-texel value for the given GPU texture format. + * + * @private + * @param {string} format - The GPU texture format. + * @return {number} The bytes-per-texel. + */ + private _getBytesPerTexel; + /** + * Returns the corresponding typed array type for the given GPU texture format. + * + * @private + * @param {string} format - The GPU texture format. + * @return {TypedArray.constructor} The typed array type. + */ + private _getTypedArrayType; + /** + * Returns the GPU dimensions for the given texture. + * + * @private + * @param {Texture} texture - The texture. + * @return {string} The GPU dimension. + */ + private _getDimension; +} +import WebGPUTexturePassUtils from './WebGPUTexturePassUtils.js'; +import { CubeTexture } from '../../../textures/CubeTexture.js'; diff --git a/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUTimestampQueryPool.d.ts b/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUTimestampQueryPool.d.ts new file mode 100644 index 000000000..cd337afe1 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUTimestampQueryPool.d.ts @@ -0,0 +1,53 @@ +export default WebGPUTimestampQueryPool; +/** + * Manages a pool of WebGPU timestamp queries for performance measurement. + * Extends the base TimestampQueryPool to provide WebGPU-specific implementation. + * + * @augments TimestampQueryPool + */ +declare class WebGPUTimestampQueryPool extends TimestampQueryPool { + /** + * Creates a new WebGPU timestamp query pool. + * + * @param {GPUDevice} device - The WebGPU device to create queries on. + * @param {string} type - The type identifier for this query pool. + * @param {number} [maxQueries=2048] - Maximum number of queries this pool can hold. + */ + constructor(device: GPUDevice, type: string, maxQueries?: number); + device: GPUDevice; + type: string; + querySet: any; + resolveBuffer: any; + resultBuffer: any; + /** + * Allocates a pair of queries for a given render context. + * + * @param {string} uid - A unique identifier for the render context. + * @returns {?number} The base offset for the allocated queries, or null if allocation failed. + */ + allocateQueriesForContext(uid: string): number | null; + /** + * Asynchronously resolves all pending queries and returns the total duration. + * If there's already a pending resolve operation, returns that promise instead. + * + * @async + * @returns {Promise} The total duration in milliseconds, or the last valid value if resolution fails. + */ + resolveQueriesAsync(): Promise; + /** + * Internal method to resolve queries and calculate total duration. + * + * @async + * @private + * @returns {Promise} The total duration in milliseconds. + */ + private _resolveQueries; + /** + * Dispose of the query pool. + * + * @async + * @returns {Promise} A Promise that resolves when the dispose has been executed. + */ + dispose(): Promise; +} +import TimestampQueryPool from '../../common/TimestampQueryPool.js'; diff --git a/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUUtils.d.ts b/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUUtils.d.ts new file mode 100644 index 000000000..8c301d0a7 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUUtils.d.ts @@ -0,0 +1,95 @@ +export default WebGPUUtils; +/** + * A WebGPU backend utility module with common helpers. + * + * @private + */ +declare class WebGPUUtils { + /** + * Constructs a new utility object. + * + * @param {WebGPUBackend} backend - The WebGPU backend. + */ + constructor(backend: WebGPUBackend); + /** + * A reference to the WebGPU backend. + * + * @type {WebGPUBackend} + */ + backend: WebGPUBackend; + /** + * Returns the depth/stencil GPU format for the given render context. + * + * @param {RenderContext} renderContext - The render context. + * @return {string} The depth/stencil GPU texture format. + */ + getCurrentDepthStencilFormat(renderContext: RenderContext): string; + /** + * Returns the GPU format for the given texture. + * + * @param {Texture} texture - The texture. + * @return {string} The GPU texture format. + */ + getTextureFormatGPU(texture: Texture): string; + /** + * Returns an object that defines the multi-sampling state of the given texture. + * + * @param {Texture} texture - The texture. + * @return {Object} The multi-sampling state. + */ + getTextureSampleData(texture: Texture): Object; + /** + * Returns the default color attachment's GPU format of the current render context. + * + * @param {RenderContext} renderContext - The render context. + * @return {string} The GPU texture format of the default color attachment. + */ + getCurrentColorFormat(renderContext: RenderContext): string; + /** + * Returns the GPU formats of all color attachments of the current render context. + * + * @param {RenderContext} renderContext - The render context. + * @return {Array} The GPU texture formats of all color attachments. + */ + getCurrentColorFormats(renderContext: RenderContext): Array; + /** + * Returns the output color space of the current render context. + * + * @param {RenderContext} renderContext - The render context. + * @return {string} The output color space. + */ + getCurrentColorSpace(renderContext: RenderContext): string; + /** + * Returns GPU primitive topology for the given object and material. + * + * @param {Object3D} object - The 3D object. + * @param {Material} material - The material. + * @return {string} The GPU primitive topology. + */ + getPrimitiveTopology(object: Object3D, material: Material): string; + /** + * Returns a modified sample count from the given sample count value. + * + * That is required since WebGPU only supports either 1 or 4. + * + * @param {number} sampleCount - The input sample count. + * @return {number} The (potentially updated) output sample count. + */ + getSampleCount(sampleCount: number): number; + /** + * Returns the sample count of the given render context. + * + * @param {RenderContext} renderContext - The render context. + * @return {number} The sample count. + */ + getSampleCountRenderContext(renderContext: RenderContext): number; + /** + * Returns the preferred canvas format. + * + * There is a separate method for this so it's possible to + * honor edge cases for specific devices. + * + * @return {string} The GPU texture format of the canvas. + */ + getPreferredCanvasFormat(): string; +} diff --git a/jsdoc-testing/jsdoc/renderers/webxr/WebXRController.d.ts b/jsdoc-testing/jsdoc/renderers/webxr/WebXRController.d.ts new file mode 100644 index 000000000..91dbb3340 --- /dev/null +++ b/jsdoc-testing/jsdoc/renderers/webxr/WebXRController.d.ts @@ -0,0 +1,96 @@ +/** + * Class for representing a XR controller with its + * different coordinate systems. + * + * @private + */ +export class WebXRController { + /** + * A group representing the target ray space + * of the XR controller. + * + * @private + * @type {?Group} + * @default null + */ + private _targetRay; + /** + * A group representing the grip space + * of the XR controller. + * + * @private + * @type {?Group} + * @default null + */ + private _grip; + /** + * A group representing the hand space + * of the XR controller. + * + * @private + * @type {?Group} + * @default null + */ + private _hand; + /** + * Returns a group representing the hand space of the XR controller. + * + * @return {Group} A group representing the hand space of the XR controller. + */ + getHandSpace(): Group; + /** + * Returns a group representing the target ray space of the XR controller. + * + * @return {Group} A group representing the target ray space of the XR controller. + */ + getTargetRaySpace(): Group; + /** + * Returns a group representing the grip space of the XR controller. + * + * @return {Group} A group representing the grip space of the XR controller. + */ + getGripSpace(): Group; + /** + * Dispatches the given event to the groups representing + * the different coordinate spaces of the XR controller. + * + * @param {Object} event - The event to dispatch. + * @return {WebXRController} A reference to this instance. + */ + dispatchEvent(event: Object): WebXRController; + /** + * Connects the controller with the given XR input source. + * + * @param {XRInputSource} inputSource - The input source. + * @return {WebXRController} A reference to this instance. + */ + connect(inputSource: XRInputSource): WebXRController; + /** + * Disconnects the controller from the given XR input source. + * + * @param {XRInputSource} inputSource - The input source. + * @return {WebXRController} A reference to this instance. + */ + disconnect(inputSource: XRInputSource): WebXRController; + /** + * Updates the controller with the given input source, XR frame and reference space. + * This updates the transformations of the groups that represent the different + * coordinate systems of the controller. + * + * @param {XRInputSource} inputSource - The input source. + * @param {XRFrame} frame - The XR frame. + * @param {XRReferenceSpace} referenceSpace - The reference space. + * @return {WebXRController} A reference to this instance. + */ + update(inputSource: XRInputSource, frame: XRFrame, referenceSpace: XRReferenceSpace): WebXRController; + /** + * Returns a group representing the hand joint for the given input joint. + * + * @private + * @param {Group} hand - The group representing the hand space. + * @param {XRJointSpace} inputjoint - The hand joint data. + * @return {Group} A group representing the hand joint for the given input joint. + */ + private _getHandJoint; +} +import { Group } from '../../objects/Group.js'; diff --git a/jsdoc-testing/jsdoc/scenes/Fog.d.ts b/jsdoc-testing/jsdoc/scenes/Fog.d.ts new file mode 100644 index 000000000..3c17089bd --- /dev/null +++ b/jsdoc-testing/jsdoc/scenes/Fog.d.ts @@ -0,0 +1,70 @@ +/** + * This class can be used to define a linear fog that grows linearly denser + * with the distance. + * + * ```js + * const scene = new THREE.Scene(); + * scene.fog = new THREE.Fog( 0xcccccc, 10, 15 ); + * ``` + */ +export class Fog { + /** + * Constructs a new fog. + * + * @param {number|Color} color - The fog's color. + * @param {number} [near=1] - The minimum distance to start applying fog. + * @param {number} [far=1000] - The maximum distance at which fog stops being calculated and applied. + */ + constructor(color: number | Color, near?: number, far?: number); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isFog: boolean; + /** + * The name of the fog. + * + * @type {string} + */ + name: string; + /** + * The fog's color. + * + * @type {Color} + */ + color: Color; + /** + * The minimum distance to start applying fog. Objects that are less than + * `near` units from the active camera won't be affected by fog. + * + * @type {number} + * @default 1 + */ + near: number; + /** + * The maximum distance at which fog stops being calculated and applied. + * Objects that are more than `far` units away from the active camera won't + * be affected by fog. + * + * @type {number} + * @default 1000 + */ + far: number; + /** + * Returns a new fog with copied values from this instance. + * + * @return {Fog} A clone of this instance. + */ + clone(): Fog; + /** + * Serializes the fog into JSON. + * + * @param {?(Object|string)} meta - An optional value holding meta information about the serialization. + * @return {Object} A JSON object representing the serialized fog + */ + toJSON(): Object; +} +import { Color } from '../math/Color.js'; diff --git a/jsdoc-testing/jsdoc/scenes/FogExp2.d.ts b/jsdoc-testing/jsdoc/scenes/FogExp2.d.ts new file mode 100644 index 000000000..e11462391 --- /dev/null +++ b/jsdoc-testing/jsdoc/scenes/FogExp2.d.ts @@ -0,0 +1,60 @@ +/** + * This class can be used to define an exponential squared fog, + * which gives a clear view near the camera and a faster than exponentially + * densening fog farther from the camera. + * + * ```js + * const scene = new THREE.Scene(); + * scene.fog = new THREE.FogExp2( 0xcccccc, 0.002 ); + * ``` + */ +export class FogExp2 { + /** + * Constructs a new fog. + * + * @param {number|Color} color - The fog's color. + * @param {number} [density=0.00025] - Defines how fast the fog will grow dense. + */ + constructor(color: number | Color, density?: number); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isFogExp2: boolean; + /** + * The name of the fog. + * + * @type {string} + */ + name: string; + /** + * The fog's color. + * + * @type {Color} + */ + color: Color; + /** + * Defines how fast the fog will grow dense. + * + * @type {number} + * @default 0.00025 + */ + density: number; + /** + * Returns a new fog with copied values from this instance. + * + * @return {FogExp2} A clone of this instance. + */ + clone(): FogExp2; + /** + * Serializes the fog into JSON. + * + * @param {?(Object|string)} meta - An optional value holding meta information about the serialization. + * @return {Object} A JSON object representing the serialized fog + */ + toJSON(): Object; +} +import { Color } from '../math/Color.js'; diff --git a/jsdoc-testing/jsdoc/scenes/Scene.d.ts b/jsdoc-testing/jsdoc/scenes/Scene.d.ts new file mode 100644 index 000000000..91ed09ab6 --- /dev/null +++ b/jsdoc-testing/jsdoc/scenes/Scene.d.ts @@ -0,0 +1,97 @@ +/** + * Scenes allow you to set up what is to be rendered and where by three.js. + * This is where you place 3D objects like meshes, lines or lights. + * + * @augments Object3D + */ +export class Scene extends Object3D { + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isScene: boolean; + type: string; + /** + * Defines the background of the scene. Valid inputs are: + * + * - A color for defining a uniform colored background. + * - A texture for defining a (flat) textured background. + * - Cube textures or equirectangular textures for defining a skybox. + * + * @type {?(Color|Texture)} + * @default null + */ + background: (Color | Texture) | null; + /** + * Sets the environment map for all physical materials in the scene. However, + * it's not possible to overwrite an existing texture assigned to the `envMap` + * material property. + * + * @type {?Texture} + * @default null + */ + environment: Texture | null; + /** + * A fog instance defining the type of fog that affects everything + * rendered in the scene. + * + * @type {?(Fog|FogExp2)} + * @default null + */ + fog: (Fog | FogExp2) | null; + /** + * Sets the blurriness of the background. Only influences environment maps + * assigned to {@link Scene#background}. Valid input is a float between `0` + * and `1`. + * + * @type {number} + * @default 0 + */ + backgroundBlurriness: number; + /** + * Attenuates the color of the background. Only applies to background textures. + * + * @type {number} + * @default 1 + */ + backgroundIntensity: number; + /** + * The rotation of the background in radians. Only influences environment maps + * assigned to {@link Scene#background}. + * + * @type {Euler} + * @default (0,0,0) + */ + backgroundRotation: Euler; + /** + * Attenuates the color of the environment. Only influences environment maps + * assigned to {@link Scene#environment}. + * + * @type {number} + * @default 1 + */ + environmentIntensity: number; + /** + * The rotation of the environment map in radians. Only influences physical materials + * in the scene when {@link Scene#environment} is used. + * + * @type {Euler} + * @default (0,0,0) + */ + environmentRotation: Euler; + /** + * Forces everything in the scene to be rendered with the defined material. It is possible + * to exclude materials from override by setting {@link Material#allowOverride} to `false`. + * + * @type {?Material} + * @default null + */ + overrideMaterial: Material | null; + copy(source: any, recursive: any): this; + toJSON(meta: any): Object; +} +import { Object3D } from '../core/Object3D.js'; +import { Euler } from '../math/Euler.js'; diff --git a/jsdoc-testing/jsdoc/textures/CubeDepthTexture.d.ts b/jsdoc-testing/jsdoc/textures/CubeDepthTexture.d.ts new file mode 100644 index 000000000..c436fb9e7 --- /dev/null +++ b/jsdoc-testing/jsdoc/textures/CubeDepthTexture.d.ts @@ -0,0 +1,51 @@ +/** + * This class can be used to automatically save the depth information of a + * cube rendering into a cube texture with depth format. Used for PointLight shadows. + * + * @augments DepthTexture + */ +export class CubeDepthTexture extends DepthTexture { + /** + * Constructs a new cube depth texture. + * + * @param {number} size - The size (width and height) of each cube face. + * @param {number} [type=UnsignedIntType] - The texture type. + * @param {number} [mapping=CubeReflectionMapping] - The texture mapping. + * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value. + * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value. + * @param {number} [magFilter=NearestFilter] - The mag filter value. + * @param {number} [minFilter=NearestFilter] - The min filter value. + * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value. + * @param {number} [format=DepthFormat] - The texture format. + */ + constructor(size: number, type?: number, mapping?: number, wrapS?: number, wrapT?: number, magFilter?: number, minFilter?: number, anisotropy?: number, format?: number); + image: { + width: number; + height: number; + depth: number; + }[]; + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isCubeDepthTexture: boolean; + /** + * Set to true for cube texture handling in WebGLTextures. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isCubeTexture: boolean; + set images(value: Array HTMLImageElement>); + /** + * Alias for {@link CubeDepthTexture#image}. + * + * @type {Array} + */ + get images(): Array HTMLImageElement>; +} +import { DepthTexture } from './DepthTexture.js'; diff --git a/jsdoc-testing/jsdoc/textures/CubeTexture.d.ts b/jsdoc-testing/jsdoc/textures/CubeTexture.d.ts new file mode 100644 index 000000000..76c1ce43d --- /dev/null +++ b/jsdoc-testing/jsdoc/textures/CubeTexture.d.ts @@ -0,0 +1,49 @@ +/** + * Creates a cube texture made up of six images. + * + * ```js + * const loader = new THREE.CubeTextureLoader(); + * loader.setPath( 'textures/cube/pisa/' ); + * + * const textureCube = loader.load( [ + * 'px.png', 'nx.png', 'py.png', 'ny.png', 'pz.png', 'nz.png' + * ] ); + * + * const material = new THREE.MeshBasicMaterial( { color: 0xffffff, envMap: textureCube } ); + * ``` + * + * @augments Texture + */ +export class CubeTexture extends Texture { + /** + * Constructs a new cube texture. + * + * @param {Array} [images=[]] - An array holding a image for each side of a cube. + * @param {number} [mapping=CubeReflectionMapping] - The texture mapping. + * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value. + * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value. + * @param {number} [magFilter=LinearFilter] - The mag filter value. + * @param {number} [minFilter=LinearMipmapLinearFilter] - The min filter value. + * @param {number} [format=RGBAFormat] - The texture format. + * @param {number} [type=UnsignedByteType] - The texture type. + * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value. + * @param {string} [colorSpace=NoColorSpace] - The color space value. + */ + constructor(images?: Array HTMLImageElement>, mapping?: number, wrapS?: number, wrapT?: number, magFilter?: number, minFilter?: number, format?: number, type?: number, anisotropy?: number, colorSpace?: string); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isCubeTexture: boolean; + set images(value: Array HTMLImageElement>); + /** + * Alias for {@link CubeTexture#image}. + * + * @type {Array} + */ + get images(): Array HTMLImageElement>; +} +import { Texture } from './Texture.js'; diff --git a/jsdoc-testing/jsdoc/textures/DataArrayTexture.d.ts b/jsdoc-testing/jsdoc/textures/DataArrayTexture.d.ts new file mode 100644 index 000000000..7b9225b8e --- /dev/null +++ b/jsdoc-testing/jsdoc/textures/DataArrayTexture.d.ts @@ -0,0 +1,53 @@ +/** + * Creates an array of textures directly from raw buffer data. + * + * @augments Texture + */ +export class DataArrayTexture extends Texture { + /** + * Constructs a new data array texture. + * + * @param {?TypedArray} [data=null] - The buffer data. + * @param {number} [width=1] - The width of the texture. + * @param {number} [height=1] - The height of the texture. + * @param {number} [depth=1] - The depth of the texture. + */ + constructor(data?: TypedArray | null, width?: number, height?: number, depth?: number); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isDataArrayTexture: boolean; + /** + * This defines how the texture is wrapped in the depth and corresponds to + * *W* in UVW mapping. + * + * @type {(RepeatWrapping|ClampToEdgeWrapping|MirroredRepeatWrapping)} + * @default ClampToEdgeWrapping + */ + wrapR: (RepeatWrapping | number | MirroredRepeatWrapping); + /** + * A set of all layers which need to be updated in the texture. + * + * @type {Set} + */ + layerUpdates: Set; + /** + * Describes that a specific layer of the texture needs to be updated. + * Normally when {@link Texture#needsUpdate} is set to `true`, the + * entire data texture array is sent to the GPU. Marking specific + * layers will only transmit subsets of all mipmaps associated with a + * specific depth in the array which is often much more performant. + * + * @param {number} layerIndex - The layer index that should be updated. + */ + addLayerUpdate(layerIndex: number): void; + /** + * Resets the layer updates registry. + */ + clearLayerUpdates(): void; +} +import { Texture } from './Texture.js'; diff --git a/jsdoc-testing/jsdoc/textures/DataTexture.d.ts b/jsdoc-testing/jsdoc/textures/DataTexture.d.ts new file mode 100644 index 000000000..8bec07e5d --- /dev/null +++ b/jsdoc-testing/jsdoc/textures/DataTexture.d.ts @@ -0,0 +1,38 @@ +/** + * Creates a texture directly from raw buffer data. + * + * The interpretation of the data depends on type and format: If the type is + * `UnsignedByteType`, a `Uint8Array` will be useful for addressing the + * texel data. If the format is `RGBAFormat`, data needs four values for + * one texel; Red, Green, Blue and Alpha (typically the opacity). + * + * @augments Texture + */ +export class DataTexture extends Texture { + /** + * Constructs a new data texture. + * + * @param {?TypedArray} [data=null] - The buffer data. + * @param {number} [width=1] - The width of the texture. + * @param {number} [height=1] - The height of the texture. + * @param {number} [format=RGBAFormat] - The texture format. + * @param {number} [type=UnsignedByteType] - The texture type. + * @param {number} [mapping=Texture.DEFAULT_MAPPING] - The texture mapping. + * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value. + * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value. + * @param {number} [magFilter=NearestFilter] - The mag filter value. + * @param {number} [minFilter=NearestFilter] - The min filter value. + * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value. + * @param {string} [colorSpace=NoColorSpace] - The color space. + */ + constructor(data?: TypedArray | null, width?: number, height?: number, format?: number, type?: number, mapping?: number, wrapS?: number, wrapT?: number, magFilter?: number, minFilter?: number, anisotropy?: number, colorSpace?: string); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isDataTexture: boolean; +} +import { Texture } from './Texture.js'; diff --git a/jsdoc-testing/jsdoc/textures/DepthTexture.d.ts b/jsdoc-testing/jsdoc/textures/DepthTexture.d.ts new file mode 100644 index 000000000..7d3a969ed --- /dev/null +++ b/jsdoc-testing/jsdoc/textures/DepthTexture.d.ts @@ -0,0 +1,42 @@ +/** + * This class can be used to automatically save the depth information of a + * rendering into a texture. + * + * @augments Texture + */ +export class DepthTexture extends Texture { + /** + * Constructs a new depth texture. + * + * @param {number} width - The width of the texture. + * @param {number} height - The height of the texture. + * @param {number} [type=UnsignedIntType] - The texture type. + * @param {number} [mapping=Texture.DEFAULT_MAPPING] - The texture mapping. + * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value. + * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value. + * @param {number} [magFilter=LinearFilter] - The mag filter value. + * @param {number} [minFilter=LinearFilter] - The min filter value. + * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value. + * @param {number} [format=DepthFormat] - The texture format. + * @param {number} [depth=1] - The depth of the texture. + */ + constructor(width: number, height: number, type?: number, mapping?: number, wrapS?: number, wrapT?: number, magFilter?: number, minFilter?: number, anisotropy?: number, format?: number, depth?: number); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isDepthTexture: boolean; + /** + * Code corresponding to the depth compare function. + * + * @type {?(NeverCompare|LessCompare|EqualCompare|LessEqualCompare|GreaterCompare|NotEqualCompare|GreaterEqualCompare|AlwaysCompare)} + * @default null + */ + compareFunction: (NeverCompare | LessCompare | EqualCompare | LessEqualCompare | GreaterCompare | NotEqualCompare | GreaterEqualCompare | AlwaysCompare) | null; + copy(source: any): this; + toJSON(meta: any): Object; +} +import { Texture } from './Texture.js'; diff --git a/jsdoc-testing/jsdoc/textures/FramebufferTexture.d.ts b/jsdoc-testing/jsdoc/textures/FramebufferTexture.d.ts new file mode 100644 index 000000000..0de9064c8 --- /dev/null +++ b/jsdoc-testing/jsdoc/textures/FramebufferTexture.d.ts @@ -0,0 +1,42 @@ +/** + * This class can only be used in combination with `copyFramebufferToTexture()` methods + * of renderers. It extracts the contents of the current bound framebuffer and provides it + * as a texture for further usage. + * + * ```js + * const pixelRatio = window.devicePixelRatio; + * const textureSize = 128 * pixelRatio; + * + * const frameTexture = new FramebufferTexture( textureSize, textureSize ); + * + * // calculate start position for copying part of the frame data + * const vector = new Vector2(); + * vector.x = ( window.innerWidth * pixelRatio / 2 ) - ( textureSize / 2 ); + * vector.y = ( window.innerHeight * pixelRatio / 2 ) - ( textureSize / 2 ); + * + * renderer.render( scene, camera ); + * + * // copy part of the rendered frame into the framebuffer texture + * renderer.copyFramebufferToTexture( frameTexture, vector ); + * ``` + * + * @augments Texture + */ +export class FramebufferTexture extends Texture { + /** + * Constructs a new framebuffer texture. + * + * @param {number} [width] - The width of the texture. + * @param {number} [height] - The height of the texture. + */ + constructor(width?: number, height?: number); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isFramebufferTexture: boolean; +} +import { Texture } from './Texture.js'; diff --git a/jsdoc-testing/jsdoc/textures/Source.d.ts b/jsdoc-testing/jsdoc/textures/Source.d.ts new file mode 100644 index 000000000..d4fbed15c --- /dev/null +++ b/jsdoc-testing/jsdoc/textures/Source.d.ts @@ -0,0 +1,78 @@ +/** + * Represents the data source of a texture. + * + * The main purpose of this class is to decouple the data definition from the texture + * definition so the same data can be used with multiple texture instances. + */ +export class Source { + /** + * Constructs a new video texture. + * + * @param {any} [data=null] - The data definition of a texture. + */ + constructor(data?: any); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isSource: boolean; + /** + * The UUID of the source. + * + * @type {string} + * @readonly + */ + readonly uuid: string; + /** + * The data definition of a texture. + * + * @type {any} + */ + data: any; + /** + * This property is only relevant when {@link Source#needsUpdate} is set to `true` and + * provides more control on how texture data should be processed. When `dataReady` is set + * to `false`, the engine performs the memory allocation (if necessary) but does not transfer + * the data into the GPU memory. + * + * @type {boolean} + * @default true + */ + dataReady: boolean; + /** + * This starts at `0` and counts how many times {@link Source#needsUpdate} is set to `true`. + * + * @type {number} + * @readonly + * @default 0 + */ + readonly version: number; + /** + * Returns the dimensions of the source into the given target vector. + * + * @param {(Vector2|Vector3)} target - The target object the result is written into. + * @return {(Vector2|Vector3)} The dimensions of the source. + */ + getSize(target: (Vector2 | Vector3)): (Vector2 | Vector3); + /** + * When the property is set to `true`, the engine allocates the memory + * for the texture (if necessary) and triggers the actual texture upload + * to the GPU next time the source is used. + * + * @type {boolean} + * @default false + * @param {boolean} value + */ + set needsUpdate(value: boolean); + /** + * Serializes the source into JSON. + * + * @param {?(Object|string)} meta - An optional value holding meta information about the serialization. + * @return {Object} A JSON object representing the serialized source. + * @see {@link ObjectLoader#parse} + */ + toJSON(meta: (Object | string) | null): Object; +} diff --git a/jsdoc-testing/jsdoc/textures/Texture.d.ts b/jsdoc-testing/jsdoc/textures/Texture.d.ts new file mode 100644 index 000000000..49013a925 --- /dev/null +++ b/jsdoc-testing/jsdoc/textures/Texture.d.ts @@ -0,0 +1,405 @@ +/** + * Base class for all textures. + * + * Note: After the initial use of a texture, its dimensions, format, and type + * cannot be changed. Instead, call {@link Texture#dispose} on the texture and instantiate a new one. + * + * @augments EventDispatcher + */ +export class Texture extends EventDispatcher { + /** + * Constructs a new texture. + * + * @param {?Object} [image=Texture.DEFAULT_IMAGE] - The image holding the texture data. + * @param {number} [mapping=Texture.DEFAULT_MAPPING] - The texture mapping. + * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value. + * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value. + * @param {number} [magFilter=LinearFilter] - The mag filter value. + * @param {number} [minFilter=LinearMipmapLinearFilter] - The min filter value. + * @param {number} [format=RGBAFormat] - The texture format. + * @param {number} [type=UnsignedByteType] - The texture type. + * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value. + * @param {string} [colorSpace=NoColorSpace] - The color space. + */ + constructor(image?: Object | null, mapping?: number, wrapS?: number, wrapT?: number, magFilter?: number, minFilter?: number, format?: number, type?: number, anisotropy?: number, colorSpace?: string); + /** + * This flag can be used for type testing. + * + * @type {boolean} + * @readonly + * @default true + */ + readonly isTexture: boolean; + /** + * The UUID of the texture. + * + * @type {string} + * @readonly + */ + readonly uuid: string; + /** + * The name of the texture. + * + * @type {string} + */ + name: string; + /** + * The data definition of a texture. A reference to the data source can be + * shared across textures. This is often useful in context of spritesheets + * where multiple textures render the same data but with different texture + * transformations. + * + * @type {Source} + */ + source: Source; + /** + * An array holding user-defined mipmaps. + * + * @type {Array} + */ + mipmaps: Array; + /** + * How the texture is applied to the object. The value `UVMapping` + * is the default, where texture or uv coordinates are used to apply the map. + * + * @type {(UVMapping|CubeReflectionMapping|CubeRefractionMapping|EquirectangularReflectionMapping|EquirectangularRefractionMapping|CubeUVReflectionMapping)} + * @default UVMapping + */ + mapping: (number | CubeReflectionMapping | CubeRefractionMapping | EquirectangularReflectionMapping | EquirectangularRefractionMapping | CubeUVReflectionMapping); + /** + * Lets you select the uv attribute to map the texture to. `0` for `uv`, + * `1` for `uv1`, `2` for `uv2` and `3` for `uv3`. + * + * @type {number} + * @default 0 + */ + channel: number; + /** + * This defines how the texture is wrapped horizontally and corresponds to + * *U* in UV mapping. + * + * @type {(RepeatWrapping|ClampToEdgeWrapping|MirroredRepeatWrapping)} + * @default ClampToEdgeWrapping + */ + wrapS: (number | number | number); + /** + * This defines how the texture is wrapped horizontally and corresponds to + * *V* in UV mapping. + * + * @type {(RepeatWrapping|ClampToEdgeWrapping|MirroredRepeatWrapping)} + * @default ClampToEdgeWrapping + */ + wrapT: (number | number | number); + /** + * How the texture is sampled when a texel covers more than one pixel. + * + * @type {(NearestFilter|NearestMipmapNearestFilter|NearestMipmapLinearFilter|LinearFilter|LinearMipmapNearestFilter|LinearMipmapLinearFilter)} + * @default LinearFilter + */ + magFilter: (NearestFilter | NearestMipmapNearestFilter | NearestMipmapLinearFilter | number | LinearMipmapNearestFilter | number); + /** + * How the texture is sampled when a texel covers less than one pixel. + * + * @type {(NearestFilter|NearestMipmapNearestFilter|NearestMipmapLinearFilter|LinearFilter|LinearMipmapNearestFilter|LinearMipmapLinearFilter)} + * @default LinearMipmapLinearFilter + */ + minFilter: (NearestFilter | NearestMipmapNearestFilter | NearestMipmapLinearFilter | number | LinearMipmapNearestFilter | number); + /** + * The number of samples taken along the axis through the pixel that has the + * highest density of texels. By default, this value is `1`. A higher value + * gives a less blurry result than a basic mipmap, at the cost of more + * texture samples being used. + * + * @type {number} + * @default Texture.DEFAULT_ANISOTROPY + */ + anisotropy: number; + /** + * The format of the texture. + * + * @type {number} + * @default RGBAFormat + */ + format: number; + /** + * The default internal format is derived from {@link Texture#format} and {@link Texture#type} and + * defines how the texture data is going to be stored on the GPU. + * + * This property allows to overwrite the default format. + * + * @type {?string} + * @default null + */ + internalFormat: string | null; + /** + * The data type of the texture. + * + * @type {number} + * @default UnsignedByteType + */ + type: number; + /** + * How much a single repetition of the texture is offset from the beginning, + * in each direction U and V. Typical range is `0.0` to `1.0`. + * + * @type {Vector2} + * @default (0,0) + */ + offset: Vector2; + /** + * How many times the texture is repeated across the surface, in each + * direction U and V. If repeat is set greater than `1` in either direction, + * the corresponding wrap parameter should also be set to `RepeatWrapping` + * or `MirroredRepeatWrapping` to achieve the desired tiling effect. + * + * @type {Vector2} + * @default (1,1) + */ + repeat: Vector2; + /** + * The point around which rotation occurs. A value of `(0.5, 0.5)` corresponds + * to the center of the texture. Default is `(0, 0)`, the lower left. + * + * @type {Vector2} + * @default (0,0) + */ + center: Vector2; + /** + * How much the texture is rotated around the center point, in radians. + * Positive values are counter-clockwise. + * + * @type {number} + * @default 0 + */ + rotation: number; + /** + * Whether to update the texture's uv-transformation {@link Texture#matrix} + * from the properties {@link Texture#offset}, {@link Texture#repeat}, + * {@link Texture#rotation}, and {@link Texture#center}. + * + * Set this to `false` if you are specifying the uv-transform matrix directly. + * + * @type {boolean} + * @default true + */ + matrixAutoUpdate: boolean; + /** + * The uv-transformation matrix of the texture. + * + * @type {Matrix3} + */ + matrix: Matrix3; + /** + * Whether to generate mipmaps (if possible) for a texture. + * + * Set this to `false` if you are creating mipmaps manually. + * + * @type {boolean} + * @default true + */ + generateMipmaps: boolean; + /** + * If set to `true`, the alpha channel, if present, is multiplied into the + * color channels when the texture is uploaded to the GPU. + * + * Note that this property has no effect when using `ImageBitmap`. You need to + * configure premultiply alpha on bitmap creation instead. + * + * @type {boolean} + * @default false + */ + premultiplyAlpha: boolean; + /** + * If set to `true`, the texture is flipped along the vertical axis when + * uploaded to the GPU. + * + * Note that this property has no effect when using `ImageBitmap`. You need to + * configure the flip on bitmap creation instead. + * + * @type {boolean} + * @default true + */ + flipY: boolean; + /** + * Specifies the alignment requirements for the start of each pixel row in memory. + * The allowable values are `1` (byte-alignment), `2` (rows aligned to even-numbered bytes), + * `4` (word-alignment), and `8` (rows start on double-word boundaries). + * + * @type {number} + * @default 4 + */ + unpackAlignment: number; + /** + * Textures containing color data should be annotated with `SRGBColorSpace` or `LinearSRGBColorSpace`. + * + * @type {string} + * @default NoColorSpace + */ + colorSpace: string; + /** + * An object that can be used to store custom data about the texture. It + * should not hold references to functions as these will not be cloned. + * + * @type {Object} + */ + userData: Object; + /** + * This can be used to only update a subregion or specific rows of the texture (for example, just the + * first 3 rows). Use the `addUpdateRange()` function to add ranges to this array. + * + * @type {Array} + */ + updateRanges: Array; + /** + * This starts at `0` and counts how many times {@link Texture#needsUpdate} is set to `true`. + * + * @type {number} + * @readonly + * @default 0 + */ + readonly version: number; + /** + * A callback function, called when the texture is updated (e.g., when + * {@link Texture#needsUpdate} has been set to true and then the texture is used). + * + * @type {?Function} + * @default null + */ + onUpdate: Function | null; + /** + * An optional back reference to the textures render target. + * + * @type {?(RenderTarget|WebGLRenderTarget)} + * @default null + */ + renderTarget: (RenderTarget | WebGLRenderTarget) | null; + /** + * Indicates whether a texture belongs to a render target or not. + * + * @type {boolean} + * @readonly + * @default false + */ + readonly isRenderTargetTexture: boolean; + /** + * Indicates if a texture should be handled like a texture array. + * + * @type {boolean} + * @readonly + * @default false + */ + readonly isArrayTexture: boolean; + /** + * Indicates whether this texture should be processed by `PMREMGenerator` or not + * (only relevant for render target textures). + * + * @type {number} + * @readonly + * @default 0 + */ + readonly pmremVersion: number; + /** + * The width of the texture in pixels. + */ + get width(): any; + /** + * The height of the texture in pixels. + */ + get height(): any; + /** + * The depth of the texture in pixels. + */ + get depth(): any; + set image(value: Object | null); + /** + * The image object holding the texture data. + * + * @type {?Object} + */ + get image(): Object | null; + /** + * Updates the texture transformation matrix from the properties {@link Texture#offset}, + * {@link Texture#repeat}, {@link Texture#rotation}, and {@link Texture#center}. + */ + updateMatrix(): void; + /** + * Adds a range of data in the data texture to be updated on the GPU. + * + * @param {number} start - Position at which to start update. + * @param {number} count - The number of components to update. + */ + addUpdateRange(start: number, count: number): void; + /** + * Clears the update ranges. + */ + clearUpdateRanges(): void; + /** + * Returns a new texture with copied values from this instance. + * + * @return {Texture} A clone of this instance. + */ + clone(): Texture; + /** + * Copies the values of the given texture to this instance. + * + * @param {Texture} source - The texture to copy. + * @return {Texture} A reference to this instance. + */ + copy(source: Texture): Texture; + /** + * Setting this property to `true` indicates the engine the texture + * must be updated in the next render. This triggers a texture upload + * to the GPU and ensures correct texture parameter configuration. + * + * @type {boolean} + * @default false + * @param {boolean} value + */ + set needsUpdate(value: boolean); + /** + * Sets this texture's properties based on `values`. + * @param {Object} values - A container with texture parameters. + */ + setValues(values: Object): void; + /** + * Serializes the texture into JSON. + * + * @param {?(Object|string)} meta - An optional value holding meta information about the serialization. + * @return {Object} A JSON object representing the serialized texture. + * @see {@link ObjectLoader#parse} + */ + toJSON(meta: (Object | string) | null): Object; + /** + * Frees the GPU-related resources allocated by this instance. Call this + * method whenever this instance is no longer used in your app. + * + * @fires Texture#dispose + */ + dispose(): void; + /** + * Transforms the given uv vector with the textures uv transformation matrix. + * + * @param {Vector2} uv - The uv vector. + * @return {Vector2} The transformed uv vector. + */ + transformUv(uv: Vector2): Vector2; + /** + * Setting this property to `true` indicates the engine the PMREM + * must be regenerated. + * + * @type {boolean} + * @default false + * @param {boolean} value + */ + set needsPMREMUpdate(value: boolean); +} +export namespace Texture { + export let DEFAULT_IMAGE: (new (width?: number, height?: number) => HTMLImageElement) | null; + export { UVMapping as DEFAULT_MAPPING }; + export let DEFAULT_ANISOTROPY: number; +} +import { EventDispatcher } from '../core/EventDispatcher.js'; +import { Source } from './Source.js'; +import { Vector2 } from '../math/Vector2.js'; +import { Matrix3 } from '../math/Matrix3.js'; +import { UVMapping } from '../constants.js'; diff --git a/jsdoc-testing/jsdoc/utils.d.ts b/jsdoc-testing/jsdoc/utils.d.ts new file mode 100644 index 000000000..21c16ba39 --- /dev/null +++ b/jsdoc-testing/jsdoc/utils.d.ts @@ -0,0 +1,185 @@ +/** + * Finds the minimum value in an array. + * + * @private + * @param {Array} array - The array to search for the minimum value. + * @return {number} The minimum value in the array, or Infinity if the array is empty. + */ +export function arrayMin(array: Array): number; +/** + * Finds the maximum value in an array. + * + * @private + * @param {Array} array - The array to search for the maximum value. + * @return {number} The maximum value in the array, or -Infinity if the array is empty. + */ +export function arrayMax(array: Array): number; +/** + * Checks if an array contains values that require Uint32 representation. + * + * This function determines whether the array contains any values >= 65535, + * which would require a Uint32Array rather than a Uint16Array for proper storage. + * The function iterates from the end of the array, assuming larger values are + * typically located at the end. + * + * @private + * @param {Array} array - The array to check. + * @return {boolean} True if the array contains values >= 65535, false otherwise. + */ +export function arrayNeedsUint32(array: Array): boolean; +/** + * Creates a typed array of the specified type from the given buffer. + * + * @private + * @param {string} type - The name of the typed array type (e.g., 'Float32Array', 'Uint16Array'). + * @param {ArrayBuffer} buffer - The buffer to create the typed array from. + * @return {TypedArray} A new typed array of the specified type. + */ +export function getTypedArray(type: string, buffer: ArrayBuffer): TypedArray; +/** + * Creates an XHTML element with the specified tag name. + * + * This function uses the XHTML namespace to create DOM elements, + * ensuring proper element creation in XML-based contexts. + * + * @private + * @param {string} name - The tag name of the element to create (e.g., 'canvas', 'div'). + * @return {HTMLElement} The created XHTML element. + */ +export function createElementNS(name: string): HTMLElement; +/** + * Creates a canvas element configured for block display. + * + * This is a convenience function that creates a canvas element with + * display style set to 'block', which is commonly used in three.js + * rendering contexts to avoid inline element spacing issues. + * + * @return {HTMLCanvasElement} A canvas element with display set to 'block'. + */ +export function createCanvasElement(): HTMLCanvasElement; +/** + * Sets a custom function to handle console output. + * + * This allows external code to intercept and handle console.log, console.warn, + * and console.error calls made by three.js, which is useful for custom logging, + * testing, or debugging workflows. + * + * @param {Function} fn - The function to handle console output. Should accept + * (type, message, ...params) where type is 'log', 'warn', or 'error'. + */ +export function setConsoleFunction(fn: Function): void; +/** + * Gets the currently set custom console function. + * + * @return {Function|null} The custom console function, or null if not set. + */ +export function getConsoleFunction(): Function | null; +/** + * Logs an informational message with the 'THREE.' prefix. + * + * If a custom console function is set via setConsoleFunction(), it will be used + * instead of the native console.log. The first parameter is treated as the + * method name and is automatically prefixed with 'THREE.'. + * + * @param {...any} params - The message components. The first param is used as + * the method name and prefixed with 'THREE.'. + */ +export function log(...params: any[]): void; +/** + * Logs a warning message with the 'THREE.' prefix. + * + * If a custom console function is set via setConsoleFunction(), it will be used + * instead of the native console.warn. The first parameter is treated as the + * method name and is automatically prefixed with 'THREE.'. + * + * @param {...any} params - The message components. The first param is used as + * the method name and prefixed with 'THREE.'. + */ +export function warn(...params: any[]): void; +/** + * Logs an error message with the 'THREE.' prefix. + * + * If a custom console function is set via setConsoleFunction(), it will be used + * instead of the native console.error. The first parameter is treated as the + * method name and is automatically prefixed with 'THREE.'. + * + * @param {...any} params - The message components. The first param is used as + * the method name and prefixed with 'THREE.'. + */ +export function error(...params: any[]): void; +/** + * Logs a warning message only once, preventing duplicate warnings. + * + * This function maintains an internal cache of warning messages and will only + * output each unique warning message once. Useful for warnings that may be + * triggered repeatedly but should only be shown to the user once. + * + * @param {...any} params - The warning message components. + */ +export function warnOnce(...params: any[]): void; +/** + * Asynchronously probes for WebGL sync object completion. + * + * This function creates a promise that resolves when the WebGL sync object + * signals completion or rejects if the sync operation fails. It uses polling + * at the specified interval to check the sync status without blocking the + * main thread. This is useful for GPU-CPU synchronization in WebGL contexts. + * + * @private + * @param {WebGL2RenderingContext} gl - The WebGL rendering context. + * @param {WebGLSync} sync - The WebGL sync object to wait for. + * @param {number} interval - The polling interval in milliseconds. + * @return {Promise} A promise that resolves when the sync completes or rejects if it fails. + */ +export function probeAsync(gl: WebGL2RenderingContext, sync: WebGLSync, interval: number): Promise; +/** + * Yields execution to the main thread to allow rendering and other tasks. + * Uses scheduler.yield() when available (Chrome 115+), falls back to requestAnimationFrame. + * + * @return {Promise} + */ +export function yieldToMain(): Promise; +/** + * Converts a projection matrix from normalized device coordinates (NDC) + * range [-1, 1] to [0, 1]. + * + * This conversion is commonly needed when working with depth textures or + * render targets that expect depth values in the [0, 1] range rather than + * the standard OpenGL NDC range of [-1, 1]. The function modifies the + * projection matrix in place. + * + * @private + * @param {Matrix4} projectionMatrix - The projection matrix to convert (modified in place). + */ +export function toNormalizedProjectionMatrix(projectionMatrix: Matrix4): void; +/** + * Reverses the depth range of a projection matrix. + * + * This function inverts the depth mapping of a projection matrix, which is + * useful for reversed-Z depth buffer techniques that can improve depth + * precision. The function handles both perspective and orthographic projection + * matrices differently and modifies the matrix in place. + * + * For perspective matrices (where m[11] === -1), the depth mapping is + * reversed with an offset. For orthographic matrices, a simpler reversal + * is applied. + * + * @private + * @param {Matrix4} projectionMatrix - The projection matrix to reverse (modified in place). + */ +export function toReversedProjectionMatrix(projectionMatrix: Matrix4): void; +/** + * Returns `true` if the given object is a typed array. + * + * @param {any} array - The object to check. + * @return {boolean} Whether the given object is a typed array. + */ +export function isTypedArray(array: any): boolean; +/** + * Used to select the correct depth functions + * when reversed depth buffer is used. + * + * @private + * @type {Object} + */ +export const ReversedDepthFuncs: Object; From 58feaddec452a2a5d33f7ccdfefec854b54b06f6 Mon Sep 17 00:00:00 2001 From: Nathan Bierema Date: Wed, 25 Mar 2026 21:39:28 -0400 Subject: [PATCH 3/4] Update patch and delete jsdoc --- jsdoc-testing/changes.patch | 97 +- .../jsdoc/animation/AnimationAction.d.ts | 310 ---- .../jsdoc/animation/AnimationClip.d.ts | 164 -- .../jsdoc/animation/AnimationMixer.d.ts | 152 -- .../jsdoc/animation/AnimationObjectGroup.d.ts | 77 - .../jsdoc/animation/AnimationUtils.d.ts | 131 -- .../jsdoc/animation/KeyframeTrack.d.ts | 178 -- .../jsdoc/animation/PropertyBinding.d.ts | 144 -- .../jsdoc/animation/PropertyMixer.d.ts | 95 - .../tracks/BooleanKeyframeTrack.d.ts | 28 - .../animation/tracks/ColorKeyframeTrack.d.ts | 17 - .../animation/tracks/NumberKeyframeTrack.d.ts | 17 - .../tracks/QuaternionKeyframeTrack.d.ts | 18 - .../animation/tracks/StringKeyframeTrack.d.ts | 28 - .../animation/tracks/VectorKeyframeTrack.d.ts | 17 - jsdoc-testing/jsdoc/audio/Audio.d.ts | 379 ---- jsdoc-testing/jsdoc/audio/AudioAnalyser.d.ts | 65 - jsdoc-testing/jsdoc/audio/AudioContext.d.ts | 19 - jsdoc-testing/jsdoc/audio/AudioListener.d.ts | 91 - .../jsdoc/audio/PositionalAudio.d.ts | 115 -- jsdoc-testing/jsdoc/cameras/ArrayCamera.d.ts | 42 - jsdoc-testing/jsdoc/cameras/Camera.d.ts | 56 - jsdoc-testing/jsdoc/cameras/CubeCamera.d.ts | 74 - .../jsdoc/cameras/OrthographicCamera.d.ts | 122 -- .../jsdoc/cameras/PerspectiveCamera.d.ts | 216 --- jsdoc-testing/jsdoc/cameras/StereoCamera.d.ts | 61 - jsdoc-testing/jsdoc/constants.d.ts | 1592 ----------------- jsdoc-testing/jsdoc/core/BufferAttribute.d.ts | 482 ----- jsdoc-testing/jsdoc/core/BufferGeometry.d.ts | 391 ---- jsdoc-testing/jsdoc/core/EventDispatcher.d.ts | 53 - .../jsdoc/core/InstancedBufferAttribute.d.ts | 36 - .../core/InstancedInterleavedBuffer.d.ts | 35 - .../jsdoc/core/InterleavedBuffer.d.ts | 153 -- .../core/InterleavedBufferAttribute.d.ts | 226 --- jsdoc-testing/jsdoc/core/Layers.d.ts | 68 - jsdoc-testing/jsdoc/core/Object3D.d.ts | 584 ------ jsdoc-testing/jsdoc/core/RenderTarget.d.ts | 197 -- jsdoc-testing/jsdoc/core/Timer.d.ts | 86 - jsdoc-testing/jsdoc/extras/DataUtils.d.ts | 39 - jsdoc-testing/jsdoc/extras/ImageUtils.d.ts | 22 - jsdoc-testing/jsdoc/extras/TextureUtils.d.ts | 81 - .../jsdoc/geometries/BoxGeometry.d.ts | 46 - .../jsdoc/geometries/ConeGeometry.d.ts | 29 - .../jsdoc/geometries/CylinderGeometry.d.ts | 47 - .../jsdoc/geometries/OctahedronGeometry.d.ts | 23 - .../jsdoc/geometries/PlaneGeometry.d.ts | 42 - .../jsdoc/geometries/PolyhedronGeometry.d.ts | 36 - .../jsdoc/geometries/SphereGeometry.d.ts | 45 - jsdoc-testing/jsdoc/helpers/ArrowHelper.d.ts | 75 - jsdoc-testing/jsdoc/helpers/AxesHelper.d.ts | 35 - jsdoc-testing/jsdoc/helpers/Box3Helper.d.ts | 35 - jsdoc-testing/jsdoc/helpers/BoxHelper.d.ts | 44 - jsdoc-testing/jsdoc/helpers/CameraHelper.d.ts | 64 - .../jsdoc/helpers/DirectionalLightHelper.d.ts | 68 - jsdoc-testing/jsdoc/helpers/GridHelper.d.ts | 32 - .../jsdoc/helpers/HemisphereLightHelper.d.ts | 55 - jsdoc-testing/jsdoc/helpers/PlaneHelper.d.ts | 41 - .../jsdoc/helpers/PointLightHelper.d.ts | 52 - .../jsdoc/helpers/PolarGridHelper.d.ts | 36 - .../jsdoc/helpers/SkeletonHelper.d.ts | 56 - .../jsdoc/helpers/SpotLightHelper.d.ts | 54 - jsdoc-testing/jsdoc/lights/AmbientLight.d.ts | 30 - .../jsdoc/lights/DirectionalLight.d.ts | 67 - .../jsdoc/lights/DirectionalLightShadow.d.ts | 20 - .../jsdoc/lights/HemisphereLight.d.ts | 40 - jsdoc-testing/jsdoc/lights/Light.d.ts | 47 - jsdoc-testing/jsdoc/lights/LightProbe.d.ts | 45 - jsdoc-testing/jsdoc/lights/LightShadow.d.ts | 198 -- jsdoc-testing/jsdoc/lights/PointLight.d.ts | 70 - .../jsdoc/lights/PointLightShadow.d.ts | 20 - jsdoc-testing/jsdoc/lights/RectAreaLight.d.ts | 68 - jsdoc-testing/jsdoc/lights/SpotLight.d.ts | 116 -- .../jsdoc/lights/SpotLightShadow.d.ts | 37 - .../jsdoc/lights/webgpu/IESSpotLight.d.ts | 18 - .../jsdoc/lights/webgpu/ProjectorLight.d.ts | 17 - .../jsdoc/materials/LineBasicMaterial.d.ts | 86 - .../jsdoc/materials/LineDashedMaterial.d.ts | 49 - jsdoc-testing/jsdoc/materials/Material.d.ts | 497 ----- jsdoc-testing/jsdoc/materials/Materials.d.ts | 19 - .../jsdoc/materials/MeshBasicMaterial.d.ts | 184 -- .../jsdoc/materials/MeshDepthMaterial.d.ts | 106 -- .../jsdoc/materials/MeshDistanceMaterial.d.ts | 86 - .../jsdoc/materials/MeshLambertMaterial.d.ts | 305 ---- .../jsdoc/materials/MeshMatcapMaterial.d.ts | 180 -- .../jsdoc/materials/MeshNormalMaterial.d.ts | 127 -- .../jsdoc/materials/MeshPhongMaterial.d.ts | 320 ---- .../jsdoc/materials/MeshPhysicalMaterial.d.ts | 310 ---- .../jsdoc/materials/MeshStandardMaterial.d.ts | 326 ---- .../jsdoc/materials/MeshToonMaterial.d.ts | 242 --- .../jsdoc/materials/PointsMaterial.d.ts | 102 -- .../jsdoc/materials/RawShaderMaterial.d.ts | 108 -- .../jsdoc/materials/ShaderMaterial.d.ts | 256 --- .../jsdoc/materials/ShadowMaterial.d.ts | 56 - .../jsdoc/materials/SpriteMaterial.d.ts | 89 - .../materials/nodes/Line2NodeMaterial.d.ts | 86 - .../nodes/LineBasicNodeMaterial.d.ts | 23 - .../nodes/LineDashedNodeMaterial.d.ts | 78 - .../nodes/MeshBasicNodeMaterial.d.ts | 39 - .../nodes/MeshLambertNodeMaterial.d.ts | 39 - .../nodes/MeshMatcapNodeMaterial.d.ts | 29 - .../nodes/MeshNormalNodeMaterial.d.ts | 28 - .../nodes/MeshPhongNodeMaterial.d.ts | 64 - .../nodes/MeshPhysicalNodeMaterial.d.ts | 276 --- .../materials/nodes/MeshSSSNodeMaterial.d.ts | 96 - .../nodes/MeshStandardNodeMaterial.d.ts | 81 - .../materials/nodes/MeshToonNodeMaterial.d.ts | 30 - .../jsdoc/materials/nodes/NodeMaterial.d.ts | 505 ------ .../jsdoc/materials/nodes/NodeMaterials.d.ts | 18 - .../materials/nodes/PointsNodeMaterial.d.ts | 49 - .../materials/nodes/ShadowNodeMaterial.d.ts | 30 - .../materials/nodes/SpriteNodeMaterial.d.ts | 62 - .../materials/nodes/VolumeNodeMaterial.d.ts | 48 - .../nodes/manager/NodeMaterialObserver.d.ts | 131 -- jsdoc-testing/jsdoc/math/Box3.d.ts | 293 --- jsdoc-testing/jsdoc/math/Color.d.ts | 538 ------ jsdoc-testing/jsdoc/math/ColorManagement.d.ts | 21 - jsdoc-testing/jsdoc/math/Euler.d.ts | 164 -- jsdoc-testing/jsdoc/math/Frustum.d.ts | 100 -- jsdoc-testing/jsdoc/math/FrustumArray.d.ts | 64 - jsdoc-testing/jsdoc/math/Interpolant.d.ts | 114 -- jsdoc-testing/jsdoc/math/MathUtils.d.ts | 224 --- jsdoc-testing/jsdoc/math/Matrix2.d.ts | 70 - jsdoc-testing/jsdoc/math/Matrix3.d.ts | 251 --- jsdoc-testing/jsdoc/math/Matrix4.d.ts | 404 ----- jsdoc-testing/jsdoc/math/Plane.d.ts | 189 -- jsdoc-testing/jsdoc/math/Quaternion.d.ts | 310 ---- jsdoc-testing/jsdoc/math/Ray.d.ts | 185 -- jsdoc-testing/jsdoc/math/Sphere.d.ts | 185 -- .../jsdoc/math/SphericalHarmonics3.d.ts | 131 -- jsdoc-testing/jsdoc/math/Triangle.d.ts | 231 --- jsdoc-testing/jsdoc/math/Vector2.d.ts | 440 ----- jsdoc-testing/jsdoc/math/Vector3.d.ts | 613 ------- jsdoc-testing/jsdoc/math/Vector4.d.ts | 443 ----- .../math/interpolants/BezierInterpolant.d.ts | 22 - .../math/interpolants/CubicInterpolant.d.ts | 22 - .../interpolants/DiscreteInterpolant.d.ts | 10 - .../math/interpolants/LinearInterpolant.d.ts | 9 - .../QuaternionLinearInterpolant.d.ts | 9 - jsdoc-testing/jsdoc/nodes/Nodes.d.ts | 140 -- jsdoc-testing/jsdoc/nodes/TSL.d.ts | 136 -- .../jsdoc/nodes/accessors/AccessorsUtils.d.ts | 23 - .../jsdoc/nodes/accessors/Arrays.d.ts | 2 - .../jsdoc/nodes/accessors/BatchNode.d.ts | 47 - .../jsdoc/nodes/accessors/Bitangent.d.ts | 28 - .../nodes/accessors/BufferAttributeNode.d.ts | 143 -- .../jsdoc/nodes/accessors/BufferNode.d.ts | 75 - .../jsdoc/nodes/accessors/BuiltinNode.d.ts | 40 - .../jsdoc/nodes/accessors/Camera.d.ts | 70 - .../jsdoc/nodes/accessors/ClippingNode.d.ts | 65 - .../nodes/accessors/CubeTextureNode.d.ts | 48 - .../jsdoc/nodes/accessors/InstanceNode.d.ts | 125 -- .../nodes/accessors/InstancedMeshNode.d.ts | 31 - .../jsdoc/nodes/accessors/Lights.d.ts | 48 - .../jsdoc/nodes/accessors/MaterialNode.d.ts | 384 ---- .../nodes/accessors/MaterialProperties.d.ts | 24 - .../accessors/MaterialReferenceNode.d.ts | 41 - .../jsdoc/nodes/accessors/ModelNode.d.ts | 104 -- .../accessors/ModelViewProjectionNode.d.ts | 7 - .../jsdoc/nodes/accessors/MorphNode.d.ts | 49 - .../jsdoc/nodes/accessors/Normal.d.ts | 100 -- .../jsdoc/nodes/accessors/Object3DNode.d.ts | 128 -- .../jsdoc/nodes/accessors/PointUVNode.d.ts | 33 - .../jsdoc/nodes/accessors/Position.d.ts | 57 - .../nodes/accessors/ReferenceBaseNode.d.ts | 181 -- .../jsdoc/nodes/accessors/ReferenceNode.d.ts | 197 -- .../jsdoc/nodes/accessors/ReflectVector.d.ts | 28 - .../accessors/RendererReferenceNode.d.ts | 33 - .../nodes/accessors/SceneProperties.d.ts | 21 - .../jsdoc/nodes/accessors/SkinningNode.d.ts | 122 -- .../nodes/accessors/StorageBufferNode.d.ts | 183 -- .../nodes/accessors/StorageTextureNode.d.ts | 123 -- .../jsdoc/nodes/accessors/Tangent.d.ts | 28 - .../jsdoc/nodes/accessors/TangentUtils.d.ts | 20 - .../jsdoc/nodes/accessors/Texture3DNode.d.ts | 54 - .../jsdoc/nodes/accessors/TextureBicubic.d.ts | 20 - .../jsdoc/nodes/accessors/TextureNode.d.ts | 337 ---- .../nodes/accessors/TextureSizeNode.d.ts | 50 - jsdoc-testing/jsdoc/nodes/accessors/UV.d.ts | 1 - .../nodes/accessors/UniformArrayNode.d.ts | 125 -- .../jsdoc/nodes/accessors/UserDataNode.d.ts | 35 - .../jsdoc/nodes/accessors/VelocityNode.d.ts | 79 - .../nodes/accessors/VertexColorNode.d.ts | 31 - jsdoc-testing/jsdoc/nodes/code/CodeNode.d.ts | 79 - .../jsdoc/nodes/code/ExpressionNode.d.ts | 35 - .../jsdoc/nodes/code/FunctionCallNode.d.ts | 70 - .../jsdoc/nodes/code/FunctionNode.d.ts | 76 - jsdoc-testing/jsdoc/nodes/core/ArrayNode.d.ts | 76 - .../jsdoc/nodes/core/AssignNode.d.ts | 65 - .../jsdoc/nodes/core/AttributeNode.d.ts | 41 - .../jsdoc/nodes/core/BypassNode.d.ts | 54 - jsdoc-testing/jsdoc/nodes/core/ConstNode.d.ts | 25 - .../jsdoc/nodes/core/ContextNode.d.ts | 107 -- jsdoc-testing/jsdoc/nodes/core/IndexNode.d.ts | 88 - jsdoc-testing/jsdoc/nodes/core/InputNode.d.ts | 61 - .../jsdoc/nodes/core/InspectorNode.d.ts | 57 - .../jsdoc/nodes/core/IsolateNode.d.ts | 55 - .../jsdoc/nodes/core/LightingModel.d.ts | 59 - jsdoc-testing/jsdoc/nodes/core/MRTNode.d.ts | 106 -- jsdoc-testing/jsdoc/nodes/core/Node.d.ts | 437 ----- .../jsdoc/nodes/core/NodeAttribute.d.ts | 44 - .../jsdoc/nodes/core/NodeBuilder.d.ts | 1322 -------------- jsdoc-testing/jsdoc/nodes/core/NodeCache.d.ts | 47 - jsdoc-testing/jsdoc/nodes/core/NodeCode.d.ts | 36 - jsdoc-testing/jsdoc/nodes/core/NodeError.d.ts | 13 - jsdoc-testing/jsdoc/nodes/core/NodeFrame.d.ts | 133 -- .../jsdoc/nodes/core/NodeFunction.d.ts | 55 - .../jsdoc/nodes/core/NodeFunctionInput.d.ts | 52 - .../jsdoc/nodes/core/NodeParser.d.ts | 15 - .../jsdoc/nodes/core/NodeUniform.d.ts | 62 - jsdoc-testing/jsdoc/nodes/core/NodeUtils.d.ts | 93 - jsdoc-testing/jsdoc/nodes/core/NodeVar.d.ts | 50 - .../jsdoc/nodes/core/NodeVarying.d.ts | 51 - .../jsdoc/nodes/core/OutputStructNode.d.ts | 41 - .../jsdoc/nodes/core/ParameterNode.d.ts | 35 - .../jsdoc/nodes/core/PropertyNode.d.ts | 253 --- jsdoc-testing/jsdoc/nodes/core/StackNode.d.ts | 145 -- .../jsdoc/nodes/core/StackTrace.d.ts | 44 - .../jsdoc/nodes/core/StructNode.d.ts | 33 - .../jsdoc/nodes/core/StructType.d.ts | 7 - .../jsdoc/nodes/core/StructTypeNode.d.ts | 48 - .../jsdoc/nodes/core/SubBuildNode.d.ts | 30 - jsdoc-testing/jsdoc/nodes/core/TempNode.d.ts | 28 - .../jsdoc/nodes/core/UniformGroupNode.d.ts | 77 - .../jsdoc/nodes/core/UniformNode.d.ts | 65 - jsdoc-testing/jsdoc/nodes/core/VarNode.d.ts | 88 - .../jsdoc/nodes/core/VaryingNode.d.ts | 80 - jsdoc-testing/jsdoc/nodes/core/constants.d.ts | 30 - .../jsdoc/nodes/display/BlendModes.d.ts | 95 - .../jsdoc/nodes/display/BumpMapNode.d.ts | 44 - .../jsdoc/nodes/display/ColorAdjustment.d.ts | 76 - .../nodes/display/ColorSpaceFunctions.d.ts | 18 - .../jsdoc/nodes/display/ColorSpaceNode.d.ts | 50 - .../jsdoc/nodes/display/FrontFacingNode.d.ts | 48 - .../jsdoc/nodes/display/NormalMapNode.d.ts | 58 - .../jsdoc/nodes/display/PassNode.d.ts | 417 ----- .../jsdoc/nodes/display/RenderOutputNode.d.ts | 79 - .../jsdoc/nodes/display/ScreenNode.d.ts | 127 -- .../nodes/display/ToneMappingFunctions.d.ts | 68 - .../jsdoc/nodes/display/ToneMappingNode.d.ts | 60 - .../nodes/display/ToonOutlinePassNode.d.ts | 71 - .../nodes/display/ViewportDepthNode.d.ts | 105 -- .../display/ViewportDepthTextureNode.d.ts | 31 - .../display/ViewportSharedTextureNode.d.ts | 37 - .../nodes/display/ViewportTextureNode.d.ts | 89 - jsdoc-testing/jsdoc/nodes/fog/Fog.d.ts | 38 - .../jsdoc/nodes/functions/BSDF/BRDF_GGX.d.ts | 2 - .../functions/BSDF/BRDF_GGX_Multiscatter.d.ts | 2 - .../nodes/functions/BSDF/BRDF_Lambert.d.ts | 2 - .../nodes/functions/BSDF/BRDF_Sheen.d.ts | 2 - .../jsdoc/nodes/functions/BSDF/DFGLUT.d.ts | 2 - .../jsdoc/nodes/functions/BSDF/D_GGX.d.ts | 2 - .../functions/BSDF/D_GGX_Anisotropic.d.ts | 2 - .../nodes/functions/BSDF/EnvironmentBRDF.d.ts | 2 - .../jsdoc/nodes/functions/BSDF/F_Schlick.d.ts | 2 - .../jsdoc/nodes/functions/BSDF/LTC.d.ts | 3 - .../nodes/functions/BSDF/Schlick_to_F0.d.ts | 2 - .../functions/BSDF/V_GGX_SmithCorrelated.d.ts | 2 - .../V_GGX_SmithCorrelated_Anisotropic.d.ts | 2 - .../nodes/functions/BasicLightingModel.d.ts | 23 - .../nodes/functions/PhongLightingModel.d.ts | 31 - .../functions/PhysicalLightingModel.d.ts | 171 -- .../nodes/functions/ShadowMaskModel.d.ts | 27 - .../nodes/functions/ToonLightingModel.d.ts | 23 - .../functions/VolumetricLightingModel.d.ts | 25 - .../material/getAlphaHashThreshold.d.ts | 2 - .../material/getGeometryRoughness.d.ts | 2 - .../material/getParallaxCorrectNormal.d.ts | 19 - .../functions/material/getRoughness.d.ts | 2 - .../functions/material/getShIrradianceAt.d.ts | 2 - .../jsdoc/nodes/geometry/RangeNode.d.ts | 68 - .../jsdoc/nodes/gpgpu/AtomicFunctionNode.d.ts | 78 - .../jsdoc/nodes/gpgpu/BarrierNode.d.ts | 23 - .../jsdoc/nodes/gpgpu/ComputeBuiltinNode.d.ts | 135 -- .../jsdoc/nodes/gpgpu/ComputeNode.d.ts | 96 - .../nodes/gpgpu/SubgroupFunctionNode.d.ts | 303 ---- .../jsdoc/nodes/gpgpu/WorkgroupInfoNode.d.ts | 119 -- .../jsdoc/nodes/lighting/AONode.d.ts | 25 - .../nodes/lighting/AmbientLightNode.d.ts | 12 - .../nodes/lighting/AnalyticLightNode.d.ts | 127 -- .../nodes/lighting/BasicEnvironmentNode.d.ts | 26 - .../nodes/lighting/BasicLightMapNode.d.ts | 24 - .../nodes/lighting/DirectionalLightNode.d.ts | 13 - .../jsdoc/nodes/lighting/EnvironmentNode.d.ts | 33 - .../nodes/lighting/HemisphereLightNode.d.ts | 34 - .../nodes/lighting/IESSpotLightNode.d.ts | 9 - .../jsdoc/nodes/lighting/IrradianceNode.d.ts | 24 - .../jsdoc/nodes/lighting/LightProbeNode.d.ts | 22 - .../jsdoc/nodes/lighting/LightUtils.d.ts | 11 - .../nodes/lighting/LightingContextNode.d.ts | 83 - .../jsdoc/nodes/lighting/LightingNode.d.ts | 21 - .../jsdoc/nodes/lighting/LightsNode.d.ts | 119 -- .../jsdoc/nodes/lighting/PointLightNode.d.ts | 40 - .../jsdoc/nodes/lighting/PointShadowNode.d.ts | 52 - .../nodes/lighting/ProjectorLightNode.d.ts | 17 - .../nodes/lighting/RectAreaLightNode.d.ts | 41 - .../jsdoc/nodes/lighting/ShadowBaseNode.d.ts | 46 - .../nodes/lighting/ShadowFilterNode.d.ts | 50 - .../jsdoc/nodes/lighting/ShadowNode.d.ts | 193 -- .../jsdoc/nodes/lighting/SpotLightNode.d.ts | 52 - .../jsdoc/nodes/materialx/MaterialXNodes.d.ts | 44 - .../jsdoc/nodes/materialx/lib/mx_hsv.d.ts | 2 - .../jsdoc/nodes/materialx/lib/mx_noise.d.ts | 70 - .../materialx/lib/mx_transform_color.d.ts | 1 - .../jsdoc/nodes/math/BitcastNode.d.ts | 62 - .../jsdoc/nodes/math/BitcountNode.d.ts | 111 -- .../jsdoc/nodes/math/ConditionalNode.d.ts | 65 - jsdoc-testing/jsdoc/nodes/math/Hash.d.ts | 9 - jsdoc-testing/jsdoc/nodes/math/MathNode.d.ts | 701 -------- jsdoc-testing/jsdoc/nodes/math/MathUtils.d.ts | 4 - .../jsdoc/nodes/math/OperatorNode.d.ts | 313 ---- .../jsdoc/nodes/math/PackFloatNode.d.ts | 66 - .../jsdoc/nodes/math/TriNoise3D.d.ts | 11 - .../jsdoc/nodes/math/UnpackFloatNode.d.ts | 64 - .../jsdoc/nodes/parsers/GLSLNodeFunction.d.ts | 25 - .../jsdoc/nodes/parsers/GLSLNodeParser.d.ts | 17 - .../jsdoc/nodes/pmrem/PMREMNode.d.ts | 113 -- .../jsdoc/nodes/pmrem/PMREMUtils.d.ts | 4 - .../jsdoc/nodes/procedural/Checker.d.ts | 9 - jsdoc-testing/jsdoc/nodes/shapes/Shapes.d.ts | 9 - jsdoc-testing/jsdoc/nodes/tsl/TSLBase.d.ts | 26 - jsdoc-testing/jsdoc/nodes/tsl/TSLCore.d.ts | 77 - .../jsdoc/nodes/utils/ArrayElementNode.d.ts | 53 - .../jsdoc/nodes/utils/ConvertNode.d.ts | 41 - .../jsdoc/nodes/utils/CubeMapNode.d.ts | 57 - .../jsdoc/nodes/utils/DebugNode.d.ts | 12 - jsdoc-testing/jsdoc/nodes/utils/Discard.d.ts | 2 - .../jsdoc/nodes/utils/EquirectUV.d.ts | 17 - .../jsdoc/nodes/utils/EventNode.d.ts | 30 - jsdoc-testing/jsdoc/nodes/utils/FlipNode.d.ts | 46 - .../nodes/utils/FunctionOverloadingNode.d.ts | 60 - jsdoc-testing/jsdoc/nodes/utils/JoinNode.d.ts | 33 - jsdoc-testing/jsdoc/nodes/utils/LoopNode.d.ts | 67 - jsdoc-testing/jsdoc/nodes/utils/MatcapUV.d.ts | 11 - .../jsdoc/nodes/utils/MaxMipLevelNode.d.ts | 51 - .../jsdoc/nodes/utils/MemberNode.d.ts | 41 - .../jsdoc/nodes/utils/Oscillators.d.ts | 4 - jsdoc-testing/jsdoc/nodes/utils/Packing.d.ts | 3 - .../nodes/utils/PostProcessingUtils.d.ts | 66 - jsdoc-testing/jsdoc/nodes/utils/RTTNode.d.ts | 120 -- .../jsdoc/nodes/utils/ReflectorNode.d.ts | 233 --- jsdoc-testing/jsdoc/nodes/utils/Remap.d.ts | 30 - .../jsdoc/nodes/utils/RotateNode.d.ts | 49 - .../jsdoc/nodes/utils/SampleNode.d.ts | 46 - jsdoc-testing/jsdoc/nodes/utils/SetNode.d.ts | 49 - .../jsdoc/nodes/utils/SplitNode.d.ts | 65 - .../jsdoc/nodes/utils/SpriteSheetUV.d.ts | 17 - .../jsdoc/nodes/utils/SpriteUtils.d.ts | 17 - .../nodes/utils/StorageArrayElementNode.d.ts | 51 - jsdoc-testing/jsdoc/nodes/utils/Timer.d.ts | 21 - .../jsdoc/nodes/utils/TriplanarTextures.d.ts | 21 - jsdoc-testing/jsdoc/nodes/utils/UVUtils.d.ts | 42 - .../jsdoc/nodes/utils/ViewportUtils.d.ts | 13 - jsdoc-testing/jsdoc/objects/Group.d.ts | 29 - jsdoc-testing/jsdoc/objects/Line.d.ts | 94 - jsdoc-testing/jsdoc/objects/LineSegments.d.ts | 24 - jsdoc-testing/jsdoc/objects/Mesh.d.ts | 97 - .../jsdoc/renderers/common/Animation.d.ts | 92 - .../jsdoc/renderers/common/Attributes.d.ts | 52 - .../jsdoc/renderers/common/Backend.d.ts | 531 ------ .../jsdoc/renderers/common/Background.d.ts | 40 - .../jsdoc/renderers/common/BindGroup.d.ts | 36 - .../jsdoc/renderers/common/Binding.d.ts | 49 - .../jsdoc/renderers/common/Bindings.d.ts | 114 -- .../jsdoc/renderers/common/BlendMode.d.ts | 109 -- .../jsdoc/renderers/common/Buffer.d.ts | 87 - .../jsdoc/renderers/common/BufferUtils.d.ts | 28 - .../jsdoc/renderers/common/BundleGroup.d.ts | 40 - .../jsdoc/renderers/common/CanvasTarget.d.ts | 189 -- .../jsdoc/renderers/common/ChainMap.d.ts | 48 - .../renderers/common/ClippingContext.d.ts | 116 -- .../jsdoc/renderers/common/Color4.d.ts | 49 - .../renderers/common/ComputePipeline.d.ts | 31 - .../jsdoc/renderers/common/Constants.d.ts | 9 - .../renderers/common/CubeRenderTarget.d.ts | 42 - .../jsdoc/renderers/common/DataMap.d.ts | 41 - .../jsdoc/renderers/common/Geometries.d.ts | 103 -- .../IndirectStorageBufferAttribute.d.ts | 29 - .../jsdoc/renderers/common/Info.d.ts | 183 -- .../jsdoc/renderers/common/InspectorBase.d.ts | 109 -- .../jsdoc/renderers/common/Lighting.d.ts | 28 - .../jsdoc/renderers/common/Pipeline.d.ts | 28 - .../jsdoc/renderers/common/Pipelines.d.ts | 174 -- .../renderers/common/PostProcessing.d.ts | 17 - .../renderers/common/ProgrammableStage.d.ts | 64 - .../jsdoc/renderers/common/QuadMesh.d.ts | 52 - .../jsdoc/renderers/common/RenderBundle.d.ts | 18 - .../jsdoc/renderers/common/RenderBundles.d.ts | 28 - .../jsdoc/renderers/common/RenderContext.d.ts | 221 --- .../renderers/common/RenderContexts.d.ts | 42 - .../jsdoc/renderers/common/RenderList.d.ts | 169 -- .../jsdoc/renderers/common/RenderLists.d.ts | 41 - .../jsdoc/renderers/common/RenderObject.d.ts | 409 ----- .../common/RenderObjectPipeline.d.ts | 30 - .../jsdoc/renderers/common/RenderObjects.d.ts | 108 -- .../renderers/common/RenderPipeline.d.ts | 126 -- .../jsdoc/renderers/common/Renderer.d.ts | 1401 --------------- .../jsdoc/renderers/common/RendererUtils.d.ts | 105 -- .../renderers/common/SampledTexture.d.ts | 85 - .../jsdoc/renderers/common/Sampler.d.ts | 66 - .../renderers/common/Storage3DTexture.d.ts | 52 - .../renderers/common/StorageArrayTexture.d.ts | 38 - .../jsdoc/renderers/common/StorageBuffer.d.ts | 38 - .../common/StorageBufferAttribute.d.ts | 35 - .../StorageInstancedBufferAttribute.d.ts | 35 - .../renderers/common/StorageTexture.d.ts | 43 - .../jsdoc/renderers/common/Textures.d.ts | 110 -- .../renderers/common/TimestampQueryPool.d.ts | 119 -- .../jsdoc/renderers/common/Uniform.d.ts | 260 --- .../jsdoc/renderers/common/UniformBuffer.d.ts | 18 - .../jsdoc/renderers/common/UniformsGroup.d.ts | 139 -- .../jsdoc/renderers/common/XRManager.d.ts | 516 ------ .../renderers/common/XRRenderTarget.d.ts | 66 - .../common/extras/PMREMGenerator.d.ts | 196 -- .../common/nodes/NodeBuilderState.d.ts | 105 -- .../renderers/common/nodes/NodeLibrary.d.ts | 99 - .../renderers/common/nodes/NodeManager.d.ts | 280 --- .../common/nodes/NodeSampledTexture.d.ts | 72 - .../renderers/common/nodes/NodeSampler.d.ts | 31 - .../common/nodes/NodeStorageBuffer.d.ts | 36 - .../renderers/common/nodes/NodeUniform.d.ts | 230 --- .../common/nodes/NodeUniformBuffer.d.ts | 56 - .../common/nodes/NodeUniformsGroup.d.ts | 38 - .../ShaderChunk/default_fragment.glsl.d.ts | 2 - .../ShaderChunk/default_vertex.glsl.d.ts | 2 - .../renderers/shaders/UniformsUtils.d.ts | 29 - .../webgl-fallback/WebGLBackend.d.ts | 631 ------- .../webgl-fallback/WebGLBufferRenderer.d.ts | 13 - .../webgl-fallback/nodes/GLSLNodeBuilder.d.ts | 365 ---- .../utils/WebGLAttributeUtils.d.ts | 59 - .../utils/WebGLCapabilities.d.ts | 48 - .../webgl-fallback/utils/WebGLConstants.d.ts | 11 - .../webgl-fallback/utils/WebGLExtensions.d.ts | 56 - .../webgl-fallback/utils/WebGLState.d.ts | 372 ---- .../utils/WebGLTextureUtils.d.ts | 197 -- .../utils/WebGLTimestampQueryPool.d.ts | 58 - .../webgl-fallback/utils/WebGLUtils.d.ts | 51 - .../jsdoc/renderers/webgpu/WebGPUBackend.d.ts | 537 ------ .../webgpu/WebGPURenderer.Nodes.d.ts | 25 - .../renderers/webgpu/WebGPURenderer.d.ts | 42 - .../webgpu/nodes/BasicNodeLibrary.d.ts | 11 - .../webgpu/nodes/StandardNodeLibrary.d.ts | 12 - .../webgpu/nodes/WGSLNodeBuilder.d.ts | 590 ------ .../webgpu/nodes/WGSLNodeFunction.d.ts | 25 - .../webgpu/nodes/WGSLNodeParser.d.ts | 17 - .../webgpu/utils/WebGPUAttributeUtils.d.ts | 73 - .../webgpu/utils/WebGPUBindingUtils.d.ts | 88 - .../webgpu/utils/WebGPUCapabilities.d.ts | 32 - .../webgpu/utils/WebGPUConstants.d.ts | 295 --- .../webgpu/utils/WebGPUPipelineUtils.d.ts | 133 -- .../webgpu/utils/WebGPUTexturePassUtils.d.ts | 97 - .../webgpu/utils/WebGPUTextureUtils.d.ts | 278 --- .../utils/WebGPUTimestampQueryPool.d.ts | 53 - .../renderers/webgpu/utils/WebGPUUtils.d.ts | 95 - .../renderers/webxr/WebXRController.d.ts | 96 - jsdoc-testing/jsdoc/scenes/Fog.d.ts | 70 - jsdoc-testing/jsdoc/scenes/FogExp2.d.ts | 60 - jsdoc-testing/jsdoc/scenes/Scene.d.ts | 97 - .../jsdoc/textures/CubeDepthTexture.d.ts | 51 - jsdoc-testing/jsdoc/textures/CubeTexture.d.ts | 49 - .../jsdoc/textures/DataArrayTexture.d.ts | 53 - jsdoc-testing/jsdoc/textures/DataTexture.d.ts | 38 - .../jsdoc/textures/DepthTexture.d.ts | 42 - .../jsdoc/textures/FramebufferTexture.d.ts | 42 - jsdoc-testing/jsdoc/textures/Source.d.ts | 78 - jsdoc-testing/jsdoc/textures/Texture.d.ts | 405 ----- jsdoc-testing/jsdoc/utils.d.ts | 185 -- 466 files changed, 54 insertions(+), 47388 deletions(-) delete mode 100644 jsdoc-testing/jsdoc/animation/AnimationAction.d.ts delete mode 100644 jsdoc-testing/jsdoc/animation/AnimationClip.d.ts delete mode 100644 jsdoc-testing/jsdoc/animation/AnimationMixer.d.ts delete mode 100644 jsdoc-testing/jsdoc/animation/AnimationObjectGroup.d.ts delete mode 100644 jsdoc-testing/jsdoc/animation/AnimationUtils.d.ts delete mode 100644 jsdoc-testing/jsdoc/animation/KeyframeTrack.d.ts delete mode 100644 jsdoc-testing/jsdoc/animation/PropertyBinding.d.ts delete mode 100644 jsdoc-testing/jsdoc/animation/PropertyMixer.d.ts delete mode 100644 jsdoc-testing/jsdoc/animation/tracks/BooleanKeyframeTrack.d.ts delete mode 100644 jsdoc-testing/jsdoc/animation/tracks/ColorKeyframeTrack.d.ts delete mode 100644 jsdoc-testing/jsdoc/animation/tracks/NumberKeyframeTrack.d.ts delete mode 100644 jsdoc-testing/jsdoc/animation/tracks/QuaternionKeyframeTrack.d.ts delete mode 100644 jsdoc-testing/jsdoc/animation/tracks/StringKeyframeTrack.d.ts delete mode 100644 jsdoc-testing/jsdoc/animation/tracks/VectorKeyframeTrack.d.ts delete mode 100644 jsdoc-testing/jsdoc/audio/Audio.d.ts delete mode 100644 jsdoc-testing/jsdoc/audio/AudioAnalyser.d.ts delete mode 100644 jsdoc-testing/jsdoc/audio/AudioContext.d.ts delete mode 100644 jsdoc-testing/jsdoc/audio/AudioListener.d.ts delete mode 100644 jsdoc-testing/jsdoc/audio/PositionalAudio.d.ts delete mode 100644 jsdoc-testing/jsdoc/cameras/ArrayCamera.d.ts delete mode 100644 jsdoc-testing/jsdoc/cameras/Camera.d.ts delete mode 100644 jsdoc-testing/jsdoc/cameras/CubeCamera.d.ts delete mode 100644 jsdoc-testing/jsdoc/cameras/OrthographicCamera.d.ts delete mode 100644 jsdoc-testing/jsdoc/cameras/PerspectiveCamera.d.ts delete mode 100644 jsdoc-testing/jsdoc/cameras/StereoCamera.d.ts delete mode 100644 jsdoc-testing/jsdoc/constants.d.ts delete mode 100644 jsdoc-testing/jsdoc/core/BufferAttribute.d.ts delete mode 100644 jsdoc-testing/jsdoc/core/BufferGeometry.d.ts delete mode 100644 jsdoc-testing/jsdoc/core/EventDispatcher.d.ts delete mode 100644 jsdoc-testing/jsdoc/core/InstancedBufferAttribute.d.ts delete mode 100644 jsdoc-testing/jsdoc/core/InstancedInterleavedBuffer.d.ts delete mode 100644 jsdoc-testing/jsdoc/core/InterleavedBuffer.d.ts delete mode 100644 jsdoc-testing/jsdoc/core/InterleavedBufferAttribute.d.ts delete mode 100644 jsdoc-testing/jsdoc/core/Layers.d.ts delete mode 100644 jsdoc-testing/jsdoc/core/Object3D.d.ts delete mode 100644 jsdoc-testing/jsdoc/core/RenderTarget.d.ts delete mode 100644 jsdoc-testing/jsdoc/core/Timer.d.ts delete mode 100644 jsdoc-testing/jsdoc/extras/DataUtils.d.ts delete mode 100644 jsdoc-testing/jsdoc/extras/ImageUtils.d.ts delete mode 100644 jsdoc-testing/jsdoc/extras/TextureUtils.d.ts delete mode 100644 jsdoc-testing/jsdoc/geometries/BoxGeometry.d.ts delete mode 100644 jsdoc-testing/jsdoc/geometries/ConeGeometry.d.ts delete mode 100644 jsdoc-testing/jsdoc/geometries/CylinderGeometry.d.ts delete mode 100644 jsdoc-testing/jsdoc/geometries/OctahedronGeometry.d.ts delete mode 100644 jsdoc-testing/jsdoc/geometries/PlaneGeometry.d.ts delete mode 100644 jsdoc-testing/jsdoc/geometries/PolyhedronGeometry.d.ts delete mode 100644 jsdoc-testing/jsdoc/geometries/SphereGeometry.d.ts delete mode 100644 jsdoc-testing/jsdoc/helpers/ArrowHelper.d.ts delete mode 100644 jsdoc-testing/jsdoc/helpers/AxesHelper.d.ts delete mode 100644 jsdoc-testing/jsdoc/helpers/Box3Helper.d.ts delete mode 100644 jsdoc-testing/jsdoc/helpers/BoxHelper.d.ts delete mode 100644 jsdoc-testing/jsdoc/helpers/CameraHelper.d.ts delete mode 100644 jsdoc-testing/jsdoc/helpers/DirectionalLightHelper.d.ts delete mode 100644 jsdoc-testing/jsdoc/helpers/GridHelper.d.ts delete mode 100644 jsdoc-testing/jsdoc/helpers/HemisphereLightHelper.d.ts delete mode 100644 jsdoc-testing/jsdoc/helpers/PlaneHelper.d.ts delete mode 100644 jsdoc-testing/jsdoc/helpers/PointLightHelper.d.ts delete mode 100644 jsdoc-testing/jsdoc/helpers/PolarGridHelper.d.ts delete mode 100644 jsdoc-testing/jsdoc/helpers/SkeletonHelper.d.ts delete mode 100644 jsdoc-testing/jsdoc/helpers/SpotLightHelper.d.ts delete mode 100644 jsdoc-testing/jsdoc/lights/AmbientLight.d.ts delete mode 100644 jsdoc-testing/jsdoc/lights/DirectionalLight.d.ts delete mode 100644 jsdoc-testing/jsdoc/lights/DirectionalLightShadow.d.ts delete mode 100644 jsdoc-testing/jsdoc/lights/HemisphereLight.d.ts delete mode 100644 jsdoc-testing/jsdoc/lights/Light.d.ts delete mode 100644 jsdoc-testing/jsdoc/lights/LightProbe.d.ts delete mode 100644 jsdoc-testing/jsdoc/lights/LightShadow.d.ts delete mode 100644 jsdoc-testing/jsdoc/lights/PointLight.d.ts delete mode 100644 jsdoc-testing/jsdoc/lights/PointLightShadow.d.ts delete mode 100644 jsdoc-testing/jsdoc/lights/RectAreaLight.d.ts delete mode 100644 jsdoc-testing/jsdoc/lights/SpotLight.d.ts delete mode 100644 jsdoc-testing/jsdoc/lights/SpotLightShadow.d.ts delete mode 100644 jsdoc-testing/jsdoc/lights/webgpu/IESSpotLight.d.ts delete mode 100644 jsdoc-testing/jsdoc/lights/webgpu/ProjectorLight.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/LineBasicMaterial.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/LineDashedMaterial.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/Material.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/Materials.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/MeshBasicMaterial.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/MeshDepthMaterial.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/MeshDistanceMaterial.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/MeshLambertMaterial.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/MeshMatcapMaterial.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/MeshNormalMaterial.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/MeshPhongMaterial.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/MeshPhysicalMaterial.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/MeshStandardMaterial.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/MeshToonMaterial.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/PointsMaterial.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/RawShaderMaterial.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/ShaderMaterial.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/ShadowMaterial.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/SpriteMaterial.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/nodes/Line2NodeMaterial.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/nodes/LineBasicNodeMaterial.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/nodes/LineDashedNodeMaterial.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/nodes/MeshBasicNodeMaterial.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/nodes/MeshLambertNodeMaterial.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/nodes/MeshMatcapNodeMaterial.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/nodes/MeshNormalNodeMaterial.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/nodes/MeshPhongNodeMaterial.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/nodes/MeshPhysicalNodeMaterial.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/nodes/MeshSSSNodeMaterial.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/nodes/MeshStandardNodeMaterial.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/nodes/MeshToonNodeMaterial.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/nodes/NodeMaterial.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/nodes/NodeMaterials.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/nodes/PointsNodeMaterial.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/nodes/ShadowNodeMaterial.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/nodes/SpriteNodeMaterial.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/nodes/VolumeNodeMaterial.d.ts delete mode 100644 jsdoc-testing/jsdoc/materials/nodes/manager/NodeMaterialObserver.d.ts delete mode 100644 jsdoc-testing/jsdoc/math/Box3.d.ts delete mode 100644 jsdoc-testing/jsdoc/math/Color.d.ts delete mode 100644 jsdoc-testing/jsdoc/math/ColorManagement.d.ts delete mode 100644 jsdoc-testing/jsdoc/math/Euler.d.ts delete mode 100644 jsdoc-testing/jsdoc/math/Frustum.d.ts delete mode 100644 jsdoc-testing/jsdoc/math/FrustumArray.d.ts delete mode 100644 jsdoc-testing/jsdoc/math/Interpolant.d.ts delete mode 100644 jsdoc-testing/jsdoc/math/MathUtils.d.ts delete mode 100644 jsdoc-testing/jsdoc/math/Matrix2.d.ts delete mode 100644 jsdoc-testing/jsdoc/math/Matrix3.d.ts delete mode 100644 jsdoc-testing/jsdoc/math/Matrix4.d.ts delete mode 100644 jsdoc-testing/jsdoc/math/Plane.d.ts delete mode 100644 jsdoc-testing/jsdoc/math/Quaternion.d.ts delete mode 100644 jsdoc-testing/jsdoc/math/Ray.d.ts delete mode 100644 jsdoc-testing/jsdoc/math/Sphere.d.ts delete mode 100644 jsdoc-testing/jsdoc/math/SphericalHarmonics3.d.ts delete mode 100644 jsdoc-testing/jsdoc/math/Triangle.d.ts delete mode 100644 jsdoc-testing/jsdoc/math/Vector2.d.ts delete mode 100644 jsdoc-testing/jsdoc/math/Vector3.d.ts delete mode 100644 jsdoc-testing/jsdoc/math/Vector4.d.ts delete mode 100644 jsdoc-testing/jsdoc/math/interpolants/BezierInterpolant.d.ts delete mode 100644 jsdoc-testing/jsdoc/math/interpolants/CubicInterpolant.d.ts delete mode 100644 jsdoc-testing/jsdoc/math/interpolants/DiscreteInterpolant.d.ts delete mode 100644 jsdoc-testing/jsdoc/math/interpolants/LinearInterpolant.d.ts delete mode 100644 jsdoc-testing/jsdoc/math/interpolants/QuaternionLinearInterpolant.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/Nodes.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/TSL.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/AccessorsUtils.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/Arrays.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/BatchNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/Bitangent.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/BufferAttributeNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/BufferNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/BuiltinNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/Camera.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/ClippingNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/CubeTextureNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/InstanceNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/InstancedMeshNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/Lights.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/MaterialNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/MaterialProperties.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/MaterialReferenceNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/ModelNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/ModelViewProjectionNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/MorphNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/Normal.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/Object3DNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/PointUVNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/Position.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/ReferenceBaseNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/ReferenceNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/ReflectVector.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/RendererReferenceNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/SceneProperties.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/SkinningNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/StorageBufferNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/StorageTextureNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/Tangent.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/TangentUtils.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/Texture3DNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/TextureBicubic.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/TextureNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/TextureSizeNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/UV.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/UniformArrayNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/UserDataNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/VelocityNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/accessors/VertexColorNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/code/CodeNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/code/ExpressionNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/code/FunctionCallNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/code/FunctionNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/ArrayNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/AssignNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/AttributeNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/BypassNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/ConstNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/ContextNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/IndexNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/InputNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/InspectorNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/IsolateNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/LightingModel.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/MRTNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/Node.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/NodeAttribute.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/NodeBuilder.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/NodeCache.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/NodeCode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/NodeError.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/NodeFrame.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/NodeFunction.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/NodeFunctionInput.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/NodeParser.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/NodeUniform.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/NodeUtils.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/NodeVar.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/NodeVarying.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/OutputStructNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/ParameterNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/PropertyNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/StackNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/StackTrace.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/StructNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/StructType.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/StructTypeNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/SubBuildNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/TempNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/UniformGroupNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/UniformNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/VarNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/VaryingNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/core/constants.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/display/BlendModes.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/display/BumpMapNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/display/ColorAdjustment.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/display/ColorSpaceFunctions.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/display/ColorSpaceNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/display/FrontFacingNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/display/NormalMapNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/display/PassNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/display/RenderOutputNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/display/ScreenNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/display/ToneMappingFunctions.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/display/ToneMappingNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/display/ToonOutlinePassNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/display/ViewportDepthNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/display/ViewportDepthTextureNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/display/ViewportSharedTextureNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/display/ViewportTextureNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/fog/Fog.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/functions/BSDF/BRDF_GGX.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/functions/BSDF/BRDF_GGX_Multiscatter.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/functions/BSDF/BRDF_Lambert.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/functions/BSDF/BRDF_Sheen.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/functions/BSDF/DFGLUT.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/functions/BSDF/D_GGX.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/functions/BSDF/D_GGX_Anisotropic.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/functions/BSDF/EnvironmentBRDF.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/functions/BSDF/F_Schlick.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/functions/BSDF/LTC.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/functions/BSDF/Schlick_to_F0.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/functions/BSDF/V_GGX_SmithCorrelated.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/functions/BasicLightingModel.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/functions/PhongLightingModel.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/functions/PhysicalLightingModel.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/functions/ShadowMaskModel.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/functions/ToonLightingModel.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/functions/VolumetricLightingModel.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/functions/material/getAlphaHashThreshold.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/functions/material/getGeometryRoughness.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/functions/material/getParallaxCorrectNormal.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/functions/material/getRoughness.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/functions/material/getShIrradianceAt.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/geometry/RangeNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/gpgpu/AtomicFunctionNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/gpgpu/BarrierNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/gpgpu/ComputeBuiltinNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/gpgpu/ComputeNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/gpgpu/SubgroupFunctionNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/gpgpu/WorkgroupInfoNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/lighting/AONode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/lighting/AmbientLightNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/lighting/AnalyticLightNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/lighting/BasicEnvironmentNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/lighting/BasicLightMapNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/lighting/DirectionalLightNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/lighting/EnvironmentNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/lighting/HemisphereLightNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/lighting/IESSpotLightNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/lighting/IrradianceNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/lighting/LightProbeNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/lighting/LightUtils.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/lighting/LightingContextNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/lighting/LightingNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/lighting/LightsNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/lighting/PointLightNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/lighting/PointShadowNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/lighting/ProjectorLightNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/lighting/RectAreaLightNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/lighting/ShadowBaseNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/lighting/ShadowFilterNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/lighting/ShadowNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/lighting/SpotLightNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/materialx/MaterialXNodes.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/materialx/lib/mx_hsv.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/materialx/lib/mx_noise.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/materialx/lib/mx_transform_color.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/math/BitcastNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/math/BitcountNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/math/ConditionalNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/math/Hash.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/math/MathNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/math/MathUtils.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/math/OperatorNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/math/PackFloatNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/math/TriNoise3D.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/math/UnpackFloatNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/parsers/GLSLNodeFunction.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/parsers/GLSLNodeParser.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/pmrem/PMREMNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/pmrem/PMREMUtils.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/procedural/Checker.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/shapes/Shapes.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/tsl/TSLBase.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/tsl/TSLCore.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/utils/ArrayElementNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/utils/ConvertNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/utils/CubeMapNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/utils/DebugNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/utils/Discard.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/utils/EquirectUV.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/utils/EventNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/utils/FlipNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/utils/FunctionOverloadingNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/utils/JoinNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/utils/LoopNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/utils/MatcapUV.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/utils/MaxMipLevelNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/utils/MemberNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/utils/Oscillators.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/utils/Packing.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/utils/PostProcessingUtils.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/utils/RTTNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/utils/ReflectorNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/utils/Remap.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/utils/RotateNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/utils/SampleNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/utils/SetNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/utils/SplitNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/utils/SpriteSheetUV.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/utils/SpriteUtils.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/utils/StorageArrayElementNode.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/utils/Timer.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/utils/TriplanarTextures.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/utils/UVUtils.d.ts delete mode 100644 jsdoc-testing/jsdoc/nodes/utils/ViewportUtils.d.ts delete mode 100644 jsdoc-testing/jsdoc/objects/Group.d.ts delete mode 100644 jsdoc-testing/jsdoc/objects/Line.d.ts delete mode 100644 jsdoc-testing/jsdoc/objects/LineSegments.d.ts delete mode 100644 jsdoc-testing/jsdoc/objects/Mesh.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/Animation.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/Attributes.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/Backend.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/Background.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/BindGroup.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/Binding.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/Bindings.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/BlendMode.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/Buffer.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/BufferUtils.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/BundleGroup.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/CanvasTarget.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/ChainMap.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/ClippingContext.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/Color4.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/ComputePipeline.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/Constants.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/CubeRenderTarget.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/DataMap.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/Geometries.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/IndirectStorageBufferAttribute.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/Info.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/InspectorBase.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/Lighting.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/Pipeline.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/Pipelines.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/PostProcessing.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/ProgrammableStage.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/QuadMesh.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/RenderBundle.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/RenderBundles.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/RenderContext.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/RenderContexts.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/RenderList.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/RenderLists.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/RenderObject.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/RenderObjectPipeline.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/RenderObjects.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/RenderPipeline.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/Renderer.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/RendererUtils.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/SampledTexture.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/Sampler.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/Storage3DTexture.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/StorageArrayTexture.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/StorageBuffer.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/StorageBufferAttribute.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/StorageInstancedBufferAttribute.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/StorageTexture.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/Textures.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/TimestampQueryPool.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/Uniform.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/UniformBuffer.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/UniformsGroup.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/XRManager.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/XRRenderTarget.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/extras/PMREMGenerator.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/nodes/NodeBuilderState.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/nodes/NodeLibrary.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/nodes/NodeManager.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/nodes/NodeSampledTexture.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/nodes/NodeSampler.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/nodes/NodeStorageBuffer.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/nodes/NodeUniform.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/nodes/NodeUniformBuffer.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/common/nodes/NodeUniformsGroup.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/shaders/ShaderChunk/default_fragment.glsl.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/shaders/ShaderChunk/default_vertex.glsl.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/shaders/UniformsUtils.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/webgl-fallback/WebGLBackend.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/webgl-fallback/WebGLBufferRenderer.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/webgl-fallback/nodes/GLSLNodeBuilder.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLAttributeUtils.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLCapabilities.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLConstants.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLExtensions.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLState.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLTextureUtils.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLUtils.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/webgpu/WebGPUBackend.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/webgpu/WebGPURenderer.Nodes.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/webgpu/WebGPURenderer.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/webgpu/nodes/BasicNodeLibrary.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/webgpu/nodes/StandardNodeLibrary.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/webgpu/nodes/WGSLNodeFunction.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/webgpu/nodes/WGSLNodeParser.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUAttributeUtils.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUBindingUtils.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUCapabilities.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUConstants.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUPipelineUtils.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUTexturePassUtils.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUTextureUtils.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUTimestampQueryPool.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUUtils.d.ts delete mode 100644 jsdoc-testing/jsdoc/renderers/webxr/WebXRController.d.ts delete mode 100644 jsdoc-testing/jsdoc/scenes/Fog.d.ts delete mode 100644 jsdoc-testing/jsdoc/scenes/FogExp2.d.ts delete mode 100644 jsdoc-testing/jsdoc/scenes/Scene.d.ts delete mode 100644 jsdoc-testing/jsdoc/textures/CubeDepthTexture.d.ts delete mode 100644 jsdoc-testing/jsdoc/textures/CubeTexture.d.ts delete mode 100644 jsdoc-testing/jsdoc/textures/DataArrayTexture.d.ts delete mode 100644 jsdoc-testing/jsdoc/textures/DataTexture.d.ts delete mode 100644 jsdoc-testing/jsdoc/textures/DepthTexture.d.ts delete mode 100644 jsdoc-testing/jsdoc/textures/FramebufferTexture.d.ts delete mode 100644 jsdoc-testing/jsdoc/textures/Source.d.ts delete mode 100644 jsdoc-testing/jsdoc/textures/Texture.d.ts delete mode 100644 jsdoc-testing/jsdoc/utils.d.ts diff --git a/jsdoc-testing/changes.patch b/jsdoc-testing/changes.patch index 5f380237a..1a6ce4da8 100644 --- a/jsdoc-testing/changes.patch +++ b/jsdoc-testing/changes.patch @@ -11990,19 +11990,20 @@ index a1cd970c9..704cfb9f6 100644 + +export default Geometries; diff --git a/jsdoc-testing/jsdoc/renderers/common/Info.d.ts b/jsdoc-testing/jsdoc/renderers/common/Info.d.ts -index caf764118..32db04c0c 100644 +index 4ea7e1d9f..d083c8631 100644 --- a/jsdoc-testing/jsdoc/renderers/common/Info.d.ts +++ b/jsdoc-testing/jsdoc/renderers/common/Info.d.ts -@@ -1,4 +1,7 @@ +@@ -1,4 +1,8 @@ -export default Info; +import { Object3D } from '../../core/Object3D.js'; +import { Texture } from '../../textures/Texture.js'; +import { BufferAttribute } from '../../core/BufferAttribute.js'; ++import ProgrammableStage from './ProgrammableStage.js'; + /** * This renderer module provides a series of statistical information * about the GPU memory and the rendering process. Useful for debugging -@@ -46,7 +49,15 @@ declare class Info { +@@ -46,7 +50,15 @@ declare class Info { * @property {number} lines - The number of rendered line primitives of the current frame. * @property {number} timestamp - The timestamp of the frame. */ @@ -12019,7 +12020,7 @@ index caf764118..32db04c0c 100644 /** * Compute related metrics. * -@@ -56,7 +67,11 @@ declare class Info { +@@ -56,7 +68,11 @@ declare class Info { * @property {number} frameCalls - The number of compute calls of the current frame. * @property {number} timestamp - The timestamp of the frame when using `renderer.computeAsync()`. */ @@ -12032,9 +12033,9 @@ index caf764118..32db04c0c 100644 /** * Memory related metrics. * -@@ -77,7 +92,22 @@ declare class Info { - * @property {number} storageAttributesSize - The memory size of active storage attributes in bytes. +@@ -78,7 +94,23 @@ declare class Info { * @property {number} indirectStorageAttributesSize - The memory size of active indirect storage attributes in bytes. + * @property {number} programsSize - The memory size of active programs in bytes. */ - readonly memory: Object; + readonly memory: { @@ -12052,11 +12053,21 @@ index caf764118..32db04c0c 100644 + indexAttributesSize: number; + storageAttributesSize: number; + indirectStorageAttributesSize: number; ++ programsSize: number; + }; /** * Map for storing calculated byte sizes of tracked objects. * -@@ -168,3 +198,5 @@ declare class Info { +@@ -163,7 +195,7 @@ declare class Info { + * + * @param {Object} program - The program to track. + */ +- destroyProgram(program: Object): void; ++ destroyProgram(program: ProgrammableStage): void; + /** + * Calculates the memory size of a texture in bytes. + * +@@ -181,3 +213,5 @@ declare class Info { */ private _getAttributeMemorySize; } @@ -12820,7 +12831,7 @@ index fcb34a2e6..5a8210553 100644 + +export default RenderObjects; diff --git a/jsdoc-testing/jsdoc/renderers/common/Renderer.d.ts b/jsdoc-testing/jsdoc/renderers/common/Renderer.d.ts -index fdf16b358..40182a6f5 100644 +index a43a970a5..128b38234 100644 --- a/jsdoc-testing/jsdoc/renderers/common/Renderer.d.ts +++ b/jsdoc-testing/jsdoc/renderers/common/Renderer.d.ts @@ -1,8 +1,56 @@ @@ -12912,7 +12923,7 @@ index fdf16b358..40182a6f5 100644 /** * The node library defines how certain library objects like materials, lights * or tone mapping functions are mapped to node types. This is required since -@@ -465,7 +513,7 @@ declare class Renderer { +@@ -466,7 +514,7 @@ declare class Renderer { * * @type {Function} */ @@ -12921,7 +12932,7 @@ index fdf16b358..40182a6f5 100644 /** * Defines the type of output buffers. The default `HalfFloatType` is recommend for * best quality. To save memory and bandwidth, `UnsignedByteType` might be used. -@@ -554,7 +602,7 @@ declare class Renderer { +@@ -555,7 +603,7 @@ declare class Renderer { /** * - The shadow map type. */ @@ -12930,7 +12941,7 @@ index fdf16b358..40182a6f5 100644 }; /** * XR configuration. -@@ -587,11 +635,19 @@ declare class Renderer { +@@ -588,11 +636,19 @@ declare class Renderer { /** * - A callback function that is executed when a shader error happens. Only supported with WebGL 2 right now. */ @@ -12952,7 +12963,7 @@ index fdf16b358..40182a6f5 100644 }; /** * Initializes the renderer so it is ready for usage. -@@ -607,7 +663,7 @@ declare class Renderer { +@@ -608,7 +664,7 @@ declare class Renderer { * * @type {HTMLCanvasElement|OffscreenCanvas} */ @@ -12961,7 +12972,7 @@ index fdf16b358..40182a6f5 100644 /** * The coordinate system of the renderer. The value of this property * depends on the selected backend. Either `THREE.WebGLCoordinateSystem` or -@@ -616,7 +672,7 @@ declare class Renderer { +@@ -617,7 +673,7 @@ declare class Renderer { * @readonly * @type {number} */ @@ -12970,7 +12981,7 @@ index fdf16b358..40182a6f5 100644 /** * Compiles all materials in the given scene. This can be useful to avoid a * phenomenon which is called "shader compilation stutter", which occurs when -@@ -632,7 +688,7 @@ declare class Renderer { +@@ -633,7 +689,7 @@ declare class Renderer { * @param {?Scene} targetScene - If the first argument is a 3D object, this parameter must represent the scene the 3D object is going to be added. * @return {Promise} A Promise that resolves when the compile has been finished. */ @@ -12979,7 +12990,7 @@ index fdf16b358..40182a6f5 100644 /** * Renders the scene in an async fashion. * -@@ -642,7 +698,7 @@ declare class Renderer { +@@ -643,7 +699,7 @@ declare class Renderer { * @param {Camera} camera - The camera. * @return {Promise} A Promise that resolves when the render has been finished. */ @@ -12988,7 +12999,7 @@ index fdf16b358..40182a6f5 100644 /** * Can be used to synchronize CPU operations with GPU tasks. So when this method is called, * the CPU waits for the GPU to complete its operation (e.g. a compute task). -@@ -651,7 +707,7 @@ declare class Renderer { +@@ -652,7 +708,7 @@ declare class Renderer { * @deprecated * @return {Promise} A Promise that resolves when synchronization has been finished. */ @@ -12997,7 +13008,7 @@ index fdf16b358..40182a6f5 100644 set inspector(value: InspectorBase); /** * The inspector instance. The inspector can be any class that extends from `InspectorBase`. -@@ -682,7 +738,7 @@ declare class Renderer { +@@ -683,7 +739,7 @@ declare class Renderer { * @param {MRTNode} mrt - The MRT node to set. * @return {Renderer} A reference to this renderer. */ @@ -13006,7 +13017,7 @@ index fdf16b358..40182a6f5 100644 /** * Returns the MRT configuration. * -@@ -694,14 +750,14 @@ declare class Renderer { +@@ -695,14 +751,14 @@ declare class Renderer { * * @return {number} The output buffer type. */ @@ -13023,7 +13034,7 @@ index fdf16b358..40182a6f5 100644 /** * Default implementation of the device lost callback. * -@@ -740,7 +796,7 @@ declare class Renderer { +@@ -741,7 +797,7 @@ declare class Renderer { * @readonly * @return {boolean} Whether the renderer has been initialized or not. */ @@ -13032,7 +13043,7 @@ index fdf16b358..40182a6f5 100644 /** * Returns an internal render target which is used when computing the output tone mapping * and color space conversion. Unlike in `WebGLRenderer`, this is done in a separate render -@@ -760,7 +816,7 @@ declare class Renderer { +@@ -761,7 +817,7 @@ declare class Renderer { * @return {RenderContext} The current render context. */ private _renderScene; @@ -13041,7 +13052,7 @@ index fdf16b358..40182a6f5 100644 /** * The output pass performs tone mapping and color space conversion. * -@@ -795,13 +851,13 @@ declare class Renderer { +@@ -796,13 +852,13 @@ declare class Renderer { * @param {?onAnimationCallback} callback - The application's animation loop. * @return {Promise} A Promise that resolves when the set has been executed. */ @@ -13057,7 +13068,7 @@ index fdf16b358..40182a6f5 100644 /** * Can be used to transfer buffer data from a storage buffer attribute * from the GPU to the CPU in context of compute shaders. -@@ -810,13 +866,13 @@ declare class Renderer { +@@ -811,13 +867,13 @@ declare class Renderer { * @param {StorageBufferAttribute} attribute - The storage buffer attribute. * @return {Promise} A promise that resolves with the buffer data when the data are ready. */ @@ -13073,7 +13084,7 @@ index fdf16b358..40182a6f5 100644 /** * Returns the pixel ratio. * -@@ -871,14 +927,14 @@ declare class Renderer { +@@ -872,14 +928,14 @@ declare class Renderer { * * @param {Function} method - The sort function. */ @@ -13090,7 +13101,7 @@ index fdf16b358..40182a6f5 100644 /** * Returns the scissor rectangle. * -@@ -886,16 +942,19 @@ declare class Renderer { +@@ -887,16 +943,19 @@ declare class Renderer { * @return {Vector4} The scissor rectangle. */ getScissor(target: Vector4): Vector4; @@ -13113,7 +13124,7 @@ index fdf16b358..40182a6f5 100644 /** * Returns the scissor test value. * -@@ -915,31 +974,35 @@ declare class Renderer { +@@ -916,31 +975,35 @@ declare class Renderer { * @return {Vector4} The viewport definition. */ getViewport(target: Vector4): Vector4; @@ -13153,7 +13164,7 @@ index fdf16b358..40182a6f5 100644 /** * Returns the clear alpha. * -@@ -1015,7 +1078,7 @@ declare class Renderer { +@@ -1016,7 +1079,7 @@ declare class Renderer { * @param {boolean} [stencil=true] - Whether the stencil buffer should be cleared or not. * @return {Promise} A Promise that resolves when the clear operation has been executed. */ @@ -13162,7 +13173,7 @@ index fdf16b358..40182a6f5 100644 /** * Async version of {@link Renderer#clearColor}. * -@@ -1023,7 +1086,7 @@ declare class Renderer { +@@ -1024,7 +1087,7 @@ declare class Renderer { * @deprecated * @return {Promise} A Promise that resolves when the clear operation has been executed. */ @@ -13171,7 +13182,7 @@ index fdf16b358..40182a6f5 100644 /** * Async version of {@link Renderer#clearDepth}. * -@@ -1031,7 +1094,7 @@ declare class Renderer { +@@ -1032,7 +1095,7 @@ declare class Renderer { * @deprecated * @return {Promise} A Promise that resolves when the clear operation has been executed. */ @@ -13180,7 +13191,7 @@ index fdf16b358..40182a6f5 100644 /** * Async version of {@link Renderer#clearStencil}. * -@@ -1039,7 +1102,7 @@ declare class Renderer { +@@ -1040,7 +1103,7 @@ declare class Renderer { * @deprecated * @return {Promise} A Promise that resolves when the clear operation has been executed. */ @@ -13189,7 +13200,7 @@ index fdf16b358..40182a6f5 100644 /** * Returns `true` if a framebuffer target is needed to perform tone mapping or color space conversion. * If this is the case, the renderer allocates an internal render target for that purpose. -@@ -1069,7 +1132,7 @@ declare class Renderer { +@@ -1070,7 +1133,7 @@ declare class Renderer { * * @type {number} */ @@ -13198,7 +13209,7 @@ index fdf16b358..40182a6f5 100644 /** * The current color space of the renderer. When not producing screen output, * the color space is always the working color space. -@@ -1103,7 +1166,7 @@ declare class Renderer { +@@ -1104,7 +1167,7 @@ declare class Renderer { * * @return {?RenderTarget} The render target. Returns `null` if no render target is set. */ @@ -13207,7 +13218,7 @@ index fdf16b358..40182a6f5 100644 /** * Sets the output render target for the renderer. * -@@ -1115,7 +1178,7 @@ declare class Renderer { +@@ -1116,7 +1179,7 @@ declare class Renderer { * * @return {?RenderTarget} The current output render target. Returns `null` if no output target is set. */ @@ -13216,7 +13227,7 @@ index fdf16b358..40182a6f5 100644 /** * Sets the canvas target. The canvas target manages the HTML canvas * or the offscreen canvas the renderer draws into. -@@ -1160,13 +1223,13 @@ declare class Renderer { +@@ -1161,13 +1224,13 @@ declare class Renderer { * * @param {?renderObjectFunction} renderObjectFunction - The render object function. */ @@ -13232,7 +13243,7 @@ index fdf16b358..40182a6f5 100644 /** * Execute a single or an array of compute nodes. This method can only be called * if the renderer has been initialized. -@@ -1178,7 +1241,7 @@ declare class Renderer { +@@ -1179,7 +1242,7 @@ declare class Renderer { * - A IndirectStorageBufferAttribute for indirect dispatch size. * @return {Promise|undefined} A Promise that resolve when the compute has finished. Only returned when the renderer has not been initialized. */ @@ -13241,7 +13252,7 @@ index fdf16b358..40182a6f5 100644 /** * Execute a single or an array of compute nodes. * -@@ -1190,7 +1253,7 @@ declare class Renderer { +@@ -1191,7 +1254,7 @@ declare class Renderer { * - A IndirectStorageBufferAttribute for indirect dispatch size. * @return {Promise} A Promise that resolve when the compute has finished. */ @@ -13250,7 +13261,7 @@ index fdf16b358..40182a6f5 100644 /** * Checks if the given feature is supported by the selected backend. * -@@ -1200,7 +1263,7 @@ declare class Renderer { +@@ -1201,7 +1264,7 @@ declare class Renderer { * @return {Promise} A Promise that resolves with a bool that indicates whether the feature is supported or not. */ hasFeatureAsync(name: string): Promise; @@ -13259,7 +13270,7 @@ index fdf16b358..40182a6f5 100644 /** * Checks if the given feature is supported by the selected backend. If the * renderer has not been initialized, this method always returns `false`. -@@ -1224,7 +1287,7 @@ declare class Renderer { +@@ -1225,7 +1288,7 @@ declare class Renderer { * @param {Texture} texture - The texture. * @return {Promise} A Promise that resolves when the texture has been initialized. */ @@ -13268,7 +13279,7 @@ index fdf16b358..40182a6f5 100644 /** * Initializes the given texture. Useful for preloading a texture rather than waiting until first render * (which can cause noticeable lags due to decode and GPU upload overhead). -@@ -1257,7 +1320,7 @@ declare class Renderer { +@@ -1258,7 +1321,7 @@ declare class Renderer { * @param {number} [srcLevel=0] - The source mip level to copy from. * @param {number} [dstLevel=0] - The destination mip level to copy to. */ @@ -13277,7 +13288,7 @@ index fdf16b358..40182a6f5 100644 /** * Reads pixel data from the given render target. * -@@ -1338,7 +1401,7 @@ declare class Renderer { +@@ -1339,7 +1402,7 @@ declare class Renderer { * @param {?ClippingContext} clippingContext - The clipping context. * @param {?string} [passId=null] - An optional ID for identifying the pass. */ @@ -13286,7 +13297,7 @@ index fdf16b358..40182a6f5 100644 /** * Checks if the given compatibility is supported by the selected backend. * -@@ -1385,16 +1448,7 @@ declare class Renderer { +@@ -1386,16 +1449,7 @@ declare class Renderer { * @param {Scene} targetScene - If the first argument is a 3D object, this parameter must represent the scene the 3D object is going to be added. * @return {function(Object3D, Camera, ?Scene): Promise|undefined} A Promise that resolves when the compile has been finished. */ @@ -14047,7 +14058,7 @@ index 0121dd34b..f5741f970 100644 + +export default NodeLibrary; diff --git a/jsdoc-testing/jsdoc/renderers/common/nodes/NodeManager.d.ts b/jsdoc-testing/jsdoc/renderers/common/nodes/NodeManager.d.ts -index c1ecbe788..26cae5b0b 100644 +index a7840ba9f..32c2c8cb3 100644 --- a/jsdoc-testing/jsdoc/renderers/common/nodes/NodeManager.d.ts +++ b/jsdoc-testing/jsdoc/renderers/common/nodes/NodeManager.d.ts @@ -1,4 +1,28 @@ @@ -14135,7 +14146,7 @@ index c1ecbe788..26cae5b0b 100644 /** * Returns the current output cache key. * -@@ -267,7 +291,7 @@ declare class NodeManager extends DataMap { +@@ -259,7 +283,7 @@ declare class NodeManager extends DataMap { * * @param {Node} computeNode - The compute node. */ @@ -14144,7 +14155,7 @@ index c1ecbe788..26cae5b0b 100644 /** * Triggers the call of `update()` methods * for all nodes of the given render object. -@@ -283,6 +307,5 @@ declare class NodeManager extends DataMap { +@@ -275,6 +299,5 @@ declare class NodeManager extends DataMap { */ needsRefresh(renderObject: RenderObject): boolean; } diff --git a/jsdoc-testing/jsdoc/animation/AnimationAction.d.ts b/jsdoc-testing/jsdoc/animation/AnimationAction.d.ts deleted file mode 100644 index 7489bf508..000000000 --- a/jsdoc-testing/jsdoc/animation/AnimationAction.d.ts +++ /dev/null @@ -1,310 +0,0 @@ -/** - * An instance of `AnimationAction` schedules the playback of an animation which is - * stored in {@link AnimationClip}. - */ -export class AnimationAction { - /** - * Constructs a new animation action. - * - * @param {AnimationMixer} mixer - The mixer that is controlled by this action. - * @param {AnimationClip} clip - The animation clip that holds the actual keyframes. - * @param {?Object3D} [localRoot=null] - The root object on which this action is performed. - * @param {(NormalAnimationBlendMode|AdditiveAnimationBlendMode)} [blendMode] - The blend mode. - */ - constructor(mixer: AnimationMixer, clip: AnimationClip, localRoot?: Object3D | null, blendMode?: (number | number)); - _mixer: AnimationMixer; - _clip: AnimationClip; - _localRoot: any; - /** - * Defines how the animation is blended/combined when two or more animations - * are simultaneously played. - * - * @type {(NormalAnimationBlendMode|AdditiveAnimationBlendMode)} - */ - blendMode: (number | number); - _interpolantSettings: { - endingStart: number; - endingEnd: number; - }; - _interpolants: any[]; - _propertyBindings: any[]; - _cacheIndex: any; - _byClipCacheIndex: any; - _timeScaleInterpolant: any; - _weightInterpolant: any; - /** - * The loop mode, set via {@link AnimationAction#setLoop}. - * - * @type {(LoopRepeat|LoopOnce|LoopPingPong)} - * @default LoopRepeat - */ - loop: (number | number | number); - _loopCount: number; - _startTime: number | null; - /** - * The local time of this action (in seconds, starting with `0`). - * - * The value gets clamped or wrapped to `[0,clip.duration]` (according to the - * loop state). - * - * @type {number} - * @default Infinity - */ - time: number; - /** - * Scaling factor for the {@link AnimationAction#time}. A value of `0` causes the - * animation to pause. Negative values cause the animation to play backwards. - * - * @type {number} - * @default 1 - */ - timeScale: number; - _effectiveTimeScale: number; - /** - * The degree of influence of this action (in the interval `[0, 1]`). Values - * between `0` (no impact) and `1` (full impact) can be used to blend between - * several actions. - * - * @type {number} - * @default 1 - */ - weight: number; - _effectiveWeight: number; - /** - * The number of repetitions of the performed clip over the course of this action. - * Can be set via {@link AnimationAction#setLoop}. - * - * Setting this number has no effect if {@link AnimationAction#loop} is set to - * `THREE:LoopOnce`. - * - * @type {number} - * @default Infinity - */ - repetitions: number; - /** - * If set to `true`, the playback of the action is paused. - * - * @type {boolean} - * @default false - */ - paused: boolean; - /** - * If set to `false`, the action is disabled so it has no impact. - * - * When the action is re-enabled, the animation continues from its current - * time (setting `enabled` to `false` doesn't reset the action). - * - * @type {boolean} - * @default true - */ - enabled: boolean; - /** - * If set to true the animation will automatically be paused on its last frame. - * - * If set to false, {@link AnimationAction#enabled} will automatically be switched - * to `false` when the last loop of the action has finished, so that this action has - * no further impact. - * - * Note: This member has no impact if the action is interrupted (it - * has only an effect if its last loop has really finished). - * - * @type {boolean} - * @default false - */ - clampWhenFinished: boolean; - /** - * Enables smooth interpolation without separate clips for start, loop and end. - * - * @type {boolean} - * @default true - */ - zeroSlopeAtStart: boolean; - /** - * Enables smooth interpolation without separate clips for start, loop and end. - * - * @type {boolean} - * @default true - */ - zeroSlopeAtEnd: boolean; - /** - * Starts the playback of the animation. - * - * @return {AnimationAction} A reference to this animation action. - */ - play(): AnimationAction; - /** - * Stops the playback of the animation. - * - * @return {AnimationAction} A reference to this animation action. - */ - stop(): AnimationAction; - /** - * Resets the playback of the animation. - * - * @return {AnimationAction} A reference to this animation action. - */ - reset(): AnimationAction; - /** - * Returns `true` if the animation is running. - * - * @return {boolean} Whether the animation is running or not. - */ - isRunning(): boolean; - /** - * Returns `true` when {@link AnimationAction#play} has been called. - * - * @return {boolean} Whether the animation is scheduled or not. - */ - isScheduled(): boolean; - /** - * Defines the time when the animation should start. - * - * @param {number} time - The start time in seconds. - * @return {AnimationAction} A reference to this animation action. - */ - startAt(time: number): AnimationAction; - /** - * Configures the loop settings for this action. - * - * @param {(LoopRepeat|LoopOnce|LoopPingPong)} mode - The loop mode. - * @param {number} repetitions - The number of repetitions. - * @return {AnimationAction} A reference to this animation action. - */ - setLoop(mode: (number | number | number), repetitions: number): AnimationAction; - /** - * Sets the effective weight of this action. - * - * An action has no effect and thus an effective weight of zero when the - * action is disabled. - * - * @param {number} weight - The weight to set. - * @return {AnimationAction} A reference to this animation action. - */ - setEffectiveWeight(weight: number): AnimationAction; - /** - * Returns the effective weight of this action. - * - * @return {number} The effective weight. - */ - getEffectiveWeight(): number; - /** - * Fades the animation in by increasing its weight gradually from `0` to `1`, - * within the passed time interval. - * - * @param {number} duration - The duration of the fade. - * @return {AnimationAction} A reference to this animation action. - */ - fadeIn(duration: number): AnimationAction; - /** - * Fades the animation out by decreasing its weight gradually from `1` to `0`, - * within the passed time interval. - * - * @param {number} duration - The duration of the fade. - * @return {AnimationAction} A reference to this animation action. - */ - fadeOut(duration: number): AnimationAction; - /** - * Causes this action to fade in and the given action to fade out, - * within the passed time interval. - * - * @param {AnimationAction} fadeOutAction - The animation action to fade out. - * @param {number} duration - The duration of the fade. - * @param {boolean} [warp=false] - Whether warping should be used or not. - * @return {AnimationAction} A reference to this animation action. - */ - crossFadeFrom(fadeOutAction: AnimationAction, duration: number, warp?: boolean): AnimationAction; - /** - * Causes this action to fade out and the given action to fade in, - * within the passed time interval. - * - * @param {AnimationAction} fadeInAction - The animation action to fade in. - * @param {number} duration - The duration of the fade. - * @param {boolean} [warp=false] - Whether warping should be used or not. - * @return {AnimationAction} A reference to this animation action. - */ - crossFadeTo(fadeInAction: AnimationAction, duration: number, warp?: boolean): AnimationAction; - /** - * Stops any fading which is applied to this action. - * - * @return {AnimationAction} A reference to this animation action. - */ - stopFading(): AnimationAction; - /** - * Sets the effective time scale of this action. - * - * An action has no effect and thus an effective time scale of zero when the - * action is paused. - * - * @param {number} timeScale - The time scale to set. - * @return {AnimationAction} A reference to this animation action. - */ - setEffectiveTimeScale(timeScale: number): AnimationAction; - /** - * Returns the effective time scale of this action. - * - * @return {number} The effective time scale. - */ - getEffectiveTimeScale(): number; - /** - * Sets the duration for a single loop of this action. - * - * @param {number} duration - The duration to set. - * @return {AnimationAction} A reference to this animation action. - */ - setDuration(duration: number): AnimationAction; - /** - * Synchronizes this action with the passed other action. - * - * @param {AnimationAction} action - The action to sync with. - * @return {AnimationAction} A reference to this animation action. - */ - syncWith(action: AnimationAction): AnimationAction; - /** - * Decelerates this animation's speed to `0` within the passed time interval. - * - * @param {number} duration - The duration. - * @return {AnimationAction} A reference to this animation action. - */ - halt(duration: number): AnimationAction; - /** - * Changes the playback speed, within the passed time interval, by modifying - * {@link AnimationAction#timeScale} gradually from `startTimeScale` to - * `endTimeScale`. - * - * @param {number} startTimeScale - The start time scale. - * @param {number} endTimeScale - The end time scale. - * @param {number} duration - The duration. - * @return {AnimationAction} A reference to this animation action. - */ - warp(startTimeScale: number, endTimeScale: number, duration: number): AnimationAction; - /** - * Stops any scheduled warping which is applied to this action. - * - * @return {AnimationAction} A reference to this animation action. - */ - stopWarping(): AnimationAction; - /** - * Returns the animation mixer of this animation action. - * - * @return {AnimationMixer} The animation mixer. - */ - getMixer(): AnimationMixer; - /** - * Returns the animation clip of this animation action. - * - * @return {AnimationClip} The animation clip. - */ - getClip(): AnimationClip; - /** - * Returns the root object of this animation action. - * - * @return {Object3D} The root object. - */ - getRoot(): Object3D; - _update(time: any, deltaTime: any, timeDirection: any, accuIndex: any): void; - _updateWeight(time: any): number; - _updateTimeScale(time: any): number; - _updateTime(deltaTime: any): any; - _setEndings(atStart: any, atEnd: any, pingPong: any): void; - _scheduleFading(duration: any, weightNow: any, weightThen: any): this; -} diff --git a/jsdoc-testing/jsdoc/animation/AnimationClip.d.ts b/jsdoc-testing/jsdoc/animation/AnimationClip.d.ts deleted file mode 100644 index aa45b91f8..000000000 --- a/jsdoc-testing/jsdoc/animation/AnimationClip.d.ts +++ /dev/null @@ -1,164 +0,0 @@ -/** - * A reusable set of keyframe tracks which represent an animation. - */ -export class AnimationClip { - /** - * Factory method for creating an animation clip from the given JSON. - * - * @static - * @param {Object} json - The serialized animation clip. - * @return {AnimationClip} The new animation clip. - */ - static parse(json: Object): AnimationClip; - /** - * Serializes the given animation clip into JSON. - * - * @static - * @param {AnimationClip} clip - The animation clip to serialize. - * @return {Object} The JSON object. - */ - static toJSON(clip: AnimationClip): Object; - /** - * Returns a new animation clip from the passed morph targets array of a - * geometry, taking a name and the number of frames per second. - * - * Note: The fps parameter is required, but the animation speed can be - * overridden via {@link AnimationAction#setDuration}. - * - * @static - * @param {string} name - The name of the animation clip. - * @param {Array} morphTargetSequence - A sequence of morph targets. - * @param {number} fps - The Frames-Per-Second value. - * @param {boolean} noLoop - Whether the clip should be no loop or not. - * @return {AnimationClip} The new animation clip. - */ - static CreateFromMorphTargetSequence(name: string, morphTargetSequence: Array, fps: number, noLoop: boolean): AnimationClip; - /** - * Searches for an animation clip by name, taking as its first parameter - * either an array of clips, or a mesh or geometry that contains an - * array named "animations" property. - * - * @static - * @param {(Array|Object3D)} objectOrClipArray - The array or object to search through. - * @param {string} name - The name to search for. - * @return {?AnimationClip} The found animation clip. Returns `null` if no clip has been found. - */ - static findByName(objectOrClipArray: (Array | Object3D), name: string): AnimationClip | null; - /** - * Returns an array of new AnimationClips created from the morph target - * sequences of a geometry, trying to sort morph target names into - * animation-group-based patterns like "Walk_001, Walk_002, Run_001, Run_002...". - * - * See {@link MD2Loader#parse} as an example for how the method should be used. - * - * @static - * @param {Array} morphTargets - A sequence of morph targets. - * @param {number} fps - The Frames-Per-Second value. - * @param {boolean} noLoop - Whether the clip should be no loop or not. - * @return {Array} An array of new animation clips. - */ - static CreateClipsFromMorphTargetSequences(morphTargets: Array, fps: number, noLoop: boolean): Array; - /** - * Parses the `animation.hierarchy` format and returns a new animation clip. - * - * @static - * @deprecated since r175. - * @param {Object} animation - A serialized animation clip as JSON. - * @param {Array} bones - An array of bones. - * @return {?AnimationClip} The new animation clip. - */ - static parseAnimation(animation: Object, bones: Array): AnimationClip | null; - /** - * Constructs a new animation clip. - * - * Note: Instead of instantiating an AnimationClip directly with the constructor, you can - * use the static interface of this class for creating clips. In most cases though, animation clips - * will automatically be created by loaders when importing animated 3D assets. - * - * @param {string} [name=''] - The clip's name. - * @param {number} [duration=-1] - The clip's duration in seconds. If a negative value is passed, - * the duration will be calculated from the passed keyframes. - * @param {Array} tracks - An array of keyframe tracks. - * @param {(NormalAnimationBlendMode|AdditiveAnimationBlendMode)} [blendMode=NormalAnimationBlendMode] - Defines how the animation - * is blended/combined when two or more animations are simultaneously played. - */ - constructor(name?: string, duration?: number, tracks?: Array, blendMode?: (number | AdditiveAnimationBlendMode)); - /** - * The clip's name. - * - * @type {string} - */ - name: string; - /** - * An array of keyframe tracks. - * - * @type {Array} - */ - tracks: Array; - /** - * The clip's duration in seconds. - * - * @type {number} - */ - duration: number; - /** - * Defines how the animation is blended/combined when two or more animations - * are simultaneously played. - * - * @type {(NormalAnimationBlendMode|AdditiveAnimationBlendMode)} - */ - blendMode: (number | AdditiveAnimationBlendMode); - /** - * The UUID of the animation clip. - * - * @type {string} - * @readonly - */ - readonly uuid: string; - /** - * An object that can be used to store custom data about the animation clip. - * It should not hold references to functions as these will not be cloned. - * - * @type {Object} - */ - userData: Object; - /** - * Sets the duration of this clip to the duration of its longest keyframe track. - * - * @return {AnimationClip} A reference to this animation clip. - */ - resetDuration(): AnimationClip; - /** - * Trims all tracks to the clip's duration. - * - * @return {AnimationClip} A reference to this animation clip. - */ - trim(): AnimationClip; - /** - * Performs minimal validation on each track in the clip. Returns `true` if all - * tracks are valid. - * - * @return {boolean} Whether the clip's keyframes are valid or not. - */ - validate(): boolean; - /** - * Optimizes each track by removing equivalent sequential keys (which are - * common in morph target sequences). - * - * @return {AnimationClip} A reference to this animation clip. - */ - optimize(): AnimationClip; - /** - * Returns a new animation clip with copied values from this instance. - * - * @return {AnimationClip} A clone of this instance. - */ - clone(): AnimationClip; - /** - * Serializes this animation clip into JSON. - * - * @return {Object} The JSON object. - */ - toJSON(): Object; -} -import { KeyframeTrack } from './KeyframeTrack.js'; diff --git a/jsdoc-testing/jsdoc/animation/AnimationMixer.d.ts b/jsdoc-testing/jsdoc/animation/AnimationMixer.d.ts deleted file mode 100644 index b474470e7..000000000 --- a/jsdoc-testing/jsdoc/animation/AnimationMixer.d.ts +++ /dev/null @@ -1,152 +0,0 @@ -/** - * `AnimationMixer` is a player for animations on a particular object in - * the scene. When multiple objects in the scene are animated independently, - * one `AnimationMixer` may be used for each object. - */ -export class AnimationMixer extends EventDispatcher { - /** - * Constructs a new animation mixer. - * - * @param {Object3D} root - The object whose animations shall be played by this mixer. - */ - constructor(root: Object3D); - _root: Object3D; - _accuIndex: number; - /** - * The global mixer time (in seconds; starting with `0` on the mixer's creation). - * - * @type {number} - * @default 0 - */ - time: number; - /** - * A scaling factor for the global time. - * - * Note: Setting this member to `0` and later back to `1` is a - * possibility to pause/unpause all actions that are controlled by this - * mixer. - * - * @type {number} - * @default 1 - */ - timeScale: number; - _bindAction(action: any, prototypeAction: any): void; - _activateAction(action: any): void; - _deactivateAction(action: any): void; - _initMemoryManager(): void; - _actions: any[] | undefined; - _nActiveActions: number | undefined; - _actionsByClip: {} | undefined; - _bindings: any[] | undefined; - _nActiveBindings: number | undefined; - _bindingsByRootAndName: {} | undefined; - _controlInterpolants: any[] | undefined; - _nActiveControlInterpolants: number | undefined; - stats: { - actions: { - readonly total: number; - readonly inUse: number | undefined; - }; - bindings: { - readonly total: number; - readonly inUse: number | undefined; - }; - controlInterpolants: { - readonly total: number; - readonly inUse: number | undefined; - }; - } | undefined; - _isActiveAction(action: any): boolean; - _addInactiveAction(action: any, clipUuid: any, rootUuid: any): void; - _removeInactiveAction(action: any): void; - _removeInactiveBindingsForAction(action: any): void; - _lendAction(action: any): void; - _takeBackAction(action: any): void; - _addInactiveBinding(binding: any, rootUuid: any, trackName: any): void; - _removeInactiveBinding(binding: any): void; - _lendBinding(binding: any): void; - _takeBackBinding(binding: any): void; - _lendControlInterpolant(): any; - _takeBackControlInterpolant(interpolant: any): void; - /** - * Returns an instance of {@link AnimationAction} for the passed clip. - * - * If an action fitting the clip and root parameters doesn't yet exist, it - * will be created by this method. Calling this method several times with the - * same clip and root parameters always returns the same action. - * - * @param {AnimationClip|string} clip - An animation clip or alternatively the name of the animation clip. - * @param {Object3D} [optionalRoot] - An alternative root object. - * @param {(NormalAnimationBlendMode|AdditiveAnimationBlendMode)} [blendMode] - The blend mode. - * @return {?AnimationAction} The animation action. - */ - clipAction(clip: AnimationClip | string, optionalRoot?: Object3D, blendMode?: (number | AdditiveAnimationBlendMode)): AnimationAction | null; - /** - * Returns an existing animation action for the passed clip. - * - * @param {AnimationClip|string} clip - An animation clip or alternatively the name of the animation clip. - * @param {Object3D} [optionalRoot] - An alternative root object. - * @return {?AnimationAction} The animation action. Returns `null` if no action was found. - */ - existingAction(clip: AnimationClip | string, optionalRoot?: Object3D): AnimationAction | null; - /** - * Deactivates all previously scheduled actions on this mixer. - * - * @return {AnimationMixer} A reference to this animation mixer. - */ - stopAllAction(): AnimationMixer; - /** - * Advances the global mixer time and updates the animation. - * - * This is usually done in the render loop by passing the delta - * time from {@link Clock} or {@link Timer}. - * - * @param {number} deltaTime - The delta time in seconds. - * @return {AnimationMixer} A reference to this animation mixer. - */ - update(deltaTime: number): AnimationMixer; - /** - * Sets the global mixer to a specific time and updates the animation accordingly. - * - * This is useful when you need to jump to an exact time in an animation. The - * input parameter will be scaled by {@link AnimationMixer#timeScale} - * - * @param {number} time - The time to set in seconds. - * @return {AnimationMixer} A reference to this animation mixer. - */ - setTime(time: number): AnimationMixer; - /** - * Returns this mixer's root object. - * - * @return {Object3D} The mixer's root object. - */ - getRoot(): Object3D; - /** - * Deallocates all memory resources for a clip. Before using this method make - * sure to call {@link AnimationAction#stop} for all related actions. - * - * @param {AnimationClip} clip - The clip to uncache. - */ - uncacheClip(clip: AnimationClip): void; - /** - * Deallocates all memory resources for a root object. Before using this - * method make sure to call {@link AnimationAction#stop} for all related - * actions or alternatively {@link AnimationMixer#stopAllAction} when the - * mixer operates on a single root. - * - * @param {Object3D} root - The root object to uncache. - */ - uncacheRoot(root: Object3D): void; - /** - * Deallocates all memory resources for an action. The action is identified by the - * given clip and an optional root object. Before using this method make - * sure to call {@link AnimationAction#stop} to deactivate the action. - * - * @param {AnimationClip|string} clip - An animation clip or alternatively the name of the animation clip. - * @param {Object3D} [optionalRoot] - An alternative root object. - */ - uncacheAction(clip: AnimationClip | string, optionalRoot?: Object3D): void; -} -import { EventDispatcher } from '../core/EventDispatcher.js'; -import { AnimationClip } from './AnimationClip.js'; -import { AnimationAction } from './AnimationAction.js'; diff --git a/jsdoc-testing/jsdoc/animation/AnimationObjectGroup.d.ts b/jsdoc-testing/jsdoc/animation/AnimationObjectGroup.d.ts deleted file mode 100644 index 040c4af5c..000000000 --- a/jsdoc-testing/jsdoc/animation/AnimationObjectGroup.d.ts +++ /dev/null @@ -1,77 +0,0 @@ -/** - * A group of objects that receives a shared animation state. - * - * Usage: - * - * - Add objects you would otherwise pass as 'root' to the - * constructor or the .clipAction method of AnimationMixer. - * - Instead pass this object as 'root'. - * - You can also add and remove objects later when the mixer is running. - * - * Note: - * - * - Objects of this class appear as one object to the mixer, - * so cache control of the individual objects must be done on the group. - * - * Limitation: - * - * - The animated properties must be compatible among the all objects in the group. - * - A single property can either be controlled through a target group or directly, but not both. - */ -export class AnimationObjectGroup { - /** - * Constructs a new animation group. - * - * @param {...Object3D} arguments - An arbitrary number of 3D objects that share the same animation state. - */ - constructor(...args: Object3D[]); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isAnimationObjectGroup: boolean; - /** - * The UUID of the 3D object. - * - * @type {string} - * @readonly - */ - readonly uuid: string; - _objects: any[]; - nCachedObjects_: number; - _indicesByUUID: {}; - _paths: any[]; - _parsedPaths: any[]; - _bindings: any[]; - _bindingsIndicesByPath: {}; - stats: { - objects: { - readonly total: number; - readonly inUse: number; - }; - readonly bindingsPerObject: number; - }; - /** - * Adds an arbitrary number of objects to this animation group. - * - * @param {...Object3D} arguments - The 3D objects to add. - */ - add(...args: Object3D[]): void; - /** - * Removes an arbitrary number of objects to this animation group - * - * @param {...Object3D} arguments - The 3D objects to remove. - */ - remove(...args: Object3D[]): void; - /** - * Deallocates all memory resources for the passed 3D objects of this animation group. - * - * @param {...Object3D} arguments - The 3D objects to uncache. - */ - uncache(...args: Object3D[]): void; - subscribe_(path: any, parsedPath: any): any; - unsubscribe_(path: any): void; -} diff --git a/jsdoc-testing/jsdoc/animation/AnimationUtils.d.ts b/jsdoc-testing/jsdoc/animation/AnimationUtils.d.ts deleted file mode 100644 index 7355fe037..000000000 --- a/jsdoc-testing/jsdoc/animation/AnimationUtils.d.ts +++ /dev/null @@ -1,131 +0,0 @@ -/** - * Converts an array to a specific type. - * - * @param {TypedArray|Array} array - The array to convert. - * @param {TypedArray.constructor} type - The constructor of a typed array that defines the new type. - * @return {TypedArray} The converted array. - */ -export function convertArray(array: TypedArray | any[], type: TypedArray.constructor): TypedArray; -import { isTypedArray } from '../utils.js'; -/** - * Returns an array by which times and values can be sorted. - * - * @param {Array} times - The keyframe time values. - * @return {Array} The array. - */ -export function getKeyframeOrder(times: Array): Array; -/** - * Sorts the given array by the previously computed order via `getKeyframeOrder()`. - * - * @param {Array} values - The values to sort. - * @param {number} stride - The stride. - * @param {Array} order - The sort order. - * @return {Array} The sorted values. - */ -export function sortedArray(values: Array, stride: number, order: Array): Array; -/** - * Used for parsing AOS keyframe formats. - * - * @param {Array} jsonKeys - A list of JSON keyframes. - * @param {Array} times - This array will be filled with keyframe times by this function. - * @param {Array} values - This array will be filled with keyframe values by this function. - * @param {string} valuePropertyName - The name of the property to use. - */ -export function flattenJSON(jsonKeys: Array, times: Array, values: Array, valuePropertyName: string): void; -/** - * Creates a new clip, containing only the segment of the original clip between the given frames. - * - * @param {AnimationClip} sourceClip - The values to sort. - * @param {string} name - The name of the clip. - * @param {number} startFrame - The start frame. - * @param {number} endFrame - The end frame. - * @param {number} [fps=30] - The FPS. - * @return {AnimationClip} The new sub clip. - */ -export function subclip(sourceClip: AnimationClip, name: string, startFrame: number, endFrame: number, fps?: number): AnimationClip; -/** - * Converts the keyframes of the given animation clip to an additive format. - * - * @param {AnimationClip} targetClip - The clip to make additive. - * @param {number} [referenceFrame=0] - The reference frame. - * @param {AnimationClip} [referenceClip=targetClip] - The reference clip. - * @param {number} [fps=30] - The FPS. - * @return {AnimationClip} The updated clip which is now additive. - */ -export function makeClipAdditive(targetClip: AnimationClip, referenceFrame?: number, referenceClip?: AnimationClip, fps?: number): AnimationClip; -/** - * A class with various methods to assist with animations. - * - * @hideconstructor - */ -export class AnimationUtils { - /** - * Converts an array to a specific type - * - * @static - * @param {TypedArray|Array} array - The array to convert. - * @param {TypedArray.constructor} type - The constructor of a type array. - * @return {TypedArray} The converted array - */ - static convertArray(array: TypedArray | any[], type: TypedArray.constructor): TypedArray; - /** - * Returns `true` if the given object is a typed array. - * - * @static - * @param {any} object - The object to check. - * @return {boolean} Whether the given object is a typed array. - */ - static isTypedArray(object: any): boolean; - /** - * Returns an array by which times and values can be sorted. - * - * @static - * @param {Array} times - The keyframe time values. - * @return {Array} The array. - */ - static getKeyframeOrder(times: Array): Array; - /** - * Sorts the given array by the previously computed order via `getKeyframeOrder()`. - * - * @static - * @param {Array} values - The values to sort. - * @param {number} stride - The stride. - * @param {Array} order - The sort order. - * @return {Array} The sorted values. - */ - static sortedArray(values: Array, stride: number, order: Array): Array; - /** - * Used for parsing AOS keyframe formats. - * - * @static - * @param {Array} jsonKeys - A list of JSON keyframes. - * @param {Array} times - This array will be filled with keyframe times by this method. - * @param {Array} values - This array will be filled with keyframe values by this method. - * @param {string} valuePropertyName - The name of the property to use. - */ - static flattenJSON(jsonKeys: Array, times: Array, values: Array, valuePropertyName: string): void; - /** - * Creates a new clip, containing only the segment of the original clip between the given frames. - * - * @static - * @param {AnimationClip} sourceClip - The values to sort. - * @param {string} name - The name of the clip. - * @param {number} startFrame - The start frame. - * @param {number} endFrame - The end frame. - * @param {number} [fps=30] - The FPS. - * @return {AnimationClip} The new sub clip. - */ - static subclip(sourceClip: AnimationClip, name: string, startFrame: number, endFrame: number, fps?: number): AnimationClip; - /** - * Converts the keyframes of the given animation clip to an additive format. - * - * @static - * @param {AnimationClip} targetClip - The clip to make additive. - * @param {number} [referenceFrame=0] - The reference frame. - * @param {AnimationClip} [referenceClip=targetClip] - The reference clip. - * @param {number} [fps=30] - The FPS. - * @return {AnimationClip} The updated clip which is now additive. - */ - static makeClipAdditive(targetClip: AnimationClip, referenceFrame?: number, referenceClip?: AnimationClip, fps?: number): AnimationClip; -} -export { isTypedArray }; diff --git a/jsdoc-testing/jsdoc/animation/KeyframeTrack.d.ts b/jsdoc-testing/jsdoc/animation/KeyframeTrack.d.ts deleted file mode 100644 index 72239e7a2..000000000 --- a/jsdoc-testing/jsdoc/animation/KeyframeTrack.d.ts +++ /dev/null @@ -1,178 +0,0 @@ -/** - * Represents a timed sequence of keyframes, which are composed of lists of - * times and related values, and which are used to animate a specific property - * of an object. - */ -export class KeyframeTrack { - /** - * Converts the keyframe track to JSON. - * - * @static - * @param {KeyframeTrack} track - The keyframe track to serialize. - * @return {Object} The serialized keyframe track as JSON. - */ - static toJSON(track: KeyframeTrack): Object; - /** - * Constructs a new keyframe track. - * - * @param {string} name - The keyframe track's name. - * @param {Array} times - A list of keyframe times. - * @param {Array} values - A list of keyframe values. - * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth|InterpolateBezier)} [interpolation] - The interpolation type. - */ - constructor(name: string, times: Array, values: Array, interpolation?: (number | number | number | number)); - /** - * The track's name can refer to morph targets or bones or - * possibly other values within an animated object. See {@link PropertyBinding#parseTrackName} - * for the forms of strings that can be parsed for property binding. - * - * @type {string} - */ - name: string; - /** - * The keyframe times. - * - * @type {Float32Array} - */ - times: Float32Array; - /** - * The keyframe values. - * - * @type {Float32Array} - */ - values: Float32Array; - /** - * Factory method for creating a new discrete interpolant. - * - * @static - * @param {TypedArray} [result] - The result buffer. - * @return {DiscreteInterpolant} The new interpolant. - */ - InterpolantFactoryMethodDiscrete(result?: TypedArray): DiscreteInterpolant; - /** - * Factory method for creating a new linear interpolant. - * - * @static - * @param {TypedArray} [result] - The result buffer. - * @return {LinearInterpolant} The new interpolant. - */ - InterpolantFactoryMethodLinear(result?: TypedArray): LinearInterpolant; - /** - * Factory method for creating a new smooth interpolant. - * - * @static - * @param {TypedArray} [result] - The result buffer. - * @return {CubicInterpolant} The new interpolant. - */ - InterpolantFactoryMethodSmooth(result?: TypedArray): CubicInterpolant; - /** - * Factory method for creating a new Bezier interpolant. - * - * The Bezier interpolant requires tangent data to be set via the `settings` property - * on the track before creating the interpolant. The settings should contain: - * - `inTangents`: Float32Array with [time, value] pairs per keyframe per component - * - `outTangents`: Float32Array with [time, value] pairs per keyframe per component - * - * @static - * @param {TypedArray} [result] - The result buffer. - * @return {BezierInterpolant} The new interpolant. - */ - InterpolantFactoryMethodBezier(result?: TypedArray): BezierInterpolant; - /** - * Defines the interpolation factor method for this keyframe track. - * - * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth|InterpolateBezier)} interpolation - The interpolation type. - * @return {KeyframeTrack} A reference to this keyframe track. - */ - setInterpolation(interpolation: (number | number | number | number)): KeyframeTrack; - createInterpolant: ((result?: TypedArray) => LinearInterpolant) | ((result?: TypedArray) => CubicInterpolant) | undefined; - /** - * Returns the current interpolation type. - * - * @return {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth|InterpolateBezier)} The interpolation type. - */ - getInterpolation(): (number | number | number | number); - /** - * Returns the value size. - * - * @return {number} The value size. - */ - getValueSize(): number; - /** - * Moves all keyframes either forward or backward in time. - * - * @param {number} timeOffset - The offset to move the time values. - * @return {KeyframeTrack} A reference to this keyframe track. - */ - shift(timeOffset: number): KeyframeTrack; - /** - * Scale all keyframe times by a factor (useful for frame - seconds conversions). - * - * @param {number} timeScale - The time scale. - * @return {KeyframeTrack} A reference to this keyframe track. - */ - scale(timeScale: number): KeyframeTrack; - /** - * Removes keyframes before and after animation without changing any values within the defined time range. - * - * Note: The method does not shift around keys to the start of the track time, because for interpolated - * keys this will change their values - * - * @param {number} startTime - The start time. - * @param {number} endTime - The end time. - * @return {KeyframeTrack} A reference to this keyframe track. - */ - trim(startTime: number, endTime: number): KeyframeTrack; - /** - * Performs minimal validation on the keyframe track. Returns `true` if the values - * are valid. - * - * @return {boolean} Whether the keyframes are valid or not. - */ - validate(): boolean; - /** - * Optimizes this keyframe track by removing equivalent sequential keys (which are - * common in morph target sequences). - * - * @return {KeyframeTrack} A reference to this keyframe track. - */ - optimize(): KeyframeTrack; - /** - * Returns a new keyframe track with copied values from this instance. - * - * @return {KeyframeTrack} A clone of this instance. - */ - clone(): KeyframeTrack; - /** - * The value type name. - * - * @type {string} - * @default '' - */ - ValueTypeName: string; - /** - * The time buffer type of this keyframe track. - * - * @type {TypedArray|Array} - * @default Float32Array.constructor - */ - TimeBufferType: TypedArray | any[]; - /** - * The value buffer type of this keyframe track. - * - * @type {TypedArray|Array} - * @default Float32Array.constructor - */ - ValueBufferType: TypedArray | any[]; - /** - * The default interpolation type of this keyframe track. - * - * @type {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth|InterpolateBezier)} - * @default InterpolateLinear - */ - DefaultInterpolation: (number | number | number | number); -} -import { DiscreteInterpolant } from '../math/interpolants/DiscreteInterpolant.js'; -import { LinearInterpolant } from '../math/interpolants/LinearInterpolant.js'; -import { CubicInterpolant } from '../math/interpolants/CubicInterpolant.js'; -import { BezierInterpolant } from '../math/interpolants/BezierInterpolant.js'; diff --git a/jsdoc-testing/jsdoc/animation/PropertyBinding.d.ts b/jsdoc-testing/jsdoc/animation/PropertyBinding.d.ts deleted file mode 100644 index af4e99d9d..000000000 --- a/jsdoc-testing/jsdoc/animation/PropertyBinding.d.ts +++ /dev/null @@ -1,144 +0,0 @@ -/** - * This holds a reference to a real property in the scene graph; used internally. - */ -export class PropertyBinding { - /** - * Factory method for creating a property binding from the given parameters. - * - * @static - * @param {Object} root - The root node. - * @param {string} path - The path. - * @param {?Object} [parsedPath] - The parsed path. - * @return {PropertyBinding|Composite} The created property binding or composite. - */ - static create(root: Object, path: string, parsedPath?: Object | null): PropertyBinding | Composite; - /** - * Replaces spaces with underscores and removes unsupported characters from - * node names, to ensure compatibility with parseTrackName(). - * - * @param {string} name - Node name to be sanitized. - * @return {string} The sanitized node name. - */ - static sanitizeNodeName(name: string): string; - /** - * Parses the given track name (an object path to an animated property) and - * returns an object with information about the path. Matches strings in the following forms: - * - * - nodeName.property - * - nodeName.property[accessor] - * - nodeName.material.property[accessor] - * - uuid.property[accessor] - * - uuid.objectName[objectIndex].propertyName[propertyIndex] - * - parentName/nodeName.property - * - parentName/parentName/nodeName.property[index] - * - .bone[Armature.DEF_cog].position - * - scene:helium_balloon_model:helium_balloon_model.position - * - * @static - * @param {string} trackName - The track name to parse. - * @return {Object} The parsed track name as an object. - */ - static parseTrackName(trackName: string): Object; - /** - * Searches for a node in the hierarchy of the given root object by the given - * node name. - * - * @static - * @param {Object} root - The root object. - * @param {string|number} nodeName - The name of the node. - * @return {?Object} The found node. Returns `null` if no object was found. - */ - static findNode(root: Object, nodeName: string | number): Object | null; - /** - * Constructs a new property binding. - * - * @param {Object} rootNode - The root node. - * @param {string} path - The path. - * @param {?Object} [parsedPath] - The parsed path. - */ - constructor(rootNode: Object, path: string, parsedPath?: Object | null); - /** - * The object path to the animated property. - * - * @type {string} - */ - path: string; - /** - * An object holding information about the path. - * - * @type {Object} - */ - parsedPath: Object; - /** - * The object owns the animated property. - * - * @type {?Object} - */ - node: Object | null; - /** - * The root node. - * - * @type {Object3D|Skeleton} - */ - rootNode: Object3D | Skeleton; - getValue: (targetArray: any, offset: any) => void; - setValue: (sourceArray: any, offset: any) => void; - _getValue_unavailable(): void; - _setValue_unavailable(): void; - _getValue_direct(buffer: any, offset: any): void; - _getValue_array(buffer: any, offset: any): void; - _getValue_arrayElement(buffer: any, offset: any): void; - _getValue_toArray(buffer: any, offset: any): void; - _setValue_direct(buffer: any, offset: any): void; - _setValue_direct_setNeedsUpdate(buffer: any, offset: any): void; - _setValue_direct_setMatrixWorldNeedsUpdate(buffer: any, offset: any): void; - _setValue_array(buffer: any, offset: any): void; - _setValue_array_setNeedsUpdate(buffer: any, offset: any): void; - _setValue_array_setMatrixWorldNeedsUpdate(buffer: any, offset: any): void; - _setValue_arrayElement(buffer: any, offset: any): void; - _setValue_arrayElement_setNeedsUpdate(buffer: any, offset: any): void; - _setValue_arrayElement_setMatrixWorldNeedsUpdate(buffer: any, offset: any): void; - _setValue_fromArray(buffer: any, offset: any): void; - _setValue_fromArray_setNeedsUpdate(buffer: any, offset: any): void; - _setValue_fromArray_setMatrixWorldNeedsUpdate(buffer: any, offset: any): void; - _getValue_unbound(targetArray: any, offset: any): void; - _setValue_unbound(sourceArray: any, offset: any): void; - /** - * Creates a getter / setter pair for the property tracked by this binding. - */ - bind(): void; - targetObject: Object | null | undefined; - resolvedProperty: any; - propertyIndex: any; - propertyName: any; - /** - * Unbinds the property. - */ - unbind(): void; - BindingType: { - Direct: number; - EntireArray: number; - ArrayElement: number; - HasFromToArray: number; - }; - Versioning: { - None: number; - NeedsUpdate: number; - MatrixWorldNeedsUpdate: number; - }; - GetterByBindingType: ((buffer: any, offset: any) => void)[]; - SetterByBindingTypeAndVersioning: ((buffer: any, offset: any) => void)[][]; -} -export namespace PropertyBinding { - export { Composite }; -} -declare class Composite { - constructor(targetGroup: any, path: any, optionalParsedPath: any); - _targetGroup: any; - _bindings: any; - getValue(array: any, offset: any): void; - setValue(array: any, offset: any): void; - bind(): void; - unbind(): void; -} -export {}; diff --git a/jsdoc-testing/jsdoc/animation/PropertyMixer.d.ts b/jsdoc-testing/jsdoc/animation/PropertyMixer.d.ts deleted file mode 100644 index 0f715aa7b..000000000 --- a/jsdoc-testing/jsdoc/animation/PropertyMixer.d.ts +++ /dev/null @@ -1,95 +0,0 @@ -/** - * Buffered scene graph property that allows weighted accumulation; used internally. - */ -export class PropertyMixer { - /** - * Constructs a new property mixer. - * - * @param {PropertyBinding} binding - The property binding. - * @param {string} typeName - The keyframe track type name. - * @param {number} valueSize - The keyframe track value size. - */ - constructor(binding: PropertyBinding, typeName: string, valueSize: number); - /** - * The property binding. - * - * @type {PropertyBinding} - */ - binding: PropertyBinding; - /** - * The keyframe track value size. - * - * @type {number} - */ - valueSize: number; - buffer: any[] | Float64Array; - _workIndex: number | undefined; - _mixBufferRegion: (buffer: any, dstOffset: any, srcOffset: any, t: any, stride: any) => void; - _mixBufferRegionAdditive: (buffer: any, dstOffset: any, srcOffset: any, t: any, stride: any) => void; - _setIdentity: () => void; - _origIndex: number; - _addIndex: number; - /** - * Accumulated weight of the property binding. - * - * @type {number} - * @default 0 - */ - cumulativeWeight: number; - /** - * Accumulated additive weight of the property binding. - * - * @type {number} - * @default 0 - */ - cumulativeWeightAdditive: number; - /** - * Number of active keyframe tracks currently using this property binding. - * - * @type {number} - * @default 0 - */ - useCount: number; - /** - * Number of keyframe tracks referencing this property binding. - * - * @type {number} - * @default 0 - */ - referenceCount: number; - /** - * Accumulates data in the `incoming` region into `accu`. - * - * @param {number} accuIndex - The accumulation index. - * @param {number} weight - The weight. - */ - accumulate(accuIndex: number, weight: number): void; - /** - * Accumulates data in the `incoming` region into `add`. - * - * @param {number} weight - The weight. - */ - accumulateAdditive(weight: number): void; - /** - * Applies the state of `accu` to the binding when accus differ. - * - * @param {number} accuIndex - The accumulation index. - */ - apply(accuIndex: number): void; - /** - * Remembers the state of the bound property and copy it to both accus. - */ - saveOriginalState(): void; - /** - * Applies the state previously taken via {@link PropertyMixer#saveOriginalState} to the binding. - */ - restoreOriginalState(): void; - _setAdditiveIdentityNumeric(): void; - _setAdditiveIdentityQuaternion(): void; - _setAdditiveIdentityOther(): void; - _select(buffer: any, dstOffset: any, srcOffset: any, t: any, stride: any): void; - _slerp(buffer: any, dstOffset: any, srcOffset: any, t: any): void; - _slerpAdditive(buffer: any, dstOffset: any, srcOffset: any, t: any, stride: any): void; - _lerp(buffer: any, dstOffset: any, srcOffset: any, t: any, stride: any): void; - _lerpAdditive(buffer: any, dstOffset: any, srcOffset: any, t: any, stride: any): void; -} diff --git a/jsdoc-testing/jsdoc/animation/tracks/BooleanKeyframeTrack.d.ts b/jsdoc-testing/jsdoc/animation/tracks/BooleanKeyframeTrack.d.ts deleted file mode 100644 index d8e3cfd7f..000000000 --- a/jsdoc-testing/jsdoc/animation/tracks/BooleanKeyframeTrack.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * A track for boolean keyframe values. - * - * @augments KeyframeTrack - */ -export class BooleanKeyframeTrack extends KeyframeTrack { - /** - * Constructs a new boolean keyframe track. - * - * This keyframe track type has no `interpolation` parameter because the - * interpolation is always discrete. - * - * @param {string} name - The keyframe track's name. - * @param {Array} times - A list of keyframe times. - * @param {Array} values - A list of keyframe values. - */ - constructor(name: string, times: Array, values: Array); - /** - * The default interpolation type of this keyframe track. - * - * @type {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} - * @default InterpolateDiscrete - */ - DefaultInterpolation: (InterpolateLinear | number | InterpolateSmooth); - InterpolantFactoryMethodLinear: any; - InterpolantFactoryMethodSmooth: any; -} -import { KeyframeTrack } from '../KeyframeTrack.js'; diff --git a/jsdoc-testing/jsdoc/animation/tracks/ColorKeyframeTrack.d.ts b/jsdoc-testing/jsdoc/animation/tracks/ColorKeyframeTrack.d.ts deleted file mode 100644 index aa0f64d74..000000000 --- a/jsdoc-testing/jsdoc/animation/tracks/ColorKeyframeTrack.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * A track for color keyframe values. - * - * @augments KeyframeTrack - */ -export class ColorKeyframeTrack extends KeyframeTrack { - /** - * Constructs a new color keyframe track. - * - * @param {string} name - The keyframe track's name. - * @param {Array} times - A list of keyframe times. - * @param {Array} values - A list of keyframe values. - * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type. - */ - constructor(name: string, times: Array, values: Array, interpolation?: (InterpolateLinear | InterpolateDiscrete | InterpolateSmooth)); -} -import { KeyframeTrack } from '../KeyframeTrack.js'; diff --git a/jsdoc-testing/jsdoc/animation/tracks/NumberKeyframeTrack.d.ts b/jsdoc-testing/jsdoc/animation/tracks/NumberKeyframeTrack.d.ts deleted file mode 100644 index f83c955ca..000000000 --- a/jsdoc-testing/jsdoc/animation/tracks/NumberKeyframeTrack.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * A track for numeric keyframe values. - * - * @augments KeyframeTrack - */ -export class NumberKeyframeTrack extends KeyframeTrack { - /** - * Constructs a new number keyframe track. - * - * @param {string} name - The keyframe track's name. - * @param {Array} times - A list of keyframe times. - * @param {Array} values - A list of keyframe values. - * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type. - */ - constructor(name: string, times: Array, values: Array, interpolation?: (InterpolateLinear | InterpolateDiscrete | InterpolateSmooth)); -} -import { KeyframeTrack } from '../KeyframeTrack.js'; diff --git a/jsdoc-testing/jsdoc/animation/tracks/QuaternionKeyframeTrack.d.ts b/jsdoc-testing/jsdoc/animation/tracks/QuaternionKeyframeTrack.d.ts deleted file mode 100644 index 98e4a75e2..000000000 --- a/jsdoc-testing/jsdoc/animation/tracks/QuaternionKeyframeTrack.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * A track for Quaternion keyframe values. - * - * @augments KeyframeTrack - */ -export class QuaternionKeyframeTrack extends KeyframeTrack { - /** - * Constructs a new Quaternion keyframe track. - * - * @param {string} name - The keyframe track's name. - * @param {Array} times - A list of keyframe times. - * @param {Array} values - A list of keyframe values. - * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type. - */ - constructor(name: string, times: Array, values: Array, interpolation?: (InterpolateLinear | InterpolateDiscrete | InterpolateSmooth)); - InterpolantFactoryMethodSmooth: any; -} -import { KeyframeTrack } from '../KeyframeTrack.js'; diff --git a/jsdoc-testing/jsdoc/animation/tracks/StringKeyframeTrack.d.ts b/jsdoc-testing/jsdoc/animation/tracks/StringKeyframeTrack.d.ts deleted file mode 100644 index 95c5bd155..000000000 --- a/jsdoc-testing/jsdoc/animation/tracks/StringKeyframeTrack.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * A track for string keyframe values. - * - * @augments KeyframeTrack - */ -export class StringKeyframeTrack extends KeyframeTrack { - /** - * Constructs a new string keyframe track. - * - * This keyframe track type has no `interpolation` parameter because the - * interpolation is always discrete. - * - * @param {string} name - The keyframe track's name. - * @param {Array} times - A list of keyframe times. - * @param {Array} values - A list of keyframe values. - */ - constructor(name: string, times: Array, values: Array); - /** - * The default interpolation type of this keyframe track. - * - * @type {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} - * @default InterpolateDiscrete - */ - DefaultInterpolation: (InterpolateLinear | number | InterpolateSmooth); - InterpolantFactoryMethodLinear: any; - InterpolantFactoryMethodSmooth: any; -} -import { KeyframeTrack } from '../KeyframeTrack.js'; diff --git a/jsdoc-testing/jsdoc/animation/tracks/VectorKeyframeTrack.d.ts b/jsdoc-testing/jsdoc/animation/tracks/VectorKeyframeTrack.d.ts deleted file mode 100644 index 856db2d58..000000000 --- a/jsdoc-testing/jsdoc/animation/tracks/VectorKeyframeTrack.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * A track for vector keyframe values. - * - * @augments KeyframeTrack - */ -export class VectorKeyframeTrack extends KeyframeTrack { - /** - * Constructs a new vector keyframe track. - * - * @param {string} name - The keyframe track's name. - * @param {Array} times - A list of keyframe times. - * @param {Array} values - A list of keyframe values. - * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type. - */ - constructor(name: string, times: Array, values: Array, interpolation?: (InterpolateLinear | InterpolateDiscrete | InterpolateSmooth)); -} -import { KeyframeTrack } from '../KeyframeTrack.js'; diff --git a/jsdoc-testing/jsdoc/audio/Audio.d.ts b/jsdoc-testing/jsdoc/audio/Audio.d.ts deleted file mode 100644 index 755622769..000000000 --- a/jsdoc-testing/jsdoc/audio/Audio.d.ts +++ /dev/null @@ -1,379 +0,0 @@ -/** - * Represents a non-positional ( global ) audio object. - * - * This and related audio modules make use of the [Web Audio API](https://www.w3.org/TR/webaudio-1.1/). - * - * ```js - * // create an AudioListener and add it to the camera - * const listener = new THREE.AudioListener(); - * camera.add( listener ); - * - * // create a global audio source - * const sound = new THREE.Audio( listener ); - * - * // load a sound and set it as the Audio object's buffer - * const audioLoader = new THREE.AudioLoader(); - * audioLoader.load( 'sounds/ambient.ogg', function( buffer ) { - * sound.setBuffer( buffer ); - * sound.setLoop( true ); - * sound.setVolume( 0.5 ); - * sound.play(); - * }); - * ``` - * - * @augments Object3D - */ -export class Audio extends Object3D { - /** - * Constructs a new audio. - * - * @param {AudioListener} listener - The global audio listener. - */ - constructor(listener: AudioListener); - type: string; - /** - * The global audio listener. - * - * @type {AudioListener} - * @readonly - */ - readonly listener: AudioListener; - /** - * The audio context. - * - * @type {AudioContext} - * @readonly - */ - readonly context: AudioContext; - /** - * The gain node used for volume control. - * - * @type {GainNode} - * @readonly - */ - readonly gain: GainNode; - /** - * Whether to start playback automatically or not. - * - * @type {boolean} - * @default false - */ - autoplay: boolean; - /** - * A reference to an audio buffer. - * - * Defined via {@link Audio#setBuffer}. - * - * @type {?AudioBuffer} - * @default null - * @readonly - */ - readonly buffer: AudioBuffer | null; - /** - * Modify pitch, measured in cents. +/- 100 is a semitone. - * +/- 1200 is an octave. - * - * Defined via {@link Audio#setDetune}. - * - * @type {number} - * @default 0 - * @readonly - */ - readonly detune: number; - /** - * Whether the audio should loop or not. - * - * Defined via {@link Audio#setLoop}. - * - * @type {boolean} - * @default false - * @readonly - */ - readonly loop: boolean; - /** - * Defines where in the audio buffer the replay should - * start, in seconds. - * - * @type {number} - * @default 0 - */ - loopStart: number; - /** - * Defines where in the audio buffer the replay should - * stop, in seconds. - * - * @type {number} - * @default 0 - */ - loopEnd: number; - /** - * An offset to the time within the audio buffer the playback - * should begin, in seconds. - * - * @type {number} - * @default 0 - */ - offset: number; - /** - * Overrides the default duration of the audio. - * - * @type {undefined|number} - * @default undefined - */ - duration: undefined | number; - /** - * The playback speed. - * - * Defined via {@link Audio#setPlaybackRate}. - * - * @type {number} - * @readonly - * @default 1 - */ - readonly playbackRate: number; - /** - * Indicates whether the audio is playing or not. - * - * This flag will be automatically set when using {@link Audio#play}, - * {@link Audio#pause}, {@link Audio#stop}. - * - * @type {boolean} - * @readonly - * @default false - */ - readonly isPlaying: boolean; - /** - * Indicates whether the audio playback can be controlled - * with method like {@link Audio#play} or {@link Audio#pause}. - * - * This flag will be automatically set when audio sources are - * defined. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly hasPlaybackControl: boolean; - /** - * Holds a reference to the current audio source. - * - * The property is automatically by one of the `set*()` methods. - * - * @type {?AudioNode} - * @readonly - * @default null - */ - readonly source: AudioNode | null; - /** - * Defines the source type. - * - * The property is automatically set by one of the `set*()` methods. - * - * @type {('empty'|'audioNode'|'mediaNode'|'mediaStreamNode'|'buffer')} - * @readonly - * @default 'empty' - */ - readonly sourceType: ("empty" | "audioNode" | "mediaNode" | "mediaStreamNode" | "buffer"); - _startedAt: number; - _progress: number; - _connected: boolean; - /** - * Can be used to apply a variety of low-order filters to create - * more complex sound effects e.g. via `BiquadFilterNode`. - * - * The property is automatically set by {@link Audio#setFilters}. - * - * @type {Array} - * @readonly - */ - readonly filters: Array; - /** - * Returns the output audio node. - * - * @return {GainNode} The output node. - */ - getOutput(): GainNode; - /** - * Sets the given audio node as the source of this instance. - * - * {@link Audio#sourceType} is set to `audioNode` and {@link Audio#hasPlaybackControl} to `false`. - * - * @param {AudioNode} audioNode - The audio node like an instance of `OscillatorNode`. - * @return {Audio} A reference to this instance. - */ - setNodeSource(audioNode: AudioNode): Audio; - /** - * Sets the given media element as the source of this instance. - * - * {@link Audio#sourceType} is set to `mediaNode` and {@link Audio#hasPlaybackControl} to `false`. - * - * @param {HTMLMediaElement} mediaElement - The media element. - * @return {Audio} A reference to this instance. - */ - setMediaElementSource(mediaElement: HTMLMediaElement): Audio; - /** - * Sets the given media stream as the source of this instance. - * - * {@link Audio#sourceType} is set to `mediaStreamNode` and {@link Audio#hasPlaybackControl} to `false`. - * - * @param {MediaStream} mediaStream - The media stream. - * @return {Audio} A reference to this instance. - */ - setMediaStreamSource(mediaStream: MediaStream): Audio; - /** - * Sets the given audio buffer as the source of this instance. - * - * {@link Audio#sourceType} is set to `buffer` and {@link Audio#hasPlaybackControl} to `true`. - * - * @param {AudioBuffer} audioBuffer - The audio buffer. - * @return {Audio} A reference to this instance. - */ - setBuffer(audioBuffer: AudioBuffer): Audio; - /** - * Starts the playback of the audio. - * - * Can only be used with compatible audio sources that allow playback control. - * - * @param {number} [delay=0] - The delay, in seconds, at which the audio should start playing. - * @return {Audio|undefined} A reference to this instance. - */ - play(delay?: number): Audio | undefined; - /** - * Pauses the playback of the audio. - * - * Can only be used with compatible audio sources that allow playback control. - * - * @return {Audio|undefined} A reference to this instance. - */ - pause(): Audio | undefined; - /** - * Stops the playback of the audio. - * - * Can only be used with compatible audio sources that allow playback control. - * - * @param {number} [delay=0] - The delay, in seconds, at which the audio should stop playing. - * @return {Audio|undefined} A reference to this instance. - */ - stop(delay?: number): Audio | undefined; - /** - * Connects to the audio source. This is used internally on - * initialisation and when setting / removing filters. - * - * @return {Audio} A reference to this instance. - */ - connect(): Audio; - /** - * Disconnects to the audio source. This is used internally on - * initialisation and when setting / removing filters. - * - * @return {Audio|undefined} A reference to this instance. - */ - disconnect(): Audio | undefined; - /** - * Returns the current set filters. - * - * @return {Array} The list of filters. - */ - getFilters(): Array; - /** - * Sets an array of filters and connects them with the audio source. - * - * @param {Array} [value] - A list of filters. - * @return {Audio} A reference to this instance. - */ - setFilters(value?: Array): Audio; - /** - * Defines the detuning of oscillation in cents. - * - * @param {number} value - The detuning of oscillation in cents. - * @return {Audio} A reference to this instance. - */ - setDetune(value: number): Audio; - /** - * Returns the detuning of oscillation in cents. - * - * @return {number} The detuning of oscillation in cents. - */ - getDetune(): number; - /** - * Returns the first filter in the list of filters. - * - * @return {AudioNode|undefined} The first filter in the list of filters. - */ - getFilter(): AudioNode | undefined; - /** - * Applies a single filter node to the audio. - * - * @param {AudioNode} [filter] - The filter to set. - * @return {Audio} A reference to this instance. - */ - setFilter(filter?: AudioNode): Audio; - /** - * Sets the playback rate. - * - * Can only be used with compatible audio sources that allow playback control. - * - * @param {number} [value] - The playback rate to set. - * @return {Audio|undefined} A reference to this instance. - */ - setPlaybackRate(value?: number): Audio | undefined; - /** - * Returns the current playback rate. - - * @return {number} The playback rate. - */ - getPlaybackRate(): number; - /** - * Automatically called when playback finished. - */ - onEnded(): void; - /** - * Returns the loop flag. - * - * Can only be used with compatible audio sources that allow playback control. - * - * @return {boolean} Whether the audio should loop or not. - */ - getLoop(): boolean; - /** - * Sets the loop flag. - * - * Can only be used with compatible audio sources that allow playback control. - * - * @param {boolean} value - Whether the audio should loop or not. - * @return {Audio|undefined} A reference to this instance. - */ - setLoop(value: boolean): Audio | undefined; - /** - * Sets the loop start value which defines where in the audio buffer the replay should - * start, in seconds. - * - * @param {number} value - The loop start value. - * @return {Audio} A reference to this instance. - */ - setLoopStart(value: number): Audio; - /** - * Sets the loop end value which defines where in the audio buffer the replay should - * stop, in seconds. - * - * @param {number} value - The loop end value. - * @return {Audio} A reference to this instance. - */ - setLoopEnd(value: number): Audio; - /** - * Returns the volume. - * - * @return {number} The volume. - */ - getVolume(): number; - /** - * Sets the volume. - * - * @param {number} value - The volume to set. - * @return {Audio} A reference to this instance. - */ - setVolume(value: number): Audio; - copy(source: any, recursive: any): this; - clone(recursive: any): any; -} -import { Object3D } from '../core/Object3D.js'; diff --git a/jsdoc-testing/jsdoc/audio/AudioAnalyser.d.ts b/jsdoc-testing/jsdoc/audio/AudioAnalyser.d.ts deleted file mode 100644 index 241498397..000000000 --- a/jsdoc-testing/jsdoc/audio/AudioAnalyser.d.ts +++ /dev/null @@ -1,65 +0,0 @@ -/** - * This class can be used to analyse audio data. - * - * ```js - * // create an AudioListener and add it to the camera - * const listener = new THREE.AudioListener(); - * camera.add( listener ); - * - * // create an Audio source - * const sound = new THREE.Audio( listener ); - * - * // load a sound and set it as the Audio object's buffer - * const audioLoader = new THREE.AudioLoader(); - * audioLoader.load( 'sounds/ambient.ogg', function( buffer ) { - * sound.setBuffer( buffer ); - * sound.setLoop(true); - * sound.setVolume(0.5); - * sound.play(); - * }); - * - * // create an AudioAnalyser, passing in the sound and desired fftSize - * const analyser = new THREE.AudioAnalyser( sound, 32 ); - * - * // get the average frequency of the sound - * const data = analyser.getAverageFrequency(); - * ``` - */ -export class AudioAnalyser { - /** - * Constructs a new audio analyzer. - * - * @param {Audio} audio - The audio to analyze. - * @param {number} [fftSize=2048] - The window size in samples that is used when performing a Fast Fourier Transform (FFT) to get frequency domain data. - */ - constructor(audio: new (src?: string) => HTMLAudioElement, fftSize?: number); - /** - * The global audio listener. - * - * @type {AnalyserNode} - */ - analyser: AnalyserNode; - /** - * Holds the analyzed data. - * - * @type {Uint8Array} - */ - data: Uint8Array; - /** - * Returns an array with frequency data of the audio. - * - * Each item in the array represents the decibel value for a specific frequency. - * The frequencies are spread linearly from 0 to 1/2 of the sample rate. - * For example, for 48000 sample rate, the last item of the array will represent - * the decibel value for 24000 Hz. - * - * @return {Uint8Array} The frequency data. - */ - getFrequencyData(): Uint8Array; - /** - * Returns the average of the frequencies returned by {@link AudioAnalyser#getFrequencyData}. - * - * @return {number} The average frequency. - */ - getAverageFrequency(): number; -} diff --git a/jsdoc-testing/jsdoc/audio/AudioContext.d.ts b/jsdoc-testing/jsdoc/audio/AudioContext.d.ts deleted file mode 100644 index 3a4632519..000000000 --- a/jsdoc-testing/jsdoc/audio/AudioContext.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -/** - * Manages the global audio context in the engine. - * - * @hideconstructor - */ -export class AudioContext { - /** - * Returns the global native audio context. - * - * @return {Window.AudioContext} The native audio context. - */ - static getContext(): Window.AudioContext; - /** - * Allows to set the global native audio context from outside. - * - * @param {Window.AudioContext} value - The native context to set. - */ - static setContext(value: Window.AudioContext): void; -} diff --git a/jsdoc-testing/jsdoc/audio/AudioListener.d.ts b/jsdoc-testing/jsdoc/audio/AudioListener.d.ts deleted file mode 100644 index c668dd516..000000000 --- a/jsdoc-testing/jsdoc/audio/AudioListener.d.ts +++ /dev/null @@ -1,91 +0,0 @@ -/** - * The class represents a virtual listener of the all positional and non-positional audio effects - * in the scene. A three.js application usually creates a single listener. It is a mandatory - * constructor parameter for audios entities like {@link Audio} and {@link PositionalAudio}. - * - * In most cases, the listener object is a child of the camera. So the 3D transformation of the - * camera represents the 3D transformation of the listener. - * - * @augments Object3D - */ -export class AudioListener extends Object3D { - type: string; - /** - * The native audio context. - * - * @type {AudioContext} - * @readonly - */ - readonly context: AudioContext; - /** - * The gain node used for volume control. - * - * @type {GainNode} - * @readonly - */ - readonly gain: GainNode; - /** - * An optional filter. - * - * Defined via {@link AudioListener#setFilter}. - * - * @type {?AudioNode} - * @default null - * @readonly - */ - readonly filter: AudioNode | null; - /** - * Time delta values required for `linearRampToValueAtTime()` usage. - * - * @type {number} - * @default 0 - * @readonly - */ - readonly timeDelta: number; - _timer: Timer; - /** - * Returns the listener's input node. - * - * This method is used by other audio nodes to connect to this listener. - * - * @return {GainNode} The input node. - */ - getInput(): GainNode; - /** - * Removes the current filter from this listener. - * - * @return {AudioListener} A reference to this listener. - */ - removeFilter(): AudioListener; - /** - * Returns the current set filter. - * - * @return {?AudioNode} The filter. - */ - getFilter(): AudioNode | null; - /** - * Sets the given filter to this listener. - * - * @param {AudioNode} value - The filter to set. - * @return {AudioListener} A reference to this listener. - */ - setFilter(value: AudioNode): AudioListener; - /** - * Returns the applications master volume. - * - * @return {number} The master volume. - */ - getMasterVolume(): number; - /** - * Sets the applications master volume. This volume setting affects - * all audio nodes in the scene. - * - * @param {number} value - The master volume to set. - * @return {AudioListener} A reference to this listener. - */ - setMasterVolume(value: number): AudioListener; - updateMatrixWorld(force: any): void; -} -import { Object3D } from '../core/Object3D.js'; -import { AudioContext } from './AudioContext.js'; -import { Timer } from '../core/Timer.js'; diff --git a/jsdoc-testing/jsdoc/audio/PositionalAudio.d.ts b/jsdoc-testing/jsdoc/audio/PositionalAudio.d.ts deleted file mode 100644 index 03307384c..000000000 --- a/jsdoc-testing/jsdoc/audio/PositionalAudio.d.ts +++ /dev/null @@ -1,115 +0,0 @@ -/** - * Represents a positional audio object. - * - * ```js - * // create an AudioListener and add it to the camera - * const listener = new THREE.AudioListener(); - * camera.add( listener ); - * - * // create the PositionalAudio object (passing in the listener) - * const sound = new THREE.PositionalAudio( listener ); - * - * // load a sound and set it as the PositionalAudio object's buffer - * const audioLoader = new THREE.AudioLoader(); - * audioLoader.load( 'sounds/song.ogg', function( buffer ) { - * sound.setBuffer( buffer ); - * sound.setRefDistance( 20 ); - * sound.play(); - * }); - * - * // create an object for the sound to play from - * const sphere = new THREE.SphereGeometry( 20, 32, 16 ); - * const material = new THREE.MeshPhongMaterial( { color: 0xff2200 } ); - * const mesh = new THREE.Mesh( sphere, material ); - * scene.add( mesh ); - * - * // finally add the sound to the mesh - * mesh.add( sound ); - * - * @augments Audio - */ -export class PositionalAudio extends Audio { - /** - * The panner node represents the location, direction, and behavior of an audio - * source in 3D space. - * - * @type {PannerNode} - * @readonly - */ - readonly panner: PannerNode; - connect(): this; - disconnect(): this; - getOutput(): PannerNode; - /** - * Returns the current reference distance. - * - * @return {number} The reference distance. - */ - getRefDistance(): number; - /** - * Defines the reference distance for reducing volume as the audio source moves - * further from the listener – i.e. the distance at which the volume reduction - * starts taking effect. - * - * @param {number} value - The reference distance to set. - * @return {PositionalAudio} A reference to this instance. - */ - setRefDistance(value: number): PositionalAudio; - /** - * Returns the current rolloff factor. - * - * @return {number} The rolloff factor. - */ - getRolloffFactor(): number; - /** - * Defines how quickly the volume is reduced as the source moves away from the listener. - * - * @param {number} value - The rolloff factor. - * @return {PositionalAudio} A reference to this instance. - */ - setRolloffFactor(value: number): PositionalAudio; - /** - * Returns the current distance model. - * - * @return {('linear'|'inverse'|'exponential')} The distance model. - */ - getDistanceModel(): ("linear" | "inverse" | "exponential"); - /** - * Defines which algorithm to use to reduce the volume of the audio source - * as it moves away from the listener. - * - * Read [the spec](https://www.w3.org/TR/webaudio-1.1/#enumdef-distancemodeltype) - * for more details. - * - * @param {('linear'|'inverse'|'exponential')} value - The distance model to set. - * @return {PositionalAudio} A reference to this instance. - */ - setDistanceModel(value: ("linear" | "inverse" | "exponential")): PositionalAudio; - /** - * Returns the current max distance. - * - * @return {number} The max distance. - */ - getMaxDistance(): number; - /** - * Defines the maximum distance between the audio source and the listener, - * after which the volume is not reduced any further. - * - * This value is used only by the `linear` distance model. - * - * @param {number} value - The max distance. - * @return {PositionalAudio} A reference to this instance. - */ - setMaxDistance(value: number): PositionalAudio; - /** - * Sets the directional cone in which the audio can be listened. - * - * @param {number} coneInnerAngle - An angle, in degrees, of a cone inside of which there will be no volume reduction. - * @param {number} coneOuterAngle - An angle, in degrees, of a cone outside of which the volume will be reduced by a constant value, defined by the `coneOuterGain` parameter. - * @param {number} coneOuterGain - The amount of volume reduction outside the cone defined by the `coneOuterAngle`. When set to `0`, no sound can be heard. - * @return {PositionalAudio} A reference to this instance. - */ - setDirectionalCone(coneInnerAngle: number, coneOuterAngle: number, coneOuterGain: number): PositionalAudio; - updateMatrixWorld(force: any): void; -} -import { Audio } from './Audio.js'; diff --git a/jsdoc-testing/jsdoc/cameras/ArrayCamera.d.ts b/jsdoc-testing/jsdoc/cameras/ArrayCamera.d.ts deleted file mode 100644 index d1dd98d30..000000000 --- a/jsdoc-testing/jsdoc/cameras/ArrayCamera.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * This type of camera can be used in order to efficiently render a scene with a - * predefined set of cameras. This is an important performance aspect for - * rendering VR scenes. - * - * An instance of `ArrayCamera` always has an array of sub cameras. It's mandatory - * to define for each sub camera the `viewport` property which determines the - * part of the viewport that is rendered with this camera. - * - * @augments PerspectiveCamera - */ -export class ArrayCamera extends PerspectiveCamera { - /** - * Constructs a new array camera. - * - * @param {Array} [array=[]] - An array of perspective sub cameras. - */ - constructor(array?: Array); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isArrayCamera: boolean; - /** - * Whether this camera is used with multiview rendering or not. - * - * @type {boolean} - * @readonly - * @default false - */ - readonly isMultiViewCamera: boolean; - /** - * An array of perspective sub cameras. - * - * @type {Array} - */ - cameras: Array; -} -import { PerspectiveCamera } from './PerspectiveCamera.js'; diff --git a/jsdoc-testing/jsdoc/cameras/Camera.d.ts b/jsdoc-testing/jsdoc/cameras/Camera.d.ts deleted file mode 100644 index b24b6e34a..000000000 --- a/jsdoc-testing/jsdoc/cameras/Camera.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Abstract base class for cameras. This class should always be inherited - * when you build a new camera. - * - * @abstract - * @augments Object3D - */ -export class Camera extends Object3D { - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isCamera: boolean; - type: string; - /** - * The inverse of the camera's world matrix. - * - * @type {Matrix4} - */ - matrixWorldInverse: Matrix4; - /** - * The camera's projection matrix. - * - * @type {Matrix4} - */ - projectionMatrix: Matrix4; - /** - * The inverse of the camera's projection matrix. - * - * @type {Matrix4} - */ - projectionMatrixInverse: Matrix4; - /** - * The coordinate system in which the camera is used. - * - * @type {(WebGLCoordinateSystem|WebGPUCoordinateSystem)} - */ - coordinateSystem: (number | WebGPUCoordinateSystem); - _reversedDepth: boolean; - /** - * The flag that indicates whether the camera uses a reversed depth buffer. - * - * @type {boolean} - * @default false - */ - get reversedDepth(): boolean; - copy(source: any, recursive: any): this; - updateMatrixWorld(force: any): void; - updateWorldMatrix(updateParents: any, updateChildren: any): void; - clone(): any; -} -import { Object3D } from '../core/Object3D.js'; -import { Matrix4 } from '../math/Matrix4.js'; diff --git a/jsdoc-testing/jsdoc/cameras/CubeCamera.d.ts b/jsdoc-testing/jsdoc/cameras/CubeCamera.d.ts deleted file mode 100644 index 28a2ba9c1..000000000 --- a/jsdoc-testing/jsdoc/cameras/CubeCamera.d.ts +++ /dev/null @@ -1,74 +0,0 @@ -/** - * A special type of camera that is positioned in 3D space to render its surroundings into a - * cube render target. The render target can then be used as an environment map for rendering - * realtime reflections in your scene. - * - * ```js - * // Create cube render target - * const cubeRenderTarget = new THREE.WebGLCubeRenderTarget( 256, { generateMipmaps: true, minFilter: THREE.LinearMipmapLinearFilter } ); - * - * // Create cube camera - * const cubeCamera = new THREE.CubeCamera( 1, 100000, cubeRenderTarget ); - * scene.add( cubeCamera ); - * - * // Create car - * const chromeMaterial = new THREE.MeshLambertMaterial( { color: 0xffffff, envMap: cubeRenderTarget.texture } ); - * const car = new THREE.Mesh( carGeometry, chromeMaterial ); - * scene.add( car ); - * - * // Update the render target cube - * car.visible = false; - * cubeCamera.position.copy( car.position ); - * cubeCamera.update( renderer, scene ); - * - * // Render the scene - * car.visible = true; - * renderer.render( scene, camera ); - * ``` - * - * @augments Object3D - */ -export class CubeCamera extends Object3D { - /** - * Constructs a new cube camera. - * - * @param {number} near - The camera's near plane. - * @param {number} far - The camera's far plane. - * @param {WebGLCubeRenderTarget} renderTarget - The cube render target. - */ - constructor(near: number, far: number, renderTarget: WebGLCubeRenderTarget); - type: string; - /** - * A reference to the cube render target. - * - * @type {WebGLCubeRenderTarget} - */ - renderTarget: WebGLCubeRenderTarget; - /** - * The current active coordinate system. - * - * @type {?(WebGLCoordinateSystem|WebGPUCoordinateSystem)} - * @default null - */ - coordinateSystem: (number | number) | null; - /** - * The current active mipmap level - * - * @type {number} - * @default 0 - */ - activeMipmapLevel: number; - /** - * Must be called when the coordinate system of the cube camera is changed. - */ - updateCoordinateSystem(): void; - /** - * Calling this method will render the given scene with the given renderer - * into the cube render target of the camera. - * - * @param {(Renderer|WebGLRenderer)} renderer - The renderer. - * @param {Scene} scene - The scene to render. - */ - update(renderer: (Renderer | WebGLRenderer), scene: Scene): void; -} -import { Object3D } from '../core/Object3D.js'; diff --git a/jsdoc-testing/jsdoc/cameras/OrthographicCamera.d.ts b/jsdoc-testing/jsdoc/cameras/OrthographicCamera.d.ts deleted file mode 100644 index b6269a9b1..000000000 --- a/jsdoc-testing/jsdoc/cameras/OrthographicCamera.d.ts +++ /dev/null @@ -1,122 +0,0 @@ -/** - * Camera that uses [orthographic projection](https://en.wikipedia.org/wiki/Orthographic_projection). - * - * In this projection mode, an object's size in the rendered image stays - * constant regardless of its distance from the camera. This can be useful - * for rendering 2D scenes and UI elements, amongst other things. - * - * ```js - * const camera = new THREE.OrthographicCamera( width / - 2, width / 2, height / 2, height / - 2, 1, 1000 ); - * scene.add( camera ); - * ``` - * - * @augments Camera - */ -export class OrthographicCamera extends Camera { - /** - * Constructs a new orthographic camera. - * - * @param {number} [left=-1] - The left plane of the camera's frustum. - * @param {number} [right=1] - The right plane of the camera's frustum. - * @param {number} [top=1] - The top plane of the camera's frustum. - * @param {number} [bottom=-1] - The bottom plane of the camera's frustum. - * @param {number} [near=0.1] - The camera's near plane. - * @param {number} [far=2000] - The camera's far plane. - */ - constructor(left?: number, right?: number, top?: number, bottom?: number, near?: number, far?: number); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isOrthographicCamera: boolean; - /** - * The zoom factor of the camera. - * - * @type {number} - * @default 1 - */ - zoom: number; - /** - * Represents the frustum window specification. This property should not be edited - * directly but via {@link PerspectiveCamera#setViewOffset} and {@link PerspectiveCamera#clearViewOffset}. - * - * @type {?Object} - * @default null - */ - view: Object | null; - /** - * The left plane of the camera's frustum. - * - * @type {number} - * @default -1 - */ - left: number; - /** - * The right plane of the camera's frustum. - * - * @type {number} - * @default 1 - */ - right: number; - /** - * The top plane of the camera's frustum. - * - * @type {number} - * @default 1 - */ - top: number; - /** - * The bottom plane of the camera's frustum. - * - * @type {number} - * @default -1 - */ - bottom: number; - /** - * The camera's near plane. The valid range is greater than `0` - * and less than the current value of {@link OrthographicCamera#far}. - * - * Note that, unlike for the {@link PerspectiveCamera}, `0` is a - * valid value for an orthographic camera's near plane. - * - * @type {number} - * @default 0.1 - */ - near: number; - /** - * The camera's far plane. Must be greater than the - * current value of {@link OrthographicCamera#near}. - * - * @type {number} - * @default 2000 - */ - far: number; - copy(source: any, recursive: any): this; - /** - * Sets an offset in a larger frustum. This is useful for multi-window or - * multi-monitor/multi-machine setups. - * - * @param {number} fullWidth - The full width of multiview setup. - * @param {number} fullHeight - The full height of multiview setup. - * @param {number} x - The horizontal offset of the subcamera. - * @param {number} y - The vertical offset of the subcamera. - * @param {number} width - The width of subcamera. - * @param {number} height - The height of subcamera. - * @see {@link PerspectiveCamera#setViewOffset} - */ - setViewOffset(fullWidth: number, fullHeight: number, x: number, y: number, width: number, height: number): void; - /** - * Removes the view offset from the projection matrix. - */ - clearViewOffset(): void; - /** - * Updates the camera's projection matrix. Must be called after any change of - * camera properties. - */ - updateProjectionMatrix(): void; - toJSON(meta: any): Object; -} -import { Camera } from './Camera.js'; diff --git a/jsdoc-testing/jsdoc/cameras/PerspectiveCamera.d.ts b/jsdoc-testing/jsdoc/cameras/PerspectiveCamera.d.ts deleted file mode 100644 index 0bf274692..000000000 --- a/jsdoc-testing/jsdoc/cameras/PerspectiveCamera.d.ts +++ /dev/null @@ -1,216 +0,0 @@ -/** - * Camera that uses [perspective projection](https://en.wikipedia.org/wiki/Perspective_(graphical)). - * - * This projection mode is designed to mimic the way the human eye sees. It - * is the most common projection mode used for rendering a 3D scene. - * - * ```js - * const camera = new THREE.PerspectiveCamera( 45, width / height, 1, 1000 ); - * scene.add( camera ); - * ``` - * - * @augments Camera - */ -export class PerspectiveCamera extends Camera { - /** - * Constructs a new perspective camera. - * - * @param {number} [fov=50] - The vertical field of view. - * @param {number} [aspect=1] - The aspect ratio. - * @param {number} [near=0.1] - The camera's near plane. - * @param {number} [far=2000] - The camera's far plane. - */ - constructor(fov?: number, aspect?: number, near?: number, far?: number); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isPerspectiveCamera: boolean; - /** - * The vertical field of view, from bottom to top of view, - * in degrees. - * - * @type {number} - * @default 50 - */ - fov: number; - /** - * The zoom factor of the camera. - * - * @type {number} - * @default 1 - */ - zoom: number; - /** - * The camera's near plane. The valid range is greater than `0` - * and less than the current value of {@link PerspectiveCamera#far}. - * - * Note that, unlike for the {@link OrthographicCamera}, `0` is not a - * valid value for a perspective camera's near plane. - * - * @type {number} - * @default 0.1 - */ - near: number; - /** - * The camera's far plane. Must be greater than the - * current value of {@link PerspectiveCamera#near}. - * - * @type {number} - * @default 2000 - */ - far: number; - /** - * Object distance used for stereoscopy and depth-of-field effects. This - * parameter does not influence the projection matrix unless a - * {@link StereoCamera} is being used. - * - * @type {number} - * @default 10 - */ - focus: number; - /** - * The aspect ratio, usually the canvas width / canvas height. - * - * @type {number} - * @default 1 - */ - aspect: number; - /** - * Represents the frustum window specification. This property should not be edited - * directly but via {@link PerspectiveCamera#setViewOffset} and {@link PerspectiveCamera#clearViewOffset}. - * - * @type {?Object} - * @default null - */ - view: Object | null; - /** - * Film size used for the larger axis. Default is `35` (millimeters). This - * parameter does not influence the projection matrix unless {@link PerspectiveCamera#filmOffset} - * is set to a nonzero value. - * - * @type {number} - * @default 35 - */ - filmGauge: number; - /** - * Horizontal off-center offset in the same unit as {@link PerspectiveCamera#filmGauge}. - * - * @type {number} - * @default 0 - */ - filmOffset: number; - copy(source: any, recursive: any): this; - /** - * Sets the FOV by focal length in respect to the current {@link PerspectiveCamera#filmGauge}. - * - * The default film gauge is 35, so that the focal length can be specified for - * a 35mm (full frame) camera. - * - * @param {number} focalLength - Values for focal length and film gauge must have the same unit. - */ - setFocalLength(focalLength: number): void; - /** - * Returns the focal length from the current {@link PerspectiveCamera#fov} and - * {@link PerspectiveCamera#filmGauge}. - * - * @return {number} The computed focal length. - */ - getFocalLength(): number; - /** - * Returns the current vertical field of view angle in degrees considering {@link PerspectiveCamera#zoom}. - * - * @return {number} The effective FOV. - */ - getEffectiveFOV(): number; - /** - * Returns the width of the image on the film. If {@link PerspectiveCamera#aspect} is greater than or - * equal to one (landscape format), the result equals {@link PerspectiveCamera#filmGauge}. - * - * @return {number} The film width. - */ - getFilmWidth(): number; - /** - * Returns the height of the image on the film. If {@link PerspectiveCamera#aspect} is greater than or - * equal to one (landscape format), the result equals {@link PerspectiveCamera#filmGauge}. - * - * @return {number} The film width. - */ - getFilmHeight(): number; - /** - * Computes the 2D bounds of the camera's viewable rectangle at a given distance along the viewing direction. - * Sets `minTarget` and `maxTarget` to the coordinates of the lower-left and upper-right corners of the view rectangle. - * - * @param {number} distance - The viewing distance. - * @param {Vector2} minTarget - The lower-left corner of the view rectangle is written into this vector. - * @param {Vector2} maxTarget - The upper-right corner of the view rectangle is written into this vector. - */ - getViewBounds(distance: number, minTarget: Vector2, maxTarget: Vector2): void; - /** - * Computes the width and height of the camera's viewable rectangle at a given distance along the viewing direction. - * - * @param {number} distance - The viewing distance. - * @param {Vector2} target - The target vector that is used to store result where x is width and y is height. - * @returns {Vector2} The view size. - */ - getViewSize(distance: number, target: Vector2): Vector2; - /** - * Sets an offset in a larger frustum. This is useful for multi-window or - * multi-monitor/multi-machine setups. - * - * For example, if you have 3x2 monitors and each monitor is 1920x1080 and - * the monitors are in grid like this - *``` - * +---+---+---+ - * | A | B | C | - * +---+---+---+ - * | D | E | F | - * +---+---+---+ - *``` - * then for each monitor you would call it like this: - *```js - * const w = 1920; - * const h = 1080; - * const fullWidth = w * 3; - * const fullHeight = h * 2; - * - * // --A-- - * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 0, w, h ); - * // --B-- - * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 0, w, h ); - * // --C-- - * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 0, w, h ); - * // --D-- - * camera.setViewOffset( fullWidth, fullHeight, w * 0, h * 1, w, h ); - * // --E-- - * camera.setViewOffset( fullWidth, fullHeight, w * 1, h * 1, w, h ); - * // --F-- - * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h ); - * ``` - * - * Note there is no reason monitors have to be the same size or in a grid. - * - * @param {number} fullWidth - The full width of multiview setup. - * @param {number} fullHeight - The full height of multiview setup. - * @param {number} x - The horizontal offset of the subcamera. - * @param {number} y - The vertical offset of the subcamera. - * @param {number} width - The width of subcamera. - * @param {number} height - The height of subcamera. - */ - setViewOffset(fullWidth: number, fullHeight: number, x: number, y: number, width: number, height: number): void; - /** - * Removes the view offset from the projection matrix. - */ - clearViewOffset(): void; - /** - * Updates the camera's projection matrix. Must be called after any change of - * camera properties. - */ - updateProjectionMatrix(): void; - toJSON(meta: any): Object; -} -import { Camera } from './Camera.js'; -import { Vector2 } from '../math/Vector2.js'; diff --git a/jsdoc-testing/jsdoc/cameras/StereoCamera.d.ts b/jsdoc-testing/jsdoc/cameras/StereoCamera.d.ts deleted file mode 100644 index 929bf5258..000000000 --- a/jsdoc-testing/jsdoc/cameras/StereoCamera.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -/** - * A special type of camera that uses two perspective cameras with - * stereoscopic projection. Can be used for rendering stereo effects - * like [3D Anaglyph](https://en.wikipedia.org/wiki/Anaglyph_3D) or - * [Parallax Barrier](https://en.wikipedia.org/wiki/parallax_barrier). - */ -export class StereoCamera { - /** - * The type property is used for detecting the object type - * in context of serialization/deserialization. - * - * @type {string} - * @readonly - */ - readonly type: string; - /** - * The aspect. - * - * @type {number} - * @default 1 - */ - aspect: number; - /** - * The eye separation which represents the distance - * between the left and right camera. - * - * @type {number} - * @default 0.064 - */ - eyeSep: number; - /** - * The camera representing the left eye. This is added to layer `1` so objects to be - * rendered by the left camera must also be added to this layer. - * - * @type {PerspectiveCamera} - */ - cameraL: PerspectiveCamera; - /** - * The camera representing the right eye. This is added to layer `2` so objects to be - * rendered by the right camera must also be added to this layer. - * - * @type {PerspectiveCamera} - */ - cameraR: PerspectiveCamera; - _cache: { - focus: null; - fov: null; - aspect: null; - near: null; - far: null; - zoom: null; - eyeSep: null; - }; - /** - * Updates the stereo camera based on the given perspective camera. - * - * @param {PerspectiveCamera} camera - The perspective camera. - */ - update(camera: PerspectiveCamera): void; -} -import { PerspectiveCamera } from './PerspectiveCamera.js'; diff --git a/jsdoc-testing/jsdoc/constants.d.ts b/jsdoc-testing/jsdoc/constants.d.ts deleted file mode 100644 index 4d57958af..000000000 --- a/jsdoc-testing/jsdoc/constants.d.ts +++ /dev/null @@ -1,1592 +0,0 @@ -export const REVISION: "184dev"; -/** - * Represents mouse buttons and interaction types in context of controls. - * - * @type {ConstantsMouse} - * @constant - */ -export const MOUSE: ConstantsMouse; -/** - * Represents touch interaction types in context of controls. - * - * @type {ConstantsTouch} - * @constant - */ -export const TOUCH: ConstantsTouch; -/** - * Disables face culling. - * - * @type {number} - * @constant - */ -export const CullFaceNone: number; -/** - * Culls back faces. - * - * @type {number} - * @constant - */ -export const CullFaceBack: number; -/** - * Culls front faces. - * - * @type {number} - * @constant - */ -export const CullFaceFront: number; -/** - * Culls both front and back faces. - * - * @type {number} - * @constant - */ -export const CullFaceFrontBack: number; -/** - * Gives unfiltered shadow maps - fastest, but lowest quality. - * - * @type {number} - * @constant - */ -export const BasicShadowMap: number; -/** - * Filters shadow maps using the Percentage-Closer Filtering (PCF) algorithm. - * - * @type {number} - * @constant - */ -export const PCFShadowMap: number; -/** - * Filters shadow maps using the Percentage-Closer Filtering (PCF) algorithm with - * better soft shadows especially when using low-resolution shadow maps. - * - * @type {number} - * @constant - */ -export const PCFSoftShadowMap: number; -/** - * Filters shadow maps using the Variance Shadow Map (VSM) algorithm. - * When using VSMShadowMap all shadow receivers will also cast shadows. - * - * @type {number} - * @constant - */ -export const VSMShadowMap: number; -/** - * Only front faces are rendered. - * - * @type {number} - * @constant - */ -export const FrontSide: number; -/** - * Only back faces are rendered. - * - * @type {number} - * @constant - */ -export const BackSide: number; -/** - * Both front and back faces are rendered. - * - * @type {number} - * @constant - */ -export const DoubleSide: number; -/** - * No blending is performed which effectively disables - * alpha transparency. - * - * @type {number} - * @constant - */ -export const NoBlending: number; -/** - * The default blending. - * - * @type {number} - * @constant - */ -export const NormalBlending: number; -/** - * Represents additive blending. - * - * @type {number} - * @constant - */ -export const AdditiveBlending: number; -/** - * Represents subtractive blending. - * - * @type {number} - * @constant - */ -export const SubtractiveBlending: number; -/** - * Represents multiply blending. - * - * @type {number} - * @constant - */ -export const MultiplyBlending: number; -/** - * Represents custom blending. - * - * @type {number} - * @constant - */ -export const CustomBlending: number; -/** - * Represents material blending. - * - * @type {number} - * @constant - */ -export const MaterialBlending: number; -/** - * A `source + destination` blending equation. - * - * @type {number} - * @constant - */ -export const AddEquation: number; -/** - * A `source - destination` blending equation. - * - * @type {number} - * @constant - */ -export const SubtractEquation: number; -/** - * A `destination - source` blending equation. - * - * @type {number} - * @constant - */ -export const ReverseSubtractEquation: number; -/** - * A blend equation that uses the minimum of source and destination. - * - * @type {number} - * @constant - */ -export const MinEquation: number; -/** - * A blend equation that uses the maximum of source and destination. - * - * @type {number} - * @constant - */ -export const MaxEquation: number; -/** - * Multiplies all colors by `0`. - * - * @type {number} - * @constant - */ -export const ZeroFactor: number; -/** - * Multiplies all colors by `1`. - * - * @type {number} - * @constant - */ -export const OneFactor: number; -/** - * Multiplies all colors by the source colors. - * - * @type {number} - * @constant - */ -export const SrcColorFactor: number; -/** - * Multiplies all colors by `1` minus each source color. - * - * @type {number} - * @constant - */ -export const OneMinusSrcColorFactor: number; -/** - * Multiplies all colors by the source alpha value. - * - * @type {number} - * @constant - */ -export const SrcAlphaFactor: number; -/** - * Multiplies all colors by 1 minus the source alpha value. - * - * @type {number} - * @constant - */ -export const OneMinusSrcAlphaFactor: number; -/** - * Multiplies all colors by the destination alpha value. - * - * @type {number} - * @constant - */ -export const DstAlphaFactor: number; -/** - * Multiplies all colors by `1` minus the destination alpha value. - * - * @type {number} - * @constant - */ -export const OneMinusDstAlphaFactor: number; -/** - * Multiplies all colors by the destination color. - * - * @type {number} - * @constant - */ -export const DstColorFactor: number; -/** - * Multiplies all colors by `1` minus each destination color. - * - * @type {number} - * @constant - */ -export const OneMinusDstColorFactor: number; -/** - * Multiplies the RGB colors by the smaller of either the source alpha - * value or the value of `1` minus the destination alpha value. The alpha - * value is multiplied by `1`. - * - * @type {number} - * @constant - */ -export const SrcAlphaSaturateFactor: number; -/** - * Multiplies all colors by a constant color. - * - * @type {number} - * @constant - */ -export const ConstantColorFactor: number; -/** - * Multiplies all colors by `1` minus a constant color. - * - * @type {number} - * @constant - */ -export const OneMinusConstantColorFactor: number; -/** - * Multiplies all colors by a constant alpha value. - * - * @type {number} - * @constant - */ -export const ConstantAlphaFactor: number; -/** - * Multiplies all colors by 1 minus a constant alpha value. - * - * @type {number} - * @constant - */ -export const OneMinusConstantAlphaFactor: number; -/** - * Never pass. - * - * @type {number} - * @constant - */ -export const NeverDepth: number; -/** - * Always pass. - * - * @type {number} - * @constant - */ -export const AlwaysDepth: number; -/** - * Pass if the incoming value is less than the depth buffer value. - * - * @type {number} - * @constant - */ -export const LessDepth: number; -/** - * Pass if the incoming value is less than or equal to the depth buffer value. - * - * @type {number} - * @constant - */ -export const LessEqualDepth: number; -/** - * Pass if the incoming value equals the depth buffer value. - * - * @type {number} - * @constant - */ -export const EqualDepth: number; -/** - * Pass if the incoming value is greater than or equal to the depth buffer value. - * - * @type {number} - * @constant - */ -export const GreaterEqualDepth: number; -/** - * Pass if the incoming value is greater than the depth buffer value. - * - * @type {number} - * @constant - */ -export const GreaterDepth: number; -/** - * Pass if the incoming value is not equal to the depth buffer value. - * - * @type {number} - * @constant - */ -export const NotEqualDepth: number; -/** - * Multiplies the environment map color with the surface color. - * - * @type {number} - * @constant - */ -export const MultiplyOperation: number; -/** - * Uses reflectivity to blend between the two colors. - * - * @type {number} - * @constant - */ -export const MixOperation: number; -/** - * Adds the two colors. - * - * @type {number} - * @constant - */ -export const AddOperation: number; -/** - * No tone mapping is applied. - * - * @type {number} - * @constant - */ -export const NoToneMapping: number; -/** - * Linear tone mapping. - * - * @type {number} - * @constant - */ -export const LinearToneMapping: number; -/** - * Reinhard tone mapping. - * - * @type {number} - * @constant - */ -export const ReinhardToneMapping: number; -/** - * Cineon tone mapping. - * - * @type {number} - * @constant - */ -export const CineonToneMapping: number; -/** - * ACES Filmic tone mapping. - * - * @type {number} - * @constant - */ -export const ACESFilmicToneMapping: number; -/** - * Custom tone mapping. - * - * Expects a custom implementation by modifying shader code of the material's fragment shader. - * - * @type {number} - * @constant - */ -export const CustomToneMapping: number; -/** - * AgX tone mapping. - * - * @type {number} - * @constant - */ -export const AgXToneMapping: number; -/** - * Neutral tone mapping. - * - * Implementation based on the Khronos 3D Commerce Group standard tone mapping. - * - * @type {number} - * @constant - */ -export const NeutralToneMapping: number; -/** - * The skinned mesh shares the same world space as the skeleton. - * - * @type {string} - * @constant - */ -export const AttachedBindMode: string; -/** - * The skinned mesh does not share the same world space as the skeleton. - * This is useful when a skeleton is shared across multiple skinned meshes. - * - * @type {string} - * @constant - */ -export const DetachedBindMode: string; -/** - * Maps textures using the geometry's UV coordinates. - * - * @type {number} - * @constant - */ -export const UVMapping: number; -/** - * Reflection mapping for cube textures. - * - * @type {number} - * @constant - */ -export const CubeReflectionMapping: number; -/** - * Refraction mapping for cube textures. - * - * @type {number} - * @constant - */ -export const CubeRefractionMapping: number; -/** - * Reflection mapping for equirectangular textures. - * - * @type {number} - * @constant - */ -export const EquirectangularReflectionMapping: number; -/** - * Refraction mapping for equirectangular textures. - * - * @type {number} - * @constant - */ -export const EquirectangularRefractionMapping: number; -/** - * Reflection mapping for PMREM textures. - * - * @type {number} - * @constant - */ -export const CubeUVReflectionMapping: number; -/** - * The texture will simply repeat to infinity. - * - * @type {number} - * @constant - */ -export const RepeatWrapping: number; -/** - * The last pixel of the texture stretches to the edge of the mesh. - * - * @type {number} - * @constant - */ -export const ClampToEdgeWrapping: number; -/** - * The texture will repeats to infinity, mirroring on each repeat. - * - * @type {number} - * @constant - */ -export const MirroredRepeatWrapping: number; -/** - * Returns the value of the texture element that is nearest (in Manhattan distance) - * to the specified texture coordinates. - * - * @type {number} - * @constant - */ -export const NearestFilter: number; -/** - * Chooses the mipmap that most closely matches the size of the pixel being textured - * and uses the `NearestFilter` criterion (the texel nearest to the center of the pixel) - * to produce a texture value. - * - * @type {number} - * @constant - */ -export const NearestMipmapNearestFilter: number; -export const NearestMipMapNearestFilter: 1004; -/** - * Chooses the two mipmaps that most closely match the size of the pixel being textured and - * uses the `NearestFilter` criterion to produce a texture value from each mipmap. - * The final texture value is a weighted average of those two values. - * - * @type {number} - * @constant - */ -export const NearestMipmapLinearFilter: number; -export const NearestMipMapLinearFilter: 1005; -/** - * Returns the weighted average of the four texture elements that are closest to the specified - * texture coordinates, and can include items wrapped or repeated from other parts of a texture, - * depending on the values of `wrapS` and `wrapT`, and on the exact mapping. - * - * @type {number} - * @constant - */ -export const LinearFilter: number; -/** - * Chooses the mipmap that most closely matches the size of the pixel being textured and uses - * the `LinearFilter` criterion (a weighted average of the four texels that are closest to the - * center of the pixel) to produce a texture value. - * - * @type {number} - * @constant - */ -export const LinearMipmapNearestFilter: number; -export const LinearMipMapNearestFilter: 1007; -/** - * Chooses the two mipmaps that most closely match the size of the pixel being textured and uses - * the `LinearFilter` criterion to produce a texture value from each mipmap. The final texture value - * is a weighted average of those two values. - * - * @type {number} - * @constant - */ -export const LinearMipmapLinearFilter: number; -export const LinearMipMapLinearFilter: 1008; -/** - * An unsigned byte data type for textures. - * - * @type {number} - * @constant - */ -export const UnsignedByteType: number; -/** - * A byte data type for textures. - * - * @type {number} - * @constant - */ -export const ByteType: number; -/** - * A short data type for textures. - * - * @type {number} - * @constant - */ -export const ShortType: number; -/** - * An unsigned short data type for textures. - * - * @type {number} - * @constant - */ -export const UnsignedShortType: number; -/** - * An int data type for textures. - * - * @type {number} - * @constant - */ -export const IntType: number; -/** - * An unsigned int data type for textures. - * - * @type {number} - * @constant - */ -export const UnsignedIntType: number; -/** - * A float data type for textures. - * - * @type {number} - * @constant - */ -export const FloatType: number; -/** - * A half float data type for textures. - * - * @type {number} - * @constant - */ -export const HalfFloatType: number; -/** - * An unsigned short 4_4_4_4 (packed) data type for textures. - * - * @type {number} - * @constant - */ -export const UnsignedShort4444Type: number; -/** - * An unsigned short 5_5_5_1 (packed) data type for textures. - * - * @type {number} - * @constant - */ -export const UnsignedShort5551Type: number; -/** - * An unsigned int 24_8 data type for textures. - * - * @type {number} - * @constant - */ -export const UnsignedInt248Type: number; -/** - * An unsigned int 5_9_9_9 (packed) data type for textures. - * - * @type {number} - * @constant - */ -export const UnsignedInt5999Type: number; -/** - * An unsigned int 10_11_11 (packed) data type for textures. - * - * @type {number} - * @constant - */ -export const UnsignedInt101111Type: number; -/** - * Discards the red, green and blue components and reads just the alpha component. - * - * @type {number} - * @constant - */ -export const AlphaFormat: number; -/** - * Discards the alpha component and reads the red, green and blue component. - * - * @type {number} - * @constant - */ -export const RGBFormat: number; -/** - * Reads the red, green, blue and alpha components. - * - * @type {number} - * @constant - */ -export const RGBAFormat: number; -/** - * Reads each element as a single depth value, converts it to floating point, and clamps to the range `[0,1]`. - * - * @type {number} - * @constant - */ -export const DepthFormat: number; -/** - * Reads each element is a pair of depth and stencil values. The depth component of the pair is interpreted as - * in `DepthFormat`. The stencil component is interpreted based on the depth + stencil internal format. - * - * @type {number} - * @constant - */ -export const DepthStencilFormat: number; -/** - * Discards the green, blue and alpha components and reads just the red component. - * - * @type {number} - * @constant - */ -export const RedFormat: number; -/** - * Discards the green, blue and alpha components and reads just the red component. The texels are read as integers instead of floating point. - * - * @type {number} - * @constant - */ -export const RedIntegerFormat: number; -/** - * Discards the alpha, and blue components and reads the red, and green components. - * - * @type {number} - * @constant - */ -export const RGFormat: number; -/** - * Discards the alpha, and blue components and reads the red, and green components. The texels are read as integers instead of floating point. - * - * @type {number} - * @constant - */ -export const RGIntegerFormat: number; -/** - * Discards the alpha component and reads the red, green and blue component. The texels are read as integers instead of floating point. - * - * @type {number} - * @constant - */ -export const RGBIntegerFormat: number; -/** - * Reads the red, green, blue and alpha components. The texels are read as integers instead of floating point. - * - * @type {number} - * @constant - */ -export const RGBAIntegerFormat: number; -/** - * A DXT1-compressed image in an RGB image format. - * - * @type {number} - * @constant - */ -export const RGB_S3TC_DXT1_Format: number; -/** - * A DXT1-compressed image in an RGB image format with a simple on/off alpha value. - * - * @type {number} - * @constant - */ -export const RGBA_S3TC_DXT1_Format: number; -/** - * A DXT3-compressed image in an RGBA image format. Compared to a 32-bit RGBA texture, it offers 4:1 compression. - * - * @type {number} - * @constant - */ -export const RGBA_S3TC_DXT3_Format: number; -/** - * A DXT5-compressed image in an RGBA image format. It also provides a 4:1 compression, but differs to the DXT3 - * compression in how the alpha compression is done. - * - * @type {number} - * @constant - */ -export const RGBA_S3TC_DXT5_Format: number; -/** - * PVRTC RGB compression in 4-bit mode. One block for each 4×4 pixels. - * - * @type {number} - * @constant - */ -export const RGB_PVRTC_4BPPV1_Format: number; -/** - * PVRTC RGB compression in 2-bit mode. One block for each 8×4 pixels. - * - * @type {number} - * @constant - */ -export const RGB_PVRTC_2BPPV1_Format: number; -/** - * PVRTC RGBA compression in 4-bit mode. One block for each 4×4 pixels. - * - * @type {number} - * @constant - */ -export const RGBA_PVRTC_4BPPV1_Format: number; -/** - * PVRTC RGBA compression in 2-bit mode. One block for each 8×4 pixels. - * - * @type {number} - * @constant - */ -export const RGBA_PVRTC_2BPPV1_Format: number; -/** - * ETC1 RGB format. - * - * @type {number} - * @constant - */ -export const RGB_ETC1_Format: number; -/** - * ETC2 RGB format. - * - * @type {number} - * @constant - */ -export const RGB_ETC2_Format: number; -/** - * ETC2 RGBA format. - * - * @type {number} - * @constant - */ -export const RGBA_ETC2_EAC_Format: number; -/** - * EAC R11 UNORM format. - * - * @type {number} - * @constant - */ -export const R11_EAC_Format: number; -/** - * EAC R11 SNORM format. - * - * @type {number} - * @constant - */ -export const SIGNED_R11_EAC_Format: number; -/** - * EAC RG11 UNORM format. - * - * @type {number} - * @constant - */ -export const RG11_EAC_Format: number; -/** - * EAC RG11 SNORM format. - * - * @type {number} - * @constant - */ -export const SIGNED_RG11_EAC_Format: number; -/** - * ASTC RGBA 4x4 format. - * - * @type {number} - * @constant - */ -export const RGBA_ASTC_4x4_Format: number; -/** - * ASTC RGBA 5x4 format. - * - * @type {number} - * @constant - */ -export const RGBA_ASTC_5x4_Format: number; -/** - * ASTC RGBA 5x5 format. - * - * @type {number} - * @constant - */ -export const RGBA_ASTC_5x5_Format: number; -/** - * ASTC RGBA 6x5 format. - * - * @type {number} - * @constant - */ -export const RGBA_ASTC_6x5_Format: number; -/** - * ASTC RGBA 6x6 format. - * - * @type {number} - * @constant - */ -export const RGBA_ASTC_6x6_Format: number; -/** - * ASTC RGBA 8x5 format. - * - * @type {number} - * @constant - */ -export const RGBA_ASTC_8x5_Format: number; -/** - * ASTC RGBA 8x6 format. - * - * @type {number} - * @constant - */ -export const RGBA_ASTC_8x6_Format: number; -/** - * ASTC RGBA 8x8 format. - * - * @type {number} - * @constant - */ -export const RGBA_ASTC_8x8_Format: number; -/** - * ASTC RGBA 10x5 format. - * - * @type {number} - * @constant - */ -export const RGBA_ASTC_10x5_Format: number; -/** - * ASTC RGBA 10x6 format. - * - * @type {number} - * @constant - */ -export const RGBA_ASTC_10x6_Format: number; -/** - * ASTC RGBA 10x8 format. - * - * @type {number} - * @constant - */ -export const RGBA_ASTC_10x8_Format: number; -/** - * ASTC RGBA 10x10 format. - * - * @type {number} - * @constant - */ -export const RGBA_ASTC_10x10_Format: number; -/** - * ASTC RGBA 12x10 format. - * - * @type {number} - * @constant - */ -export const RGBA_ASTC_12x10_Format: number; -/** - * ASTC RGBA 12x12 format. - * - * @type {number} - * @constant - */ -export const RGBA_ASTC_12x12_Format: number; -/** - * BPTC RGBA format. - * - * @type {number} - * @constant - */ -export const RGBA_BPTC_Format: number; -/** - * BPTC Signed RGB format. - * - * @type {number} - * @constant - */ -export const RGB_BPTC_SIGNED_Format: number; -/** - * BPTC Unsigned RGB format. - * - * @type {number} - * @constant - */ -export const RGB_BPTC_UNSIGNED_Format: number; -/** - * RGTC1 Red format. - * - * @type {number} - * @constant - */ -export const RED_RGTC1_Format: number; -/** - * RGTC1 Signed Red format. - * - * @type {number} - * @constant - */ -export const SIGNED_RED_RGTC1_Format: number; -/** - * RGTC2 Red Green format. - * - * @type {number} - * @constant - */ -export const RED_GREEN_RGTC2_Format: number; -/** - * RGTC2 Signed Red Green format. - * - * @type {number} - * @constant - */ -export const SIGNED_RED_GREEN_RGTC2_Format: number; -/** - * Animations are played once. - * - * @type {number} - * @constant - */ -export const LoopOnce: number; -/** - * Animations are played with a chosen number of repetitions, each time jumping from - * the end of the clip directly to its beginning. - * - * @type {number} - * @constant - */ -export const LoopRepeat: number; -/** - * Animations are played with a chosen number of repetitions, alternately playing forward - * and backward. - * - * @type {number} - * @constant - */ -export const LoopPingPong: number; -/** - * Discrete interpolation mode for keyframe tracks. - * - * @type {number} - * @constant - */ -export const InterpolateDiscrete: number; -/** - * Linear interpolation mode for keyframe tracks. - * - * @type {number} - * @constant - */ -export const InterpolateLinear: number; -/** - * Smooth interpolation mode for keyframe tracks. - * - * @type {number} - * @constant - */ -export const InterpolateSmooth: number; -/** - * Bezier interpolation mode for keyframe tracks. - * - * Uses cubic Bezier curves with explicit 2D control points. - * Requires tangent data to be set on the track. - * - * @type {number} - * @constant - */ -export const InterpolateBezier: number; -/** - * Zero curvature ending for animations. - * - * @type {number} - * @constant - */ -export const ZeroCurvatureEnding: number; -/** - * Zero slope ending for animations. - * - * @type {number} - * @constant - */ -export const ZeroSlopeEnding: number; -/** - * Wrap around ending for animations. - * - * @type {number} - * @constant - */ -export const WrapAroundEnding: number; -/** - * Default animation blend mode. - * - * @type {number} - * @constant - */ -export const NormalAnimationBlendMode: number; -/** - * Additive animation blend mode. Can be used to layer motions on top of - * each other to build complex performances from smaller re-usable assets. - * - * @type {number} - * @constant - */ -export const AdditiveAnimationBlendMode: number; -/** - * For every three vertices draw a single triangle. - * - * @type {number} - * @constant - */ -export const TrianglesDrawMode: number; -/** - * For each vertex draw a triangle from the last three vertices. - * - * @type {number} - * @constant - */ -export const TriangleStripDrawMode: number; -/** - * For each vertex draw a triangle from the first vertex and the last two vertices. - * - * @type {number} - * @constant - */ -export const TriangleFanDrawMode: number; -/** - * The depth value is inverted (1.0 - z) for visualization purposes. - * - * @type {number} - * @constant - */ -export const BasicDepthPacking: number; -/** - * The depth value is packed into 32 bit RGBA. - * - * @type {number} - * @constant - */ -export const RGBADepthPacking: number; -/** - * The depth value is packed into 24 bit RGB. - * - * @type {number} - * @constant - */ -export const RGBDepthPacking: number; -/** - * The depth value is packed into 16 bit RG. - * - * @type {number} - * @constant - */ -export const RGDepthPacking: number; -/** - * Normal information is relative to the underlying surface. - * - * @type {number} - * @constant - */ -export const TangentSpaceNormalMap: number; -/** - * Normal information is relative to the object orientation. - * - * @type {number} - * @constant - */ -export const ObjectSpaceNormalMap: number; -/** - * No color space. - * - * @type {string} - * @constant - */ -export const NoColorSpace: string; -/** - * sRGB color space. - * - * @type {string} - * @constant - */ -export const SRGBColorSpace: string; -/** - * sRGB-linear color space. - * - * @type {string} - * @constant - */ -export const LinearSRGBColorSpace: string; -/** - * Linear transfer function. - * - * @type {string} - * @constant - */ -export const LinearTransfer: string; -/** - * sRGB transfer function. - * - * @type {string} - * @constant - */ -export const SRGBTransfer: string; -/** - * No normal map packing. - * - * @type {string} - * @constant - */ -export const NoNormalPacking: string; -/** - * Normal RG packing. - * - * @type {string} - * @constant - */ -export const NormalRGPacking: string; -/** - * Normal GA packing. - * - * @type {string} - * @constant - */ -export const NormalGAPacking: string; -/** - * Sets the stencil buffer value to `0`. - * - * @type {number} - * @constant - */ -export const ZeroStencilOp: number; -/** - * Keeps the current value. - * - * @type {number} - * @constant - */ -export const KeepStencilOp: number; -/** - * Sets the stencil buffer value to the specified reference value. - * - * @type {number} - * @constant - */ -export const ReplaceStencilOp: number; -/** - * Increments the current stencil buffer value. Clamps to the maximum representable unsigned value. - * - * @type {number} - * @constant - */ -export const IncrementStencilOp: number; -/** - * Decrements the current stencil buffer value. Clamps to `0`. - * - * @type {number} - * @constant - */ -export const DecrementStencilOp: number; -/** - * Increments the current stencil buffer value. Wraps stencil buffer value to zero when incrementing - * the maximum representable unsigned value. - * - * @type {number} - * @constant - */ -export const IncrementWrapStencilOp: number; -/** - * Decrements the current stencil buffer value. Wraps stencil buffer value to the maximum representable - * unsigned value when decrementing a stencil buffer value of `0`. - * - * @type {number} - * @constant - */ -export const DecrementWrapStencilOp: number; -/** - * Inverts the current stencil buffer value bitwise. - * - * @type {number} - * @constant - */ -export const InvertStencilOp: number; -/** - * Will never return true. - * - * @type {number} - * @constant - */ -export const NeverStencilFunc: number; -/** - * Will return true if the stencil reference value is less than the current stencil value. - * - * @type {number} - * @constant - */ -export const LessStencilFunc: number; -/** - * Will return true if the stencil reference value is equal to the current stencil value. - * - * @type {number} - * @constant - */ -export const EqualStencilFunc: number; -/** - * Will return true if the stencil reference value is less than or equal to the current stencil value. - * - * @type {number} - * @constant - */ -export const LessEqualStencilFunc: number; -/** - * Will return true if the stencil reference value is greater than the current stencil value. - * - * @type {number} - * @constant - */ -export const GreaterStencilFunc: number; -/** - * Will return true if the stencil reference value is not equal to the current stencil value. - * - * @type {number} - * @constant - */ -export const NotEqualStencilFunc: number; -/** - * Will return true if the stencil reference value is greater than or equal to the current stencil value. - * - * @type {number} - * @constant - */ -export const GreaterEqualStencilFunc: number; -/** - * Will always return true. - * - * @type {number} - * @constant - */ -export const AlwaysStencilFunc: number; -/** - * Never pass. - * - * @type {number} - * @constant - */ -export const NeverCompare: number; -/** - * Pass if the incoming value is less than the texture value. - * - * @type {number} - * @constant - */ -export const LessCompare: number; -/** - * Pass if the incoming value equals the texture value. - * - * @type {number} - * @constant - */ -export const EqualCompare: number; -/** - * Pass if the incoming value is less than or equal to the texture value. - * - * @type {number} - * @constant - */ -export const LessEqualCompare: number; -/** - * Pass if the incoming value is greater than the texture value. - * - * @type {number} - * @constant - */ -export const GreaterCompare: number; -/** - * Pass if the incoming value is not equal to the texture value. - * - * @type {number} - * @constant - */ -export const NotEqualCompare: number; -/** - * Pass if the incoming value is greater than or equal to the texture value. - * - * @type {number} - * @constant - */ -export const GreaterEqualCompare: number; -/** - * Always pass. - * - * @type {number} - * @constant - */ -export const AlwaysCompare: number; -/** - * The contents are intended to be specified once by the application, and used many - * times as the source for drawing and image specification commands. - * - * @type {number} - * @constant - */ -export const StaticDrawUsage: number; -/** - * The contents are intended to be respecified repeatedly by the application, and - * used many times as the source for drawing and image specification commands. - * - * @type {number} - * @constant - */ -export const DynamicDrawUsage: number; -/** - * The contents are intended to be specified once by the application, and used at most - * a few times as the source for drawing and image specification commands. - * - * @type {number} - * @constant - */ -export const StreamDrawUsage: number; -/** - * The contents are intended to be specified once by reading data from the 3D API, and queried - * many times by the application. - * - * @type {number} - * @constant - */ -export const StaticReadUsage: number; -/** - * The contents are intended to be respecified repeatedly by reading data from the 3D API, and queried - * many times by the application. - * - * @type {number} - * @constant - */ -export const DynamicReadUsage: number; -/** - * The contents are intended to be specified once by reading data from the 3D API, and queried at most - * a few times by the application - * - * @type {number} - * @constant - */ -export const StreamReadUsage: number; -/** - * The contents are intended to be specified once by reading data from the 3D API, and used many times as - * the source for WebGL drawing and image specification commands. - * - * @type {number} - * @constant - */ -export const StaticCopyUsage: number; -/** - * The contents are intended to be respecified repeatedly by reading data from the 3D API, and used many times - * as the source for WebGL drawing and image specification commands. - * - * @type {number} - * @constant - */ -export const DynamicCopyUsage: number; -/** - * The contents are intended to be specified once by reading data from the 3D API, and used at most a few times - * as the source for WebGL drawing and image specification commands. - * - * @type {number} - * @constant - */ -export const StreamCopyUsage: number; -/** - * GLSL 1 shader code. - * - * @type {string} - * @constant - */ -export const GLSL1: string; -/** - * GLSL 3 shader code. - * - * @type {string} - * @constant - */ -export const GLSL3: string; -/** - * WebGL coordinate system. - * - * @type {number} - * @constant - */ -export const WebGLCoordinateSystem: number; -/** - * WebGPU coordinate system. - * - * @type {number} - * @constant - */ -export const WebGPUCoordinateSystem: number; -/** - * Represents the different timestamp query types. - * - * @type {ConstantsTimestampQuery} - * @constant - */ -export const TimestampQuery: ConstantsTimestampQuery; -/** - * Represents mouse buttons and interaction types in context of controls. - * - * @type {ConstantsInterpolationSamplingType} - * @constant - */ -export const InterpolationSamplingType: ConstantsInterpolationSamplingType; -/** - * Represents the different interpolation sampling modes. - * - * @type {ConstantsInterpolationSamplingMode} - * @constant - */ -export const InterpolationSamplingMode: ConstantsInterpolationSamplingMode; -/** - * Compatibility flags for features that may not be supported across all platforms. - * - * @type {Object} - * @constant - */ -export const Compatibility: Object; -/** - * This type represents mouse buttons and interaction types in context of controls. - */ -export type ConstantsMouse = { - /** - * - The left mouse button. - */ - MIDDLE: number; - /** - * - The middle mouse button. - */ - LEFT: number; - /** - * - The right mouse button. - */ - RIGHT: number; - /** - * - A rotate interaction. - */ - ROTATE: number; - /** - * - A dolly interaction. - */ - DOLLY: number; - /** - * - A pan interaction. - */ - PAN: number; -}; -/** - * This type represents touch interaction types in context of controls. - */ -export type ConstantsTouch = { - /** - * - A rotate interaction. - */ - ROTATE: number; - /** - * - A pan interaction. - */ - PAN: number; - /** - * - The dolly-pan interaction. - */ - DOLLY_PAN: number; - /** - * - A dolly-rotate interaction. - */ - DOLLY_ROTATE: number; -}; -/** - * This type represents the different timestamp query types. - */ -export type ConstantsTimestampQuery = { - /** - * - A `compute` timestamp query. - */ - COMPUTE: string; - /** - * - A `render` timestamp query. - */ - RENDER: string; -}; -/** - * Represents the different interpolation sampling types. - */ -export type ConstantsInterpolationSamplingType = { - /** - * - Perspective-correct interpolation. - */ - PERSPECTIVE: string; - /** - * - Linear interpolation. - */ - LINEAR: string; - /** - * - Flat interpolation. - */ - FLAT: string; -}; -/** - * Represents the different interpolation sampling modes. - */ -export type ConstantsInterpolationSamplingMode = { - /** - * - Normal sampling mode. - */ - NORMAL: string; - /** - * - Centroid sampling mode. - */ - CENTROID: string; - /** - * - Sample-specific sampling mode. - */ - SAMPLE: string; - /** - * - Flat interpolation using the first vertex. - */ - FIRST: string; - /** - * - Flat interpolation using either vertex. - */ - EITHER: string; -}; diff --git a/jsdoc-testing/jsdoc/core/BufferAttribute.d.ts b/jsdoc-testing/jsdoc/core/BufferAttribute.d.ts deleted file mode 100644 index c2ca498b3..000000000 --- a/jsdoc-testing/jsdoc/core/BufferAttribute.d.ts +++ /dev/null @@ -1,482 +0,0 @@ -/** - * Convenient class that can be used when creating a `Float32` buffer attribute with - * a plain `Array` instance. - * - * @augments BufferAttribute - */ -export class Float32BufferAttribute extends BufferAttribute { - /** - * Constructs a new buffer attribute. - * - * @param {(Array|Float32Array)} array - The array holding the attribute data. - * @param {number} itemSize - The item size. - * @param {boolean} [normalized=false] - Whether the data are normalized or not. - */ - constructor(array: (Array | Float32Array), itemSize: number, normalized?: boolean); -} -/** - * Convenient class that can be used when creating a `Float16` buffer attribute with - * a plain `Array` instance. - * - * This class automatically converts to and from FP16 via `Uint16Array` since `Float16Array` - * browser support is still problematic. - * - * @augments BufferAttribute - */ -export class Float16BufferAttribute extends BufferAttribute { - /** - * Constructs a new buffer attribute. - * - * @param {(Array|Uint16Array)} array - The array holding the attribute data. - * @param {number} itemSize - The item size. - * @param {boolean} [normalized=false] - Whether the data are normalized or not. - */ - constructor(array: (Array | Uint16Array), itemSize: number, normalized?: boolean); - isFloat16BufferAttribute: boolean; - getX(index: any): number; - setX(index: any, x: any): this; - getY(index: any): number; - setY(index: any, y: any): this; - getZ(index: any): number; - setZ(index: any, z: any): this; - getW(index: any): number; - setW(index: any, w: any): this; - setXY(index: any, x: any, y: any): this; - setXYZ(index: any, x: any, y: any, z: any): this; - setXYZW(index: any, x: any, y: any, z: any, w: any): this; -} -/** - * Convenient class that can be used when creating a `UInt32` buffer attribute with - * a plain `Array` instance. - * - * @augments BufferAttribute - */ -export class Uint32BufferAttribute extends BufferAttribute { - /** - * Constructs a new buffer attribute. - * - * @param {(Array|Uint32Array)} array - The array holding the attribute data. - * @param {number} itemSize - The item size. - * @param {boolean} [normalized=false] - Whether the data are normalized or not. - */ - constructor(array: (Array | Uint32Array), itemSize: number, normalized?: boolean); -} -/** - * Convenient class that can be used when creating a `Int32` buffer attribute with - * a plain `Array` instance. - * - * @augments BufferAttribute - */ -export class Int32BufferAttribute extends BufferAttribute { - /** - * Constructs a new buffer attribute. - * - * @param {(Array|Int32Array)} array - The array holding the attribute data. - * @param {number} itemSize - The item size. - * @param {boolean} [normalized=false] - Whether the data are normalized or not. - */ - constructor(array: (Array | Int32Array), itemSize: number, normalized?: boolean); -} -/** - * Convenient class that can be used when creating a `UInt16` buffer attribute with - * a plain `Array` instance. - * - * @augments BufferAttribute - */ -export class Uint16BufferAttribute extends BufferAttribute { - /** - * Constructs a new buffer attribute. - * - * @param {(Array|Uint16Array)} array - The array holding the attribute data. - * @param {number} itemSize - The item size. - * @param {boolean} [normalized=false] - Whether the data are normalized or not. - */ - constructor(array: (Array | Uint16Array), itemSize: number, normalized?: boolean); -} -/** - * Convenient class that can be used when creating a `Int16` buffer attribute with - * a plain `Array` instance. - * - * @augments BufferAttribute - */ -export class Int16BufferAttribute extends BufferAttribute { - /** - * Constructs a new buffer attribute. - * - * @param {(Array|Int16Array)} array - The array holding the attribute data. - * @param {number} itemSize - The item size. - * @param {boolean} [normalized=false] - Whether the data are normalized or not. - */ - constructor(array: (Array | Int16Array), itemSize: number, normalized?: boolean); -} -/** - * Convenient class that can be used when creating a `UInt8Clamped` buffer attribute with - * a plain `Array` instance. - * - * @augments BufferAttribute - */ -export class Uint8ClampedBufferAttribute extends BufferAttribute { - /** - * Constructs a new buffer attribute. - * - * @param {(Array|Uint8ClampedArray)} array - The array holding the attribute data. - * @param {number} itemSize - The item size. - * @param {boolean} [normalized=false] - Whether the data are normalized or not. - */ - constructor(array: (Array | Uint8ClampedArray), itemSize: number, normalized?: boolean); -} -/** - * Convenient class that can be used when creating a `UInt8` buffer attribute with - * a plain `Array` instance. - * - * @augments BufferAttribute - */ -export class Uint8BufferAttribute extends BufferAttribute { - /** - * Constructs a new buffer attribute. - * - * @param {(Array|Uint8Array)} array - The array holding the attribute data. - * @param {number} itemSize - The item size. - * @param {boolean} [normalized=false] - Whether the data are normalized or not. - */ - constructor(array: (Array | Uint8Array), itemSize: number, normalized?: boolean); -} -/** - * Convenient class that can be used when creating a `Int8` buffer attribute with - * a plain `Array` instance. - * - * @augments BufferAttribute - */ -export class Int8BufferAttribute extends BufferAttribute { - /** - * Constructs a new buffer attribute. - * - * @param {(Array|Int8Array)} array - The array holding the attribute data. - * @param {number} itemSize - The item size. - * @param {boolean} [normalized=false] - Whether the data are normalized or not. - */ - constructor(array: (Array | Int8Array), itemSize: number, normalized?: boolean); -} -/** - * This class stores data for an attribute (such as vertex positions, face - * indices, normals, colors, UVs, and any custom attributes ) associated with - * a geometry, which allows for more efficient passing of data to the GPU. - * - * When working with vector-like data, the `fromBufferAttribute( attribute, index )` - * helper methods on vector and color class might be helpful. E.g. {@link Vector3#fromBufferAttribute}. - */ -export class BufferAttribute { - /** - * Constructs a new buffer attribute. - * - * @param {TypedArray} array - The array holding the attribute data. - * @param {number} itemSize - The item size. - * @param {boolean} [normalized=false] - Whether the data are normalized or not. - */ - constructor(array: TypedArray, itemSize: number, normalized?: boolean); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isBufferAttribute: boolean; - /** - * The name of the buffer attribute. - * - * @type {string} - */ - name: string; - /** - * The array holding the attribute data. It should have `itemSize * numVertices` - * elements, where `numVertices` is the number of vertices in the associated geometry. - * - * @type {TypedArray} - */ - array: TypedArray; - /** - * The number of values of the array that should be associated with a particular vertex. - * For instance, if this attribute is storing a 3-component vector (such as a position, - * normal, or color), then the value should be `3`. - * - * @type {number} - */ - itemSize: number; - /** - * Represents the number of items this buffer attribute stores. It is internally computed - * by dividing the `array` length by the `itemSize`. - * - * @type {number} - * @readonly - */ - readonly count: number; - /** - * Applies to integer data only. Indicates how the underlying data in the buffer maps to - * the values in the GLSL code. For instance, if `array` is an instance of `UInt16Array`, - * and `normalized` is `true`, the values `0 - +65535` in the array data will be mapped to - * `0.0f - +1.0f` in the GLSL attribute. If `normalized` is `false`, the values will be converted - * to floats unmodified, i.e. `65535` becomes `65535.0f`. - * - * @type {boolean} - */ - normalized: boolean; - /** - * Defines the intended usage pattern of the data store for optimization purposes. - * - * Note: After the initial use of a buffer, its usage cannot be changed. Instead, - * instantiate a new one and set the desired usage before the next render. - * - * @type {(StaticDrawUsage|DynamicDrawUsage|StreamDrawUsage|StaticReadUsage|DynamicReadUsage|StreamReadUsage|StaticCopyUsage|DynamicCopyUsage|StreamCopyUsage)} - * @default StaticDrawUsage - */ - usage: (number | DynamicDrawUsage | StreamDrawUsage | StaticReadUsage | DynamicReadUsage | StreamReadUsage | StaticCopyUsage | DynamicCopyUsage | StreamCopyUsage); - /** - * This can be used to only update some components of stored vectors (for example, just the - * component related to color). Use the `addUpdateRange()` function to add ranges to this array. - * - * @type {Array} - */ - updateRanges: Array; - /** - * Configures the bound GPU type for use in shaders. - * - * Note: this only has an effect for integer arrays and is not configurable for float arrays. - * For lower precision float types, use `Float16BufferAttribute`. - * - * @type {(FloatType|IntType)} - * @default FloatType - */ - gpuType: (number | IntType); - /** - * A version number, incremented every time the `needsUpdate` is set to `true`. - * - * @type {number} - */ - version: number; - /** - * A callback function that is executed after the renderer has transferred the attribute - * array data to the GPU. - */ - onUploadCallback(): void; - /** - * Flag to indicate that this attribute has changed and should be re-sent to - * the GPU. Set this to `true` when you modify the value of the array. - * - * @type {number} - * @default false - * @param {boolean} value - */ - set needsUpdate(value: boolean); - /** - * Sets the usage of this buffer attribute. - * - * @param {(StaticDrawUsage|DynamicDrawUsage|StreamDrawUsage|StaticReadUsage|DynamicReadUsage|StreamReadUsage|StaticCopyUsage|DynamicCopyUsage|StreamCopyUsage)} value - The usage to set. - * @return {BufferAttribute} A reference to this buffer attribute. - */ - setUsage(value: (number | DynamicDrawUsage | StreamDrawUsage | StaticReadUsage | DynamicReadUsage | StreamReadUsage | StaticCopyUsage | DynamicCopyUsage | StreamCopyUsage)): BufferAttribute; - /** - * Adds a range of data in the data array to be updated on the GPU. - * - * @param {number} start - Position at which to start update. - * @param {number} count - The number of components to update. - */ - addUpdateRange(start: number, count: number): void; - /** - * Clears the update ranges. - */ - clearUpdateRanges(): void; - /** - * Copies the values of the given buffer attribute to this instance. - * - * @param {BufferAttribute} source - The buffer attribute to copy. - * @return {BufferAttribute} A reference to this instance. - */ - copy(source: BufferAttribute): BufferAttribute; - /** - * Copies a vector from the given buffer attribute to this one. The start - * and destination position in the attribute buffers are represented by the - * given indices. - * - * @param {number} index1 - The destination index into this buffer attribute. - * @param {BufferAttribute} attribute - The buffer attribute to copy from. - * @param {number} index2 - The source index into the given buffer attribute. - * @return {BufferAttribute} A reference to this instance. - */ - copyAt(index1: number, attribute: BufferAttribute, index2: number): BufferAttribute; - /** - * Copies the given array data into this buffer attribute. - * - * @param {(TypedArray|Array)} array - The array to copy. - * @return {BufferAttribute} A reference to this instance. - */ - copyArray(array: (TypedArray | any[])): BufferAttribute; - /** - * Applies the given 3x3 matrix to the given attribute. Works with - * item size `2` and `3`. - * - * @param {Matrix3} m - The matrix to apply. - * @return {BufferAttribute} A reference to this instance. - */ - applyMatrix3(m: Matrix3): BufferAttribute; - /** - * Applies the given 4x4 matrix to the given attribute. Only works with - * item size `3`. - * - * @param {Matrix4} m - The matrix to apply. - * @return {BufferAttribute} A reference to this instance. - */ - applyMatrix4(m: Matrix4): BufferAttribute; - /** - * Applies the given 3x3 normal matrix to the given attribute. Only works with - * item size `3`. - * - * @param {Matrix3} m - The normal matrix to apply. - * @return {BufferAttribute} A reference to this instance. - */ - applyNormalMatrix(m: Matrix3): BufferAttribute; - /** - * Applies the given 4x4 matrix to the given attribute. Only works with - * item size `3` and with direction vectors. - * - * @param {Matrix4} m - The matrix to apply. - * @return {BufferAttribute} A reference to this instance. - */ - transformDirection(m: Matrix4): BufferAttribute; - /** - * Sets the given array data in the buffer attribute. - * - * @param {(TypedArray|Array)} value - The array data to set. - * @param {number} [offset=0] - The offset in this buffer attribute's array. - * @return {BufferAttribute} A reference to this instance. - */ - set(value: (TypedArray | any[]), offset?: number): BufferAttribute; - /** - * Returns the given component of the vector at the given index. - * - * @param {number} index - The index into the buffer attribute. - * @param {number} component - The component index. - * @return {number} The returned value. - */ - getComponent(index: number, component: number): number; - /** - * Sets the given value to the given component of the vector at the given index. - * - * @param {number} index - The index into the buffer attribute. - * @param {number} component - The component index. - * @param {number} value - The value to set. - * @return {BufferAttribute} A reference to this instance. - */ - setComponent(index: number, component: number, value: number): BufferAttribute; - /** - * Returns the x component of the vector at the given index. - * - * @param {number} index - The index into the buffer attribute. - * @return {number} The x component. - */ - getX(index: number): number; - /** - * Sets the x component of the vector at the given index. - * - * @param {number} index - The index into the buffer attribute. - * @param {number} x - The value to set. - * @return {BufferAttribute} A reference to this instance. - */ - setX(index: number, x: number): BufferAttribute; - /** - * Returns the y component of the vector at the given index. - * - * @param {number} index - The index into the buffer attribute. - * @return {number} The y component. - */ - getY(index: number): number; - /** - * Sets the y component of the vector at the given index. - * - * @param {number} index - The index into the buffer attribute. - * @param {number} y - The value to set. - * @return {BufferAttribute} A reference to this instance. - */ - setY(index: number, y: number): BufferAttribute; - /** - * Returns the z component of the vector at the given index. - * - * @param {number} index - The index into the buffer attribute. - * @return {number} The z component. - */ - getZ(index: number): number; - /** - * Sets the z component of the vector at the given index. - * - * @param {number} index - The index into the buffer attribute. - * @param {number} z - The value to set. - * @return {BufferAttribute} A reference to this instance. - */ - setZ(index: number, z: number): BufferAttribute; - /** - * Returns the w component of the vector at the given index. - * - * @param {number} index - The index into the buffer attribute. - * @return {number} The w component. - */ - getW(index: number): number; - /** - * Sets the w component of the vector at the given index. - * - * @param {number} index - The index into the buffer attribute. - * @param {number} w - The value to set. - * @return {BufferAttribute} A reference to this instance. - */ - setW(index: number, w: number): BufferAttribute; - /** - * Sets the x and y component of the vector at the given index. - * - * @param {number} index - The index into the buffer attribute. - * @param {number} x - The value for the x component to set. - * @param {number} y - The value for the y component to set. - * @return {BufferAttribute} A reference to this instance. - */ - setXY(index: number, x: number, y: number): BufferAttribute; - /** - * Sets the x, y and z component of the vector at the given index. - * - * @param {number} index - The index into the buffer attribute. - * @param {number} x - The value for the x component to set. - * @param {number} y - The value for the y component to set. - * @param {number} z - The value for the z component to set. - * @return {BufferAttribute} A reference to this instance. - */ - setXYZ(index: number, x: number, y: number, z: number): BufferAttribute; - /** - * Sets the x, y, z and w component of the vector at the given index. - * - * @param {number} index - The index into the buffer attribute. - * @param {number} x - The value for the x component to set. - * @param {number} y - The value for the y component to set. - * @param {number} z - The value for the z component to set. - * @param {number} w - The value for the w component to set. - * @return {BufferAttribute} A reference to this instance. - */ - setXYZW(index: number, x: number, y: number, z: number, w: number): BufferAttribute; - /** - * Sets the given callback function that is executed after the Renderer has transferred - * the attribute array data to the GPU. Can be used to perform clean-up operations after - * the upload when attribute data are not needed anymore on the CPU side. - * - * @param {Function} callback - The `onUpload()` callback. - * @return {BufferAttribute} A reference to this instance. - */ - onUpload(callback: Function): BufferAttribute; - /** - * Returns a new buffer attribute with copied values from this instance. - * - * @return {BufferAttribute} A clone of this instance. - */ - clone(): BufferAttribute; - /** - * Serializes the buffer attribute into JSON. - * - * @return {Object} A JSON object representing the serialized buffer attribute. - */ - toJSON(): Object; -} diff --git a/jsdoc-testing/jsdoc/core/BufferGeometry.d.ts b/jsdoc-testing/jsdoc/core/BufferGeometry.d.ts deleted file mode 100644 index 82a3230ad..000000000 --- a/jsdoc-testing/jsdoc/core/BufferGeometry.d.ts +++ /dev/null @@ -1,391 +0,0 @@ -/** - * A representation of mesh, line, or point geometry. Includes vertex - * positions, face indices, normals, colors, UVs, and custom attributes - * within buffers, reducing the cost of passing all this data to the GPU. - * - * ```js - * const geometry = new THREE.BufferGeometry(); - * // create a simple square shape. We duplicate the top left and bottom right - * // vertices because each vertex needs to appear once per triangle. - * const vertices = new Float32Array( [ - * -1.0, -1.0, 1.0, // v0 - * 1.0, -1.0, 1.0, // v1 - * 1.0, 1.0, 1.0, // v2 - * - * 1.0, 1.0, 1.0, // v3 - * -1.0, 1.0, 1.0, // v4 - * -1.0, -1.0, 1.0 // v5 - * ] ); - * // itemSize = 3 because there are 3 values (components) per vertex - * geometry.setAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) ); - * const material = new THREE.MeshBasicMaterial( { color: 0xff0000 } ); - * const mesh = new THREE.Mesh( geometry, material ); - * ``` - * - * @augments EventDispatcher - */ -export class BufferGeometry extends EventDispatcher { - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isBufferGeometry: boolean; - /** - * The UUID of the geometry. - * - * @type {string} - * @readonly - */ - readonly uuid: string; - /** - * The name of the geometry. - * - * @type {string} - */ - name: string; - type: string; - /** - * Allows for vertices to be re-used across multiple triangles; this is - * called using "indexed triangles". Each triangle is associated with the - * indices of three vertices. This attribute therefore stores the index of - * each vertex for each triangular face. If this attribute is not set, the - * renderer assumes that each three contiguous positions represent a single triangle. - * - * @type {?BufferAttribute} - * @default null - */ - index: BufferAttribute | null; - /** - * A (storage) buffer attribute which was generated with a compute shader and - * now defines indirect draw calls. - * - * Can only be used with {@link WebGPURenderer} and a WebGPU backend. - * - * @type {?BufferAttribute} - * @default null - */ - indirect: BufferAttribute | null; - /** - * The offset, in bytes, into the indirect drawing buffer where the value data begins. If an array is provided, multiple indirect draw calls will be made for each offset. - * - * Can only be used with {@link WebGPURenderer} and a WebGPU backend. - * - * @type {number|Array} - * @default 0 - */ - indirectOffset: number | Array; - /** - * This dictionary has as id the name of the attribute to be set and as value - * the buffer attribute to set it to. Rather than accessing this property directly, - * use `setAttribute()` and `getAttribute()` to access attributes of this geometry. - * - * @type {Object} - */ - attributes: { - [x: string]: any; - }; - /** - * This dictionary holds the morph targets of the geometry. - * - * Note: Once the geometry has been rendered, the morph attribute data cannot - * be changed. You will have to call `dispose()`, and create a new geometry instance. - * - * @type {Object} - */ - morphAttributes: Object; - /** - * Used to control the morph target behavior; when set to `true`, the morph - * target data is treated as relative offsets, rather than as absolute - * positions/normals. - * - * @type {boolean} - * @default false - */ - morphTargetsRelative: boolean; - /** - * Split the geometry into groups, each of which will be rendered in a - * separate draw call. This allows an array of materials to be used with the geometry. - * - * Use `addGroup()` and `clearGroups()` to edit groups, rather than modifying this array directly. - * - * Every vertex and index must belong to exactly one group — groups must not share vertices or - * indices, and must not leave vertices or indices unused. - * - * @type {Array} - */ - groups: Array; - /** - * Bounding box for the geometry which can be calculated with `computeBoundingBox()`. - * - * @type {?Box3} - * @default null - */ - boundingBox: Box3 | null; - /** - * Bounding sphere for the geometry which can be calculated with `computeBoundingSphere()`. - * - * @type {?Sphere} - * @default null - */ - boundingSphere: Sphere | null; - /** - * Determines the part of the geometry to render. This should not be set directly, - * instead use `setDrawRange()`. - * - * @type {{start:number,count:number}} - */ - drawRange: { - start: number; - count: number; - }; - /** - * An object that can be used to store custom data about the geometry. - * It should not hold references to functions as these will not be cloned. - * - * @type {Object} - */ - userData: Object; - /** - * Returns the index of this geometry. - * - * @return {?BufferAttribute} The index. Returns `null` if no index is defined. - */ - getIndex(): BufferAttribute | null; - /** - * Sets the given index to this geometry. - * - * @param {Array|BufferAttribute} index - The index to set. - * @return {BufferGeometry} A reference to this instance. - */ - setIndex(index: Array | BufferAttribute): BufferGeometry; - /** - * Sets the given indirect attribute to this geometry. - * - * @param {BufferAttribute} indirect - The attribute holding indirect draw calls. - * @param {number|Array} [indirectOffset=0] - The offset, in bytes, into the indirect drawing buffer where the value data begins. If an array is provided, multiple indirect draw calls will be made for each offset. - * @return {BufferGeometry} A reference to this instance. - */ - setIndirect(indirect: BufferAttribute, indirectOffset?: number | Array): BufferGeometry; - /** - * Returns the indirect attribute of this geometry. - * - * @return {?BufferAttribute} The indirect attribute. Returns `null` if no indirect attribute is defined. - */ - getIndirect(): BufferAttribute | null; - /** - * Returns the buffer attribute for the given name. - * - * @param {string} name - The attribute name. - * @return {BufferAttribute|InterleavedBufferAttribute|undefined} The buffer attribute. - * Returns `undefined` if not attribute has been found. - */ - getAttribute(name: string): BufferAttribute | InterleavedBufferAttribute | undefined; - /** - * Sets the given attribute for the given name. - * - * @param {string} name - The attribute name. - * @param {BufferAttribute|InterleavedBufferAttribute} attribute - The attribute to set. - * @return {BufferGeometry} A reference to this instance. - */ - setAttribute(name: string, attribute: BufferAttribute | InterleavedBufferAttribute): BufferGeometry; - /** - * Deletes the attribute for the given name. - * - * @param {string} name - The attribute name to delete. - * @return {BufferGeometry} A reference to this instance. - */ - deleteAttribute(name: string): BufferGeometry; - /** - * Returns `true` if this geometry has an attribute for the given name. - * - * @param {string} name - The attribute name. - * @return {boolean} Whether this geometry has an attribute for the given name or not. - */ - hasAttribute(name: string): boolean; - /** - * Adds a group to this geometry. - * - * @param {number} start - The first element in this draw call. That is the first - * vertex for non-indexed geometry, otherwise the first triangle index. - * @param {number} count - Specifies how many vertices (or indices) are part of this group. - * @param {number} [materialIndex=0] - The material array index to use. - */ - addGroup(start: number, count: number, materialIndex?: number): void; - /** - * Clears all groups. - */ - clearGroups(): void; - /** - * Sets the draw range for this geometry. - * - * @param {number} start - The first vertex for non-indexed geometry, otherwise the first triangle index. - * @param {number} count - For non-indexed BufferGeometry, `count` is the number of vertices to render. - * For indexed BufferGeometry, `count` is the number of indices to render. - */ - setDrawRange(start: number, count: number): void; - /** - * Applies the given 4x4 transformation matrix to the geometry. - * - * @param {Matrix4} matrix - The matrix to apply. - * @return {BufferGeometry} A reference to this instance. - */ - applyMatrix4(matrix: Matrix4): BufferGeometry; - /** - * Applies the rotation represented by the Quaternion to the geometry. - * - * @param {Quaternion} q - The Quaternion to apply. - * @return {BufferGeometry} A reference to this instance. - */ - applyQuaternion(q: Quaternion): BufferGeometry; - /** - * Rotates the geometry about the X axis. This is typically done as a one time - * operation, and not during a loop. Use {@link Object3D#rotation} for typical - * real-time mesh rotation. - * - * @param {number} angle - The angle in radians. - * @return {BufferGeometry} A reference to this instance. - */ - rotateX(angle: number): BufferGeometry; - /** - * Rotates the geometry about the Y axis. This is typically done as a one time - * operation, and not during a loop. Use {@link Object3D#rotation} for typical - * real-time mesh rotation. - * - * @param {number} angle - The angle in radians. - * @return {BufferGeometry} A reference to this instance. - */ - rotateY(angle: number): BufferGeometry; - /** - * Rotates the geometry about the Z axis. This is typically done as a one time - * operation, and not during a loop. Use {@link Object3D#rotation} for typical - * real-time mesh rotation. - * - * @param {number} angle - The angle in radians. - * @return {BufferGeometry} A reference to this instance. - */ - rotateZ(angle: number): BufferGeometry; - /** - * Translates the geometry. This is typically done as a one time - * operation, and not during a loop. Use {@link Object3D#position} for typical - * real-time mesh rotation. - * - * @param {number} x - The x offset. - * @param {number} y - The y offset. - * @param {number} z - The z offset. - * @return {BufferGeometry} A reference to this instance. - */ - translate(x: number, y: number, z: number): BufferGeometry; - /** - * Scales the geometry. This is typically done as a one time - * operation, and not during a loop. Use {@link Object3D#scale} for typical - * real-time mesh rotation. - * - * @param {number} x - The x scale. - * @param {number} y - The y scale. - * @param {number} z - The z scale. - * @return {BufferGeometry} A reference to this instance. - */ - scale(x: number, y: number, z: number): BufferGeometry; - /** - * Rotates the geometry to face a point in 3D space. This is typically done as a one time - * operation, and not during a loop. Use {@link Object3D#lookAt} for typical - * real-time mesh rotation. - * - * @param {Vector3} vector - The target point. - * @return {BufferGeometry} A reference to this instance. - */ - lookAt(vector: Vector3): BufferGeometry; - /** - * Center the geometry based on its bounding box. - * - * @return {BufferGeometry} A reference to this instance. - */ - center(): BufferGeometry; - /** - * Defines a geometry by creating a `position` attribute based on the given array of points. The array - * can hold 2D or 3D vectors. When using two-dimensional data, the `z` coordinate for all vertices is - * set to `0`. - * - * If the method is used with an existing `position` attribute, the vertex data are overwritten with the - * data from the array. The length of the array must match the vertex count. - * - * @param {Array|Array} points - The points. - * @return {BufferGeometry} A reference to this instance. - */ - setFromPoints(points: Array | Array): BufferGeometry; - /** - * Computes the bounding box of the geometry, and updates the `boundingBox` member. - * The bounding box is not computed by the engine; it must be computed by your app. - * You may need to recompute the bounding box if the geometry vertices are modified. - */ - computeBoundingBox(): void; - /** - * Computes the bounding sphere of the geometry, and updates the `boundingSphere` member. - * The engine automatically computes the bounding sphere when it is needed, e.g., for ray casting or view frustum culling. - * You may need to recompute the bounding sphere if the geometry vertices are modified. - */ - computeBoundingSphere(): void; - /** - * Calculates and adds a tangent attribute to this geometry. - * - * The computation is only supported for indexed geometries and if position, normal, and uv attributes - * are defined. When using a tangent space normal map, prefer the MikkTSpace algorithm provided by - * {@link BufferGeometryUtils#computeMikkTSpaceTangents} instead. - */ - computeTangents(): void; - /** - * Computes vertex normals for the given vertex data. For indexed geometries, the method sets - * each vertex normal to be the average of the face normals of the faces that share that vertex. - * For non-indexed geometries, vertices are not shared, and the method sets each vertex normal - * to be the same as the face normal. - */ - computeVertexNormals(): void; - /** - * Ensures every normal vector in a geometry will have a magnitude of `1`. This will - * correct lighting on the geometry surfaces. - */ - normalizeNormals(): void; - /** - * Return a new non-index version of this indexed geometry. If the geometry - * is already non-indexed, the method is a NOOP. - * - * @return {BufferGeometry} The non-indexed version of this indexed geometry. - */ - toNonIndexed(): BufferGeometry; - /** - * Serializes the geometry into JSON. - * - * @return {Object} A JSON object representing the serialized geometry. - */ - toJSON(): Object; - /** - * Returns a new geometry with copied values from this instance. - * - * @return {BufferGeometry} A clone of this instance. - */ - clone(): BufferGeometry; - /** - * Copies the values of the given geometry to this instance. - * - * @param {BufferGeometry} source - The geometry to copy. - * @return {BufferGeometry} A reference to this instance. - */ - copy(source: BufferGeometry): BufferGeometry; - /** - * Frees the GPU-related resources allocated by this instance. Call this - * method whenever this instance is no longer used in your app. - * - * @fires BufferGeometry#dispose - */ - dispose(): void; -} -import { EventDispatcher } from './EventDispatcher.js'; -import { BufferAttribute } from './BufferAttribute.js'; -import { Box3 } from '../math/Box3.js'; -import { Sphere } from '../math/Sphere.js'; -import { Matrix4 } from '../math/Matrix4.js'; -import { Vector3 } from '../math/Vector3.js'; -import { Vector2 } from '../math/Vector2.js'; diff --git a/jsdoc-testing/jsdoc/core/EventDispatcher.d.ts b/jsdoc-testing/jsdoc/core/EventDispatcher.d.ts deleted file mode 100644 index b53482ecc..000000000 --- a/jsdoc-testing/jsdoc/core/EventDispatcher.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -/** - * This modules allows to dispatch event objects on custom JavaScript objects. - * - * Main repository: [eventdispatcher.js](https://github.com/mrdoob/eventdispatcher.js/) - * - * Code Example: - * ```js - * class Car extends EventDispatcher { - * start() { - * this.dispatchEvent( { type: 'start', message: 'vroom vroom!' } ); - * } - *}; - * - * // Using events with the custom object - * const car = new Car(); - * car.addEventListener( 'start', function ( event ) { - * alert( event.message ); - * } ); - * - * car.start(); - * ``` - */ -export class EventDispatcher { - /** - * Adds the given event listener to the given event type. - * - * @param {string} type - The type of event to listen to. - * @param {Function} listener - The function that gets called when the event is fired. - */ - addEventListener(type: string, listener: Function): void; - _listeners: {} | undefined; - /** - * Returns `true` if the given event listener has been added to the given event type. - * - * @param {string} type - The type of event. - * @param {Function} listener - The listener to check. - * @return {boolean} Whether the given event listener has been added to the given event type. - */ - hasEventListener(type: string, listener: Function): boolean; - /** - * Removes the given event listener from the given event type. - * - * @param {string} type - The type of event. - * @param {Function} listener - The listener to remove. - */ - removeEventListener(type: string, listener: Function): void; - /** - * Dispatches an event object. - * - * @param {Object} event - The event that gets fired. - */ - dispatchEvent(event: Object): void; -} diff --git a/jsdoc-testing/jsdoc/core/InstancedBufferAttribute.d.ts b/jsdoc-testing/jsdoc/core/InstancedBufferAttribute.d.ts deleted file mode 100644 index aed6b3ff4..000000000 --- a/jsdoc-testing/jsdoc/core/InstancedBufferAttribute.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * An instanced version of a buffer attribute. - * - * @augments BufferAttribute - */ -export class InstancedBufferAttribute extends BufferAttribute { - /** - * Constructs a new instanced buffer attribute. - * - * @param {TypedArray} array - The array holding the attribute data. - * @param {number} itemSize - The item size. - * @param {boolean} [normalized=false] - Whether the data are normalized or not. - * @param {number} [meshPerAttribute=1] - How often a value of this buffer attribute should be repeated. - */ - constructor(array: TypedArray, itemSize: number, normalized?: boolean, meshPerAttribute?: number); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isInstancedBufferAttribute: boolean; - /** - * Defines how often a value of this buffer attribute should be repeated. A - * value of one means that each value of the instanced attribute is used for - * a single instance. A value of two means that each value is used for two - * consecutive instances (and so on). - * - * @type {number} - * @default 1 - */ - meshPerAttribute: number; - copy(source: any): this; -} -import { BufferAttribute } from './BufferAttribute.js'; diff --git a/jsdoc-testing/jsdoc/core/InstancedInterleavedBuffer.d.ts b/jsdoc-testing/jsdoc/core/InstancedInterleavedBuffer.d.ts deleted file mode 100644 index 3f95ae1bb..000000000 --- a/jsdoc-testing/jsdoc/core/InstancedInterleavedBuffer.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * An instanced version of an interleaved buffer. - * - * @augments InterleavedBuffer - */ -export class InstancedInterleavedBuffer extends InterleavedBuffer { - /** - * Constructs a new instanced interleaved buffer. - * - * @param {TypedArray} array - A typed array with a shared buffer storing attribute data. - * @param {number} stride - The number of typed-array elements per vertex. - * @param {number} [meshPerAttribute=1] - Defines how often a value of this interleaved buffer should be repeated. - */ - constructor(array: TypedArray, stride: number, meshPerAttribute?: number); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isInstancedInterleavedBuffer: boolean; - /** - * Defines how often a value of this buffer attribute should be repeated, - * see {@link InstancedBufferAttribute#meshPerAttribute}. - * - * @type {number} - * @default 1 - */ - meshPerAttribute: number; - copy(source: any): this; - clone(data: any): InterleavedBuffer; - toJSON(data: any): Object; -} -import { InterleavedBuffer } from './InterleavedBuffer.js'; diff --git a/jsdoc-testing/jsdoc/core/InterleavedBuffer.d.ts b/jsdoc-testing/jsdoc/core/InterleavedBuffer.d.ts deleted file mode 100644 index c6054ce83..000000000 --- a/jsdoc-testing/jsdoc/core/InterleavedBuffer.d.ts +++ /dev/null @@ -1,153 +0,0 @@ -/** - * "Interleaved" means that multiple attributes, possibly of different types, - * (e.g., position, normal, uv, color) are packed into a single array buffer. - * - * An introduction into interleaved arrays can be found here: [Interleaved array basics](https://blog.tojicode.com/2011/05/interleaved-array-basics.html) - */ -export class InterleavedBuffer { - /** - * Constructs a new interleaved buffer. - * - * @param {TypedArray} array - A typed array with a shared buffer storing attribute data. - * @param {number} stride - The number of typed-array elements per vertex. - */ - constructor(array: TypedArray, stride: number); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isInterleavedBuffer: boolean; - /** - * A typed array with a shared buffer storing attribute data. - * - * @type {TypedArray} - */ - array: TypedArray; - /** - * The number of typed-array elements per vertex. - * - * @type {number} - */ - stride: number; - /** - * The total number of elements in the array - * - * @type {number} - * @readonly - */ - readonly count: number; - /** - * Defines the intended usage pattern of the data store for optimization purposes. - * - * Note: After the initial use of a buffer, its usage cannot be changed. Instead, - * instantiate a new one and set the desired usage before the next render. - * - * @type {(StaticDrawUsage|DynamicDrawUsage|StreamDrawUsage|StaticReadUsage|DynamicReadUsage|StreamReadUsage|StaticCopyUsage|DynamicCopyUsage|StreamCopyUsage)} - * @default StaticDrawUsage - */ - usage: (number | DynamicDrawUsage | StreamDrawUsage | StaticReadUsage | DynamicReadUsage | StreamReadUsage | StaticCopyUsage | DynamicCopyUsage | StreamCopyUsage); - /** - * This can be used to only update some components of stored vectors (for example, just the - * component related to color). Use the `addUpdateRange()` function to add ranges to this array. - * - * @type {Array} - */ - updateRanges: Array; - /** - * A version number, incremented every time the `needsUpdate` is set to `true`. - * - * @type {number} - */ - version: number; - /** - * The UUID of the interleaved buffer. - * - * @type {string} - * @readonly - */ - readonly uuid: string; - /** - * A callback function that is executed after the renderer has transferred the attribute array - * data to the GPU. - */ - onUploadCallback(): void; - /** - * Flag to indicate that this attribute has changed and should be re-sent to - * the GPU. Set this to `true` when you modify the value of the array. - * - * @type {number} - * @default false - * @param {boolean} value - */ - set needsUpdate(value: boolean); - /** - * Sets the usage of this interleaved buffer. - * - * @param {(StaticDrawUsage|DynamicDrawUsage|StreamDrawUsage|StaticReadUsage|DynamicReadUsage|StreamReadUsage|StaticCopyUsage|DynamicCopyUsage|StreamCopyUsage)} value - The usage to set. - * @return {InterleavedBuffer} A reference to this interleaved buffer. - */ - setUsage(value: (number | DynamicDrawUsage | StreamDrawUsage | StaticReadUsage | DynamicReadUsage | StreamReadUsage | StaticCopyUsage | DynamicCopyUsage | StreamCopyUsage)): InterleavedBuffer; - /** - * Adds a range of data in the data array to be updated on the GPU. - * - * @param {number} start - Position at which to start update. - * @param {number} count - The number of components to update. - */ - addUpdateRange(start: number, count: number): void; - /** - * Clears the update ranges. - */ - clearUpdateRanges(): void; - /** - * Copies the values of the given interleaved buffer to this instance. - * - * @param {InterleavedBuffer} source - The interleaved buffer to copy. - * @return {InterleavedBuffer} A reference to this instance. - */ - copy(source: InterleavedBuffer): InterleavedBuffer; - /** - * Copies a vector from the given interleaved buffer to this one. The start - * and destination position in the attribute buffers are represented by the - * given indices. - * - * @param {number} index1 - The destination index into this interleaved buffer. - * @param {InterleavedBuffer} interleavedBuffer - The interleaved buffer to copy from. - * @param {number} index2 - The source index into the given interleaved buffer. - * @return {InterleavedBuffer} A reference to this instance. - */ - copyAt(index1: number, interleavedBuffer: InterleavedBuffer, index2: number): InterleavedBuffer; - /** - * Sets the given array data in the interleaved buffer. - * - * @param {(TypedArray|Array)} value - The array data to set. - * @param {number} [offset=0] - The offset in this interleaved buffer's array. - * @return {InterleavedBuffer} A reference to this instance. - */ - set(value: (TypedArray | any[]), offset?: number): InterleavedBuffer; - /** - * Returns a new interleaved buffer with copied values from this instance. - * - * @param {Object} [data] - An object with shared array buffers that allows to retain shared structures. - * @return {InterleavedBuffer} A clone of this instance. - */ - clone(data?: Object): InterleavedBuffer; - /** - * Sets the given callback function that is executed after the Renderer has transferred - * the array data to the GPU. Can be used to perform clean-up operations after - * the upload when data are not needed anymore on the CPU side. - * - * @param {Function} callback - The `onUpload()` callback. - * @return {InterleavedBuffer} A reference to this instance. - */ - onUpload(callback: Function): InterleavedBuffer; - /** - * Serializes the interleaved buffer into JSON. - * - * @param {Object} [data] - An optional value holding meta information about the serialization. - * @return {Object} A JSON object representing the serialized interleaved buffer. - */ - toJSON(data?: Object): Object; -} diff --git a/jsdoc-testing/jsdoc/core/InterleavedBufferAttribute.d.ts b/jsdoc-testing/jsdoc/core/InterleavedBufferAttribute.d.ts deleted file mode 100644 index 8fd60911e..000000000 --- a/jsdoc-testing/jsdoc/core/InterleavedBufferAttribute.d.ts +++ /dev/null @@ -1,226 +0,0 @@ -/** - * An alternative version of a buffer attribute with interleaved data. Interleaved - * attributes share a common interleaved data storage ({@link InterleavedBuffer}) and refer with - * different offsets into the buffer. - */ -export class InterleavedBufferAttribute { - /** - * Constructs a new interleaved buffer attribute. - * - * @param {InterleavedBuffer} interleavedBuffer - The buffer holding the interleaved data. - * @param {number} itemSize - The item size. - * @param {number} offset - The attribute offset into the buffer. - * @param {boolean} [normalized=false] - Whether the data are normalized or not. - */ - constructor(interleavedBuffer: InterleavedBuffer, itemSize: number, offset: number, normalized?: boolean); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isInterleavedBufferAttribute: boolean; - /** - * The name of the buffer attribute. - * - * @type {string} - */ - name: string; - /** - * The buffer holding the interleaved data. - * - * @type {InterleavedBuffer} - */ - data: InterleavedBuffer; - /** - * The item size, see {@link BufferAttribute#itemSize}. - * - * @type {number} - */ - itemSize: number; - /** - * The attribute offset into the buffer. - * - * @type {number} - */ - offset: number; - /** - * Whether the data are normalized or not, see {@link BufferAttribute#normalized} - * - * @type {InterleavedBuffer} - */ - normalized: InterleavedBuffer; - /** - * The item count of this buffer attribute. - * - * @type {number} - * @readonly - */ - readonly get count(): number; - /** - * The array holding the interleaved buffer attribute data. - * - * @type {TypedArray} - */ - get array(): TypedArray; - /** - * Flag to indicate that this attribute has changed and should be re-sent to - * the GPU. Set this to `true` when you modify the value of the array. - * - * @type {number} - * @default false - * @param {boolean} value - */ - set needsUpdate(value: boolean); - /** - * Applies the given 4x4 matrix to the given attribute. Only works with - * item size `3`. - * - * @param {Matrix4} m - The matrix to apply. - * @return {InterleavedBufferAttribute} A reference to this instance. - */ - applyMatrix4(m: Matrix4): InterleavedBufferAttribute; - /** - * Applies the given 3x3 normal matrix to the given attribute. Only works with - * item size `3`. - * - * @param {Matrix3} m - The normal matrix to apply. - * @return {InterleavedBufferAttribute} A reference to this instance. - */ - applyNormalMatrix(m: Matrix3): InterleavedBufferAttribute; - /** - * Applies the given 4x4 matrix to the given attribute. Only works with - * item size `3` and with direction vectors. - * - * @param {Matrix4} m - The matrix to apply. - * @return {InterleavedBufferAttribute} A reference to this instance. - */ - transformDirection(m: Matrix4): InterleavedBufferAttribute; - /** - * Returns the given component of the vector at the given index. - * - * @param {number} index - The index into the buffer attribute. - * @param {number} component - The component index. - * @return {number} The returned value. - */ - getComponent(index: number, component: number): number; - /** - * Sets the given value to the given component of the vector at the given index. - * - * @param {number} index - The index into the buffer attribute. - * @param {number} component - The component index. - * @param {number} value - The value to set. - * @return {InterleavedBufferAttribute} A reference to this instance. - */ - setComponent(index: number, component: number, value: number): InterleavedBufferAttribute; - /** - * Sets the x component of the vector at the given index. - * - * @param {number} index - The index into the buffer attribute. - * @param {number} x - The value to set. - * @return {InterleavedBufferAttribute} A reference to this instance. - */ - setX(index: number, x: number): InterleavedBufferAttribute; - /** - * Sets the y component of the vector at the given index. - * - * @param {number} index - The index into the buffer attribute. - * @param {number} y - The value to set. - * @return {InterleavedBufferAttribute} A reference to this instance. - */ - setY(index: number, y: number): InterleavedBufferAttribute; - /** - * Sets the z component of the vector at the given index. - * - * @param {number} index - The index into the buffer attribute. - * @param {number} z - The value to set. - * @return {InterleavedBufferAttribute} A reference to this instance. - */ - setZ(index: number, z: number): InterleavedBufferAttribute; - /** - * Sets the w component of the vector at the given index. - * - * @param {number} index - The index into the buffer attribute. - * @param {number} w - The value to set. - * @return {InterleavedBufferAttribute} A reference to this instance. - */ - setW(index: number, w: number): InterleavedBufferAttribute; - /** - * Returns the x component of the vector at the given index. - * - * @param {number} index - The index into the buffer attribute. - * @return {number} The x component. - */ - getX(index: number): number; - /** - * Returns the y component of the vector at the given index. - * - * @param {number} index - The index into the buffer attribute. - * @return {number} The y component. - */ - getY(index: number): number; - /** - * Returns the z component of the vector at the given index. - * - * @param {number} index - The index into the buffer attribute. - * @return {number} The z component. - */ - getZ(index: number): number; - /** - * Returns the w component of the vector at the given index. - * - * @param {number} index - The index into the buffer attribute. - * @return {number} The w component. - */ - getW(index: number): number; - /** - * Sets the x and y component of the vector at the given index. - * - * @param {number} index - The index into the buffer attribute. - * @param {number} x - The value for the x component to set. - * @param {number} y - The value for the y component to set. - * @return {InterleavedBufferAttribute} A reference to this instance. - */ - setXY(index: number, x: number, y: number): InterleavedBufferAttribute; - /** - * Sets the x, y and z component of the vector at the given index. - * - * @param {number} index - The index into the buffer attribute. - * @param {number} x - The value for the x component to set. - * @param {number} y - The value for the y component to set. - * @param {number} z - The value for the z component to set. - * @return {InterleavedBufferAttribute} A reference to this instance. - */ - setXYZ(index: number, x: number, y: number, z: number): InterleavedBufferAttribute; - /** - * Sets the x, y, z and w component of the vector at the given index. - * - * @param {number} index - The index into the buffer attribute. - * @param {number} x - The value for the x component to set. - * @param {number} y - The value for the y component to set. - * @param {number} z - The value for the z component to set. - * @param {number} w - The value for the w component to set. - * @return {InterleavedBufferAttribute} A reference to this instance. - */ - setXYZW(index: number, x: number, y: number, z: number, w: number): InterleavedBufferAttribute; - /** - * Returns a new buffer attribute with copied values from this instance. - * - * If no parameter is provided, cloning an interleaved buffer attribute will de-interleave buffer data. - * - * @param {Object} [data] - An object with interleaved buffers that allows to retain the interleaved property. - * @return {BufferAttribute|InterleavedBufferAttribute} A clone of this instance. - */ - clone(data?: Object): BufferAttribute | InterleavedBufferAttribute; - /** - * Serializes the buffer attribute into JSON. - * - * If no parameter is provided, cloning an interleaved buffer attribute will de-interleave buffer data. - * - * @param {Object} [data] - An optional value holding meta information about the serialization. - * @return {Object} A JSON object representing the serialized buffer attribute. - */ - toJSON(data?: Object): Object; -} -import { BufferAttribute } from './BufferAttribute.js'; diff --git a/jsdoc-testing/jsdoc/core/Layers.d.ts b/jsdoc-testing/jsdoc/core/Layers.d.ts deleted file mode 100644 index 34b3c6175..000000000 --- a/jsdoc-testing/jsdoc/core/Layers.d.ts +++ /dev/null @@ -1,68 +0,0 @@ -/** - * A layers object assigns an 3D object to 1 or more of 32 - * layers numbered `0` to `31` - internally the layers are stored as a - * bit mask], and by default all 3D objects are a member of layer `0`. - * - * This can be used to control visibility - an object must share a layer with - * a camera to be visible when that camera's view is - * rendered. - * - * All classes that inherit from {@link Object3D} have an `layers` property which - * is an instance of this class. - */ -export class Layers { - /** - * A bit mask storing which of the 32 layers this layers object is currently - * a member of. - * - * @type {number} - */ - mask: number; - /** - * Sets membership to the given layer, and remove membership all other layers. - * - * @param {number} layer - The layer to set. - */ - set(layer: number): void; - /** - * Adds membership of the given layer. - * - * @param {number} layer - The layer to enable. - */ - enable(layer: number): void; - /** - * Adds membership to all layers. - */ - enableAll(): void; - /** - * Toggles the membership of the given layer. - * - * @param {number} layer - The layer to toggle. - */ - toggle(layer: number): void; - /** - * Removes membership of the given layer. - * - * @param {number} layer - The layer to enable. - */ - disable(layer: number): void; - /** - * Removes the membership from all layers. - */ - disableAll(): void; - /** - * Returns `true` if this and the given layers object have at least one - * layer in common. - * - * @param {Layers} layers - The layers to test. - * @return {boolean } Whether this and the given layers object have at least one layer in common or not. - */ - test(layers: Layers): boolean; - /** - * Returns `true` if the given layer is enabled. - * - * @param {number} layer - The layer to test. - * @return {boolean } Whether the given layer is enabled or not. - */ - isEnabled(layer: number): boolean; -} diff --git a/jsdoc-testing/jsdoc/core/Object3D.d.ts b/jsdoc-testing/jsdoc/core/Object3D.d.ts deleted file mode 100644 index b6e8715c8..000000000 --- a/jsdoc-testing/jsdoc/core/Object3D.d.ts +++ /dev/null @@ -1,584 +0,0 @@ -/** - * This is the base class for most objects in three.js and provides a set of - * properties and methods for manipulating objects in 3D space. - * - * @augments EventDispatcher - */ -export class Object3D extends EventDispatcher { - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isObject3D: boolean; - /** - * The UUID of the 3D object. - * - * @type {string} - * @readonly - */ - readonly uuid: string; - /** - * The name of the 3D object. - * - * @type {string} - */ - name: string; - /** - * The type property is used for detecting the object type - * in context of serialization/deserialization. - * - * @type {string} - * @readonly - */ - readonly type: string; - /** - * A reference to the parent object. - * - * @type {?Object3D} - * @default null - */ - parent: Object3D | null; - /** - * An array holding the child 3D objects of this instance. - * - * @type {Array} - */ - children: Array; - /** - * Defines the `up` direction of the 3D object which influences - * the orientation via methods like {@link Object3D#lookAt}. - * - * The default values for all 3D objects is defined by `Object3D.DEFAULT_UP`. - * - * @type {Vector3} - */ - up: Vector3; - /** - * Represents the object's transformation matrix in local space. - * - * @type {Matrix4} - */ - matrix: Matrix4; - /** - * Represents the object's transformation matrix in world space. - * If the 3D object has no parent, then it's identical to the local transformation matrix - * - * @type {Matrix4} - */ - matrixWorld: Matrix4; - /** - * When set to `true`, the engine automatically computes the local matrix from position, - * rotation and scale every frame. If set to `false`, the app is responsible for recomputing - * the local matrix by calling `updateMatrix()`. - * - * The default values for all 3D objects is defined by `Object3D.DEFAULT_MATRIX_AUTO_UPDATE`. - * - * @type {boolean} - * @default true - */ - matrixAutoUpdate: boolean; - /** - * When set to `true`, the engine automatically computes the world matrix from the current local - * matrix and the object's transformation hierarchy. If set to `false`, the app is responsible for - * recomputing the world matrix by directly updating the `matrixWorld` property. - * - * The default values for all 3D objects is defined by `Object3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE`. - * - * @type {boolean} - * @default true - */ - matrixWorldAutoUpdate: boolean; - /** - * When set to `true`, it calculates the world matrix in that frame and resets this property - * to `false`. - * - * @type {boolean} - * @default false - */ - matrixWorldNeedsUpdate: boolean; - /** - * The layer membership of the 3D object. The 3D object is only visible if it has - * at least one layer in common with the camera in use. This property can also be - * used to filter out unwanted objects in ray-intersection tests when using {@link Raycaster}. - * - * @type {Layers} - */ - layers: Layers; - /** - * When set to `true`, the 3D object gets rendered. - * - * @type {boolean} - * @default true - */ - visible: boolean; - /** - * When set to `true`, the 3D object gets rendered into shadow maps. - * - * @type {boolean} - * @default false - */ - castShadow: boolean; - /** - * When set to `true`, the 3D object is affected by shadows in the scene. - * - * @type {boolean} - * @default false - */ - receiveShadow: boolean; - /** - * When set to `true`, the 3D object is honored by view frustum culling. - * - * @type {boolean} - * @default true - */ - frustumCulled: boolean; - /** - * This value allows the default rendering order of scene graph objects to be - * overridden although opaque and transparent objects remain sorted independently. - * When this property is set for an instance of {@link Group},all descendants - * objects will be sorted and rendered together. Sorting is from lowest to highest - * render order. - * - * @type {number} - * @default 0 - */ - renderOrder: number; - /** - * An array holding the animation clips of the 3D object. - * - * @type {Array} - */ - animations: Array; - /** - * Custom depth material to be used when rendering to the depth map. Can only be used - * in context of meshes. When shadow-casting with a {@link DirectionalLight} or {@link SpotLight}, - * if you are modifying vertex positions in the vertex shader you must specify a custom depth - * material for proper shadows. - * - * Only relevant in context of {@link WebGLRenderer}. - * - * @type {(Material|undefined)} - * @default undefined - */ - customDepthMaterial: (Material | undefined); - /** - * Same as {@link Object3D#customDepthMaterial}, but used with {@link PointLight}. - * - * Only relevant in context of {@link WebGLRenderer}. - * - * @type {(Material|undefined)} - * @default undefined - */ - customDistanceMaterial: (Material | undefined); - /** - * Whether the 3D object is supposed to be static or not. If set to `true`, it means - * the 3D object is not going to be changed after the initial renderer. This includes - * geometry and material settings. A static 3D object can be processed by the renderer - * slightly faster since certain state checks can be bypassed. - * - * Only relevant in context of {@link WebGPURenderer}. - * - * @type {boolean} - * @default false - */ - static: boolean; - /** - * An object that can be used to store custom data about the 3D object. It - * should not hold references to functions as these will not be cloned. - * - * @type {Object} - */ - userData: Object; - /** - * The pivot point for rotation and scale transformations. - * When set, rotation and scale are applied around this point - * instead of the object's origin. - * - * @type {?Vector3} - * @default null - */ - pivot: Vector3 | null; - /** - * A callback that is executed immediately before a 3D object is rendered to a shadow map. - * - * @param {Renderer|WebGLRenderer} renderer - The renderer. - * @param {Object3D} object - The 3D object. - * @param {Camera} camera - The camera that is used to render the scene. - * @param {Camera} shadowCamera - The shadow camera. - * @param {BufferGeometry} geometry - The 3D object's geometry. - * @param {Material} depthMaterial - The depth material. - * @param {Object} group - The geometry group data. - */ - onBeforeShadow(): void; - /** - * A callback that is executed immediately after a 3D object is rendered to a shadow map. - * - * @param {Renderer|WebGLRenderer} renderer - The renderer. - * @param {Object3D} object - The 3D object. - * @param {Camera} camera - The camera that is used to render the scene. - * @param {Camera} shadowCamera - The shadow camera. - * @param {BufferGeometry} geometry - The 3D object's geometry. - * @param {Material} depthMaterial - The depth material. - * @param {Object} group - The geometry group data. - */ - onAfterShadow(): void; - /** - * A callback that is executed immediately before a 3D object is rendered. - * - * @param {Renderer|WebGLRenderer} renderer - The renderer. - * @param {Object3D} object - The 3D object. - * @param {Camera} camera - The camera that is used to render the scene. - * @param {BufferGeometry} geometry - The 3D object's geometry. - * @param {Material} material - The 3D object's material. - * @param {Object} group - The geometry group data. - */ - onBeforeRender(): void; - /** - * A callback that is executed immediately after a 3D object is rendered. - * - * @param {Renderer|WebGLRenderer} renderer - The renderer. - * @param {Object3D} object - The 3D object. - * @param {Camera} camera - The camera that is used to render the scene. - * @param {BufferGeometry} geometry - The 3D object's geometry. - * @param {Material} material - The 3D object's material. - * @param {Object} group - The geometry group data. - */ - onAfterRender(): void; - /** - * Applies the given transformation matrix to the object and updates the object's position, - * rotation and scale. - * - * @param {Matrix4} matrix - The transformation matrix. - */ - applyMatrix4(matrix: Matrix4): void; - /** - * Applies a rotation represented by given the quaternion to the 3D object. - * - * @param {Quaternion} q - The quaternion. - * @return {Object3D} A reference to this instance. - */ - applyQuaternion(q: Quaternion): Object3D; - /** - * Sets the given rotation represented as an axis/angle couple to the 3D object. - * - * @param {Vector3} axis - The (normalized) axis vector. - * @param {number} angle - The angle in radians. - */ - setRotationFromAxisAngle(axis: Vector3, angle: number): void; - /** - * Sets the given rotation represented as Euler angles to the 3D object. - * - * @param {Euler} euler - The Euler angles. - */ - setRotationFromEuler(euler: Euler): void; - /** - * Sets the given rotation represented as rotation matrix to the 3D object. - * - * @param {Matrix4} m - Although a 4x4 matrix is expected, the upper 3x3 portion must be - * a pure rotation matrix (i.e, unscaled). - */ - setRotationFromMatrix(m: Matrix4): void; - /** - * Sets the given rotation represented as a Quaternion to the 3D object. - * - * @param {Quaternion} q - The Quaternion - */ - setRotationFromQuaternion(q: Quaternion): void; - /** - * Rotates the 3D object along an axis in local space. - * - * @param {Vector3} axis - The (normalized) axis vector. - * @param {number} angle - The angle in radians. - * @return {Object3D} A reference to this instance. - */ - rotateOnAxis(axis: Vector3, angle: number): Object3D; - /** - * Rotates the 3D object along an axis in world space. - * - * @param {Vector3} axis - The (normalized) axis vector. - * @param {number} angle - The angle in radians. - * @return {Object3D} A reference to this instance. - */ - rotateOnWorldAxis(axis: Vector3, angle: number): Object3D; - /** - * Rotates the 3D object around its X axis in local space. - * - * @param {number} angle - The angle in radians. - * @return {Object3D} A reference to this instance. - */ - rotateX(angle: number): Object3D; - /** - * Rotates the 3D object around its Y axis in local space. - * - * @param {number} angle - The angle in radians. - * @return {Object3D} A reference to this instance. - */ - rotateY(angle: number): Object3D; - /** - * Rotates the 3D object around its Z axis in local space. - * - * @param {number} angle - The angle in radians. - * @return {Object3D} A reference to this instance. - */ - rotateZ(angle: number): Object3D; - /** - * Translate the 3D object by a distance along the given axis in local space. - * - * @param {Vector3} axis - The (normalized) axis vector. - * @param {number} distance - The distance in world units. - * @return {Object3D} A reference to this instance. - */ - translateOnAxis(axis: Vector3, distance: number): Object3D; - /** - * Translate the 3D object by a distance along its X-axis in local space. - * - * @param {number} distance - The distance in world units. - * @return {Object3D} A reference to this instance. - */ - translateX(distance: number): Object3D; - /** - * Translate the 3D object by a distance along its Y-axis in local space. - * - * @param {number} distance - The distance in world units. - * @return {Object3D} A reference to this instance. - */ - translateY(distance: number): Object3D; - /** - * Translate the 3D object by a distance along its Z-axis in local space. - * - * @param {number} distance - The distance in world units. - * @return {Object3D} A reference to this instance. - */ - translateZ(distance: number): Object3D; - /** - * Converts the given vector from this 3D object's local space to world space. - * - * @param {Vector3} vector - The vector to convert. - * @return {Vector3} The converted vector. - */ - localToWorld(vector: Vector3): Vector3; - /** - * Converts the given vector from this 3D object's world space to local space. - * - * @param {Vector3} vector - The vector to convert. - * @return {Vector3} The converted vector. - */ - worldToLocal(vector: Vector3): Vector3; - /** - * Rotates the object to face a point in world space. - * - * This method does not support objects having non-uniformly-scaled parent(s). - * - * @param {number|Vector3} x - The x coordinate in world space. Alternatively, a vector representing a position in world space - * @param {number} [y] - The y coordinate in world space. - * @param {number} [z] - The z coordinate in world space. - */ - lookAt(x: number | Vector3, y?: number, z?: number): void; - /** - * Adds the given 3D object as a child to this 3D object. An arbitrary number of - * objects may be added. Any current parent on an object passed in here will be - * removed, since an object can have at most one parent. - * - * @fires Object3D#added - * @fires Object3D#childadded - * @param {Object3D} object - The 3D object to add. - * @return {Object3D} A reference to this instance. - */ - add(object: Object3D, ...args: any[]): Object3D; - /** - * Removes the given 3D object as child from this 3D object. - * An arbitrary number of objects may be removed. - * - * @fires Object3D#removed - * @fires Object3D#childremoved - * @param {Object3D} object - The 3D object to remove. - * @return {Object3D} A reference to this instance. - */ - remove(object: Object3D, ...args: any[]): Object3D; - /** - * Removes this 3D object from its current parent. - * - * @fires Object3D#removed - * @fires Object3D#childremoved - * @return {Object3D} A reference to this instance. - */ - removeFromParent(): Object3D; - /** - * Removes all child objects. - * - * @fires Object3D#removed - * @fires Object3D#childremoved - * @return {Object3D} A reference to this instance. - */ - clear(): Object3D; - /** - * Adds the given 3D object as a child of this 3D object, while maintaining the object's world - * transform. This method does not support scene graphs having non-uniformly-scaled nodes(s). - * - * @fires Object3D#added - * @fires Object3D#childadded - * @param {Object3D} object - The 3D object to attach. - * @return {Object3D} A reference to this instance. - */ - attach(object: Object3D): Object3D; - /** - * Searches through the 3D object and its children, starting with the 3D object - * itself, and returns the first with a matching ID. - * - * @param {number} id - The id. - * @return {Object3D|undefined} The found 3D object. Returns `undefined` if no 3D object has been found. - */ - getObjectById(id: number): Object3D | undefined; - /** - * Searches through the 3D object and its children, starting with the 3D object - * itself, and returns the first with a matching name. - * - * @param {string} name - The name. - * @return {Object3D|undefined} The found 3D object. Returns `undefined` if no 3D object has been found. - */ - getObjectByName(name: string): Object3D | undefined; - /** - * Searches through the 3D object and its children, starting with the 3D object - * itself, and returns the first with a matching property value. - * - * @param {string} name - The name of the property. - * @param {any} value - The value. - * @return {Object3D|undefined} The found 3D object. Returns `undefined` if no 3D object has been found. - */ - getObjectByProperty(name: string, value: any): Object3D | undefined; - /** - * Searches through the 3D object and its children, starting with the 3D object - * itself, and returns all 3D objects with a matching property value. - * - * @param {string} name - The name of the property. - * @param {any} value - The value. - * @param {Array} result - The method stores the result in this array. - * @return {Array} The found 3D objects. - */ - getObjectsByProperty(name: string, value: any, result?: Array): Array; - /** - * Returns a vector representing the position of the 3D object in world space. - * - * @param {Vector3} target - The target vector the result is stored to. - * @return {Vector3} The 3D object's position in world space. - */ - getWorldPosition(target: Vector3): Vector3; - /** - * Returns a Quaternion representing the position of the 3D object in world space. - * - * @param {Quaternion} target - The target Quaternion the result is stored to. - * @return {Quaternion} The 3D object's rotation in world space. - */ - getWorldQuaternion(target: Quaternion): Quaternion; - /** - * Returns a vector representing the scale of the 3D object in world space. - * - * @param {Vector3} target - The target vector the result is stored to. - * @return {Vector3} The 3D object's scale in world space. - */ - getWorldScale(target: Vector3): Vector3; - /** - * Returns a vector representing the ("look") direction of the 3D object in world space. - * - * @param {Vector3} target - The target vector the result is stored to. - * @return {Vector3} The 3D object's direction in world space. - */ - getWorldDirection(target: Vector3): Vector3; - /** - * Abstract method to get intersections between a casted ray and this - * 3D object. Renderable 3D objects such as {@link Mesh}, {@link Line} or {@link Points} - * implement this method in order to use raycasting. - * - * @abstract - * @param {Raycaster} raycaster - The raycaster. - * @param {Array} intersects - An array holding the result of the method. - */ - raycast(): void; - /** - * Executes the callback on this 3D object and all descendants. - * - * Note: Modifying the scene graph inside the callback is discouraged. - * - * @param {Function} callback - A callback function that allows to process the current 3D object. - */ - traverse(callback: Function): void; - /** - * Like {@link Object3D#traverse}, but the callback will only be executed for visible 3D objects. - * Descendants of invisible 3D objects are not traversed. - * - * Note: Modifying the scene graph inside the callback is discouraged. - * - * @param {Function} callback - A callback function that allows to process the current 3D object. - */ - traverseVisible(callback: Function): void; - /** - * Like {@link Object3D#traverse}, but the callback will only be executed for all ancestors. - * - * Note: Modifying the scene graph inside the callback is discouraged. - * - * @param {Function} callback - A callback function that allows to process the current 3D object. - */ - traverseAncestors(callback: Function): void; - /** - * Updates the transformation matrix in local space by computing it from the current - * position, rotation and scale values. - */ - updateMatrix(): void; - /** - * Updates the transformation matrix in world space of this 3D objects and its descendants. - * - * To ensure correct results, this method also recomputes the 3D object's transformation matrix in - * local space. The computation of the local and world matrix can be controlled with the - * {@link Object3D#matrixAutoUpdate} and {@link Object3D#matrixWorldAutoUpdate} flags which are both - * `true` by default. Set these flags to `false` if you need more control over the update matrix process. - * - * @param {boolean} [force=false] - When set to `true`, a recomputation of world matrices is forced even - * when {@link Object3D#matrixWorldNeedsUpdate} is `false`. - */ - updateMatrixWorld(force?: boolean): void; - /** - * An alternative version of {@link Object3D#updateMatrixWorld} with more control over the - * update of ancestor and descendant nodes. - * - * @param {boolean} [updateParents=false] Whether ancestor nodes should be updated or not. - * @param {boolean} [updateChildren=false] Whether descendant nodes should be updated or not. - */ - updateWorldMatrix(updateParents?: boolean, updateChildren?: boolean): void; - /** - * Serializes the 3D object into JSON. - * - * @param {?(Object|string)} meta - An optional value holding meta information about the serialization. - * @return {Object} A JSON object representing the serialized 3D object. - * @see {@link ObjectLoader#parse} - */ - toJSON(meta: (Object | string) | null): Object; - /** - * Returns a new 3D object with copied values from this instance. - * - * @param {boolean} [recursive=true] - When set to `true`, descendants of the 3D object are also cloned. - * @return {Object3D} A clone of this instance. - */ - clone(recursive?: boolean): Object3D; - /** - * Copies the values of the given 3D object to this instance. - * - * @param {Object3D} source - The 3D object to copy. - * @param {boolean} [recursive=true] - When set to `true`, descendants of the 3D object are cloned. - * @return {Object3D} A reference to this instance. - */ - copy(source: Object3D, recursive?: boolean): Object3D; -} -export namespace Object3D { - let DEFAULT_UP: Vector3; - let DEFAULT_MATRIX_AUTO_UPDATE: boolean; - let DEFAULT_MATRIX_WORLD_AUTO_UPDATE: boolean; -} -import { EventDispatcher } from './EventDispatcher.js'; -import { Vector3 } from '../math/Vector3.js'; -import { Matrix4 } from '../math/Matrix4.js'; -import { Layers } from './Layers.js'; -import { Quaternion } from '../math/Quaternion.js'; -import { Euler } from '../math/Euler.js'; diff --git a/jsdoc-testing/jsdoc/core/RenderTarget.d.ts b/jsdoc-testing/jsdoc/core/RenderTarget.d.ts deleted file mode 100644 index d610b86f8..000000000 --- a/jsdoc-testing/jsdoc/core/RenderTarget.d.ts +++ /dev/null @@ -1,197 +0,0 @@ -/** - * A render target is a buffer where the video card draws pixels for a scene - * that is being rendered in the background. It is used in different effects, - * such as applying postprocessing to a rendered image before displaying it - * on the screen. - * - * @augments EventDispatcher - */ -export class RenderTarget extends EventDispatcher { - /** - * Render target options. - * - * @typedef {Object} RenderTarget~Options - * @property {boolean} [generateMipmaps=false] - Whether to generate mipmaps or not. - * @property {number} [magFilter=LinearFilter] - The mag filter. - * @property {number} [minFilter=LinearFilter] - The min filter. - * @property {number} [format=RGBAFormat] - The texture format. - * @property {number} [type=UnsignedByteType] - The texture type. - * @property {?string} [internalFormat=null] - The texture's internal format. - * @property {number} [wrapS=ClampToEdgeWrapping] - The texture's uv wrapping mode. - * @property {number} [wrapT=ClampToEdgeWrapping] - The texture's uv wrapping mode. - * @property {number} [anisotropy=1] - The texture's anisotropy value. - * @property {string} [colorSpace=NoColorSpace] - The texture's color space. - * @property {boolean} [depthBuffer=true] - Whether to allocate a depth buffer or not. - * @property {boolean} [stencilBuffer=false] - Whether to allocate a stencil buffer or not. - * @property {boolean} [resolveDepthBuffer=true] - Whether to resolve the depth buffer or not. - * @property {boolean} [resolveStencilBuffer=true] - Whether to resolve the stencil buffer or not. - * @property {?Texture} [depthTexture=null] - Reference to a depth texture. - * @property {number} [samples=0] - The MSAA samples count. - * @property {number} [count=1] - Defines the number of color attachments . Must be at least `1`. - * @property {number} [depth=1] - The texture depth. - * @property {boolean} [multiview=false] - Whether this target is used for multiview rendering. - */ - /** - * Constructs a new render target. - * - * @param {number} [width=1] - The width of the render target. - * @param {number} [height=1] - The height of the render target. - * @param {RenderTarget~Options} [options] - The configuration object. - */ - constructor(width?: number, height?: number, options?: {}); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isRenderTarget: boolean; - /** - * The width of the render target. - * - * @type {number} - * @default 1 - */ - width: number; - /** - * The height of the render target. - * - * @type {number} - * @default 1 - */ - height: number; - /** - * The depth of the render target. - * - * @type {number} - * @default 1 - */ - depth: number; - /** - * A rectangular area inside the render target's viewport. Fragments that are - * outside the area will be discarded. - * - * @type {Vector4} - * @default (0,0,width,height) - */ - scissor: Vector4; - /** - * Indicates whether the scissor test should be enabled when rendering into - * this render target or not. - * - * @type {boolean} - * @default false - */ - scissorTest: boolean; - /** - * A rectangular area representing the render target's viewport. - * - * @type {Vector4} - * @default (0,0,width,height) - */ - viewport: Vector4; - /** - * An array of textures. Each color attachment is represented as a separate texture. - * Has at least a single entry for the default color attachment. - * - * @type {Array} - */ - textures: Array; - /** - * Whether to allocate a depth buffer or not. - * - * @type {boolean} - * @default true - */ - depthBuffer: boolean; - /** - * Whether to allocate a stencil buffer or not. - * - * @type {boolean} - * @default false - */ - stencilBuffer: boolean; - /** - * Whether to resolve the depth buffer or not. - * - * @type {boolean} - * @default true - */ - resolveDepthBuffer: boolean; - /** - * Whether to resolve the stencil buffer or not. - * - * @type {boolean} - * @default true - */ - resolveStencilBuffer: boolean; - _depthTexture: any; - set depthTexture(current: DepthTexture | null); - /** - * Instead of saving the depth in a renderbuffer, a texture - * can be used instead which is useful for further processing - * e.g. in context of post-processing. - * - * @type {?DepthTexture} - * @default null - */ - get depthTexture(): DepthTexture | null; - /** - * The number of MSAA samples. - * - * A value of `0` disables MSAA. - * - * @type {number} - * @default 0 - */ - samples: number; - /** - * Whether to this target is used in multiview rendering. - * - * @type {boolean} - * @default false - */ - multiview: boolean; - _setTextureOptions(options?: {}): void; - set texture(value: Texture); - /** - * The texture representing the default color attachment. - * - * @type {Texture} - */ - get texture(): Texture; - /** - * Sets the size of this render target. - * - * @param {number} width - The width. - * @param {number} height - The height. - * @param {number} [depth=1] - The depth. - */ - setSize(width: number, height: number, depth?: number): void; - /** - * Returns a new render target with copied values from this instance. - * - * @return {RenderTarget} A clone of this instance. - */ - clone(): RenderTarget; - /** - * Copies the settings of the given render target. This is a structural copy so - * no resources are shared between render targets after the copy. That includes - * all MRT textures and the depth texture. - * - * @param {RenderTarget} source - The render target to copy. - * @return {RenderTarget} A reference to this instance. - */ - copy(source: RenderTarget): RenderTarget; - /** - * Frees the GPU-related resources allocated by this instance. Call this - * method whenever this instance is no longer used in your app. - * - * @fires RenderTarget#dispose - */ - dispose(): void; -} -import { EventDispatcher } from './EventDispatcher.js'; -import { Vector4 } from '../math/Vector4.js'; -import { Texture } from '../textures/Texture.js'; diff --git a/jsdoc-testing/jsdoc/core/Timer.d.ts b/jsdoc-testing/jsdoc/core/Timer.d.ts deleted file mode 100644 index d47c2d4bd..000000000 --- a/jsdoc-testing/jsdoc/core/Timer.d.ts +++ /dev/null @@ -1,86 +0,0 @@ -/** - * This class is an alternative to {@link Clock} with a different API design and behavior. - * The goal is to avoid the conceptual flaws that became apparent in `Clock` over time. - * - * - `Timer` has an `update()` method that updates its internal state. That makes it possible to - * call `getDelta()` and `getElapsed()` multiple times per simulation step without getting different values. - * - The class can make use of the Page Visibility API to avoid large time delta values when the app - * is inactive (e.g. tab switched or browser hidden). - * - * ```js - * const timer = new Timer(); - * timer.connect( document ); // use Page Visibility API - * ``` - */ -export class Timer { - _previousTime: number; - _currentTime: number; - _startTime: number; - _delta: number; - _elapsed: number; - _timescale: number; - _document: Document | null; - _pageVisibilityHandler: typeof handleVisibilityChange | null; - /** - * Connect the timer to the given document.Calling this method is not mandatory to - * use the timer but enables the usage of the Page Visibility API to avoid large time - * delta values. - * - * @param {Document} document - The document. - */ - connect(document: Document): void; - /** - * Disconnects the timer from the DOM and also disables the usage of the Page Visibility API. - */ - disconnect(): void; - /** - * Returns the time delta in seconds. - * - * @return {number} The time delta in second. - */ - getDelta(): number; - /** - * Returns the elapsed time in seconds. - * - * @return {number} The elapsed time in second. - */ - getElapsed(): number; - /** - * Returns the timescale. - * - * @return {number} The timescale. - */ - getTimescale(): number; - /** - * Sets the given timescale which scale the time delta computation - * in `update()`. - * - * @param {number} timescale - The timescale to set. - * @return {Timer} A reference to this timer. - */ - setTimescale(timescale: number): Timer; - /** - * Resets the time computation for the current simulation step. - * - * @return {Timer} A reference to this timer. - */ - reset(): Timer; - /** - * Can be used to free all internal resources. Usually called when - * the timer instance isn't required anymore. - */ - dispose(): void; - /** - * Updates the internal state of the timer. This method should be called - * once per simulation step and before you perform queries against the timer - * (e.g. via `getDelta()`). - * - * @param {number} timestamp - The current time in milliseconds. Can be obtained - * from the `requestAnimationFrame` callback argument. If not provided, the current - * time will be determined with `performance.now`. - * @return {Timer} A reference to this timer. - */ - update(timestamp: number): Timer; -} -declare function handleVisibilityChange(): void; -export {}; diff --git a/jsdoc-testing/jsdoc/extras/DataUtils.d.ts b/jsdoc-testing/jsdoc/extras/DataUtils.d.ts deleted file mode 100644 index 66cfe1590..000000000 --- a/jsdoc-testing/jsdoc/extras/DataUtils.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Returns a half precision floating point value (FP16) from the given single - * precision floating point value (FP32). - * - * @param {number} val - A single precision floating point value. - * @return {number} The FP16 value. - */ -export function toHalfFloat(val: number): number; -/** - * Returns a single precision floating point value (FP32) from the given half - * precision floating point value (FP16). - * - * @param {number} val - A half precision floating point value. - * @return {number} The FP32 value. - */ -export function fromHalfFloat(val: number): number; -/** - * A class containing utility functions for data. - * - * @hideconstructor - */ -export class DataUtils { - /** - * Returns a half precision floating point value (FP16) from the given single - * precision floating point value (FP32). - * - * @param {number} val - A single precision floating point value. - * @return {number} The FP16 value. - */ - static toHalfFloat(val: number): number; - /** - * Returns a single precision floating point value (FP32) from the given half - * precision floating point value (FP16). - * - * @param {number} val - A half precision floating point value. - * @return {number} The FP32 value. - */ - static fromHalfFloat(val: number): number; -} diff --git a/jsdoc-testing/jsdoc/extras/ImageUtils.d.ts b/jsdoc-testing/jsdoc/extras/ImageUtils.d.ts deleted file mode 100644 index 26077e10c..000000000 --- a/jsdoc-testing/jsdoc/extras/ImageUtils.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * A class containing utility functions for images. - * - * @hideconstructor - */ -export class ImageUtils { - /** - * Returns a data URI containing a representation of the given image. - * - * @param {(HTMLImageElement|HTMLCanvasElement)} image - The image object. - * @param {string} [type='image/png'] - Indicates the image format. - * @return {string} The data URI. - */ - static getDataURL(image: (HTMLImageElement | HTMLCanvasElement), type?: string): string; - /** - * Converts the given sRGB image data to linear color space. - * - * @param {(HTMLImageElement|HTMLCanvasElement|ImageBitmap|Object)} image - The image object. - * @return {HTMLCanvasElement|Object} The converted image. - */ - static sRGBToLinear(image: (HTMLImageElement | HTMLCanvasElement | ImageBitmap | Object)): HTMLCanvasElement | Object; -} diff --git a/jsdoc-testing/jsdoc/extras/TextureUtils.d.ts b/jsdoc-testing/jsdoc/extras/TextureUtils.d.ts deleted file mode 100644 index 5de7a1677..000000000 --- a/jsdoc-testing/jsdoc/extras/TextureUtils.d.ts +++ /dev/null @@ -1,81 +0,0 @@ -/** - * Scales the texture as large as possible within its surface without cropping - * or stretching the texture. The method preserves the original aspect ratio of - * the texture. Akin to CSS `object-fit: contain` - * - * @param {Texture} texture - The texture. - * @param {number} aspect - The texture's aspect ratio. - * @return {Texture} The updated texture. - */ -export function contain(texture: Texture, aspect: number): Texture; -/** - * Scales the texture to the smallest possible size to fill the surface, leaving - * no empty space. The method preserves the original aspect ratio of the texture. - * Akin to CSS `object-fit: cover`. - * - * @param {Texture} texture - The texture. - * @param {number} aspect - The texture's aspect ratio. - * @return {Texture} The updated texture. - */ -export function cover(texture: Texture, aspect: number): Texture; -/** - * Configures the texture to the default transformation. Akin to CSS `object-fit: fill`. - * - * @param {Texture} texture - The texture. - * @return {Texture} The updated texture. - */ -export function fill(texture: Texture): Texture; -/** - * Determines how many bytes must be used to represent the texture. - * - * @param {number} width - The width of the texture. - * @param {number} height - The height of the texture. - * @param {number} format - The texture's format. - * @param {number} type - The texture's type. - * @return {number} The byte length. - */ -export function getByteLength(width: number, height: number, format: number, type: number): number; -/** - * A class containing utility functions for textures. - * - * @hideconstructor - */ -export class TextureUtils { - /** - * Scales the texture as large as possible within its surface without cropping - * or stretching the texture. The method preserves the original aspect ratio of - * the texture. Akin to CSS `object-fit: contain` - * - * @param {Texture} texture - The texture. - * @param {number} aspect - The texture's aspect ratio. - * @return {Texture} The updated texture. - */ - static contain(texture: Texture, aspect: number): Texture; - /** - * Scales the texture to the smallest possible size to fill the surface, leaving - * no empty space. The method preserves the original aspect ratio of the texture. - * Akin to CSS `object-fit: cover`. - * - * @param {Texture} texture - The texture. - * @param {number} aspect - The texture's aspect ratio. - * @return {Texture} The updated texture. - */ - static cover(texture: Texture, aspect: number): Texture; - /** - * Configures the texture to the default transformation. Akin to CSS `object-fit: fill`. - * - * @param {Texture} texture - The texture. - * @return {Texture} The updated texture. - */ - static fill(texture: Texture): Texture; - /** - * Determines how many bytes must be used to represent the texture. - * - * @param {number} width - The width of the texture. - * @param {number} height - The height of the texture. - * @param {number} format - The texture's format. - * @param {number} type - The texture's type. - * @return {number} The byte length. - */ - static getByteLength(width: number, height: number, format: number, type: number): number; -} diff --git a/jsdoc-testing/jsdoc/geometries/BoxGeometry.d.ts b/jsdoc-testing/jsdoc/geometries/BoxGeometry.d.ts deleted file mode 100644 index 36fb50dad..000000000 --- a/jsdoc-testing/jsdoc/geometries/BoxGeometry.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * A geometry class for a rectangular cuboid with a given width, height, and depth. - * On creation, the cuboid is centred on the origin, with each edge parallel to one - * of the axes. - * - * ```js - * const geometry = new THREE.BoxGeometry( 1, 1, 1 ); - * const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } ); - * const cube = new THREE.Mesh( geometry, material ); - * scene.add( cube ); - * ``` - * - * @augments BufferGeometry - * @demo scenes/geometry-browser.html#BoxGeometry - */ -export class BoxGeometry extends BufferGeometry { - /** - * Factory method for creating an instance of this class from the given - * JSON object. - * - * @param {Object} data - A JSON object representing the serialized geometry. - * @return {BoxGeometry} A new instance. - */ - static fromJSON(data: Object): BoxGeometry; - /** - * Constructs a new box geometry. - * - * @param {number} [width=1] - The width. That is, the length of the edges parallel to the X axis. - * @param {number} [height=1] - The height. That is, the length of the edges parallel to the Y axis. - * @param {number} [depth=1] - The depth. That is, the length of the edges parallel to the Z axis. - * @param {number} [widthSegments=1] - Number of segmented rectangular faces along the width of the sides. - * @param {number} [heightSegments=1] - Number of segmented rectangular faces along the height of the sides. - * @param {number} [depthSegments=1] - Number of segmented rectangular faces along the depth of the sides. - */ - constructor(width?: number, height?: number, depth?: number, widthSegments?: number, heightSegments?: number, depthSegments?: number); - /** - * Holds the constructor parameters that have been - * used to generate the geometry. Any modification - * after instantiation does not change the geometry. - * - * @type {Object} - */ - parameters: Object; - copy(source: any): this; -} -import { BufferGeometry } from '../core/BufferGeometry.js'; diff --git a/jsdoc-testing/jsdoc/geometries/ConeGeometry.d.ts b/jsdoc-testing/jsdoc/geometries/ConeGeometry.d.ts deleted file mode 100644 index 0df48d532..000000000 --- a/jsdoc-testing/jsdoc/geometries/ConeGeometry.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * A geometry class for representing a cone. - * - * ```js - * const geometry = new THREE.ConeGeometry( 5, 20, 32 ); - * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } ); - * const cone = new THREE.Mesh(geometry, material ); - * scene.add( cone ); - * ``` - * - * @augments CylinderGeometry - * @demo scenes/geometry-browser.html#ConeGeometry - */ -export class ConeGeometry extends CylinderGeometry { - /** - * Constructs a new cone geometry. - * - * @param {number} [radius=1] - Radius of the cone base. - * @param {number} [height=1] - Height of the cone. - * @param {number} [radialSegments=32] - Number of segmented faces around the circumference of the cone. - * @param {number} [heightSegments=1] - Number of rows of faces along the height of the cone. - * @param {boolean} [openEnded=false] - Whether the base of the cone is open or capped. - * @param {number} [thetaStart=0] - Start angle for first segment, in radians. - * @param {number} [thetaLength=Math.PI*2] - The central angle, often called theta, of the circular sector, in radians. - * The default value results in a complete cone. - */ - constructor(radius?: number, height?: number, radialSegments?: number, heightSegments?: number, openEnded?: boolean, thetaStart?: number, thetaLength?: number); -} -import { CylinderGeometry } from './CylinderGeometry.js'; diff --git a/jsdoc-testing/jsdoc/geometries/CylinderGeometry.d.ts b/jsdoc-testing/jsdoc/geometries/CylinderGeometry.d.ts deleted file mode 100644 index 6b28774bd..000000000 --- a/jsdoc-testing/jsdoc/geometries/CylinderGeometry.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -/** - * A geometry class for representing a cylinder. - * - * ```js - * const geometry = new THREE.CylinderGeometry( 5, 5, 20, 32 ); - * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } ); - * const cylinder = new THREE.Mesh( geometry, material ); - * scene.add( cylinder ); - * ``` - * - * @augments BufferGeometry - * @demo scenes/geometry-browser.html#CylinderGeometry - */ -export class CylinderGeometry extends BufferGeometry { - /** - * Factory method for creating an instance of this class from the given - * JSON object. - * - * @param {Object} data - A JSON object representing the serialized geometry. - * @return {CylinderGeometry} A new instance. - */ - static fromJSON(data: Object): CylinderGeometry; - /** - * Constructs a new cylinder geometry. - * - * @param {number} [radiusTop=1] - Radius of the cylinder at the top. - * @param {number} [radiusBottom=1] - Radius of the cylinder at the bottom. - * @param {number} [height=1] - Height of the cylinder. - * @param {number} [radialSegments=32] - Number of segmented faces around the circumference of the cylinder. - * @param {number} [heightSegments=1] - Number of rows of faces along the height of the cylinder. - * @param {boolean} [openEnded=false] - Whether the base of the cylinder is open or capped. - * @param {number} [thetaStart=0] - Start angle for first segment, in radians. - * @param {number} [thetaLength=Math.PI*2] - The central angle, often called theta, of the circular sector, in radians. - * The default value results in a complete cylinder. - */ - constructor(radiusTop?: number, radiusBottom?: number, height?: number, radialSegments?: number, heightSegments?: number, openEnded?: boolean, thetaStart?: number, thetaLength?: number); - /** - * Holds the constructor parameters that have been - * used to generate the geometry. Any modification - * after instantiation does not change the geometry. - * - * @type {Object} - */ - parameters: Object; - copy(source: any): this; -} -import { BufferGeometry } from '../core/BufferGeometry.js'; diff --git a/jsdoc-testing/jsdoc/geometries/OctahedronGeometry.d.ts b/jsdoc-testing/jsdoc/geometries/OctahedronGeometry.d.ts deleted file mode 100644 index d61fe28a2..000000000 --- a/jsdoc-testing/jsdoc/geometries/OctahedronGeometry.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * A geometry class for representing an octahedron. - * - * ```js - * const geometry = new THREE.OctahedronGeometry(); - * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } ); - * const octahedron = new THREE.Mesh( geometry, material ); - * scene.add( octahedron ); - * ``` - * - * @augments PolyhedronGeometry - * @demo scenes/geometry-browser.html#OctahedronGeometry - */ -export class OctahedronGeometry extends PolyhedronGeometry { - /** - * Constructs a new octahedron geometry. - * - * @param {number} [radius=1] - Radius of the octahedron. - * @param {number} [detail=0] - Setting this to a value greater than `0` adds vertices making it no longer a octahedron. - */ - constructor(radius?: number, detail?: number); -} -import { PolyhedronGeometry } from './PolyhedronGeometry.js'; diff --git a/jsdoc-testing/jsdoc/geometries/PlaneGeometry.d.ts b/jsdoc-testing/jsdoc/geometries/PlaneGeometry.d.ts deleted file mode 100644 index d75a367ea..000000000 --- a/jsdoc-testing/jsdoc/geometries/PlaneGeometry.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * A geometry class for representing a plane. - * - * ```js - * const geometry = new THREE.PlaneGeometry( 1, 1 ); - * const material = new THREE.MeshBasicMaterial( { color: 0xffff00, side: THREE.DoubleSide } ); - * const plane = new THREE.Mesh( geometry, material ); - * scene.add( plane ); - * ``` - * - * @augments BufferGeometry - * @demo scenes/geometry-browser.html#PlaneGeometry - */ -export class PlaneGeometry extends BufferGeometry { - /** - * Factory method for creating an instance of this class from the given - * JSON object. - * - * @param {Object} data - A JSON object representing the serialized geometry. - * @return {PlaneGeometry} A new instance. - */ - static fromJSON(data: Object): PlaneGeometry; - /** - * Constructs a new plane geometry. - * - * @param {number} [width=1] - The width along the X axis. - * @param {number} [height=1] - The height along the Y axis - * @param {number} [widthSegments=1] - The number of segments along the X axis. - * @param {number} [heightSegments=1] - The number of segments along the Y axis. - */ - constructor(width?: number, height?: number, widthSegments?: number, heightSegments?: number); - /** - * Holds the constructor parameters that have been - * used to generate the geometry. Any modification - * after instantiation does not change the geometry. - * - * @type {Object} - */ - parameters: Object; - copy(source: any): this; -} -import { BufferGeometry } from '../core/BufferGeometry.js'; diff --git a/jsdoc-testing/jsdoc/geometries/PolyhedronGeometry.d.ts b/jsdoc-testing/jsdoc/geometries/PolyhedronGeometry.d.ts deleted file mode 100644 index c0ef0437c..000000000 --- a/jsdoc-testing/jsdoc/geometries/PolyhedronGeometry.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * A polyhedron is a solid in three dimensions with flat faces. This class - * will take an array of vertices, project them onto a sphere, and then - * divide them up to the desired level of detail. - * - * @augments BufferGeometry - */ -export class PolyhedronGeometry extends BufferGeometry { - /** - * Factory method for creating an instance of this class from the given - * JSON object. - * - * @param {Object} data - A JSON object representing the serialized geometry. - * @return {PolyhedronGeometry} A new instance. - */ - static fromJSON(data: Object): PolyhedronGeometry; - /** - * Constructs a new polyhedron geometry. - * - * @param {Array} [vertices] - A flat array of vertices describing the base shape. - * @param {Array} [indices] - A flat array of indices describing the base shape. - * @param {number} [radius=1] - The radius of the shape. - * @param {number} [detail=0] - How many levels to subdivide the geometry. The more detail, the smoother the shape. - */ - constructor(vertices?: Array, indices?: Array, radius?: number, detail?: number); - /** - * Holds the constructor parameters that have been - * used to generate the geometry. Any modification - * after instantiation does not change the geometry. - * - * @type {Object} - */ - parameters: Object; - copy(source: any): this; -} -import { BufferGeometry } from '../core/BufferGeometry.js'; diff --git a/jsdoc-testing/jsdoc/geometries/SphereGeometry.d.ts b/jsdoc-testing/jsdoc/geometries/SphereGeometry.d.ts deleted file mode 100644 index b150fa7df..000000000 --- a/jsdoc-testing/jsdoc/geometries/SphereGeometry.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** - * A class for generating a sphere geometry. - * - * ```js - * const geometry = new THREE.SphereGeometry( 15, 32, 16 ); - * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } ); - * const sphere = new THREE.Mesh( geometry, material ); - * scene.add( sphere ); - * ``` - * - * @augments BufferGeometry - * @demo scenes/geometry-browser.html#SphereGeometry - */ -export class SphereGeometry extends BufferGeometry { - /** - * Factory method for creating an instance of this class from the given - * JSON object. - * - * @param {Object} data - A JSON object representing the serialized geometry. - * @return {SphereGeometry} A new instance. - */ - static fromJSON(data: Object): SphereGeometry; - /** - * Constructs a new sphere geometry. - * - * @param {number} [radius=1] - The sphere radius. - * @param {number} [widthSegments=32] - The number of horizontal segments. Minimum value is `3`. - * @param {number} [heightSegments=16] - The number of vertical segments. Minimum value is `2`. - * @param {number} [phiStart=0] - The horizontal starting angle in radians. - * @param {number} [phiLength=Math.PI*2] - The horizontal sweep angle size. - * @param {number} [thetaStart=0] - The vertical starting angle in radians. - * @param {number} [thetaLength=Math.PI] - The vertical sweep angle size. - */ - constructor(radius?: number, widthSegments?: number, heightSegments?: number, phiStart?: number, phiLength?: number, thetaStart?: number, thetaLength?: number); - /** - * Holds the constructor parameters that have been - * used to generate the geometry. Any modification - * after instantiation does not change the geometry. - * - * @type {Object} - */ - parameters: Object; - copy(source: any): this; -} -import { BufferGeometry } from '../core/BufferGeometry.js'; diff --git a/jsdoc-testing/jsdoc/helpers/ArrowHelper.d.ts b/jsdoc-testing/jsdoc/helpers/ArrowHelper.d.ts deleted file mode 100644 index 302ccad5a..000000000 --- a/jsdoc-testing/jsdoc/helpers/ArrowHelper.d.ts +++ /dev/null @@ -1,75 +0,0 @@ -/** - * An 3D arrow object for visualizing directions. - * - * ```js - * const dir = new THREE.Vector3( 1, 2, 0 ); - * - * //normalize the direction vector (convert to vector of length 1) - * dir.normalize(); - * - * const origin = new THREE.Vector3( 0, 0, 0 ); - * const length = 1; - * const hex = 0xffff00; - * - * const arrowHelper = new THREE.ArrowHelper( dir, origin, length, hex ); - * scene.add( arrowHelper ); - * ``` - * - * @augments Object3D - */ -export class ArrowHelper extends Object3D { - /** - * Constructs a new arrow helper. - * - * @param {Vector3} [dir=(0, 0, 1)] - The (normalized) direction vector. - * @param {Vector3} [origin=(0, 0, 0)] - Point at which the arrow starts. - * @param {number} [length=1] - Length of the arrow in world units. - * @param {(number|Color|string)} [color=0xffff00] - Color of the arrow. - * @param {number} [headLength=length*0.2] - The length of the head of the arrow. - * @param {number} [headWidth=headLength*0.2] - The width of the head of the arrow. - */ - constructor(dir?: Vector3, origin?: Vector3, length?: number, color?: (number | Color | string), headLength?: number, headWidth?: number); - type: string; - /** - * The line part of the arrow helper. - * - * @type {Line} - */ - line: Line; - /** - * The cone part of the arrow helper. - * - * @type {Mesh} - */ - cone: Mesh; - /** - * Sets the direction of the helper. - * - * @param {Vector3} dir - The normalized direction vector. - */ - setDirection(dir: Vector3): void; - /** - * Sets the length of the helper. - * - * @param {number} length - Length of the arrow in world units. - * @param {number} [headLength=length*0.2] - The length of the head of the arrow. - * @param {number} [headWidth=headLength*0.2] - The width of the head of the arrow. - */ - setLength(length: number, headLength?: number, headWidth?: number): void; - /** - * Sets the color of the helper. - * - * @param {number|Color|string} color - The color to set. - */ - setColor(color: number | Color | string): void; - copy(source: any): this; - /** - * Frees the GPU-related resources allocated by this instance. Call this - * method whenever this instance is no longer used in your app. - */ - dispose(): void; -} -import { Object3D } from '../core/Object3D.js'; -import { Line } from '../objects/Line.js'; -import { Mesh } from '../objects/Mesh.js'; -import { Vector3 } from '../math/Vector3.js'; diff --git a/jsdoc-testing/jsdoc/helpers/AxesHelper.d.ts b/jsdoc-testing/jsdoc/helpers/AxesHelper.d.ts deleted file mode 100644 index cc7858bfe..000000000 --- a/jsdoc-testing/jsdoc/helpers/AxesHelper.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * An axis object to visualize the 3 axes in a simple way. - * The X axis is red. The Y axis is green. The Z axis is blue. - * - * ```js - * const axesHelper = new THREE.AxesHelper( 5 ); - * scene.add( axesHelper ); - * ``` - * - * @augments LineSegments - */ -export class AxesHelper extends LineSegments { - /** - * Constructs a new axes helper. - * - * @param {number} [size=1] - Size of the lines representing the axes. - */ - constructor(size?: number); - /** - * Defines the colors of the axes helper. - * - * @param {number|Color|string} xAxisColor - The color for the x axis. - * @param {number|Color|string} yAxisColor - The color for the y axis. - * @param {number|Color|string} zAxisColor - The color for the z axis. - * @return {AxesHelper} A reference to this axes helper. - */ - setColors(xAxisColor: number | Color | string, yAxisColor: number | Color | string, zAxisColor: number | Color | string): AxesHelper; - /** - * Frees the GPU-related resources allocated by this instance. Call this - * method whenever this instance is no longer used in your app. - */ - dispose(): void; -} -import { LineSegments } from '../objects/LineSegments.js'; -import { Color } from '../math/Color.js'; diff --git a/jsdoc-testing/jsdoc/helpers/Box3Helper.d.ts b/jsdoc-testing/jsdoc/helpers/Box3Helper.d.ts deleted file mode 100644 index 982072dbb..000000000 --- a/jsdoc-testing/jsdoc/helpers/Box3Helper.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/** - * A helper object to visualize an instance of {@link Box3}. - * - * ```js - * const box = new THREE.Box3(); - * box.setFromCenterAndSize( new THREE.Vector3( 1, 1, 1 ), new THREE.Vector3( 2, 1, 3 ) ); - * - * const helper = new THREE.Box3Helper( box, 0xffff00 ); - * scene.add( helper ) - * ``` - * - * @augments LineSegments - */ -export class Box3Helper extends LineSegments { - /** - * Constructs a new box3 helper. - * - * @param {Box3} box - The box to visualize. - * @param {number|Color|string} [color=0xffff00] - The box's color. - */ - constructor(box: Box3, color?: number | Color | string); - /** - * The box being visualized. - * - * @type {Box3} - */ - box: Box3; - updateMatrixWorld(force: any): void; - /** - * Frees the GPU-related resources allocated by this instance. Call this - * method whenever this instance is no longer used in your app. - */ - dispose(): void; -} -import { LineSegments } from '../objects/LineSegments.js'; diff --git a/jsdoc-testing/jsdoc/helpers/BoxHelper.d.ts b/jsdoc-testing/jsdoc/helpers/BoxHelper.d.ts deleted file mode 100644 index 0b864050e..000000000 --- a/jsdoc-testing/jsdoc/helpers/BoxHelper.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Helper object to graphically show the world-axis-aligned bounding box - * around an object. The actual bounding box is handled with {@link Box3}, - * this is just a visual helper for debugging. It can be automatically - * resized with {@link BoxHelper#update} when the object it's created from - * is transformed. Note that the object must have a geometry for this to work, - * so it won't work with sprites. - * - * ```js - * const sphere = new THREE.SphereGeometry(); - * const object = new THREE.Mesh( sphere, new THREE.MeshBasicMaterial( 0xff0000 ) ); - * const box = new THREE.BoxHelper( object, 0xffff00 ); - * scene.add( box ); - * ``` - * - * @augments LineSegments - */ -export class BoxHelper extends LineSegments { - /** - * The 3D object being visualized. - * - * @type {Object3D} - */ - object: Object3D; - /** - * Updates the helper's geometry to match the dimensions of the object, - * including any children. - */ - update(): void; - /** - * Updates the wireframe box for the passed object. - * - * @param {Object3D} object - The 3D object to create the helper for. - * @return {BoxHelper} A reference to this instance. - */ - setFromObject(object: Object3D): BoxHelper; - copy(source: any, recursive: any): this; - /** - * Frees the GPU-related resources allocated by this instance. Call this - * method whenever this instance is no longer used in your app. - */ - dispose(): void; -} -import { LineSegments } from '../objects/LineSegments.js'; diff --git a/jsdoc-testing/jsdoc/helpers/CameraHelper.d.ts b/jsdoc-testing/jsdoc/helpers/CameraHelper.d.ts deleted file mode 100644 index 69f517585..000000000 --- a/jsdoc-testing/jsdoc/helpers/CameraHelper.d.ts +++ /dev/null @@ -1,64 +0,0 @@ -/** - * This helps with visualizing what a camera contains in its frustum. It - * visualizes the frustum of a camera using a line segments. - * - * Based on frustum visualization in [lightgl.js shadowmap example](https://github.com/evanw/lightgl.js/blob/master/tests/shadowmap.html). - * - * `CameraHelper` must be a child of the scene. - * - * When the camera is transformed or its projection matrix is changed, it's necessary - * to call the `update()` method of the respective helper. - * - * ```js - * const camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 ); - * const helper = new THREE.CameraHelper( camera ); - * scene.add( helper ); - * ``` - * - * @augments LineSegments - */ -export class CameraHelper extends LineSegments { - /** - * Constructs a new arrow helper. - * - * @param {Camera} camera - The camera to visualize. - */ - constructor(camera: Camera); - /** - * The camera being visualized. - * - * @type {Camera} - */ - camera: Camera; - /** - * This contains the points used to visualize the camera. - * - * @type {Object>} - */ - pointMap: { - [x: string]: number[]; - }; - /** - * Defines the colors of the helper. - * - * @param {Color} frustum - The frustum line color. - * @param {Color} cone - The cone line color. - * @param {Color} up - The up line color. - * @param {Color} target - The target line color. - * @param {Color} cross - The cross line color. - * @return {CameraHelper} A reference to this helper. - */ - setColors(frustum: Color, cone: Color, up: Color, target: Color, cross: Color): CameraHelper; - /** - * Updates the helper based on the projection matrix of the camera. - */ - update(): void; - /** - * Frees the GPU-related resources allocated by this instance. Call this - * method whenever this instance is no longer used in your app. - */ - dispose(): void; -} -import { LineSegments } from '../objects/LineSegments.js'; -import { Camera } from '../cameras/Camera.js'; -import { Color } from '../math/Color.js'; diff --git a/jsdoc-testing/jsdoc/helpers/DirectionalLightHelper.d.ts b/jsdoc-testing/jsdoc/helpers/DirectionalLightHelper.d.ts deleted file mode 100644 index edd4fa7ff..000000000 --- a/jsdoc-testing/jsdoc/helpers/DirectionalLightHelper.d.ts +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Helper object to assist with visualizing a {@link DirectionalLight}'s - * effect on the scene. This consists of a plane and a line representing the - * light's position and direction. - * - * When the directional light or its target are transformed or light properties - * are changed, it's necessary to call the `update()` method of the respective helper. - * - * ```js - * const light = new THREE.DirectionalLight( 0xFFFFFF ); - * scene.add( light ); - * - * const helper = new THREE.DirectionalLightHelper( light, 5 ); - * scene.add( helper ); - * ``` - * - * @augments Object3D - */ -export class DirectionalLightHelper extends Object3D { - /** - * Constructs a new directional light helper. - * - * @param {DirectionalLight} light - The light to be visualized. - * @param {number} [size=1] - The dimensions of the plane. - * @param {number|Color|string} [color] - The helper's color. If not set, the helper will take - * the color of the light. - */ - constructor(light: DirectionalLight, size?: number, color?: number | Color | string); - /** - * The light being visualized. - * - * @type {DirectionalLight} - */ - light: DirectionalLight; - matrix: any; - /** - * The color parameter passed in the constructor. - * If not set, the helper will take the color of the light. - * - * @type {number|Color|string} - */ - color: number | Color | string; - type: string; - /** - * Contains the line showing the location of the directional light. - * - * @type {Line} - */ - lightPlane: Line; - /** - * Represents the target line of the directional light. - * - * @type {Line} - */ - targetLine: Line; - /** - * Frees the GPU-related resources allocated by this instance. Call this - * method whenever this instance is no longer used in your app. - */ - dispose(): void; - /** - * Updates the helper to match the position and direction of the - * light being visualized. - */ - update(): void; -} -import { Object3D } from '../core/Object3D.js'; -import { Line } from '../objects/Line.js'; diff --git a/jsdoc-testing/jsdoc/helpers/GridHelper.d.ts b/jsdoc-testing/jsdoc/helpers/GridHelper.d.ts deleted file mode 100644 index c0df154aa..000000000 --- a/jsdoc-testing/jsdoc/helpers/GridHelper.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -/** - * The helper is an object to define grids. Grids are two-dimensional - * arrays of lines. - * - * ```js - * const size = 10; - * const divisions = 10; - * - * const gridHelper = new THREE.GridHelper( size, divisions ); - * scene.add( gridHelper ); - * ``` - * - * @augments LineSegments - */ -export class GridHelper extends LineSegments { - /** - * Constructs a new grid helper. - * - * @param {number} [size=10] - The size of the grid. - * @param {number} [divisions=10] - The number of divisions across the grid. - * @param {number|Color|string} [color1=0x444444] - The color of the center line. - * @param {number|Color|string} [color2=0x888888] - The color of the lines of the grid. - */ - constructor(size?: number, divisions?: number, color1?: number | Color | string, color2?: number | Color | string); - /** - * Frees the GPU-related resources allocated by this instance. Call this - * method whenever this instance is no longer used in your app. - */ - dispose(): void; -} -import { LineSegments } from '../objects/LineSegments.js'; -import { Color } from '../math/Color.js'; diff --git a/jsdoc-testing/jsdoc/helpers/HemisphereLightHelper.d.ts b/jsdoc-testing/jsdoc/helpers/HemisphereLightHelper.d.ts deleted file mode 100644 index 5920f3014..000000000 --- a/jsdoc-testing/jsdoc/helpers/HemisphereLightHelper.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Creates a visual aid consisting of a spherical mesh for a - * given {@link HemisphereLight}. - * - * When the hemisphere light is transformed or its light properties are changed, - * it's necessary to call the `update()` method of the respective helper. - * - * ```js - * const light = new THREE.HemisphereLight( 0xffffbb, 0x080820, 1 ); - * const helper = new THREE.HemisphereLightHelper( light, 5 ); - * scene.add( helper ); - * ``` - * - * @augments Object3D - */ -export class HemisphereLightHelper extends Object3D { - /** - * Constructs a new hemisphere light helper. - * - * @param {HemisphereLight} light - The light to be visualized. - * @param {number} [size=1] - The size of the mesh used to visualize the light. - * @param {number|Color|string} [color] - The helper's color. If not set, the helper will take - * the color of the light. - */ - constructor(light: HemisphereLight, size?: number, color?: number | Color | string); - /** - * The light being visualized. - * - * @type {HemisphereLight} - */ - light: HemisphereLight; - matrix: any; - /** - * The color parameter passed in the constructor. - * If not set, the helper will take the color of the light. - * - * @type {number|Color|string} - */ - color: number | Color | string; - type: string; - material: MeshBasicMaterial; - /** - * Frees the GPU-related resources allocated by this instance. Call this - * method whenever this instance is no longer used in your app. - */ - dispose(): void; - /** - * Updates the helper to match the position and direction of the - * light being visualized. - */ - update(): void; -} -import { Object3D } from '../core/Object3D.js'; -import { Color } from '../math/Color.js'; -import { MeshBasicMaterial } from '../materials/MeshBasicMaterial.js'; diff --git a/jsdoc-testing/jsdoc/helpers/PlaneHelper.d.ts b/jsdoc-testing/jsdoc/helpers/PlaneHelper.d.ts deleted file mode 100644 index be6163223..000000000 --- a/jsdoc-testing/jsdoc/helpers/PlaneHelper.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -/** - * A helper object to visualize an instance of {@link Plane}. - * - * ```js - * const plane = new THREE.Plane( new THREE.Vector3( 1, 1, 0.2 ), 3 ); - * const helper = new THREE.PlaneHelper( plane, 1, 0xffff00 ); - * scene.add( helper ); - * ``` - * - * @augments Line - */ -export class PlaneHelper extends Line { - /** - * Constructs a new plane helper. - * - * @param {Plane} plane - The plane to be visualized. - * @param {number} [size=1] - The side length of plane helper. - * @param {number|Color|string} [hex=0xffff00] - The helper's color. - */ - constructor(plane: Plane, size?: number, hex?: number | Color | string); - /** - * The plane being visualized. - * - * @type {Plane} - */ - plane: Plane; - /** - * The side length of plane helper. - * - * @type {number} - * @default 1 - */ - size: number; - updateMatrixWorld(force: any): void; - /** - * Updates the helper to match the position and direction of the - * light being visualized. - */ - dispose(): void; -} -import { Line } from '../objects/Line.js'; diff --git a/jsdoc-testing/jsdoc/helpers/PointLightHelper.d.ts b/jsdoc-testing/jsdoc/helpers/PointLightHelper.d.ts deleted file mode 100644 index f2f51e312..000000000 --- a/jsdoc-testing/jsdoc/helpers/PointLightHelper.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * This displays a helper object consisting of a spherical mesh for - * visualizing an instance of {@link PointLight}. - * - * ```js - * const pointLight = new THREE.PointLight( 0xff0000, 1, 100 ); - * pointLight.position.set( 10, 10, 10 ); - * scene.add( pointLight ); - * - * const sphereSize = 1; - * const pointLightHelper = new THREE.PointLightHelper( pointLight, sphereSize ); - * scene.add( pointLightHelper ); - * ``` - * - * @augments Mesh - */ -export class PointLightHelper extends Mesh { - /** - * Constructs a new point light helper. - * - * @param {PointLight} light - The light to be visualized. - * @param {number} [sphereSize=1] - The size of the sphere helper. - * @param {number|Color|string} [color] - The helper's color. If not set, the helper will take - * the color of the light. - */ - constructor(light: PointLight, sphereSize?: number, color?: number | Color | string); - /** - * The light being visualized. - * - * @type {PointLight} - */ - light: PointLight; - /** - * The color parameter passed in the constructor. - * If not set, the helper will take the color of the light. - * - * @type {number|Color|string} - */ - color: number | Color | string; - matrix: any; - /** - * Frees the GPU-related resources allocated by this instance. Call this - * method whenever this instance is no longer used in your app. - */ - dispose(): void; - /** - * Updates the helper to match the position of the - * light being visualized. - */ - update(): void; -} -import { Mesh } from '../objects/Mesh.js'; diff --git a/jsdoc-testing/jsdoc/helpers/PolarGridHelper.d.ts b/jsdoc-testing/jsdoc/helpers/PolarGridHelper.d.ts deleted file mode 100644 index 9d4caa9c7..000000000 --- a/jsdoc-testing/jsdoc/helpers/PolarGridHelper.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -/** - * This helper is an object to define polar grids. Grids are - * two-dimensional arrays of lines. - * - * ```js - * const radius = 10; - * const sectors = 16; - * const rings = 8; - * const divisions = 64; - * - * const helper = new THREE.PolarGridHelper( radius, sectors, rings, divisions ); - * scene.add( helper ); - * ``` - * - * @augments LineSegments - */ -export class PolarGridHelper extends LineSegments { - /** - * Constructs a new polar grid helper. - * - * @param {number} [radius=10] - The radius of the polar grid. This can be any positive number. - * @param {number} [sectors=16] - The number of sectors the grid will be divided into. This can be any positive integer. - * @param {number} [rings=16] - The number of rings. This can be any positive integer. - * @param {number} [divisions=64] - The number of line segments used for each circle. This can be any positive integer. - * @param {number|Color|string} [color1=0x444444] - The first color used for grid elements. - * @param {number|Color|string} [color2=0x888888] - The second color used for grid elements. - */ - constructor(radius?: number, sectors?: number, rings?: number, divisions?: number, color1?: number | Color | string, color2?: number | Color | string); - /** - * Frees the GPU-related resources allocated by this instance. Call this - * method whenever this instance is no longer used in your app. - */ - dispose(): void; -} -import { LineSegments } from '../objects/LineSegments.js'; -import { Color } from '../math/Color.js'; diff --git a/jsdoc-testing/jsdoc/helpers/SkeletonHelper.d.ts b/jsdoc-testing/jsdoc/helpers/SkeletonHelper.d.ts deleted file mode 100644 index a129e99ab..000000000 --- a/jsdoc-testing/jsdoc/helpers/SkeletonHelper.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -/** - * A helper object to assist with visualizing a {@link Skeleton}. - * - * ```js - * const helper = new THREE.SkeletonHelper( skinnedMesh ); - * scene.add( helper ); - * ``` - * - * @augments LineSegments - */ -export class SkeletonHelper extends LineSegments { - /** - * Constructs a new skeleton helper. - * - * @param {Object3D} object - Usually an instance of {@link SkinnedMesh}. However, any 3D object - * can be used if it represents a hierarchy of bones (see {@link Bone}). - */ - constructor(object: Object3D); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isSkeletonHelper: boolean; - /** - * The object being visualized. - * - * @type {Object3D} - */ - root: Object3D; - /** - * The list of bones that the helper visualizes. - * - * @type {Array} - */ - bones: Array; - matrix: any; - updateMatrixWorld(force: any): void; - /** - * Defines the colors of the helper. - * - * @param {Color} color1 - The first line color for each bone. - * @param {Color} color2 - The second line color for each bone. - * @return {SkeletonHelper} A reference to this helper. - */ - setColors(color1: Color, color2: Color): SkeletonHelper; - /** - * Frees the GPU-related resources allocated by this instance. Call this - * method whenever this instance is no longer used in your app. - */ - dispose(): void; -} -import { LineSegments } from '../objects/LineSegments.js'; -import { Color } from '../math/Color.js'; diff --git a/jsdoc-testing/jsdoc/helpers/SpotLightHelper.d.ts b/jsdoc-testing/jsdoc/helpers/SpotLightHelper.d.ts deleted file mode 100644 index 7e73edcef..000000000 --- a/jsdoc-testing/jsdoc/helpers/SpotLightHelper.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -/** - * This displays a cone shaped helper object for a {@link SpotLight}. - * - * When the spot light or its target are transformed or light properties are - * changed, it's necessary to call the `update()` method of the respective helper. - * - * ```js - * const spotLight = new THREE.SpotLight( 0xffffff ); - * spotLight.position.set( 10, 10, 10 ); - * scene.add( spotLight ); - * - * const spotLightHelper = new THREE.SpotLightHelper( spotLight ); - * scene.add( spotLightHelper ); - * ``` - * - * @augments Object3D - */ -export class SpotLightHelper extends Object3D { - /** - * Constructs a new spot light helper. - * - * @param {HemisphereLight} light - The light to be visualized. - * @param {number|Color|string} [color] - The helper's color. If not set, the helper will take - * the color of the light. - */ - constructor(light: HemisphereLight, color?: number | Color | string); - /** - * The light being visualized. - * - * @type {SpotLight} - */ - light: SpotLight; - /** - * The color parameter passed in the constructor. - * If not set, the helper will take the color of the light. - * - * @type {number|Color|string} - */ - color: number | Color | string; - type: string; - cone: LineSegments; - /** - * Frees the GPU-related resources allocated by this instance. Call this - * method whenever this instance is no longer used in your app. - */ - dispose(): void; - /** - * Updates the helper to match the position and direction of the - * light being visualized. - */ - update(): void; -} -import { Object3D } from '../core/Object3D.js'; -import { LineSegments } from '../objects/LineSegments.js'; diff --git a/jsdoc-testing/jsdoc/lights/AmbientLight.d.ts b/jsdoc-testing/jsdoc/lights/AmbientLight.d.ts deleted file mode 100644 index 78c3196fd..000000000 --- a/jsdoc-testing/jsdoc/lights/AmbientLight.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * This light globally illuminates all objects in the scene equally. - * - * It cannot be used to cast shadows as it does not have a direction. - * - * ```js - * const light = new THREE.AmbientLight( 0x404040 ); // soft white light - * scene.add( light ); - * ``` - * - * @augments Light - */ -export class AmbientLight extends Light { - /** - * Constructs a new ambient light. - * - * @param {(number|Color|string)} [color=0xffffff] - The light's color. - * @param {number} [intensity=1] - The light's strength/intensity. - */ - constructor(color?: (number | Color | string), intensity?: number); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isAmbientLight: boolean; -} -import { Light } from './Light.js'; diff --git a/jsdoc-testing/jsdoc/lights/DirectionalLight.d.ts b/jsdoc-testing/jsdoc/lights/DirectionalLight.d.ts deleted file mode 100644 index 753317423..000000000 --- a/jsdoc-testing/jsdoc/lights/DirectionalLight.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -/** - * A light that gets emitted in a specific direction. This light will behave - * as though it is infinitely far away and the rays produced from it are all - * parallel. The common use case for this is to simulate daylight; the sun is - * far enough away that its position can be considered to be infinite, and - * all light rays coming from it are parallel. - * - * A common point of confusion for directional lights is that setting the - * rotation has no effect. This is because three.js's DirectionalLight is the - * equivalent to what is often called a 'Target Direct Light' in other - * applications. - * - * This means that its direction is calculated as pointing from the light's - * {@link Object3D#position} to the {@link DirectionalLight#target} position - * (as opposed to a 'Free Direct Light' that just has a rotation - * component). - * - * This light can cast shadows - see the {@link DirectionalLightShadow} for details. - * - * ```js - * // White directional light at half intensity shining from the top. - * const directionalLight = new THREE.DirectionalLight( 0xffffff, 0.5 ); - * scene.add( directionalLight ); - * ``` - * - * @augments Light - */ -export class DirectionalLight extends Light { - /** - * Constructs a new directional light. - * - * @param {(number|Color|string)} [color=0xffffff] - The light's color. - * @param {number} [intensity=1] - The light's strength/intensity. - */ - constructor(color?: (number | Color | string), intensity?: number); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isDirectionalLight: boolean; - /** - * The directional light points from its position to the - * target's position. - * - * For the target's position to be changed to anything other - * than the default, it must be added to the scene. - * - * It is also possible to set the target to be another 3D object - * in the scene. The light will now track the target object. - * - * @type {Object3D} - */ - target: Object3D; - /** - * This property holds the light's shadow configuration. - * - * @type {DirectionalLightShadow} - */ - shadow: DirectionalLightShadow; - copy(source: any): this; -} -import { Light } from './Light.js'; -import { Object3D } from '../core/Object3D.js'; -import { DirectionalLightShadow } from './DirectionalLightShadow.js'; diff --git a/jsdoc-testing/jsdoc/lights/DirectionalLightShadow.d.ts b/jsdoc-testing/jsdoc/lights/DirectionalLightShadow.d.ts deleted file mode 100644 index 69d809ea1..000000000 --- a/jsdoc-testing/jsdoc/lights/DirectionalLightShadow.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Represents the shadow configuration of directional lights. - * - * @augments LightShadow - */ -export class DirectionalLightShadow extends LightShadow { - /** - * Constructs a new directional light shadow. - */ - constructor(); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isDirectionalLightShadow: boolean; -} -import { LightShadow } from './LightShadow.js'; diff --git a/jsdoc-testing/jsdoc/lights/HemisphereLight.d.ts b/jsdoc-testing/jsdoc/lights/HemisphereLight.d.ts deleted file mode 100644 index 9bffa0d03..000000000 --- a/jsdoc-testing/jsdoc/lights/HemisphereLight.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -/** - * A light source positioned directly above the scene, with color fading from - * the sky color to the ground color. - * - * This light cannot be used to cast shadows. - * - * ```js - * const light = new THREE.HemisphereLight( 0xffffbb, 0x080820, 1 ); - * scene.add( light ); - * ``` - * - * @augments Light - */ -export class HemisphereLight extends Light { - /** - * Constructs a new hemisphere light. - * - * @param {(number|Color|string)} [skyColor=0xffffff] - The light's sky color. - * @param {(number|Color|string)} [groundColor=0xffffff] - The light's ground color. - * @param {number} [intensity=1] - The light's strength/intensity. - */ - constructor(skyColor?: (number | Color | string), groundColor?: (number | Color | string), intensity?: number); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isHemisphereLight: boolean; - /** - * The light's ground color. - * - * @type {Color} - */ - groundColor: Color; - copy(source: any, recursive: any): this; -} -import { Light } from './Light.js'; -import { Color } from '../math/Color.js'; diff --git a/jsdoc-testing/jsdoc/lights/Light.d.ts b/jsdoc-testing/jsdoc/lights/Light.d.ts deleted file mode 100644 index 15a77b361..000000000 --- a/jsdoc-testing/jsdoc/lights/Light.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Abstract base class for lights - all other light types inherit the - * properties and methods described here. - * - * @abstract - * @augments Object3D - */ -export class Light extends Object3D { - /** - * Constructs a new light. - * - * @param {(number|Color|string)} [color=0xffffff] - The light's color. - * @param {number} [intensity=1] - The light's strength/intensity. - */ - constructor(color?: (number | Color | string), intensity?: number); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isLight: boolean; - type: string; - /** - * The light's color. - * - * @type {Color} - */ - color: Color; - /** - * The light's intensity. - * - * @type {number} - * @default 1 - */ - intensity: number; - /** - * Frees the GPU-related resources allocated by this instance. Call this - * method whenever this instance is no longer used in your app. - */ - dispose(): void; - copy(source: any, recursive: any): this; - toJSON(meta: any): Object; -} -import { Object3D } from '../core/Object3D.js'; -import { Color } from '../math/Color.js'; diff --git a/jsdoc-testing/jsdoc/lights/LightProbe.d.ts b/jsdoc-testing/jsdoc/lights/LightProbe.d.ts deleted file mode 100644 index 8a03aa8cf..000000000 --- a/jsdoc-testing/jsdoc/lights/LightProbe.d.ts +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Light probes are an alternative way of adding light to a 3D scene. Unlike - * classical light sources (e.g. directional, point or spot lights), light - * probes do not emit light. Instead they store information about light - * passing through 3D space. During rendering, the light that hits a 3D - * object is approximated by using the data from the light probe. - * - * Light probes are usually created from (radiance) environment maps. The - * class {@link LightProbeGenerator} can be used to create light probes from - * cube textures or render targets. However, light estimation data could also - * be provided in other forms e.g. by WebXR. This enables the rendering of - * augmented reality content that reacts to real world lighting. - * - * The current probe implementation in three.js supports so-called diffuse - * light probes. This type of light probe is functionally equivalent to an - * irradiance environment map. - * - * @augments Light - */ -export class LightProbe extends Light { - /** - * Constructs a new light probe. - * - * @param {SphericalHarmonics3} sh - The spherical harmonics which represents encoded lighting information. - * @param {number} [intensity=1] - The light's strength/intensity. - */ - constructor(sh?: SphericalHarmonics3, intensity?: number); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isLightProbe: boolean; - /** - * A light probe uses spherical harmonics to encode lighting information. - * - * @type {SphericalHarmonics3} - */ - sh: SphericalHarmonics3; - copy(source: any): this; -} -import { Light } from './Light.js'; -import { SphericalHarmonics3 } from '../math/SphericalHarmonics3.js'; diff --git a/jsdoc-testing/jsdoc/lights/LightShadow.d.ts b/jsdoc-testing/jsdoc/lights/LightShadow.d.ts deleted file mode 100644 index 24ffaf5b3..000000000 --- a/jsdoc-testing/jsdoc/lights/LightShadow.d.ts +++ /dev/null @@ -1,198 +0,0 @@ -/** - * Abstract base class for light shadow classes. These classes - * represent the shadow configuration for different light types. - * - * @abstract - */ -export class LightShadow { - /** - * Constructs a new light shadow. - * - * @param {Camera} camera - The light's view of the world. - */ - constructor(camera: Camera); - /** - * The light's view of the world. - * - * @type {Camera} - */ - camera: Camera; - /** - * The intensity of the shadow. The default is `1`. - * Valid values are in the range `[0, 1]`. - * - * @type {number} - * @default 1 - */ - intensity: number; - /** - * Shadow map bias, how much to add or subtract from the normalized depth - * when deciding whether a surface is in shadow. - * - * The default is `0`. Very tiny adjustments here (in the order of `0.0001`) - * may help reduce artifacts in shadows. - * - * @type {number} - * @default 0 - */ - bias: number; - /** - * A node version of `bias`. Only supported with `WebGPURenderer`. - * - * If a bias node is defined, `bias` has no effect. - * - * @type {?Node} - * @default null - */ - biasNode: Node | null; - /** - * Defines how much the position used to query the shadow map is offset along - * the object normal. The default is `0`. Increasing this value can be used to - * reduce shadow acne especially in large scenes where light shines onto - * geometry at a shallow angle. The cost is that shadows may appear distorted. - * - * @type {number} - * @default 0 - */ - normalBias: number; - /** - * Setting this to values greater than 1 will blur the edges of the shadow. - * High values will cause unwanted banding effects in the shadows - a greater - * map size will allow for a higher value to be used here before these effects - * become visible. - * - * The property has no effect when the shadow map type is `BasicShadowMap`. - * - * @type {number} - * @default 1 - */ - radius: number; - /** - * The amount of samples to use when blurring a VSM shadow map. - * - * @type {number} - * @default 8 - */ - blurSamples: number; - /** - * Defines the width and height of the shadow map. Higher values give better quality - * shadows at the cost of computation time. Values must be powers of two. - * - * @type {Vector2} - * @default (512,512) - */ - mapSize: Vector2; - /** - * The type of shadow texture. The default is `UnsignedByteType`. - * - * @type {number} - * @default UnsignedByteType - */ - mapType: number; - /** - * The depth map generated using the internal camera; a location beyond a - * pixel's depth is in shadow. Computed internally during rendering. - * - * @type {?RenderTarget} - * @default null - */ - map: RenderTarget | null; - /** - * The distribution map generated using the internal camera; an occlusion is - * calculated based on the distribution of depths. Computed internally during - * rendering. - * - * @type {?RenderTarget} - * @default null - */ - mapPass: RenderTarget | null; - /** - * Model to shadow camera space, to compute location and depth in shadow map. - * This is computed internally during rendering. - * - * @type {Matrix4} - */ - matrix: Matrix4; - /** - * Enables automatic updates of the light's shadow. If you do not require dynamic - * lighting / shadows, you may set this to `false`. - * - * @type {boolean} - * @default true - */ - autoUpdate: boolean; - /** - * When set to `true`, shadow maps will be updated in the next `render` call. - * If you have set {@link LightShadow#autoUpdate} to `false`, you will need to - * set this property to `true` and then make a render call to update the light's shadow. - * - * @type {boolean} - * @default false - */ - needsUpdate: boolean; - _frustum: Frustum; - _frameExtents: Vector2; - _viewportCount: number; - _viewports: Vector4[]; - /** - * Used internally by the renderer to get the number of viewports that need - * to be rendered for this shadow. - * - * @return {number} The viewport count. - */ - getViewportCount(): number; - /** - * Gets the shadow cameras frustum. Used internally by the renderer to cull objects. - * - * @return {Frustum} The shadow camera frustum. - */ - getFrustum(): Frustum; - /** - * Update the matrices for the camera and shadow, used internally by the renderer. - * - * @param {Light} light - The light for which the shadow is being rendered. - */ - updateMatrices(light: Light): void; - /** - * Returns a viewport definition for the given viewport index. - * - * @param {number} viewportIndex - The viewport index. - * @return {Vector4} The viewport. - */ - getViewport(viewportIndex: number): Vector4; - /** - * Returns the frame extends. - * - * @return {Vector2} The frame extends. - */ - getFrameExtents(): Vector2; - /** - * Frees the GPU-related resources allocated by this instance. Call this - * method whenever this instance is no longer used in your app. - */ - dispose(): void; - /** - * Copies the values of the given light shadow instance to this instance. - * - * @param {LightShadow} source - The light shadow to copy. - * @return {LightShadow} A reference to this light shadow instance. - */ - copy(source: LightShadow): LightShadow; - /** - * Returns a new light shadow instance with copied values from this instance. - * - * @return {LightShadow} A clone of this instance. - */ - clone(): LightShadow; - /** - * Serializes the light shadow into JSON. - * - * @return {Object} A JSON object representing the serialized light shadow. - * @see {@link ObjectLoader#parse} - */ - toJSON(): Object; -} -import { Vector2 } from '../math/Vector2.js'; -import { Matrix4 } from '../math/Matrix4.js'; -import { Frustum } from '../math/Frustum.js'; -import { Vector4 } from '../math/Vector4.js'; diff --git a/jsdoc-testing/jsdoc/lights/PointLight.d.ts b/jsdoc-testing/jsdoc/lights/PointLight.d.ts deleted file mode 100644 index f42ec0f7c..000000000 --- a/jsdoc-testing/jsdoc/lights/PointLight.d.ts +++ /dev/null @@ -1,70 +0,0 @@ -/** - * A light that gets emitted from a single point in all directions. A common - * use case for this is to replicate the light emitted from a bare - * lightbulb. - * - * This light can cast shadows - see the {@link PointLightShadow} for details. - * - * ```js - * const light = new THREE.PointLight( 0xff0000, 1, 100 ); - * light.position.set( 50, 50, 50 ); - * scene.add( light ); - * ``` - * - * @augments Light - */ -export class PointLight extends Light { - /** - * Constructs a new point light. - * - * @param {(number|Color|string)} [color=0xffffff] - The light's color. - * @param {number} [intensity=1] - The light's strength/intensity measured in candela (cd). - * @param {number} [distance=0] - Maximum range of the light. `0` means no limit. - * @param {number} [decay=2] - The amount the light dims along the distance of the light. - */ - constructor(color?: (number | Color | string), intensity?: number, distance?: number, decay?: number); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isPointLight: boolean; - /** - * When distance is zero, light will attenuate according to inverse-square - * law to infinite distance. When distance is non-zero, light will attenuate - * according to inverse-square law until near the distance cutoff, where it - * will then attenuate quickly and smoothly to 0. Inherently, cutoffs are not - * physically correct. - * - * @type {number} - * @default 0 - */ - distance: number; - /** - * The amount the light dims along the distance of the light. In context of - * physically-correct rendering the default value should not be changed. - * - * @type {number} - * @default 2 - */ - decay: number; - /** - * This property holds the light's shadow configuration. - * - * @type {PointLightShadow} - */ - shadow: PointLightShadow; - set power(power: number); - /** - * The light's power. Power is the luminous power of the light measured in lumens (lm). - * Changing the power will also change the light's intensity. - * - * @type {number} - */ - get power(): number; - copy(source: any, recursive: any): this; -} -import { Light } from './Light.js'; -import { PointLightShadow } from './PointLightShadow.js'; diff --git a/jsdoc-testing/jsdoc/lights/PointLightShadow.d.ts b/jsdoc-testing/jsdoc/lights/PointLightShadow.d.ts deleted file mode 100644 index 9157a63b8..000000000 --- a/jsdoc-testing/jsdoc/lights/PointLightShadow.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Represents the shadow configuration of point lights. - * - * @augments LightShadow - */ -export class PointLightShadow extends LightShadow { - /** - * Constructs a new point light shadow. - */ - constructor(); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isPointLightShadow: boolean; -} -import { LightShadow } from './LightShadow.js'; diff --git a/jsdoc-testing/jsdoc/lights/RectAreaLight.d.ts b/jsdoc-testing/jsdoc/lights/RectAreaLight.d.ts deleted file mode 100644 index 6d4b7b657..000000000 --- a/jsdoc-testing/jsdoc/lights/RectAreaLight.d.ts +++ /dev/null @@ -1,68 +0,0 @@ -/** - * This class emits light uniformly across the face a rectangular plane. - * This light type can be used to simulate light sources such as bright - * windows or strip lighting. - * - * Important Notes: - * - * - There is no shadow support. - * - Only PBR materials are supported. - * - You have to include `RectAreaLightUniformsLib` (`WebGLRenderer`) or `RectAreaLightTexturesLib` (`WebGPURenderer`) - * into your app and init the uniforms/textures. - * - * ```js - * RectAreaLightUniformsLib.init(); // only relevant for WebGLRenderer - * THREE.RectAreaLightNode.setLTC( RectAreaLightTexturesLib.init() ); // only relevant for WebGPURenderer - * - * const intensity = 1; const width = 10; const height = 10; - * const rectLight = new THREE.RectAreaLight( 0xffffff, intensity, width, height ); - * rectLight.position.set( 5, 5, 0 ); - * rectLight.lookAt( 0, 0, 0 ); - * scene.add( rectLight ) - * ``` - * - * @augments Light - */ -export class RectAreaLight extends Light { - /** - * Constructs a new area light. - * - * @param {(number|Color|string)} [color=0xffffff] - The light's color. - * @param {number} [intensity=1] - The light's strength/intensity. - * @param {number} [width=10] - The width of the light. - * @param {number} [height=10] - The height of the light. - */ - constructor(color?: (number | Color | string), intensity?: number, width?: number, height?: number); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isRectAreaLight: boolean; - /** - * The width of the light. - * - * @type {number} - * @default 10 - */ - width: number; - /** - * The height of the light. - * - * @type {number} - * @default 10 - */ - height: number; - set power(power: number); - /** - * The light's power. Power is the luminous power of the light measured in lumens (lm). - * Changing the power will also change the light's intensity. - * - * @type {number} - */ - get power(): number; - copy(source: any): this; -} -import { Light } from './Light.js'; diff --git a/jsdoc-testing/jsdoc/lights/SpotLight.d.ts b/jsdoc-testing/jsdoc/lights/SpotLight.d.ts deleted file mode 100644 index 1197fdf27..000000000 --- a/jsdoc-testing/jsdoc/lights/SpotLight.d.ts +++ /dev/null @@ -1,116 +0,0 @@ -/** - * This light gets emitted from a single point in one direction, along a cone - * that increases in size the further from the light it gets. - * - * This light can cast shadows - see the {@link SpotLightShadow} for details. - * - * ```js - * // white spotlight shining from the side, modulated by a texture - * const spotLight = new THREE.SpotLight( 0xffffff ); - * spotLight.position.set( 100, 1000, 100 ); - * spotLight.map = new THREE.TextureLoader().load( url ); - * - * spotLight.castShadow = true; - * spotLight.shadow.mapSize.width = 1024; - * spotLight.shadow.mapSize.height = 1024; - * spotLight.shadow.camera.near = 500; - * spotLight.shadow.camera.far = 4000; - * spotLight.shadow.camera.fov = 30;s - * ``` - * - * @augments Light - */ -export class SpotLight extends Light { - /** - * Constructs a new spot light. - * - * @param {(number|Color|string)} [color=0xffffff] - The light's color. - * @param {number} [intensity=1] - The light's strength/intensity measured in candela (cd). - * @param {number} [distance=0] - Maximum range of the light. `0` means no limit. - * @param {number} [angle=Math.PI/3] - Maximum angle of light dispersion from its direction whose upper bound is `Math.PI/2`. - * @param {number} [penumbra=0] - Percent of the spotlight cone that is attenuated due to penumbra. Value range is `[0,1]`. - * @param {number} [decay=2] - The amount the light dims along the distance of the light. - */ - constructor(color?: (number | Color | string), intensity?: number, distance?: number, angle?: number, penumbra?: number, decay?: number); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isSpotLight: boolean; - /** - * The spot light points from its position to the - * target's position. - * - * For the target's position to be changed to anything other - * than the default, it must be added to the scene. - * - * It is also possible to set the target to be another 3D object - * in the scene. The light will now track the target object. - * - * @type {Object3D} - */ - target: Object3D; - /** - * Maximum range of the light. `0` means no limit. - * - * @type {number} - * @default 0 - */ - distance: number; - /** - * Maximum angle of light dispersion from its direction whose upper bound is `Math.PI/2`. - * - * @type {number} - * @default Math.PI/3 - */ - angle: number; - /** - * Percent of the spotlight cone that is attenuated due to penumbra. - * Value range is `[0,1]`. - * - * @type {number} - * @default 0 - */ - penumbra: number; - /** - * The amount the light dims along the distance of the light. In context of - * physically-correct rendering the default value should not be changed. - * - * @type {number} - * @default 2 - */ - decay: number; - /** - * A texture used to modulate the color of the light. The spot light - * color is mixed with the RGB value of this texture, with a ratio - * corresponding to its alpha value. The cookie-like masking effect is - * reproduced using pixel values (0, 0, 0, 1-cookie_value). - * - * *Warning*: This property is disabled if {@link Object3D#castShadow} is set to `false`. - * - * @type {?Texture} - * @default null - */ - map: Texture | null; - /** - * This property holds the light's shadow configuration. - * - * @type {SpotLightShadow} - */ - shadow: SpotLightShadow; - set power(power: number); - /** - * The light's power. Power is the luminous power of the light measured in lumens (lm). - * Changing the power will also change the light's intensity. - * - * @type {number} - */ - get power(): number; - copy(source: any, recursive: any): this; -} -import { Light } from './Light.js'; -import { Object3D } from '../core/Object3D.js'; -import { SpotLightShadow } from './SpotLightShadow.js'; diff --git a/jsdoc-testing/jsdoc/lights/SpotLightShadow.d.ts b/jsdoc-testing/jsdoc/lights/SpotLightShadow.d.ts deleted file mode 100644 index 0de4c95b0..000000000 --- a/jsdoc-testing/jsdoc/lights/SpotLightShadow.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Represents the shadow configuration of directional lights. - * - * @augments LightShadow - */ -export class SpotLightShadow extends LightShadow { - /** - * Constructs a new spot light shadow. - */ - constructor(); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isSpotLightShadow: boolean; - /** - * Used to focus the shadow camera. The camera's field of view is set as a - * percentage of the spotlight's field-of-view. Range is `[0, 1]`. - * - * @type {number} - * @default 1 - */ - focus: number; - /** - * Texture aspect ratio. - * - * @type {number} - * @default 1 - */ - aspect: number; - updateMatrices(light: any): void; - copy(source: any): this; -} -import { LightShadow } from './LightShadow.js'; diff --git a/jsdoc-testing/jsdoc/lights/webgpu/IESSpotLight.d.ts b/jsdoc-testing/jsdoc/lights/webgpu/IESSpotLight.d.ts deleted file mode 100644 index 0e372ff20..000000000 --- a/jsdoc-testing/jsdoc/lights/webgpu/IESSpotLight.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -export default IESSpotLight; -/** - * A IES version of {@link SpotLight}. Can only be used with {@link WebGPURenderer}. - * - * @augments SpotLight - */ -declare class IESSpotLight extends SpotLight { - /** - * The IES map. It's a lookup table that stores normalized attenuation factors - * (0.0 to 1.0) that represent the light's intensity at a specific angle. - * - * @type {?Texture} - * @default null - */ - iesMap: Texture | null; - copy(source: any, recursive: any): this; -} -import { SpotLight } from '../SpotLight.js'; diff --git a/jsdoc-testing/jsdoc/lights/webgpu/ProjectorLight.d.ts b/jsdoc-testing/jsdoc/lights/webgpu/ProjectorLight.d.ts deleted file mode 100644 index f561855ff..000000000 --- a/jsdoc-testing/jsdoc/lights/webgpu/ProjectorLight.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -export default ProjectorLight; -/** - * A projector light version of {@link SpotLight}. Can only be used with {@link WebGPURenderer}. - * - * @augments SpotLight - */ -declare class ProjectorLight extends SpotLight { - /** - * Aspect ratio of the light. Set to `null` to use the texture aspect ratio. - * - * @type {?number} - * @default null - */ - aspect: number | null; - copy(source: any, recursive: any): this; -} -import { SpotLight } from '../SpotLight.js'; diff --git a/jsdoc-testing/jsdoc/materials/LineBasicMaterial.d.ts b/jsdoc-testing/jsdoc/materials/LineBasicMaterial.d.ts deleted file mode 100644 index 64e5c7024..000000000 --- a/jsdoc-testing/jsdoc/materials/LineBasicMaterial.d.ts +++ /dev/null @@ -1,86 +0,0 @@ -/** - * A material for rendering line primitives. - * - * Materials define the appearance of renderable 3D objects. - * - * ```js - * const material = new THREE.LineBasicMaterial( { color: 0xffffff } ); - * ``` - * - * @augments Material - */ -export class LineBasicMaterial extends Material { - /** - * Constructs a new line basic material. - * - * @param {Object} [parameters] - An object with one or more properties - * defining the material's appearance. Any property of the material - * (including any property from inherited materials) can be passed - * in here. Color values can be passed any type of value accepted - * by {@link Color#set}. - */ - constructor(parameters?: Object); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isLineBasicMaterial: boolean; - type: string; - /** - * Color of the material. - * - * @type {Color} - * @default (1,1,1) - */ - color: Color; - /** - * Sets the color of the lines using data from a texture. The texture map - * color is modulated by the diffuse `color`. - * - * @type {?Texture} - * @default null - */ - map: Texture | null; - /** - * Controls line thickness or lines. - * - * Can only be used with {@link SVGRenderer}. WebGL and WebGPU - * ignore this setting and always render line primitives with a - * width of one pixel. - * - * @type {number} - * @default 1 - */ - linewidth: number; - /** - * Defines appearance of line ends. - * - * Can only be used with {@link SVGRenderer}. - * - * @type {('butt'|'round'|'square')} - * @default 'round' - */ - linecap: ("butt" | "round" | "square"); - /** - * Defines appearance of line joints. - * - * Can only be used with {@link SVGRenderer}. - * - * @type {('round'|'bevel'|'miter')} - * @default 'round' - */ - linejoin: ("round" | "bevel" | "miter"); - /** - * Whether the material is affected by fog or not. - * - * @type {boolean} - * @default true - */ - fog: boolean; - copy(source: any): this; -} -import { Material } from './Material.js'; -import { Color } from '../math/Color.js'; diff --git a/jsdoc-testing/jsdoc/materials/LineDashedMaterial.d.ts b/jsdoc-testing/jsdoc/materials/LineDashedMaterial.d.ts deleted file mode 100644 index 3cb1a34d8..000000000 --- a/jsdoc-testing/jsdoc/materials/LineDashedMaterial.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -/** - * A material for rendering line primitives. - * - * Materials define the appearance of renderable 3D objects. - * - * ```js - * const material = new THREE.LineDashedMaterial( { - * color: 0xffffff, - * scale: 1, - * dashSize: 3, - * gapSize: 1, - * } ); - * ``` - * - * @augments LineBasicMaterial - */ -export class LineDashedMaterial extends LineBasicMaterial { - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isLineDashedMaterial: boolean; - /** - * The scale of the dashed part of a line. - * - * @type {number} - * @default 1 - */ - scale: number; - /** - * The size of the dash. This is both the gap with the stroke. - * - * @type {number} - * @default 3 - */ - dashSize: number; - /** - * The size of the gap. - * - * @type {number} - * @default 1 - */ - gapSize: number; - copy(source: any): this; -} -import { LineBasicMaterial } from './LineBasicMaterial.js'; diff --git a/jsdoc-testing/jsdoc/materials/Material.d.ts b/jsdoc-testing/jsdoc/materials/Material.d.ts deleted file mode 100644 index c05cd91f7..000000000 --- a/jsdoc-testing/jsdoc/materials/Material.d.ts +++ /dev/null @@ -1,497 +0,0 @@ -/** - * Abstract base class for materials. - * - * Materials define the appearance of renderable 3D objects. - * - * @abstract - * @augments EventDispatcher - */ -export class Material extends EventDispatcher { - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isMaterial: boolean; - /** - * The UUID of the material. - * - * @type {string} - * @readonly - */ - readonly uuid: string; - /** - * The name of the material. - * - * @type {string} - */ - name: string; - /** - * The type property is used for detecting the object type - * in context of serialization/deserialization. - * - * @type {string} - * @readonly - */ - readonly type: string; - /** - * Defines the blending type of the material. - * - * It must be set to `CustomBlending` if custom blending properties like - * {@link Material#blendSrc}, {@link Material#blendDst} or {@link Material#blendEquation} - * should have any effect. - * - * @type {(NoBlending|NormalBlending|AdditiveBlending|SubtractiveBlending|MultiplyBlending|CustomBlending)} - * @default NormalBlending - */ - blending: (NoBlending | number | AdditiveBlending | SubtractiveBlending | MultiplyBlending | CustomBlending); - /** - * Defines which side of faces will be rendered - front, back or both. - * - * @type {(FrontSide|BackSide|DoubleSide)} - * @default FrontSide - */ - side: (number | BackSide | DoubleSide); - /** - * If set to `true`, vertex colors should be used. - * - * The engine supports RGB and RGBA vertex colors depending on whether a three (RGB) or - * four (RGBA) component color buffer attribute is used. - * - * @type {boolean} - * @default false - */ - vertexColors: boolean; - /** - * Defines how transparent the material is. - * A value of `0.0` indicates fully transparent, `1.0` is fully opaque. - * - * If the {@link Material#transparent} is not set to `true`, - * the material will remain fully opaque and this value will only affect its color. - * - * @type {number} - * @default 1 - */ - opacity: number; - /** - * Defines whether this material is transparent. This has an effect on - * rendering as transparent objects need special treatment and are rendered - * after non-transparent objects. - * - * When set to true, the extent to which the material is transparent is - * controlled by {@link Material#opacity}. - * - * @type {boolean} - * @default false - */ - transparent: boolean; - /** - * Enables alpha hashed transparency, an alternative to {@link Material#transparent} or - * {@link Material#alphaTest}. The material will not be rendered if opacity is lower than - * a random threshold. Randomization introduces some grain or noise, but approximates alpha - * blending without the associated problems of sorting. Using TAA can reduce the resulting noise. - * - * @type {boolean} - * @default false - */ - alphaHash: boolean; - /** - * Defines the blending source factor. - * - * @type {(ZeroFactor|OneFactor|SrcColorFactor|OneMinusSrcColorFactor|SrcAlphaFactor|OneMinusSrcAlphaFactor|DstAlphaFactor|OneMinusDstAlphaFactor|DstColorFactor|OneMinusDstColorFactor|SrcAlphaSaturateFactor|ConstantColorFactor|OneMinusConstantColorFactor|ConstantAlphaFactor|OneMinusConstantAlphaFactor)} - * @default SrcAlphaFactor - */ - blendSrc: (ZeroFactor | OneFactor | SrcColorFactor | OneMinusSrcColorFactor | number | number | DstAlphaFactor | OneMinusDstAlphaFactor | DstColorFactor | OneMinusDstColorFactor | SrcAlphaSaturateFactor | ConstantColorFactor | OneMinusConstantColorFactor | ConstantAlphaFactor | OneMinusConstantAlphaFactor); - /** - * Defines the blending destination factor. - * - * @type {(ZeroFactor|OneFactor|SrcColorFactor|OneMinusSrcColorFactor|SrcAlphaFactor|OneMinusSrcAlphaFactor|DstAlphaFactor|OneMinusDstAlphaFactor|DstColorFactor|OneMinusDstColorFactor|SrcAlphaSaturateFactor|ConstantColorFactor|OneMinusConstantColorFactor|ConstantAlphaFactor|OneMinusConstantAlphaFactor)} - * @default OneMinusSrcAlphaFactor - */ - blendDst: (ZeroFactor | OneFactor | SrcColorFactor | OneMinusSrcColorFactor | number | number | DstAlphaFactor | OneMinusDstAlphaFactor | DstColorFactor | OneMinusDstColorFactor | SrcAlphaSaturateFactor | ConstantColorFactor | OneMinusConstantColorFactor | ConstantAlphaFactor | OneMinusConstantAlphaFactor); - /** - * Defines the blending equation. - * - * @type {(AddEquation|SubtractEquation|ReverseSubtractEquation|MinEquation|MaxEquation)} - * @default AddEquation - */ - blendEquation: (number | SubtractEquation | ReverseSubtractEquation | MinEquation | MaxEquation); - /** - * Defines the blending source alpha factor. - * - * @type {?(ZeroFactor|OneFactor|SrcColorFactor|OneMinusSrcColorFactor|SrcAlphaFactor|OneMinusSrcAlphaFactor|DstAlphaFactor|OneMinusDstAlphaFactor|DstColorFactor|OneMinusDstColorFactor|SrcAlphaSaturateFactor|ConstantColorFactor|OneMinusConstantColorFactor|ConstantAlphaFactor|OneMinusConstantAlphaFactor)} - * @default null - */ - blendSrcAlpha: (ZeroFactor | OneFactor | SrcColorFactor | OneMinusSrcColorFactor | number | number | DstAlphaFactor | OneMinusDstAlphaFactor | DstColorFactor | OneMinusDstColorFactor | SrcAlphaSaturateFactor | ConstantColorFactor | OneMinusConstantColorFactor | ConstantAlphaFactor | OneMinusConstantAlphaFactor) | null; - /** - * Defines the blending destination alpha factor. - * - * @type {?(ZeroFactor|OneFactor|SrcColorFactor|OneMinusSrcColorFactor|SrcAlphaFactor|OneMinusSrcAlphaFactor|DstAlphaFactor|OneMinusDstAlphaFactor|DstColorFactor|OneMinusDstColorFactor|SrcAlphaSaturateFactor|ConstantColorFactor|OneMinusConstantColorFactor|ConstantAlphaFactor|OneMinusConstantAlphaFactor)} - * @default null - */ - blendDstAlpha: (ZeroFactor | OneFactor | SrcColorFactor | OneMinusSrcColorFactor | number | number | DstAlphaFactor | OneMinusDstAlphaFactor | DstColorFactor | OneMinusDstColorFactor | SrcAlphaSaturateFactor | ConstantColorFactor | OneMinusConstantColorFactor | ConstantAlphaFactor | OneMinusConstantAlphaFactor) | null; - /** - * Defines the blending equation of the alpha channel. - * - * @type {?(AddEquation|SubtractEquation|ReverseSubtractEquation|MinEquation|MaxEquation)} - * @default null - */ - blendEquationAlpha: (number | SubtractEquation | ReverseSubtractEquation | MinEquation | MaxEquation) | null; - /** - * Represents the RGB values of the constant blend color. - * - * This property has only an effect when using custom blending with `ConstantColor` or `OneMinusConstantColor`. - * - * @type {Color} - * @default (0,0,0) - */ - blendColor: Color; - /** - * Represents the alpha value of the constant blend color. - * - * This property has only an effect when using custom blending with `ConstantAlpha` or `OneMinusConstantAlpha`. - * - * @type {number} - * @default 0 - */ - blendAlpha: number; - /** - * Defines the depth function. - * - * @type {(NeverDepth|AlwaysDepth|LessDepth|LessEqualDepth|EqualDepth|GreaterEqualDepth|GreaterDepth|NotEqualDepth)} - * @default LessEqualDepth - */ - depthFunc: (NeverDepth | AlwaysDepth | LessDepth | number | EqualDepth | GreaterEqualDepth | GreaterDepth | NotEqualDepth); - /** - * Whether to have depth test enabled when rendering this material. - * When the depth test is disabled, the depth write will also be implicitly disabled. - * - * @type {boolean} - * @default true - */ - depthTest: boolean; - /** - * Whether rendering this material has any effect on the depth buffer. - * - * When drawing 2D overlays it can be useful to disable the depth writing in - * order to layer several things together without creating z-index artifacts. - * - * @type {boolean} - * @default true - */ - depthWrite: boolean; - /** - * The bit mask to use when writing to the stencil buffer. - * - * @type {number} - * @default 0xff - */ - stencilWriteMask: number; - /** - * The stencil comparison function to use. - * - * @type {NeverStencilFunc|LessStencilFunc|EqualStencilFunc|LessEqualStencilFunc|GreaterStencilFunc|NotEqualStencilFunc|GreaterEqualStencilFunc|AlwaysStencilFunc} - * @default AlwaysStencilFunc - */ - stencilFunc: NeverStencilFunc | LessStencilFunc | EqualStencilFunc | LessEqualStencilFunc | GreaterStencilFunc | NotEqualStencilFunc | GreaterEqualStencilFunc | number; - /** - * The value to use when performing stencil comparisons or stencil operations. - * - * @type {number} - * @default 0 - */ - stencilRef: number; - /** - * The bit mask to use when comparing against the stencil buffer. - * - * @type {number} - * @default 0xff - */ - stencilFuncMask: number; - /** - * Which stencil operation to perform when the comparison function returns `false`. - * - * @type {ZeroStencilOp|KeepStencilOp|ReplaceStencilOp|IncrementStencilOp|DecrementStencilOp|IncrementWrapStencilOp|DecrementWrapStencilOp|InvertStencilOp} - * @default KeepStencilOp - */ - stencilFail: ZeroStencilOp | number | ReplaceStencilOp | IncrementStencilOp | DecrementStencilOp | IncrementWrapStencilOp | DecrementWrapStencilOp | InvertStencilOp; - /** - * Which stencil operation to perform when the comparison function returns - * `true` but the depth test fails. - * - * @type {ZeroStencilOp|KeepStencilOp|ReplaceStencilOp|IncrementStencilOp|DecrementStencilOp|IncrementWrapStencilOp|DecrementWrapStencilOp|InvertStencilOp} - * @default KeepStencilOp - */ - stencilZFail: ZeroStencilOp | number | ReplaceStencilOp | IncrementStencilOp | DecrementStencilOp | IncrementWrapStencilOp | DecrementWrapStencilOp | InvertStencilOp; - /** - * Which stencil operation to perform when the comparison function returns - * `true` and the depth test passes. - * - * @type {ZeroStencilOp|KeepStencilOp|ReplaceStencilOp|IncrementStencilOp|DecrementStencilOp|IncrementWrapStencilOp|DecrementWrapStencilOp|InvertStencilOp} - * @default KeepStencilOp - */ - stencilZPass: ZeroStencilOp | number | ReplaceStencilOp | IncrementStencilOp | DecrementStencilOp | IncrementWrapStencilOp | DecrementWrapStencilOp | InvertStencilOp; - /** - * Whether stencil operations are performed against the stencil buffer. In - * order to perform writes or comparisons against the stencil buffer this - * value must be `true`. - * - * @type {boolean} - * @default false - */ - stencilWrite: boolean; - /** - * User-defined clipping planes specified as THREE.Plane objects in world - * space. These planes apply to the objects this material is attached to. - * Points in space whose signed distance to the plane is negative are clipped - * (not rendered). This requires {@link WebGLRenderer#localClippingEnabled} to - * be `true`. - * - * @type {?Array} - * @default null - */ - clippingPlanes: Array | null; - /** - * Changes the behavior of clipping planes so that only their intersection is - * clipped, rather than their union. - * - * @type {boolean} - * @default false - */ - clipIntersection: boolean; - /** - * Defines whether to clip shadows according to the clipping planes specified - * on this material. - * - * @type {boolean} - * @default false - */ - clipShadows: boolean; - /** - * Defines which side of faces cast shadows. If `null`, the side casting shadows - * is determined as follows: - * - * - When {@link Material#side} is set to `FrontSide`, the back side cast shadows. - * - When {@link Material#side} is set to `BackSide`, the front side cast shadows. - * - When {@link Material#side} is set to `DoubleSide`, both sides cast shadows. - * - * @type {?(FrontSide|BackSide|DoubleSide)} - * @default null - */ - shadowSide: (number | BackSide | DoubleSide) | null; - /** - * Whether to render the material's color. - * - * This can be used in conjunction with {@link Object3D#renderOder} to create invisible - * objects that occlude other objects. - * - * @type {boolean} - * @default true - */ - colorWrite: boolean; - /** - * Override the renderer's default precision for this material. - * - * @type {?('highp'|'mediump'|'lowp')} - * @default null - */ - precision: ("highp" | "mediump" | "lowp") | null; - /** - * Whether to use polygon offset or not. When enabled, each fragment's depth value will - * be offset after it is interpolated from the depth values of the appropriate vertices. - * The offset is added before the depth test is performed and before the value is written - * into the depth buffer. - * - * Can be useful for rendering hidden-line images, for applying decals to surfaces, and for - * rendering solids with highlighted edges. - * - * @type {boolean} - * @default false - */ - polygonOffset: boolean; - /** - * Specifies a scale factor that is used to create a variable depth offset for each polygon. - * - * @type {number} - * @default 0 - */ - polygonOffsetFactor: number; - /** - * Is multiplied by an implementation-specific value to create a constant depth offset. - * - * @type {number} - * @default 0 - */ - polygonOffsetUnits: number; - /** - * Whether to apply dithering to the color to remove the appearance of banding. - * - * @type {boolean} - * @default false - */ - dithering: boolean; - /** - * Whether alpha to coverage should be enabled or not. Can only be used with MSAA-enabled contexts - * (meaning when the renderer was created with *antialias* parameter set to `true`). Enabling this - * will smooth aliasing on clip plane edges and alphaTest-clipped edges. - * - * @type {boolean} - * @default false - */ - alphaToCoverage: boolean; - /** - * Whether to premultiply the alpha (transparency) value. - * - * @type {boolean} - * @default false - */ - premultipliedAlpha: boolean; - /** - * Whether double-sided, transparent objects should be rendered with a single pass or not. - * - * The engine renders double-sided, transparent objects with two draw calls (back faces first, - * then front faces) to mitigate transparency artifacts. There are scenarios however where this - * approach produces no quality gains but still doubles draw calls e.g. when rendering flat - * vegetation like grass sprites. In these cases, set the `forceSinglePass` flag to `true` to - * disable the two pass rendering to avoid performance issues. - * - * @type {boolean} - * @default false - */ - forceSinglePass: boolean; - /** - * Whether it's possible to override the material with {@link Scene#overrideMaterial} or not. - * - * @type {boolean} - * @default true - */ - allowOverride: boolean; - /** - * Defines whether 3D objects using this material are visible. - * - * @type {boolean} - * @default true - */ - visible: boolean; - /** - * Defines whether this material is tone mapped according to the renderer's tone mapping setting. - * - * It is ignored when rendering to a render target or using post processing or when using - * `WebGPURenderer`. In all these cases, all materials are honored by tone mapping. - * - * @type {boolean} - * @default true - */ - toneMapped: boolean; - /** - * An object that can be used to store custom data about the Material. It - * should not hold references to functions as these will not be cloned. - * - * @type {Object} - */ - userData: Object; - /** - * This starts at `0` and counts how many times {@link Material#needsUpdate} is set to `true`. - * - * @type {number} - * @readonly - * @default 0 - */ - readonly version: number; - _alphaTest: number; - readonly set alphaTest(value: number); - /** - * Sets the alpha value to be used when running an alpha test. The material - * will not be rendered if the opacity is lower than this value. - * - * @type {number} - * @readonly - * @default 0 - */ - readonly get alphaTest(): number; - /** - * An optional callback that is executed immediately before the material is used to render a 3D object. - * - * This method can only be used when rendering with {@link WebGLRenderer}. - * - * @param {WebGLRenderer} renderer - The renderer. - * @param {Scene} scene - The scene. - * @param {Camera} camera - The camera that is used to render the scene. - * @param {BufferGeometry} geometry - The 3D object's geometry. - * @param {Object3D} object - The 3D object. - * @param {Object} group - The geometry group data. - */ - onBeforeRender(): void; - /** - * An optional callback that is executed immediately before the shader - * program is compiled. This function is called with the shader source code - * as a parameter. Useful for the modification of built-in materials. - * - * This method can only be used when rendering with {@link WebGLRenderer}. The - * recommended approach when customizing materials is to use `WebGPURenderer` with the new - * Node Material system and [TSL](https://github.com/mrdoob/three.js/wiki/Three.js-Shading-Language). - * - * @param {{vertexShader:string,fragmentShader:string,uniforms:Object}} shaderobject - The object holds the uniforms and the vertex and fragment shader source. - * @param {WebGLRenderer} renderer - A reference to the renderer. - */ - onBeforeCompile(): void; - /** - * In case {@link Material#onBeforeCompile} is used, this callback can be used to identify - * values of settings used in `onBeforeCompile()`, so three.js can reuse a cached - * shader or recompile the shader for this material as needed. - * - * This method can only be used when rendering with {@link WebGLRenderer}. - * - * @return {string} The custom program cache key. - */ - customProgramCacheKey(): string; - /** - * This method can be used to set default values from parameter objects. - * It is a generic implementation so it can be used with different types - * of materials. - * - * @param {Object} [values] - The material values to set. - */ - setValues(values?: Object): void; - /** - * Serializes the material into JSON. - * - * @param {?(Object|string)} meta - An optional value holding meta information about the serialization. - * @return {Object} A JSON object representing the serialized material. - * @see {@link ObjectLoader#parse} - */ - toJSON(meta: (Object | string) | null): Object; - /** - * Returns a new material with copied values from this instance. - * - * @return {Material} A clone of this instance. - */ - clone(): Material; - /** - * Copies the values of the given material to this instance. - * - * @param {Material} source - The material to copy. - * @return {Material} A reference to this instance. - */ - copy(source: Material): Material; - /** - * Frees the GPU-related resources allocated by this instance. Call this - * method whenever this instance is no longer used in your app. - * - * @fires Material#dispose - */ - dispose(): void; - /** - * Setting this property to `true` indicates the engine the material - * needs to be recompiled. - * - * @type {boolean} - * @default false - * @param {boolean} value - */ - set needsUpdate(value: boolean); -} -import { EventDispatcher } from '../core/EventDispatcher.js'; -import { Color } from '../math/Color.js'; diff --git a/jsdoc-testing/jsdoc/materials/Materials.d.ts b/jsdoc-testing/jsdoc/materials/Materials.d.ts deleted file mode 100644 index 3f555b856..000000000 --- a/jsdoc-testing/jsdoc/materials/Materials.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { ShadowMaterial } from './ShadowMaterial.js'; -import { SpriteMaterial } from './SpriteMaterial.js'; -import { RawShaderMaterial } from './RawShaderMaterial.js'; -import { ShaderMaterial } from './ShaderMaterial.js'; -import { PointsMaterial } from './PointsMaterial.js'; -import { MeshPhysicalMaterial } from './MeshPhysicalMaterial.js'; -import { MeshStandardMaterial } from './MeshStandardMaterial.js'; -import { MeshPhongMaterial } from './MeshPhongMaterial.js'; -import { MeshToonMaterial } from './MeshToonMaterial.js'; -import { MeshNormalMaterial } from './MeshNormalMaterial.js'; -import { MeshLambertMaterial } from './MeshLambertMaterial.js'; -import { MeshDepthMaterial } from './MeshDepthMaterial.js'; -import { MeshDistanceMaterial } from './MeshDistanceMaterial.js'; -import { MeshBasicMaterial } from './MeshBasicMaterial.js'; -import { MeshMatcapMaterial } from './MeshMatcapMaterial.js'; -import { LineDashedMaterial } from './LineDashedMaterial.js'; -import { LineBasicMaterial } from './LineBasicMaterial.js'; -import { Material } from './Material.js'; -export { ShadowMaterial, SpriteMaterial, RawShaderMaterial, ShaderMaterial, PointsMaterial, MeshPhysicalMaterial, MeshStandardMaterial, MeshPhongMaterial, MeshToonMaterial, MeshNormalMaterial, MeshLambertMaterial, MeshDepthMaterial, MeshDistanceMaterial, MeshBasicMaterial, MeshMatcapMaterial, LineDashedMaterial, LineBasicMaterial, Material }; diff --git a/jsdoc-testing/jsdoc/materials/MeshBasicMaterial.d.ts b/jsdoc-testing/jsdoc/materials/MeshBasicMaterial.d.ts deleted file mode 100644 index 83636586f..000000000 --- a/jsdoc-testing/jsdoc/materials/MeshBasicMaterial.d.ts +++ /dev/null @@ -1,184 +0,0 @@ -/** - * A material for drawing geometries in a simple shaded (flat or wireframe) way. - * - * This material is not affected by lights. - * - * @augments Material - * @demo scenes/material-browser.html#MeshBasicMaterial - */ -export class MeshBasicMaterial extends Material { - /** - * Constructs a new mesh basic material. - * - * @param {Object} [parameters] - An object with one or more properties - * defining the material's appearance. Any property of the material - * (including any property from inherited materials) can be passed - * in here. Color values can be passed any type of value accepted - * by {@link Color#set}. - */ - constructor(parameters?: Object); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isMeshBasicMaterial: boolean; - type: string; - /** - * Color of the material. - * - * @type {Color} - * @default (1,1,1) - */ - color: Color; - /** - * The color map. May optionally include an alpha channel, typically combined - * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map - * color is modulated by the diffuse `color`. - * - * @type {?Texture} - * @default null - */ - map: Texture | null; - /** - * The light map. Requires a second set of UVs. - * - * @type {?Texture} - * @default null - */ - lightMap: Texture | null; - /** - * Intensity of the baked light. - * - * @type {number} - * @default 1 - */ - lightMapIntensity: number; - /** - * The red channel of this texture is used as the ambient occlusion map. - * Requires a second set of UVs. - * - * @type {?Texture} - * @default null - */ - aoMap: Texture | null; - /** - * Intensity of the ambient occlusion effect. Range is `[0,1]`, where `0` - * disables ambient occlusion. Where intensity is `1` and the AO map's - * red channel is also `1`, ambient light is fully occluded on a surface. - * - * @type {number} - * @default 1 - */ - aoMapIntensity: number; - /** - * Specular map used by the material. - * - * @type {?Texture} - * @default null - */ - specularMap: Texture | null; - /** - * The alpha map is a grayscale texture that controls the opacity across the - * surface (black: fully transparent; white: fully opaque). - * - * Only the color of the texture is used, ignoring the alpha channel if one - * exists. For RGB and RGBA textures, the renderer will use the green channel - * when sampling this texture due to the extra bit of precision provided for - * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and - * luminance/alpha textures will also still work as expected. - * - * @type {?Texture} - * @default null - */ - alphaMap: Texture | null; - /** - * The environment map. - * - * @type {?Texture} - * @default null - */ - envMap: Texture | null; - /** - * The rotation of the environment map in radians. - * - * @type {Euler} - * @default (0,0,0) - */ - envMapRotation: Euler; - /** - * How to combine the result of the surface's color with the environment map, if any. - * - * When set to `MixOperation`, the {@link MeshBasicMaterial#reflectivity} is used to - * blend between the two colors. - * - * @type {(MultiplyOperation|MixOperation|AddOperation)} - * @default MultiplyOperation - */ - combine: (number | MixOperation | AddOperation); - /** - * How much the environment map affects the surface. - * The valid range is between `0` (no reflections) and `1` (full reflections). - * - * @type {number} - * @default 1 - */ - reflectivity: number; - /** - * The index of refraction (IOR) of air (approximately 1) divided by the - * index of refraction of the material. It is used with environment mapping - * modes {@link CubeRefractionMapping} and {@link EquirectangularRefractionMapping}. - * The refraction ratio should not exceed `1`. - * - * @type {number} - * @default 0.98 - */ - refractionRatio: number; - /** - * Renders the geometry as a wireframe. - * - * @type {boolean} - * @default false - */ - wireframe: boolean; - /** - * Controls the thickness of the wireframe. - * - * Can only be used with {@link SVGRenderer}. - * - * @type {number} - * @default 1 - */ - wireframeLinewidth: number; - /** - * Defines appearance of wireframe ends. - * - * Can only be used with {@link SVGRenderer}. - * - * @type {('round'|'bevel'|'miter')} - * @default 'round' - */ - wireframeLinecap: ("round" | "bevel" | "miter"); - /** - * Defines appearance of wireframe joints. - * - * Can only be used with {@link SVGRenderer}. - * - * @type {('round'|'bevel'|'miter')} - * @default 'round' - */ - wireframeLinejoin: ("round" | "bevel" | "miter"); - /** - * Whether the material is affected by fog or not. - * - * @type {boolean} - * @default true - */ - fog: boolean; - copy(source: any): this; -} -import { Material } from './Material.js'; -import { Color } from '../math/Color.js'; -import { Euler } from '../math/Euler.js'; diff --git a/jsdoc-testing/jsdoc/materials/MeshDepthMaterial.d.ts b/jsdoc-testing/jsdoc/materials/MeshDepthMaterial.d.ts deleted file mode 100644 index a85883a0e..000000000 --- a/jsdoc-testing/jsdoc/materials/MeshDepthMaterial.d.ts +++ /dev/null @@ -1,106 +0,0 @@ -/** - * A material for drawing geometry by depth. Depth is based off of the camera - * near and far plane. White is nearest, black is farthest. - * - * @augments Material - * @demo scenes/material-browser.html#MeshDepthMaterial - */ -export class MeshDepthMaterial extends Material { - /** - * Constructs a new mesh depth material. - * - * @param {Object} [parameters] - An object with one or more properties - * defining the material's appearance. Any property of the material - * (including any property from inherited materials) can be passed - * in here. Color values can be passed any type of value accepted - * by {@link Color#set}. - */ - constructor(parameters?: Object); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isMeshDepthMaterial: boolean; - type: string; - /** - * Type for depth packing. - * - * @type {(BasicDepthPacking|RGBADepthPacking|RGBDepthPacking|RGDepthPacking)} - * @default BasicDepthPacking - */ - depthPacking: (number | RGBADepthPacking | RGBDepthPacking | RGDepthPacking); - /** - * The color map. May optionally include an alpha channel, typically combined - * with {@link Material#transparent} or {@link Material#alphaTest}. - * - * @type {?Texture} - * @default null - */ - map: Texture | null; - /** - * The alpha map is a grayscale texture that controls the opacity across the - * surface (black: fully transparent; white: fully opaque). - * - * Only the color of the texture is used, ignoring the alpha channel if one - * exists. For RGB and RGBA textures, the renderer will use the green channel - * when sampling this texture due to the extra bit of precision provided for - * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and - * luminance/alpha textures will also still work as expected. - * - * @type {?Texture} - * @default null - */ - alphaMap: Texture | null; - /** - * The displacement map affects the position of the mesh's vertices. Unlike - * other maps which only affect the light and shade of the material the - * displaced vertices can cast shadows, block other objects, and otherwise - * act as real geometry. The displacement texture is an image where the value - * of each pixel (white being the highest) is mapped against, and - * repositions, the vertices of the mesh. - * - * @type {?Texture} - * @default null - */ - displacementMap: Texture | null; - /** - * How much the displacement map affects the mesh (where black is no - * displacement, and white is maximum displacement). Without a displacement - * map set, this value is not applied. - * - * @type {number} - * @default 0 - */ - displacementScale: number; - /** - * The offset of the displacement map's values on the mesh's vertices. - * The bias is added to the scaled sample of the displacement map. - * Without a displacement map set, this value is not applied. - * - * @type {number} - * @default 0 - */ - displacementBias: number; - /** - * Renders the geometry as a wireframe. - * - * @type {boolean} - * @default false - */ - wireframe: boolean; - /** - * Controls the thickness of the wireframe. - * - * WebGL and WebGPU ignore this property and always render - * 1 pixel wide lines. - * - * @type {number} - * @default 1 - */ - wireframeLinewidth: number; - copy(source: any): this; -} -import { Material } from './Material.js'; diff --git a/jsdoc-testing/jsdoc/materials/MeshDistanceMaterial.d.ts b/jsdoc-testing/jsdoc/materials/MeshDistanceMaterial.d.ts deleted file mode 100644 index bddc4ff5c..000000000 --- a/jsdoc-testing/jsdoc/materials/MeshDistanceMaterial.d.ts +++ /dev/null @@ -1,86 +0,0 @@ -/** - * A material used internally for implementing shadow mapping with - * point lights. - * - * Can also be used to customize the shadow casting of an object by assigning - * an instance of `MeshDistanceMaterial` to {@link Object3D#customDistanceMaterial}. - * The following examples demonstrates this approach in order to ensure - * transparent parts of objects do not cast shadows. - * - * @augments Material - */ -export class MeshDistanceMaterial extends Material { - /** - * Constructs a new mesh distance material. - * - * @param {Object} [parameters] - An object with one or more properties - * defining the material's appearance. Any property of the material - * (including any property from inherited materials) can be passed - * in here. Color values can be passed any type of value accepted - * by {@link Color#set}. - */ - constructor(parameters?: Object); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isMeshDistanceMaterial: boolean; - type: string; - /** - * The color map. May optionally include an alpha channel, typically combined - * with {@link Material#transparent} or {@link Material#alphaTest}. - * - * @type {?Texture} - * @default null - */ - map: Texture | null; - /** - * The alpha map is a grayscale texture that controls the opacity across the - * surface (black: fully transparent; white: fully opaque). - * - * Only the color of the texture is used, ignoring the alpha channel if one - * exists. For RGB and RGBA textures, the renderer will use the green channel - * when sampling this texture due to the extra bit of precision provided for - * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and - * luminance/alpha textures will also still work as expected. - * - * @type {?Texture} - * @default null - */ - alphaMap: Texture | null; - /** - * The displacement map affects the position of the mesh's vertices. Unlike - * other maps which only affect the light and shade of the material the - * displaced vertices can cast shadows, block other objects, and otherwise - * act as real geometry. The displacement texture is an image where the value - * of each pixel (white being the highest) is mapped against, and - * repositions, the vertices of the mesh. - * - * @type {?Texture} - * @default null - */ - displacementMap: Texture | null; - /** - * How much the displacement map affects the mesh (where black is no - * displacement, and white is maximum displacement). Without a displacement - * map set, this value is not applied. - * - * @type {number} - * @default 0 - */ - displacementScale: number; - /** - * The offset of the displacement map's values on the mesh's vertices. - * The bias is added to the scaled sample of the displacement map. - * Without a displacement map set, this value is not applied. - * - * @type {number} - * @default 0 - */ - displacementBias: number; - copy(source: any): this; -} -import { Material } from './Material.js'; diff --git a/jsdoc-testing/jsdoc/materials/MeshLambertMaterial.d.ts b/jsdoc-testing/jsdoc/materials/MeshLambertMaterial.d.ts deleted file mode 100644 index d83f9155b..000000000 --- a/jsdoc-testing/jsdoc/materials/MeshLambertMaterial.d.ts +++ /dev/null @@ -1,305 +0,0 @@ -/** - * A material for non-shiny surfaces, without specular highlights. - * - * The material uses a non-physically based [Lambertian](https://en.wikipedia.org/wiki/Lambertian_reflectance) - * model for calculating reflectance. This can simulate some surfaces (such - * as untreated wood or stone) well, but cannot simulate shiny surfaces with - * specular highlights (such as varnished wood). `MeshLambertMaterial` uses per-fragment - * shading. - * - * Due to the simplicity of the reflectance and illumination models, - * performance will be greater when using this material over the - * {@link MeshPhongMaterial}, {@link MeshStandardMaterial} or - * {@link MeshPhysicalMaterial}, at the cost of some graphical accuracy. - * - * @augments Material - * @demo scenes/material-browser.html#MeshLambertMaterial - */ -export class MeshLambertMaterial extends Material { - /** - * Constructs a new mesh lambert material. - * - * @param {Object} [parameters] - An object with one or more properties - * defining the material's appearance. Any property of the material - * (including any property from inherited materials) can be passed - * in here. Color values can be passed any type of value accepted - * by {@link Color#set}. - */ - constructor(parameters?: Object); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isMeshLambertMaterial: boolean; - type: string; - /** - * Color of the material. - * - * @type {Color} - * @default (1,1,1) - */ - color: Color; - /** - * The color map. May optionally include an alpha channel, typically combined - * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map - * color is modulated by the diffuse `color`. - * - * @type {?Texture} - * @default null - */ - map: Texture | null; - /** - * The light map. Requires a second set of UVs. - * - * @type {?Texture} - * @default null - */ - lightMap: Texture | null; - /** - * Intensity of the baked light. - * - * @type {number} - * @default 1 - */ - lightMapIntensity: number; - /** - * The red channel of this texture is used as the ambient occlusion map. - * Requires a second set of UVs. - * - * @type {?Texture} - * @default null - */ - aoMap: Texture | null; - /** - * Intensity of the ambient occlusion effect. Range is `[0,1]`, where `0` - * disables ambient occlusion. Where intensity is `1` and the AO map's - * red channel is also `1`, ambient light is fully occluded on a surface. - * - * @type {number} - * @default 1 - */ - aoMapIntensity: number; - /** - * Emissive (light) color of the material, essentially a solid color - * unaffected by other lighting. - * - * @type {Color} - * @default (0,0,0) - */ - emissive: Color; - /** - * Intensity of the emissive light. Modulates the emissive color. - * - * @type {number} - * @default 1 - */ - emissiveIntensity: number; - /** - * Set emissive (glow) map. The emissive map color is modulated by the - * emissive color and the emissive intensity. If you have an emissive map, - * be sure to set the emissive color to something other than black. - * - * @type {?Texture} - * @default null - */ - emissiveMap: Texture | null; - /** - * The texture to create a bump map. The black and white values map to the - * perceived depth in relation to the lights. Bump doesn't actually affect - * the geometry of the object, only the lighting. If a normal map is defined - * this will be ignored. - * - * @type {?Texture} - * @default null - */ - bumpMap: Texture | null; - /** - * How much the bump map affects the material. Typical range is `[0,1]`. - * - * @type {number} - * @default 1 - */ - bumpScale: number; - /** - * The texture to create a normal map. The RGB values affect the surface - * normal for each pixel fragment and change the way the color is lit. Normal - * maps do not change the actual shape of the surface, only the lighting. In - * case the material has a normal map authored using the left handed - * convention, the `y` component of `normalScale` should be negated to compensate - * for the different handedness. - * - * @type {?Texture} - * @default null - */ - normalMap: Texture | null; - /** - * The type of normal map. - * - * @type {(TangentSpaceNormalMap|ObjectSpaceNormalMap)} - * @default TangentSpaceNormalMap - */ - normalMapType: (number | ObjectSpaceNormalMap); - /** - * How much the normal map affects the material. Typical value range is `[0,1]`. - * - * @type {Vector2} - * @default (1,1) - */ - normalScale: Vector2; - /** - * The displacement map affects the position of the mesh's vertices. Unlike - * other maps which only affect the light and shade of the material the - * displaced vertices can cast shadows, block other objects, and otherwise - * act as real geometry. The displacement texture is an image where the value - * of each pixel (white being the highest) is mapped against, and - * repositions, the vertices of the mesh. - * - * @type {?Texture} - * @default null - */ - displacementMap: Texture | null; - /** - * How much the displacement map affects the mesh (where black is no - * displacement, and white is maximum displacement). Without a displacement - * map set, this value is not applied. - * - * @type {number} - * @default 0 - */ - displacementScale: number; - /** - * The offset of the displacement map's values on the mesh's vertices. - * The bias is added to the scaled sample of the displacement map. - * Without a displacement map set, this value is not applied. - * - * @type {number} - * @default 0 - */ - displacementBias: number; - /** - * Specular map used by the material. - * - * @type {?Texture} - * @default null - */ - specularMap: Texture | null; - /** - * The alpha map is a grayscale texture that controls the opacity across the - * surface (black: fully transparent; white: fully opaque). - * - * Only the color of the texture is used, ignoring the alpha channel if one - * exists. For RGB and RGBA textures, the renderer will use the green channel - * when sampling this texture due to the extra bit of precision provided for - * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and - * luminance/alpha textures will also still work as expected. - * - * @type {?Texture} - * @default null - */ - alphaMap: Texture | null; - /** - * The environment map. - * - * @type {?Texture} - * @default null - */ - envMap: Texture | null; - /** - * The rotation of the environment map in radians. - * - * @type {Euler} - * @default (0,0,0) - */ - envMapRotation: Euler; - /** - * How to combine the result of the surface's color with the environment map, if any. - * - * When set to `MixOperation`, the {@link MeshBasicMaterial#reflectivity} is used to - * blend between the two colors. - * - * @type {(MultiplyOperation|MixOperation|AddOperation)} - * @default MultiplyOperation - */ - combine: (number | MixOperation | AddOperation); - /** - * How much the environment map affects the surface. - * The valid range is between `0` (no reflections) and `1` (full reflections). - * - * @type {number} - * @default 1 - */ - reflectivity: number; - /** - * Scales the effect of the environment map by multiplying its color. - * - * @type {number} - * @default 1 - */ - envMapIntensity: number; - /** - * The index of refraction (IOR) of air (approximately 1) divided by the - * index of refraction of the material. It is used with environment mapping - * modes {@link CubeRefractionMapping} and {@link EquirectangularRefractionMapping}. - * The refraction ratio should not exceed `1`. - * - * @type {number} - * @default 0.98 - */ - refractionRatio: number; - /** - * Renders the geometry as a wireframe. - * - * @type {boolean} - * @default false - */ - wireframe: boolean; - /** - * Controls the thickness of the wireframe. - * - * Can only be used with {@link SVGRenderer}. - * - * @type {number} - * @default 1 - */ - wireframeLinewidth: number; - /** - * Defines appearance of wireframe ends. - * - * Can only be used with {@link SVGRenderer}. - * - * @type {('round'|'bevel'|'miter')} - * @default 'round' - */ - wireframeLinecap: ("round" | "bevel" | "miter"); - /** - * Defines appearance of wireframe joints. - * - * Can only be used with {@link SVGRenderer}. - * - * @type {('round'|'bevel'|'miter')} - * @default 'round' - */ - wireframeLinejoin: ("round" | "bevel" | "miter"); - /** - * Whether the material is rendered with flat shading or not. - * - * @type {boolean} - * @default false - */ - flatShading: boolean; - /** - * Whether the material is affected by fog or not. - * - * @type {boolean} - * @default true - */ - fog: boolean; - copy(source: any): this; -} -import { Material } from './Material.js'; -import { Color } from '../math/Color.js'; -import { Vector2 } from '../math/Vector2.js'; -import { Euler } from '../math/Euler.js'; diff --git a/jsdoc-testing/jsdoc/materials/MeshMatcapMaterial.d.ts b/jsdoc-testing/jsdoc/materials/MeshMatcapMaterial.d.ts deleted file mode 100644 index ac33b9fb2..000000000 --- a/jsdoc-testing/jsdoc/materials/MeshMatcapMaterial.d.ts +++ /dev/null @@ -1,180 +0,0 @@ -/** - * This material is defined by a MatCap (or Lit Sphere) texture, which encodes the - * material color and shading. - * - * `MeshMatcapMaterial` does not respond to lights since the matcap image file encodes - * baked lighting. It will cast a shadow onto an object that receives shadows - * (and shadow clipping works), but it will not self-shadow or receive - * shadows. - * - * @augments Material - * @demo scenes/material-browser.html#MeshMatcapMaterial - */ -export class MeshMatcapMaterial extends Material { - /** - * Constructs a new mesh matcap material. - * - * @param {Object} [parameters] - An object with one or more properties - * defining the material's appearance. Any property of the material - * (including any property from inherited materials) can be passed - * in here. Color values can be passed any type of value accepted - * by {@link Color#set}. - */ - constructor(parameters?: Object); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isMeshMatcapMaterial: boolean; - defines: { - MATCAP: string; - }; - type: string; - /** - * Color of the material. - * - * @type {Color} - * @default (1,1,1) - */ - color: Color; - /** - * The matcap map. - * - * @type {?Texture} - * @default null - */ - matcap: Texture | null; - /** - * The color map. May optionally include an alpha channel, typically combined - * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map - * color is modulated by the diffuse `color`. - * - * @type {?Texture} - * @default null - */ - map: Texture | null; - /** - * The texture to create a bump map. The black and white values map to the - * perceived depth in relation to the lights. Bump doesn't actually affect - * the geometry of the object, only the lighting. If a normal map is defined - * this will be ignored. - * - * @type {?Texture} - * @default null - */ - bumpMap: Texture | null; - /** - * How much the bump map affects the material. Typical range is `[0,1]`. - * - * @type {number} - * @default 1 - */ - bumpScale: number; - /** - * The texture to create a normal map. The RGB values affect the surface - * normal for each pixel fragment and change the way the color is lit. Normal - * maps do not change the actual shape of the surface, only the lighting. In - * case the material has a normal map authored using the left handed - * convention, the `y` component of `normalScale` should be negated to compensate - * for the different handedness. - * - * @type {?Texture} - * @default null - */ - normalMap: Texture | null; - /** - * The type of normal map. - * - * @type {(TangentSpaceNormalMap|ObjectSpaceNormalMap)} - * @default TangentSpaceNormalMap - */ - normalMapType: (number | ObjectSpaceNormalMap); - /** - * How much the normal map affects the material. Typical value range is `[0,1]`. - * - * @type {Vector2} - * @default (1,1) - */ - normalScale: Vector2; - /** - * The displacement map affects the position of the mesh's vertices. Unlike - * other maps which only affect the light and shade of the material the - * displaced vertices can cast shadows, block other objects, and otherwise - * act as real geometry. The displacement texture is an image where the value - * of each pixel (white being the highest) is mapped against, and - * repositions, the vertices of the mesh. - * - * @type {?Texture} - * @default null - */ - displacementMap: Texture | null; - /** - * How much the displacement map affects the mesh (where black is no - * displacement, and white is maximum displacement). Without a displacement - * map set, this value is not applied. - * - * @type {number} - * @default 0 - */ - displacementScale: number; - /** - * The offset of the displacement map's values on the mesh's vertices. - * The bias is added to the scaled sample of the displacement map. - * Without a displacement map set, this value is not applied. - * - * @type {number} - * @default 0 - */ - displacementBias: number; - /** - * The alpha map is a grayscale texture that controls the opacity across the - * surface (black: fully transparent; white: fully opaque). - * - * Only the color of the texture is used, ignoring the alpha channel if one - * exists. For RGB and RGBA textures, the renderer will use the green channel - * when sampling this texture due to the extra bit of precision provided for - * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and - * luminance/alpha textures will also still work as expected. - * - * @type {?Texture} - * @default null - */ - alphaMap: Texture | null; - /** - * Renders the geometry as a wireframe. - * - * @type {boolean} - * @default false - */ - wireframe: boolean; - /** - * Controls the thickness of the wireframe. - * - * Can only be used with {@link SVGRenderer}. - * - * @type {number} - * @default 1 - */ - wireframeLinewidth: number; - /** - * Whether the material is rendered with flat shading or not. - * - * @type {boolean} - * @default false - */ - flatShading: boolean; - /** - * Whether the material is affected by fog or not. - * - * @type {boolean} - * @default true - */ - fog: boolean; - copy(source: any): this; -} -import { Material } from './Material.js'; -import { Color } from '../math/Color.js'; -import { Vector2 } from '../math/Vector2.js'; diff --git a/jsdoc-testing/jsdoc/materials/MeshNormalMaterial.d.ts b/jsdoc-testing/jsdoc/materials/MeshNormalMaterial.d.ts deleted file mode 100644 index 7d0ab053f..000000000 --- a/jsdoc-testing/jsdoc/materials/MeshNormalMaterial.d.ts +++ /dev/null @@ -1,127 +0,0 @@ -/** - * A material that maps the normal vectors to RGB colors. - * - * @augments Material - * @demo scenes/material-browser.html#MeshNormalMaterial - */ -export class MeshNormalMaterial extends Material { - /** - * Constructs a new mesh normal material. - * - * @param {Object} [parameters] - An object with one or more properties - * defining the material's appearance. Any property of the material - * (including any property from inherited materials) can be passed - * in here. Color values can be passed any type of value accepted - * by {@link Color#set}. - */ - constructor(parameters?: Object); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isMeshNormalMaterial: boolean; - type: string; - /** - * The texture to create a bump map. The black and white values map to the - * perceived depth in relation to the lights. Bump doesn't actually affect - * the geometry of the object, only the lighting. If a normal map is defined - * this will be ignored. - * - * @type {?Texture} - * @default null - */ - bumpMap: Texture | null; - /** - * How much the bump map affects the material. Typical range is `[0,1]`. - * - * @type {number} - * @default 1 - */ - bumpScale: number; - /** - * The texture to create a normal map. The RGB values affect the surface - * normal for each pixel fragment and change the way the color is lit. Normal - * maps do not change the actual shape of the surface, only the lighting. In - * case the material has a normal map authored using the left handed - * convention, the `y` component of `normalScale` should be negated to compensate - * for the different handedness. - * - * @type {?Texture} - * @default null - */ - normalMap: Texture | null; - /** - * The type of normal map. - * - * @type {(TangentSpaceNormalMap|ObjectSpaceNormalMap)} - * @default TangentSpaceNormalMap - */ - normalMapType: (number | ObjectSpaceNormalMap); - /** - * How much the normal map affects the material. Typical value range is `[0,1]`. - * - * @type {Vector2} - * @default (1,1) - */ - normalScale: Vector2; - /** - * The displacement map affects the position of the mesh's vertices. Unlike - * other maps which only affect the light and shade of the material the - * displaced vertices can cast shadows, block other objects, and otherwise - * act as real geometry. The displacement texture is an image where the value - * of each pixel (white being the highest) is mapped against, and - * repositions, the vertices of the mesh. - * - * @type {?Texture} - * @default null - */ - displacementMap: Texture | null; - /** - * How much the displacement map affects the mesh (where black is no - * displacement, and white is maximum displacement). Without a displacement - * map set, this value is not applied. - * - * @type {number} - * @default 0 - */ - displacementScale: number; - /** - * The offset of the displacement map's values on the mesh's vertices. - * The bias is added to the scaled sample of the displacement map. - * Without a displacement map set, this value is not applied. - * - * @type {number} - * @default 0 - */ - displacementBias: number; - /** - * Renders the geometry as a wireframe. - * - * @type {boolean} - * @default false - */ - wireframe: boolean; - /** - * Controls the thickness of the wireframe. - * - * WebGL and WebGPU ignore this property and always render - * 1 pixel wide lines. - * - * @type {number} - * @default 1 - */ - wireframeLinewidth: number; - /** - * Whether the material is rendered with flat shading or not. - * - * @type {boolean} - * @default false - */ - flatShading: boolean; - copy(source: any): this; -} -import { Material } from './Material.js'; -import { Vector2 } from '../math/Vector2.js'; diff --git a/jsdoc-testing/jsdoc/materials/MeshPhongMaterial.d.ts b/jsdoc-testing/jsdoc/materials/MeshPhongMaterial.d.ts deleted file mode 100644 index 085598b1b..000000000 --- a/jsdoc-testing/jsdoc/materials/MeshPhongMaterial.d.ts +++ /dev/null @@ -1,320 +0,0 @@ -/** - * A material for shiny surfaces with specular highlights. - * - * The material uses a non-physically based [Blinn-Phong](https://en.wikipedia.org/wiki/Blinn-Phong_shading_model) - * model for calculating reflectance. Unlike the Lambertian model used in the - * {@link MeshLambertMaterial} this can simulate shiny surfaces with specular - * highlights (such as varnished wood). `MeshPhongMaterial` uses per-fragment shading. - * - * Performance will generally be greater when using this material over the - * {@link MeshStandardMaterial} or {@link MeshPhysicalMaterial}, at the cost of - * some graphical accuracy. - * - * @augments Material - * @demo scenes/material-browser.html#MeshPhongMaterial - */ -export class MeshPhongMaterial extends Material { - /** - * Constructs a new mesh phong material. - * - * @param {Object} [parameters] - An object with one or more properties - * defining the material's appearance. Any property of the material - * (including any property from inherited materials) can be passed - * in here. Color values can be passed any type of value accepted - * by {@link Color#set}. - */ - constructor(parameters?: Object); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isMeshPhongMaterial: boolean; - type: string; - /** - * Color of the material. - * - * @type {Color} - * @default (1,1,1) - */ - color: Color; - /** - * Specular color of the material. The default color is set to `0x111111` (very dark grey) - * - * This defines how shiny the material is and the color of its shine. - * - * @type {Color} - */ - specular: Color; - /** - * How shiny the specular highlight is; a higher value gives a sharper highlight. - * - * @type {number} - * @default 30 - */ - shininess: number; - /** - * The color map. May optionally include an alpha channel, typically combined - * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map - * color is modulated by the diffuse `color`. - * - * @type {?Texture} - * @default null - */ - map: Texture | null; - /** - * The light map. Requires a second set of UVs. - * - * @type {?Texture} - * @default null - */ - lightMap: Texture | null; - /** - * Intensity of the baked light. - * - * @type {number} - * @default 1 - */ - lightMapIntensity: number; - /** - * The red channel of this texture is used as the ambient occlusion map. - * Requires a second set of UVs. - * - * @type {?Texture} - * @default null - */ - aoMap: Texture | null; - /** - * Intensity of the ambient occlusion effect. Range is `[0,1]`, where `0` - * disables ambient occlusion. Where intensity is `1` and the AO map's - * red channel is also `1`, ambient light is fully occluded on a surface. - * - * @type {number} - * @default 1 - */ - aoMapIntensity: number; - /** - * Emissive (light) color of the material, essentially a solid color - * unaffected by other lighting. - * - * @type {Color} - * @default (0,0,0) - */ - emissive: Color; - /** - * Intensity of the emissive light. Modulates the emissive color. - * - * @type {number} - * @default 1 - */ - emissiveIntensity: number; - /** - * Set emissive (glow) map. The emissive map color is modulated by the - * emissive color and the emissive intensity. If you have an emissive map, - * be sure to set the emissive color to something other than black. - * - * @type {?Texture} - * @default null - */ - emissiveMap: Texture | null; - /** - * The texture to create a bump map. The black and white values map to the - * perceived depth in relation to the lights. Bump doesn't actually affect - * the geometry of the object, only the lighting. If a normal map is defined - * this will be ignored. - * - * @type {?Texture} - * @default null - */ - bumpMap: Texture | null; - /** - * How much the bump map affects the material. Typical range is `[0,1]`. - * - * @type {number} - * @default 1 - */ - bumpScale: number; - /** - * The texture to create a normal map. The RGB values affect the surface - * normal for each pixel fragment and change the way the color is lit. Normal - * maps do not change the actual shape of the surface, only the lighting. In - * case the material has a normal map authored using the left handed - * convention, the `y` component of `normalScale` should be negated to compensate - * for the different handedness. - * - * @type {?Texture} - * @default null - */ - normalMap: Texture | null; - /** - * The type of normal map. - * - * @type {(TangentSpaceNormalMap|ObjectSpaceNormalMap)} - * @default TangentSpaceNormalMap - */ - normalMapType: (number | ObjectSpaceNormalMap); - /** - * How much the normal map affects the material. Typical value range is `[0,1]`. - * - * @type {Vector2} - * @default (1,1) - */ - normalScale: Vector2; - /** - * The displacement map affects the position of the mesh's vertices. Unlike - * other maps which only affect the light and shade of the material the - * displaced vertices can cast shadows, block other objects, and otherwise - * act as real geometry. The displacement texture is an image where the value - * of each pixel (white being the highest) is mapped against, and - * repositions, the vertices of the mesh. - * - * @type {?Texture} - * @default null - */ - displacementMap: Texture | null; - /** - * How much the displacement map affects the mesh (where black is no - * displacement, and white is maximum displacement). Without a displacement - * map set, this value is not applied. - * - * @type {number} - * @default 0 - */ - displacementScale: number; - /** - * The offset of the displacement map's values on the mesh's vertices. - * The bias is added to the scaled sample of the displacement map. - * Without a displacement map set, this value is not applied. - * - * @type {number} - * @default 0 - */ - displacementBias: number; - /** - * The specular map value affects both how much the specular surface - * highlight contributes and how much of the environment map affects the - * surface. - * - * @type {?Texture} - * @default null - */ - specularMap: Texture | null; - /** - * The alpha map is a grayscale texture that controls the opacity across the - * surface (black: fully transparent; white: fully opaque). - * - * Only the color of the texture is used, ignoring the alpha channel if one - * exists. For RGB and RGBA textures, the renderer will use the green channel - * when sampling this texture due to the extra bit of precision provided for - * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and - * luminance/alpha textures will also still work as expected. - * - * @type {?Texture} - * @default null - */ - alphaMap: Texture | null; - /** - * The environment map. - * - * @type {?Texture} - * @default null - */ - envMap: Texture | null; - /** - * The rotation of the environment map in radians. - * - * @type {Euler} - * @default (0,0,0) - */ - envMapRotation: Euler; - /** - * How to combine the result of the surface's color with the environment map, if any. - * - * When set to `MixOperation`, the {@link MeshBasicMaterial#reflectivity} is used to - * blend between the two colors. - * - * @type {(MultiplyOperation|MixOperation|AddOperation)} - * @default MultiplyOperation - */ - combine: (number | MixOperation | AddOperation); - /** - * How much the environment map affects the surface. - * The valid range is between `0` (no reflections) and `1` (full reflections). - * - * @type {number} - * @default 1 - */ - reflectivity: number; - /** - * Scales the effect of the environment map by multiplying its color. - * - * @type {number} - * @default 1 - */ - envMapIntensity: number; - /** - * The index of refraction (IOR) of air (approximately 1) divided by the - * index of refraction of the material. It is used with environment mapping - * modes {@link CubeRefractionMapping} and {@link EquirectangularRefractionMapping}. - * The refraction ratio should not exceed `1`. - * - * @type {number} - * @default 0.98 - */ - refractionRatio: number; - /** - * Renders the geometry as a wireframe. - * - * @type {boolean} - * @default false - */ - wireframe: boolean; - /** - * Controls the thickness of the wireframe. - * - * Can only be used with {@link SVGRenderer}. - * - * @type {number} - * @default 1 - */ - wireframeLinewidth: number; - /** - * Defines appearance of wireframe ends. - * - * Can only be used with {@link SVGRenderer}. - * - * @type {('round'|'bevel'|'miter')} - * @default 'round' - */ - wireframeLinecap: ("round" | "bevel" | "miter"); - /** - * Defines appearance of wireframe joints. - * - * Can only be used with {@link SVGRenderer}. - * - * @type {('round'|'bevel'|'miter')} - * @default 'round' - */ - wireframeLinejoin: ("round" | "bevel" | "miter"); - /** - * Whether the material is rendered with flat shading or not. - * - * @type {boolean} - * @default false - */ - flatShading: boolean; - /** - * Whether the material is affected by fog or not. - * - * @type {boolean} - * @default true - */ - fog: boolean; - copy(source: any): this; -} -import { Material } from './Material.js'; -import { Color } from '../math/Color.js'; -import { Vector2 } from '../math/Vector2.js'; -import { Euler } from '../math/Euler.js'; diff --git a/jsdoc-testing/jsdoc/materials/MeshPhysicalMaterial.d.ts b/jsdoc-testing/jsdoc/materials/MeshPhysicalMaterial.d.ts deleted file mode 100644 index 3dd61375e..000000000 --- a/jsdoc-testing/jsdoc/materials/MeshPhysicalMaterial.d.ts +++ /dev/null @@ -1,310 +0,0 @@ -/** - * An extension of the {@link MeshStandardMaterial}, providing more advanced - * physically-based rendering properties: - * - * - Anisotropy: Ability to represent the anisotropic property of materials - * as observable with brushed metals. - * - Clearcoat: Some materials — like car paints, carbon fiber, and wet surfaces — require - * a clear, reflective layer on top of another layer that may be irregular or rough. - * Clearcoat approximates this effect, without the need for a separate transparent surface. - * - Iridescence: Allows to render the effect where hue varies depending on the viewing - * angle and illumination angle. This can be seen on soap bubbles, oil films, or on the - * wings of many insects. - * - Physically-based transparency: One limitation of {@link Material#opacity} is that highly - * transparent materials are less reflective. Physically-based transmission provides a more - * realistic option for thin, transparent surfaces like glass. - * - Advanced reflectivity: More flexible reflectivity for non-metallic materials. - * - Sheen: Can be used for representing cloth and fabric materials. - * - * As a result of these complex shading features, `MeshPhysicalMaterial` has a - * higher performance cost, per pixel, than other three.js materials. Most - * effects are disabled by default, and add cost as they are enabled. For - * best results, always specify an environment map when using this material. - * - * @augments MeshStandardMaterial - * @demo scenes/material-browser.html#MeshPhysicalMaterial - */ -export class MeshPhysicalMaterial extends MeshStandardMaterial { - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isMeshPhysicalMaterial: boolean; - defines: { - STANDARD: string; - PHYSICAL: string; - }; - /** - * The rotation of the anisotropy in tangent, bitangent space, measured in radians - * counter-clockwise from the tangent. When `anisotropyMap` is present, this - * property provides additional rotation to the vectors in the texture. - * - * @type {number} - * @default 1 - */ - anisotropyRotation: number; - /** - * Red and green channels represent the anisotropy direction in `[-1, 1]` tangent, - * bitangent space, to be rotated by `anisotropyRotation`. The blue channel - * contains strength as `[0, 1]` to be multiplied by `anisotropy`. - * - * @type {?Texture} - * @default null - */ - anisotropyMap: Texture | null; - /** - * The red channel of this texture is multiplied against `clearcoat`, - * for per-pixel control over a coating's intensity. - * - * @type {?Texture} - * @default null - */ - clearcoatMap: Texture | null; - /** - * Roughness of the clear coat layer, from `0.0` to `1.0`. - * - * @type {number} - * @default 0 - */ - clearcoatRoughness: number; - /** - * The green channel of this texture is multiplied against - * `clearcoatRoughness`, for per-pixel control over a coating's roughness. - * - * @type {?Texture} - * @default null - */ - clearcoatRoughnessMap: Texture | null; - /** - * How much `clearcoatNormalMap` affects the clear coat layer, from - * `(0,0)` to `(1,1)`. - * - * @type {Vector2} - * @default (1,1) - */ - clearcoatNormalScale: Vector2; - /** - * Can be used to enable independent normals for the clear coat layer. - * - * @type {?Texture} - * @default null - */ - clearcoatNormalMap: Texture | null; - /** - * Index-of-refraction for non-metallic materials, from `1.0` to `2.333`. - * - * @type {number} - * @default 1.5 - */ - ior: number; - /** - * The red channel of this texture is multiplied against `iridescence`, for per-pixel - * control over iridescence. - * - * @type {?Texture} - * @default null - */ - iridescenceMap: Texture | null; - /** - * Strength of the iridescence RGB color shift effect, represented by an index-of-refraction. - * Between `1.0` to `2.333`. - * - * @type {number} - * @default 1.3 - */ - iridescenceIOR: number; - /** - *Array of exactly 2 elements, specifying minimum and maximum thickness of the iridescence layer. - Thickness of iridescence layer has an equivalent effect of the one `thickness` has on `ior`. - * - * @type {Array} - * @default [100,400] - */ - iridescenceThicknessRange: Array; - /** - * A texture that defines the thickness of the iridescence layer, stored in the green channel. - * Minimum and maximum values of thickness are defined by `iridescenceThicknessRange` array: - * - `0.0` in the green channel will result in thickness equal to first element of the array. - * - `1.0` in the green channel will result in thickness equal to second element of the array. - * - Values in-between will linearly interpolate between the elements of the array. - * - * @type {?Texture} - * @default null - */ - iridescenceThicknessMap: Texture | null; - /** - * The sheen tint. - * - * @type {Color} - * @default (0,0,0) - */ - sheenColor: Color; - /** - * The RGB channels of this texture are multiplied against `sheenColor`, for per-pixel control - * over sheen tint. - * - * @type {?Texture} - * @default null - */ - sheenColorMap: Texture | null; - /** - * Roughness of the sheen layer, from `0.0` to `1.0`. - * - * @type {number} - * @default 1 - */ - sheenRoughness: number; - /** - * The alpha channel of this texture is multiplied against `sheenRoughness`, for per-pixel control - * over sheen roughness. - * - * @type {?Texture} - * @default null - */ - sheenRoughnessMap: Texture | null; - /** - * The red channel of this texture is multiplied against `transmission`, for per-pixel control over - * optical transparency. - * - * @type {?Texture} - * @default null - */ - transmissionMap: Texture | null; - /** - * The thickness of the volume beneath the surface. The value is given in the - * coordinate space of the mesh. If the value is `0` the material is - * thin-walled. Otherwise the material is a volume boundary. - * - * @type {number} - * @default 0 - */ - thickness: number; - /** - * A texture that defines the thickness, stored in the green channel. This will - * be multiplied by `thickness`. - * - * @type {?Texture} - * @default null - */ - thicknessMap: Texture | null; - /** - * Density of the medium given as the average distance that light travels in - * the medium before interacting with a particle. The value is given in world - * space units, and must be greater than zero. - * - * @type {number} - * @default Infinity - */ - attenuationDistance: number; - /** - * The color that white light turns into due to absorption when reaching the - * attenuation distance. - * - * @type {Color} - * @default (1,1,1) - */ - attenuationColor: Color; - /** - * A float that scales the amount of specular reflection for non-metals only. - * When set to zero, the model is effectively Lambertian. From `0.0` to `1.0`. - * - * @type {number} - * @default 1 - */ - specularIntensity: number; - /** - * The alpha channel of this texture is multiplied against `specularIntensity`, - * for per-pixel control over specular intensity. - * - * @type {?Texture} - * @default null - */ - specularIntensityMap: Texture | null; - /** - * Tints the specular reflection at normal incidence for non-metals only. - * - * @type {Color} - * @default (1,1,1) - */ - specularColor: Color; - /** - * The RGB channels of this texture are multiplied against `specularColor`, - * for per-pixel control over specular color. - * - * @type {?Texture} - * @default null - */ - specularColorMap: Texture | null; - _anisotropy: number; - _clearcoat: number; - _dispersion: number; - _iridescence: number; - _sheen: number; - _transmission: number; - set anisotropy(value: number); - /** - * The anisotropy strength, from `0.0` to `1.0`. - * - * @type {number} - * @default 0 - */ - get anisotropy(): number; - set clearcoat(value: number); - /** - * Represents the intensity of the clear coat layer, from `0.0` to `1.0`. Use - * clear coat related properties to enable multilayer materials that have a - * thin translucent layer over the base layer. - * - * @type {number} - * @default 0 - */ - get clearcoat(): number; - set iridescence(value: number); - /** - * The intensity of the iridescence layer, simulating RGB color shift based on the angle between - * the surface and the viewer, from `0.0` to `1.0`. - * - * @type {number} - * @default 0 - */ - get iridescence(): number; - set dispersion(value: number); - /** - * Defines the strength of the angular separation of colors (chromatic aberration) transmitting - * through a relatively clear volume. Any value zero or larger is valid, the typical range of - * realistic values is `[0, 1]`. This property can be only be used with transmissive objects. - * - * @type {number} - * @default 0 - */ - get dispersion(): number; - set sheen(value: number); - /** - * The intensity of the sheen layer, from `0.0` to `1.0`. - * - * @type {number} - * @default 0 - */ - get sheen(): number; - set transmission(value: number); - /** - * Degree of transmission (or optical transparency), from `0.0` to `1.0`. - * - * Thin, transparent or semitransparent, plastic or glass materials remain - * largely reflective even if they are fully transmissive. The transmission - * property can be used to model these materials. - * - * When transmission is non-zero, `opacity` should be set to `1`. - * - * @type {number} - * @default 0 - */ - get transmission(): number; - copy(source: any): this; -} -import { MeshStandardMaterial } from './MeshStandardMaterial.js'; -import { Vector2 } from '../math/Vector2.js'; -import { Color } from '../math/Color.js'; diff --git a/jsdoc-testing/jsdoc/materials/MeshStandardMaterial.d.ts b/jsdoc-testing/jsdoc/materials/MeshStandardMaterial.d.ts deleted file mode 100644 index 5b623bfb8..000000000 --- a/jsdoc-testing/jsdoc/materials/MeshStandardMaterial.d.ts +++ /dev/null @@ -1,326 +0,0 @@ -/** - * A standard physically based material, using Metallic-Roughness workflow. - * - * Physically based rendering (PBR) has recently become the standard in many - * 3D applications, such as [Unity](https://blogs.unity3d.com/2014/10/29/physically-based-shading-in-unity-5-a-primer/), - * [Unreal](https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/PhysicallyBased/) and - * [3D Studio Max](http://area.autodesk.com/blogs/the-3ds-max-blog/what039s-new-for-rendering-in-3ds-max-2017). - * - * This approach differs from older approaches in that instead of using - * approximations for the way in which light interacts with a surface, a - * physically correct model is used. The idea is that, instead of tweaking - * materials to look good under specific lighting, a material can be created - * that will react 'correctly' under all lighting scenarios. - * - * In practice this gives a more accurate and realistic looking result than - * the {@link MeshLambertMaterial} or {@link MeshPhongMaterial}, at the cost of - * being somewhat more computationally expensive. `MeshStandardMaterial` uses per-fragment - * shading. - * - * Note that for best results you should always specify an environment map when using this material. - * - * For a non-technical introduction to the concept of PBR and how to set up a - * PBR material, check out these articles by the people at [marmoset](https://www.marmoset.co): - * - * - [Basic Theory of Physically Based Rendering](https://www.marmoset.co/posts/basic-theory-of-physically-based-rendering/) - * - [Physically Based Rendering and You Can Too](https://www.marmoset.co/posts/physically-based-rendering-and-you-can-too/) - * - * Technical details of the approach used in three.js (and most other PBR systems) can be found is this - * [paper from Disney](https://media.disneyanimation.com/uploads/production/publication_asset/48/asset/s2012_pbs_disney_brdf_notes_v3.pdf) - * (pdf), by Brent Burley. - * - * @augments Material - * @demo scenes/material-browser.html#MeshStandardMaterial - */ -export class MeshStandardMaterial extends Material { - /** - * Constructs a new mesh standard material. - * - * @param {Object} [parameters] - An object with one or more properties - * defining the material's appearance. Any property of the material - * (including any property from inherited materials) can be passed - * in here. Color values can be passed any type of value accepted - * by {@link Color#set}. - */ - constructor(parameters?: Object); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isMeshStandardMaterial: boolean; - type: string; - defines: { - STANDARD: string; - }; - /** - * Color of the material. - * - * @type {Color} - * @default (1,1,1) - */ - color: Color; - /** - * How rough the material appears. `0.0` means a smooth mirror reflection, `1.0` - * means fully diffuse. If `roughnessMap` is also provided, - * both values are multiplied. - * - * @type {number} - * @default 1 - */ - roughness: number; - /** - * How much the material is like a metal. Non-metallic materials such as wood - * or stone use `0.0`, metallic use `1.0`, with nothing (usually) in between. - * A value between `0.0` and `1.0` could be used for a rusty metal look. - * If `metalnessMap` is also provided, both values are multiplied. - * - * @type {number} - * @default 0 - */ - metalness: number; - /** - * The color map. May optionally include an alpha channel, typically combined - * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map - * color is modulated by the diffuse `color`. - * - * @type {?Texture} - * @default null - */ - map: Texture | null; - /** - * The light map. Requires a second set of UVs. - * - * @type {?Texture} - * @default null - */ - lightMap: Texture | null; - /** - * Intensity of the baked light. - * - * @type {number} - * @default 1 - */ - lightMapIntensity: number; - /** - * The red channel of this texture is used as the ambient occlusion map. - * Requires a second set of UVs. - * - * @type {?Texture} - * @default null - */ - aoMap: Texture | null; - /** - * Intensity of the ambient occlusion effect. Range is `[0,1]`, where `0` - * disables ambient occlusion. Where intensity is `1` and the AO map's - * red channel is also `1`, ambient light is fully occluded on a surface. - * - * @type {number} - * @default 1 - */ - aoMapIntensity: number; - /** - * Emissive (light) color of the material, essentially a solid color - * unaffected by other lighting. - * - * @type {Color} - * @default (0,0,0) - */ - emissive: Color; - /** - * Intensity of the emissive light. Modulates the emissive color. - * - * @type {number} - * @default 1 - */ - emissiveIntensity: number; - /** - * Set emissive (glow) map. The emissive map color is modulated by the - * emissive color and the emissive intensity. If you have an emissive map, - * be sure to set the emissive color to something other than black. - * - * @type {?Texture} - * @default null - */ - emissiveMap: Texture | null; - /** - * The texture to create a bump map. The black and white values map to the - * perceived depth in relation to the lights. Bump doesn't actually affect - * the geometry of the object, only the lighting. If a normal map is defined - * this will be ignored. - * - * @type {?Texture} - * @default null - */ - bumpMap: Texture | null; - /** - * How much the bump map affects the material. Typical range is `[0,1]`. - * - * @type {number} - * @default 1 - */ - bumpScale: number; - /** - * The texture to create a normal map. The RGB values affect the surface - * normal for each pixel fragment and change the way the color is lit. Normal - * maps do not change the actual shape of the surface, only the lighting. In - * case the material has a normal map authored using the left handed - * convention, the `y` component of `normalScale` should be negated to compensate - * for the different handedness. - * - * @type {?Texture} - * @default null - */ - normalMap: Texture | null; - /** - * The type of normal map. - * - * @type {(TangentSpaceNormalMap|ObjectSpaceNormalMap)} - * @default TangentSpaceNormalMap - */ - normalMapType: (number | ObjectSpaceNormalMap); - /** - * How much the normal map affects the material. Typical value range is `[0,1]`. - * - * @type {Vector2} - * @default (1,1) - */ - normalScale: Vector2; - /** - * The displacement map affects the position of the mesh's vertices. Unlike - * other maps which only affect the light and shade of the material the - * displaced vertices can cast shadows, block other objects, and otherwise - * act as real geometry. The displacement texture is an image where the value - * of each pixel (white being the highest) is mapped against, and - * repositions, the vertices of the mesh. - * - * @type {?Texture} - * @default null - */ - displacementMap: Texture | null; - /** - * How much the displacement map affects the mesh (where black is no - * displacement, and white is maximum displacement). Without a displacement - * map set, this value is not applied. - * - * @type {number} - * @default 0 - */ - displacementScale: number; - /** - * The offset of the displacement map's values on the mesh's vertices. - * The bias is added to the scaled sample of the displacement map. - * Without a displacement map set, this value is not applied. - * - * @type {number} - * @default 0 - */ - displacementBias: number; - /** - * The green channel of this texture is used to alter the roughness of the - * material. - * - * @type {?Texture} - * @default null - */ - roughnessMap: Texture | null; - /** - * The blue channel of this texture is used to alter the metalness of the - * material. - * - * @type {?Texture} - * @default null - */ - metalnessMap: Texture | null; - /** - * The alpha map is a grayscale texture that controls the opacity across the - * surface (black: fully transparent; white: fully opaque). - * - * Only the color of the texture is used, ignoring the alpha channel if one - * exists. For RGB and RGBA textures, the renderer will use the green channel - * when sampling this texture due to the extra bit of precision provided for - * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and - * luminance/alpha textures will also still work as expected. - * - * @type {?Texture} - * @default null - */ - alphaMap: Texture | null; - /** - * The environment map. To ensure a physically correct rendering, environment maps - * are internally pre-processed with {@link PMREMGenerator}. - * - * @type {?Texture} - * @default null - */ - envMap: Texture | null; - /** - * The rotation of the environment map in radians. - * - * @type {Euler} - * @default (0,0,0) - */ - envMapRotation: Euler; - /** - * Scales the effect of the environment map by multiplying its color. - * - * @type {number} - * @default 1 - */ - envMapIntensity: number; - /** - * Renders the geometry as a wireframe. - * - * @type {boolean} - * @default false - */ - wireframe: boolean; - /** - * Controls the thickness of the wireframe. - * - * Can only be used with {@link SVGRenderer}. - * - * @type {number} - * @default 1 - */ - wireframeLinewidth: number; - /** - * Defines appearance of wireframe ends. - * - * Can only be used with {@link SVGRenderer}. - * - * @type {('round'|'bevel'|'miter')} - * @default 'round' - */ - wireframeLinecap: ("round" | "bevel" | "miter"); - /** - * Defines appearance of wireframe joints. - * - * Can only be used with {@link SVGRenderer}. - * - * @type {('round'|'bevel'|'miter')} - * @default 'round' - */ - wireframeLinejoin: ("round" | "bevel" | "miter"); - /** - * Whether the material is rendered with flat shading or not. - * - * @type {boolean} - * @default false - */ - flatShading: boolean; - /** - * Whether the material is affected by fog or not. - * - * @type {boolean} - * @default true - */ - fog: boolean; - copy(source: any): this; -} -import { Material } from './Material.js'; -import { Color } from '../math/Color.js'; -import { Vector2 } from '../math/Vector2.js'; -import { Euler } from '../math/Euler.js'; diff --git a/jsdoc-testing/jsdoc/materials/MeshToonMaterial.d.ts b/jsdoc-testing/jsdoc/materials/MeshToonMaterial.d.ts deleted file mode 100644 index 9d8db3ec6..000000000 --- a/jsdoc-testing/jsdoc/materials/MeshToonMaterial.d.ts +++ /dev/null @@ -1,242 +0,0 @@ -/** - * A material implementing toon shading. - * - * @augments Material - * @demo scenes/material-browser.html#MeshToonMaterial - */ -export class MeshToonMaterial extends Material { - /** - * Constructs a new mesh toon material. - * - * @param {Object} [parameters] - An object with one or more properties - * defining the material's appearance. Any property of the material - * (including any property from inherited materials) can be passed - * in here. Color values can be passed any type of value accepted - * by {@link Color#set}. - */ - constructor(parameters?: Object); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isMeshToonMaterial: boolean; - defines: { - TOON: string; - }; - type: string; - /** - * Color of the material. - * - * @type {Color} - * @default (1,1,1) - */ - color: Color; - /** - * The color map. May optionally include an alpha channel, typically combined - * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map - * color is modulated by the diffuse `color`. - * - * @type {?Texture} - * @default null - */ - map: Texture | null; - /** - * Gradient map for toon shading. It's required to set - * {@link Texture#minFilter} and {@link Texture#magFilter} to {@link NearestFilter} - * when using this type of texture. - * - * @type {?Texture} - * @default null - */ - gradientMap: Texture | null; - /** - * The light map. Requires a second set of UVs. - * - * @type {?Texture} - * @default null - */ - lightMap: Texture | null; - /** - * Intensity of the baked light. - * - * @type {number} - * @default 1 - */ - lightMapIntensity: number; - /** - * The red channel of this texture is used as the ambient occlusion map. - * Requires a second set of UVs. - * - * @type {?Texture} - * @default null - */ - aoMap: Texture | null; - /** - * Intensity of the ambient occlusion effect. Range is `[0,1]`, where `0` - * disables ambient occlusion. Where intensity is `1` and the AO map's - * red channel is also `1`, ambient light is fully occluded on a surface. - * - * @type {number} - * @default 1 - */ - aoMapIntensity: number; - /** - * Emissive (light) color of the material, essentially a solid color - * unaffected by other lighting. - * - * @type {Color} - * @default (0,0,0) - */ - emissive: Color; - /** - * Intensity of the emissive light. Modulates the emissive color. - * - * @type {number} - * @default 1 - */ - emissiveIntensity: number; - /** - * Set emissive (glow) map. The emissive map color is modulated by the - * emissive color and the emissive intensity. If you have an emissive map, - * be sure to set the emissive color to something other than black. - * - * @type {?Texture} - * @default null - */ - emissiveMap: Texture | null; - /** - * The texture to create a bump map. The black and white values map to the - * perceived depth in relation to the lights. Bump doesn't actually affect - * the geometry of the object, only the lighting. If a normal map is defined - * this will be ignored. - * - * @type {?Texture} - * @default null - */ - bumpMap: Texture | null; - /** - * How much the bump map affects the material. Typical range is `[0,1]`. - * - * @type {number} - * @default 1 - */ - bumpScale: number; - /** - * The texture to create a normal map. The RGB values affect the surface - * normal for each pixel fragment and change the way the color is lit. Normal - * maps do not change the actual shape of the surface, only the lighting. In - * case the material has a normal map authored using the left handed - * convention, the `y` component of `normalScale` should be negated to compensate - * for the different handedness. - * - * @type {?Texture} - * @default null - */ - normalMap: Texture | null; - /** - * The type of normal map. - * - * @type {(TangentSpaceNormalMap|ObjectSpaceNormalMap)} - * @default TangentSpaceNormalMap - */ - normalMapType: (number | ObjectSpaceNormalMap); - /** - * How much the normal map affects the material. Typical value range is `[0,1]`. - * - * @type {Vector2} - * @default (1,1) - */ - normalScale: Vector2; - /** - * The displacement map affects the position of the mesh's vertices. Unlike - * other maps which only affect the light and shade of the material the - * displaced vertices can cast shadows, block other objects, and otherwise - * act as real geometry. The displacement texture is an image where the value - * of each pixel (white being the highest) is mapped against, and - * repositions, the vertices of the mesh. - * - * @type {?Texture} - * @default null - */ - displacementMap: Texture | null; - /** - * How much the displacement map affects the mesh (where black is no - * displacement, and white is maximum displacement). Without a displacement - * map set, this value is not applied. - * - * @type {number} - * @default 0 - */ - displacementScale: number; - /** - * The offset of the displacement map's values on the mesh's vertices. - * The bias is added to the scaled sample of the displacement map. - * Without a displacement map set, this value is not applied. - * - * @type {number} - * @default 0 - */ - displacementBias: number; - /** - * The alpha map is a grayscale texture that controls the opacity across the - * surface (black: fully transparent; white: fully opaque). - * - * Only the color of the texture is used, ignoring the alpha channel if one - * exists. For RGB and RGBA textures, the renderer will use the green channel - * when sampling this texture due to the extra bit of precision provided for - * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and - * luminance/alpha textures will also still work as expected. - * - * @type {?Texture} - * @default null - */ - alphaMap: Texture | null; - /** - * Renders the geometry as a wireframe. - * - * @type {boolean} - * @default false - */ - wireframe: boolean; - /** - * Controls the thickness of the wireframe. - * - * Can only be used with {@link SVGRenderer}. - * - * @type {number} - * @default 1 - */ - wireframeLinewidth: number; - /** - * Defines appearance of wireframe ends. - * - * Can only be used with {@link SVGRenderer}. - * - * @type {('round'|'bevel'|'miter')} - * @default 'round' - */ - wireframeLinecap: ("round" | "bevel" | "miter"); - /** - * Defines appearance of wireframe joints. - * - * Can only be used with {@link SVGRenderer}. - * - * @type {('round'|'bevel'|'miter')} - * @default 'round' - */ - wireframeLinejoin: ("round" | "bevel" | "miter"); - /** - * Whether the material is affected by fog or not. - * - * @type {boolean} - * @default true - */ - fog: boolean; - copy(source: any): this; -} -import { Material } from './Material.js'; -import { Color } from '../math/Color.js'; -import { Vector2 } from '../math/Vector2.js'; diff --git a/jsdoc-testing/jsdoc/materials/PointsMaterial.d.ts b/jsdoc-testing/jsdoc/materials/PointsMaterial.d.ts deleted file mode 100644 index b6869b31b..000000000 --- a/jsdoc-testing/jsdoc/materials/PointsMaterial.d.ts +++ /dev/null @@ -1,102 +0,0 @@ -/** - * A material for rendering point primitives. - * - * Materials define the appearance of renderable 3D objects. - * - * ```js - * const vertices = []; - * - * for ( let i = 0; i < 10000; i ++ ) { - * const x = THREE.MathUtils.randFloatSpread( 2000 ); - * const y = THREE.MathUtils.randFloatSpread( 2000 ); - * const z = THREE.MathUtils.randFloatSpread( 2000 ); - * - * vertices.push( x, y, z ); - * } - * - * const geometry = new THREE.BufferGeometry(); - * geometry.setAttribute( 'position', new THREE.Float32BufferAttribute( vertices, 3 ) ); - * const material = new THREE.PointsMaterial( { color: 0x888888 } ); - * const points = new THREE.Points( geometry, material ); - * scene.add( points ); - * ``` - * - * @augments Material - */ -export class PointsMaterial extends Material { - /** - * Constructs a new points material. - * - * @param {Object} [parameters] - An object with one or more properties - * defining the material's appearance. Any property of the material - * (including any property from inherited materials) can be passed - * in here. Color values can be passed any type of value accepted - * by {@link Color#set}. - */ - constructor(parameters?: Object); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isPointsMaterial: boolean; - type: string; - /** - * Color of the material. - * - * @type {Color} - * @default (1,1,1) - */ - color: Color; - /** - * The color map. May optionally include an alpha channel, typically combined - * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map - * color is modulated by the diffuse `color`. - * - * @type {?Texture} - * @default null - */ - map: Texture | null; - /** - * The alpha map is a grayscale texture that controls the opacity across the - * surface (black: fully transparent; white: fully opaque). - * - * Only the color of the texture is used, ignoring the alpha channel if one - * exists. For RGB and RGBA textures, the renderer will use the green channel - * when sampling this texture due to the extra bit of precision provided for - * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and - * luminance/alpha textures will also still work as expected. - * - * @type {?Texture} - * @default null - */ - alphaMap: Texture | null; - /** - * Defines the size of the points in pixels. - * - * Might be capped if the value exceeds hardware dependent parameters like [gl.ALIASED_POINT_SIZE_RANGE](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getParamete). - * - * @type {number} - * @default 1 - */ - size: number; - /** - * Specifies whether size of individual points is attenuated by the camera depth (perspective camera only). - * - * @type {boolean} - * @default true - */ - sizeAttenuation: boolean; - /** - * Whether the material is affected by fog or not. - * - * @type {boolean} - * @default true - */ - fog: boolean; - copy(source: any): this; -} -import { Material } from './Material.js'; -import { Color } from '../math/Color.js'; diff --git a/jsdoc-testing/jsdoc/materials/RawShaderMaterial.d.ts b/jsdoc-testing/jsdoc/materials/RawShaderMaterial.d.ts deleted file mode 100644 index 6f5a5c8a5..000000000 --- a/jsdoc-testing/jsdoc/materials/RawShaderMaterial.d.ts +++ /dev/null @@ -1,108 +0,0 @@ -declare const RawShaderMaterial_base: { - new (parameters?: Object): { - readonly isShaderMaterial: boolean; - type: string; - defines: Object; - uniforms: Object; - uniformsGroups: Array; - vertexShader: string; - fragmentShader: string; - linewidth: number; - wireframe: boolean; - wireframeLinewidth: number; - fog: boolean; - lights: boolean; - clipping: boolean; - forceSinglePass: boolean; - extensions: { - clipCullDistance: false; - multiDraw: false; - }; - defaultAttributeValues: Object; - index0AttributeName: string | undefined; - uniformsNeedUpdate: boolean; - glslVersion: (GLSL1 | GLSL3) | null; - copy(source: any): /*elided*/ any; - toJSON(meta: any): Object; - readonly isMaterial: boolean; - readonly uuid: string; - name: string; - blending: (NoBlending | number | AdditiveBlending | SubtractiveBlending | MultiplyBlending | CustomBlending); - side: (number | BackSide | DoubleSide); - vertexColors: boolean; - opacity: number; - transparent: boolean; - alphaHash: boolean; - blendSrc: (ZeroFactor | OneFactor | SrcColorFactor | OneMinusSrcColorFactor | number | number | DstAlphaFactor | OneMinusDstAlphaFactor | DstColorFactor | OneMinusDstColorFactor | SrcAlphaSaturateFactor | ConstantColorFactor | OneMinusConstantColorFactor | ConstantAlphaFactor | OneMinusConstantAlphaFactor); - blendDst: (ZeroFactor | OneFactor | SrcColorFactor | OneMinusSrcColorFactor | number | number | DstAlphaFactor | OneMinusDstAlphaFactor | DstColorFactor | OneMinusDstColorFactor | SrcAlphaSaturateFactor | ConstantColorFactor | OneMinusConstantColorFactor | ConstantAlphaFactor | OneMinusConstantAlphaFactor); - blendEquation: (number | SubtractEquation | ReverseSubtractEquation | MinEquation | MaxEquation); - blendSrcAlpha: (ZeroFactor | OneFactor | SrcColorFactor | OneMinusSrcColorFactor | number | number | DstAlphaFactor | OneMinusDstAlphaFactor | DstColorFactor | OneMinusDstColorFactor | SrcAlphaSaturateFactor | ConstantColorFactor | OneMinusConstantColorFactor | ConstantAlphaFactor | OneMinusConstantAlphaFactor) | null; - blendDstAlpha: (ZeroFactor | OneFactor | SrcColorFactor | OneMinusSrcColorFactor | number | number | DstAlphaFactor | OneMinusDstAlphaFactor | DstColorFactor | OneMinusDstColorFactor | SrcAlphaSaturateFactor | ConstantColorFactor | OneMinusConstantColorFactor | ConstantAlphaFactor | OneMinusConstantAlphaFactor) | null; - blendEquationAlpha: (number | SubtractEquation | ReverseSubtractEquation | MinEquation | MaxEquation) | null; - blendColor: import("../math/Color.js").Color; - blendAlpha: number; - depthFunc: (NeverDepth | AlwaysDepth | LessDepth | number | EqualDepth | GreaterEqualDepth | GreaterDepth | NotEqualDepth); - depthTest: boolean; - depthWrite: boolean; - stencilWriteMask: number; - stencilFunc: NeverStencilFunc | LessStencilFunc | EqualStencilFunc | LessEqualStencilFunc | GreaterStencilFunc | NotEqualStencilFunc | GreaterEqualStencilFunc | number; - stencilRef: number; - stencilFuncMask: number; - stencilFail: ZeroStencilOp | number | ReplaceStencilOp | IncrementStencilOp | DecrementStencilOp | IncrementWrapStencilOp | DecrementWrapStencilOp | InvertStencilOp; - stencilZFail: ZeroStencilOp | number | ReplaceStencilOp | IncrementStencilOp | DecrementStencilOp | IncrementWrapStencilOp | DecrementWrapStencilOp | InvertStencilOp; - stencilZPass: ZeroStencilOp | number | ReplaceStencilOp | IncrementStencilOp | DecrementStencilOp | IncrementWrapStencilOp | DecrementWrapStencilOp | InvertStencilOp; - stencilWrite: boolean; - clippingPlanes: Array | null; - clipIntersection: boolean; - clipShadows: boolean; - shadowSide: (number | BackSide | DoubleSide) | null; - colorWrite: boolean; - precision: ("highp" | "mediump" | "lowp") | null; - polygonOffset: boolean; - polygonOffsetFactor: number; - polygonOffsetUnits: number; - dithering: boolean; - alphaToCoverage: boolean; - premultipliedAlpha: boolean; - allowOverride: boolean; - visible: boolean; - toneMapped: boolean; - userData: Object; - readonly version: number; - _alphaTest: number; - get alphaTest(): number; - set alphaTest(value: number); - onBeforeRender(): void; - onBeforeCompile(): void; - customProgramCacheKey(): string; - setValues(values?: Object): void; - clone(): Material; - dispose(): void; - set needsUpdate(value: boolean); - addEventListener(type: string, listener: Function): void; - _listeners: {} | undefined; - hasEventListener(type: string, listener: Function): boolean; - removeEventListener(type: string, listener: Function): void; - dispatchEvent(event: Object): void; - }; -}; -/** - * This class works just like {@link ShaderMaterial}, except that definitions - * of built-in uniforms and attributes are not automatically prepended to the - * GLSL shader code. - * - * `RawShaderMaterial` can only be used with {@link WebGLRenderer}. - * - * @augments ShaderMaterial - */ -export class RawShaderMaterial extends RawShaderMaterial_base { - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isRawShaderMaterial: boolean; -} -export {}; diff --git a/jsdoc-testing/jsdoc/materials/ShaderMaterial.d.ts b/jsdoc-testing/jsdoc/materials/ShaderMaterial.d.ts deleted file mode 100644 index 63d1da267..000000000 --- a/jsdoc-testing/jsdoc/materials/ShaderMaterial.d.ts +++ /dev/null @@ -1,256 +0,0 @@ -/** - * ~Shader - */ -export type ShaderMaterial = { - /** - * - The name of the shader. - */ - name: string; - /** - * - The uniforms of the shader. - */ - uniforms: { - [x: string]: Uniform; - }; - /** - * - The defines of the shader. - */ - defines: { - [x: string]: any; - }; - /** - * - The vertex shader code. - */ - vertexShader: string; - /** - * - The fragment shader code. - */ - fragmentShader: string; -}; -/** - * A material rendered with custom shaders. A shader is a small program written in GLSL. - * that runs on the GPU. You may want to use a custom shader if you need to implement an - * effect not included with any of the built-in materials. - * - * There are the following notes to bear in mind when using a `ShaderMaterial`: - * - * - `ShaderMaterial` can only be used with {@link WebGLRenderer}. - * - Built in attributes and uniforms are passed to the shaders along with your code. If - * you don't want that, use {@link RawShaderMaterial} instead. - * - You can use the directive `#pragma unroll_loop_start` and `#pragma unroll_loop_end` - * in order to unroll a `for` loop in GLSL by the shader preprocessor. The directive has - * to be placed right above the loop. The loop formatting has to correspond to a defined standard. - * - The loop has to be [normalized](https://en.wikipedia.org/wiki/Normalized_loop). - * - The loop variable has to be *i*. - * - The value `UNROLLED_LOOP_INDEX` will be replaced with the explicitly - * value of *i* for the given iteration and can be used in preprocessor - * statements. - * - * ```js - * const material = new THREE.ShaderMaterial( { - * uniforms: { - * time: { value: 1.0 }, - * resolution: { value: new THREE.Vector2() } - * }, - * vertexShader: document.getElementById( 'vertexShader' ).textContent, - * fragmentShader: document.getElementById( 'fragmentShader' ).textContent - * } ); - * ``` - * - * @augments Material - */ -export class ShaderMaterial extends Material { - /** - * Constructs a new shader material. - * - * @param {Object} [parameters] - An object with one or more properties - * defining the material's appearance. Any property of the material - * (including any property from inherited materials) can be passed - * in here. Color values can be passed any type of value accepted - * by {@link Color#set}. - */ - constructor(parameters?: Object); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isShaderMaterial: boolean; - type: string; - /** - * Defines custom constants using `#define` directives within the GLSL code - * for both the vertex shader and the fragment shader; each key/value pair - * yields another directive. - * ```js - * defines: { - * FOO: 15, - * BAR: true - * } - * ``` - * Yields the lines: - * ``` - * #define FOO 15 - * #define BAR true - * ``` - * - * @type {Object} - */ - defines: Object; - /** - * An object of the form: - * ```js - * { - * "uniform1": { value: 1.0 }, - * "uniform2": { value: 2 } - * } - * ``` - * specifying the uniforms to be passed to the shader code; keys are uniform - * names, values are definitions of the form - * ``` - * { - * value: 1.0 - * } - * ``` - * where `value` is the value of the uniform. Names must match the name of - * the uniform, as defined in the GLSL code. Note that uniforms are refreshed - * on every frame, so updating the value of the uniform will immediately - * update the value available to the GLSL code. - * - * @type {Object} - */ - uniforms: Object; - /** - * An array holding uniforms groups for configuring UBOs. - * - * @type {Array} - */ - uniformsGroups: Array; - /** - * Vertex shader GLSL code. This is the actual code for the shader. - * - * @type {string} - */ - vertexShader: string; - /** - * Fragment shader GLSL code. This is the actual code for the shader. - * - * @type {string} - */ - fragmentShader: string; - /** - * Controls line thickness or lines. - * - * WebGL and WebGPU ignore this setting and always render line primitives with a - * width of one pixel. - * - * @type {number} - * @default 1 - */ - linewidth: number; - /** - * Renders the geometry as a wireframe. - * - * @type {boolean} - * @default false - */ - wireframe: boolean; - /** - * Controls the thickness of the wireframe. - * - * WebGL and WebGPU ignore this property and always render - * 1 pixel wide lines. - * - * @type {number} - * @default 1 - */ - wireframeLinewidth: number; - /** - * Defines whether the material color is affected by global fog settings; `true` - * to pass fog uniforms to the shader. - * - * Setting this property to `true` requires the definition of fog uniforms. It is - * recommended to use `UniformsUtils.merge()` to combine the custom shader uniforms - * with predefined fog uniforms. - * - * ```js - * const material = new ShaderMaterial( { - * uniforms: UniformsUtils.merge( [ UniformsLib[ 'fog' ], shaderUniforms ] ); - * vertexShader: vertexShader, - * fragmentShader: fragmentShader, - * fog: true - * } ); - * ``` - * - * @type {boolean} - * @default false - */ - fog: boolean; - /** - * Defines whether this material uses lighting; `true` to pass uniform data - * related to lighting to this shader. - * - * @type {boolean} - * @default false - */ - lights: boolean; - /** - * Defines whether this material supports clipping; `true` to let the renderer - * pass the clippingPlanes uniform. - * - * @type {boolean} - * @default false - */ - clipping: boolean; - /** - * This object allows to enable certain WebGL 2 extensions. - * - * - clipCullDistance: set to `true` to use vertex shader clipping - * - multiDraw: set to `true` to use vertex shader multi_draw / enable gl_DrawID - * - * @type {{clipCullDistance:false,multiDraw:false}} - */ - extensions: { - clipCullDistance: false; - multiDraw: false; - }; - /** - * When the rendered geometry doesn't include these attributes but the - * material does, these default values will be passed to the shaders. This - * avoids errors when buffer data is missing. - * - * - color: [ 1, 1, 1 ] - * - uv: [ 0, 0 ] - * - uv1: [ 0, 0 ] - * - * @type {Object} - */ - defaultAttributeValues: Object; - /** - * If set, this calls [gl.bindAttribLocation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bindAttribLocation) - * to bind a generic vertex index to an attribute variable. - * - * @type {string|undefined} - * @default undefined - */ - index0AttributeName: string | undefined; - /** - * Can be used to force a uniform update while changing uniforms in - * {@link Object3D#onBeforeRender}. - * - * @type {boolean} - * @default false - */ - uniformsNeedUpdate: boolean; - /** - * Defines the GLSL version of custom shader code. - * - * @type {?(GLSL1|GLSL3)} - * @default null - */ - glslVersion: (GLSL1 | GLSL3) | null; - copy(source: any): this; - toJSON(meta: any): Object; -} -import { Material } from './Material.js'; diff --git a/jsdoc-testing/jsdoc/materials/ShadowMaterial.d.ts b/jsdoc-testing/jsdoc/materials/ShadowMaterial.d.ts deleted file mode 100644 index 2e66a5668..000000000 --- a/jsdoc-testing/jsdoc/materials/ShadowMaterial.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -/** - * This material can receive shadows, but otherwise is completely transparent. - * - * ```js - * const geometry = new THREE.PlaneGeometry( 2000, 2000 ); - * geometry.rotateX( - Math.PI / 2 ); - * - * const material = new THREE.ShadowMaterial(); - * material.opacity = 0.2; - * - * const plane = new THREE.Mesh( geometry, material ); - * plane.position.y = -200; - * plane.receiveShadow = true; - * scene.add( plane ); - * ``` - * - * @augments Material - */ -export class ShadowMaterial extends Material { - /** - * Constructs a new shadow material. - * - * @param {Object} [parameters] - An object with one or more properties - * defining the material's appearance. Any property of the material - * (including any property from inherited materials) can be passed - * in here. Color values can be passed any type of value accepted - * by {@link Color#set}. - */ - constructor(parameters?: Object); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isShadowMaterial: boolean; - type: string; - /** - * Color of the material. - * - * @type {Color} - * @default (0,0,0) - */ - color: Color; - /** - * Whether the material is affected by fog or not. - * - * @type {boolean} - * @default true - */ - fog: boolean; - copy(source: any): this; -} -import { Material } from './Material.js'; -import { Color } from '../math/Color.js'; diff --git a/jsdoc-testing/jsdoc/materials/SpriteMaterial.d.ts b/jsdoc-testing/jsdoc/materials/SpriteMaterial.d.ts deleted file mode 100644 index e44d5d72d..000000000 --- a/jsdoc-testing/jsdoc/materials/SpriteMaterial.d.ts +++ /dev/null @@ -1,89 +0,0 @@ -/** - * A material for rendering instances of {@link Sprite}. - * - * ```js - * const map = new THREE.TextureLoader().load( 'textures/sprite.png' ); - * const material = new THREE.SpriteMaterial( { map: map, color: 0xffffff } ); - * - * const sprite = new THREE.Sprite( material ); - * sprite.scale.set(200, 200, 1) - * scene.add( sprite ); - * ``` - * - * @augments Material - */ -export class SpriteMaterial extends Material { - /** - * Constructs a new sprite material. - * - * @param {Object} [parameters] - An object with one or more properties - * defining the material's appearance. Any property of the material - * (including any property from inherited materials) can be passed - * in here. Color values can be passed any type of value accepted - * by {@link Color#set}. - */ - constructor(parameters?: Object); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isSpriteMaterial: boolean; - type: string; - /** - * Color of the material. - * - * @type {Color} - * @default (1,1,1) - */ - color: Color; - /** - * The color map. May optionally include an alpha channel, typically combined - * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map - * color is modulated by the diffuse `color`. - * - * @type {?Texture} - * @default null - */ - map: Texture | null; - /** - * The alpha map is a grayscale texture that controls the opacity across the - * surface (black: fully transparent; white: fully opaque). - * - * Only the color of the texture is used, ignoring the alpha channel if one - * exists. For RGB and RGBA textures, the renderer will use the green channel - * when sampling this texture due to the extra bit of precision provided for - * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and - * luminance/alpha textures will also still work as expected. - * - * @type {?Texture} - * @default null - */ - alphaMap: Texture | null; - /** - * The rotation of the sprite in radians. - * - * @type {number} - * @default 0 - */ - rotation: number; - /** - * Specifies whether size of the sprite is attenuated by the camera depth (perspective camera only). - * - * @type {boolean} - * @default true - */ - sizeAttenuation: boolean; - /** - * Whether the material is affected by fog or not. - * - * @type {boolean} - * @default true - */ - fog: boolean; - copy(source: any): this; -} -import { Material } from './Material.js'; -import { Color } from '../math/Color.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/Line2NodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/Line2NodeMaterial.d.ts deleted file mode 100644 index 1637e7e49..000000000 --- a/jsdoc-testing/jsdoc/materials/nodes/Line2NodeMaterial.d.ts +++ /dev/null @@ -1,86 +0,0 @@ -export default Line2NodeMaterial; -/** - * This node material can be used to render lines with a size larger than one - * by representing them as instanced meshes. - * - * @augments NodeMaterial - */ -declare class Line2NodeMaterial extends NodeMaterial { - /** - * Constructs a new node material for wide line rendering. - * - * @param {Object} [parameters={}] - The configuration parameter. - */ - constructor(parameters?: Object); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isLine2NodeMaterial: boolean; - /** - * The dash offset. - * - * @type {number} - * @default 0 - */ - dashOffset: number; - /** - * Defines the lines color. - * - * @type {?Node} - * @default null - */ - lineColorNode: Node | null; - /** - * Defines the offset. - * - * @type {?Node} - * @default null - */ - offsetNode: Node | null; - /** - * Defines the dash scale. - * - * @type {?Node} - * @default null - */ - dashScaleNode: Node | null; - /** - * Defines the dash size. - * - * @type {?Node} - * @default null - */ - dashSizeNode: Node | null; - /** - * Defines the gap size. - * - * @type {?Node} - * @default null - */ - gapSizeNode: Node | null; - _useDash: any; - _useAlphaToCoverage: boolean; - _useWorldUnits: boolean; - set worldUnits(value: boolean); - /** - * Whether the lines should sized in world units or not. - * When set to `false` the unit is pixel. - * - * @type {boolean} - * @default false - */ - get worldUnits(): boolean; - set dashed(value: boolean); - /** - * Whether the lines should be dashed or not. - * - * @type {boolean} - * @default false - */ - get dashed(): boolean; -} -import NodeMaterial from './NodeMaterial.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/LineBasicNodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/LineBasicNodeMaterial.d.ts deleted file mode 100644 index da65dc888..000000000 --- a/jsdoc-testing/jsdoc/materials/nodes/LineBasicNodeMaterial.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -export default LineBasicNodeMaterial; -/** - * Node material version of {@link LineBasicMaterial}. - * - * @augments NodeMaterial - */ -declare class LineBasicNodeMaterial extends NodeMaterial { - /** - * Constructs a new line basic node material. - * - * @param {Object} [parameters] - The configuration parameter. - */ - constructor(parameters?: Object); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isLineBasicNodeMaterial: boolean; -} -import NodeMaterial from './NodeMaterial.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/LineDashedNodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/LineDashedNodeMaterial.d.ts deleted file mode 100644 index 89820e463..000000000 --- a/jsdoc-testing/jsdoc/materials/nodes/LineDashedNodeMaterial.d.ts +++ /dev/null @@ -1,78 +0,0 @@ -export default LineDashedNodeMaterial; -/** - * Node material version of {@link LineDashedMaterial}. - * - * @augments NodeMaterial - */ -declare class LineDashedNodeMaterial extends NodeMaterial { - /** - * Constructs a new line dashed node material. - * - * @param {Object} [parameters] - The configuration parameter. - */ - constructor(parameters?: Object); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isLineDashedNodeMaterial: boolean; - /** - * The dash offset. - * - * @type {number} - * @default 0 - */ - dashOffset: number; - /** - * The offset of dash materials is by default inferred from the `dashOffset` - * property. This node property allows to overwrite the default - * and define the offset with a node instead. - * - * If you don't want to overwrite the offset but modify the existing - * value instead, use {@link materialLineDashOffset}. - * - * @type {?Node} - * @default null - */ - offsetNode: Node | null; - /** - * The scale of dash materials is by default inferred from the `scale` - * property. This node property allows to overwrite the default - * and define the scale with a node instead. - * - * If you don't want to overwrite the scale but modify the existing - * value instead, use {@link materialLineScale}. - * - * @type {?Node} - * @default null - */ - dashScaleNode: Node | null; - /** - * The dash size of dash materials is by default inferred from the `dashSize` - * property. This node property allows to overwrite the default - * and define the dash size with a node instead. - * - * If you don't want to overwrite the dash size but modify the existing - * value instead, use {@link materialLineDashSize}. - * - * @type {?Node} - * @default null - */ - dashSizeNode: Node | null; - /** - * The gap size of dash materials is by default inferred from the `gapSize` - * property. This node property allows to overwrite the default - * and define the gap size with a node instead. - * - * If you don't want to overwrite the gap size but modify the existing - * value instead, use {@link materialLineGapSize}. - * - * @type {?Node} - * @default null - */ - gapSizeNode: Node | null; -} -import NodeMaterial from './NodeMaterial.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/MeshBasicNodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/MeshBasicNodeMaterial.d.ts deleted file mode 100644 index 97d6b1cb4..000000000 --- a/jsdoc-testing/jsdoc/materials/nodes/MeshBasicNodeMaterial.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -export default MeshBasicNodeMaterial; -/** - * Node material version of {@link MeshBasicMaterial}. - * - * @augments NodeMaterial - */ -declare class MeshBasicNodeMaterial extends NodeMaterial { - /** - * Constructs a new mesh basic node material. - * - * @param {Object} [parameters] - The configuration parameter. - */ - constructor(parameters?: Object); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isMeshBasicNodeMaterial: boolean; - /** - * Overwritten since this type of material uses {@link BasicEnvironmentNode} - * to implement the default environment mapping. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {?BasicEnvironmentNode} The environment node. - */ - setupEnvironment(builder: NodeBuilder): BasicEnvironmentNode | null; - /** - * Setups the lighting model. - * - * @return {BasicLightingModel} The lighting model. - */ - setupLightingModel(): BasicLightingModel; -} -import NodeMaterial from './NodeMaterial.js'; -import BasicEnvironmentNode from '../../nodes/lighting/BasicEnvironmentNode.js'; -import BasicLightingModel from '../../nodes/functions/BasicLightingModel.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/MeshLambertNodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/MeshLambertNodeMaterial.d.ts deleted file mode 100644 index a5e110905..000000000 --- a/jsdoc-testing/jsdoc/materials/nodes/MeshLambertNodeMaterial.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -export default MeshLambertNodeMaterial; -/** - * Node material version of {@link MeshLambertMaterial}. - * - * @augments NodeMaterial - */ -declare class MeshLambertNodeMaterial extends NodeMaterial { - /** - * Constructs a new mesh lambert node material. - * - * @param {Object} [parameters] - The configuration parameter. - */ - constructor(parameters?: Object); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isMeshLambertNodeMaterial: boolean; - /** - * Overwritten since this type of material uses {@link BasicEnvironmentNode} - * to implement the default environment mapping. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {?BasicEnvironmentNode} The environment node. - */ - setupEnvironment(builder: NodeBuilder): BasicEnvironmentNode | null; - /** - * Setups the lighting model. - * - * @return {PhongLightingModel} The lighting model. - */ - setupLightingModel(): PhongLightingModel; -} -import NodeMaterial from './NodeMaterial.js'; -import BasicEnvironmentNode from '../../nodes/lighting/BasicEnvironmentNode.js'; -import PhongLightingModel from '../../nodes/functions/PhongLightingModel.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/MeshMatcapNodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/MeshMatcapNodeMaterial.d.ts deleted file mode 100644 index 1a2d32c8c..000000000 --- a/jsdoc-testing/jsdoc/materials/nodes/MeshMatcapNodeMaterial.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -export default MeshMatcapNodeMaterial; -/** - * Node material version of {@link MeshMatcapMaterial}. - * - * @augments NodeMaterial - */ -declare class MeshMatcapNodeMaterial extends NodeMaterial { - /** - * Constructs a new mesh normal node material. - * - * @param {Object} [parameters] - The configuration parameter. - */ - constructor(parameters?: Object); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isMeshMatcapNodeMaterial: boolean; - /** - * Setups the matcap specific node variables. - * - * @param {NodeBuilder} builder - The current node builder. - */ - setupVariants(builder: NodeBuilder): void; -} -import NodeMaterial from './NodeMaterial.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/MeshNormalNodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/MeshNormalNodeMaterial.d.ts deleted file mode 100644 index effc5951b..000000000 --- a/jsdoc-testing/jsdoc/materials/nodes/MeshNormalNodeMaterial.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -export default MeshNormalNodeMaterial; -/** - * Node material version of {@link MeshNormalMaterial}. - * - * @augments NodeMaterial - */ -declare class MeshNormalNodeMaterial extends NodeMaterial { - /** - * Constructs a new mesh normal node material. - * - * @param {Object} [parameters] - The configuration parameter. - */ - constructor(parameters?: Object); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isMeshNormalNodeMaterial: boolean; - /** - * Overwrites the default implementation by computing the diffuse color - * based on the normal data. - */ - setupDiffuseColor(): void; -} -import NodeMaterial from './NodeMaterial.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/MeshPhongNodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/MeshPhongNodeMaterial.d.ts deleted file mode 100644 index b55a9c942..000000000 --- a/jsdoc-testing/jsdoc/materials/nodes/MeshPhongNodeMaterial.d.ts +++ /dev/null @@ -1,64 +0,0 @@ -export default MeshPhongNodeMaterial; -/** - * Node material version of {@link MeshPhongMaterial}. - * - * @augments NodeMaterial - */ -declare class MeshPhongNodeMaterial extends NodeMaterial { - /** - * Constructs a new mesh lambert node material. - * - * @param {Object} [parameters] - The configuration parameter. - */ - constructor(parameters?: Object); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isMeshPhongNodeMaterial: boolean; - /** - * The shininess of phong materials is by default inferred from the `shininess` - * property. This node property allows to overwrite the default - * and define the shininess with a node instead. - * - * If you don't want to overwrite the shininess but modify the existing - * value instead, use {@link materialShininess}. - * - * @type {?Node} - * @default null - */ - shininessNode: Node | null; - /** - * The specular color of phong materials is by default inferred from the - * `specular` property. This node property allows to overwrite the default - * and define the specular color with a node instead. - * - * If you don't want to overwrite the specular color but modify the existing - * value instead, use {@link materialSpecular}. - * - * @type {?Node} - * @default null - */ - specularNode: Node | null; - /** - * Overwritten since this type of material uses {@link BasicEnvironmentNode} - * to implement the default environment mapping. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {?BasicEnvironmentNode} The environment node. - */ - setupEnvironment(builder: NodeBuilder): BasicEnvironmentNode | null; - /** - * Setups the lighting model. - * - * @return {PhongLightingModel} The lighting model. - */ - setupLightingModel(): PhongLightingModel; - copy(source: any): NodeMaterial; -} -import NodeMaterial from './NodeMaterial.js'; -import BasicEnvironmentNode from '../../nodes/lighting/BasicEnvironmentNode.js'; -import PhongLightingModel from '../../nodes/functions/PhongLightingModel.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/MeshPhysicalNodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/MeshPhysicalNodeMaterial.d.ts deleted file mode 100644 index 0545af43c..000000000 --- a/jsdoc-testing/jsdoc/materials/nodes/MeshPhysicalNodeMaterial.d.ts +++ /dev/null @@ -1,276 +0,0 @@ -export default MeshPhysicalNodeMaterial; -/** - * Node material version of {@link MeshPhysicalMaterial}. - * - * @augments MeshStandardNodeMaterial - */ -declare class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial { - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isMeshPhysicalNodeMaterial: boolean; - /** - * The clearcoat of physical materials is by default inferred from the `clearcoat` - * and `clearcoatMap` properties. This node property allows to overwrite the default - * and define the clearcoat with a node instead. - * - * If you don't want to overwrite the clearcoat but modify the existing - * value instead, use {@link materialClearcoat}. - * - * @type {?Node} - * @default null - */ - clearcoatNode: Node | null; - /** - * The clearcoat roughness of physical materials is by default inferred from the `clearcoatRoughness` - * and `clearcoatRoughnessMap` properties. This node property allows to overwrite the default - * and define the clearcoat roughness with a node instead. - * - * If you don't want to overwrite the clearcoat roughness but modify the existing - * value instead, use {@link materialClearcoatRoughness}. - * - * @type {?Node} - * @default null - */ - clearcoatRoughnessNode: Node | null; - /** - * The clearcoat normal of physical materials is by default inferred from the `clearcoatNormalMap` - * property. This node property allows to overwrite the default - * and define the clearcoat normal with a node instead. - * - * If you don't want to overwrite the clearcoat normal but modify the existing - * value instead, use {@link materialClearcoatNormal}. - * - * @type {?Node} - * @default null - */ - clearcoatNormalNode: Node | null; - /** - * The sheen of physical materials is by default inferred from the `sheen`, `sheenColor` - * and `sheenColorMap` properties. This node property allows to overwrite the default - * and define the sheen with a node instead. - * - * If you don't want to overwrite the sheen but modify the existing - * value instead, use {@link materialSheen}. - * - * @type {?Node} - * @default null - */ - sheenNode: Node | null; - /** - * The sheen roughness of physical materials is by default inferred from the `sheenRoughness` and - * `sheenRoughnessMap` properties. This node property allows to overwrite the default - * and define the sheen roughness with a node instead. - * - * If you don't want to overwrite the sheen roughness but modify the existing - * value instead, use {@link materialSheenRoughness}. - * - * @type {?Node} - * @default null - */ - sheenRoughnessNode: Node | null; - /** - * The iridescence of physical materials is by default inferred from the `iridescence` - * property. This node property allows to overwrite the default - * and define the iridescence with a node instead. - * - * If you don't want to overwrite the iridescence but modify the existing - * value instead, use {@link materialIridescence}. - * - * @type {?Node} - * @default null - */ - iridescenceNode: Node | null; - /** - * The iridescence IOR of physical materials is by default inferred from the `iridescenceIOR` - * property. This node property allows to overwrite the default - * and define the iridescence IOR with a node instead. - * - * If you don't want to overwrite the iridescence IOR but modify the existing - * value instead, use {@link materialIridescenceIOR}. - * - * @type {?Node} - * @default null - */ - iridescenceIORNode: Node | null; - /** - * The iridescence thickness of physical materials is by default inferred from the `iridescenceThicknessRange` - * and `iridescenceThicknessMap` properties. This node property allows to overwrite the default - * and define the iridescence thickness with a node instead. - * - * If you don't want to overwrite the iridescence thickness but modify the existing - * value instead, use {@link materialIridescenceThickness}. - * - * @type {?Node} - * @default null - */ - iridescenceThicknessNode: Node | null; - /** - * The specular intensity of physical materials is by default inferred from the `specularIntensity` - * and `specularIntensityMap` properties. This node property allows to overwrite the default - * and define the specular intensity with a node instead. - * - * If you don't want to overwrite the specular intensity but modify the existing - * value instead, use {@link materialSpecularIntensity}. - * - * @type {?Node} - * @default null - */ - specularIntensityNode: Node | null; - /** - * The specular color of physical materials is by default inferred from the `specularColor` - * and `specularColorMap` properties. This node property allows to overwrite the default - * and define the specular color with a node instead. - * - * If you don't want to overwrite the specular color but modify the existing - * value instead, use {@link materialSpecularColor}. - * - * @type {?Node} - * @default null - */ - specularColorNode: Node | null; - /** - * The ior of physical materials is by default inferred from the `ior` - * property. This node property allows to overwrite the default - * and define the ior with a node instead. - * - * If you don't want to overwrite the ior but modify the existing - * value instead, use {@link materialIOR}. - * - * @type {?Node} - * @default null - */ - iorNode: Node | null; - /** - * The transmission of physical materials is by default inferred from the `transmission` and - * `transmissionMap` properties. This node property allows to overwrite the default - * and define the transmission with a node instead. - * - * If you don't want to overwrite the transmission but modify the existing - * value instead, use {@link materialTransmission}. - * - * @type {?Node} - * @default null - */ - transmissionNode: Node | null; - /** - * The thickness of physical materials is by default inferred from the `thickness` and - * `thicknessMap` properties. This node property allows to overwrite the default - * and define the thickness with a node instead. - * - * If you don't want to overwrite the thickness but modify the existing - * value instead, use {@link materialThickness}. - * - * @type {?Node} - * @default null - */ - thicknessNode: Node | null; - /** - * The attenuation distance of physical materials is by default inferred from the - * `attenuationDistance` property. This node property allows to overwrite the default - * and define the attenuation distance with a node instead. - * - * If you don't want to overwrite the attenuation distance but modify the existing - * value instead, use {@link materialAttenuationDistance}. - * - * @type {?Node} - * @default null - */ - attenuationDistanceNode: Node | null; - /** - * The attenuation color of physical materials is by default inferred from the - * `attenuationColor` property. This node property allows to overwrite the default - * and define the attenuation color with a node instead. - * - * If you don't want to overwrite the attenuation color but modify the existing - * value instead, use {@link materialAttenuationColor}. - * - * @type {?Node} - * @default null - */ - attenuationColorNode: Node | null; - /** - * The dispersion of physical materials is by default inferred from the - * `dispersion` property. This node property allows to overwrite the default - * and define the dispersion with a node instead. - * - * If you don't want to overwrite the dispersion but modify the existing - * value instead, use {@link materialDispersion}. - * - * @type {?Node} - * @default null - */ - dispersionNode: Node | null; - /** - * The anisotropy of physical materials is by default inferred from the - * `anisotropy` property. This node property allows to overwrite the default - * and define the anisotropy with a node instead. - * - * If you don't want to overwrite the anisotropy but modify the existing - * value instead, use {@link materialAnisotropy}. - * - * @type {?Node} - * @default null - */ - anisotropyNode: Node | null; - /** - * Whether the lighting model should use clearcoat or not. - * - * @type {boolean} - * @default true - */ - get useClearcoat(): boolean; - /** - * Whether the lighting model should use iridescence or not. - * - * @type {boolean} - * @default true - */ - get useIridescence(): boolean; - /** - * Whether the lighting model should use sheen or not. - * - * @type {boolean} - * @default true - */ - get useSheen(): boolean; - /** - * Whether the lighting model should use anisotropy or not. - * - * @type {boolean} - * @default true - */ - get useAnisotropy(): boolean; - /** - * Whether the lighting model should use transmission or not. - * - * @type {boolean} - * @default true - */ - get useTransmission(): boolean; - /** - * Whether the lighting model should use dispersion or not. - * - * @type {boolean} - * @default true - */ - get useDispersion(): boolean; - /** - * Setups the physical specific node variables. - * - * @param {NodeBuilder} builder - The current node builder. - */ - setupVariants(builder: NodeBuilder): void; - /** - * Setups the clearcoat normal node. - * - * @return {Node} The clearcoat normal. - */ - setupClearcoatNormal(): Node; - setup(builder: any): void; -} -import MeshStandardNodeMaterial from './MeshStandardNodeMaterial.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/MeshSSSNodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/MeshSSSNodeMaterial.d.ts deleted file mode 100644 index ca33d8128..000000000 --- a/jsdoc-testing/jsdoc/materials/nodes/MeshSSSNodeMaterial.d.ts +++ /dev/null @@ -1,96 +0,0 @@ -export default MeshSSSNodeMaterial; -/** - * This node material is an experimental extension of {@link MeshPhysicalNodeMaterial} - * that implements a Subsurface scattering (SSS) term. - * - * @augments MeshPhysicalNodeMaterial - */ -declare class MeshSSSNodeMaterial extends MeshPhysicalNodeMaterial { - /** - * Represents the thickness color. - * - * @type {?Node} - * @default null - */ - thicknessColorNode: Node | null; - /** - * Represents the distortion factor. - * - * @type {?Node} - */ - thicknessDistortionNode: Node | null; - /** - * Represents the thickness ambient factor. - * - * @type {?Node} - */ - thicknessAmbientNode: Node | null; - /** - * Represents the thickness attenuation. - * - * @type {?Node} - */ - thicknessAttenuationNode: Node | null; - /** - * Represents the thickness power. - * - * @type {?Node} - */ - thicknessPowerNode: Node | null; - /** - * Represents the thickness scale. - * - * @type {?Node} - */ - thicknessScaleNode: Node | null; - /** - * Whether the lighting model should use SSS or not. - * - * @type {boolean} - * @default true - */ - get useSSS(): boolean; - /** - * Setups the lighting model. - * - * @return {SSSLightingModel} The lighting model. - */ - setupLightingModel(): SSSLightingModel; -} -import MeshPhysicalNodeMaterial from './MeshPhysicalNodeMaterial.js'; -/** - * Represents the lighting model for {@link MeshSSSNodeMaterial}. - * - * @augments PhysicalLightingModel - */ -declare class SSSLightingModel extends PhysicalLightingModel { - /** - * Constructs a new physical lighting model. - * - * @param {boolean} [clearcoat=false] - Whether clearcoat is supported or not. - * @param {boolean} [sheen=false] - Whether sheen is supported or not. - * @param {boolean} [iridescence=false] - Whether iridescence is supported or not. - * @param {boolean} [anisotropy=false] - Whether anisotropy is supported or not. - * @param {boolean} [transmission=false] - Whether transmission is supported or not. - * @param {boolean} [dispersion=false] - Whether dispersion is supported or not. - * @param {boolean} [sss=false] - Whether SSS is supported or not. - */ - constructor(clearcoat?: boolean, sheen?: boolean, iridescence?: boolean, anisotropy?: boolean, transmission?: boolean, dispersion?: boolean, sss?: boolean); - /** - * Whether the lighting model should use SSS or not. - * - * @type {boolean} - * @default false - */ - useSSS: boolean; - /** - * Extends the default implementation with a SSS term. - * - * Reference: [Approximating Translucency for a Fast, Cheap and Convincing Subsurface Scattering Look](https://colinbarrebrisebois.com/2011/03/07/gdc-2011-approximating-translucency-for-a-fast-cheap-and-convincing-subsurface-scattering-look/) - * - * @param {Object} input - The input data. - * @param {NodeBuilder} builder - The current node builder. - */ - direct({ lightDirection, lightColor, reflectedLight }: Object, builder: NodeBuilder): void; -} -import PhysicalLightingModel from '../../nodes/functions/PhysicalLightingModel.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/MeshStandardNodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/MeshStandardNodeMaterial.d.ts deleted file mode 100644 index 2128d9631..000000000 --- a/jsdoc-testing/jsdoc/materials/nodes/MeshStandardNodeMaterial.d.ts +++ /dev/null @@ -1,81 +0,0 @@ -export default MeshStandardNodeMaterial; -/** - * Node material version of {@link MeshStandardMaterial}. - * - * @augments NodeMaterial - */ -declare class MeshStandardNodeMaterial extends NodeMaterial { - /** - * Constructs a new mesh standard node material. - * - * @param {Object} [parameters] - The configuration parameter. - */ - constructor(parameters?: Object); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isMeshStandardNodeMaterial: boolean; - /** - * The emissive color of standard materials is by default inferred from the `emissive`, - * `emissiveIntensity` and `emissiveMap` properties. This node property allows to - * overwrite the default and define the emissive color with a node instead. - * - * If you don't want to overwrite the emissive color but modify the existing - * value instead, use {@link materialEmissive}. - * - * @type {?Node} - * @default null - */ - emissiveNode: Node | null; - /** - * The metalness of standard materials is by default inferred from the `metalness`, - * and `metalnessMap` properties. This node property allows to - * overwrite the default and define the metalness with a node instead. - * - * If you don't want to overwrite the metalness but modify the existing - * value instead, use {@link materialMetalness}. - * - * @type {?Node} - * @default null - */ - metalnessNode: Node | null; - /** - * The roughness of standard materials is by default inferred from the `roughness`, - * and `roughnessMap` properties. This node property allows to - * overwrite the default and define the roughness with a node instead. - * - * If you don't want to overwrite the roughness but modify the existing - * value instead, use {@link materialRoughness}. - * - * @type {?Node} - * @default null - */ - roughnessNode: Node | null; - /** - * Overwritten since this type of material uses {@link EnvironmentNode} - * to implement the PBR (PMREM based) environment mapping. Besides, the - * method honors `Scene.environment`. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {?EnvironmentNode} The environment node. - */ - setupEnvironment(builder: NodeBuilder): EnvironmentNode | null; - /** - * Setups the lighting model. - * - * @return {PhysicalLightingModel} The lighting model. - */ - setupLightingModel(): PhysicalLightingModel; - /** - * Setups the specular related node variables. - */ - setupSpecular(): void; - copy(source: any): NodeMaterial; -} -import NodeMaterial from './NodeMaterial.js'; -import EnvironmentNode from '../../nodes/lighting/EnvironmentNode.js'; -import PhysicalLightingModel from '../../nodes/functions/PhysicalLightingModel.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/MeshToonNodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/MeshToonNodeMaterial.d.ts deleted file mode 100644 index 1ffe1bd1b..000000000 --- a/jsdoc-testing/jsdoc/materials/nodes/MeshToonNodeMaterial.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -export default MeshToonNodeMaterial; -/** - * Node material version of {@link MeshToonMaterial}. - * - * @augments NodeMaterial - */ -declare class MeshToonNodeMaterial extends NodeMaterial { - /** - * Constructs a new mesh toon node material. - * - * @param {Object} [parameters] - The configuration parameter. - */ - constructor(parameters?: Object); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isMeshToonNodeMaterial: boolean; - /** - * Setups the lighting model. - * - * @return {ToonLightingModel} The lighting model. - */ - setupLightingModel(): ToonLightingModel; -} -import NodeMaterial from './NodeMaterial.js'; -import ToonLightingModel from '../../nodes/functions/ToonLightingModel.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/NodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/NodeMaterial.d.ts deleted file mode 100644 index 3c8a1d19f..000000000 --- a/jsdoc-testing/jsdoc/materials/nodes/NodeMaterial.d.ts +++ /dev/null @@ -1,505 +0,0 @@ -export default NodeMaterial; -/** - * Base class for all node materials. - * - * @augments Material - */ -declare class NodeMaterial extends Material { - static get type(): string; - set type(_value: string); - /** - * Represents the type of the node material. - * - * @type {string} - */ - get type(): string; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isNodeMaterial: boolean; - /** - * Whether this material is affected by fog or not. - * - * @type {boolean} - * @default true - */ - fog: boolean; - /** - * Whether this material is affected by lights or not. - * - * @type {boolean} - * @default false - */ - lights: boolean; - /** - * Whether this material uses hardware clipping or not. - * This property is managed by the engine and should not be - * modified by apps. - * - * @type {boolean} - * @default false - */ - hardwareClipping: boolean; - /** - * Node materials which set their `lights` property to `true` - * are affected by all lights of the scene. Sometimes selective - * lighting is wanted which means only _some_ lights in the scene - * affect a material. This can be achieved by creating an instance - * of {@link LightsNode} with a list of selective - * lights and assign the node to this property. - * - * ```js - * const customLightsNode = lights( [ light1, light2 ] ); - * material.lightsNode = customLightsNode; - * ``` - * - * @type {?LightsNode} - * @default null - */ - lightsNode: LightsNode | null; - /** - * The environment of node materials can be defined by an environment - * map assigned to the `envMap` property or by `Scene.environment` - * if the node material is a PBR material. This node property allows to overwrite - * the default behavior and define the environment with a custom node. - * - * ```js - * material.envNode = pmremTexture( renderTarget.texture ); - * ``` - * - * @type {?Node} - * @default null - */ - envNode: Node | null; - /** - * The lighting of node materials might be influenced by ambient occlusion. - * The default AO is inferred from an ambient occlusion map assigned to `aoMap` - * and the respective `aoMapIntensity`. This node property allows to overwrite - * the default and define the ambient occlusion with a custom node instead. - * - * If you don't want to overwrite the diffuse color but modify the existing - * values instead, use {@link materialAO}. - * - * @type {?Node} - * @default null - */ - aoNode: Node | null; - /** - * The diffuse color of node materials is by default inferred from the - * `color` and `map` properties. This node property allows to overwrite the default - * and define the diffuse color with a node instead. - * - * ```js - * material.colorNode = color( 0xff0000 ); // define red color - * ``` - * - * If you don't want to overwrite the diffuse color but modify the existing - * values instead, use {@link materialColor}. - * - * ```js - * material.colorNode = materialColor.mul( color( 0xff0000 ) ); // give diffuse colors a red tint - * ``` - * - * @type {?Node} - * @default null - */ - colorNode: Node | null; - /** - * The normals of node materials are by default inferred from the `normalMap`/`normalScale` - * or `bumpMap`/`bumpScale` properties. This node property allows to overwrite the default - * and define the normals with a node instead. - * - * If you don't want to overwrite the normals but modify the existing values instead, - * use {@link materialNormal}. - * - * @type {?Node} - * @default null - */ - normalNode: Node | null; - /** - * The opacity of node materials is by default inferred from the `opacity` - * and `alphaMap` properties. This node property allows to overwrite the default - * and define the opacity with a node instead. - * - * If you don't want to overwrite the opacity but modify the existing - * value instead, use {@link materialOpacity}. - * - * @type {?Node} - * @default null - */ - opacityNode: Node | null; - /** - * This node can be used to implement a variety of filter-like effects. The idea is - * to store the current rendering into a texture e.g. via `viewportSharedTexture()`, use it - * to create an arbitrary effect and then assign the node composition to this property. - * Everything behind the object using this material will now be affected by a filter. - * - * ```js - * const material = new NodeMaterial() - * material.transparent = true; - * - * // everything behind the object will be monochromatic - * material.backdropNode = saturation( viewportSharedTexture().rgb, 0 ); - * ``` - * - * Backdrop computations are part of the lighting so only lit materials can use this property. - * - * @type {?Node} - * @default null - */ - backdropNode: Node | null; - /** - * This node allows to modulate the influence of `backdropNode` to the outgoing light. - * - * @type {?Node} - * @default null - */ - backdropAlphaNode: Node | null; - /** - * The alpha test of node materials is by default inferred from the `alphaTest` - * property. This node property allows to overwrite the default and define the - * alpha test with a node instead. - * - * If you don't want to overwrite the alpha test but modify the existing - * value instead, use {@link materialAlphaTest}. - * - * @type {?Node} - * @default null - */ - alphaTestNode: Node | null; - /** - * Discards the fragment if the mask value is `false`. - * - * @type {?Node} - * @default null - */ - maskNode: Node | null; - /** - * This node can be used to implement a shadow mask for the material. - * - * @type {?Node} - * @default null - */ - maskShadowNode: Node | null; - /** - * The local vertex positions are computed based on multiple factors like the - * attribute data, morphing or skinning. This node property allows to overwrite - * the default and define local vertex positions with nodes instead. - * - * If you don't want to overwrite the vertex positions but modify the existing - * values instead, use {@link positionLocal}. - * - *```js - * material.positionNode = positionLocal.add( displace ); - * ``` - * - * @type {?Node} - * @default null - */ - positionNode: Node | null; - /** - * This node property is intended for logic which modifies geometry data once or per animation step. - * Apps usually place such logic randomly in initialization routines or in the animation loop. - * `geometryNode` is intended as a dedicated API so there is an intended spot where geometry modifications - * can be implemented. - * - * The idea is to assign a `Fn` definition that holds the geometry modification logic. A typical example - * would be a GPU based particle system that provides a node material for usage on app level. The particle - * simulation would be implemented as compute shaders and managed inside a `Fn` function. This function is - * eventually assigned to `geometryNode`. - * - * @type {?Function} - * @default null - */ - geometryNode: Function | null; - /** - * Allows to overwrite depth values in the fragment shader. - * - * @type {?Node} - * @default null - */ - depthNode: Node | null; - /** - * Allows to overwrite the position used for shadow map rendering which - * is by default {@link positionWorld}, the vertex position - * in world space. - * - * @type {?Node} - * @default null - */ - receivedShadowPositionNode: Node | null; - /** - * Allows to overwrite the geometry position used for shadow map projection which - * is by default {@link positionLocal}, the vertex position in local space. - * - * @type {?Node} - * @default null - */ - castShadowPositionNode: Node | null; - /** - * This node can be used to influence how an object using this node material - * receive shadows. - * - * ```js - * const totalShadows = float( 1 ).toVar(); - * material.receivedShadowNode = Fn( ( [ shadow ] ) => { - * totalShadows.mulAssign( shadow ); - * //return float( 1 ); // bypass received shadows - * return shadow.mix( color( 0xff0000 ), 1 ); // modify shadow color - * } ); - * - * @type {?(Function|FunctionNode)} - * @default null - */ - receivedShadowNode: (Function | FunctionNode) | null; - /** - * This node can be used to influence how an object using this node material - * casts shadows. To apply a color to shadows, you can simply do: - * - * ```js - * material.castShadowNode = vec4( 1, 0, 0, 1 ); - * ``` - * - * Which can be nice to fake colored shadows of semi-transparent objects. It - * is also common to use the property with `Fn` function so checks are performed - * per fragment. - * - * ```js - * materialCustomShadow.castShadowNode = Fn( () => { - * hash( vertexIndex ).greaterThan( 0.5 ).discard(); - * return materialColor; - * } )(); - * ``` - * - * @type {?Node} - * @default null - */ - castShadowNode: Node | null; - /** - * This node can be used to define the final output of the material. - * - * TODO: Explain the differences to `fragmentNode`. - * - * @type {?Node} - * @default null - */ - outputNode: Node | null; - /** - * MRT configuration is done on renderer or pass level. This node allows to - * overwrite what values are written into MRT targets on material level. This - * can be useful for implementing selective FX features that should only affect - * specific objects. - * - * @type {?MRTNode} - * @default null - */ - mrtNode: MRTNode | null; - /** - * This node property can be used if you need complete freedom in implementing - * the fragment shader. Assigning a node will replace the built-in material - * logic used in the fragment stage. - * - * @type {?Node} - * @default null - */ - fragmentNode: Node | null; - /** - * This node property can be used if you need complete freedom in implementing - * the vertex shader. Assigning a node will replace the built-in material logic - * used in the vertex stage. - * - * @type {?Node} - * @default null - */ - vertexNode: Node | null; - /** - * This node can be used as a global context management component for this material. - * - * @type {?ContextNode} - * @default null - */ - contextNode: ContextNode | null; - /** - * Returns an array of child nodes for this material. - * - * @private - * @returns {Array<{property: string, childNode: Node}>} - */ - private _getNodeChildren; - /** - * Builds this material with the given node builder. - * - * @param {NodeBuilder} builder - The current node builder. - */ - build(builder: NodeBuilder): void; - /** - * Setups a node material observer with the given builder. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {NodeMaterialObserver} The node material observer. - */ - setupObserver(builder: NodeBuilder): NodeMaterialObserver; - /** - * Setups the vertex and fragment stage of this node material. - * - * @param {NodeBuilder} builder - The current node builder. - */ - setup(builder: NodeBuilder): void; - /** - * Setups the clipping node. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {ClippingNode} The clipping node. - */ - setupClipping(builder: NodeBuilder): ClippingNode; - /** - * Setups the hardware clipping if available on the current device. - * - * @param {NodeBuilder} builder - The current node builder. - */ - setupHardwareClipping(builder: NodeBuilder): void; - /** - * Setups the depth of this material. - * - * @param {NodeBuilder} builder - The current node builder. - */ - setupDepth(builder: NodeBuilder): void; - /** - * Setups the position node in view space. This method exists - * so derived node materials can modify the implementation e.g. sprite materials. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {Node} The position in view space. - */ - setupPositionView(): Node; - /** - * Setups the position in clip space. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {Node} The position in view space. - */ - setupModelViewProjection(): Node; - /** - * Setups the logic for the vertex stage. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {Node} The position in clip space. - */ - setupVertex(builder: NodeBuilder): Node; - /** - * Setups the computation of the position in local space. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {Node} The position in local space. - */ - setupPosition(builder: NodeBuilder): Node; - /** - * Setups the computation of the material's diffuse color. - * - * @param {NodeBuilder} builder - The current node builder. - * @param {BufferGeometry} geometry - The geometry. - */ - setupDiffuseColor(builder: NodeBuilder): void; - /** - * Abstract interface method that can be implemented by derived materials - * to setup material-specific node variables. - * - * @abstract - * @param {NodeBuilder} builder - The current node builder. - */ - setupVariants(): void; - /** - * Setups the outgoing light node variable - * - * @return {Node} The outgoing light node. - */ - setupOutgoingLight(): Node; - /** - * Setups the normal node from the material. - * - * @return {Node} The normal node. - */ - setupNormal(): Node; - /** - * Setups the environment node from the material. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {Node} The environment node. - */ - setupEnvironment(): Node; - /** - * Setups the light map node from the material. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {Node} The light map node. - */ - setupLightMap(builder: NodeBuilder): Node; - /** - * Setups the lights node based on the scene, environment and material. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {LightsNode} The lights node. - */ - setupLights(builder: NodeBuilder): LightsNode; - /** - * This method should be implemented by most derived materials - * since it defines the material's lighting model. - * - * @abstract - * @param {NodeBuilder} builder - The current node builder. - * @return {LightingModel} The lighting model. - */ - setupLightingModel(): LightingModel; - /** - * Setups the outgoing light node. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {Node} The outgoing light node. - */ - setupLighting(builder: NodeBuilder): Node; - /** - * Setup the fog. - * - * @param {NodeBuilder} builder - The current node builder. - * @param {Node} outputNode - The existing output node. - * @return {Node} The output node. - */ - setupFog(builder: NodeBuilder, outputNode: Node): Node; - /** - * Setups premultiplied alpha. - * - * @param {NodeBuilder} builder - The current node builder. - * @param {Node} outputNode - The existing output node. - * @return {Node} The output node. - */ - setupPremultipliedAlpha(builder: NodeBuilder, outputNode: Node): Node; - /** - * Setups the output node. - * - * @param {NodeBuilder} builder - The current node builder. - * @param {Node} outputNode - The existing output node. - * @return {Node} The output node. - */ - setupOutput(builder: NodeBuilder, outputNode: Node): Node; - /** - * Most classic material types have a node pendant e.g. for `MeshBasicMaterial` - * there is `MeshBasicNodeMaterial`. This utility method is intended for - * defining all material properties of the classic type in the node type. - * - * @param {Material} material - The material to copy properties with their values to this node material. - */ - setDefaultValues(material: Material): void; - /** - * Copies the properties of the given node material to this instance. - * - * @param {NodeMaterial} source - The material to copy. - * @return {NodeMaterial} A reference to this node material. - */ - copy(source: NodeMaterial): NodeMaterial; -} -import { Material } from '../Material.js'; -import NodeMaterialObserver from './manager/NodeMaterialObserver.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/NodeMaterials.d.ts b/jsdoc-testing/jsdoc/materials/nodes/NodeMaterials.d.ts deleted file mode 100644 index 3ab3141d1..000000000 --- a/jsdoc-testing/jsdoc/materials/nodes/NodeMaterials.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -export { default as NodeMaterialObserver } from "./manager/NodeMaterialObserver.js"; -export { default as NodeMaterial } from "./NodeMaterial.js"; -export { default as LineBasicNodeMaterial } from "./LineBasicNodeMaterial.js"; -export { default as LineDashedNodeMaterial } from "./LineDashedNodeMaterial.js"; -export { default as Line2NodeMaterial } from "./Line2NodeMaterial.js"; -export { default as MeshNormalNodeMaterial } from "./MeshNormalNodeMaterial.js"; -export { default as MeshBasicNodeMaterial } from "./MeshBasicNodeMaterial.js"; -export { default as MeshLambertNodeMaterial } from "./MeshLambertNodeMaterial.js"; -export { default as MeshPhongNodeMaterial } from "./MeshPhongNodeMaterial.js"; -export { default as MeshStandardNodeMaterial } from "./MeshStandardNodeMaterial.js"; -export { default as MeshPhysicalNodeMaterial } from "./MeshPhysicalNodeMaterial.js"; -export { default as MeshSSSNodeMaterial } from "./MeshSSSNodeMaterial.js"; -export { default as MeshToonNodeMaterial } from "./MeshToonNodeMaterial.js"; -export { default as MeshMatcapNodeMaterial } from "./MeshMatcapNodeMaterial.js"; -export { default as PointsNodeMaterial } from "./PointsNodeMaterial.js"; -export { default as SpriteNodeMaterial } from "./SpriteNodeMaterial.js"; -export { default as ShadowNodeMaterial } from "./ShadowNodeMaterial.js"; -export { default as VolumeNodeMaterial } from "./VolumeNodeMaterial.js"; diff --git a/jsdoc-testing/jsdoc/materials/nodes/PointsNodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/PointsNodeMaterial.d.ts deleted file mode 100644 index 1a6e48eef..000000000 --- a/jsdoc-testing/jsdoc/materials/nodes/PointsNodeMaterial.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -export default PointsNodeMaterial; -/** - * Node material version of {@link PointsMaterial}. - * - * This material can be used in two ways: - * - * - By rendering point primitives with {@link Points}. Since WebGPU only supports point primitives - * with a pixel size of `1`, it's not possible to define a size. - * - * ```js - * const pointCloud = new THREE.Points( geometry, new THREE.PointsNodeMaterial() ); - * ``` - * - * - By rendering point primitives with {@link Sprites}. In this case, size is honored, - * see {@link PointsNodeMaterial#sizeNode}. - * - * ```js - * const instancedPoints = new THREE.Sprite( new THREE.PointsNodeMaterial( { positionNode: instancedBufferAttribute( positionAttribute ) } ) ); - * ``` - * - * @augments SpriteNodeMaterial - */ -declare class PointsNodeMaterial extends SpriteNodeMaterial { - /** - * This node property provides an additional way to set the point size. - * - * Note that WebGPU only supports point primitives with 1 pixel size. Consequently, - * this node has no effect when the material is used with {@link Points} and a WebGPU - * backend. If an application wants to render points with a size larger than 1 pixel, - * the material should be used with {@link Sprite} and instancing. - * - * @type {?Node} - * @default null - */ - sizeNode: Node | null; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isPointsNodeMaterial: boolean; - setupPositionView(): any; - setupVertexSprite(builder: any): any; - setupVertex(builder: any): any; - _useAlphaToCoverage: any; -} -import SpriteNodeMaterial from './SpriteNodeMaterial.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/ShadowNodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/ShadowNodeMaterial.d.ts deleted file mode 100644 index edf904684..000000000 --- a/jsdoc-testing/jsdoc/materials/nodes/ShadowNodeMaterial.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -export default ShadowNodeMaterial; -/** - * Node material version of {@link ShadowMaterial}. - * - * @augments NodeMaterial - */ -declare class ShadowNodeMaterial extends NodeMaterial { - /** - * Constructs a new shadow node material. - * - * @param {Object} [parameters] - The configuration parameter. - */ - constructor(parameters?: Object); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isShadowNodeMaterial: boolean; - /** - * Setups the lighting model. - * - * @return {ShadowMaskModel} The lighting model. - */ - setupLightingModel(): ShadowMaskModel; -} -import NodeMaterial from './NodeMaterial.js'; -import ShadowMaskModel from '../../nodes/functions/ShadowMaskModel.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/SpriteNodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/SpriteNodeMaterial.d.ts deleted file mode 100644 index 7f8da84d3..000000000 --- a/jsdoc-testing/jsdoc/materials/nodes/SpriteNodeMaterial.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -export default SpriteNodeMaterial; -/** - * Node material version of {@link SpriteMaterial}. - * - * @augments NodeMaterial - */ -declare class SpriteNodeMaterial extends NodeMaterial { - /** - * Constructs a new sprite node material. - * - * @param {Object} [parameters] - The configuration parameter. - */ - constructor(parameters?: Object); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isSpriteNodeMaterial: boolean; - _useSizeAttenuation: boolean; - /** - * The rotation of sprite materials is by default inferred from the `rotation`, - * property. This node property allows to overwrite the default and define - * the rotation with a node instead. - * - * If you don't want to overwrite the rotation but modify the existing - * value instead, use {@link materialRotation}. - * - * @type {?Node} - * @default null - */ - rotationNode: Node | null; - /** - * This node property provides an additional way to scale sprites next to - * `Object3D.scale`. The scale transformation based in `Object3D.scale` - * is multiplied with the scale value of this node in the vertex shader. - * - * @type {?Node} - * @default null - */ - scaleNode: Node | null; - /** - * Setups the position node in view space. This method implements - * the sprite specific vertex shader. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {Node} The position in view space. - */ - setupPositionView(builder: NodeBuilder): Node; - copy(source: any): NodeMaterial; - set sizeAttenuation(value: boolean); - /** - * Whether to use size attenuation or not. - * - * @type {boolean} - * @default true - */ - get sizeAttenuation(): boolean; -} -import NodeMaterial from './NodeMaterial.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/VolumeNodeMaterial.d.ts b/jsdoc-testing/jsdoc/materials/nodes/VolumeNodeMaterial.d.ts deleted file mode 100644 index 8b5885c3c..000000000 --- a/jsdoc-testing/jsdoc/materials/nodes/VolumeNodeMaterial.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -export default VolumeNodeMaterial; -/** - * Volume node material. - * - * @augments NodeMaterial - */ -declare class VolumeNodeMaterial extends NodeMaterial { - /** - * Constructs a new volume node material. - * - * @param {Object} [parameters] - The configuration parameter. - */ - constructor(parameters?: Object); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isVolumeNodeMaterial: boolean; - /** - * Number of steps used for raymarching. - * - * @type {number} - * @default 25 - */ - steps: number; - /** - * Offsets the distance a ray has been traveled through a volume. - * Can be used to implement dithering to reduce banding. - * - * @type {Node} - * @default null - */ - offsetNode: Node; - /** - * Node used for scattering calculations. - * - * @type {Function|FunctionNode} - * @default null - */ - scatteringNode: Function | FunctionNode; - side: number; - setupLightingModel(): VolumetricLightingModel; -} -import NodeMaterial from './NodeMaterial.js'; -import VolumetricLightingModel from '../../nodes/functions/VolumetricLightingModel.js'; diff --git a/jsdoc-testing/jsdoc/materials/nodes/manager/NodeMaterialObserver.d.ts b/jsdoc-testing/jsdoc/materials/nodes/manager/NodeMaterialObserver.d.ts deleted file mode 100644 index cd485df56..000000000 --- a/jsdoc-testing/jsdoc/materials/nodes/manager/NodeMaterialObserver.d.ts +++ /dev/null @@ -1,131 +0,0 @@ -export default NodeMaterialObserver; -/** - * This class is used by {@link WebGPURenderer} as management component. - * It's primary purpose is to determine whether render objects require a - * refresh right before they are going to be rendered or not. - */ -declare class NodeMaterialObserver { - /** - * Constructs a new node material observer. - * - * @param {NodeBuilder} builder - The node builder. - */ - constructor(builder: NodeBuilder); - /** - * A node material can be used by more than one render object so the - * monitor must maintain a list of render objects. - * - * @type {WeakMap} - */ - renderObjects: WeakMap; - /** - * Whether the material uses node objects or not. - * - * @type {boolean} - */ - hasNode: boolean; - /** - * Whether the node builder's 3D object is animated or not. - * - * @type {boolean} - */ - hasAnimation: boolean; - /** - * A list of all possible material uniforms - * - * @type {Array} - */ - refreshUniforms: Array; - /** - * Holds the current render ID from the node frame. - * - * @type {number} - * @default 0 - */ - renderId: number; - /** - * Returns `true` if the given render object is verified for the first time of this observer. - * - * @param {RenderObject} renderObject - The render object. - * @return {boolean} Whether the given render object is verified for the first time of this observer. - */ - firstInitialization(renderObject: RenderObject): boolean; - /** - * Returns `true` if the current rendering produces motion vectors. - * - * @param {Renderer} renderer - The renderer. - * @return {boolean} Whether the current rendering produces motion vectors or not. - */ - needsVelocity(renderer: Renderer): boolean; - /** - * Returns monitoring data for the given render object. - * - * @param {RenderObject} renderObject - The render object. - * @return {Object} The monitoring data. - */ - getRenderObjectData(renderObject: RenderObject): Object; - /** - * Returns an attribute data structure holding the attributes versions for - * monitoring. - * - * @param {Object} attributes - The geometry attributes. - * @return {Object} An object for monitoring the versions of attributes. - */ - getAttributesData(attributes: Object): Object; - /** - * Returns `true` if the node builder's material uses - * node properties. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {boolean} Whether the node builder's material uses node properties or not. - */ - containsNode(builder: NodeBuilder): boolean; - /** - * Returns a geometry data structure holding the geometry property values for - * monitoring. - * - * @param {BufferGeometry} geometry - The geometry. - * @return {Object} An object for monitoring geometry properties. - */ - getGeometryData(geometry: BufferGeometry): Object; - /** - * Returns a material data structure holding the material property values for - * monitoring. - * - * @param {Material} material - The material. - * @return {Object} An object for monitoring material properties. - */ - getMaterialData(material: Material): Object; - /** - * Returns `true` if the given render object has not changed its state. - * - * @param {RenderObject} renderObject - The render object. - * @param {Array} lightsData - The current material lights. - * @param {number} renderId - The current render ID. - * @return {boolean} Whether the given render object has changed its state or not. - */ - equals(renderObject: RenderObject, lightsData: Array, renderId: number): boolean; - /** - * Returns the lights data for the given material lights. - * - * @param {Array} materialLights - The material lights. - * @return {Array} The lights data for the given material lights. - */ - getLightsData(materialLights: Array): Array; - /** - * Returns the lights for the given lights node and render ID. - * - * @param {LightsNode} lightsNode - The lights node. - * @param {number} renderId - The render ID. - * @return {Array} The lights for the given lights node and render ID. - */ - getLights(lightsNode: LightsNode, renderId: number): Array; - /** - * Checks if the given render object requires a refresh. - * - * @param {RenderObject} renderObject - The render object. - * @param {NodeFrame} nodeFrame - The current node frame. - * @return {boolean} Whether the given render object requires a refresh or not. - */ - needsRefresh(renderObject: RenderObject, nodeFrame: NodeFrame): boolean; -} diff --git a/jsdoc-testing/jsdoc/math/Box3.d.ts b/jsdoc-testing/jsdoc/math/Box3.d.ts deleted file mode 100644 index b85cca985..000000000 --- a/jsdoc-testing/jsdoc/math/Box3.d.ts +++ /dev/null @@ -1,293 +0,0 @@ -/** - * Represents an axis-aligned bounding box (AABB) in 3D space. - */ -export class Box3 { - /** - * Constructs a new bounding box. - * - * @param {Vector3} [min=(Infinity,Infinity,Infinity)] - A vector representing the lower boundary of the box. - * @param {Vector3} [max=(-Infinity,-Infinity,-Infinity)] - A vector representing the upper boundary of the box. - */ - constructor(min?: Vector3, max?: Vector3); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isBox3: boolean; - /** - * The lower boundary of the box. - * - * @type {Vector3} - */ - min: Vector3; - /** - * The upper boundary of the box. - * - * @type {Vector3} - */ - max: Vector3; - /** - * Sets the lower and upper boundaries of this box. - * Please note that this method only copies the values from the given objects. - * - * @param {Vector3} min - The lower boundary of the box. - * @param {Vector3} max - The upper boundary of the box. - * @return {Box3} A reference to this bounding box. - */ - set(min: Vector3, max: Vector3): Box3; - /** - * Sets the upper and lower bounds of this box so it encloses the position data - * in the given array. - * - * @param {Array} array - An array holding 3D position data. - * @return {Box3} A reference to this bounding box. - */ - setFromArray(array: Array): Box3; - /** - * Sets the upper and lower bounds of this box so it encloses the position data - * in the given buffer attribute. - * - * @param {BufferAttribute} attribute - A buffer attribute holding 3D position data. - * @return {Box3} A reference to this bounding box. - */ - setFromBufferAttribute(attribute: BufferAttribute): Box3; - /** - * Sets the upper and lower bounds of this box so it encloses the position data - * in the given array. - * - * @param {Array} points - An array holding 3D position data as instances of {@link Vector3}. - * @return {Box3} A reference to this bounding box. - */ - setFromPoints(points: Array): Box3; - /** - * Centers this box on the given center vector and sets this box's width, height and - * depth to the given size values. - * - * @param {Vector3} center - The center of the box. - * @param {Vector3} size - The x, y and z dimensions of the box. - * @return {Box3} A reference to this bounding box. - */ - setFromCenterAndSize(center: Vector3, size: Vector3): Box3; - /** - * Computes the world-axis-aligned bounding box for the given 3D object - * (including its children), accounting for the object's, and children's, - * world transforms. The function may result in a larger box than strictly necessary. - * - * @param {Object3D} object - The 3D object to compute the bounding box for. - * @param {boolean} [precise=false] - If set to `true`, the method computes the smallest - * world-axis-aligned bounding box at the expense of more computation. - * @return {Box3} A reference to this bounding box. - */ - setFromObject(object: Object3D, precise?: boolean): Box3; - /** - * Returns a new box with copied values from this instance. - * - * @return {Box3} A clone of this instance. - */ - clone(): Box3; - /** - * Copies the values of the given box to this instance. - * - * @param {Box3} box - The box to copy. - * @return {Box3} A reference to this bounding box. - */ - copy(box: Box3): Box3; - /** - * Makes this box empty which means in encloses a zero space in 3D. - * - * @return {Box3} A reference to this bounding box. - */ - makeEmpty(): Box3; - /** - * Returns true if this box includes zero points within its bounds. - * Note that a box with equal lower and upper bounds still includes one - * point, the one both bounds share. - * - * @return {boolean} Whether this box is empty or not. - */ - isEmpty(): boolean; - /** - * Returns the center point of this box. - * - * @param {Vector3} target - The target vector that is used to store the method's result. - * @return {Vector3} The center point. - */ - getCenter(target: Vector3): Vector3; - /** - * Returns the dimensions of this box. - * - * @param {Vector3} target - The target vector that is used to store the method's result. - * @return {Vector3} The size. - */ - getSize(target: Vector3): Vector3; - /** - * Expands the boundaries of this box to include the given point. - * - * @param {Vector3} point - The point that should be included by the bounding box. - * @return {Box3} A reference to this bounding box. - */ - expandByPoint(point: Vector3): Box3; - /** - * Expands this box equilaterally by the given vector. The width of this - * box will be expanded by the x component of the vector in both - * directions. The height of this box will be expanded by the y component of - * the vector in both directions. The depth of this box will be - * expanded by the z component of the vector in both directions. - * - * @param {Vector3} vector - The vector that should expand the bounding box. - * @return {Box3} A reference to this bounding box. - */ - expandByVector(vector: Vector3): Box3; - /** - * Expands each dimension of the box by the given scalar. If negative, the - * dimensions of the box will be contracted. - * - * @param {number} scalar - The scalar value that should expand the bounding box. - * @return {Box3} A reference to this bounding box. - */ - expandByScalar(scalar: number): Box3; - /** - * Expands the boundaries of this box to include the given 3D object and - * its children, accounting for the object's, and children's, world - * transforms. The function may result in a larger box than strictly - * necessary (unless the precise parameter is set to true). - * - * @param {Object3D} object - The 3D object that should expand the bounding box. - * @param {boolean} precise - If set to `true`, the method expands the bounding box - * as little as necessary at the expense of more computation. - * @return {Box3} A reference to this bounding box. - */ - expandByObject(object: Object3D, precise?: boolean): Box3; - /** - * Returns `true` if the given point lies within or on the boundaries of this box. - * - * @param {Vector3} point - The point to test. - * @return {boolean} Whether the bounding box contains the given point or not. - */ - containsPoint(point: Vector3): boolean; - /** - * Returns `true` if this bounding box includes the entirety of the given bounding box. - * If this box and the given one are identical, this function also returns `true`. - * - * @param {Box3} box - The bounding box to test. - * @return {boolean} Whether the bounding box contains the given bounding box or not. - */ - containsBox(box: Box3): boolean; - /** - * Returns a point as a proportion of this box's width, height and depth. - * - * @param {Vector3} point - A point in 3D space. - * @param {Vector3} target - The target vector that is used to store the method's result. - * @return {Vector3} A point as a proportion of this box's width, height and depth. - */ - getParameter(point: Vector3, target: Vector3): Vector3; - /** - * Returns `true` if the given bounding box intersects with this bounding box. - * - * @param {Box3} box - The bounding box to test. - * @return {boolean} Whether the given bounding box intersects with this bounding box. - */ - intersectsBox(box: Box3): boolean; - /** - * Returns `true` if the given bounding sphere intersects with this bounding box. - * - * @param {Sphere} sphere - The bounding sphere to test. - * @return {boolean} Whether the given bounding sphere intersects with this bounding box. - */ - intersectsSphere(sphere: Sphere): boolean; - /** - * Returns `true` if the given plane intersects with this bounding box. - * - * @param {Plane} plane - The plane to test. - * @return {boolean} Whether the given plane intersects with this bounding box. - */ - intersectsPlane(plane: Plane): boolean; - /** - * Returns `true` if the given triangle intersects with this bounding box. - * - * @param {Triangle} triangle - The triangle to test. - * @return {boolean} Whether the given triangle intersects with this bounding box. - */ - intersectsTriangle(triangle: Triangle): boolean; - /** - * Clamps the given point within the bounds of this box. - * - * @param {Vector3} point - The point to clamp. - * @param {Vector3} target - The target vector that is used to store the method's result. - * @return {Vector3} The clamped point. - */ - clampPoint(point: Vector3, target: Vector3): Vector3; - /** - * Returns the euclidean distance from any edge of this box to the specified point. If - * the given point lies inside of this box, the distance will be `0`. - * - * @param {Vector3} point - The point to compute the distance to. - * @return {number} The euclidean distance. - */ - distanceToPoint(point: Vector3): number; - /** - * Returns a bounding sphere that encloses this bounding box. - * - * @param {Sphere} target - The target sphere that is used to store the method's result. - * @return {Sphere} The bounding sphere that encloses this bounding box. - */ - getBoundingSphere(target: Sphere): Sphere; - /** - * Computes the intersection of this bounding box and the given one, setting the upper - * bound of this box to the lesser of the two boxes' upper bounds and the - * lower bound of this box to the greater of the two boxes' lower bounds. If - * there's no overlap, makes this box empty. - * - * @param {Box3} box - The bounding box to intersect with. - * @return {Box3} A reference to this bounding box. - */ - intersect(box: Box3): Box3; - /** - * Computes the union of this box and another and the given one, setting the upper - * bound of this box to the greater of the two boxes' upper bounds and the - * lower bound of this box to the lesser of the two boxes' lower bounds. - * - * @param {Box3} box - The bounding box that will be unioned with this instance. - * @return {Box3} A reference to this bounding box. - */ - union(box: Box3): Box3; - /** - * Transforms this bounding box by the given 4x4 transformation matrix. - * - * @param {Matrix4} matrix - The transformation matrix. - * @return {Box3} A reference to this bounding box. - */ - applyMatrix4(matrix: Matrix4): Box3; - /** - * Adds the given offset to both the upper and lower bounds of this bounding box, - * effectively moving it in 3D space. - * - * @param {Vector3} offset - The offset that should be used to translate the bounding box. - * @return {Box3} A reference to this bounding box. - */ - translate(offset: Vector3): Box3; - /** - * Returns `true` if this bounding box is equal with the given one. - * - * @param {Box3} box - The box to test for equality. - * @return {boolean} Whether this bounding box is equal with the given one. - */ - equals(box: Box3): boolean; - /** - * Returns a serialized structure of the bounding box. - * - * @return {Object} Serialized structure with fields representing the object state. - */ - toJSON(): Object; - /** - * Returns a serialized structure of the bounding box. - * - * @param {Object} json - The serialized json to set the box from. - * @return {Box3} A reference to this bounding box. - */ - fromJSON(json: Object): Box3; -} -import { Vector3 } from './Vector3.js'; diff --git a/jsdoc-testing/jsdoc/math/Color.d.ts b/jsdoc-testing/jsdoc/math/Color.d.ts deleted file mode 100644 index 88445d822..000000000 --- a/jsdoc-testing/jsdoc/math/Color.d.ts +++ /dev/null @@ -1,538 +0,0 @@ -/** - * A Color instance is represented by RGB components in the linear working - * color space, which defaults to `LinearSRGBColorSpace`. Inputs - * conventionally using `SRGBColorSpace` (such as hexadecimals and CSS - * strings) are converted to the working color space automatically. - * - * ```js - * // converted automatically from SRGBColorSpace to LinearSRGBColorSpace - * const color = new THREE.Color().setHex( 0x112233 ); - * ``` - * Source color spaces may be specified explicitly, to ensure correct conversions. - * ```js - * // assumed already LinearSRGBColorSpace; no conversion - * const color = new THREE.Color().setRGB( 0.5, 0.5, 0.5 ); - * - * // converted explicitly from SRGBColorSpace to LinearSRGBColorSpace - * const color = new THREE.Color().setRGB( 0.5, 0.5, 0.5, SRGBColorSpace ); - * ``` - * If THREE.ColorManagement is disabled, no conversions occur. For details, - * see Color management. Iterating through a Color instance will yield - * its components (r, g, b) in the corresponding order. A Color can be initialised - * in any of the following ways: - * ```js - * //empty constructor - will default white - * const color1 = new THREE.Color(); - * - * //Hexadecimal color (recommended) - * const color2 = new THREE.Color( 0xff0000 ); - * - * //RGB string - * const color3 = new THREE.Color("rgb(255, 0, 0)"); - * const color4 = new THREE.Color("rgb(100%, 0%, 0%)"); - * - * //X11 color name - all 140 color names are supported. - * //Note the lack of CamelCase in the name - * const color5 = new THREE.Color( 'skyblue' ); - * //HSL string - * const color6 = new THREE.Color("hsl(0, 100%, 50%)"); - * - * //Separate RGB values between 0 and 1 - * const color7 = new THREE.Color( 1, 0, 0 ); - * ``` - */ -export class Color { - /** - * Constructs a new color. - * - * Note that standard method of specifying color in three.js is with a hexadecimal triplet, - * and that method is used throughout the rest of the documentation. - * - * @param {(number|string|Color)} [r] - The red component of the color. If `g` and `b` are - * not provided, it can be hexadecimal triplet, a CSS-style string or another `Color` instance. - * @param {number} [g] - The green component. - * @param {number} [b] - The blue component. - */ - constructor(r?: (number | string | Color), g?: number, b?: number); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isColor: boolean; - /** - * The red component. - * - * @type {number} - * @default 1 - */ - r: number; - /** - * The green component. - * - * @type {number} - * @default 1 - */ - g: number; - /** - * The blue component. - * - * @type {number} - * @default 1 - */ - b: number; - /** - * Sets the colors's components from the given values. - * - * @param {(number|string|Color)} [r] - The red component of the color. If `g` and `b` are - * not provided, it can be hexadecimal triplet, a CSS-style string or another `Color` instance. - * @param {number} [g] - The green component. - * @param {number} [b] - The blue component. - * @return {Color} A reference to this color. - */ - set(r?: (number | string | Color), g?: number, b?: number): Color; - /** - * Sets the colors's components to the given scalar value. - * - * @param {number} scalar - The scalar value. - * @return {Color} A reference to this color. - */ - setScalar(scalar: number): Color; - /** - * Sets this color from a hexadecimal value. - * - * @param {number} hex - The hexadecimal value. - * @param {string} [colorSpace=SRGBColorSpace] - The color space. - * @return {Color} A reference to this color. - */ - setHex(hex: number, colorSpace?: string): Color; - /** - * Sets this color from RGB values. - * - * @param {number} r - Red channel value between `0.0` and `1.0`. - * @param {number} g - Green channel value between `0.0` and `1.0`. - * @param {number} b - Blue channel value between `0.0` and `1.0`. - * @param {string} [colorSpace=ColorManagement.workingColorSpace] - The color space. - * @return {Color} A reference to this color. - */ - setRGB(r: number, g: number, b: number, colorSpace?: string): Color; - /** - * Sets this color from RGB values. - * - * @param {number} h - Hue value between `0.0` and `1.0`. - * @param {number} s - Saturation value between `0.0` and `1.0`. - * @param {number} l - Lightness value between `0.0` and `1.0`. - * @param {string} [colorSpace=ColorManagement.workingColorSpace] - The color space. - * @return {Color} A reference to this color. - */ - setHSL(h: number, s: number, l: number, colorSpace?: string): Color; - /** - * Sets this color from a CSS-style string. For example, `rgb(250, 0,0)`, - * `rgb(100%, 0%, 0%)`, `hsl(0, 100%, 50%)`, `#ff0000`, `#f00`, or `red` ( or - * any [X11 color name](https://en.wikipedia.org/wiki/X11_color_names#Color_name_chart) - - * all 140 color names are supported). - * - * @param {string} style - Color as a CSS-style string. - * @param {string} [colorSpace=SRGBColorSpace] - The color space. - * @return {Color} A reference to this color. - */ - setStyle(style: string, colorSpace?: string): Color; - /** - * Sets this color from a color name. Faster than {@link Color#setStyle} if - * you don't need the other CSS-style formats. - * - * For convenience, the list of names is exposed in `Color.NAMES` as a hash. - * ```js - * Color.NAMES.aliceblue // returns 0xF0F8FF - * ``` - * - * @param {string} style - The color name. - * @param {string} [colorSpace=SRGBColorSpace] - The color space. - * @return {Color} A reference to this color. - */ - setColorName(style: string, colorSpace?: string): Color; - /** - * Returns a new color with copied values from this instance. - * - * @return {Color} A clone of this instance. - */ - clone(): Color; - /** - * Copies the values of the given color to this instance. - * - * @param {Color} color - The color to copy. - * @return {Color} A reference to this color. - */ - copy(color: Color): Color; - /** - * Copies the given color into this color, and then converts this color from - * `SRGBColorSpace` to `LinearSRGBColorSpace`. - * - * @param {Color} color - The color to copy/convert. - * @return {Color} A reference to this color. - */ - copySRGBToLinear(color: Color): Color; - /** - * Copies the given color into this color, and then converts this color from - * `LinearSRGBColorSpace` to `SRGBColorSpace`. - * - * @param {Color} color - The color to copy/convert. - * @return {Color} A reference to this color. - */ - copyLinearToSRGB(color: Color): Color; - /** - * Converts this color from `SRGBColorSpace` to `LinearSRGBColorSpace`. - * - * @return {Color} A reference to this color. - */ - convertSRGBToLinear(): Color; - /** - * Converts this color from `LinearSRGBColorSpace` to `SRGBColorSpace`. - * - * @return {Color} A reference to this color. - */ - convertLinearToSRGB(): Color; - /** - * Returns the hexadecimal value of this color. - * - * @param {string} [colorSpace=SRGBColorSpace] - The color space. - * @return {number} The hexadecimal value. - */ - getHex(colorSpace?: string): number; - /** - * Returns the hexadecimal value of this color as a string (for example, 'FFFFFF'). - * - * @param {string} [colorSpace=SRGBColorSpace] - The color space. - * @return {string} The hexadecimal value as a string. - */ - getHexString(colorSpace?: string): string; - /** - * Converts the colors RGB values into the HSL format and stores them into the - * given target object. - * - * @param {{h:number,s:number,l:number}} target - The target object that is used to store the method's result. - * @param {string} [colorSpace=ColorManagement.workingColorSpace] - The color space. - * @return {{h:number,s:number,l:number}} The HSL representation of this color. - */ - getHSL(target: { - h: number; - s: number; - l: number; - }, colorSpace?: string): { - h: number; - s: number; - l: number; - }; - /** - * Returns the RGB values of this color and stores them into the given target object. - * - * @param {Color} target - The target color that is used to store the method's result. - * @param {string} [colorSpace=ColorManagement.workingColorSpace] - The color space. - * @return {Color} The RGB representation of this color. - */ - getRGB(target: Color, colorSpace?: string): Color; - /** - * Returns the value of this color as a CSS style string. Example: `rgb(255,0,0)`. - * - * @param {string} [colorSpace=SRGBColorSpace] - The color space. - * @return {string} The CSS representation of this color. - */ - getStyle(colorSpace?: string): string; - /** - * Adds the given HSL values to this color's values. - * Internally, this converts the color's RGB values to HSL, adds HSL - * and then converts the color back to RGB. - * - * @param {number} h - Hue value between `0.0` and `1.0`. - * @param {number} s - Saturation value between `0.0` and `1.0`. - * @param {number} l - Lightness value between `0.0` and `1.0`. - * @return {Color} A reference to this color. - */ - offsetHSL(h: number, s: number, l: number): Color; - /** - * Adds the RGB values of the given color to the RGB values of this color. - * - * @param {Color} color - The color to add. - * @return {Color} A reference to this color. - */ - add(color: Color): Color; - /** - * Adds the RGB values of the given colors and stores the result in this instance. - * - * @param {Color} color1 - The first color. - * @param {Color} color2 - The second color. - * @return {Color} A reference to this color. - */ - addColors(color1: Color, color2: Color): Color; - /** - * Adds the given scalar value to the RGB values of this color. - * - * @param {number} s - The scalar to add. - * @return {Color} A reference to this color. - */ - addScalar(s: number): Color; - /** - * Subtracts the RGB values of the given color from the RGB values of this color. - * - * @param {Color} color - The color to subtract. - * @return {Color} A reference to this color. - */ - sub(color: Color): Color; - /** - * Multiplies the RGB values of the given color with the RGB values of this color. - * - * @param {Color} color - The color to multiply. - * @return {Color} A reference to this color. - */ - multiply(color: Color): Color; - /** - * Multiplies the given scalar value with the RGB values of this color. - * - * @param {number} s - The scalar to multiply. - * @return {Color} A reference to this color. - */ - multiplyScalar(s: number): Color; - /** - * Linearly interpolates this color's RGB values toward the RGB values of the - * given color. The alpha argument can be thought of as the ratio between - * the two colors, where `0.0` is this color and `1.0` is the first argument. - * - * @param {Color} color - The color to converge on. - * @param {number} alpha - The interpolation factor in the closed interval `[0,1]`. - * @return {Color} A reference to this color. - */ - lerp(color: Color, alpha: number): Color; - /** - * Linearly interpolates between the given colors and stores the result in this instance. - * The alpha argument can be thought of as the ratio between the two colors, where `0.0` - * is the first and `1.0` is the second color. - * - * @param {Color} color1 - The first color. - * @param {Color} color2 - The second color. - * @param {number} alpha - The interpolation factor in the closed interval `[0,1]`. - * @return {Color} A reference to this color. - */ - lerpColors(color1: Color, color2: Color, alpha: number): Color; - /** - * Linearly interpolates this color's HSL values toward the HSL values of the - * given color. It differs from {@link Color#lerp} by not interpolating straight - * from one color to the other, but instead going through all the hues in between - * those two colors. The alpha argument can be thought of as the ratio between - * the two colors, where 0.0 is this color and 1.0 is the first argument. - * - * @param {Color} color - The color to converge on. - * @param {number} alpha - The interpolation factor in the closed interval `[0,1]`. - * @return {Color} A reference to this color. - */ - lerpHSL(color: Color, alpha: number): Color; - /** - * Sets the color's RGB components from the given 3D vector. - * - * @param {Vector3} v - The vector to set. - * @return {Color} A reference to this color. - */ - setFromVector3(v: Vector3): Color; - /** - * Transforms this color with the given 3x3 matrix. - * - * @param {Matrix3} m - The matrix. - * @return {Color} A reference to this color. - */ - applyMatrix3(m: Matrix3): Color; - /** - * Returns `true` if this color is equal with the given one. - * - * @param {Color} c - The color to test for equality. - * @return {boolean} Whether this bounding color is equal with the given one. - */ - equals(c: Color): boolean; - /** - * Sets this color's RGB components from the given array. - * - * @param {Array} array - An array holding the RGB values. - * @param {number} [offset=0] - The offset into the array. - * @return {Color} A reference to this color. - */ - fromArray(array: Array, offset?: number): Color; - /** - * Writes the RGB components of this color to the given array. If no array is provided, - * the method returns a new instance. - * - * @param {Array} [array=[]] - The target array holding the color components. - * @param {number} [offset=0] - Index of the first element in the array. - * @return {Array} The color components. - */ - toArray(array?: Array, offset?: number): Array; - /** - * Sets the components of this color from the given buffer attribute. - * - * @param {BufferAttribute} attribute - The buffer attribute holding color data. - * @param {number} index - The index into the attribute. - * @return {Color} A reference to this color. - */ - fromBufferAttribute(attribute: BufferAttribute, index: number): Color; - /** - * This methods defines the serialization result of this class. Returns the color - * as a hexadecimal value. - * - * @return {number} The hexadecimal value. - */ - toJSON(): number; - [Symbol.iterator](): Generator; -} -export namespace Color { - export { _colorKeywords as NAMES }; -} -declare namespace _colorKeywords { - let aliceblue: number; - let antiquewhite: number; - let aqua: number; - let aquamarine: number; - let azure: number; - let beige: number; - let bisque: number; - let black: number; - let blanchedalmond: number; - let blue: number; - let blueviolet: number; - let brown: number; - let burlywood: number; - let cadetblue: number; - let chartreuse: number; - let chocolate: number; - let coral: number; - let cornflowerblue: number; - let cornsilk: number; - let crimson: number; - let cyan: number; - let darkblue: number; - let darkcyan: number; - let darkgoldenrod: number; - let darkgray: number; - let darkgreen: number; - let darkgrey: number; - let darkkhaki: number; - let darkmagenta: number; - let darkolivegreen: number; - let darkorange: number; - let darkorchid: number; - let darkred: number; - let darksalmon: number; - let darkseagreen: number; - let darkslateblue: number; - let darkslategray: number; - let darkslategrey: number; - let darkturquoise: number; - let darkviolet: number; - let deeppink: number; - let deepskyblue: number; - let dimgray: number; - let dimgrey: number; - let dodgerblue: number; - let firebrick: number; - let floralwhite: number; - let forestgreen: number; - let fuchsia: number; - let gainsboro: number; - let ghostwhite: number; - let gold: number; - let goldenrod: number; - let gray: number; - let green: number; - let greenyellow: number; - let grey: number; - let honeydew: number; - let hotpink: number; - let indianred: number; - let indigo: number; - let ivory: number; - let khaki: number; - let lavender: number; - let lavenderblush: number; - let lawngreen: number; - let lemonchiffon: number; - let lightblue: number; - let lightcoral: number; - let lightcyan: number; - let lightgoldenrodyellow: number; - let lightgray: number; - let lightgreen: number; - let lightgrey: number; - let lightpink: number; - let lightsalmon: number; - let lightseagreen: number; - let lightskyblue: number; - let lightslategray: number; - let lightslategrey: number; - let lightsteelblue: number; - let lightyellow: number; - let lime: number; - let limegreen: number; - let linen: number; - let magenta: number; - let maroon: number; - let mediumaquamarine: number; - let mediumblue: number; - let mediumorchid: number; - let mediumpurple: number; - let mediumseagreen: number; - let mediumslateblue: number; - let mediumspringgreen: number; - let mediumturquoise: number; - let mediumvioletred: number; - let midnightblue: number; - let mintcream: number; - let mistyrose: number; - let moccasin: number; - let navajowhite: number; - let navy: number; - let oldlace: number; - let olive: number; - let olivedrab: number; - let orange: number; - let orangered: number; - let orchid: number; - let palegoldenrod: number; - let palegreen: number; - let paleturquoise: number; - let palevioletred: number; - let papayawhip: number; - let peachpuff: number; - let peru: number; - let pink: number; - let plum: number; - let powderblue: number; - let purple: number; - let rebeccapurple: number; - let red: number; - let rosybrown: number; - let royalblue: number; - let saddlebrown: number; - let salmon: number; - let sandybrown: number; - let seagreen: number; - let seashell: number; - let sienna: number; - let silver: number; - let skyblue: number; - let slateblue: number; - let slategray: number; - let slategrey: number; - let snow: number; - let springgreen: number; - let steelblue: number; - let tan: number; - let teal: number; - let thistle: number; - let tomato: number; - let turquoise: number; - let violet: number; - let wheat: number; - let white: number; - let whitesmoke: number; - let yellow: number; - let yellowgreen: number; -} -export {}; diff --git a/jsdoc-testing/jsdoc/math/ColorManagement.d.ts b/jsdoc-testing/jsdoc/math/ColorManagement.d.ts deleted file mode 100644 index 63d1502b9..000000000 --- a/jsdoc-testing/jsdoc/math/ColorManagement.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -export function SRGBToLinear(c: any): number; -export function LinearToSRGB(c: any): number; -export namespace ColorManagement { - export let enabled: boolean; - export { LinearSRGBColorSpace as workingColorSpace }; - export let spaces: {}; - export function convert(color: any, sourceColorSpace: any, targetColorSpace: any): any; - export function workingToColorSpace(color: any, targetColorSpace: any): any; - export function colorSpaceToWorking(color: any, sourceColorSpace: any): any; - export function getPrimaries(colorSpace: any): any; - export function getTransfer(colorSpace: any): any; - export function getToneMappingMode(colorSpace: any): any; - export function getLuminanceCoefficients(target: any, colorSpace?: any): any; - export function define(colorSpaces: any): void; - export function _getMatrix(targetMatrix: any, sourceColorSpace: any, targetColorSpace: any): any; - export function _getDrawingBufferColorSpace(colorSpace: any): any; - export function _getUnpackColorSpace(colorSpace?: any): any; - export function fromWorkingColorSpace(color: any, targetColorSpace: any): any; - export function toWorkingColorSpace(color: any, sourceColorSpace: any): any; -} -import { LinearSRGBColorSpace } from '../constants.js'; diff --git a/jsdoc-testing/jsdoc/math/Euler.d.ts b/jsdoc-testing/jsdoc/math/Euler.d.ts deleted file mode 100644 index 8ba21b0f2..000000000 --- a/jsdoc-testing/jsdoc/math/Euler.d.ts +++ /dev/null @@ -1,164 +0,0 @@ -/** - * A class representing Euler angles. - * - * Euler angles describe a rotational transformation by rotating an object on - * its various axes in specified amounts per axis, and a specified axis - * order. - * - * Iterating through an instance will yield its components (x, y, z, - * order) in the corresponding order. - * - * ```js - * const a = new THREE.Euler( 0, 1, 1.57, 'XYZ' ); - * const b = new THREE.Vector3( 1, 0, 1 ); - * b.applyEuler(a); - * ``` - */ -export class Euler { - /** - * Constructs a new euler instance. - * - * @param {number} [x=0] - The angle of the x axis in radians. - * @param {number} [y=0] - The angle of the y axis in radians. - * @param {number} [z=0] - The angle of the z axis in radians. - * @param {string} [order=Euler.DEFAULT_ORDER] - A string representing the order that the rotations are applied. - */ - constructor(x?: number, y?: number, z?: number, order?: string); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isEuler: boolean; - _x: number; - _y: number; - _z: number; - _order: string; - set x(value: number); - /** - * The angle of the x axis in radians. - * - * @type {number} - * @default 0 - */ - get x(): number; - set y(value: number); - /** - * The angle of the y axis in radians. - * - * @type {number} - * @default 0 - */ - get y(): number; - set z(value: number); - /** - * The angle of the z axis in radians. - * - * @type {number} - * @default 0 - */ - get z(): number; - set order(value: string); - /** - * A string representing the order that the rotations are applied. - * - * @type {string} - * @default 'XYZ' - */ - get order(): string; - /** - * Sets the Euler components. - * - * @param {number} x - The angle of the x axis in radians. - * @param {number} y - The angle of the y axis in radians. - * @param {number} z - The angle of the z axis in radians. - * @param {string} [order] - A string representing the order that the rotations are applied. - * @return {Euler} A reference to this Euler instance. - */ - set(x: number, y: number, z: number, order?: string): Euler; - /** - * Returns a new Euler instance with copied values from this instance. - * - * @return {Euler} A clone of this instance. - */ - clone(): Euler; - /** - * Copies the values of the given Euler instance to this instance. - * - * @param {Euler} euler - The Euler instance to copy. - * @return {Euler} A reference to this Euler instance. - */ - copy(euler: Euler): Euler; - /** - * Sets the angles of this Euler instance from a pure rotation matrix. - * - * @param {Matrix4} m - A 4x4 matrix of which the upper 3x3 of matrix is a pure rotation matrix (i.e. unscaled). - * @param {string} [order] - A string representing the order that the rotations are applied. - * @param {boolean} [update=true] - Whether the internal `onChange` callback should be executed or not. - * @return {Euler} A reference to this Euler instance. - */ - setFromRotationMatrix(m: Matrix4, order?: string, update?: boolean): Euler; - /** - * Sets the angles of this Euler instance from a normalized quaternion. - * - * @param {Quaternion} q - A normalized Quaternion. - * @param {string} [order] - A string representing the order that the rotations are applied. - * @param {boolean} [update=true] - Whether the internal `onChange` callback should be executed or not. - * @return {Euler} A reference to this Euler instance. - */ - setFromQuaternion(q: Quaternion, order?: string, update?: boolean): Euler; - /** - * Sets the angles of this Euler instance from the given vector. - * - * @param {Vector3} v - The vector. - * @param {string} [order] - A string representing the order that the rotations are applied. - * @return {Euler} A reference to this Euler instance. - */ - setFromVector3(v: Vector3, order?: string): Euler; - /** - * Resets the euler angle with a new order by creating a quaternion from this - * euler angle and then setting this euler angle with the quaternion and the - * new order. - * - * Warning: This discards revolution information. - * - * @param {string} [newOrder] - A string representing the new order that the rotations are applied. - * @return {Euler} A reference to this Euler instance. - */ - reorder(newOrder?: string): Euler; - /** - * Returns `true` if this Euler instance is equal with the given one. - * - * @param {Euler} euler - The Euler instance to test for equality. - * @return {boolean} Whether this Euler instance is equal with the given one. - */ - equals(euler: Euler): boolean; - /** - * Sets this Euler instance's components to values from the given array. The first three - * entries of the array are assign to the x,y and z components. An optional fourth entry - * defines the Euler order. - * - * @param {Array} array - An array holding the Euler component values. - * @return {Euler} A reference to this Euler instance. - */ - fromArray(array: Array): Euler; - /** - * Writes the components of this Euler instance to the given array. If no array is provided, - * the method returns a new instance. - * - * @param {Array} [array=[]] - The target array holding the Euler components. - * @param {number} [offset=0] - Index of the first element in the array. - * @return {Array} The Euler components. - */ - toArray(array?: Array, offset?: number): Array; - _onChange(callback: any): this; - _onChangeCallback(): void; - [Symbol.iterator](): Generator; -} -export namespace Euler { - let DEFAULT_ORDER: string; -} -import { Matrix4 } from './Matrix4.js'; -import { Quaternion } from './Quaternion.js'; diff --git a/jsdoc-testing/jsdoc/math/Frustum.d.ts b/jsdoc-testing/jsdoc/math/Frustum.d.ts deleted file mode 100644 index d6e9231b3..000000000 --- a/jsdoc-testing/jsdoc/math/Frustum.d.ts +++ /dev/null @@ -1,100 +0,0 @@ -/** - * Frustums are used to determine what is inside the camera's field of view. - * They help speed up the rendering process - objects which lie outside a camera's - * frustum can safely be excluded from rendering. - * - * This class is mainly intended for use internally by a renderer. - */ -export class Frustum { - /** - * Constructs a new frustum. - * - * @param {Plane} [p0] - The first plane that encloses the frustum. - * @param {Plane} [p1] - The second plane that encloses the frustum. - * @param {Plane} [p2] - The third plane that encloses the frustum. - * @param {Plane} [p3] - The fourth plane that encloses the frustum. - * @param {Plane} [p4] - The fifth plane that encloses the frustum. - * @param {Plane} [p5] - The sixth plane that encloses the frustum. - */ - constructor(p0?: Plane, p1?: Plane, p2?: Plane, p3?: Plane, p4?: Plane, p5?: Plane); - /** - * This array holds the planes that enclose the frustum. - * - * @type {Array} - */ - planes: Array; - /** - * Sets the frustum planes by copying the given planes. - * - * @param {Plane} [p0] - The first plane that encloses the frustum. - * @param {Plane} [p1] - The second plane that encloses the frustum. - * @param {Plane} [p2] - The third plane that encloses the frustum. - * @param {Plane} [p3] - The fourth plane that encloses the frustum. - * @param {Plane} [p4] - The fifth plane that encloses the frustum. - * @param {Plane} [p5] - The sixth plane that encloses the frustum. - * @return {Frustum} A reference to this frustum. - */ - set(p0?: Plane, p1?: Plane, p2?: Plane, p3?: Plane, p4?: Plane, p5?: Plane): Frustum; - /** - * Copies the values of the given frustum to this instance. - * - * @param {Frustum} frustum - The frustum to copy. - * @return {Frustum} A reference to this frustum. - */ - copy(frustum: Frustum): Frustum; - /** - * Sets the frustum planes from the given projection matrix. - * - * @param {Matrix4} m - The projection matrix. - * @param {(WebGLCoordinateSystem|WebGPUCoordinateSystem)} coordinateSystem - The coordinate system. - * @param {boolean} [reversedDepth=false] - Whether to use a reversed depth. - * @return {Frustum} A reference to this frustum. - */ - setFromProjectionMatrix(m: Matrix4, coordinateSystem?: (number | number), reversedDepth?: boolean): Frustum; - /** - * Returns `true` if the 3D object's bounding sphere is intersecting this frustum. - * - * Note that the 3D object must have a geometry so that the bounding sphere can be calculated. - * - * @param {Object3D} object - The 3D object to test. - * @return {boolean} Whether the 3D object's bounding sphere is intersecting this frustum or not. - */ - intersectsObject(object: Object3D): boolean; - /** - * Returns `true` if the given sprite is intersecting this frustum. - * - * @param {Sprite} sprite - The sprite to test. - * @return {boolean} Whether the sprite is intersecting this frustum or not. - */ - intersectsSprite(sprite: Sprite): boolean; - /** - * Returns `true` if the given bounding sphere is intersecting this frustum. - * - * @param {Sphere} sphere - The bounding sphere to test. - * @return {boolean} Whether the bounding sphere is intersecting this frustum or not. - */ - intersectsSphere(sphere: Sphere): boolean; - /** - * Returns `true` if the given bounding box is intersecting this frustum. - * - * @param {Box3} box - The bounding box to test. - * @return {boolean} Whether the bounding box is intersecting this frustum or not. - */ - intersectsBox(box: Box3): boolean; - /** - * Returns `true` if the given point lies within the frustum. - * - * @param {Vector3} point - The point to test. - * @return {boolean} Whether the point lies within this frustum or not. - */ - containsPoint(point: Vector3): boolean; - /** - * Returns a new frustum with copied values from this instance. - * - * @return {Frustum} A clone of this instance. - */ - clone(): Frustum; -} -import { Plane } from './Plane.js'; -import { Sphere } from './Sphere.js'; -import { Vector3 } from './Vector3.js'; diff --git a/jsdoc-testing/jsdoc/math/FrustumArray.d.ts b/jsdoc-testing/jsdoc/math/FrustumArray.d.ts deleted file mode 100644 index f5f5b4bd9..000000000 --- a/jsdoc-testing/jsdoc/math/FrustumArray.d.ts +++ /dev/null @@ -1,64 +0,0 @@ -/** - * FrustumArray is used to determine if an object is visible in at least one camera - * from an array of cameras. This is particularly useful for multi-view renderers. -*/ -export class FrustumArray { - /** - * The coordinate system to use. - * - * @type {WebGLCoordinateSystem|WebGPUCoordinateSystem} - * @default WebGLCoordinateSystem - */ - coordinateSystem: number | WebGPUCoordinateSystem; - /** - * Returns `true` if the 3D object's bounding sphere is intersecting any frustum - * from the camera array. - * - * @param {Object3D} object - The 3D object to test. - * @param {Object} cameraArray - An object with a cameras property containing an array of cameras. - * @return {boolean} Whether the 3D object is visible in any camera. - */ - intersectsObject(object: Object3D, cameraArray: Object): boolean; - /** - * Returns `true` if the given sprite is intersecting any frustum - * from the camera array. - * - * @param {Sprite} sprite - The sprite to test. - * @param {Object} cameraArray - An object with a cameras property containing an array of cameras. - * @return {boolean} Whether the sprite is visible in any camera. - */ - intersectsSprite(sprite: Sprite, cameraArray: Object): boolean; - /** - * Returns `true` if the given bounding sphere is intersecting any frustum - * from the camera array. - * - * @param {Sphere} sphere - The bounding sphere to test. - * @param {Object} cameraArray - An object with a cameras property containing an array of cameras. - * @return {boolean} Whether the sphere is visible in any camera. - */ - intersectsSphere(sphere: Sphere, cameraArray: Object): boolean; - /** - * Returns `true` if the given bounding box is intersecting any frustum - * from the camera array. - * - * @param {Box3} box - The bounding box to test. - * @param {Object} cameraArray - An object with a cameras property containing an array of cameras. - * @return {boolean} Whether the box is visible in any camera. - */ - intersectsBox(box: Box3, cameraArray: Object): boolean; - /** - * Returns `true` if the given point lies within any frustum - * from the camera array. - * - * @param {Vector3} point - The point to test. - * @param {Object} cameraArray - An object with a cameras property containing an array of cameras. - * @return {boolean} Whether the point is visible in any camera. - */ - containsPoint(point: Vector3, cameraArray: Object): boolean; - /** - * Returns a new frustum array with copied values from this instance. - * - * @return {FrustumArray} A clone of this instance. - */ - clone(): FrustumArray; -} diff --git a/jsdoc-testing/jsdoc/math/Interpolant.d.ts b/jsdoc-testing/jsdoc/math/Interpolant.d.ts deleted file mode 100644 index 561415c0e..000000000 --- a/jsdoc-testing/jsdoc/math/Interpolant.d.ts +++ /dev/null @@ -1,114 +0,0 @@ -/** - * Abstract base class of interpolants over parametric samples. - * - * The parameter domain is one dimensional, typically the time or a path - * along a curve defined by the data. - * - * The sample values can have any dimensionality and derived classes may - * apply special interpretations to the data. - * - * This class provides the interval seek in a Template Method, deferring - * the actual interpolation to derived classes. - * - * Time complexity is O(1) for linear access crossing at most two points - * and O(log N) for random access, where N is the number of positions. - * - * References: {@link http://www.oodesign.com/template-method-pattern.html} - * - * @abstract - */ -export class Interpolant { - /** - * Constructs a new interpolant. - * - * @param {TypedArray} parameterPositions - The parameter positions hold the interpolation factors. - * @param {TypedArray} sampleValues - The sample values. - * @param {number} sampleSize - The sample size - * @param {TypedArray} [resultBuffer] - The result buffer. - */ - constructor(parameterPositions: TypedArray, sampleValues: TypedArray, sampleSize: number, resultBuffer?: TypedArray); - /** - * The parameter positions. - * - * @type {TypedArray} - */ - parameterPositions: TypedArray; - /** - * A cache index. - * - * @private - * @type {number} - * @default 0 - */ - private _cachedIndex; - /** - * The result buffer. - * - * @type {TypedArray} - */ - resultBuffer: TypedArray; - /** - * The sample values. - * - * @type {TypedArray} - */ - sampleValues: TypedArray; - /** - * The value size. - * - * @type {TypedArray} - */ - valueSize: TypedArray; - /** - * The interpolation settings. - * - * @type {?Object} - * @default null - */ - settings: Object | null; - /** - * The default settings object. - * - * @type {Object} - */ - DefaultSettings_: Object; - /** - * Evaluate the interpolant at position `t`. - * - * @param {number} t - The interpolation factor. - * @return {TypedArray} The result buffer. - */ - evaluate(t: number): TypedArray; - /** - * Returns the interpolation settings. - * - * @return {Object} The interpolation settings. - */ - getSettings_(): Object; - /** - * Copies a sample value to the result buffer. - * - * @param {number} index - An index into the sample value buffer. - * @return {TypedArray} The result buffer. - */ - copySampleValue_(index: number): TypedArray; - /** - * Copies a sample value to the result buffer. - * - * @abstract - * @param {number} i1 - An index into the sample value buffer. - * @param {number} t0 - The previous interpolation factor. - * @param {number} t - The current interpolation factor. - * @param {number} t1 - The next interpolation factor. - * @return {TypedArray} The result buffer. - */ - interpolate_(): TypedArray; - /** - * Optional method that is executed when the interval has changed. - * - * @param {number} i1 - An index into the sample value buffer. - * @param {number} t0 - The previous interpolation factor. - * @param {number} t - The current interpolation factor. - */ - intervalChanged_(): void; -} diff --git a/jsdoc-testing/jsdoc/math/MathUtils.d.ts b/jsdoc-testing/jsdoc/math/MathUtils.d.ts deleted file mode 100644 index bc4d11f77..000000000 --- a/jsdoc-testing/jsdoc/math/MathUtils.d.ts +++ /dev/null @@ -1,224 +0,0 @@ -export const DEG2RAD: number; -export const RAD2DEG: number; -/** - * Generate a [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) - * (universally unique identifier). - * - * @return {string} The UUID. - */ -export function generateUUID(): string; -/** - * Clamps the given value between min and max. - * - * @param {number} value - The value to clamp. - * @param {number} min - The min value. - * @param {number} max - The max value. - * @return {number} The clamped value. - */ -export function clamp(value: number, min: number, max: number): number; -/** - * Computes the Euclidean modulo of the given parameters that - * is `( ( n % m ) + m ) % m`. - * - * @param {number} n - The first parameter. - * @param {number} m - The second parameter. - * @return {number} The Euclidean modulo. - */ -export function euclideanModulo(n: number, m: number): number; -/** - * Performs a linear mapping from range `` to range `` - * for the given value. `a2` must be greater than `a1`. - * - * @param {number} x - The value to be mapped. - * @param {number} a1 - Minimum value for range A. - * @param {number} a2 - Maximum value for range A. - * @param {number} b1 - Minimum value for range B. - * @param {number} b2 - Maximum value for range B. - * @return {number} The mapped value. - */ -export function mapLinear(x: number, a1: number, a2: number, b1: number, b2: number): number; -/** - * Returns the percentage in the closed interval `[0, 1]` of the given value - * between the start and end point. - * - * @param {number} x - The start point - * @param {number} y - The end point. - * @param {number} value - A value between start and end. - * @return {number} The interpolation factor. - */ -export function inverseLerp(x: number, y: number, value: number): number; -/** - * Returns a value linearly interpolated from two known points based on the given interval - - * `t = 0` will return `x` and `t = 1` will return `y`. - * - * @param {number} x - The start point - * @param {number} y - The end point. - * @param {number} t - The interpolation factor in the closed interval `[0, 1]`. - * @return {number} The interpolated value. - */ -export function lerp(x: number, y: number, t: number): number; -/** - * Smoothly interpolate a number from `x` to `y` in a spring-like manner using a delta - * time to maintain frame rate independent movement. For details, see - * [Frame rate independent damping using lerp](http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/). - * - * @param {number} x - The current point. - * @param {number} y - The target point. - * @param {number} lambda - A higher lambda value will make the movement more sudden, - * and a lower value will make the movement more gradual. - * @param {number} dt - Delta time in seconds. - * @return {number} The interpolated value. - */ -export function damp(x: number, y: number, lambda: number, dt: number): number; -/** - * Returns a value that alternates between `0` and the given `length` parameter. - * - * @param {number} x - The value to pingpong. - * @param {number} [length=1] - The positive value the function will pingpong to. - * @return {number} The alternated value. - */ -export function pingpong(x: number, length?: number): number; -/** - * Returns a value in the range `[0,1]` that represents the percentage that `x` has - * moved between `min` and `max`, but smoothed or slowed down the closer `x` is to - * the `min` and `max`. - * - * See [Smoothstep](http://en.wikipedia.org/wiki/Smoothstep) for more details. - * - * @param {number} x - The value to evaluate based on its position between `min` and `max`. - * @param {number} min - The min value. Any `x` value below `min` will be `0`. `min` must be lower than `max`. - * @param {number} max - The max value. Any `x` value above `max` will be `1`. `max` must be greater than `min`. - * @return {number} The alternated value. - */ -export function smoothstep(x: number, min: number, max: number): number; -/** - * A [variation on smoothstep](https://en.wikipedia.org/wiki/Smoothstep#Variations) - * that has zero 1st and 2nd order derivatives at `x=0` and `x=1`. - * - * @param {number} x - The value to evaluate based on its position between `min` and `max`. - * @param {number} min - The min value. Any `x` value below `min` will be `0`. `min` must be lower than `max`. - * @param {number} max - The max value. Any `x` value above `max` will be `1`. `max` must be greater than `min`. - * @return {number} The alternated value. - */ -export function smootherstep(x: number, min: number, max: number): number; -/** - * Returns a random integer from `` interval. - * - * @param {number} low - The lower value boundary. - * @param {number} high - The upper value boundary - * @return {number} A random integer. - */ -export function randInt(low: number, high: number): number; -/** - * Returns a random float from `` interval. - * - * @param {number} low - The lower value boundary. - * @param {number} high - The upper value boundary - * @return {number} A random float. - */ -export function randFloat(low: number, high: number): number; -/** - * Returns a random integer from `<-range/2, range/2>` interval. - * - * @param {number} range - Defines the value range. - * @return {number} A random float. - */ -export function randFloatSpread(range: number): number; -/** - * Returns a deterministic pseudo-random float in the interval `[0, 1]`. - * - * @param {number} [s] - The integer seed. - * @return {number} A random float. - */ -export function seededRandom(s?: number): number; -/** - * Converts degrees to radians. - * - * @param {number} degrees - A value in degrees. - * @return {number} The converted value in radians. - */ -export function degToRad(degrees: number): number; -/** - * Converts radians to degrees. - * - * @param {number} radians - A value in radians. - * @return {number} The converted value in degrees. - */ -export function radToDeg(radians: number): number; -/** - * Returns `true` if the given number is a power of two. - * - * @param {number} value - The value to check. - * @return {boolean} Whether the given number is a power of two or not. - */ -export function isPowerOfTwo(value: number): boolean; -/** - * Returns the smallest power of two that is greater than or equal to the given number. - * - * @param {number} value - The value to find a POT for. Must be greater than `0`. - * @return {number} The smallest power of two that is greater than or equal to the given number. - */ -export function ceilPowerOfTwo(value: number): number; -/** - * Returns the largest power of two that is less than or equal to the given number. - * - * @param {number} value - The value to find a POT for. Must be greater than `0`. - * @return {number} The largest power of two that is less than or equal to the given number. - */ -export function floorPowerOfTwo(value: number): number; -/** - * Sets the given quaternion from the [Intrinsic Proper Euler Angles](https://en.wikipedia.org/wiki/Euler_angles) - * defined by the given angles and order. - * - * Rotations are applied to the axes in the order specified by order: - * rotation by angle `a` is applied first, then by angle `b`, then by angle `c`. - * - * @param {Quaternion} q - The quaternion to set. - * @param {number} a - The rotation applied to the first axis, in radians. - * @param {number} b - The rotation applied to the second axis, in radians. - * @param {number} c - The rotation applied to the third axis, in radians. - * @param {('XYX'|'XZX'|'YXY'|'YZY'|'ZXZ'|'ZYZ')} order - A string specifying the axes order. - */ -export function setQuaternionFromProperEuler(q: Quaternion, a: number, b: number, c: number, order: ("XYX" | "XZX" | "YXY" | "YZY" | "ZXZ" | "ZYZ")): void; -/** - * Normalizes the given value according to the given typed array. - * - * @param {number} value - The float value in the range `[0,1]` to normalize. - * @param {TypedArray} array - The typed array that defines the data type of the value. - * @return {number} The normalize value. - */ -export function normalize(value: number, array: TypedArray): number; -/** - * Denormalizes the given value according to the given typed array. - * - * @param {number} value - The value to denormalize. - * @param {TypedArray} array - The typed array that defines the data type of the value. - * @return {number} The denormalize (float) value in the range `[0,1]`. - */ -export function denormalize(value: number, array: TypedArray): number; -export namespace MathUtils { - export { DEG2RAD }; - export { RAD2DEG }; - export { generateUUID }; - export { clamp }; - export { euclideanModulo }; - export { mapLinear }; - export { inverseLerp }; - export { lerp }; - export { damp }; - export { pingpong }; - export { smoothstep }; - export { smootherstep }; - export { randInt }; - export { randFloat }; - export { randFloatSpread }; - export { seededRandom }; - export { degToRad }; - export { radToDeg }; - export { isPowerOfTwo }; - export { ceilPowerOfTwo }; - export { floorPowerOfTwo }; - export { setQuaternionFromProperEuler }; - export { normalize }; - export { denormalize }; -} diff --git a/jsdoc-testing/jsdoc/math/Matrix2.d.ts b/jsdoc-testing/jsdoc/math/Matrix2.d.ts deleted file mode 100644 index 7eac72d0b..000000000 --- a/jsdoc-testing/jsdoc/math/Matrix2.d.ts +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Represents a 2x2 matrix. - * - * A Note on Row-Major and Column-Major Ordering: - * - * The constructor and {@link Matrix2#set} method take arguments in - * [row-major](https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order) - * order, while internally they are stored in the {@link Matrix2#elements} array in column-major order. - * This means that calling: - * ```js - * const m = new THREE.Matrix2(); - * m.set( 11, 12, - * 21, 22 ); - * ``` - * will result in the elements array containing: - * ```js - * m.elements = [ 11, 21, - * 12, 22 ]; - * ``` - * and internally all calculations are performed using column-major ordering. - * However, as the actual ordering makes no difference mathematically and - * most people are used to thinking about matrices in row-major order, the - * three.js documentation shows matrices in row-major order. Just bear in - * mind that if you are reading the source code, you'll have to take the - * transpose of any matrices outlined here to make sense of the calculations. - */ -export class Matrix2 { - /** - * Constructs a new 2x2 matrix. The arguments are supposed to be - * in row-major order. If no arguments are provided, the constructor - * initializes the matrix as an identity matrix. - * - * @param {number} [n11] - 1-1 matrix element. - * @param {number} [n12] - 1-2 matrix element. - * @param {number} [n21] - 2-1 matrix element. - * @param {number} [n22] - 2-2 matrix element. - */ - constructor(n11?: number, n12?: number, n21?: number, n22?: number); - /** - * A column-major list of matrix values. - * - * @type {Array} - */ - elements: Array; - /** - * Sets this matrix to the 2x2 identity matrix. - * - * @return {Matrix2} A reference to this matrix. - */ - identity(): Matrix2; - /** - * Sets the elements of the matrix from the given array. - * - * @param {Array} array - The matrix elements in column-major order. - * @param {number} [offset=0] - Index of the first element in the array. - * @return {Matrix2} A reference to this matrix. - */ - fromArray(array: Array, offset?: number): Matrix2; - /** - * Sets the elements of the matrix.The arguments are supposed to be - * in row-major order. - * - * @param {number} n11 - 1-1 matrix element. - * @param {number} n12 - 1-2 matrix element. - * @param {number} n21 - 2-1 matrix element. - * @param {number} n22 - 2-2 matrix element. - * @return {Matrix2} A reference to this matrix. - */ - set(n11: number, n12: number, n21: number, n22: number): Matrix2; -} diff --git a/jsdoc-testing/jsdoc/math/Matrix3.d.ts b/jsdoc-testing/jsdoc/math/Matrix3.d.ts deleted file mode 100644 index 0aea68708..000000000 --- a/jsdoc-testing/jsdoc/math/Matrix3.d.ts +++ /dev/null @@ -1,251 +0,0 @@ -/** - * Represents a 3x3 matrix. - * - * A Note on Row-Major and Column-Major Ordering: - * - * The constructor and {@link Matrix3#set} method take arguments in - * [row-major](https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order) - * order, while internally they are stored in the {@link Matrix3#elements} array in column-major order. - * This means that calling: - * ```js - * const m = new THREE.Matrix(); - * m.set( 11, 12, 13, - * 21, 22, 23, - * 31, 32, 33 ); - * ``` - * will result in the elements array containing: - * ```js - * m.elements = [ 11, 21, 31, - * 12, 22, 32, - * 13, 23, 33 ]; - * ``` - * and internally all calculations are performed using column-major ordering. - * However, as the actual ordering makes no difference mathematically and - * most people are used to thinking about matrices in row-major order, the - * three.js documentation shows matrices in row-major order. Just bear in - * mind that if you are reading the source code, you'll have to take the - * transpose of any matrices outlined here to make sense of the calculations. - */ -export class Matrix3 { - /** - * Constructs a new 3x3 matrix. The arguments are supposed to be - * in row-major order. If no arguments are provided, the constructor - * initializes the matrix as an identity matrix. - * - * @param {number} [n11] - 1-1 matrix element. - * @param {number} [n12] - 1-2 matrix element. - * @param {number} [n13] - 1-3 matrix element. - * @param {number} [n21] - 2-1 matrix element. - * @param {number} [n22] - 2-2 matrix element. - * @param {number} [n23] - 2-3 matrix element. - * @param {number} [n31] - 3-1 matrix element. - * @param {number} [n32] - 3-2 matrix element. - * @param {number} [n33] - 3-3 matrix element. - */ - constructor(n11?: number, n12?: number, n13?: number, n21?: number, n22?: number, n23?: number, n31?: number, n32?: number, n33?: number); - /** - * A column-major list of matrix values. - * - * @type {Array} - */ - elements: Array; - /** - * Sets the elements of the matrix.The arguments are supposed to be - * in row-major order. - * - * @param {number} [n11] - 1-1 matrix element. - * @param {number} [n12] - 1-2 matrix element. - * @param {number} [n13] - 1-3 matrix element. - * @param {number} [n21] - 2-1 matrix element. - * @param {number} [n22] - 2-2 matrix element. - * @param {number} [n23] - 2-3 matrix element. - * @param {number} [n31] - 3-1 matrix element. - * @param {number} [n32] - 3-2 matrix element. - * @param {number} [n33] - 3-3 matrix element. - * @return {Matrix3} A reference to this matrix. - */ - set(n11?: number, n12?: number, n13?: number, n21?: number, n22?: number, n23?: number, n31?: number, n32?: number, n33?: number): Matrix3; - /** - * Sets this matrix to the 3x3 identity matrix. - * - * @return {Matrix3} A reference to this matrix. - */ - identity(): Matrix3; - /** - * Copies the values of the given matrix to this instance. - * - * @param {Matrix3} m - The matrix to copy. - * @return {Matrix3} A reference to this matrix. - */ - copy(m: Matrix3): Matrix3; - /** - * Extracts the basis of this matrix into the three axis vectors provided. - * - * @param {Vector3} xAxis - The basis's x axis. - * @param {Vector3} yAxis - The basis's y axis. - * @param {Vector3} zAxis - The basis's z axis. - * @return {Matrix3} A reference to this matrix. - */ - extractBasis(xAxis: Vector3, yAxis: Vector3, zAxis: Vector3): Matrix3; - /** - * Set this matrix to the upper 3x3 matrix of the given 4x4 matrix. - * - * @param {Matrix4} m - The 4x4 matrix. - * @return {Matrix3} A reference to this matrix. - */ - setFromMatrix4(m: Matrix4): Matrix3; - /** - * Post-multiplies this matrix by the given 3x3 matrix. - * - * @param {Matrix3} m - The matrix to multiply with. - * @return {Matrix3} A reference to this matrix. - */ - multiply(m: Matrix3): Matrix3; - /** - * Pre-multiplies this matrix by the given 3x3 matrix. - * - * @param {Matrix3} m - The matrix to multiply with. - * @return {Matrix3} A reference to this matrix. - */ - premultiply(m: Matrix3): Matrix3; - /** - * Multiples the given 3x3 matrices and stores the result - * in this matrix. - * - * @param {Matrix3} a - The first matrix. - * @param {Matrix3} b - The second matrix. - * @return {Matrix3} A reference to this matrix. - */ - multiplyMatrices(a: Matrix3, b: Matrix3): Matrix3; - /** - * Multiplies every component of the matrix by the given scalar. - * - * @param {number} s - The scalar. - * @return {Matrix3} A reference to this matrix. - */ - multiplyScalar(s: number): Matrix3; - /** - * Computes and returns the determinant of this matrix. - * - * @return {number} The determinant. - */ - determinant(): number; - /** - * Inverts this matrix, using the [analytic method](https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution). - * You can not invert with a determinant of zero. If you attempt this, the method produces - * a zero matrix instead. - * - * @return {Matrix3} A reference to this matrix. - */ - invert(): Matrix3; - /** - * Transposes this matrix in place. - * - * @return {Matrix3} A reference to this matrix. - */ - transpose(): Matrix3; - /** - * Computes the normal matrix which is the inverse transpose of the upper - * left 3x3 portion of the given 4x4 matrix. - * - * @param {Matrix4} matrix4 - The 4x4 matrix. - * @return {Matrix3} A reference to this matrix. - */ - getNormalMatrix(matrix4: Matrix4): Matrix3; - /** - * Transposes this matrix into the supplied array, and returns itself unchanged. - * - * @param {Array} r - An array to store the transposed matrix elements. - * @return {Matrix3} A reference to this matrix. - */ - transposeIntoArray(r: Array): Matrix3; - /** - * Sets the UV transform matrix from offset, repeat, rotation, and center. - * - * @param {number} tx - Offset x. - * @param {number} ty - Offset y. - * @param {number} sx - Repeat x. - * @param {number} sy - Repeat y. - * @param {number} rotation - Rotation, in radians. Positive values rotate counterclockwise. - * @param {number} cx - Center x of rotation. - * @param {number} cy - Center y of rotation - * @return {Matrix3} A reference to this matrix. - */ - setUvTransform(tx: number, ty: number, sx: number, sy: number, rotation: number, cx: number, cy: number): Matrix3; - /** - * Scales this matrix with the given scalar values. - * - * @param {number} sx - The amount to scale in the X axis. - * @param {number} sy - The amount to scale in the Y axis. - * @return {Matrix3} A reference to this matrix. - */ - scale(sx: number, sy: number): Matrix3; - /** - * Rotates this matrix by the given angle. - * - * @param {number} theta - The rotation in radians. - * @return {Matrix3} A reference to this matrix. - */ - rotate(theta: number): Matrix3; - /** - * Translates this matrix by the given scalar values. - * - * @param {number} tx - The amount to translate in the X axis. - * @param {number} ty - The amount to translate in the Y axis. - * @return {Matrix3} A reference to this matrix. - */ - translate(tx: number, ty: number): Matrix3; - /** - * Sets this matrix as a 2D translation transform. - * - * @param {number|Vector2} x - The amount to translate in the X axis or alternatively a translation vector. - * @param {number} y - The amount to translate in the Y axis. - * @return {Matrix3} A reference to this matrix. - */ - makeTranslation(x: number | Vector2, y: number): Matrix3; - /** - * Sets this matrix as a 2D rotational transformation. - * - * @param {number} theta - The rotation in radians. - * @return {Matrix3} A reference to this matrix. - */ - makeRotation(theta: number): Matrix3; - /** - * Sets this matrix as a 2D scale transform. - * - * @param {number} x - The amount to scale in the X axis. - * @param {number} y - The amount to scale in the Y axis. - * @return {Matrix3} A reference to this matrix. - */ - makeScale(x: number, y: number): Matrix3; - /** - * Returns `true` if this matrix is equal with the given one. - * - * @param {Matrix3} matrix - The matrix to test for equality. - * @return {boolean} Whether this matrix is equal with the given one. - */ - equals(matrix: Matrix3): boolean; - /** - * Sets the elements of the matrix from the given array. - * - * @param {Array} array - The matrix elements in column-major order. - * @param {number} [offset=0] - Index of the first element in the array. - * @return {Matrix3} A reference to this matrix. - */ - fromArray(array: Array, offset?: number): Matrix3; - /** - * Writes the elements of this matrix to the given array. If no array is provided, - * the method returns a new instance. - * - * @param {Array} [array=[]] - The target array holding the matrix elements in column-major order. - * @param {number} [offset=0] - Index of the first element in the array. - * @return {Array} The matrix elements in column-major order. - */ - toArray(array?: Array, offset?: number): Array; - /** - * Returns a matrix with copied values from this instance. - * - * @return {Matrix3} A clone of this instance. - */ - clone(): Matrix3; -} diff --git a/jsdoc-testing/jsdoc/math/Matrix4.d.ts b/jsdoc-testing/jsdoc/math/Matrix4.d.ts deleted file mode 100644 index 6f15181df..000000000 --- a/jsdoc-testing/jsdoc/math/Matrix4.d.ts +++ /dev/null @@ -1,404 +0,0 @@ -/** - * Represents a 4x4 matrix. - * - * The most common use of a 4x4 matrix in 3D computer graphics is as a transformation matrix. - * For an introduction to transformation matrices as used in WebGL, check out [this tutorial](https://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices) - * - * This allows a 3D vector representing a point in 3D space to undergo - * transformations such as translation, rotation, shear, scale, reflection, - * orthogonal or perspective projection and so on, by being multiplied by the - * matrix. This is known as `applying` the matrix to the vector. - * - * A Note on Row-Major and Column-Major Ordering: - * - * The constructor and {@link Matrix3#set} method take arguments in - * [row-major](https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order) - * order, while internally they are stored in the {@link Matrix3#elements} array in column-major order. - * This means that calling: - * ```js - * const m = new THREE.Matrix4(); - * m.set( 11, 12, 13, 14, - * 21, 22, 23, 24, - * 31, 32, 33, 34, - * 41, 42, 43, 44 ); - * ``` - * will result in the elements array containing: - * ```js - * m.elements = [ 11, 21, 31, 41, - * 12, 22, 32, 42, - * 13, 23, 33, 43, - * 14, 24, 34, 44 ]; - * ``` - * and internally all calculations are performed using column-major ordering. - * However, as the actual ordering makes no difference mathematically and - * most people are used to thinking about matrices in row-major order, the - * three.js documentation shows matrices in row-major order. Just bear in - * mind that if you are reading the source code, you'll have to take the - * transpose of any matrices outlined here to make sense of the calculations. - */ -export class Matrix4 { - /** - * Constructs a new 4x4 matrix. The arguments are supposed to be - * in row-major order. If no arguments are provided, the constructor - * initializes the matrix as an identity matrix. - * - * @param {number} [n11] - 1-1 matrix element. - * @param {number} [n12] - 1-2 matrix element. - * @param {number} [n13] - 1-3 matrix element. - * @param {number} [n14] - 1-4 matrix element. - * @param {number} [n21] - 2-1 matrix element. - * @param {number} [n22] - 2-2 matrix element. - * @param {number} [n23] - 2-3 matrix element. - * @param {number} [n24] - 2-4 matrix element. - * @param {number} [n31] - 3-1 matrix element. - * @param {number} [n32] - 3-2 matrix element. - * @param {number} [n33] - 3-3 matrix element. - * @param {number} [n34] - 3-4 matrix element. - * @param {number} [n41] - 4-1 matrix element. - * @param {number} [n42] - 4-2 matrix element. - * @param {number} [n43] - 4-3 matrix element. - * @param {number} [n44] - 4-4 matrix element. - */ - constructor(n11?: number, n12?: number, n13?: number, n14?: number, n21?: number, n22?: number, n23?: number, n24?: number, n31?: number, n32?: number, n33?: number, n34?: number, n41?: number, n42?: number, n43?: number, n44?: number); - /** - * A column-major list of matrix values. - * - * @type {Array} - */ - elements: Array; - /** - * Sets the elements of the matrix.The arguments are supposed to be - * in row-major order. - * - * @param {number} [n11] - 1-1 matrix element. - * @param {number} [n12] - 1-2 matrix element. - * @param {number} [n13] - 1-3 matrix element. - * @param {number} [n14] - 1-4 matrix element. - * @param {number} [n21] - 2-1 matrix element. - * @param {number} [n22] - 2-2 matrix element. - * @param {number} [n23] - 2-3 matrix element. - * @param {number} [n24] - 2-4 matrix element. - * @param {number} [n31] - 3-1 matrix element. - * @param {number} [n32] - 3-2 matrix element. - * @param {number} [n33] - 3-3 matrix element. - * @param {number} [n34] - 3-4 matrix element. - * @param {number} [n41] - 4-1 matrix element. - * @param {number} [n42] - 4-2 matrix element. - * @param {number} [n43] - 4-3 matrix element. - * @param {number} [n44] - 4-4 matrix element. - * @return {Matrix4} A reference to this matrix. - */ - set(n11?: number, n12?: number, n13?: number, n14?: number, n21?: number, n22?: number, n23?: number, n24?: number, n31?: number, n32?: number, n33?: number, n34?: number, n41?: number, n42?: number, n43?: number, n44?: number): Matrix4; - /** - * Sets this matrix to the 4x4 identity matrix. - * - * @return {Matrix4} A reference to this matrix. - */ - identity(): Matrix4; - /** - * Returns a matrix with copied values from this instance. - * - * @return {Matrix4} A clone of this instance. - */ - clone(): Matrix4; - /** - * Copies the values of the given matrix to this instance. - * - * @param {Matrix4} m - The matrix to copy. - * @return {Matrix4} A reference to this matrix. - */ - copy(m: Matrix4): Matrix4; - /** - * Copies the translation component of the given matrix - * into this matrix's translation component. - * - * @param {Matrix4} m - The matrix to copy the translation component. - * @return {Matrix4} A reference to this matrix. - */ - copyPosition(m: Matrix4): Matrix4; - /** - * Set the upper 3x3 elements of this matrix to the values of given 3x3 matrix. - * - * @param {Matrix3} m - The 3x3 matrix. - * @return {Matrix4} A reference to this matrix. - */ - setFromMatrix3(m: Matrix3): Matrix4; - /** - * Extracts the basis of this matrix into the three axis vectors provided. - * - * @param {Vector3} xAxis - The basis's x axis. - * @param {Vector3} yAxis - The basis's y axis. - * @param {Vector3} zAxis - The basis's z axis. - * @return {Matrix4} A reference to this matrix. - */ - extractBasis(xAxis: Vector3, yAxis: Vector3, zAxis: Vector3): Matrix4; - /** - * Sets the given basis vectors to this matrix. - * - * @param {Vector3} xAxis - The basis's x axis. - * @param {Vector3} yAxis - The basis's y axis. - * @param {Vector3} zAxis - The basis's z axis. - * @return {Matrix4} A reference to this matrix. - */ - makeBasis(xAxis: Vector3, yAxis: Vector3, zAxis: Vector3): Matrix4; - /** - * Extracts the rotation component of the given matrix - * into this matrix's rotation component. - * - * Note: This method does not support reflection matrices. - * - * @param {Matrix4} m - The matrix. - * @return {Matrix4} A reference to this matrix. - */ - extractRotation(m: Matrix4): Matrix4; - /** - * Sets the rotation component (the upper left 3x3 matrix) of this matrix to - * the rotation specified by the given Euler angles. The rest of - * the matrix is set to the identity. Depending on the {@link Euler#order}, - * there are six possible outcomes. See [this page](https://en.wikipedia.org/wiki/Euler_angles#Rotation_matrix) - * for a complete list. - * - * @param {Euler} euler - The Euler angles. - * @return {Matrix4} A reference to this matrix. - */ - makeRotationFromEuler(euler: Euler): Matrix4; - /** - * Sets the rotation component of this matrix to the rotation specified by - * the given Quaternion as outlined [here](https://en.wikipedia.org/wiki/Rotation_matrix#Quaternion) - * The rest of the matrix is set to the identity. - * - * @param {Quaternion} q - The Quaternion. - * @return {Matrix4} A reference to this matrix. - */ - makeRotationFromQuaternion(q: Quaternion): Matrix4; - /** - * Sets the rotation component of the transformation matrix, looking from `eye` towards - * `target`, and oriented by the up-direction. - * - * @param {Vector3} eye - The eye vector. - * @param {Vector3} target - The target vector. - * @param {Vector3} up - The up vector. - * @return {Matrix4} A reference to this matrix. - */ - lookAt(eye: Vector3, target: Vector3, up: Vector3): Matrix4; - /** - * Post-multiplies this matrix by the given 4x4 matrix. - * - * @param {Matrix4} m - The matrix to multiply with. - * @return {Matrix4} A reference to this matrix. - */ - multiply(m: Matrix4): Matrix4; - /** - * Pre-multiplies this matrix by the given 4x4 matrix. - * - * @param {Matrix4} m - The matrix to multiply with. - * @return {Matrix4} A reference to this matrix. - */ - premultiply(m: Matrix4): Matrix4; - /** - * Multiples the given 4x4 matrices and stores the result - * in this matrix. - * - * @param {Matrix4} a - The first matrix. - * @param {Matrix4} b - The second matrix. - * @return {Matrix4} A reference to this matrix. - */ - multiplyMatrices(a: Matrix4, b: Matrix4): Matrix4; - /** - * Multiplies every component of the matrix by the given scalar. - * - * @param {number} s - The scalar. - * @return {Matrix4} A reference to this matrix. - */ - multiplyScalar(s: number): Matrix4; - /** - * Computes and returns the determinant of this matrix. - * - * Based on the method outlined [here](http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.html). - * - * @return {number} The determinant. - */ - determinant(): number; - /** - * Transposes this matrix in place. - * - * @return {Matrix4} A reference to this matrix. - */ - transpose(): Matrix4; - /** - * Sets the position component for this matrix from the given vector, - * without affecting the rest of the matrix. - * - * @param {number|Vector3} x - The x component of the vector or alternatively the vector object. - * @param {number} y - The y component of the vector. - * @param {number} z - The z component of the vector. - * @return {Matrix4} A reference to this matrix. - */ - setPosition(x: number | Vector3, y: number, z: number): Matrix4; - /** - * Inverts this matrix, using the [analytic method](https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution). - * You can not invert with a determinant of zero. If you attempt this, the method produces - * a zero matrix instead. - * - * @return {Matrix4} A reference to this matrix. - */ - invert(): Matrix4; - /** - * Multiplies the columns of this matrix by the given vector. - * - * @param {Vector3} v - The scale vector. - * @return {Matrix4} A reference to this matrix. - */ - scale(v: Vector3): Matrix4; - /** - * Gets the maximum scale value of the three axes. - * - * @return {number} The maximum scale. - */ - getMaxScaleOnAxis(): number; - /** - * Sets this matrix as a translation transform from the given vector. - * - * @param {number|Vector3} x - The amount to translate in the X axis or alternatively a translation vector. - * @param {number} y - The amount to translate in the Y axis. - * @param {number} z - The amount to translate in the z axis. - * @return {Matrix4} A reference to this matrix. - */ - makeTranslation(x: number | Vector3, y: number, z: number): Matrix4; - /** - * Sets this matrix as a rotational transformation around the X axis by - * the given angle. - * - * @param {number} theta - The rotation in radians. - * @return {Matrix4} A reference to this matrix. - */ - makeRotationX(theta: number): Matrix4; - /** - * Sets this matrix as a rotational transformation around the Y axis by - * the given angle. - * - * @param {number} theta - The rotation in radians. - * @return {Matrix4} A reference to this matrix. - */ - makeRotationY(theta: number): Matrix4; - /** - * Sets this matrix as a rotational transformation around the Z axis by - * the given angle. - * - * @param {number} theta - The rotation in radians. - * @return {Matrix4} A reference to this matrix. - */ - makeRotationZ(theta: number): Matrix4; - /** - * Sets this matrix as a rotational transformation around the given axis by - * the given angle. - * - * This is a somewhat controversial but mathematically sound alternative to - * rotating via Quaternions. See the discussion [here](https://www.gamedev.net/articles/programming/math-and-physics/do-we-really-need-quaternions-r1199). - * - * @param {Vector3} axis - The normalized rotation axis. - * @param {number} angle - The rotation in radians. - * @return {Matrix4} A reference to this matrix. - */ - makeRotationAxis(axis: Vector3, angle: number): Matrix4; - /** - * Sets this matrix as a scale transformation. - * - * @param {number} x - The amount to scale in the X axis. - * @param {number} y - The amount to scale in the Y axis. - * @param {number} z - The amount to scale in the Z axis. - * @return {Matrix4} A reference to this matrix. - */ - makeScale(x: number, y: number, z: number): Matrix4; - /** - * Sets this matrix as a shear transformation. - * - * @param {number} xy - The amount to shear X by Y. - * @param {number} xz - The amount to shear X by Z. - * @param {number} yx - The amount to shear Y by X. - * @param {number} yz - The amount to shear Y by Z. - * @param {number} zx - The amount to shear Z by X. - * @param {number} zy - The amount to shear Z by Y. - * @return {Matrix4} A reference to this matrix. - */ - makeShear(xy: number, xz: number, yx: number, yz: number, zx: number, zy: number): Matrix4; - /** - * Sets this matrix to the transformation composed of the given position, - * rotation (Quaternion) and scale. - * - * @param {Vector3} position - The position vector. - * @param {Quaternion} quaternion - The rotation as a Quaternion. - * @param {Vector3} scale - The scale vector. - * @return {Matrix4} A reference to this matrix. - */ - compose(position: Vector3, quaternion: Quaternion, scale: Vector3): Matrix4; - /** - * Decomposes this matrix into its position, rotation and scale components - * and provides the result in the given objects. - * - * Note: Not all matrices are decomposable in this way. For example, if an - * object has a non-uniformly scaled parent, then the object's world matrix - * may not be decomposable, and this method may not be appropriate. - * - * @param {Vector3} position - The position vector. - * @param {Quaternion} quaternion - The rotation as a Quaternion. - * @param {Vector3} scale - The scale vector. - * @return {Matrix4} A reference to this matrix. - */ - decompose(position: Vector3, quaternion: Quaternion, scale: Vector3): Matrix4; - /** - * Creates a perspective projection matrix. This is used internally by - * {@link PerspectiveCamera#updateProjectionMatrix}. - - * @param {number} left - Left boundary of the viewing frustum at the near plane. - * @param {number} right - Right boundary of the viewing frustum at the near plane. - * @param {number} top - Top boundary of the viewing frustum at the near plane. - * @param {number} bottom - Bottom boundary of the viewing frustum at the near plane. - * @param {number} near - The distance from the camera to the near plane. - * @param {number} far - The distance from the camera to the far plane. - * @param {(WebGLCoordinateSystem|WebGPUCoordinateSystem)} [coordinateSystem=WebGLCoordinateSystem] - The coordinate system. - * @param {boolean} [reversedDepth=false] - Whether to use a reversed depth. - * @return {Matrix4} A reference to this matrix. - */ - makePerspective(left: number, right: number, top: number, bottom: number, near: number, far: number, coordinateSystem?: (number | number), reversedDepth?: boolean): Matrix4; - /** - * Creates a orthographic projection matrix. This is used internally by - * {@link OrthographicCamera#updateProjectionMatrix}. - - * @param {number} left - Left boundary of the viewing frustum at the near plane. - * @param {number} right - Right boundary of the viewing frustum at the near plane. - * @param {number} top - Top boundary of the viewing frustum at the near plane. - * @param {number} bottom - Bottom boundary of the viewing frustum at the near plane. - * @param {number} near - The distance from the camera to the near plane. - * @param {number} far - The distance from the camera to the far plane. - * @param {(WebGLCoordinateSystem|WebGPUCoordinateSystem)} [coordinateSystem=WebGLCoordinateSystem] - The coordinate system. - * @param {boolean} [reversedDepth=false] - Whether to use a reversed depth. - * @return {Matrix4} A reference to this matrix. - */ - makeOrthographic(left: number, right: number, top: number, bottom: number, near: number, far: number, coordinateSystem?: (number | number), reversedDepth?: boolean): Matrix4; - /** - * Returns `true` if this matrix is equal with the given one. - * - * @param {Matrix4} matrix - The matrix to test for equality. - * @return {boolean} Whether this matrix is equal with the given one. - */ - equals(matrix: Matrix4): boolean; - /** - * Sets the elements of the matrix from the given array. - * - * @param {Array} array - The matrix elements in column-major order. - * @param {number} [offset=0] - Index of the first element in the array. - * @return {Matrix4} A reference to this matrix. - */ - fromArray(array: Array, offset?: number): Matrix4; - /** - * Writes the elements of this matrix to the given array. If no array is provided, - * the method returns a new instance. - * - * @param {Array} [array=[]] - The target array holding the matrix elements in column-major order. - * @param {number} [offset=0] - Index of the first element in the array. - * @return {Array} The matrix elements in column-major order. - */ - toArray(array?: Array, offset?: number): Array; -} -import { Vector3 } from './Vector3.js'; diff --git a/jsdoc-testing/jsdoc/math/Plane.d.ts b/jsdoc-testing/jsdoc/math/Plane.d.ts deleted file mode 100644 index 7cf5d9a16..000000000 --- a/jsdoc-testing/jsdoc/math/Plane.d.ts +++ /dev/null @@ -1,189 +0,0 @@ -/** - * A two dimensional surface that extends infinitely in 3D space, represented - * in [Hessian normal form](http://mathworld.wolfram.com/HessianNormalForm.html) - * by a unit length normal vector and a constant. - */ -export class Plane { - /** - * Constructs a new plane. - * - * @param {Vector3} [normal=(1,0,0)] - A unit length vector defining the normal of the plane. - * @param {number} [constant=0] - The signed distance from the origin to the plane. - */ - constructor(normal?: Vector3, constant?: number); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isPlane: boolean; - /** - * A unit length vector defining the normal of the plane. - * - * @type {Vector3} - */ - normal: Vector3; - /** - * The signed distance from the origin to the plane. - * - * @type {number} - * @default 0 - */ - constant: number; - /** - * Sets the plane components by copying the given values. - * - * @param {Vector3} normal - The normal. - * @param {number} constant - The constant. - * @return {Plane} A reference to this plane. - */ - set(normal: Vector3, constant: number): Plane; - /** - * Sets the plane components by defining `x`, `y`, `z` as the - * plane normal and `w` as the constant. - * - * @param {number} x - The value for the normal's x component. - * @param {number} y - The value for the normal's y component. - * @param {number} z - The value for the normal's z component. - * @param {number} w - The constant value. - * @return {Plane} A reference to this plane. - */ - setComponents(x: number, y: number, z: number, w: number): Plane; - /** - * Sets the plane from the given normal and coplanar point (that is a point - * that lies onto the plane). - * - * @param {Vector3} normal - The normal. - * @param {Vector3} point - A coplanar point. - * @return {Plane} A reference to this plane. - */ - setFromNormalAndCoplanarPoint(normal: Vector3, point: Vector3): Plane; - /** - * Sets the plane from three coplanar points. The winding order is - * assumed to be counter-clockwise, and determines the direction of - * the plane normal. - * - * @param {Vector3} a - The first coplanar point. - * @param {Vector3} b - The second coplanar point. - * @param {Vector3} c - The third coplanar point. - * @return {Plane} A reference to this plane. - */ - setFromCoplanarPoints(a: Vector3, b: Vector3, c: Vector3): Plane; - /** - * Copies the values of the given plane to this instance. - * - * @param {Plane} plane - The plane to copy. - * @return {Plane} A reference to this plane. - */ - copy(plane: Plane): Plane; - /** - * Normalizes the plane normal and adjusts the constant accordingly. - * - * @return {Plane} A reference to this plane. - */ - normalize(): Plane; - /** - * Negates both the plane normal and the constant. - * - * @return {Plane} A reference to this plane. - */ - negate(): Plane; - /** - * Returns the signed distance from the given point to this plane. - * - * @param {Vector3} point - The point to compute the distance for. - * @return {number} The signed distance. - */ - distanceToPoint(point: Vector3): number; - /** - * Returns the signed distance from the given sphere to this plane. - * - * @param {Sphere} sphere - The sphere to compute the distance for. - * @return {number} The signed distance. - */ - distanceToSphere(sphere: Sphere): number; - /** - * Projects a the given point onto the plane. - * - * @param {Vector3} point - The point to project. - * @param {Vector3} target - The target vector that is used to store the method's result. - * @return {Vector3} The projected point on the plane. - */ - projectPoint(point: Vector3, target: Vector3): Vector3; - /** - * Returns the intersection point of the passed line and the plane. Returns - * `null` if the line does not intersect. Returns the line's starting point if - * the line is coplanar with the plane. - * - * @param {Line3} line - The line to compute the intersection for. - * @param {Vector3} target - The target vector that is used to store the method's result. - * @return {?Vector3} The intersection point. - */ - intersectLine(line: Line3, target: Vector3): Vector3 | null; - /** - * Returns `true` if the given line segment intersects with (passes through) the plane. - * - * @param {Line3} line - The line to test. - * @return {boolean} Whether the given line segment intersects with the plane or not. - */ - intersectsLine(line: Line3): boolean; - /** - * Returns `true` if the given bounding box intersects with the plane. - * - * @param {Box3} box - The bounding box to test. - * @return {boolean} Whether the given bounding box intersects with the plane or not. - */ - intersectsBox(box: Box3): boolean; - /** - * Returns `true` if the given bounding sphere intersects with the plane. - * - * @param {Sphere} sphere - The bounding sphere to test. - * @return {boolean} Whether the given bounding sphere intersects with the plane or not. - */ - intersectsSphere(sphere: Sphere): boolean; - /** - * Returns a coplanar vector to the plane, by calculating the - * projection of the normal at the origin onto the plane. - * - * @param {Vector3} target - The target vector that is used to store the method's result. - * @return {Vector3} The coplanar point. - */ - coplanarPoint(target: Vector3): Vector3; - /** - * Apply a 4x4 matrix to the plane. The matrix must be an affine, homogeneous transform. - * - * The optional normal matrix can be pre-computed like so: - * ```js - * const optionalNormalMatrix = new THREE.Matrix3().getNormalMatrix( matrix ); - * ``` - * - * @param {Matrix4} matrix - The transformation matrix. - * @param {Matrix4} [optionalNormalMatrix] - A pre-computed normal matrix. - * @return {Plane} A reference to this plane. - */ - applyMatrix4(matrix: Matrix4, optionalNormalMatrix?: Matrix4): Plane; - /** - * Translates the plane by the distance defined by the given offset vector. - * Note that this only affects the plane constant and will not affect the normal vector. - * - * @param {Vector3} offset - The offset vector. - * @return {Plane} A reference to this plane. - */ - translate(offset: Vector3): Plane; - /** - * Returns `true` if this plane is equal with the given one. - * - * @param {Plane} plane - The plane to test for equality. - * @return {boolean} Whether this plane is equal with the given one. - */ - equals(plane: Plane): boolean; - /** - * Returns a new plane with copied values from this instance. - * - * @return {Plane} A clone of this instance. - */ - clone(): Plane; -} -import { Vector3 } from './Vector3.js'; diff --git a/jsdoc-testing/jsdoc/math/Quaternion.d.ts b/jsdoc-testing/jsdoc/math/Quaternion.d.ts deleted file mode 100644 index 214548cde..000000000 --- a/jsdoc-testing/jsdoc/math/Quaternion.d.ts +++ /dev/null @@ -1,310 +0,0 @@ -/** - * Class for representing a Quaternion. Quaternions are used in three.js to represent rotations. - * - * Iterating through a vector instance will yield its components `(x, y, z, w)` in - * the corresponding order. - * - * Note that three.js expects Quaternions to be normalized. - * ```js - * const quaternion = new THREE.Quaternion(); - * quaternion.setFromAxisAngle( new THREE.Vector3( 0, 1, 0 ), Math.PI / 2 ); - * - * const vector = new THREE.Vector3( 1, 0, 0 ); - * vector.applyQuaternion( quaternion ); - * ``` - */ -export class Quaternion { - /** - * Interpolates between two quaternions via SLERP. This implementation assumes the - * quaternion data are managed in flat arrays. - * - * @param {Array} dst - The destination array. - * @param {number} dstOffset - An offset into the destination array. - * @param {Array} src0 - The source array of the first quaternion. - * @param {number} srcOffset0 - An offset into the first source array. - * @param {Array} src1 - The source array of the second quaternion. - * @param {number} srcOffset1 - An offset into the second source array. - * @param {number} t - The interpolation factor. A value in the range `[0,1]` will interpolate. A value outside the range `[0,1]` will extrapolate. - * @see {@link Quaternion#slerp} - */ - static slerpFlat(dst: Array, dstOffset: number, src0: Array, srcOffset0: number, src1: Array, srcOffset1: number, t: number): void; - /** - * Multiplies two quaternions. This implementation assumes the quaternion data are managed - * in flat arrays. - * - * @param {Array} dst - The destination array. - * @param {number} dstOffset - An offset into the destination array. - * @param {Array} src0 - The source array of the first quaternion. - * @param {number} srcOffset0 - An offset into the first source array. - * @param {Array} src1 - The source array of the second quaternion. - * @param {number} srcOffset1 - An offset into the second source array. - * @return {Array} The destination array. - * @see {@link Quaternion#multiplyQuaternions}. - */ - static multiplyQuaternionsFlat(dst: Array, dstOffset: number, src0: Array, srcOffset0: number, src1: Array, srcOffset1: number): Array; - /** - * Constructs a new quaternion. - * - * @param {number} [x=0] - The x value of this quaternion. - * @param {number} [y=0] - The y value of this quaternion. - * @param {number} [z=0] - The z value of this quaternion. - * @param {number} [w=1] - The w value of this quaternion. - */ - constructor(x?: number, y?: number, z?: number, w?: number); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isQuaternion: boolean; - _x: number; - _y: number; - _z: number; - _w: number; - set x(value: number); - /** - * The x value of this quaternion. - * - * @type {number} - * @default 0 - */ - get x(): number; - set y(value: number); - /** - * The y value of this quaternion. - * - * @type {number} - * @default 0 - */ - get y(): number; - set z(value: number); - /** - * The z value of this quaternion. - * - * @type {number} - * @default 0 - */ - get z(): number; - set w(value: number); - /** - * The w value of this quaternion. - * - * @type {number} - * @default 1 - */ - get w(): number; - /** - * Sets the quaternion components. - * - * @param {number} x - The x value of this quaternion. - * @param {number} y - The y value of this quaternion. - * @param {number} z - The z value of this quaternion. - * @param {number} w - The w value of this quaternion. - * @return {Quaternion} A reference to this quaternion. - */ - set(x: number, y: number, z: number, w: number): Quaternion; - /** - * Returns a new quaternion with copied values from this instance. - * - * @return {Quaternion} A clone of this instance. - */ - clone(): Quaternion; - /** - * Copies the values of the given quaternion to this instance. - * - * @param {Quaternion} quaternion - The quaternion to copy. - * @return {Quaternion} A reference to this quaternion. - */ - copy(quaternion: Quaternion): Quaternion; - /** - * Sets this quaternion from the rotation specified by the given - * Euler angles. - * - * @param {Euler} euler - The Euler angles. - * @param {boolean} [update=true] - Whether the internal `onChange` callback should be executed or not. - * @return {Quaternion} A reference to this quaternion. - */ - setFromEuler(euler: Euler, update?: boolean): Quaternion; - /** - * Sets this quaternion from the given axis and angle. - * - * @param {Vector3} axis - The normalized axis. - * @param {number} angle - The angle in radians. - * @return {Quaternion} A reference to this quaternion. - */ - setFromAxisAngle(axis: Vector3, angle: number): Quaternion; - /** - * Sets this quaternion from the given rotation matrix. - * - * @param {Matrix4} m - A 4x4 matrix of which the upper 3x3 of matrix is a pure rotation matrix (i.e. unscaled). - * @return {Quaternion} A reference to this quaternion. - */ - setFromRotationMatrix(m: Matrix4): Quaternion; - /** - * Sets this quaternion to the rotation required to rotate the direction vector - * `vFrom` to the direction vector `vTo`. - * - * @param {Vector3} vFrom - The first (normalized) direction vector. - * @param {Vector3} vTo - The second (normalized) direction vector. - * @return {Quaternion} A reference to this quaternion. - */ - setFromUnitVectors(vFrom: Vector3, vTo: Vector3): Quaternion; - /** - * Returns the angle between this quaternion and the given one in radians. - * - * @param {Quaternion} q - The quaternion to compute the angle with. - * @return {number} The angle in radians. - */ - angleTo(q: Quaternion): number; - /** - * Rotates this quaternion by a given angular step to the given quaternion. - * The method ensures that the final quaternion will not overshoot `q`. - * - * @param {Quaternion} q - The target quaternion. - * @param {number} step - The angular step in radians. - * @return {Quaternion} A reference to this quaternion. - */ - rotateTowards(q: Quaternion, step: number): Quaternion; - /** - * Sets this quaternion to the identity quaternion; that is, to the - * quaternion that represents "no rotation". - * - * @return {Quaternion} A reference to this quaternion. - */ - identity(): Quaternion; - /** - * Inverts this quaternion via {@link Quaternion#conjugate}. The - * quaternion is assumed to have unit length. - * - * @return {Quaternion} A reference to this quaternion. - */ - invert(): Quaternion; - /** - * Returns the rotational conjugate of this quaternion. The conjugate of a - * quaternion represents the same rotation in the opposite direction about - * the rotational axis. - * - * @return {Quaternion} A reference to this quaternion. - */ - conjugate(): Quaternion; - /** - * Calculates the dot product of this quaternion and the given one. - * - * @param {Quaternion} v - The quaternion to compute the dot product with. - * @return {number} The result of the dot product. - */ - dot(v: Quaternion): number; - /** - * Computes the squared Euclidean length (straight-line length) of this quaternion, - * considered as a 4 dimensional vector. This can be useful if you are comparing the - * lengths of two quaternions, as this is a slightly more efficient calculation than - * {@link Quaternion#length}. - * - * @return {number} The squared Euclidean length. - */ - lengthSq(): number; - /** - * Computes the Euclidean length (straight-line length) of this quaternion, - * considered as a 4 dimensional vector. - * - * @return {number} The Euclidean length. - */ - length(): number; - /** - * Normalizes this quaternion - that is, calculated the quaternion that performs - * the same rotation as this one, but has a length equal to `1`. - * - * @return {Quaternion} A reference to this quaternion. - */ - normalize(): Quaternion; - /** - * Multiplies this quaternion by the given one. - * - * @param {Quaternion} q - The quaternion. - * @return {Quaternion} A reference to this quaternion. - */ - multiply(q: Quaternion): Quaternion; - /** - * Pre-multiplies this quaternion by the given one. - * - * @param {Quaternion} q - The quaternion. - * @return {Quaternion} A reference to this quaternion. - */ - premultiply(q: Quaternion): Quaternion; - /** - * Multiplies the given quaternions and stores the result in this instance. - * - * @param {Quaternion} a - The first quaternion. - * @param {Quaternion} b - The second quaternion. - * @return {Quaternion} A reference to this quaternion. - */ - multiplyQuaternions(a: Quaternion, b: Quaternion): Quaternion; - /** - * Performs a spherical linear interpolation between this quaternion and the target quaternion. - * - * @param {Quaternion} qb - The target quaternion. - * @param {number} t - The interpolation factor. A value in the range `[0,1]` will interpolate. A value outside the range `[0,1]` will extrapolate. - * @return {Quaternion} A reference to this quaternion. - */ - slerp(qb: Quaternion, t: number): Quaternion; - /** - * Performs a spherical linear interpolation between the given quaternions - * and stores the result in this quaternion. - * - * @param {Quaternion} qa - The source quaternion. - * @param {Quaternion} qb - The target quaternion. - * @param {number} t - The interpolation factor in the closed interval `[0, 1]`. - * @return {Quaternion} A reference to this quaternion. - */ - slerpQuaternions(qa: Quaternion, qb: Quaternion, t: number): Quaternion; - /** - * Sets this quaternion to a uniformly random, normalized quaternion. - * - * @return {Quaternion} A reference to this quaternion. - */ - random(): Quaternion; - /** - * Returns `true` if this quaternion is equal with the given one. - * - * @param {Quaternion} quaternion - The quaternion to test for equality. - * @return {boolean} Whether this quaternion is equal with the given one. - */ - equals(quaternion: Quaternion): boolean; - /** - * Sets this quaternion's components from the given array. - * - * @param {Array} array - An array holding the quaternion component values. - * @param {number} [offset=0] - The offset into the array. - * @return {Quaternion} A reference to this quaternion. - */ - fromArray(array: Array, offset?: number): Quaternion; - /** - * Writes the components of this quaternion to the given array. If no array is provided, - * the method returns a new instance. - * - * @param {Array} [array=[]] - The target array holding the quaternion components. - * @param {number} [offset=0] - Index of the first element in the array. - * @return {Array} The quaternion components. - */ - toArray(array?: Array, offset?: number): Array; - /** - * Sets the components of this quaternion from the given buffer attribute. - * - * @param {BufferAttribute} attribute - The buffer attribute holding quaternion data. - * @param {number} index - The index into the attribute. - * @return {Quaternion} A reference to this quaternion. - */ - fromBufferAttribute(attribute: BufferAttribute, index: number): Quaternion; - /** - * This methods defines the serialization result of this class. Returns the - * numerical elements of this quaternion in an array of format `[x, y, z, w]`. - * - * @return {Array} The serialized quaternion. - */ - toJSON(): Array; - _onChange(callback: any): this; - _onChangeCallback(): void; - [Symbol.iterator](): Generator; -} diff --git a/jsdoc-testing/jsdoc/math/Ray.d.ts b/jsdoc-testing/jsdoc/math/Ray.d.ts deleted file mode 100644 index 02531c54e..000000000 --- a/jsdoc-testing/jsdoc/math/Ray.d.ts +++ /dev/null @@ -1,185 +0,0 @@ -/** - * A ray that emits from an origin in a certain direction. The class is used by - * {@link Raycaster} to assist with raycasting. Raycasting is used for - * mouse picking (working out what objects in the 3D space the mouse is over) - * amongst other things. - */ -export class Ray { - /** - * Constructs a new ray. - * - * @param {Vector3} [origin=(0,0,0)] - The origin of the ray. - * @param {Vector3} [direction=(0,0,-1)] - The (normalized) direction of the ray. - */ - constructor(origin?: Vector3, direction?: Vector3); - /** - * The origin of the ray. - * - * @type {Vector3} - */ - origin: Vector3; - /** - * The (normalized) direction of the ray. - * - * @type {Vector3} - */ - direction: Vector3; - /** - * Sets the ray's components by copying the given values. - * - * @param {Vector3} origin - The origin. - * @param {Vector3} direction - The direction. - * @return {Ray} A reference to this ray. - */ - set(origin: Vector3, direction: Vector3): Ray; - /** - * Copies the values of the given ray to this instance. - * - * @param {Ray} ray - The ray to copy. - * @return {Ray} A reference to this ray. - */ - copy(ray: Ray): Ray; - /** - * Returns a vector that is located at a given distance along this ray. - * - * @param {number} t - The distance along the ray to retrieve a position for. - * @param {Vector3} target - The target vector that is used to store the method's result. - * @return {Vector3} A position on the ray. - */ - at(t: number, target: Vector3): Vector3; - /** - * Adjusts the direction of the ray to point at the given vector in world space. - * - * @param {Vector3} v - The target position. - * @return {Ray} A reference to this ray. - */ - lookAt(v: Vector3): Ray; - /** - * Shift the origin of this ray along its direction by the given distance. - * - * @param {number} t - The distance along the ray to interpolate. - * @return {Ray} A reference to this ray. - */ - recast(t: number): Ray; - /** - * Returns the point along this ray that is closest to the given point. - * - * @param {Vector3} point - A point in 3D space to get the closet location on the ray for. - * @param {Vector3} target - The target vector that is used to store the method's result. - * @return {Vector3} The closest point on this ray. - */ - closestPointToPoint(point: Vector3, target: Vector3): Vector3; - /** - * Returns the distance of the closest approach between this ray and the given point. - * - * @param {Vector3} point - A point in 3D space to compute the distance to. - * @return {number} The distance. - */ - distanceToPoint(point: Vector3): number; - /** - * Returns the squared distance of the closest approach between this ray and the given point. - * - * @param {Vector3} point - A point in 3D space to compute the distance to. - * @return {number} The squared distance. - */ - distanceSqToPoint(point: Vector3): number; - /** - * Returns the squared distance between this ray and the given line segment. - * - * @param {Vector3} v0 - The start point of the line segment. - * @param {Vector3} v1 - The end point of the line segment. - * @param {Vector3} [optionalPointOnRay] - When provided, it receives the point on this ray that is closest to the segment. - * @param {Vector3} [optionalPointOnSegment] - When provided, it receives the point on the line segment that is closest to this ray. - * @return {number} The squared distance. - */ - distanceSqToSegment(v0: Vector3, v1: Vector3, optionalPointOnRay?: Vector3, optionalPointOnSegment?: Vector3): number; - /** - * Intersects this ray with the given sphere, returning the intersection - * point or `null` if there is no intersection. - * - * @param {Sphere} sphere - The sphere to intersect. - * @param {Vector3} target - The target vector that is used to store the method's result. - * @return {?Vector3} The intersection point. - */ - intersectSphere(sphere: Sphere, target: Vector3): Vector3 | null; - /** - * Returns `true` if this ray intersects with the given sphere. - * - * @param {Sphere} sphere - The sphere to intersect. - * @return {boolean} Whether this ray intersects with the given sphere or not. - */ - intersectsSphere(sphere: Sphere): boolean; - /** - * Computes the distance from the ray's origin to the given plane. Returns `null` if the ray - * does not intersect with the plane. - * - * @param {Plane} plane - The plane to compute the distance to. - * @return {?number} Whether this ray intersects with the given sphere or not. - */ - distanceToPlane(plane: Plane): number | null; - /** - * Intersects this ray with the given plane, returning the intersection - * point or `null` if there is no intersection. - * - * @param {Plane} plane - The plane to intersect. - * @param {Vector3} target - The target vector that is used to store the method's result. - * @return {?Vector3} The intersection point. - */ - intersectPlane(plane: Plane, target: Vector3): Vector3 | null; - /** - * Returns `true` if this ray intersects with the given plane. - * - * @param {Plane} plane - The plane to intersect. - * @return {boolean} Whether this ray intersects with the given plane or not. - */ - intersectsPlane(plane: Plane): boolean; - /** - * Intersects this ray with the given bounding box, returning the intersection - * point or `null` if there is no intersection. - * - * @param {Box3} box - The box to intersect. - * @param {Vector3} target - The target vector that is used to store the method's result. - * @return {?Vector3} The intersection point. - */ - intersectBox(box: Box3, target: Vector3): Vector3 | null; - /** - * Returns `true` if this ray intersects with the given box. - * - * @param {Box3} box - The box to intersect. - * @return {boolean} Whether this ray intersects with the given box or not. - */ - intersectsBox(box: Box3): boolean; - /** - * Intersects this ray with the given triangle, returning the intersection - * point or `null` if there is no intersection. - * - * @param {Vector3} a - The first vertex of the triangle. - * @param {Vector3} b - The second vertex of the triangle. - * @param {Vector3} c - The third vertex of the triangle. - * @param {boolean} backfaceCulling - Whether to use backface culling or not. - * @param {Vector3} target - The target vector that is used to store the method's result. - * @return {?Vector3} The intersection point. - */ - intersectTriangle(a: Vector3, b: Vector3, c: Vector3, backfaceCulling: boolean, target: Vector3): Vector3 | null; - /** - * Transforms this ray with the given 4x4 transformation matrix. - * - * @param {Matrix4} matrix4 - The transformation matrix. - * @return {Ray} A reference to this ray. - */ - applyMatrix4(matrix4: Matrix4): Ray; - /** - * Returns `true` if this ray is equal with the given one. - * - * @param {Ray} ray - The ray to test for equality. - * @return {boolean} Whether this ray is equal with the given one. - */ - equals(ray: Ray): boolean; - /** - * Returns a new ray with copied values from this instance. - * - * @return {Ray} A clone of this instance. - */ - clone(): Ray; -} -import { Vector3 } from './Vector3.js'; diff --git a/jsdoc-testing/jsdoc/math/Sphere.d.ts b/jsdoc-testing/jsdoc/math/Sphere.d.ts deleted file mode 100644 index 5d7e4ac67..000000000 --- a/jsdoc-testing/jsdoc/math/Sphere.d.ts +++ /dev/null @@ -1,185 +0,0 @@ -/** - * An analytical 3D sphere defined by a center and radius. This class is mainly - * used as a Bounding Sphere for 3D objects. - */ -export class Sphere { - /** - * Constructs a new sphere. - * - * @param {Vector3} [center=(0,0,0)] - The center of the sphere - * @param {number} [radius=-1] - The radius of the sphere. - */ - constructor(center?: Vector3, radius?: number); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isSphere: boolean; - /** - * The center of the sphere - * - * @type {Vector3} - */ - center: Vector3; - /** - * The radius of the sphere. - * - * @type {number} - */ - radius: number; - /** - * Sets the sphere's components by copying the given values. - * - * @param {Vector3} center - The center. - * @param {number} radius - The radius. - * @return {Sphere} A reference to this sphere. - */ - set(center: Vector3, radius: number): Sphere; - /** - * Computes the minimum bounding sphere for list of points. - * If the optional center point is given, it is used as the sphere's - * center. Otherwise, the center of the axis-aligned bounding box - * encompassing the points is calculated. - * - * @param {Array} points - A list of points in 3D space. - * @param {Vector3} [optionalCenter] - The center of the sphere. - * @return {Sphere} A reference to this sphere. - */ - setFromPoints(points: Array, optionalCenter?: Vector3): Sphere; - /** - * Copies the values of the given sphere to this instance. - * - * @param {Sphere} sphere - The sphere to copy. - * @return {Sphere} A reference to this sphere. - */ - copy(sphere: Sphere): Sphere; - /** - * Returns `true` if the sphere is empty (the radius set to a negative number). - * - * Spheres with a radius of `0` contain only their center point and are not - * considered to be empty. - * - * @return {boolean} Whether this sphere is empty or not. - */ - isEmpty(): boolean; - /** - * Makes this sphere empty which means in encloses a zero space in 3D. - * - * @return {Sphere} A reference to this sphere. - */ - makeEmpty(): Sphere; - /** - * Returns `true` if this sphere contains the given point inclusive of - * the surface of the sphere. - * - * @param {Vector3} point - The point to check. - * @return {boolean} Whether this sphere contains the given point or not. - */ - containsPoint(point: Vector3): boolean; - /** - * Returns the closest distance from the boundary of the sphere to the - * given point. If the sphere contains the point, the distance will - * be negative. - * - * @param {Vector3} point - The point to compute the distance to. - * @return {number} The distance to the point. - */ - distanceToPoint(point: Vector3): number; - /** - * Returns `true` if this sphere intersects with the given one. - * - * @param {Sphere} sphere - The sphere to test. - * @return {boolean} Whether this sphere intersects with the given one or not. - */ - intersectsSphere(sphere: Sphere): boolean; - /** - * Returns `true` if this sphere intersects with the given box. - * - * @param {Box3} box - The box to test. - * @return {boolean} Whether this sphere intersects with the given box or not. - */ - intersectsBox(box: Box3): boolean; - /** - * Returns `true` if this sphere intersects with the given plane. - * - * @param {Plane} plane - The plane to test. - * @return {boolean} Whether this sphere intersects with the given plane or not. - */ - intersectsPlane(plane: Plane): boolean; - /** - * Clamps a point within the sphere. If the point is outside the sphere, it - * will clamp it to the closest point on the edge of the sphere. Points - * already inside the sphere will not be affected. - * - * @param {Vector3} point - The plane to clamp. - * @param {Vector3} target - The target vector that is used to store the method's result. - * @return {Vector3} The clamped point. - */ - clampPoint(point: Vector3, target: Vector3): Vector3; - /** - * Returns a bounding box that encloses this sphere. - * - * @param {Box3} target - The target box that is used to store the method's result. - * @return {Box3} The bounding box that encloses this sphere. - */ - getBoundingBox(target: Box3): Box3; - /** - * Transforms this sphere with the given 4x4 transformation matrix. - * - * @param {Matrix4} matrix - The transformation matrix. - * @return {Sphere} A reference to this sphere. - */ - applyMatrix4(matrix: Matrix4): Sphere; - /** - * Translates the sphere's center by the given offset. - * - * @param {Vector3} offset - The offset. - * @return {Sphere} A reference to this sphere. - */ - translate(offset: Vector3): Sphere; - /** - * Expands the boundaries of this sphere to include the given point. - * - * @param {Vector3} point - The point to include. - * @return {Sphere} A reference to this sphere. - */ - expandByPoint(point: Vector3): Sphere; - /** - * Expands this sphere to enclose both the original sphere and the given sphere. - * - * @param {Sphere} sphere - The sphere to include. - * @return {Sphere} A reference to this sphere. - */ - union(sphere: Sphere): Sphere; - /** - * Returns `true` if this sphere is equal with the given one. - * - * @param {Sphere} sphere - The sphere to test for equality. - * @return {boolean} Whether this bounding sphere is equal with the given one. - */ - equals(sphere: Sphere): boolean; - /** - * Returns a new sphere with copied values from this instance. - * - * @return {Sphere} A clone of this instance. - */ - clone(): Sphere; - /** - * Returns a serialized structure of the bounding sphere. - * - * @return {Object} Serialized structure with fields representing the object state. - */ - toJSON(): Object; - /** - * Returns a serialized structure of the bounding sphere. - * - * @param {Object} json - The serialized json to set the sphere from. - * @return {Sphere} A reference to this bounding sphere. - */ - fromJSON(json: Object): Sphere; -} -import { Vector3 } from './Vector3.js'; -import { Box3 } from './Box3.js'; diff --git a/jsdoc-testing/jsdoc/math/SphericalHarmonics3.d.ts b/jsdoc-testing/jsdoc/math/SphericalHarmonics3.d.ts deleted file mode 100644 index 307ff49fa..000000000 --- a/jsdoc-testing/jsdoc/math/SphericalHarmonics3.d.ts +++ /dev/null @@ -1,131 +0,0 @@ -/** - * Represents a third-order spherical harmonics (SH). Light probes use this class - * to encode lighting information. - * - * - Primary reference: {@link https://graphics.stanford.edu/papers/envmap/envmap.pdf} - * - Secondary reference: {@link https://www.ppsloan.org/publications/StupidSH36.pdf} - */ -export class SphericalHarmonics3 { - /** - * Computes the SH basis for the given normal vector. - * - * @param {Vector3} normal - The normal. - * @param {Array} shBasis - The target array holding the SH basis. - */ - static getBasisAt(normal: Vector3, shBasis: Array): void; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isSphericalHarmonics3: boolean; - /** - * An array holding the (9) SH coefficients. - * - * @type {Array} - */ - coefficients: Array; - /** - * Sets the given SH coefficients to this instance by copying - * the values. - * - * @param {Array} coefficients - The SH coefficients. - * @return {SphericalHarmonics3} A reference to this spherical harmonics. - */ - set(coefficients: Array): SphericalHarmonics3; - /** - * Sets all SH coefficients to `0`. - * - * @return {SphericalHarmonics3} A reference to this spherical harmonics. - */ - zero(): SphericalHarmonics3; - /** - * Returns the radiance in the direction of the given normal. - * - * @param {Vector3} normal - The normal vector (assumed to be unit length) - * @param {Vector3} target - The target vector that is used to store the method's result. - * @return {Vector3} The radiance. - */ - getAt(normal: Vector3, target: Vector3): Vector3; - /** - * Returns the irradiance (radiance convolved with cosine lobe) in the - * direction of the given normal. - * - * @param {Vector3} normal - The normal vector (assumed to be unit length) - * @param {Vector3} target - The target vector that is used to store the method's result. - * @return {Vector3} The irradiance. - */ - getIrradianceAt(normal: Vector3, target: Vector3): Vector3; - /** - * Adds the given SH to this instance. - * - * @param {SphericalHarmonics3} sh - The SH to add. - * @return {SphericalHarmonics3} A reference to this spherical harmonics. - */ - add(sh: SphericalHarmonics3): SphericalHarmonics3; - /** - * A convenience method for performing {@link SphericalHarmonics3#add} and - * {@link SphericalHarmonics3#scale} at once. - * - * @param {SphericalHarmonics3} sh - The SH to add. - * @param {number} s - The scale factor. - * @return {SphericalHarmonics3} A reference to this spherical harmonics. - */ - addScaledSH(sh: SphericalHarmonics3, s: number): SphericalHarmonics3; - /** - * Scales this SH by the given scale factor. - * - * @param {number} s - The scale factor. - * @return {SphericalHarmonics3} A reference to this spherical harmonics. - */ - scale(s: number): SphericalHarmonics3; - /** - * Linear interpolates between the given SH and this instance by the given - * alpha factor. - * - * @param {SphericalHarmonics3} sh - The SH to interpolate with. - * @param {number} alpha - The alpha factor. - * @return {SphericalHarmonics3} A reference to this spherical harmonics. - */ - lerp(sh: SphericalHarmonics3, alpha: number): SphericalHarmonics3; - /** - * Returns `true` if this spherical harmonics is equal with the given one. - * - * @param {SphericalHarmonics3} sh - The spherical harmonics to test for equality. - * @return {boolean} Whether this spherical harmonics is equal with the given one. - */ - equals(sh: SphericalHarmonics3): boolean; - /** - * Copies the values of the given spherical harmonics to this instance. - * - * @param {SphericalHarmonics3} sh - The spherical harmonics to copy. - * @return {SphericalHarmonics3} A reference to this spherical harmonics. - */ - copy(sh: SphericalHarmonics3): SphericalHarmonics3; - /** - * Returns a new spherical harmonics with copied values from this instance. - * - * @return {SphericalHarmonics3} A clone of this instance. - */ - clone(): SphericalHarmonics3; - /** - * Sets the SH coefficients of this instance from the given array. - * - * @param {Array} array - An array holding the SH coefficients. - * @param {number} [offset=0] - The array offset where to start copying. - * @return {SphericalHarmonics3} A clone of this instance. - */ - fromArray(array: Array, offset?: number): SphericalHarmonics3; - /** - * Returns an array with the SH coefficients, or copies them into the provided - * array. The coefficients are represented as numbers. - * - * @param {Array} [array=[]] - The target array. - * @param {number} [offset=0] - The array offset where to start copying. - * @return {Array} An array with flat SH coefficients. - */ - toArray(array?: Array, offset?: number): Array; -} -import { Vector3 } from './Vector3.js'; diff --git a/jsdoc-testing/jsdoc/math/Triangle.d.ts b/jsdoc-testing/jsdoc/math/Triangle.d.ts deleted file mode 100644 index 3841d3852..000000000 --- a/jsdoc-testing/jsdoc/math/Triangle.d.ts +++ /dev/null @@ -1,231 +0,0 @@ -/** - * A geometric triangle as defined by three vectors representing its three corners. - */ -export class Triangle { - /** - * Computes the normal vector of a triangle. - * - * @param {Vector3} a - The first corner of the triangle. - * @param {Vector3} b - The second corner of the triangle. - * @param {Vector3} c - The third corner of the triangle. - * @param {Vector3} target - The target vector that is used to store the method's result. - * @return {Vector3} The triangle's normal. - */ - static getNormal(a: Vector3, b: Vector3, c: Vector3, target: Vector3): Vector3; - /** - * Computes a barycentric coordinates from the given vector. - * Returns `null` if the triangle is degenerate. - * - * @param {Vector3} point - A point in 3D space. - * @param {Vector3} a - The first corner of the triangle. - * @param {Vector3} b - The second corner of the triangle. - * @param {Vector3} c - The third corner of the triangle. - * @param {Vector3} target - The target vector that is used to store the method's result. - * @return {?Vector3} The barycentric coordinates for the given point - */ - static getBarycoord(point: Vector3, a: Vector3, b: Vector3, c: Vector3, target: Vector3): Vector3 | null; - /** - * Returns `true` if the given point, when projected onto the plane of the - * triangle, lies within the triangle. - * - * @param {Vector3} point - The point in 3D space to test. - * @param {Vector3} a - The first corner of the triangle. - * @param {Vector3} b - The second corner of the triangle. - * @param {Vector3} c - The third corner of the triangle. - * @return {boolean} Whether the given point, when projected onto the plane of the - * triangle, lies within the triangle or not. - */ - static containsPoint(point: Vector3, a: Vector3, b: Vector3, c: Vector3): boolean; - /** - * Computes the value barycentrically interpolated for the given point on the - * triangle. Returns `null` if the triangle is degenerate. - * - * @param {Vector3} point - Position of interpolated point. - * @param {Vector3} p1 - The first corner of the triangle. - * @param {Vector3} p2 - The second corner of the triangle. - * @param {Vector3} p3 - The third corner of the triangle. - * @param {Vector3} v1 - Value to interpolate of first vertex. - * @param {Vector3} v2 - Value to interpolate of second vertex. - * @param {Vector3} v3 - Value to interpolate of third vertex. - * @param {Vector3} target - The target vector that is used to store the method's result. - * @return {?Vector3} The interpolated value. - */ - static getInterpolation(point: Vector3, p1: Vector3, p2: Vector3, p3: Vector3, v1: Vector3, v2: Vector3, v3: Vector3, target: Vector3): Vector3 | null; - /** - * Computes the value barycentrically interpolated for the given attribute and indices. - * - * @param {BufferAttribute} attr - The attribute to interpolate. - * @param {number} i1 - Index of first vertex. - * @param {number} i2 - Index of second vertex. - * @param {number} i3 - Index of third vertex. - * @param {Vector3} barycoord - The barycoordinate value to use to interpolate. - * @param {Vector3} target - The target vector that is used to store the method's result. - * @return {Vector3} The interpolated attribute value. - */ - static getInterpolatedAttribute(attr: BufferAttribute, i1: number, i2: number, i3: number, barycoord: Vector3, target: Vector3): Vector3; - /** - * Returns `true` if the triangle is oriented towards the given direction. - * - * @param {Vector3} a - The first corner of the triangle. - * @param {Vector3} b - The second corner of the triangle. - * @param {Vector3} c - The third corner of the triangle. - * @param {Vector3} direction - The (normalized) direction vector. - * @return {boolean} Whether the triangle is oriented towards the given direction or not. - */ - static isFrontFacing(a: Vector3, b: Vector3, c: Vector3, direction: Vector3): boolean; - /** - * Constructs a new triangle. - * - * @param {Vector3} [a=(0,0,0)] - The first corner of the triangle. - * @param {Vector3} [b=(0,0,0)] - The second corner of the triangle. - * @param {Vector3} [c=(0,0,0)] - The third corner of the triangle. - */ - constructor(a?: Vector3, b?: Vector3, c?: Vector3); - /** - * The first corner of the triangle. - * - * @type {Vector3} - */ - a: Vector3; - /** - * The second corner of the triangle. - * - * @type {Vector3} - */ - b: Vector3; - /** - * The third corner of the triangle. - * - * @type {Vector3} - */ - c: Vector3; - /** - * Sets the triangle's vertices by copying the given values. - * - * @param {Vector3} a - The first corner of the triangle. - * @param {Vector3} b - The second corner of the triangle. - * @param {Vector3} c - The third corner of the triangle. - * @return {Triangle} A reference to this triangle. - */ - set(a: Vector3, b: Vector3, c: Vector3): Triangle; - /** - * Sets the triangle's vertices by copying the given array values. - * - * @param {Array} points - An array with 3D points. - * @param {number} i0 - The array index representing the first corner of the triangle. - * @param {number} i1 - The array index representing the second corner of the triangle. - * @param {number} i2 - The array index representing the third corner of the triangle. - * @return {Triangle} A reference to this triangle. - */ - setFromPointsAndIndices(points: Array, i0: number, i1: number, i2: number): Triangle; - /** - * Sets the triangle's vertices by copying the given attribute values. - * - * @param {BufferAttribute} attribute - A buffer attribute with 3D points data. - * @param {number} i0 - The attribute index representing the first corner of the triangle. - * @param {number} i1 - The attribute index representing the second corner of the triangle. - * @param {number} i2 - The attribute index representing the third corner of the triangle. - * @return {Triangle} A reference to this triangle. - */ - setFromAttributeAndIndices(attribute: BufferAttribute, i0: number, i1: number, i2: number): Triangle; - /** - * Returns a new triangle with copied values from this instance. - * - * @return {Triangle} A clone of this instance. - */ - clone(): Triangle; - /** - * Copies the values of the given triangle to this instance. - * - * @param {Triangle} triangle - The triangle to copy. - * @return {Triangle} A reference to this triangle. - */ - copy(triangle: Triangle): Triangle; - /** - * Computes the area of the triangle. - * - * @return {number} The triangle's area. - */ - getArea(): number; - /** - * Computes the midpoint of the triangle. - * - * @param {Vector3} target - The target vector that is used to store the method's result. - * @return {Vector3} The triangle's midpoint. - */ - getMidpoint(target: Vector3): Vector3; - /** - * Computes the normal of the triangle. - * - * @param {Vector3} target - The target vector that is used to store the method's result. - * @return {Vector3} The triangle's normal. - */ - getNormal(target: Vector3): Vector3; - /** - * Computes a plane the triangle lies within. - * - * @param {Plane} target - The target vector that is used to store the method's result. - * @return {Plane} The plane the triangle lies within. - */ - getPlane(target: Plane): Plane; - /** - * Computes a barycentric coordinates from the given vector. - * Returns `null` if the triangle is degenerate. - * - * @param {Vector3} point - A point in 3D space. - * @param {Vector3} target - The target vector that is used to store the method's result. - * @return {?Vector3} The barycentric coordinates for the given point - */ - getBarycoord(point: Vector3, target: Vector3): Vector3 | null; - /** - * Computes the value barycentrically interpolated for the given point on the - * triangle. Returns `null` if the triangle is degenerate. - * - * @param {Vector3} point - Position of interpolated point. - * @param {Vector3} v1 - Value to interpolate of first vertex. - * @param {Vector3} v2 - Value to interpolate of second vertex. - * @param {Vector3} v3 - Value to interpolate of third vertex. - * @param {Vector3} target - The target vector that is used to store the method's result. - * @return {?Vector3} The interpolated value. - */ - getInterpolation(point: Vector3, v1: Vector3, v2: Vector3, v3: Vector3, target: Vector3): Vector3 | null; - /** - * Returns `true` if the given point, when projected onto the plane of the - * triangle, lies within the triangle. - * - * @param {Vector3} point - The point in 3D space to test. - * @return {boolean} Whether the given point, when projected onto the plane of the - * triangle, lies within the triangle or not. - */ - containsPoint(point: Vector3): boolean; - /** - * Returns `true` if the triangle is oriented towards the given direction. - * - * @param {Vector3} direction - The (normalized) direction vector. - * @return {boolean} Whether the triangle is oriented towards the given direction or not. - */ - isFrontFacing(direction: Vector3): boolean; - /** - * Returns `true` if this triangle intersects with the given box. - * - * @param {Box3} box - The box to intersect. - * @return {boolean} Whether this triangle intersects with the given box or not. - */ - intersectsBox(box: Box3): boolean; - /** - * Returns the closest point on the triangle to the given point. - * - * @param {Vector3} p - The point to compute the closest point for. - * @param {Vector3} target - The target vector that is used to store the method's result. - * @return {Vector3} The closest point on the triangle. - */ - closestPointToPoint(p: Vector3, target: Vector3): Vector3; - /** - * Returns `true` if this triangle is equal with the given one. - * - * @param {Triangle} triangle - The triangle to test for equality. - * @return {boolean} Whether this triangle is equal with the given one. - */ - equals(triangle: Triangle): boolean; -} -import { Vector3 } from './Vector3.js'; diff --git a/jsdoc-testing/jsdoc/math/Vector2.d.ts b/jsdoc-testing/jsdoc/math/Vector2.d.ts deleted file mode 100644 index aeaeb509d..000000000 --- a/jsdoc-testing/jsdoc/math/Vector2.d.ts +++ /dev/null @@ -1,440 +0,0 @@ -/** - * Class representing a 2D vector. A 2D vector is an ordered pair of numbers - * (labeled x and y), which can be used to represent a number of things, such as: - * - * - A point in 2D space (i.e. a position on a plane). - * - A direction and length across a plane. In three.js the length will - * always be the Euclidean distance(straight-line distance) from `(0, 0)` to `(x, y)` - * and the direction is also measured from `(0, 0)` towards `(x, y)`. - * - Any arbitrary ordered pair of numbers. - * - * There are other things a 2D vector can be used to represent, such as - * momentum vectors, complex numbers and so on, however these are the most - * common uses in three.js. - * - * Iterating through a vector instance will yield its components `(x, y)` in - * the corresponding order. - * ```js - * const a = new THREE.Vector2( 0, 1 ); - * - * //no arguments; will be initialised to (0, 0) - * const b = new THREE.Vector2( ); - * - * const d = a.distanceTo( b ); - * ``` - */ -export class Vector2 { - /** - * Constructs a new 2D vector. - * - * @param {number} [x=0] - The x value of this vector. - * @param {number} [y=0] - The y value of this vector. - */ - constructor(x?: number, y?: number); - /** - * The x value of this vector. - * - * @type {number} - */ - x: number; - /** - * The y value of this vector. - * - * @type {number} - */ - y: number; - set width(value: number); - /** - * Alias for {@link Vector2#x}. - * - * @type {number} - */ - get width(): number; - set height(value: number); - /** - * Alias for {@link Vector2#y}. - * - * @type {number} - */ - get height(): number; - /** - * Sets the vector components. - * - * @param {number} x - The value of the x component. - * @param {number} y - The value of the y component. - * @return {Vector2} A reference to this vector. - */ - set(x: number, y: number): Vector2; - /** - * Sets the vector components to the same value. - * - * @param {number} scalar - The value to set for all vector components. - * @return {Vector2} A reference to this vector. - */ - setScalar(scalar: number): Vector2; - /** - * Sets the vector's x component to the given value - * - * @param {number} x - The value to set. - * @return {Vector2} A reference to this vector. - */ - setX(x: number): Vector2; - /** - * Sets the vector's y component to the given value - * - * @param {number} y - The value to set. - * @return {Vector2} A reference to this vector. - */ - setY(y: number): Vector2; - /** - * Allows to set a vector component with an index. - * - * @param {number} index - The component index. `0` equals to x, `1` equals to y. - * @param {number} value - The value to set. - * @return {Vector2} A reference to this vector. - */ - setComponent(index: number, value: number): Vector2; - /** - * Returns the value of the vector component which matches the given index. - * - * @param {number} index - The component index. `0` equals to x, `1` equals to y. - * @return {number} A vector component value. - */ - getComponent(index: number): number; - /** - * Returns a new vector with copied values from this instance. - * - * @return {Vector2} A clone of this instance. - */ - clone(): Vector2; - /** - * Copies the values of the given vector to this instance. - * - * @param {Vector2} v - The vector to copy. - * @return {Vector2} A reference to this vector. - */ - copy(v: Vector2): Vector2; - /** - * Adds the given vector to this instance. - * - * @param {Vector2} v - The vector to add. - * @return {Vector2} A reference to this vector. - */ - add(v: Vector2): Vector2; - /** - * Adds the given scalar value to all components of this instance. - * - * @param {number} s - The scalar to add. - * @return {Vector2} A reference to this vector. - */ - addScalar(s: number): Vector2; - /** - * Adds the given vectors and stores the result in this instance. - * - * @param {Vector2} a - The first vector. - * @param {Vector2} b - The second vector. - * @return {Vector2} A reference to this vector. - */ - addVectors(a: Vector2, b: Vector2): Vector2; - /** - * Adds the given vector scaled by the given factor to this instance. - * - * @param {Vector2} v - The vector. - * @param {number} s - The factor that scales `v`. - * @return {Vector2} A reference to this vector. - */ - addScaledVector(v: Vector2, s: number): Vector2; - /** - * Subtracts the given vector from this instance. - * - * @param {Vector2} v - The vector to subtract. - * @return {Vector2} A reference to this vector. - */ - sub(v: Vector2): Vector2; - /** - * Subtracts the given scalar value from all components of this instance. - * - * @param {number} s - The scalar to subtract. - * @return {Vector2} A reference to this vector. - */ - subScalar(s: number): Vector2; - /** - * Subtracts the given vectors and stores the result in this instance. - * - * @param {Vector2} a - The first vector. - * @param {Vector2} b - The second vector. - * @return {Vector2} A reference to this vector. - */ - subVectors(a: Vector2, b: Vector2): Vector2; - /** - * Multiplies the given vector with this instance. - * - * @param {Vector2} v - The vector to multiply. - * @return {Vector2} A reference to this vector. - */ - multiply(v: Vector2): Vector2; - /** - * Multiplies the given scalar value with all components of this instance. - * - * @param {number} scalar - The scalar to multiply. - * @return {Vector2} A reference to this vector. - */ - multiplyScalar(scalar: number): Vector2; - /** - * Divides this instance by the given vector. - * - * @param {Vector2} v - The vector to divide. - * @return {Vector2} A reference to this vector. - */ - divide(v: Vector2): Vector2; - /** - * Divides this vector by the given scalar. - * - * @param {number} scalar - The scalar to divide. - * @return {Vector2} A reference to this vector. - */ - divideScalar(scalar: number): Vector2; - /** - * Multiplies this vector (with an implicit 1 as the 3rd component) by - * the given 3x3 matrix. - * - * @param {Matrix3} m - The matrix to apply. - * @return {Vector2} A reference to this vector. - */ - applyMatrix3(m: Matrix3): Vector2; - /** - * If this vector's x or y value is greater than the given vector's x or y - * value, replace that value with the corresponding min value. - * - * @param {Vector2} v - The vector. - * @return {Vector2} A reference to this vector. - */ - min(v: Vector2): Vector2; - /** - * If this vector's x or y value is less than the given vector's x or y - * value, replace that value with the corresponding max value. - * - * @param {Vector2} v - The vector. - * @return {Vector2} A reference to this vector. - */ - max(v: Vector2): Vector2; - /** - * If this vector's x or y value is greater than the max vector's x or y - * value, it is replaced by the corresponding value. - * If this vector's x or y value is less than the min vector's x or y value, - * it is replaced by the corresponding value. - * - * @param {Vector2} min - The minimum x and y values. - * @param {Vector2} max - The maximum x and y values in the desired range. - * @return {Vector2} A reference to this vector. - */ - clamp(min: Vector2, max: Vector2): Vector2; - /** - * If this vector's x or y values are greater than the max value, they are - * replaced by the max value. - * If this vector's x or y values are less than the min value, they are - * replaced by the min value. - * - * @param {number} minVal - The minimum value the components will be clamped to. - * @param {number} maxVal - The maximum value the components will be clamped to. - * @return {Vector2} A reference to this vector. - */ - clampScalar(minVal: number, maxVal: number): Vector2; - /** - * If this vector's length is greater than the max value, it is replaced by - * the max value. - * If this vector's length is less than the min value, it is replaced by the - * min value. - * - * @param {number} min - The minimum value the vector length will be clamped to. - * @param {number} max - The maximum value the vector length will be clamped to. - * @return {Vector2} A reference to this vector. - */ - clampLength(min: number, max: number): Vector2; - /** - * The components of this vector are rounded down to the nearest integer value. - * - * @return {Vector2} A reference to this vector. - */ - floor(): Vector2; - /** - * The components of this vector are rounded up to the nearest integer value. - * - * @return {Vector2} A reference to this vector. - */ - ceil(): Vector2; - /** - * The components of this vector are rounded to the nearest integer value - * - * @return {Vector2} A reference to this vector. - */ - round(): Vector2; - /** - * The components of this vector are rounded towards zero (up if negative, - * down if positive) to an integer value. - * - * @return {Vector2} A reference to this vector. - */ - roundToZero(): Vector2; - /** - * Inverts this vector - i.e. sets x = -x and y = -y. - * - * @return {Vector2} A reference to this vector. - */ - negate(): Vector2; - /** - * Calculates the dot product of the given vector with this instance. - * - * @param {Vector2} v - The vector to compute the dot product with. - * @return {number} The result of the dot product. - */ - dot(v: Vector2): number; - /** - * Calculates the cross product of the given vector with this instance. - * - * @param {Vector2} v - The vector to compute the cross product with. - * @return {number} The result of the cross product. - */ - cross(v: Vector2): number; - /** - * Computes the square of the Euclidean length (straight-line length) from - * (0, 0) to (x, y). If you are comparing the lengths of vectors, you should - * compare the length squared instead as it is slightly more efficient to calculate. - * - * @return {number} The square length of this vector. - */ - lengthSq(): number; - /** - * Computes the Euclidean length (straight-line length) from (0, 0) to (x, y). - * - * @return {number} The length of this vector. - */ - length(): number; - /** - * Computes the Manhattan length of this vector. - * - * @return {number} The length of this vector. - */ - manhattanLength(): number; - /** - * Converts this vector to a unit vector - that is, sets it equal to a vector - * with the same direction as this one, but with a vector length of `1`. - * - * @return {Vector2} A reference to this vector. - */ - normalize(): Vector2; - /** - * Computes the angle in radians of this vector with respect to the positive x-axis. - * - * @return {number} The angle in radians. - */ - angle(): number; - /** - * Returns the angle between the given vector and this instance in radians. - * - * @param {Vector2} v - The vector to compute the angle with. - * @return {number} The angle in radians. - */ - angleTo(v: Vector2): number; - /** - * Computes the distance from the given vector to this instance. - * - * @param {Vector2} v - The vector to compute the distance to. - * @return {number} The distance. - */ - distanceTo(v: Vector2): number; - /** - * Computes the squared distance from the given vector to this instance. - * If you are just comparing the distance with another distance, you should compare - * the distance squared instead as it is slightly more efficient to calculate. - * - * @param {Vector2} v - The vector to compute the squared distance to. - * @return {number} The squared distance. - */ - distanceToSquared(v: Vector2): number; - /** - * Computes the Manhattan distance from the given vector to this instance. - * - * @param {Vector2} v - The vector to compute the Manhattan distance to. - * @return {number} The Manhattan distance. - */ - manhattanDistanceTo(v: Vector2): number; - /** - * Sets this vector to a vector with the same direction as this one, but - * with the specified length. - * - * @param {number} length - The new length of this vector. - * @return {Vector2} A reference to this vector. - */ - setLength(length: number): Vector2; - /** - * Linearly interpolates between the given vector and this instance, where - * alpha is the percent distance along the line - alpha = 0 will be this - * vector, and alpha = 1 will be the given one. - * - * @param {Vector2} v - The vector to interpolate towards. - * @param {number} alpha - The interpolation factor, typically in the closed interval `[0, 1]`. - * @return {Vector2} A reference to this vector. - */ - lerp(v: Vector2, alpha: number): Vector2; - /** - * Linearly interpolates between the given vectors, where alpha is the percent - * distance along the line - alpha = 0 will be first vector, and alpha = 1 will - * be the second one. The result is stored in this instance. - * - * @param {Vector2} v1 - The first vector. - * @param {Vector2} v2 - The second vector. - * @param {number} alpha - The interpolation factor, typically in the closed interval `[0, 1]`. - * @return {Vector2} A reference to this vector. - */ - lerpVectors(v1: Vector2, v2: Vector2, alpha: number): Vector2; - /** - * Returns `true` if this vector is equal with the given one. - * - * @param {Vector2} v - The vector to test for equality. - * @return {boolean} Whether this vector is equal with the given one. - */ - equals(v: Vector2): boolean; - /** - * Sets this vector's x value to be `array[ offset ]` and y - * value to be `array[ offset + 1 ]`. - * - * @param {Array} array - An array holding the vector component values. - * @param {number} [offset=0] - The offset into the array. - * @return {Vector2} A reference to this vector. - */ - fromArray(array: Array, offset?: number): Vector2; - /** - * Writes the components of this vector to the given array. If no array is provided, - * the method returns a new instance. - * - * @param {Array} [array=[]] - The target array holding the vector components. - * @param {number} [offset=0] - Index of the first element in the array. - * @return {Array} The vector components. - */ - toArray(array?: Array, offset?: number): Array; - /** - * Sets the components of this vector from the given buffer attribute. - * - * @param {BufferAttribute} attribute - The buffer attribute holding vector data. - * @param {number} index - The index into the attribute. - * @return {Vector2} A reference to this vector. - */ - fromBufferAttribute(attribute: BufferAttribute, index: number): Vector2; - /** - * Rotates this vector around the given center by the given angle. - * - * @param {Vector2} center - The point around which to rotate. - * @param {number} angle - The angle to rotate, in radians. - * @return {Vector2} A reference to this vector. - */ - rotateAround(center: Vector2, angle: number): Vector2; - /** - * Sets each component of this vector to a pseudo-random value between `0` and - * `1`, excluding `1`. - * - * @return {Vector2} A reference to this vector. - */ - random(): Vector2; - [Symbol.iterator](): Generator; -} diff --git a/jsdoc-testing/jsdoc/math/Vector3.d.ts b/jsdoc-testing/jsdoc/math/Vector3.d.ts deleted file mode 100644 index df65f7998..000000000 --- a/jsdoc-testing/jsdoc/math/Vector3.d.ts +++ /dev/null @@ -1,613 +0,0 @@ -/** - * Class representing a 3D vector. A 3D vector is an ordered triplet of numbers - * (labeled x, y and z), which can be used to represent a number of things, such as: - * - * - A point in 3D space. - * - A direction and length in 3D space. In three.js the length will - * always be the Euclidean distance(straight-line distance) from `(0, 0, 0)` to `(x, y, z)` - * and the direction is also measured from `(0, 0, 0)` towards `(x, y, z)`. - * - Any arbitrary ordered triplet of numbers. - * - * There are other things a 3D vector can be used to represent, such as - * momentum vectors and so on, however these are the most - * common uses in three.js. - * - * Iterating through a vector instance will yield its components `(x, y, z)` in - * the corresponding order. - * ```js - * const a = new THREE.Vector3( 0, 1, 0 ); - * - * //no arguments; will be initialised to (0, 0, 0) - * const b = new THREE.Vector3( ); - * - * const d = a.distanceTo( b ); - * ``` - */ -export class Vector3 { - /** - * Constructs a new 3D vector. - * - * @param {number} [x=0] - The x value of this vector. - * @param {number} [y=0] - The y value of this vector. - * @param {number} [z=0] - The z value of this vector. - */ - constructor(x?: number, y?: number, z?: number); - /** - * The x value of this vector. - * - * @type {number} - */ - x: number; - /** - * The y value of this vector. - * - * @type {number} - */ - y: number; - /** - * The z value of this vector. - * - * @type {number} - */ - z: number; - /** - * Sets the vector components. - * - * @param {number} x - The value of the x component. - * @param {number} y - The value of the y component. - * @param {number} z - The value of the z component. - * @return {Vector3} A reference to this vector. - */ - set(x: number, y: number, z: number): Vector3; - /** - * Sets the vector components to the same value. - * - * @param {number} scalar - The value to set for all vector components. - * @return {Vector3} A reference to this vector. - */ - setScalar(scalar: number): Vector3; - /** - * Sets the vector's x component to the given value. - * - * @param {number} x - The value to set. - * @return {Vector3} A reference to this vector. - */ - setX(x: number): Vector3; - /** - * Sets the vector's y component to the given value. - * - * @param {number} y - The value to set. - * @return {Vector3} A reference to this vector. - */ - setY(y: number): Vector3; - /** - * Sets the vector's z component to the given value. - * - * @param {number} z - The value to set. - * @return {Vector3} A reference to this vector. - */ - setZ(z: number): Vector3; - /** - * Allows to set a vector component with an index. - * - * @param {number} index - The component index. `0` equals to x, `1` equals to y, `2` equals to z. - * @param {number} value - The value to set. - * @return {Vector3} A reference to this vector. - */ - setComponent(index: number, value: number): Vector3; - /** - * Returns the value of the vector component which matches the given index. - * - * @param {number} index - The component index. `0` equals to x, `1` equals to y, `2` equals to z. - * @return {number} A vector component value. - */ - getComponent(index: number): number; - /** - * Returns a new vector with copied values from this instance. - * - * @return {Vector3} A clone of this instance. - */ - clone(): Vector3; - /** - * Copies the values of the given vector to this instance. - * - * @param {Vector3} v - The vector to copy. - * @return {Vector3} A reference to this vector. - */ - copy(v: Vector3): Vector3; - /** - * Adds the given vector to this instance. - * - * @param {Vector3} v - The vector to add. - * @return {Vector3} A reference to this vector. - */ - add(v: Vector3): Vector3; - /** - * Adds the given scalar value to all components of this instance. - * - * @param {number} s - The scalar to add. - * @return {Vector3} A reference to this vector. - */ - addScalar(s: number): Vector3; - /** - * Adds the given vectors and stores the result in this instance. - * - * @param {Vector3} a - The first vector. - * @param {Vector3} b - The second vector. - * @return {Vector3} A reference to this vector. - */ - addVectors(a: Vector3, b: Vector3): Vector3; - /** - * Adds the given vector scaled by the given factor to this instance. - * - * @param {Vector3|Vector4} v - The vector. - * @param {number} s - The factor that scales `v`. - * @return {Vector3} A reference to this vector. - */ - addScaledVector(v: Vector3 | Vector4, s: number): Vector3; - /** - * Subtracts the given vector from this instance. - * - * @param {Vector3} v - The vector to subtract. - * @return {Vector3} A reference to this vector. - */ - sub(v: Vector3): Vector3; - /** - * Subtracts the given scalar value from all components of this instance. - * - * @param {number} s - The scalar to subtract. - * @return {Vector3} A reference to this vector. - */ - subScalar(s: number): Vector3; - /** - * Subtracts the given vectors and stores the result in this instance. - * - * @param {Vector3} a - The first vector. - * @param {Vector3} b - The second vector. - * @return {Vector3} A reference to this vector. - */ - subVectors(a: Vector3, b: Vector3): Vector3; - /** - * Multiplies the given vector with this instance. - * - * @param {Vector3} v - The vector to multiply. - * @return {Vector3} A reference to this vector. - */ - multiply(v: Vector3): Vector3; - /** - * Multiplies the given scalar value with all components of this instance. - * - * @param {number} scalar - The scalar to multiply. - * @return {Vector3} A reference to this vector. - */ - multiplyScalar(scalar: number): Vector3; - /** - * Multiplies the given vectors and stores the result in this instance. - * - * @param {Vector3} a - The first vector. - * @param {Vector3} b - The second vector. - * @return {Vector3} A reference to this vector. - */ - multiplyVectors(a: Vector3, b: Vector3): Vector3; - /** - * Applies the given Euler rotation to this vector. - * - * @param {Euler} euler - The Euler angles. - * @return {Vector3} A reference to this vector. - */ - applyEuler(euler: Euler): Vector3; - /** - * Applies a rotation specified by an axis and an angle to this vector. - * - * @param {Vector3} axis - A normalized vector representing the rotation axis. - * @param {number} angle - The angle in radians. - * @return {Vector3} A reference to this vector. - */ - applyAxisAngle(axis: Vector3, angle: number): Vector3; - /** - * Multiplies this vector with the given 3x3 matrix. - * - * @param {Matrix3} m - The 3x3 matrix. - * @return {Vector3} A reference to this vector. - */ - applyMatrix3(m: Matrix3): Vector3; - /** - * Multiplies this vector by the given normal matrix and normalizes - * the result. - * - * @param {Matrix3} m - The normal matrix. - * @return {Vector3} A reference to this vector. - */ - applyNormalMatrix(m: Matrix3): Vector3; - /** - * Multiplies this vector (with an implicit 1 in the 4th dimension) by m, and - * divides by perspective. - * - * @param {Matrix4} m - The matrix to apply. - * @return {Vector3} A reference to this vector. - */ - applyMatrix4(m: Matrix4): Vector3; - /** - * Applies the given Quaternion to this vector. - * - * @param {Quaternion} q - The Quaternion. - * @return {Vector3} A reference to this vector. - */ - applyQuaternion(q: Quaternion): Vector3; - /** - * Projects this vector from world space into the camera's normalized - * device coordinate (NDC) space. - * - * @param {Camera} camera - The camera. - * @return {Vector3} A reference to this vector. - */ - project(camera: Camera): Vector3; - /** - * Unprojects this vector from the camera's normalized device coordinate (NDC) - * space into world space. - * - * @param {Camera} camera - The camera. - * @return {Vector3} A reference to this vector. - */ - unproject(camera: Camera): Vector3; - /** - * Transforms the direction of this vector by a matrix (the upper left 3 x 3 - * subset of the given 4x4 matrix and then normalizes the result. - * - * @param {Matrix4} m - The matrix. - * @return {Vector3} A reference to this vector. - */ - transformDirection(m: Matrix4): Vector3; - /** - * Divides this instance by the given vector. - * - * @param {Vector3} v - The vector to divide. - * @return {Vector3} A reference to this vector. - */ - divide(v: Vector3): Vector3; - /** - * Divides this vector by the given scalar. - * - * @param {number} scalar - The scalar to divide. - * @return {Vector3} A reference to this vector. - */ - divideScalar(scalar: number): Vector3; - /** - * If this vector's x, y or z value is greater than the given vector's x, y or z - * value, replace that value with the corresponding min value. - * - * @param {Vector3} v - The vector. - * @return {Vector3} A reference to this vector. - */ - min(v: Vector3): Vector3; - /** - * If this vector's x, y or z value is less than the given vector's x, y or z - * value, replace that value with the corresponding max value. - * - * @param {Vector3} v - The vector. - * @return {Vector3} A reference to this vector. - */ - max(v: Vector3): Vector3; - /** - * If this vector's x, y or z value is greater than the max vector's x, y or z - * value, it is replaced by the corresponding value. - * If this vector's x, y or z value is less than the min vector's x, y or z value, - * it is replaced by the corresponding value. - * - * @param {Vector3} min - The minimum x, y and z values. - * @param {Vector3} max - The maximum x, y and z values in the desired range. - * @return {Vector3} A reference to this vector. - */ - clamp(min: Vector3, max: Vector3): Vector3; - /** - * If this vector's x, y or z values are greater than the max value, they are - * replaced by the max value. - * If this vector's x, y or z values are less than the min value, they are - * replaced by the min value. - * - * @param {number} minVal - The minimum value the components will be clamped to. - * @param {number} maxVal - The maximum value the components will be clamped to. - * @return {Vector3} A reference to this vector. - */ - clampScalar(minVal: number, maxVal: number): Vector3; - /** - * If this vector's length is greater than the max value, it is replaced by - * the max value. - * If this vector's length is less than the min value, it is replaced by the - * min value. - * - * @param {number} min - The minimum value the vector length will be clamped to. - * @param {number} max - The maximum value the vector length will be clamped to. - * @return {Vector3} A reference to this vector. - */ - clampLength(min: number, max: number): Vector3; - /** - * The components of this vector are rounded down to the nearest integer value. - * - * @return {Vector3} A reference to this vector. - */ - floor(): Vector3; - /** - * The components of this vector are rounded up to the nearest integer value. - * - * @return {Vector3} A reference to this vector. - */ - ceil(): Vector3; - /** - * The components of this vector are rounded to the nearest integer value - * - * @return {Vector3} A reference to this vector. - */ - round(): Vector3; - /** - * The components of this vector are rounded towards zero (up if negative, - * down if positive) to an integer value. - * - * @return {Vector3} A reference to this vector. - */ - roundToZero(): Vector3; - /** - * Inverts this vector - i.e. sets x = -x, y = -y and z = -z. - * - * @return {Vector3} A reference to this vector. - */ - negate(): Vector3; - /** - * Calculates the dot product of the given vector with this instance. - * - * @param {Vector3} v - The vector to compute the dot product with. - * @return {number} The result of the dot product. - */ - dot(v: Vector3): number; - /** - * Computes the square of the Euclidean length (straight-line length) from - * (0, 0, 0) to (x, y, z). If you are comparing the lengths of vectors, you should - * compare the length squared instead as it is slightly more efficient to calculate. - * - * @return {number} The square length of this vector. - */ - lengthSq(): number; - /** - * Computes the Euclidean length (straight-line length) from (0, 0, 0) to (x, y, z). - * - * @return {number} The length of this vector. - */ - length(): number; - /** - * Computes the Manhattan length of this vector. - * - * @return {number} The length of this vector. - */ - manhattanLength(): number; - /** - * Converts this vector to a unit vector - that is, sets it equal to a vector - * with the same direction as this one, but with a vector length of `1`. - * - * @return {Vector3} A reference to this vector. - */ - normalize(): Vector3; - /** - * Sets this vector to a vector with the same direction as this one, but - * with the specified length. - * - * @param {number} length - The new length of this vector. - * @return {Vector3} A reference to this vector. - */ - setLength(length: number): Vector3; - /** - * Linearly interpolates between the given vector and this instance, where - * alpha is the percent distance along the line - alpha = 0 will be this - * vector, and alpha = 1 will be the given one. - * - * @param {Vector3} v - The vector to interpolate towards. - * @param {number} alpha - The interpolation factor, typically in the closed interval `[0, 1]`. - * @return {Vector3} A reference to this vector. - */ - lerp(v: Vector3, alpha: number): Vector3; - /** - * Linearly interpolates between the given vectors, where alpha is the percent - * distance along the line - alpha = 0 will be first vector, and alpha = 1 will - * be the second one. The result is stored in this instance. - * - * @param {Vector3} v1 - The first vector. - * @param {Vector3} v2 - The second vector. - * @param {number} alpha - The interpolation factor, typically in the closed interval `[0, 1]`. - * @return {Vector3} A reference to this vector. - */ - lerpVectors(v1: Vector3, v2: Vector3, alpha: number): Vector3; - /** - * Calculates the cross product of the given vector with this instance. - * - * @param {Vector3} v - The vector to compute the cross product with. - * @return {Vector3} The result of the cross product. - */ - cross(v: Vector3): Vector3; - /** - * Calculates the cross product of the given vectors and stores the result - * in this instance. - * - * @param {Vector3} a - The first vector. - * @param {Vector3} b - The second vector. - * @return {Vector3} A reference to this vector. - */ - crossVectors(a: Vector3, b: Vector3): Vector3; - /** - * Projects this vector onto the given one. - * - * @param {Vector3} v - The vector to project to. - * @return {Vector3} A reference to this vector. - */ - projectOnVector(v: Vector3): Vector3; - /** - * Projects this vector onto a plane by subtracting this - * vector projected onto the plane's normal from this vector. - * - * @param {Vector3} planeNormal - The plane normal. - * @return {Vector3} A reference to this vector. - */ - projectOnPlane(planeNormal: Vector3): Vector3; - /** - * Reflects this vector off a plane orthogonal to the given normal vector. - * - * @param {Vector3} normal - The (normalized) normal vector. - * @return {Vector3} A reference to this vector. - */ - reflect(normal: Vector3): Vector3; - /** - * Returns the angle between the given vector and this instance in radians. - * - * @param {Vector3} v - The vector to compute the angle with. - * @return {number} The angle in radians. - */ - angleTo(v: Vector3): number; - /** - * Computes the distance from the given vector to this instance. - * - * @param {Vector3} v - The vector to compute the distance to. - * @return {number} The distance. - */ - distanceTo(v: Vector3): number; - /** - * Computes the squared distance from the given vector to this instance. - * If you are just comparing the distance with another distance, you should compare - * the distance squared instead as it is slightly more efficient to calculate. - * - * @param {Vector3} v - The vector to compute the squared distance to. - * @return {number} The squared distance. - */ - distanceToSquared(v: Vector3): number; - /** - * Computes the Manhattan distance from the given vector to this instance. - * - * @param {Vector3} v - The vector to compute the Manhattan distance to. - * @return {number} The Manhattan distance. - */ - manhattanDistanceTo(v: Vector3): number; - /** - * Sets the vector components from the given spherical coordinates. - * - * @param {Spherical} s - The spherical coordinates. - * @return {Vector3} A reference to this vector. - */ - setFromSpherical(s: Spherical): Vector3; - /** - * Sets the vector components from the given spherical coordinates. - * - * @param {number} radius - The radius. - * @param {number} phi - The phi angle in radians. - * @param {number} theta - The theta angle in radians. - * @return {Vector3} A reference to this vector. - */ - setFromSphericalCoords(radius: number, phi: number, theta: number): Vector3; - /** - * Sets the vector components from the given cylindrical coordinates. - * - * @param {Cylindrical} c - The cylindrical coordinates. - * @return {Vector3} A reference to this vector. - */ - setFromCylindrical(c: Cylindrical): Vector3; - /** - * Sets the vector components from the given cylindrical coordinates. - * - * @param {number} radius - The radius. - * @param {number} theta - The theta angle in radians. - * @param {number} y - The y value. - * @return {Vector3} A reference to this vector. - */ - setFromCylindricalCoords(radius: number, theta: number, y: number): Vector3; - /** - * Sets the vector components to the position elements of the - * given transformation matrix. - * - * @param {Matrix4} m - The 4x4 matrix. - * @return {Vector3} A reference to this vector. - */ - setFromMatrixPosition(m: Matrix4): Vector3; - /** - * Sets the vector components to the scale elements of the - * given transformation matrix. - * - * @param {Matrix4} m - The 4x4 matrix. - * @return {Vector3} A reference to this vector. - */ - setFromMatrixScale(m: Matrix4): Vector3; - /** - * Sets the vector components from the specified matrix column. - * - * @param {Matrix4} m - The 4x4 matrix. - * @param {number} index - The column index. - * @return {Vector3} A reference to this vector. - */ - setFromMatrixColumn(m: Matrix4, index: number): Vector3; - /** - * Sets the vector components from the specified matrix column. - * - * @param {Matrix3} m - The 3x3 matrix. - * @param {number} index - The column index. - * @return {Vector3} A reference to this vector. - */ - setFromMatrix3Column(m: Matrix3, index: number): Vector3; - /** - * Sets the vector components from the given Euler angles. - * - * @param {Euler} e - The Euler angles to set. - * @return {Vector3} A reference to this vector. - */ - setFromEuler(e: Euler): Vector3; - /** - * Sets the vector components from the RGB components of the - * given color. - * - * @param {Color} c - The color to set. - * @return {Vector3} A reference to this vector. - */ - setFromColor(c: Color): Vector3; - /** - * Returns `true` if this vector is equal with the given one. - * - * @param {Vector3} v - The vector to test for equality. - * @return {boolean} Whether this vector is equal with the given one. - */ - equals(v: Vector3): boolean; - /** - * Sets this vector's x value to be `array[ offset ]`, y value to be `array[ offset + 1 ]` - * and z value to be `array[ offset + 2 ]`. - * - * @param {Array} array - An array holding the vector component values. - * @param {number} [offset=0] - The offset into the array. - * @return {Vector3} A reference to this vector. - */ - fromArray(array: Array, offset?: number): Vector3; - /** - * Writes the components of this vector to the given array. If no array is provided, - * the method returns a new instance. - * - * @param {Array} [array=[]] - The target array holding the vector components. - * @param {number} [offset=0] - Index of the first element in the array. - * @return {Array} The vector components. - */ - toArray(array?: Array, offset?: number): Array; - /** - * Sets the components of this vector from the given buffer attribute. - * - * @param {BufferAttribute} attribute - The buffer attribute holding vector data. - * @param {number} index - The index into the attribute. - * @return {Vector3} A reference to this vector. - */ - fromBufferAttribute(attribute: BufferAttribute, index: number): Vector3; - /** - * Sets each component of this vector to a pseudo-random value between `0` and - * `1`, excluding `1`. - * - * @return {Vector3} A reference to this vector. - */ - random(): Vector3; - /** - * Sets this vector to a uniformly random point on a unit sphere. - * - * @return {Vector3} A reference to this vector. - */ - randomDirection(): Vector3; - [Symbol.iterator](): Generator; -} -import { Quaternion } from './Quaternion.js'; diff --git a/jsdoc-testing/jsdoc/math/Vector4.d.ts b/jsdoc-testing/jsdoc/math/Vector4.d.ts deleted file mode 100644 index 2360be77d..000000000 --- a/jsdoc-testing/jsdoc/math/Vector4.d.ts +++ /dev/null @@ -1,443 +0,0 @@ -/** - * Class representing a 4D vector. A 4D vector is an ordered quadruplet of numbers - * (labeled x, y, z and w), which can be used to represent a number of things, such as: - * - * - A point in 4D space. - * - A direction and length in 4D space. In three.js the length will - * always be the Euclidean distance(straight-line distance) from `(0, 0, 0, 0)` to `(x, y, z, w)` - * and the direction is also measured from `(0, 0, 0, 0)` towards `(x, y, z, w)`. - * - Any arbitrary ordered quadruplet of numbers. - * - * There are other things a 4D vector can be used to represent, however these - * are the most common uses in *three.js*. - * - * Iterating through a vector instance will yield its components `(x, y, z, w)` in - * the corresponding order. - * ```js - * const a = new THREE.Vector4( 0, 1, 0, 0 ); - * - * //no arguments; will be initialised to (0, 0, 0, 1) - * const b = new THREE.Vector4( ); - * - * const d = a.dot( b ); - * ``` - */ -export class Vector4 { - /** - * Constructs a new 4D vector. - * - * @param {number} [x=0] - The x value of this vector. - * @param {number} [y=0] - The y value of this vector. - * @param {number} [z=0] - The z value of this vector. - * @param {number} [w=1] - The w value of this vector. - */ - constructor(x?: number, y?: number, z?: number, w?: number); - /** - * The x value of this vector. - * - * @type {number} - */ - x: number; - /** - * The y value of this vector. - * - * @type {number} - */ - y: number; - /** - * The z value of this vector. - * - * @type {number} - */ - z: number; - /** - * The w value of this vector. - * - * @type {number} - */ - w: number; - set width(value: number); - /** - * Alias for {@link Vector4#z}. - * - * @type {number} - */ - get width(): number; - set height(value: number); - /** - * Alias for {@link Vector4#w}. - * - * @type {number} - */ - get height(): number; - /** - * Sets the vector components. - * - * @param {number} x - The value of the x component. - * @param {number} y - The value of the y component. - * @param {number} z - The value of the z component. - * @param {number} w - The value of the w component. - * @return {Vector4} A reference to this vector. - */ - set(x: number, y: number, z: number, w: number): Vector4; - /** - * Sets the vector components to the same value. - * - * @param {number} scalar - The value to set for all vector components. - * @return {Vector4} A reference to this vector. - */ - setScalar(scalar: number): Vector4; - /** - * Sets the vector's x component to the given value - * - * @param {number} x - The value to set. - * @return {Vector4} A reference to this vector. - */ - setX(x: number): Vector4; - /** - * Sets the vector's y component to the given value - * - * @param {number} y - The value to set. - * @return {Vector4} A reference to this vector. - */ - setY(y: number): Vector4; - /** - * Sets the vector's z component to the given value - * - * @param {number} z - The value to set. - * @return {Vector4} A reference to this vector. - */ - setZ(z: number): Vector4; - /** - * Sets the vector's w component to the given value - * - * @param {number} w - The value to set. - * @return {Vector4} A reference to this vector. - */ - setW(w: number): Vector4; - /** - * Allows to set a vector component with an index. - * - * @param {number} index - The component index. `0` equals to x, `1` equals to y, - * `2` equals to z, `3` equals to w. - * @param {number} value - The value to set. - * @return {Vector4} A reference to this vector. - */ - setComponent(index: number, value: number): Vector4; - /** - * Returns the value of the vector component which matches the given index. - * - * @param {number} index - The component index. `0` equals to x, `1` equals to y, - * `2` equals to z, `3` equals to w. - * @return {number} A vector component value. - */ - getComponent(index: number): number; - /** - * Returns a new vector with copied values from this instance. - * - * @return {Vector4} A clone of this instance. - */ - clone(): Vector4; - /** - * Copies the values of the given vector to this instance. - * - * @param {Vector3|Vector4} v - The vector to copy. - * @return {Vector4} A reference to this vector. - */ - copy(v: Vector3 | Vector4): Vector4; - /** - * Adds the given vector to this instance. - * - * @param {Vector4} v - The vector to add. - * @return {Vector4} A reference to this vector. - */ - add(v: Vector4): Vector4; - /** - * Adds the given scalar value to all components of this instance. - * - * @param {number} s - The scalar to add. - * @return {Vector4} A reference to this vector. - */ - addScalar(s: number): Vector4; - /** - * Adds the given vectors and stores the result in this instance. - * - * @param {Vector4} a - The first vector. - * @param {Vector4} b - The second vector. - * @return {Vector4} A reference to this vector. - */ - addVectors(a: Vector4, b: Vector4): Vector4; - /** - * Adds the given vector scaled by the given factor to this instance. - * - * @param {Vector4} v - The vector. - * @param {number} s - The factor that scales `v`. - * @return {Vector4} A reference to this vector. - */ - addScaledVector(v: Vector4, s: number): Vector4; - /** - * Subtracts the given vector from this instance. - * - * @param {Vector4} v - The vector to subtract. - * @return {Vector4} A reference to this vector. - */ - sub(v: Vector4): Vector4; - /** - * Subtracts the given scalar value from all components of this instance. - * - * @param {number} s - The scalar to subtract. - * @return {Vector4} A reference to this vector. - */ - subScalar(s: number): Vector4; - /** - * Subtracts the given vectors and stores the result in this instance. - * - * @param {Vector4} a - The first vector. - * @param {Vector4} b - The second vector. - * @return {Vector4} A reference to this vector. - */ - subVectors(a: Vector4, b: Vector4): Vector4; - /** - * Multiplies the given vector with this instance. - * - * @param {Vector4} v - The vector to multiply. - * @return {Vector4} A reference to this vector. - */ - multiply(v: Vector4): Vector4; - /** - * Multiplies the given scalar value with all components of this instance. - * - * @param {number} scalar - The scalar to multiply. - * @return {Vector4} A reference to this vector. - */ - multiplyScalar(scalar: number): Vector4; - /** - * Multiplies this vector with the given 4x4 matrix. - * - * @param {Matrix4} m - The 4x4 matrix. - * @return {Vector4} A reference to this vector. - */ - applyMatrix4(m: Matrix4): Vector4; - /** - * Divides this instance by the given vector. - * - * @param {Vector4} v - The vector to divide. - * @return {Vector4} A reference to this vector. - */ - divide(v: Vector4): Vector4; - /** - * Divides this vector by the given scalar. - * - * @param {number} scalar - The scalar to divide. - * @return {Vector4} A reference to this vector. - */ - divideScalar(scalar: number): Vector4; - /** - * Sets the x, y and z components of this - * vector to the quaternion's axis and w to the angle. - * - * @param {Quaternion} q - The Quaternion to set. - * @return {Vector4} A reference to this vector. - */ - setAxisAngleFromQuaternion(q: Quaternion): Vector4; - /** - * Sets the x, y and z components of this - * vector to the axis of rotation and w to the angle. - * - * @param {Matrix4} m - A 4x4 matrix of which the upper left 3x3 matrix is a pure rotation matrix. - * @return {Vector4} A reference to this vector. - */ - setAxisAngleFromRotationMatrix(m: Matrix4): Vector4; - /** - * Sets the vector components to the position elements of the - * given transformation matrix. - * - * @param {Matrix4} m - The 4x4 matrix. - * @return {Vector4} A reference to this vector. - */ - setFromMatrixPosition(m: Matrix4): Vector4; - /** - * If this vector's x, y, z or w value is greater than the given vector's x, y, z or w - * value, replace that value with the corresponding min value. - * - * @param {Vector4} v - The vector. - * @return {Vector4} A reference to this vector. - */ - min(v: Vector4): Vector4; - /** - * If this vector's x, y, z or w value is less than the given vector's x, y, z or w - * value, replace that value with the corresponding max value. - * - * @param {Vector4} v - The vector. - * @return {Vector4} A reference to this vector. - */ - max(v: Vector4): Vector4; - /** - * If this vector's x, y, z or w value is greater than the max vector's x, y, z or w - * value, it is replaced by the corresponding value. - * If this vector's x, y, z or w value is less than the min vector's x, y, z or w value, - * it is replaced by the corresponding value. - * - * @param {Vector4} min - The minimum x, y and z values. - * @param {Vector4} max - The maximum x, y and z values in the desired range. - * @return {Vector4} A reference to this vector. - */ - clamp(min: Vector4, max: Vector4): Vector4; - /** - * If this vector's x, y, z or w values are greater than the max value, they are - * replaced by the max value. - * If this vector's x, y, z or w values are less than the min value, they are - * replaced by the min value. - * - * @param {number} minVal - The minimum value the components will be clamped to. - * @param {number} maxVal - The maximum value the components will be clamped to. - * @return {Vector4} A reference to this vector. - */ - clampScalar(minVal: number, maxVal: number): Vector4; - /** - * If this vector's length is greater than the max value, it is replaced by - * the max value. - * If this vector's length is less than the min value, it is replaced by the - * min value. - * - * @param {number} min - The minimum value the vector length will be clamped to. - * @param {number} max - The maximum value the vector length will be clamped to. - * @return {Vector4} A reference to this vector. - */ - clampLength(min: number, max: number): Vector4; - /** - * The components of this vector are rounded down to the nearest integer value. - * - * @return {Vector4} A reference to this vector. - */ - floor(): Vector4; - /** - * The components of this vector are rounded up to the nearest integer value. - * - * @return {Vector4} A reference to this vector. - */ - ceil(): Vector4; - /** - * The components of this vector are rounded to the nearest integer value - * - * @return {Vector4} A reference to this vector. - */ - round(): Vector4; - /** - * The components of this vector are rounded towards zero (up if negative, - * down if positive) to an integer value. - * - * @return {Vector4} A reference to this vector. - */ - roundToZero(): Vector4; - /** - * Inverts this vector - i.e. sets x = -x, y = -y, z = -z, w = -w. - * - * @return {Vector4} A reference to this vector. - */ - negate(): Vector4; - /** - * Calculates the dot product of the given vector with this instance. - * - * @param {Vector4} v - The vector to compute the dot product with. - * @return {number} The result of the dot product. - */ - dot(v: Vector4): number; - /** - * Computes the square of the Euclidean length (straight-line length) from - * (0, 0, 0, 0) to (x, y, z, w). If you are comparing the lengths of vectors, you should - * compare the length squared instead as it is slightly more efficient to calculate. - * - * @return {number} The square length of this vector. - */ - lengthSq(): number; - /** - * Computes the Euclidean length (straight-line length) from (0, 0, 0, 0) to (x, y, z, w). - * - * @return {number} The length of this vector. - */ - length(): number; - /** - * Computes the Manhattan length of this vector. - * - * @return {number} The length of this vector. - */ - manhattanLength(): number; - /** - * Converts this vector to a unit vector - that is, sets it equal to a vector - * with the same direction as this one, but with a vector length of `1`. - * - * @return {Vector4} A reference to this vector. - */ - normalize(): Vector4; - /** - * Sets this vector to a vector with the same direction as this one, but - * with the specified length. - * - * @param {number} length - The new length of this vector. - * @return {Vector4} A reference to this vector. - */ - setLength(length: number): Vector4; - /** - * Linearly interpolates between the given vector and this instance, where - * alpha is the percent distance along the line - alpha = 0 will be this - * vector, and alpha = 1 will be the given one. - * - * @param {Vector4} v - The vector to interpolate towards. - * @param {number} alpha - The interpolation factor, typically in the closed interval `[0, 1]`. - * @return {Vector4} A reference to this vector. - */ - lerp(v: Vector4, alpha: number): Vector4; - /** - * Linearly interpolates between the given vectors, where alpha is the percent - * distance along the line - alpha = 0 will be first vector, and alpha = 1 will - * be the second one. The result is stored in this instance. - * - * @param {Vector4} v1 - The first vector. - * @param {Vector4} v2 - The second vector. - * @param {number} alpha - The interpolation factor, typically in the closed interval `[0, 1]`. - * @return {Vector4} A reference to this vector. - */ - lerpVectors(v1: Vector4, v2: Vector4, alpha: number): Vector4; - /** - * Returns `true` if this vector is equal with the given one. - * - * @param {Vector4} v - The vector to test for equality. - * @return {boolean} Whether this vector is equal with the given one. - */ - equals(v: Vector4): boolean; - /** - * Sets this vector's x value to be `array[ offset ]`, y value to be `array[ offset + 1 ]`, - * z value to be `array[ offset + 2 ]`, w value to be `array[ offset + 3 ]`. - * - * @param {Array} array - An array holding the vector component values. - * @param {number} [offset=0] - The offset into the array. - * @return {Vector4} A reference to this vector. - */ - fromArray(array: Array, offset?: number): Vector4; - /** - * Writes the components of this vector to the given array. If no array is provided, - * the method returns a new instance. - * - * @param {Array} [array=[]] - The target array holding the vector components. - * @param {number} [offset=0] - Index of the first element in the array. - * @return {Array} The vector components. - */ - toArray(array?: Array, offset?: number): Array; - /** - * Sets the components of this vector from the given buffer attribute. - * - * @param {BufferAttribute} attribute - The buffer attribute holding vector data. - * @param {number} index - The index into the attribute. - * @return {Vector4} A reference to this vector. - */ - fromBufferAttribute(attribute: BufferAttribute, index: number): Vector4; - /** - * Sets each component of this vector to a pseudo-random value between `0` and - * `1`, excluding `1`. - * - * @return {Vector4} A reference to this vector. - */ - random(): Vector4; - [Symbol.iterator](): Generator; -} diff --git a/jsdoc-testing/jsdoc/math/interpolants/BezierInterpolant.d.ts b/jsdoc-testing/jsdoc/math/interpolants/BezierInterpolant.d.ts deleted file mode 100644 index 445b0e1f5..000000000 --- a/jsdoc-testing/jsdoc/math/interpolants/BezierInterpolant.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * A Bezier interpolant using cubic Bezier curves with 2D control points. - * - * This interpolant supports the COLLADA/Maya style of Bezier animation where - * each keyframe has explicit in/out tangent control points specified as - * 2D coordinates (time, value). - * - * The tangent data must be provided via the `settings` object: - * - `settings.inTangents`: Float32Array with [time, value] pairs per keyframe per component - * - `settings.outTangents`: Float32Array with [time, value] pairs per keyframe per component - * - * For a track with N keyframes and stride S: - * - Each tangent array has N * S * 2 values - * - Layout: [k0_c0_time, k0_c0_value, k0_c1_time, k0_c1_value, ..., k0_cS_time, k0_cS_value, - * k1_c0_time, k1_c0_value, ...] - * - * @augments Interpolant - */ -export class BezierInterpolant extends Interpolant { - interpolate_(i1: any, t0: any, t: any, t1: any): TypedArray; -} -import { Interpolant } from '../Interpolant.js'; diff --git a/jsdoc-testing/jsdoc/math/interpolants/CubicInterpolant.d.ts b/jsdoc-testing/jsdoc/math/interpolants/CubicInterpolant.d.ts deleted file mode 100644 index ca53c5e9a..000000000 --- a/jsdoc-testing/jsdoc/math/interpolants/CubicInterpolant.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Fast and simple cubic spline interpolant. - * - * It was derived from a Hermitian construction setting the first derivative - * at each sample position to the linear slope between neighboring positions - * over their parameter interval. - * - * @augments Interpolant - */ -export class CubicInterpolant extends Interpolant { - _weightPrev: number; - _offsetPrev: number; - _weightNext: number; - _offsetNext: number; - DefaultSettings_: { - endingStart: number; - endingEnd: number; - }; - intervalChanged_(i1: any, t0: any, t1: any): void; - interpolate_(i1: any, t0: any, t: any, t1: any): TypedArray; -} -import { Interpolant } from '../Interpolant.js'; diff --git a/jsdoc-testing/jsdoc/math/interpolants/DiscreteInterpolant.d.ts b/jsdoc-testing/jsdoc/math/interpolants/DiscreteInterpolant.d.ts deleted file mode 100644 index 04ce01eb6..000000000 --- a/jsdoc-testing/jsdoc/math/interpolants/DiscreteInterpolant.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Interpolant that evaluates to the sample value at the position preceding - * the parameter. - * - * @augments Interpolant - */ -export class DiscreteInterpolant extends Interpolant { - interpolate_(i1: any): TypedArray; -} -import { Interpolant } from '../Interpolant.js'; diff --git a/jsdoc-testing/jsdoc/math/interpolants/LinearInterpolant.d.ts b/jsdoc-testing/jsdoc/math/interpolants/LinearInterpolant.d.ts deleted file mode 100644 index d36003868..000000000 --- a/jsdoc-testing/jsdoc/math/interpolants/LinearInterpolant.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * A basic linear interpolant. - * - * @augments Interpolant - */ -export class LinearInterpolant extends Interpolant { - interpolate_(i1: any, t0: any, t: any, t1: any): TypedArray; -} -import { Interpolant } from '../Interpolant.js'; diff --git a/jsdoc-testing/jsdoc/math/interpolants/QuaternionLinearInterpolant.d.ts b/jsdoc-testing/jsdoc/math/interpolants/QuaternionLinearInterpolant.d.ts deleted file mode 100644 index e8ddddc6e..000000000 --- a/jsdoc-testing/jsdoc/math/interpolants/QuaternionLinearInterpolant.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Spherical linear unit quaternion interpolant. - * - * @augments Interpolant - */ -export class QuaternionLinearInterpolant extends Interpolant { - interpolate_(i1: any, t0: any, t: any, t1: any): TypedArray; -} -import { Interpolant } from '../Interpolant.js'; diff --git a/jsdoc-testing/jsdoc/nodes/Nodes.d.ts b/jsdoc-testing/jsdoc/nodes/Nodes.d.ts deleted file mode 100644 index 5fb46b9ae..000000000 --- a/jsdoc-testing/jsdoc/nodes/Nodes.d.ts +++ /dev/null @@ -1,140 +0,0 @@ -export * from "./core/constants.js"; -export { default as ArrayNode } from "./core/ArrayNode.js"; -export { default as AssignNode } from "./core/AssignNode.js"; -export { default as AttributeNode } from "./core/AttributeNode.js"; -export { default as BypassNode } from "./core/BypassNode.js"; -export { default as ConstNode } from "./core/ConstNode.js"; -export { default as ContextNode } from "./core/ContextNode.js"; -export { default as IndexNode } from "./core/IndexNode.js"; -export { default as InputNode } from "./core/InputNode.js"; -export { default as InspectorNode } from "./core/InspectorNode.js"; -export { default as IsolateNode } from "./core/IsolateNode.js"; -export { default as LightingModel } from "./core/LightingModel.js"; -export { default as MRTNode } from "./core/MRTNode.js"; -export { default as Node } from "./core/Node.js"; -export { default as NodeAttribute } from "./core/NodeAttribute.js"; -export { default as NodeBuilder } from "./core/NodeBuilder.js"; -export { default as NodeCache } from "./core/NodeCache.js"; -export { default as NodeCode } from "./core/NodeCode.js"; -export { default as NodeError } from "./core/NodeError.js"; -export { default as NodeFrame } from "./core/NodeFrame.js"; -export { default as NodeFunctionInput } from "./core/NodeFunctionInput.js"; -export { default as NodeUniform } from "./core/NodeUniform.js"; -export { default as NodeVar } from "./core/NodeVar.js"; -export { default as NodeVarying } from "./core/NodeVarying.js"; -export { default as OutputStructNode } from "./core/OutputStructNode.js"; -export { default as ParameterNode } from "./core/ParameterNode.js"; -export { default as PropertyNode } from "./core/PropertyNode.js"; -export { default as StackNode } from "./core/StackNode.js"; -export { default as StackTrace } from "./core/StackTrace.js"; -export { default as StructNode } from "./core/StructNode.js"; -export { default as StructTypeNode } from "./core/StructTypeNode.js"; -export { default as SubBuildNode } from "./core/SubBuildNode.js"; -export { default as TempNode } from "./core/TempNode.js"; -export { default as UniformGroupNode } from "./core/UniformGroupNode.js"; -export { default as UniformNode } from "./core/UniformNode.js"; -export { default as VarNode } from "./core/VarNode.js"; -export { default as VaryingNode } from "./core/VaryingNode.js"; -export { NodeUtils }; -export { default as BatchNode } from "./accessors/BatchNode.js"; -export { default as BufferAttributeNode } from "./accessors/BufferAttributeNode.js"; -export { default as BufferNode } from "./accessors/BufferNode.js"; -export { default as BuiltinNode } from "./accessors/BuiltinNode.js"; -export { default as ClippingNode } from "./accessors/ClippingNode.js"; -export { default as CubeTextureNode } from "./accessors/CubeTextureNode.js"; -export { default as InstanceNode } from "./accessors/InstanceNode.js"; -export { default as InstancedMeshNode } from "./accessors/InstancedMeshNode.js"; -export { default as MaterialNode } from "./accessors/MaterialNode.js"; -export { default as MaterialReferenceNode } from "./accessors/MaterialReferenceNode.js"; -export { default as ModelNode } from "./accessors/ModelNode.js"; -export { default as MorphNode } from "./accessors/MorphNode.js"; -export { default as Object3DNode } from "./accessors/Object3DNode.js"; -export { default as PointUVNode } from "./accessors/PointUVNode.js"; -export { default as ReferenceBaseNode } from "./accessors/ReferenceBaseNode.js"; -export { default as ReferenceNode } from "./accessors/ReferenceNode.js"; -export { default as RendererReferenceNode } from "./accessors/RendererReferenceNode.js"; -export { default as SkinningNode } from "./accessors/SkinningNode.js"; -export { default as StorageBufferNode } from "./accessors/StorageBufferNode.js"; -export { default as StorageTextureNode } from "./accessors/StorageTextureNode.js"; -export { default as Texture3DNode } from "./accessors/Texture3DNode.js"; -export { default as TextureNode } from "./accessors/TextureNode.js"; -export { default as TextureSizeNode } from "./accessors/TextureSizeNode.js"; -export { default as UniformArrayNode } from "./accessors/UniformArrayNode.js"; -export { default as UserDataNode } from "./accessors/UserDataNode.js"; -export { default as VelocityNode } from "./accessors/VelocityNode.js"; -export { default as VertexColorNode } from "./accessors/VertexColorNode.js"; -export { default as CodeNode } from "./code/CodeNode.js"; -export { default as ExpressionNode } from "./code/ExpressionNode.js"; -export { default as FunctionCallNode } from "./code/FunctionCallNode.js"; -export { default as FunctionNode } from "./code/FunctionNode.js"; -export { default as BumpMapNode } from "./display/BumpMapNode.js"; -export { default as ColorSpaceNode } from "./display/ColorSpaceNode.js"; -export { default as FrontFacingNode } from "./display/FrontFacingNode.js"; -export { default as NormalMapNode } from "./display/NormalMapNode.js"; -export { default as PassNode } from "./display/PassNode.js"; -export { default as RenderOutputNode } from "./display/RenderOutputNode.js"; -export { default as ScreenNode } from "./display/ScreenNode.js"; -export { default as ToneMappingNode } from "./display/ToneMappingNode.js"; -export { default as ToonOutlinePassNode } from "./display/ToonOutlinePassNode.js"; -export { default as ViewportDepthNode } from "./display/ViewportDepthNode.js"; -export { default as ViewportDepthTextureNode } from "./display/ViewportDepthTextureNode.js"; -export { default as ViewportSharedTextureNode } from "./display/ViewportSharedTextureNode.js"; -export { default as ViewportTextureNode } from "./display/ViewportTextureNode.js"; -export { default as RangeNode } from "./geometry/RangeNode.js"; -export { default as AtomicFunctionNode } from "./gpgpu/AtomicFunctionNode.js"; -export { default as BarrierNode } from "./gpgpu/BarrierNode.js"; -export { default as ComputeBuiltinNode } from "./gpgpu/ComputeBuiltinNode.js"; -export { default as ComputeNode } from "./gpgpu/ComputeNode.js"; -export { default as SubgroupFunctionNode } from "./gpgpu/SubgroupFunctionNode.js"; -export { default as WorkgroupInfoNode } from "./gpgpu/WorkgroupInfoNode.js"; -export { default as AmbientLightNode } from "./lighting/AmbientLightNode.js"; -export { default as AnalyticLightNode } from "./lighting/AnalyticLightNode.js"; -export { default as AONode } from "./lighting/AONode.js"; -export { default as BasicEnvironmentNode } from "./lighting/BasicEnvironmentNode.js"; -export { default as BasicLightMapNode } from "./lighting/BasicLightMapNode.js"; -export { default as DirectionalLightNode } from "./lighting/DirectionalLightNode.js"; -export { default as EnvironmentNode } from "./lighting/EnvironmentNode.js"; -export { default as HemisphereLightNode } from "./lighting/HemisphereLightNode.js"; -export { default as IESSpotLightNode } from "./lighting/IESSpotLightNode.js"; -export { default as IrradianceNode } from "./lighting/IrradianceNode.js"; -export { default as LightingContextNode } from "./lighting/LightingContextNode.js"; -export { default as LightingNode } from "./lighting/LightingNode.js"; -export { default as LightProbeNode } from "./lighting/LightProbeNode.js"; -export { default as LightsNode } from "./lighting/LightsNode.js"; -export { default as PointLightNode } from "./lighting/PointLightNode.js"; -export { default as PointShadowNode } from "./lighting/PointShadowNode.js"; -export { default as ProjectorLightNode } from "./lighting/ProjectorLightNode.js"; -export { default as RectAreaLightNode } from "./lighting/RectAreaLightNode.js"; -export { default as ShadowBaseNode } from "./lighting/ShadowBaseNode.js"; -export { default as ShadowNode } from "./lighting/ShadowNode.js"; -export { default as SpotLightNode } from "./lighting/SpotLightNode.js"; -export { default as BitcastNode } from "./math/BitcastNode.js"; -export { default as BitcountNode } from "./math/BitcountNode.js"; -export { default as ConditionalNode } from "./math/ConditionalNode.js"; -export { default as MathNode } from "./math/MathNode.js"; -export { default as OperatorNode } from "./math/OperatorNode.js"; -export { default as PackFloatNode } from "./math/PackFloatNode.js"; -export { default as UnpackFloatNode } from "./math/UnpackFloatNode.js"; -export { default as GLSLNodeParser } from "./parsers/GLSLNodeParser.js"; -export { default as PMREMNode } from "./pmrem/PMREMNode.js"; -export { default as ArrayElementNode } from "./utils/ArrayElementNode.js"; -export { default as ConvertNode } from "./utils/ConvertNode.js"; -export { default as CubeMapNode } from "./utils/CubeMapNode.js"; -export { default as DebugNode } from "./utils/DebugNode.js"; -export { default as EventNode } from "./utils/EventNode.js"; -export { default as FlipNode } from "./utils/FlipNode.js"; -export { default as FunctionOverloadingNode } from "./utils/FunctionOverloadingNode.js"; -export { default as JoinNode } from "./utils/JoinNode.js"; -export { default as LoopNode } from "./utils/LoopNode.js"; -export { default as MaxMipLevelNode } from "./utils/MaxMipLevelNode.js"; -export { default as MemberNode } from "./utils/MemberNode.js"; -export { default as ReflectorNode } from "./utils/ReflectorNode.js"; -export { default as RotateNode } from "./utils/RotateNode.js"; -export { default as RTTNode } from "./utils/RTTNode.js"; -export { default as SampleNode } from "./utils/SampleNode.js"; -export { default as SetNode } from "./utils/SetNode.js"; -export { default as SplitNode } from "./utils/SplitNode.js"; -export { default as StorageArrayElementNode } from "./utils/StorageArrayElementNode.js"; -export { default as PhongLightingModel } from "./functions/PhongLightingModel.js"; -export { default as PhysicalLightingModel } from "./functions/PhysicalLightingModel.js"; -import * as NodeUtils from './core/NodeUtils.js'; diff --git a/jsdoc-testing/jsdoc/nodes/TSL.d.ts b/jsdoc-testing/jsdoc/nodes/TSL.d.ts deleted file mode 100644 index 05540a297..000000000 --- a/jsdoc-testing/jsdoc/nodes/TSL.d.ts +++ /dev/null @@ -1,136 +0,0 @@ -export * from "./core/constants.js"; -export * from "./core/AssignNode.js"; -export * from "./core/AttributeNode.js"; -export * from "./core/BypassNode.js"; -export * from "./core/IsolateNode.js"; -export * from "./core/ContextNode.js"; -export * from "./core/IndexNode.js"; -export * from "./core/ParameterNode.js"; -export * from "./core/PropertyNode.js"; -export * from "./core/StackNode.js"; -export * from "./core/StructNode.js"; -export * from "./core/UniformGroupNode.js"; -export * from "./core/UniformNode.js"; -export * from "./core/VaryingNode.js"; -export * from "./core/OutputStructNode.js"; -export * from "./core/MRTNode.js"; -export * from "./math/BitcastNode.js"; -export * from "./math/BitcountNode.js"; -export * from "./math/Hash.js"; -export * from "./math/MathUtils.js"; -export * from "./math/PackFloatNode.js"; -export * from "./math/UnpackFloatNode.js"; -export * from "./math/TriNoise3D.js"; -export * from "./utils/EquirectUV.js"; -export * from "./utils/FunctionOverloadingNode.js"; -export * from "./utils/LoopNode.js"; -export * from "./utils/MatcapUV.js"; -export * from "./utils/MaxMipLevelNode.js"; -export * from "./utils/Oscillators.js"; -export * from "./utils/Packing.js"; -export * from "./utils/Remap.js"; -export * from "./utils/UVUtils.js"; -export * from "./utils/SpriteUtils.js"; -export * from "./utils/ViewportUtils.js"; -export * from "./utils/RotateNode.js"; -export * from "./utils/SpriteSheetUV.js"; -export * from "./utils/Timer.js"; -export * from "./utils/TriplanarTextures.js"; -export * from "./utils/ReflectorNode.js"; -export * from "./utils/RTTNode.js"; -export * from "./utils/PostProcessingUtils.js"; -export * from "./utils/SampleNode.js"; -export * from "./utils/EventNode.js"; -export * from "./tsl/TSLBase.js"; -export * from "./accessors/AccessorsUtils.js"; -export * from "./accessors/Arrays.js"; -export * from "./accessors/UniformArrayNode.js"; -export * from "./accessors/Bitangent.js"; -export * from "./accessors/BufferAttributeNode.js"; -export * from "./accessors/BufferNode.js"; -export * from "./accessors/BuiltinNode.js"; -export * from "./accessors/Camera.js"; -export * from "./accessors/VertexColorNode.js"; -export * from "./accessors/CubeTextureNode.js"; -export * from "./accessors/InstanceNode.js"; -export * from "./accessors/InstancedMeshNode.js"; -export * from "./accessors/BatchNode.js"; -export * from "./accessors/MaterialNode.js"; -export * from "./accessors/MaterialProperties.js"; -export * from "./accessors/MaterialReferenceNode.js"; -export * from "./accessors/RendererReferenceNode.js"; -export * from "./accessors/MorphNode.js"; -export * from "./accessors/TextureBicubic.js"; -export * from "./accessors/ModelNode.js"; -export * from "./accessors/ModelViewProjectionNode.js"; -export * from "./accessors/Normal.js"; -export * from "./accessors/Object3DNode.js"; -export * from "./accessors/PointUVNode.js"; -export * from "./accessors/Position.js"; -export * from "./accessors/ReferenceNode.js"; -export * from "./accessors/ReflectVector.js"; -export * from "./accessors/SkinningNode.js"; -export * from "./accessors/SceneProperties.js"; -export * from "./accessors/StorageBufferNode.js"; -export * from "./accessors/Tangent.js"; -export * from "./accessors/TextureNode.js"; -export * from "./accessors/TextureSizeNode.js"; -export * from "./accessors/StorageTextureNode.js"; -export * from "./accessors/Texture3DNode.js"; -export * from "./accessors/UV.js"; -export * from "./accessors/UserDataNode.js"; -export * from "./accessors/VelocityNode.js"; -export * from "./display/BlendModes.js"; -export * from "./display/BumpMapNode.js"; -export * from "./display/ColorAdjustment.js"; -export * from "./display/ColorSpaceNode.js"; -export * from "./display/FrontFacingNode.js"; -export * from "./display/NormalMapNode.js"; -export * from "./display/ToneMappingNode.js"; -export * from "./display/ScreenNode.js"; -export * from "./display/ViewportTextureNode.js"; -export * from "./display/ViewportSharedTextureNode.js"; -export * from "./display/ViewportDepthTextureNode.js"; -export * from "./display/ViewportDepthNode.js"; -export * from "./display/RenderOutputNode.js"; -export * from "./display/ToonOutlinePassNode.js"; -export * from "./display/PassNode.js"; -export * from "./display/ColorSpaceFunctions.js"; -export * from "./display/ToneMappingFunctions.js"; -export * from "./code/ExpressionNode.js"; -export * from "./code/CodeNode.js"; -export * from "./code/FunctionCallNode.js"; -export * from "./code/FunctionNode.js"; -export * from "./fog/Fog.js"; -export * from "./geometry/RangeNode.js"; -export * from "./gpgpu/ComputeNode.js"; -export * from "./gpgpu/ComputeBuiltinNode.js"; -export * from "./gpgpu/BarrierNode.js"; -export * from "./gpgpu/WorkgroupInfoNode.js"; -export * from "./gpgpu/AtomicFunctionNode.js"; -export * from "./gpgpu/SubgroupFunctionNode.js"; -export * from "./accessors/Lights.js"; -export * from "./lighting/LightsNode.js"; -export * from "./lighting/LightingContextNode.js"; -export * from "./lighting/ShadowBaseNode.js"; -export * from "./lighting/ShadowNode.js"; -export * from "./lighting/ShadowFilterNode.js"; -export * from "./lighting/PointShadowNode.js"; -export * from "./lighting/PointLightNode.js"; -export * from "./pmrem/PMREMNode.js"; -export * from "./pmrem/PMREMUtils.js"; -export * from "./procedural/Checker.js"; -export * from "./shapes/Shapes.js"; -export * from "./materialx/MaterialXNodes.js"; -export * from "./lighting/LightUtils.js"; -export { default as BRDF_GGX } from "./functions/BSDF/BRDF_GGX.js"; -export { default as BRDF_Lambert } from "./functions/BSDF/BRDF_Lambert.js"; -export { default as D_GGX } from "./functions/BSDF/D_GGX.js"; -export { default as DFGLUT } from "./functions/BSDF/DFGLUT.js"; -export { default as F_Schlick } from "./functions/BSDF/F_Schlick.js"; -export { default as Schlick_to_F0 } from "./functions/BSDF/Schlick_to_F0.js"; -export { default as V_GGX_SmithCorrelated } from "./functions/BSDF/V_GGX_SmithCorrelated.js"; -export { default as getGeometryRoughness } from "./functions/material/getGeometryRoughness.js"; -export { default as getParallaxCorrectNormal } from "./functions/material/getParallaxCorrectNormal.js"; -export { default as getRoughness } from "./functions/material/getRoughness.js"; -export { default as getShIrradianceAt } from "./functions/material/getShIrradianceAt.js"; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/AccessorsUtils.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/AccessorsUtils.d.ts deleted file mode 100644 index 07177caec..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/AccessorsUtils.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * TSL object that represents the TBN matrix in view space. - * - * @tsl - * @type {Node} - */ -export const TBNViewMatrix: Node; -/** - * TSL object that represents the parallax direction. - * - * @tsl - * @type {Node} - */ -export const parallaxDirection: Node; -export function parallaxUV(uv: Node, scale: Node): Node; -/** - * TSL function for computing bent normals. - * - * @tsl - * @function - * @returns {Node} Bent normals. - */ -export const bentNormalView: any; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/Arrays.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/Arrays.d.ts deleted file mode 100644 index 6c9184803..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/Arrays.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export function attributeArray(count: number | TypedArray, type?: string | Struct): StorageBufferNode; -export function instancedArray(count: number | TypedArray, type?: string | Struct): StorageBufferNode; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/BatchNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/BatchNode.d.ts deleted file mode 100644 index 1fa7fd4cc..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/BatchNode.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -export default BatchNode; -/** - * TSL function for creating a batch node. - * - * @tsl - * @function - * @param {BatchedMesh} batchMesh - A reference to batched mesh. - * @returns {BatchNode} - */ -export const batch: any; -/** - * This node implements the vertex shader logic which is required - * when rendering 3D objects via batching. `BatchNode` must be used - * with instances of {@link BatchedMesh}. - * - * @augments Node - */ -declare class BatchNode extends Node { - /** - * Constructs a new batch node. - * - * @param {BatchedMesh} batchMesh - A reference to batched mesh. - */ - constructor(batchMesh: BatchedMesh); - /** - * A reference to batched mesh. - * - * @type {BatchedMesh} - */ - batchMesh: BatchedMesh; - /** - * The batching index node. - * - * @type {?IndexNode} - * @default null - */ - batchingIdNode: IndexNode | null; - /** - * Setups the internal buffers and nodes and assigns the transformed vertex data - * to predefined node variables for accumulation. That follows the same patterns - * like with morph and skinning nodes. - * - * @param {NodeBuilder} builder - The current node builder. - */ - setup(builder: NodeBuilder): void; -} -import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/Bitangent.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/Bitangent.d.ts deleted file mode 100644 index 7694a53fc..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/Bitangent.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * TSL object that represents the bitangent attribute of the current rendered object. - * - * @tsl - * @type {Node} - */ -export const bitangentGeometry: Node; -/** - * TSL object that represents the vertex bitangent in local space of the current rendered object. - * - * @tsl - * @type {Node} - */ -export const bitangentLocal: Node; -/** - * TSL object that represents the vertex bitangent in view space of the current rendered object. - * - * @tsl - * @type {Node} - */ -export const bitangentView: Node; -/** - * TSL object that represents the vertex bitangent in world space of the current rendered object. - * - * @tsl - * @type {Node} - */ -export const bitangentWorld: Node; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/BufferAttributeNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/BufferAttributeNode.d.ts deleted file mode 100644 index 60775a2a1..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/BufferAttributeNode.d.ts +++ /dev/null @@ -1,143 +0,0 @@ -export default BufferAttributeNode; -export function bufferAttribute(array: BufferAttribute | InterleavedBuffer | TypedArray, type?: string | null, stride?: number, offset?: number): BufferAttributeNode | Node; -export function dynamicBufferAttribute(array: BufferAttribute | InterleavedBuffer | TypedArray, type?: string | null, stride?: number, offset?: number): BufferAttributeNode | Node; -export function instancedBufferAttribute(array: BufferAttribute | InterleavedBuffer | TypedArray, type?: string | null, stride?: number, offset?: number): BufferAttributeNode | Node; -export function instancedDynamicBufferAttribute(array: BufferAttribute | InterleavedBuffer | TypedArray, type?: string | null, stride?: number, offset?: number): BufferAttributeNode | Node; -/** - * In earlier `three.js` versions it was only possible to define attribute data - * on geometry level. With `BufferAttributeNode`, it is also possible to do this - * on the node level. - * ```js - * const geometry = new THREE.PlaneGeometry(); - * const positionAttribute = geometry.getAttribute( 'position' ); - * - * const colors = []; - * for ( let i = 0; i < position.count; i ++ ) { - * colors.push( 1, 0, 0 ); - * } - * - * material.colorNode = bufferAttribute( new THREE.Float32BufferAttribute( colors, 3 ) ); - * ``` - * This new approach is especially interesting when geometry data are generated via - * compute shaders. The below line converts a storage buffer into an attribute node. - * ```js - * material.positionNode = positionBuffer.toAttribute(); - * ``` - * @augments InputNode - */ -declare class BufferAttributeNode extends InputNode { - /** - * Constructs a new buffer attribute node. - * - * @param {BufferAttribute|InterleavedBuffer|TypedArray} value - The attribute data. - * @param {?string} [bufferType=null] - The buffer type (e.g. `'vec3'`). - * @param {number} [bufferStride=0] - The buffer stride. - * @param {number} [bufferOffset=0] - The buffer offset. - */ - constructor(value: BufferAttribute | InterleavedBuffer | TypedArray, bufferType?: string | null, bufferStride?: number, bufferOffset?: number); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isBufferNode: boolean; - /** - * The buffer type (e.g. `'vec3'`). - * - * @type {?string} - * @default null - */ - bufferType: string | null; - /** - * The buffer stride. - * - * @type {number} - * @default 0 - */ - bufferStride: number; - /** - * The buffer offset. - * - * @type {number} - * @default 0 - */ - bufferOffset: number; - /** - * The usage property. Set this to `THREE.DynamicDrawUsage` via `.setUsage()`, - * if you are planning to update the attribute data per frame. - * - * @type {number} - * @default StaticDrawUsage - */ - usage: number; - /** - * Whether the attribute is instanced or not. - * - * @type {boolean} - * @default false - */ - instanced: boolean; - /** - * A reference to the buffer attribute. - * - * @type {?BufferAttribute} - * @default null - */ - attribute: BufferAttribute | null; - /** - * This method is overwritten since the attribute data might be shared - * and thus the hash should be shared as well. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The hash. - */ - getHash(builder: NodeBuilder): string; - /** - * This method is overwritten since the node type is inferred from - * the buffer attribute. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The node type. - */ - generateNodeType(builder: NodeBuilder): string; - /** - * Depending on which value was passed to the node, `setup()` behaves - * differently. If no instance of `BufferAttribute` was passed, the method - * creates an internal attribute and configures it respectively. - * - * @param {NodeBuilder} builder - The current node builder. - */ - setup(builder: NodeBuilder): void; - /** - * Generates the code snippet of the buffer attribute node. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The generated code snippet. - */ - generate(builder: NodeBuilder): string; - /** - * Overwrites the default implementation to return a fixed value `'bufferAttribute'`. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The input type. - */ - getInputType(): string; - /** - * Sets the `usage` property to the given value. - * - * @param {number} value - The usage to set. - * @return {BufferAttributeNode} A reference to this node. - */ - setUsage(value: number): BufferAttributeNode; - /** - * Sets the `instanced` property to the given value. - * - * @param {boolean} value - The value to set. - * @return {BufferAttributeNode} A reference to this node. - */ - setInstanced(value: boolean): BufferAttributeNode; -} -import { InterleavedBuffer } from '../../core/InterleavedBuffer.js'; -import InputNode from '../core/InputNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/BufferNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/BufferNode.d.ts deleted file mode 100644 index a0765ba1c..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/BufferNode.d.ts +++ /dev/null @@ -1,75 +0,0 @@ -export default BufferNode; -export function buffer(value: Array, type: string, count: number): BufferNode; -/** - * A special type of uniform node which represents array-like data - * as uniform buffers. The access usually happens via `element()` - * which returns an instance of {@link ArrayElementNode}. For example: - * - * ```js - * const bufferNode = buffer( array, 'mat4', count ); - * const matrixNode = bufferNode.element( index ); // access a matrix from the buffer - * ``` - * In general, it is recommended to use the more managed {@link UniformArrayNode} - * since it handles more input types and automatically cares about buffer paddings. - * - * @augments UniformNode - */ -declare class BufferNode extends UniformNode { - /** - * Constructs a new buffer node. - * - * @param {Array} value - Array-like buffer data. - * @param {string} bufferType - The data type of the buffer. - * @param {number} [bufferCount=0] - The count of buffer elements. - */ - constructor(value: Array, bufferType: string, bufferCount?: number); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isBufferNode: boolean; - /** - * The data type of the buffer. - * - * @type {string} - */ - bufferType: string; - /** - * The uniform node that holds the value of the reference node. - * - * @type {number} - * @default 0 - */ - bufferCount: number; - /** - * An array of update ranges. - * - * @type {Array<{start: number, count: number}>} - */ - updateRanges: Array<{ - start: number; - count: number; - }>; - /** - * Adds a range of data in the data array to be updated on the GPU. - * - * @param {number} start - Position at which to start update. - * @param {number} count - The number of components to update. - */ - addUpdateRange(start: number, count: number): void; - /** - * Clears the update ranges. - */ - clearUpdateRanges(): void; - /** - * Overwrites the default implementation to return a fixed value `'buffer'`. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The input type. - */ - getInputType(): string; -} -import UniformNode from '../core/UniformNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/BuiltinNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/BuiltinNode.d.ts deleted file mode 100644 index 1081d0ec4..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/BuiltinNode.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -export default BuiltinNode; -/** - * TSL function for creating a builtin node. - * - * @tsl - * @function - * @param {string} name - The name of the built-in shader variable. - * @returns {BuiltinNode} - */ -export const builtin: any; -/** - * The node allows to set values for built-in shader variables. That is - * required for features like hardware-accelerated vertex clipping. - * - * @augments Node - */ -declare class BuiltinNode extends Node { - /** - * Constructs a new builtin node. - * - * @param {string} name - The name of the built-in shader variable. - */ - constructor(name: string); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isBuiltinNode: boolean; - /** - * Generates the code snippet of the builtin node. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The generated code snippet. - */ - generate(): string; -} -import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/Camera.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/Camera.d.ts deleted file mode 100644 index 1af86bd26..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/Camera.d.ts +++ /dev/null @@ -1,70 +0,0 @@ -/** - * TSL object that represents the current `index` value of the camera if used ArrayCamera. - * - * @tsl - * @type {UniformNode} - */ -export const cameraIndex: UniformNode; -/** - * TSL object that represents the `near` value of the camera used for the current render. - * - * @tsl - * @type {UniformNode} - */ -export const cameraNear: UniformNode; -/** - * TSL object that represents the `far` value of the camera used for the current render. - * - * @tsl - * @type {UniformNode} - */ -export const cameraFar: UniformNode; -/** - * TSL object that represents the projection matrix of the camera used for the current render. - * - * @tsl - * @type {UniformNode} - */ -export const cameraProjectionMatrix: UniformNode; -/** - * TSL object that represents the inverse projection matrix of the camera used for the current render. - * - * @tsl - * @type {UniformNode} - */ -export const cameraProjectionMatrixInverse: UniformNode; -/** - * TSL object that represents the view matrix of the camera used for the current render. - * - * @tsl - * @type {UniformNode} - */ -export const cameraViewMatrix: UniformNode; -/** - * TSL object that represents the world matrix of the camera used for the current render. - * - * @tsl - * @type {UniformNode} - */ -export const cameraWorldMatrix: UniformNode; -/** - * TSL object that represents the normal matrix of the camera used for the current render. - * - * @tsl - * @type {UniformNode} - */ -export const cameraNormalMatrix: UniformNode; -/** - * TSL object that represents the position in world space of the camera used for the current render. - * - * @tsl - * @type {UniformNode} - */ -export const cameraPosition: UniformNode; -/** - * TSL object that represents the viewport of the camera used for the current render. - * - * @tsl - * @type {UniformNode} - */ -export const cameraViewport: UniformNode; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/ClippingNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/ClippingNode.d.ts deleted file mode 100644 index 5ee80d125..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/ClippingNode.d.ts +++ /dev/null @@ -1,65 +0,0 @@ -export default ClippingNode; -export function clipping(): ClippingNode; -export function clippingAlpha(): ClippingNode; -export function hardwareClipping(): ClippingNode; -/** - * This node is used in {@link NodeMaterial} to setup the clipping - * which can happen hardware-accelerated (if supported) and optionally - * use alpha-to-coverage for anti-aliasing clipped edges. - * - * @augments Node - */ -declare class ClippingNode extends Node { - /** - * Constructs a new clipping node. - * - * @param {('default'|'hardware'|'alphaToCoverage')} [scope='default'] - The node's scope. Similar to other nodes, - * the selected scope influences the behavior of the node and what type of code is generated. - */ - constructor(scope?: ("default" | "hardware" | "alphaToCoverage")); - /** - * The node's scope. Similar to other nodes, the selected scope influences - * the behavior of the node and what type of code is generated. - * - * @type {('default'|'hardware'|'alphaToCoverage')} - */ - scope: ("default" | "hardware" | "alphaToCoverage"); - /** - * Setups the node depending on the selected scope. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {Node} The result node. - */ - setup(builder: NodeBuilder): Node; - hardwareClipping: any; - /** - * Setups alpha to coverage. - * - * @param {Array} intersectionPlanes - The intersection planes. - * @param {Array} unionPlanes - The union planes. - * @return {Node} The result node. - */ - setupAlphaToCoverage(intersectionPlanes: Array, unionPlanes: Array): Node; - /** - * Setups the default clipping. - * - * @param {Array} intersectionPlanes - The intersection planes. - * @param {Array} unionPlanes - The union planes. - * @return {Node} The result node. - */ - setupDefault(intersectionPlanes: Array, unionPlanes: Array): Node; - /** - * Setups hardware clipping. - * - * @param {Array} unionPlanes - The union planes. - * @param {NodeBuilder} builder - The current node builder. - * @return {Node} The result node. - */ - setupHardwareClipping(unionPlanes: Array, builder: NodeBuilder): Node; -} -declare namespace ClippingNode { - let ALPHA_TO_COVERAGE: string; - let DEFAULT: string; - let HARDWARE: string; -} -import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/CubeTextureNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/CubeTextureNode.d.ts deleted file mode 100644 index 23a01c90a..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/CubeTextureNode.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -export default CubeTextureNode; -/** - * TSL function for creating a cube texture node. - * - * @tsl - * @function - * @param {CubeTexture} value - The cube texture. - * @param {?Node} [uvNode=null] - The uv node. - * @param {?Node} [levelNode=null] - The level node. - * @param {?Node} [biasNode=null] - The bias node. - * @returns {CubeTextureNode} - */ -export const cubeTextureBase: any; -export function cubeTexture(value?: (CubeTexture | CubeTextureNode) | null, uvNode?: Node | null, levelNode?: Node | null, biasNode?: Node | null): CubeTextureNode; -export function uniformCubeTexture(value?: CubeTexture | null): CubeTextureNode; -/** - * This type of uniform node represents a cube texture. - * - * @augments TextureNode - */ -declare class CubeTextureNode extends TextureNode { - /** - * Constructs a new cube texture node. - * - * @param {CubeTexture} value - The cube texture. - * @param {?Node} [uvNode=null] - The uv node. - * @param {?Node} [levelNode=null] - The level node. - * @param {?Node} [biasNode=null] - The bias node. - */ - constructor(value: CubeTexture, uvNode?: Node | null, levelNode?: Node | null, biasNode?: Node | null); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isCubeTextureNode: boolean; - /** - * Overwritten with an empty implementation since the `updateMatrix` flag is ignored - * for cube textures. The uv transformation matrix is not applied to cube textures. - * - * @param {boolean} value - The update toggle. - */ - setUpdateMatrix(): void; -} -import { CubeTexture } from '../../textures/CubeTexture.js'; -import TextureNode from './TextureNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/InstanceNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/InstanceNode.d.ts deleted file mode 100644 index 818fd503c..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/InstanceNode.d.ts +++ /dev/null @@ -1,125 +0,0 @@ -export default InstanceNode; -/** - * TSL function for creating an instance node. - * - * @tsl - * @function - * @param {number} count - The number of instances. - * @param {InstancedBufferAttribute|StorageInstancedBufferAttribute} instanceMatrix - Instanced buffer attribute representing the instance transformations. - * @param {?InstancedBufferAttribute|StorageInstancedBufferAttribute} instanceColor - Instanced buffer attribute representing the instance colors. - * @returns {InstanceNode} - */ -export const instance: any; -/** - * This node implements the vertex shader logic which is required - * when rendering 3D objects via instancing. The code makes sure - * vertex positions, normals and colors can be modified via instanced - * data. - * - * @augments Node - */ -declare class InstanceNode extends Node { - /** - * Constructs a new instance node. - * - * @param {number} count - The number of instances. - * @param {InstancedBufferAttribute|StorageInstancedBufferAttribute} instanceMatrix - Instanced buffer attribute representing the instance transformations. - * @param {?InstancedBufferAttribute|StorageInstancedBufferAttribute} instanceColor - Instanced buffer attribute representing the instance colors. - */ - constructor(count: number, instanceMatrix: InstancedBufferAttribute | StorageInstancedBufferAttribute, instanceColor?: (InstancedBufferAttribute | StorageInstancedBufferAttribute) | null); - /** - * The number of instances. - * - * @type {number} - */ - count: number; - /** - * Instanced buffer attribute representing the transformation of instances. - * - * @type {InstancedBufferAttribute} - */ - instanceMatrix: InstancedBufferAttribute; - /** - * Instanced buffer attribute representing the color of instances. - * - * @type {InstancedBufferAttribute} - */ - instanceColor: InstancedBufferAttribute; - /** - * The node that represents the instance matrix data. - * - * @type {?Node} - */ - instanceMatrixNode: Node | null; - /** - * The node that represents the instance color data. - * - * @type {?Node} - * @default null - */ - instanceColorNode: Node | null; - /** - * A reference to a buffer that is used by `instanceMatrixNode`. - * - * @type {?InstancedInterleavedBuffer} - */ - buffer: InstancedInterleavedBuffer | null; - /** - * A reference to a buffer that is used by `instanceColorNode`. - * - * @type {?InstancedBufferAttribute} - */ - bufferColor: InstancedBufferAttribute | null; - /** - * The previous instance matrices. Required for computing motion vectors. - * - * @type {?Node} - * @default null - */ - previousInstanceMatrixNode: Node | null; - /** - * Tracks whether the matrix data is provided via a storage buffer. - * - * @type {boolean} - */ - get isStorageMatrix(): boolean; - /** - * Tracks whether the color data is provided via a storage buffer. - * - * @type {boolean} - */ - get isStorageColor(): boolean; - /** - * Setups the internal buffers and nodes and assigns the transformed vertex data - * to predefined node variables for accumulation. That follows the same patterns - * like with morph and skinning nodes. - * - * @param {NodeBuilder} builder - The current node builder. - */ - setup(builder: NodeBuilder): void; - /** - * Checks if the internal buffers require an update. - * - * @param {NodeFrame} frame - The current node frame. - */ - update(frame: NodeFrame): void; - /** - * Computes the transformed/instanced vertex position of the previous frame. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {Node} The instanced position from the previous frame. - */ - getPreviousInstancedPosition(builder: NodeBuilder): Node; - /** - * Creates a node representing the instance matrix data. - * - * @private - * @param {boolean} assignBuffer - Whether the created interleaved buffer should be assigned to the `buffer` member or not. - * @param {NodeBuilder} builder - A reference to the current node builder. - * @return {Node} The instance matrix node. - */ - private _createInstanceMatrixNode; -} -import Node from '../core/Node.js'; -import { InstancedBufferAttribute } from '../../core/InstancedBufferAttribute.js'; -import { InstancedInterleavedBuffer } from '../../core/InstancedInterleavedBuffer.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/InstancedMeshNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/InstancedMeshNode.d.ts deleted file mode 100644 index d9619f9e8..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/InstancedMeshNode.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -export default InstancedMeshNode; -/** - * TSL function for creating an instanced mesh node. - * - * @tsl - * @function - * @param {InstancedMesh} instancedMesh - The instancedMesh. - * @returns {InstancedMeshNode} - */ -export const instancedMesh: any; -/** - * This is a special version of `InstanceNode` which requires the usage of {@link InstancedMesh}. - * It allows an easier setup of the instance node. - * - * @augments InstanceNode - */ -declare class InstancedMeshNode extends InstanceNode { - /** - * Constructs a new instanced mesh node. - * - * @param {InstancedMesh} instancedMesh - The instanced mesh. - */ - constructor(instancedMesh: InstancedMesh); - /** - * A reference to the instanced mesh. - * - * @type {InstancedMesh} - */ - instancedMesh: InstancedMesh; -} -import InstanceNode from './InstanceNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/Lights.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/Lights.d.ts deleted file mode 100644 index 1639939c2..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/Lights.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -/** - * TSL function for getting a shadow matrix uniform node for the given light. - * - * @tsl - * @function - * @param {Light} light -The light source. - * @returns {UniformNode} The shadow matrix uniform node. - */ -export function lightShadowMatrix(light: Light): UniformNode; -/** - * TSL function for getting projected uv coordinates for the given light. - * Relevant when using maps with spot lights. - * - * @tsl - * @function - * @param {Light} light -The light source. - * @param {Node} [position=positionWorld] -The position to project. - * @returns {Node} The projected uvs. - */ -export function lightProjectionUV(light: Light, position?: Node): Node; -/** - * TSL function for getting the position in world space for the given light. - * - * @tsl - * @function - * @param {Light} light -The light source. - * @returns {UniformNode} The light's position in world space. - */ -export function lightPosition(light: Light): UniformNode; -/** - * TSL function for getting the light target position in world space for the given light. - * - * @tsl - * @function - * @param {Light} light -The light source. - * @returns {UniformNode} The light target position in world space. - */ -export function lightTargetPosition(light: Light): UniformNode; -/** - * TSL function for getting the position in view space for the given light. - * - * @tsl - * @function - * @param {Light} light - The light source. - * @returns {UniformNode} The light's position in view space. - */ -export function lightViewPosition(light: Light): UniformNode; -export function lightTargetDirection(light: Light): Node; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/MaterialNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/MaterialNode.d.ts deleted file mode 100644 index 3bfbe299d..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/MaterialNode.d.ts +++ /dev/null @@ -1,384 +0,0 @@ -export default MaterialNode; -/** - * TSL object that represents alpha test of the current material. - * - * @tsl - * @type {Node} - */ -export const materialAlphaTest: Node; -/** - * TSL object that represents the diffuse color of the current material. - * The value is composed via `color` * `map`. - * - * @tsl - * @type {Node} - */ -export const materialColor: Node; -/** - * TSL object that represents the shininess of the current material. - * - * @tsl - * @type {Node} - */ -export const materialShininess: Node; -/** - * TSL object that represents the emissive color of the current material. - * The value is composed via `emissive` * `emissiveIntensity` * `emissiveMap`. - * - * @tsl - * @type {Node} - */ -export const materialEmissive: Node; -/** - * TSL object that represents the opacity of the current material. - * The value is composed via `opacity` * `alphaMap`. - * - * @tsl - * @type {Node} - */ -export const materialOpacity: Node; -/** - * TSL object that represents the specular of the current material. - * - * @tsl - * @type {Node} - */ -export const materialSpecular: Node; -/** - * TSL object that represents the specular intensity of the current material. - * The value is composed via `specularIntensity` * `specularMap.a`. - * - * @tsl - * @type {Node} - */ -export const materialSpecularIntensity: Node; -/** - * TSL object that represents the specular color of the current material. - * The value is composed via `specularColor` * `specularMap.rgb`. - * - * @tsl - * @type {Node} - */ -export const materialSpecularColor: Node; -/** - * TSL object that represents the specular strength of the current material. - * The value is composed via `specularMap.r`. - * - * @tsl - * @type {Node} - */ -export const materialSpecularStrength: Node; -/** - * TSL object that represents the reflectivity of the current material. - * - * @tsl - * @type {Node} - */ -export const materialReflectivity: Node; -/** - * TSL object that represents the roughness of the current material. - * The value is composed via `roughness` * `roughnessMap.g`. - * - * @tsl - * @type {Node} - */ -export const materialRoughness: Node; -/** - * TSL object that represents the metalness of the current material. - * The value is composed via `metalness` * `metalnessMap.b`. - * - * @tsl - * @type {Node} - */ -export const materialMetalness: Node; -/** - * TSL object that represents the normal of the current material. - * The value will be either `normalMap` * `normalScale`, `bumpMap` * `bumpScale` or `normalView`. - * - * @tsl - * @type {Node} - */ -export const materialNormal: Node; -/** - * TSL object that represents the clearcoat of the current material. - * The value is composed via `clearcoat` * `clearcoatMap.r` - * - * @tsl - * @type {Node} - */ -export const materialClearcoat: Node; -/** - * TSL object that represents the clearcoat roughness of the current material. - * The value is composed via `clearcoatRoughness` * `clearcoatRoughnessMap.r`. - * - * @tsl - * @type {Node} - */ -export const materialClearcoatRoughness: Node; -/** - * TSL object that represents the clearcoat normal of the current material. - * The value will be either `clearcoatNormalMap` or `normalView`. - * - * @tsl - * @type {Node} - */ -export const materialClearcoatNormal: Node; -/** - * TSL object that represents the rotation of the current sprite material. - * - * @tsl - * @type {Node} - */ -export const materialRotation: Node; -/** - * TSL object that represents the sheen color of the current material. - * The value is composed via `sheen` * `sheenColor` * `sheenColorMap`. - * - * @tsl - * @type {Node} - */ -export const materialSheen: Node; -/** - * TSL object that represents the sheen roughness of the current material. - * The value is composed via `sheenRoughness` * `sheenRoughnessMap.a`. - * - * @tsl - * @type {Node} - */ -export const materialSheenRoughness: Node; -/** - * TSL object that represents the anisotropy of the current material. - * - * @tsl - * @type {Node} - */ -export const materialAnisotropy: Node; -/** - * TSL object that represents the iridescence of the current material. - * - * @tsl - * @type {Node} - */ -export const materialIridescence: Node; -/** - * TSL object that represents the iridescence IOR of the current material. - * - * @tsl - * @type {Node} - */ -export const materialIridescenceIOR: Node; -/** - * TSL object that represents the iridescence thickness of the current material. - * - * @tsl - * @type {Node} - */ -export const materialIridescenceThickness: Node; -/** - * TSL object that represents the transmission of the current material. - * The value is composed via `transmission` * `transmissionMap.r`. - * - * @tsl - * @type {Node} - */ -export const materialTransmission: Node; -/** - * TSL object that represents the thickness of the current material. - * The value is composed via `thickness` * `thicknessMap.g`. - * - * @tsl - * @type {Node} - */ -export const materialThickness: Node; -/** - * TSL object that represents the IOR of the current material. - * - * @tsl - * @type {Node} - */ -export const materialIOR: Node; -/** - * TSL object that represents the attenuation distance of the current material. - * - * @tsl - * @type {Node} - */ -export const materialAttenuationDistance: Node; -/** - * TSL object that represents the attenuation color of the current material. - * - * @tsl - * @type {Node} - */ -export const materialAttenuationColor: Node; -/** - * TSL object that represents the scale of the current dashed line material. - * - * @tsl - * @type {Node} - */ -export const materialLineScale: Node; -/** - * TSL object that represents the dash size of the current dashed line material. - * - * @tsl - * @type {Node} - */ -export const materialLineDashSize: Node; -/** - * TSL object that represents the gap size of the current dashed line material. - * - * @tsl - * @type {Node} - */ -export const materialLineGapSize: Node; -/** - * TSL object that represents the line width of the current line material. - * - * @tsl - * @type {Node} - */ -export const materialLineWidth: Node; -/** - * TSL object that represents the dash offset of the current line material. - * - * @tsl - * @type {Node} - */ -export const materialLineDashOffset: Node; -/** - * TSL object that represents the point size of the current points material. - * - * @tsl - * @type {Node} - */ -export const materialPointSize: Node; -/** - * TSL object that represents the dispersion of the current material. - * - * @tsl - * @type {Node} - */ -export const materialDispersion: Node; -/** - * TSL object that represents the light map of the current material. - * The value is composed via `lightMapIntensity` * `lightMap.rgb`. - * - * @tsl - * @type {Node} - */ -export const materialLightMap: Node; -/** - * TSL object that represents the ambient occlusion map of the current material. - * The value is composed via `aoMap.r` - 1 * `aoMapIntensity` + 1. - * - * @tsl - * @type {Node} - */ -export const materialAO: Node; -/** - * TSL object that represents the anisotropy vector of the current material. - * - * @tsl - * @type {Node} - */ -export const materialAnisotropyVector: Node; -/** - * This class should simplify the node access to material properties. - * It internal uses reference nodes to make sure changes to material - * properties are automatically reflected to predefined TSL objects - * like e.g. `materialColor`. - * - * @augments Node - */ -declare class MaterialNode extends Node { - /** - * Constructs a new material node. - * - * @param {string} scope - The scope defines what kind of material property is referred by the node. - */ - constructor(scope: string); - /** - * The scope defines what material property is referred by the node. - * - * @type {string} - */ - scope: string; - /** - * Returns a cached reference node for the given property and type. - * - * @param {string} property - The name of the material property. - * @param {string} type - The uniform type of the property. - * @return {MaterialReferenceNode} A material reference node representing the property access. - */ - getCache(property: string, type: string): MaterialReferenceNode; - /** - * Returns a float-typed material reference node for the given property name. - * - * @param {string} property - The name of the material property. - * @return {MaterialReferenceNode} A material reference node representing the property access. - */ - getFloat(property: string): MaterialReferenceNode; - /** - * Returns a color-typed material reference node for the given property name. - * - * @param {string} property - The name of the material property. - * @return {MaterialReferenceNode} A material reference node representing the property access. - */ - getColor(property: string): MaterialReferenceNode; - /** - * Returns a texture-typed material reference node for the given property name. - * - * @param {string} property - The name of the material property. - * @return {MaterialReferenceNode} A material reference node representing the property access. - */ - getTexture(property: string): MaterialReferenceNode; - /** - * The node setup is done depending on the selected scope. Multiple material properties - * might be grouped into a single node composition if they logically belong together. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {Node} The node representing the selected scope. - */ - setup(builder: NodeBuilder): Node; -} -declare namespace MaterialNode { - let ALPHA_TEST: string; - let COLOR: string; - let OPACITY: string; - let SHININESS: string; - let SPECULAR: string; - let SPECULAR_STRENGTH: string; - let SPECULAR_INTENSITY: string; - let SPECULAR_COLOR: string; - let REFLECTIVITY: string; - let ROUGHNESS: string; - let METALNESS: string; - let NORMAL: string; - let CLEARCOAT: string; - let CLEARCOAT_ROUGHNESS: string; - let CLEARCOAT_NORMAL: string; - let EMISSIVE: string; - let ROTATION: string; - let SHEEN: string; - let SHEEN_ROUGHNESS: string; - let ANISOTROPY: string; - let IRIDESCENCE: string; - let IRIDESCENCE_IOR: string; - let IRIDESCENCE_THICKNESS: string; - let IOR: string; - let TRANSMISSION: string; - let THICKNESS: string; - let ATTENUATION_DISTANCE: string; - let ATTENUATION_COLOR: string; - let LINE_SCALE: string; - let LINE_DASH_SIZE: string; - let LINE_GAP_SIZE: string; - let LINE_WIDTH: string; - let LINE_DASH_OFFSET: string; - let POINT_SIZE: string; - let DISPERSION: string; - let LIGHT_MAP: string; - let AO: string; -} -import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/MaterialProperties.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/MaterialProperties.d.ts deleted file mode 100644 index 0525adf5a..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/MaterialProperties.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * TSL object that represents the refraction ratio of the material used for rendering the current object. - * - * @tsl - * @type {UniformNode} - */ -export const materialRefractionRatio: UniformNode; -/** - * TSL object that represents the intensity of environment maps of PBR materials. - * When `material.envMap` is set, the value is `material.envMapIntensity` otherwise `scene.environmentIntensity`. - * - * @tsl - * @type {Node} - */ -export const materialEnvIntensity: Node; -/** - * TSL object that represents the rotation of environment maps. - * When `material.envMap` is set, the value is `material.envMapRotation`. `scene.environmentRotation` controls the - * rotation of `scene.environment` instead. - * - * @tsl - * @type {Node} - */ -export const materialEnvRotation: Node; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/MaterialReferenceNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/MaterialReferenceNode.d.ts deleted file mode 100644 index 7a6029df8..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/MaterialReferenceNode.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -export default MaterialReferenceNode; -export function materialReference(name: string, type: string, material?: Material | null): MaterialReferenceNode; -/** - * This node is a special type of reference node which is intended - * for linking material properties with node values. - * ```js - * const opacityNode = materialReference( 'opacity', 'float', material ); - * ``` - * When changing `material.opacity`, the node value of `opacityNode` will - * automatically be updated. - * - * @augments ReferenceNode - */ -declare class MaterialReferenceNode extends ReferenceNode { - /** - * Constructs a new material reference node. - * - * @param {string} property - The name of the property the node refers to. - * @param {string} inputType - The uniform type that should be used to represent the property value. - * @param {?Material} [material=null] - The material the property belongs to. When no material is set, - * the node refers to the material of the current rendered object. - */ - constructor(property: string, inputType: string, material?: Material | null); - /** - * The material the property belongs to. When no material is set, - * the node refers to the material of the current rendered object. - * - * @type {?Material} - * @default null - */ - material: Material | null; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isMaterialReferenceNode: boolean; -} -import ReferenceNode from './ReferenceNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/ModelNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/ModelNode.d.ts deleted file mode 100644 index b5523dfa3..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/ModelNode.d.ts +++ /dev/null @@ -1,104 +0,0 @@ -export default ModelNode; -/** - * TSL object that represents the object's direction in world space. - * - * @tsl - * @type {ModelNode} - */ -export const modelDirection: ModelNode; -/** - * TSL object that represents the object's world matrix. - * - * @tsl - * @type {ModelNode} - */ -export const modelWorldMatrix: ModelNode; -/** - * TSL object that represents the object's position in world space. - * - * @tsl - * @type {ModelNode} - */ -export const modelPosition: ModelNode; -/** - * TSL object that represents the object's scale in world space. - * - * @tsl - * @type {ModelNode} - */ -export const modelScale: ModelNode; -/** - * TSL object that represents the object's position in view/camera space. - * - * @tsl - * @type {ModelNode} - */ -export const modelViewPosition: ModelNode; -/** - * TSL object that represents the object's radius. - * - * @tsl - * @type {ModelNode} - */ -export const modelRadius: ModelNode; -/** - * TSL object that represents the object's normal matrix. - * - * @tsl - * @type {UniformNode} - */ -export const modelNormalMatrix: UniformNode; -/** - * TSL object that represents the object's inverse world matrix. - * - * @tsl - * @type {UniformNode} - */ -export const modelWorldMatrixInverse: UniformNode; -/** - * TSL object that represents the object's model view matrix. - * - * @tsl - * @type {Node} - */ -export const modelViewMatrix: Node; -/** - * TSL object that represents the object's model view in `mediump` precision. - * - * @tsl - * @type {Node} - */ -export const mediumpModelViewMatrix: Node; -/** - * TSL object that represents the object's model view in `highp` precision - * which is achieved by computing the matrix in JS and not in the shader. - * - * @tsl - * @type {Node} - */ -export const highpModelViewMatrix: Node; -/** - * TSL object that represents the object's model normal view in `highp` precision - * which is achieved by computing the matrix in JS and not in the shader. - * - * @tsl - * @type {Node} - */ -export const highpModelNormalViewMatrix: Node; -/** - * This type of node is a specialized version of `Object3DNode` - * with larger set of model related metrics. Unlike `Object3DNode`, - * `ModelNode` extracts the reference to the 3D object from the - * current node frame state. - * - * @augments Object3DNode - */ -declare class ModelNode extends Object3DNode { - /** - * Constructs a new object model node. - * - * @param {('position'|'viewPosition'|'direction'|'scale'|'worldMatrix')} scope - The node represents a different type of transformation depending on the scope. - */ - constructor(scope: ("position" | "viewPosition" | "direction" | "scale" | "worldMatrix")); -} -import Object3DNode from './Object3DNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/ModelViewProjectionNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/ModelViewProjectionNode.d.ts deleted file mode 100644 index 40d0ac691..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/ModelViewProjectionNode.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -/** - * TSL object that represents the position in clip space after the model-view-projection transform of the current rendered object. - * - * @tsl - * @type {VaryingNode} - */ -export const modelViewProjection: VaryingNode; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/MorphNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/MorphNode.d.ts deleted file mode 100644 index 70c2b991f..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/MorphNode.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -export default MorphNode; -/** - * TSL function for creating a morph node. - * - * @tsl - * @function - * @param {Mesh} mesh - The mesh holding the morph targets. - * @returns {MorphNode} - */ -export const morphReference: any; -/** - * This node implements the vertex transformation shader logic which is required - * for morph target animation. - * - * @augments Node - */ -declare class MorphNode extends Node { - /** - * Constructs a new morph node. - * - * @param {Mesh} mesh - The mesh holding the morph targets. - */ - constructor(mesh: Mesh); - /** - * The mesh holding the morph targets. - * - * @type {Mesh} - */ - mesh: Mesh; - /** - * A uniform node which represents the morph base influence value. - * - * @type {UniformNode} - */ - morphBaseInfluence: UniformNode; - /** - * Setups the morph node by assigning the transformed vertex data to predefined node variables. - * - * @param {NodeBuilder} builder - The current node builder. - */ - setup(builder: NodeBuilder): void; - /** - * Updates the state of the morphed mesh by updating the base influence. - * - * @param {NodeFrame} frame - The current node frame. - */ - update(): void; -} -import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/Normal.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/Normal.d.ts deleted file mode 100644 index b75ce8778..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/Normal.d.ts +++ /dev/null @@ -1,100 +0,0 @@ -/** - * TSL object that represents the normal attribute of the current rendered object in local space. - * - * @tsl - * @type {Node} - */ -export const normalGeometry: Node; -/** - * TSL object that represents the vertex normal of the current rendered object in local space. - * - * @tsl - * @type {Node} - */ -export const normalLocal: Node; -/** - * TSL object that represents the flat vertex normal of the current rendered object in view space. - * - * @tsl - * @type {Node} - */ -export const normalFlat: Node; -/** - * TSL object that represents the vertex normal of the current rendered object in view space. - * - * @tsl - * @type {Node} - */ -export const normalViewGeometry: Node; -/** - * TSL object that represents the vertex normal of the current rendered object in world space. - * - * @tsl - * @type {Node} - */ -export const normalWorldGeometry: Node; -/** - * TSL object that represents the vertex normal of the current rendered object in view space. - * - * @tsl - * @type {Node} - */ -export const normalView: Node; -/** - * TSL object that represents the vertex normal of the current rendered object in world space. - * - * @tsl - * @type {Node} - */ -export const normalWorld: Node; -/** - * TSL object that represents the clearcoat vertex normal of the current rendered object in view space. - * - * @tsl - * @type {Node} - */ -export const clearcoatNormalView: Node; -/** - * Transforms the normal with the given matrix. - * - * @tsl - * @function - * @param {Node} normal - The normal. - * @param {Node} [matrix=modelWorldMatrix] - The matrix. - * @return {Node} The transformed normal. - */ -export const transformNormal: () => void; -/** - * Transforms the given normal from local to view space. - * - * @tsl - * @function - * @param {Node} normal - The normal. - * @param {NodeBuilder} builder - The current node builder. - * @return {Node} The transformed normal. - */ -export const transformNormalToView: () => void; -/** - * TSL object that represents the transformed vertex normal of the current rendered object in view space. - * - * @tsl - * @type {Node} - * @deprecated since r178. Use `normalView` instead. - */ -export const transformedNormalView: Node; -/** - * TSL object that represents the transformed vertex normal of the current rendered object in world space. - * - * @tsl - * @type {Node} - * @deprecated since r178. Use `normalWorld` instead. - */ -export const transformedNormalWorld: Node; -/** - * TSL object that represents the transformed clearcoat vertex normal of the current rendered object in view space. - * - * @tsl - * @type {Node} - * @deprecated since r178. Use `clearcoatNormalView` instead. - */ -export const transformedClearcoatNormalView: Node; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/Object3DNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/Object3DNode.d.ts deleted file mode 100644 index 99b15b948..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/Object3DNode.d.ts +++ /dev/null @@ -1,128 +0,0 @@ -export default Object3DNode; -/** - * TSL function for creating an object 3D node that represents the object's direction in world space. - * - * @tsl - * @function - * @param {?Object3D} [object3d] - The 3D object. - * @returns {Object3DNode} - */ -export const objectDirection: any; -/** - * TSL function for creating an object 3D node that represents the object's world matrix. - * - * @tsl - * @function - * @param {?Object3D} [object3d] - The 3D object. - * @returns {Object3DNode} - */ -export const objectWorldMatrix: any; -/** - * TSL function for creating an object 3D node that represents the object's position in world space. - * - * @tsl - * @function - * @param {?Object3D} [object3d] - The 3D object. - * @returns {Object3DNode} - */ -export const objectPosition: any; -/** - * TSL function for creating an object 3D node that represents the object's scale in world space. - * - * @tsl - * @function - * @param {?Object3D} [object3d] - The 3D object. - * @returns {Object3DNode} - */ -export const objectScale: any; -/** - * TSL function for creating an object 3D node that represents the object's position in view/camera space. - * - * @tsl - * @function - * @param {?Object3D} [object3d] - The 3D object. - * @returns {Object3DNode} - */ -export const objectViewPosition: any; -/** - * TSL function for creating an object 3D node that represents the object's radius. - * - * @tsl - * @function - * @param {?Object3D} [object3d] - The 3D object. - * @returns {Object3DNode} - */ -export const objectRadius: any; -/** - * This node can be used to access transformation related metrics of 3D objects. - * Depending on the selected scope, a different metric is represented as a uniform - * in the shader. The following scopes are supported: - * - * - `POSITION`: The object's position in world space. - * - `VIEW_POSITION`: The object's position in view/camera space. - * - `DIRECTION`: The object's direction in world space. - * - `SCALE`: The object's scale in world space. - * - `WORLD_MATRIX`: The object's matrix in world space. - * - * @augments Node - */ -declare class Object3DNode extends Node { - /** - * Constructs a new object 3D node. - * - * @param {('position'|'viewPosition'|'direction'|'scale'|'worldMatrix')} scope - The node represents a different type of transformation depending on the scope. - * @param {?Object3D} [object3d=null] - The 3D object. - */ - constructor(scope: ("position" | "viewPosition" | "direction" | "scale" | "worldMatrix"), object3d?: Object3D | null); - /** - * The node reports a different type of transformation depending on the scope. - * - * @type {('position'|'viewPosition'|'direction'|'scale'|'worldMatrix')} - */ - scope: ("position" | "viewPosition" | "direction" | "scale" | "worldMatrix"); - /** - * The 3D object. - * - * @type {?Object3D} - * @default null - */ - object3d: Object3D | null; - /** - * Holds the value of the node as a uniform. - * - * @type {UniformNode} - */ - uniformNode: UniformNode; - /** - * Overwritten since the node type is inferred from the scope. - * - * @return {('mat4'|'vec3'|'float')} The node type. - */ - generateNodeType(): ("mat4" | "vec3" | "float"); - /** - * Updates the uniform value depending on the scope. - * - * @param {NodeFrame} frame - The current node frame. - */ - update(frame: NodeFrame): void; - /** - * Generates the code snippet of the uniform node. The node type of the uniform - * node also depends on the selected scope. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The generated code snippet. - */ - generate(builder: NodeBuilder): string; - serialize(data: any): void; - deserialize(data: any): void; -} -declare namespace Object3DNode { - let WORLD_MATRIX: string; - let POSITION: string; - let SCALE: string; - let VIEW_POSITION: string; - let DIRECTION: string; - let RADIUS: string; -} -import Node from '../core/Node.js'; -import UniformNode from '../core/UniformNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/PointUVNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/PointUVNode.d.ts deleted file mode 100644 index 67872c0e7..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/PointUVNode.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -export default PointUVNode; -/** - * TSL object that represents the uv coordinates of points. - * - * @tsl - * @type {PointUVNode} - */ -export const pointUV: PointUVNode; -/** - * A node for representing the uv coordinates of points. - * - * Can only be used with a WebGL backend. In WebGPU, point - * primitives always have the size of one pixel and can thus - * can't be used as sprite-like objects that display textures. - * - * @augments Node - */ -declare class PointUVNode extends Node { - /** - * Constructs a new point uv node. - */ - constructor(); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isPointUVNode: boolean; - generate(): string; -} -import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/Position.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/Position.d.ts deleted file mode 100644 index 4562c2971..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/Position.d.ts +++ /dev/null @@ -1,57 +0,0 @@ -/** - * TSL object that represents the clip space position of the current rendered object. - * - * @tsl - * @type {VaryingNode} - */ -export const clipSpace: VaryingNode; -/** - * TSL object that represents the position attribute of the current rendered object. - * - * @tsl - * @type {AttributeNode} - */ -export const positionGeometry: AttributeNode; -/** - * TSL object that represents the vertex position in local space of the current rendered object. - * - * @tsl - * @type {AttributeNode} - */ -export const positionLocal: AttributeNode; -/** - * TSL object that represents the previous vertex position in local space of the current rendered object. - * Used in context of {@link VelocityNode} for rendering motion vectors. - * - * @tsl - * @type {AttributeNode} - */ -export const positionPrevious: AttributeNode; -/** - * TSL object that represents the vertex position in world space of the current rendered object. - * - * @tsl - * @type {VaryingNode} - */ -export const positionWorld: VaryingNode; -/** - * TSL object that represents the position world direction of the current rendered object. - * - * @tsl - * @type {Node} - */ -export const positionWorldDirection: Node; -/** - * TSL object that represents the vertex position in view space of the current rendered object. - * - * @tsl - * @type {VaryingNode} - */ -export const positionView: VaryingNode; -/** - * TSL object that represents the position view direction of the current rendered object. - * - * @tsl - * @type {VaryingNode} - */ -export const positionViewDirection: VaryingNode; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/ReferenceBaseNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/ReferenceBaseNode.d.ts deleted file mode 100644 index 413924422..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/ReferenceBaseNode.d.ts +++ /dev/null @@ -1,181 +0,0 @@ -export default ReferenceBaseNode; -export function reference(name: string, type: string, object: Object): ReferenceBaseNode; -export function referenceBuffer(name: string, type: string, count: number, object?: Object): ReferenceBaseNode; -/** - * Base class for nodes which establishes a reference to a property of another object. - * In this way, the value of the node is automatically linked to the value of - * referenced object. Reference nodes internally represent the linked value - * as a uniform. - * - * @augments Node - */ -declare class ReferenceBaseNode extends Node { - /** - * Constructs a new reference base node. - * - * @param {string} property - The name of the property the node refers to. - * @param {string} uniformType - The uniform type that should be used to represent the property value. - * @param {?Object} [object=null] - The object the property belongs to. - * @param {?number} [count=null] - When the linked property is an array-like, this parameter defines its length. - */ - constructor(property: string, uniformType: string, object?: Object | null, count?: number | null); - /** - * The name of the property the node refers to. - * - * @type {string} - */ - property: string; - /** - * The uniform type that should be used to represent the property value. - * - * @type {string} - */ - uniformType: string; - /** - * The object the property belongs to. - * - * @type {?Object} - * @default null - */ - object: Object | null; - /** - * When the linked property is an array, this parameter defines its length. - * - * @type {?number} - * @default null - */ - count: number | null; - /** - * The property name might have dots so nested properties can be referred. - * The hierarchy of the names is stored inside this array. - * - * @type {Array} - */ - properties: Array; - /** - * Points to the current referred object. This property exists next to {@link ReferenceNode#object} - * since the final reference might be updated from calling code. - * - * @type {?Object} - * @default null - */ - reference: Object | null; - /** - * The uniform node that holds the value of the reference node. - * - * @type {UniformNode} - * @default null - */ - node: UniformNode; - /** - * The uniform group of the internal uniform. - * - * @type {UniformGroupNode} - * @default null - */ - group: UniformGroupNode; - /** - * Sets the uniform group for this reference node. - * - * @param {UniformGroupNode} group - The uniform group to set. - * @return {ReferenceBaseNode} A reference to this node. - */ - setGroup(group: UniformGroupNode): ReferenceBaseNode; - /** - * When the referred property is array-like, this method can be used - * to access elements via an index node. - * - * @param {IndexNode} indexNode - indexNode. - * @return {ReferenceElementNode} A reference to an element. - */ - element(indexNode: IndexNode): ReferenceElementNode; - /** - * Sets the node type which automatically defines the internal - * uniform type. - * - * @param {string} uniformType - The type to set. - */ - setNodeType(uniformType: string): void; - /** - * This method is overwritten since the node type is inferred from - * the type of the reference node. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The node type. - */ - generateNodeType(builder: NodeBuilder): string; - /** - * Returns the property value from the given referred object. - * - * @param {Object} [object=this.reference] - The object to retrieve the property value from. - * @return {any} The value. - */ - getValueFromReference(object?: Object): any; - /** - * Allows to update the reference based on the given state. The state is only - * evaluated {@link ReferenceBaseNode#object} is not set. - * - * @param {(NodeFrame|NodeBuilder)} state - The current state. - * @return {Object} The updated reference. - */ - updateReference(state: (NodeFrame | NodeBuilder)): Object; - /** - * The output of the reference node is the internal uniform node. - * - * @return {UniformNode} The output node. - */ - setup(): UniformNode; - /** - * Overwritten to update the internal uniform value. - * - * @param {NodeFrame} frame - A reference to the current node frame. - */ - update(): void; - /** - * Retrieves the value from the referred object property and uses it - * to updated the internal uniform. - */ - updateValue(): void; -} -import Node from '../core/Node.js'; -/** - * This class is only relevant if the referenced property is array-like. - * In this case, `ReferenceElementNode` allows to refer to a specific - * element inside the data structure via an index. - * - * @augments ArrayElementNode - */ -declare class ReferenceElementNode extends ArrayElementNode { - /** - * Constructs a new reference element node. - * - * @param {ReferenceBaseNode} referenceNode - The reference node. - * @param {Node} indexNode - The index node that defines the element access. - */ - constructor(referenceNode: ReferenceBaseNode, indexNode: Node); - /** - * Similar to {@link ReferenceBaseNode#reference}, an additional - * property references to the current node. - * - * @type {?ReferenceBaseNode} - * @default null - */ - referenceNode: ReferenceBaseNode | null; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isReferenceElementNode: boolean; - /** - * This method is overwritten since the node type is inferred from - * the uniform type of the reference node. - * - * @return {string} The node type. - */ - generateNodeType(): string; - generate(builder: any): any; -} -import ArrayElementNode from '../utils/ArrayElementNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/ReferenceNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/ReferenceNode.d.ts deleted file mode 100644 index 7476c25c4..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/ReferenceNode.d.ts +++ /dev/null @@ -1,197 +0,0 @@ -export default ReferenceNode; -export function reference(name: string, type: string, object?: Object | null): ReferenceNode; -export function referenceBuffer(name: string, type: string, count: number, object: Object): ReferenceNode; -/** - * This type of node establishes a reference to a property of another object. - * In this way, the value of the node is automatically linked to the value of - * referenced object. Reference nodes internally represent the linked value - * as a uniform. - * - * @augments Node - */ -declare class ReferenceNode extends Node { - /** - * Constructs a new reference node. - * - * @param {string} property - The name of the property the node refers to. - * @param {string} uniformType - The uniform type that should be used to represent the property value. - * @param {?Object} [object=null] - The object the property belongs to. - * @param {?number} [count=null] - When the linked property is an array-like, this parameter defines its length. - */ - constructor(property: string, uniformType: string, object?: Object | null, count?: number | null); - /** - * The name of the property the node refers to. - * - * @type {string} - */ - property: string; - /** - * The uniform type that should be used to represent the property value. - * - * @type {string} - */ - uniformType: string; - /** - * The object the property belongs to. - * - * @type {?Object} - * @default null - */ - object: Object | null; - /** - * When the linked property is an array, this parameter defines its length. - * - * @type {?number} - * @default null - */ - count: number | null; - /** - * The property name might have dots so nested properties can be referred. - * The hierarchy of the names is stored inside this array. - * - * @type {Array} - */ - properties: Array; - /** - * Points to the current referred object. This property exists next to {@link ReferenceNode#object} - * since the final reference might be updated from calling code. - * - * @type {?Object} - * @default null - */ - reference: Object | null; - /** - * The uniform node that holds the value of the reference node. - * - * @type {UniformNode} - * @default null - */ - node: UniformNode; - /** - * The uniform group of the internal uniform. - * - * @type {UniformGroupNode} - * @default null - */ - group: UniformGroupNode; - /** - * When the referred property is array-like, this method can be used - * to access elements via an index node. - * - * @param {IndexNode} indexNode - indexNode. - * @return {ReferenceElementNode} A reference to an element. - */ - element(indexNode: IndexNode): ReferenceElementNode; - /** - * Sets the uniform group for this reference node. - * - * @param {UniformGroupNode} group - The uniform group to set. - * @return {ReferenceNode} A reference to this node. - */ - setGroup(group: UniformGroupNode): ReferenceNode; - /** - * Sets the name for the internal uniform. - * - * @param {string} name - The label to set. - * @return {ReferenceNode} A reference to this node. - */ - setName(name: string): ReferenceNode; - /** - * Sets the label for the internal uniform. - * - * @deprecated - * @param {string} name - The label to set. - * @return {ReferenceNode} A reference to this node. - */ - label(name: string): ReferenceNode; - /** - * Sets the node type which automatically defines the internal - * uniform type. - * - * @param {string} uniformType - The type to set. - */ - setNodeType(uniformType: string): void; - /** - * This method is overwritten since the node type is inferred from - * the type of the reference node. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The node type. - */ - generateNodeType(builder: NodeBuilder): string; - /** - * Returns the property value from the given referred object. - * - * @param {Object} [object=this.reference] - The object to retrieve the property value from. - * @return {any} The value. - */ - getValueFromReference(object?: Object): any; - /** - * Allows to update the reference based on the given state. The state is only - * evaluated {@link ReferenceNode#object} is not set. - * - * @param {(NodeFrame|NodeBuilder)} state - The current state. - * @return {Object} The updated reference. - */ - updateReference(state: (NodeFrame | NodeBuilder)): Object; - /** - * The output of the reference node is the internal uniform node. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {UniformNode} The output node. - */ - setup(): UniformNode; - /** - * Overwritten to update the internal uniform value. - * - * @param {NodeFrame} frame - A reference to the current node frame. - */ - update(): void; - /** - * Retrieves the value from the referred object property and uses it - * to updated the internal uniform. - */ - updateValue(): void; -} -import Node from '../core/Node.js'; -/** - * This class is only relevant if the referenced property is array-like. - * In this case, `ReferenceElementNode` allows to refer to a specific - * element inside the data structure via an index. - * - * @augments ArrayElementNode - */ -declare class ReferenceElementNode extends ArrayElementNode { - /** - * Constructs a new reference element node. - * - * @param {?ReferenceNode} referenceNode - The reference node. - * @param {Node} indexNode - The index node that defines the element access. - */ - constructor(referenceNode: ReferenceNode | null, indexNode: Node); - /** - * Similar to {@link ReferenceNode#reference}, an additional - * property references to the current node. - * - * @type {?ReferenceNode} - * @default null - */ - referenceNode: ReferenceNode | null; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isReferenceElementNode: boolean; - /** - * This method is overwritten since the node type is inferred from - * the uniform type of the reference node. - * - * @return {string} The node type. - */ - generateNodeType(): string; - generate(builder: any): any; -} -import ArrayElementNode from '../utils/ArrayElementNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/ReflectVector.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/ReflectVector.d.ts deleted file mode 100644 index 6cf15717c..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/ReflectVector.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * The reflect vector in view space. - * - * @tsl - * @type {Node} - */ -export const reflectView: Node; -/** - * The refract vector in view space. - * - * @tsl - * @type {Node} - */ -export const refractView: Node; -/** - * Used for sampling cube maps when using cube reflection mapping. - * - * @tsl - * @type {Node} - */ -export const reflectVector: Node; -/** - * Used for sampling cube maps when using cube refraction mapping. - * - * @tsl - * @type {Node} - */ -export const refractVector: Node; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/RendererReferenceNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/RendererReferenceNode.d.ts deleted file mode 100644 index 43bd3b071..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/RendererReferenceNode.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -export default RendererReferenceNode; -export function rendererReference(name: string, type: string, renderer?: Renderer | null): RendererReferenceNode; -/** - * This node is a special type of reference node which is intended - * for linking renderer properties with node values. - * ```js - * const exposureNode = rendererReference( 'toneMappingExposure', 'float', renderer ); - * ``` - * When changing `renderer.toneMappingExposure`, the node value of `exposureNode` will - * automatically be updated. - * - * @augments ReferenceBaseNode - */ -declare class RendererReferenceNode extends ReferenceBaseNode { - /** - * Constructs a new renderer reference node. - * - * @param {string} property - The name of the property the node refers to. - * @param {string} inputType - The uniform type that should be used to represent the property value. - * @param {?Renderer} [renderer=null] - The renderer the property belongs to. When no renderer is set, - * the node refers to the renderer of the current state. - */ - constructor(property: string, inputType: string, renderer?: Renderer | null); - /** - * The renderer the property belongs to. When no renderer is set, - * the node refers to the renderer of the current state. - * - * @type {?Renderer} - * @default null - */ - renderer: Renderer | null; -} -import ReferenceBaseNode from './ReferenceBaseNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/SceneProperties.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/SceneProperties.d.ts deleted file mode 100644 index 12f6b0aef..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/SceneProperties.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * TSL object that represents the scene's background blurriness. - * - * @tsl - * @type {Node} - */ -export const backgroundBlurriness: Node; -/** - * TSL object that represents the scene's background intensity. - * - * @tsl - * @type {Node} - */ -export const backgroundIntensity: Node; -/** - * TSL object that represents the scene's background rotation. - * - * @tsl - * @type {Node} - */ -export const backgroundRotation: Node; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/SkinningNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/SkinningNode.d.ts deleted file mode 100644 index d649f273b..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/SkinningNode.d.ts +++ /dev/null @@ -1,122 +0,0 @@ -export default SkinningNode; -export function skinning(skinnedMesh: SkinnedMesh): SkinningNode; -export function computeSkinning(skinnedMesh: SkinnedMesh, toPosition?: Node): SkinningNode; -/** - * This node implements the vertex transformation shader logic which is required - * for skinning/skeletal animation. - * - * @augments Node - */ -declare class SkinningNode extends Node { - /** - * Constructs a new skinning node. - * - * @param {SkinnedMesh} skinnedMesh - The skinned mesh. - */ - constructor(skinnedMesh: SkinnedMesh); - /** - * The skinned mesh. - * - * @type {SkinnedMesh} - */ - skinnedMesh: SkinnedMesh; - /** - * The skin index attribute. - * - * @type {AttributeNode} - */ - skinIndexNode: AttributeNode; - /** - * The skin weight attribute. - * - * @type {AttributeNode} - */ - skinWeightNode: AttributeNode; - /** - * The bind matrix node. - * - * @type {Node} - */ - bindMatrixNode: Node; - /** - * The bind matrix inverse node. - * - * @type {Node} - */ - bindMatrixInverseNode: Node; - /** - * The bind matrices as a uniform buffer node. - * - * @type {Node} - */ - boneMatricesNode: Node; - /** - * The current vertex position in local space. - * - * @type {Node} - */ - positionNode: Node; - /** - * The result of vertex position in local space. - * - * @type {Node} - */ - toPositionNode: Node; - /** - * The previous bind matrices as a uniform buffer node. - * Required for computing motion vectors. - * - * @type {?Node} - * @default null - */ - previousBoneMatricesNode: Node | null; - /** - * Transforms the given vertex position via skinning. - * - * @param {Node} [boneMatrices=this.boneMatricesNode] - The bone matrices - * @param {Node} [position=this.positionNode] - The vertex position in local space. - * @return {Node} The transformed vertex position. - */ - getSkinnedPosition(boneMatrices?: Node, position?: Node): Node; - /** - * Transforms the given vertex normal and tangent via skinning. - * - * @param {Node} [boneMatrices=this.boneMatricesNode] - The bone matrices - * @param {Node} [normal=normalLocal] - The vertex normal in local space. - * @param {Node} [tangent=tangentLocal] - The vertex tangent in local space. - * @return {{skinNormal: Node, skinTangent:Node}} The transformed vertex normal and tangent. - */ - getSkinnedNormalAndTangent(boneMatrices?: Node, normal?: Node, tangent?: Node): { - skinNormal: Node; - skinTangent: Node; - }; - /** - * Computes the transformed/skinned vertex position of the previous frame. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {Node} The skinned position from the previous frame. - */ - getPreviousSkinnedPosition(builder: NodeBuilder): Node; - /** - * Setups the skinning node by assigning the transformed vertex data to predefined node variables. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {Node} The transformed vertex position. - */ - setup(builder: NodeBuilder): Node; - /** - * Generates the code snippet of the skinning node. - * - * @param {NodeBuilder} builder - The current node builder. - * @param {string} output - The current output. - * @return {string} The generated code snippet. - */ - generate(builder: NodeBuilder, output: string): string; - /** - * Updates the state of the skinned mesh by updating the skeleton once per frame. - * - * @param {NodeFrame} frame - The current node frame. - */ - update(frame: NodeFrame): void; -} -import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/StorageBufferNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/StorageBufferNode.d.ts deleted file mode 100644 index fea4f9cd4..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/StorageBufferNode.d.ts +++ /dev/null @@ -1,183 +0,0 @@ -export default StorageBufferNode; -export function storage(value: StorageBufferAttribute | StorageInstancedBufferAttribute | BufferAttribute, type?: (string | Struct) | null, count?: number): StorageBufferNode; -/** - * This node is used in context of compute shaders and allows to define a - * storage buffer for data. A typical workflow is to create instances of - * this node with the convenience functions `attributeArray()` or `instancedArray()`, - * setup up a compute shader that writes into the buffers and then convert - * the storage buffers to attribute nodes for rendering. - * - * ```js - * const positionBuffer = instancedArray( particleCount, 'vec3' ); // the storage buffer node - * - * const computeInit = Fn( () => { // the compute shader - * - * const position = positionBuffer.element( instanceIndex ); - * - * // compute position data - * - * position.x = 1; - * position.y = 1; - * position.z = 1; - * - * } )().compute( particleCount ); - * - * const particleMaterial = new THREE.SpriteNodeMaterial(); - * particleMaterial.positionNode = positionBuffer.toAttribute(); - * - * renderer.computeAsync( computeInit ); - * - * ``` - * - * @augments BufferNode - */ -declare class StorageBufferNode extends BufferNode { - /** - * Constructs a new storage buffer node. - * - * @param {StorageBufferAttribute|StorageInstancedBufferAttribute|BufferAttribute} value - The buffer data. - * @param {?(string|Struct)} [bufferType=null] - The buffer type (e.g. `'vec3'`). - * @param {number} [bufferCount=0] - The buffer count. - */ - constructor(value: StorageBufferAttribute | StorageInstancedBufferAttribute | BufferAttribute, bufferType?: (string | Struct) | null, bufferCount?: number); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isStorageBufferNode: boolean; - /** - * The buffer struct type. - * - * @type {?StructTypeNode} - * @default null - */ - structTypeNode: StructTypeNode | null; - /** - * The access type of the texture node. - * - * @type {string} - * @default 'readWrite' - */ - access: string; - /** - * Whether the node is atomic or not. - * - * @type {boolean} - * @default false - */ - isAtomic: boolean; - /** - * Whether the node represents a PBO or not. - * Only relevant for WebGL. - * - * @type {boolean} - * @default false - */ - isPBO: boolean; - /** - * A reference to the internal buffer attribute node. - * - * @private - * @type {?BufferAttributeNode} - * @default null - */ - private _attribute; - /** - * A reference to the internal varying node. - * - * @private - * @type {?VaryingNode} - * @default null - */ - private _varying; - /** - * This method is overwritten since the buffer data might be shared - * and thus the hash should be shared as well. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The hash. - */ - getHash(builder: NodeBuilder): string; - /** - * Enables element access with the given index node. - * - * @param {IndexNode} indexNode - The index node. - * @return {StorageArrayElementNode} A node representing the element access. - */ - element(indexNode: IndexNode): StorageArrayElementNode; - /** - * Defines whether this node is a PBO or not. Only relevant for WebGL. - * - * @param {boolean} value - The value so set. - * @return {StorageBufferNode} A reference to this node. - */ - setPBO(value: boolean): StorageBufferNode; - /** - * Returns the `isPBO` value. - * - * @return {boolean} Whether the node represents a PBO or not. - */ - getPBO(): boolean; - /** - * Defines the node access. - * - * @param {string} value - The node access. - * @return {StorageBufferNode} A reference to this node. - */ - setAccess(value: string): StorageBufferNode; - /** - * Convenience method for configuring a read-only node access. - * - * @return {StorageBufferNode} A reference to this node. - */ - toReadOnly(): StorageBufferNode; - /** - * Defines whether the node is atomic or not. - * - * @param {boolean} value - The atomic flag. - * @return {StorageBufferNode} A reference to this node. - */ - setAtomic(value: boolean): StorageBufferNode; - /** - * Convenience method for making this node atomic. - * - * @return {StorageBufferNode} A reference to this node. - */ - toAtomic(): StorageBufferNode; - /** - * Returns attribute data for this storage buffer node. - * - * @return {{attribute: BufferAttributeNode, varying: VaryingNode}} The attribute data. - */ - getAttributeData(): { - attribute: BufferAttributeNode; - varying: VaryingNode; - }; - /** - * This method is overwritten since the node type from the availability of storage buffers - * and the attribute data. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The node type. - */ - generateNodeType(builder: NodeBuilder): string; - /** - * Returns the type of a member of the struct. - * - * @param {NodeBuilder} builder - The current node builder. - * @param {string} name - The name of the member. - * @return {string} The type of the member. - */ - getMemberType(builder: NodeBuilder, name: string): string; - /** - * Generates the code snippet of the storage buffer node. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The generated code snippet. - */ - generate(builder: NodeBuilder): string; -} -import BufferNode from './BufferNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/StorageTextureNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/StorageTextureNode.d.ts deleted file mode 100644 index ad559e11f..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/StorageTextureNode.d.ts +++ /dev/null @@ -1,123 +0,0 @@ -export default StorageTextureNode; -/** - * TSL function for creating a storage texture node. - * - * @tsl - * @function - * @param {StorageTexture} value - The storage texture. - * @param {?Node} uvNode - The uv node. - * @param {?Node} [storeNode=null] - The value node that should be stored in the texture. - * @returns {StorageTextureNode} - */ -export const storageTexture: any; -export function textureStore(value: StorageTexture, uvNode: Node, storeNode?: Node | null): StorageTextureNode; -/** - * This special version of a texture node can be used to - * write data into a storage texture with a compute shader. - * - * ```js - * const storageTexture = new THREE.StorageTexture( width, height ); - * - * const computeTexture = Fn( ( { storageTexture } ) => { - * - * const posX = instanceIndex.mod( width ); - * const posY = instanceIndex.div( width ); - * const indexUV = uvec2( posX, posY ); - * - * // generate RGB values - * - * const r = 1; - * const g = 1; - * const b = 1; - * - * textureStore( storageTexture, indexUV, vec4( r, g, b, 1 ) ).toWriteOnly(); - * - * } ); - * - * const computeNode = computeTexture( { storageTexture } ).compute( width * height ); - * renderer.computeAsync( computeNode ); - * ``` - * - * This node can only be used with a WebGPU backend. - * - * @augments TextureNode - */ -declare class StorageTextureNode extends TextureNode { - /** - * Constructs a new storage texture node. - * - * @param {StorageTexture} value - The storage texture. - * @param {Node} uvNode - The uv node. - * @param {?Node} [storeNode=null] - The value node that should be stored in the texture. - */ - constructor(value: StorageTexture, uvNode: Node, storeNode?: Node | null); - /** - * The value node that should be stored in the texture. - * - * @type {?Node} - * @default null - */ - storeNode: Node | null; - /** - * The mip level to write to for storage textures. - * - * @type {number} - * @default 0 - */ - mipLevel: number; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isStorageTextureNode: boolean; - /** - * The access type of the texture node. - * - * @type {string} - * @default 'writeOnly' - */ - access: string; - setup(builder: any): any; - /** - * Defines the node access. - * - * @param {string} value - The node access. - * @return {StorageTextureNode} A reference to this node. - */ - setAccess(value: string): StorageTextureNode; - /** - * Sets the mip level to write to. - * - * @param {number} level - The mip level. - * @return {StorageTextureNode} A reference to this node. - */ - setMipLevel(level: number): StorageTextureNode; - /** - * Convenience method for configuring a read/write node access. - * - * @return {StorageTextureNode} A reference to this node. - */ - toReadWrite(): StorageTextureNode; - /** - * Convenience method for configuring a read-only node access. - * - * @return {StorageTextureNode} A reference to this node. - */ - toReadOnly(): StorageTextureNode; - /** - * Convenience method for configuring a write-only node access. - * - * @return {StorageTextureNode} A reference to this node. - */ - toWriteOnly(): StorageTextureNode; - /** - * Generates the code snippet of the storage texture node. - * - * @param {NodeBuilder} builder - The current node builder. - */ - generateStore(builder: NodeBuilder): void; -} -import TextureNode from './TextureNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/Tangent.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/Tangent.d.ts deleted file mode 100644 index fa48ada28..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/Tangent.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * TSL object that represents the tangent attribute of the current rendered object. - * - * @tsl - * @type {Node} - */ -export const tangentGeometry: Node; -/** - * TSL object that represents the vertex tangent in local space of the current rendered object. - * - * @tsl - * @type {Node} - */ -export const tangentLocal: Node; -/** - * TSL object that represents the vertex tangent in view space of the current rendered object. - * - * @tsl - * @type {Node} - */ -export const tangentView: Node; -/** - * TSL object that represents the vertex tangent in world space of the current rendered object. - * - * @tsl - * @type {Node} - */ -export const tangentWorld: Node; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/TangentUtils.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/TangentUtils.d.ts deleted file mode 100644 index 5ae231172..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/TangentUtils.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Tangent vector in view space, computed dynamically from geometry and UV derivatives. - * Useful for normal mapping without precomputed tangents. - * - * Reference: http://www.thetenthplanet.de/archives/1180 - * - * @tsl - * @type {Node} - */ -export const tangentViewFrame: Node; -/** - * Bitangent vector in view space, computed dynamically from geometry and UV derivatives. - * Complements the tangentViewFrame for constructing the tangent space basis. - * - * Reference: http://www.thetenthplanet.de/archives/1180 - * - * @tsl - * @type {Node} - */ -export const bitangentViewFrame: Node; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/Texture3DNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/Texture3DNode.d.ts deleted file mode 100644 index 1b1066b8b..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/Texture3DNode.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -export default Texture3DNode; -/** - * TSL function for creating a 3D texture node. - * - * @tsl - * @function - * @param {Data3DTexture} value - The 3D texture. - * @param {?Node} [uvNode=null] - The uv node. - * @param {?Node} [levelNode=null] - The level node. - * @returns {Texture3DNode} - */ -export const texture3D: any; -export function texture3DLoad(...params: any[]): TextureNode; -export function texture3DLevel(value?: (Texture | TextureNode) | null, uvNode?: Node | null, levelNode?: Node | null): TextureNode; -/** - * This type of uniform node represents a 3D texture. - * - * @augments TextureNode - */ -declare class Texture3DNode extends TextureNode { - /** - * Constructs a new 3D texture node. - * - * @param {Data3DTexture} value - The 3D texture. - * @param {?Node} [uvNode=null] - The uv node. - * @param {?Node} [levelNode=null] - The level node. - */ - constructor(value: Data3DTexture, uvNode?: Node | null, levelNode?: Node | null); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isTexture3DNode: boolean; - /** - * Overwritten with an empty implementation since the `updateMatrix` flag is ignored - * for 3D textures. The uv transformation matrix is not applied to 3D textures. - * - * @param {boolean} value - The update toggle. - */ - setUpdateMatrix(): void; - /** - * Computes the normal for the given uv. These texture coordiantes represent a - * position inside the 3D texture. Unlike geometric normals, this normal - * represents a slope or gradient of scalar data inside the 3D texture. - * - * @param {Node} uvNode - The uv node that defines a position in the 3D texture. - * @return {Node} The normal representing the slope/gradient in the data. - */ - normal(uvNode: Node): Node; -} -import TextureNode from './TextureNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/TextureBicubic.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/TextureBicubic.d.ts deleted file mode 100644 index ff3a05aad..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/TextureBicubic.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Applies mipped bicubic texture filtering to the given texture node. - * - * @tsl - * @function - * @param {TextureNode} textureNode - The texture node that should be filtered. - * @param {Node} lodNode - Defines the LOD to sample from. - * @return {Node} The filtered texture sample. - */ -export const textureBicubicLevel: () => void; -/** - * Applies mipped bicubic texture filtering to the given texture node. - * - * @tsl - * @function - * @param {TextureNode} textureNode - The texture node that should be filtered. - * @param {Node} [strength] - Defines the strength of the bicubic filtering. - * @return {Node} The filtered texture sample. - */ -export const textureBicubic: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/TextureNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/TextureNode.d.ts deleted file mode 100644 index b7233be58..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/TextureNode.d.ts +++ /dev/null @@ -1,337 +0,0 @@ -export default TextureNode; -export function texture(value?: (Texture | TextureNode) | null, uvNode?: Node | null, levelNode?: Node | null, biasNode?: Node | null): TextureNode; -export function uniformTexture(value?: Texture | null): TextureNode; -export function textureLoad(...params: any[]): TextureNode; -export function textureLevel(value: any, uv: any, level: any): TextureNode; -export function sampler(value: TextureNode | Texture): Node; -export function samplerComparison(value: TextureNode | Texture): Node; -/** - * This type of uniform node represents a 2D texture. - * - * @augments UniformNode - */ -declare class TextureNode extends UniformNode { - /** - * Constructs a new texture node. - * - * @param {Texture} [value=EmptyTexture] - The texture. - * @param {?Node} [uvNode=null] - The uv node. - * @param {?Node} [levelNode=null] - The level node. - * @param {?Node} [biasNode=null] - The bias node. - */ - constructor(value?: Texture, uvNode?: Node | null, levelNode?: Node | null, biasNode?: Node | null); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isTextureNode: boolean; - /** - * Represents the texture coordinates. - * - * @type {?Node} - * @default null - */ - uvNode: Node | null; - /** - * Represents the mip level that should be selected. - * - * @type {?Node} - * @default null - */ - levelNode: Node | null; - /** - * Represents the bias to be applied during level-of-detail computation. - * - * @type {?Node} - * @default null - */ - biasNode: Node | null; - /** - * Represents a reference value a texture sample is compared to. - * - * @type {?Node} - * @default null - */ - compareNode: Node | null; - /** - * When using texture arrays, the depth node defines the layer to select. - * - * @type {?Node} - * @default null - */ - depthNode: Node | null; - /** - * When defined, a texture is sampled using explicit gradients. - * - * @type {?Array>} - * @default null - */ - gradNode: Array> | null; - /** - * Represents the optional texel offset applied to the unnormalized texture - * coordinate before sampling the texture. - * - * @type {?Node} - * @default null - */ - offsetNode: Node | null; - /** - * Whether texture values should be sampled or fetched. - * - * @type {boolean} - * @default true - */ - sampler: boolean; - /** - * Whether the uv transformation matrix should be - * automatically updated or not. Use `setUpdateMatrix()` - * if you want to change the value of the property. - * - * @type {boolean} - * @default false - */ - updateMatrix: boolean; - /** - * The reference node. - * - * @type {?Node} - * @default null - */ - referenceNode: Node | null; - /** - * The texture value is stored in a private property. - * - * @private - * @type {Texture} - */ - private _value; - /** - * The uniform node that represents the uv transformation matrix. - * - * @private - * @type {?UniformNode} - * @default null - */ - private _matrixUniform; - /** - * The uniform node that represents the y-flip. Only required for WebGL. - * - * @private - * @type {?UniformNode} - * @default null - */ - private _flipYUniform; - set value(value: Texture); - /** - * The texture value. - * - * @type {Texture} - */ - get value(): Texture; - /** - * Overwritten since the uniform hash is defined by the texture's UUID. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The uniform hash. - */ - getUniformHash(): string; - /** - * Overwritten since the node type is inferred from the texture type. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The node type. - */ - generateNodeType(): string; - /** - * Overwrites the default implementation to return a fixed value `'texture'`. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The input type. - */ - getInputType(): string; - /** - * Returns a default uvs based on the current texture's channel. - * - * @return {AttributeNode} The default uvs. - */ - getDefaultUV(): AttributeNode; - /** - * Overwritten to always return the texture reference of the node. - * - * @param {any} state - This method can be invocated in different contexts so `state` can refer to any object type. - * @return {Texture} The texture reference. - */ - updateReference(): Texture; - /** - * Transforms the given uv node with the texture transformation matrix. - * - * @param {Node} uvNode - The uv node to transform. - * @return {Node} The transformed uv node. - */ - getTransformedUV(uvNode: Node): Node; - /** - * Defines whether the uv transformation matrix should automatically be updated or not. - * - * @param {boolean} value - The update toggle. - * @return {TextureNode} A reference to this node. - */ - setUpdateMatrix(value: boolean): TextureNode; - /** - * Setups the uv node. Depending on the backend as well as texture's image and type, it might be necessary - * to modify the uv node for correct sampling. - * - * @param {NodeBuilder} builder - The current node builder. - * @param {Node} uvNode - The uv node to setup. - * @return {Node} The updated uv node. - */ - setupUV(builder: NodeBuilder, uvNode: Node): Node; - /** - * Setups texture node by preparing the internal nodes for code generation. - * - * @param {NodeBuilder} builder - The current node builder. - */ - setup(builder: NodeBuilder): void; - /** - * Generates the uv code snippet. - * - * @param {NodeBuilder} builder - The current node builder. - * @param {Node} uvNode - The uv node to generate code for. - * @return {string} The generated code snippet. - */ - generateUV(builder: NodeBuilder, uvNode: Node): string; - /** - * Generates the offset code snippet. - * - * @param {NodeBuilder} builder - The current node builder. - * @param {Node} offsetNode - The offset node to generate code for. - * @return {string} The generated code snippet. - */ - generateOffset(builder: NodeBuilder, offsetNode: Node): string; - /** - * Generates the snippet for the texture sampling. - * - * @param {NodeBuilder} builder - The current node builder. - * @param {string} textureProperty - The texture property. - * @param {string} uvSnippet - The uv snippet. - * @param {?string} levelSnippet - The level snippet. - * @param {?string} biasSnippet - The bias snippet. - * @param {?string} depthSnippet - The depth snippet. - * @param {?string} compareSnippet - The compare snippet. - * @param {?Array} gradSnippet - The grad snippet. - * @param {?string} offsetSnippet - The offset snippet. - * @return {string} The generated code snippet. - */ - generateSnippet(builder: NodeBuilder, textureProperty: string, uvSnippet: string, levelSnippet: string | null, biasSnippet: string | null, depthSnippet: string | null, compareSnippet: string | null, gradSnippet: Array | null, offsetSnippet: string | null): string; - /** - * Generates the code snippet of the texture node. - * - * @param {NodeBuilder} builder - The current node builder. - * @param {string} output - The current output. - * @return {string} The generated code snippet. - */ - generate(builder: NodeBuilder, output: string): string; - /** - * Sets the sampler value. - * - * @param {boolean} value - The sampler value to set. - * @return {TextureNode} A reference to this texture node. - */ - setSampler(value: boolean): TextureNode; - /** - * Returns the sampler value. - * - * @return {boolean} The sampler value. - */ - getSampler(): boolean; - /** - * Samples the texture with the given uv node. - * - * @param {Node} uvNode - The uv node. - * @return {TextureNode} A texture node representing the texture sample. - */ - sample(uvNode: Node): TextureNode; - /** - * TSL function for creating a texture node that fetches/loads texels without interpolation. - * - * @param {Node} uvNode - The uv node. - * @returns {TextureNode} A texture node representing the texture load. - */ - load(uvNode: Node): TextureNode; - /** - * Samples a blurred version of the texture by defining an internal bias. - * - * @param {Node} amountNode - How blurred the texture should be. - * @return {TextureNode} A texture node representing the texture sample. - */ - blur(amountNode: Node): TextureNode; - /** - * Samples a specific mip of the texture. - * - * @param {Node} levelNode - The mip level to sample. - * @return {TextureNode} A texture node representing the texture sample. - */ - level(levelNode: Node): TextureNode; - /** - * Returns the texture size of the requested level. - * - * @param {Node} levelNode - The level to compute the size for. - * @return {TextureSizeNode} The texture size. - */ - size(levelNode: Node): TextureSizeNode; - /** - * Samples the texture with the given bias. - * - * @param {Node} biasNode - The bias node. - * @return {TextureNode} A texture node representing the texture sample. - */ - bias(biasNode: Node): TextureNode; - /** - * Returns the base texture of this node. - * @return {TextureNode} The base texture node. - */ - getBase(): TextureNode; - /** - * Samples the texture by executing a compare operation. - * - * @param {Node} compareNode - The node that defines the compare value. - * @return {TextureNode} A texture node representing the texture sample. - */ - compare(compareNode: Node): TextureNode; - /** - * Samples the texture using an explicit gradient. - * - * @param {Node} gradNodeX - The gradX node. - * @param {Node} gradNodeY - The gradY node. - * @return {TextureNode} A texture node representing the texture sample. - */ - grad(gradNodeX: Node, gradNodeY: Node): TextureNode; - /** - * Samples the texture by defining a depth node. - * - * @param {Node} depthNode - The depth node. - * @return {TextureNode} A texture node representing the texture sample. - */ - depth(depthNode: Node): TextureNode; - /** - * Samples the texture by defining an offset node. - * - * @param {Node} offsetNode - The offset node. - * @return {TextureNode} A texture node representing the texture sample. - */ - offset(offsetNode: Node): TextureNode; - /** - * The update is used to implement the update of the uv transformation matrix. - */ - update(): void; - /** - * Clones the texture node. - * - * @return {TextureNode} The cloned texture node. - */ - clone(): TextureNode; -} -import { Texture } from '../../textures/Texture.js'; -import UniformNode from '../core/UniformNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/TextureSizeNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/TextureSizeNode.d.ts deleted file mode 100644 index 994971036..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/TextureSizeNode.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -export default TextureSizeNode; -/** - * TSL function for creating a texture size node. - * - * @tsl - * @function - * @param {TextureNode} textureNode - A texture node which size should be retrieved. - * @param {?Node} [levelNode=null] - A level node which defines the requested mip. - * @returns {TextureSizeNode} - */ -export const textureSize: any; -/** - * A node that represents the dimensions of a texture. The texture size is - * retrieved in the shader via built-in shader functions like `textureDimensions()` - * or `textureSize()`. - * - * @augments Node - */ -declare class TextureSizeNode extends Node { - /** - * Constructs a new texture size node. - * - * @param {TextureNode} textureNode - A texture node which size should be retrieved. - * @param {?Node} [levelNode=null] - A level node which defines the requested mip. - */ - constructor(textureNode: TextureNode, levelNode?: Node | null); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isTextureSizeNode: boolean; - /** - * A texture node which size should be retrieved. - * - * @type {TextureNode} - */ - textureNode: TextureNode; - /** - * A level node which defines the requested mip. - * - * @type {Node} - * @default null - */ - levelNode: Node; - generate(builder: any, output: any): any; -} -import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/UV.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/UV.d.ts deleted file mode 100644 index 959b2be65..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/UV.d.ts +++ /dev/null @@ -1 +0,0 @@ -export function uv(index?: number): AttributeNode; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/UniformArrayNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/UniformArrayNode.d.ts deleted file mode 100644 index 290ab3d93..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/UniformArrayNode.d.ts +++ /dev/null @@ -1,125 +0,0 @@ -export default UniformArrayNode; -export function uniformArray(values: Array, nodeType?: string | null): UniformArrayNode; -/** - * Similar to {@link BufferNode} this module represents array-like data as - * uniform buffers. Unlike {@link BufferNode}, it can handle more common - * data types in the array (e.g `three.js` primitives) and automatically - * manage buffer padding. It should be the first choice when working with - * uniforms buffers. - * ```js - * const tintColors = uniformArray( [ - * new Color( 1, 0, 0 ), - * new Color( 0, 1, 0 ), - * new Color( 0, 0, 1 ) - * ], 'color' ); - * - * const redColor = tintColors.element( 0 ); - * - * @augments BufferNode - */ -declare class UniformArrayNode extends BufferNode { - /** - * Constructs a new uniform array node. - * - * @param {Array} value - Array holding the buffer data. - * @param {?string} [elementType=null] - The data type of a buffer element. - */ - constructor(value: Array, elementType?: string | null); - /** - * Array holding the buffer data. Unlike {@link BufferNode}, the array can - * hold number primitives as well as three.js objects like vectors, matrices - * or colors. - * - * @type {Array} - */ - array: Array; - /** - * The data type of an array element. - * - * @type {string} - */ - elementType: string; - /** - * The padded type. Uniform buffers must conform to a certain buffer layout - * so a separate type is computed to ensure correct buffer size. - * - * @type {string} - */ - paddedType: string; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isArrayBufferNode: boolean; - /** - * This method is overwritten since the node type is inferred from the - * {@link UniformArrayNode#paddedType}. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The node type. - */ - generateNodeType(): string; - /** - * The data type of the array elements. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The element type. - */ - getElementType(): string; - /** - * Returns the padded type based on the element type. - * - * @return {string} The padded type. - */ - getPaddedType(): string; - /** - * The update makes sure to correctly transfer the data from the (complex) objects - * in the array to the internal, correctly padded value buffer. - * - * @param {NodeFrame} frame - A reference to the current node frame. - */ - update(): void; - /** - * Implement the value buffer creation based on the array data. - * - * @param {NodeBuilder} builder - A reference to the current node builder. - * @return {null} - */ - setup(builder: NodeBuilder): null; - /** - * Overwrites the default `element()` method to provide element access - * based on {@link UniformArrayNode}. - * - * @param {IndexNode} indexNode - The index node. - * @return {UniformArrayElementNode} - */ - element(indexNode: IndexNode): UniformArrayElementNode; -} -import BufferNode from './BufferNode.js'; -/** - * Represents the element access on uniform array nodes. - * - * @augments ArrayElementNode - */ -declare class UniformArrayElementNode extends ArrayElementNode { - /** - * Constructs a new buffer node. - * - * @param {UniformArrayNode} uniformArrayNode - The uniform array node to access. - * @param {IndexNode} indexNode - The index data that define the position of the accessed element in the array. - */ - constructor(uniformArrayNode: UniformArrayNode, indexNode: IndexNode); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isArrayBufferElementNode: boolean; - generate(builder: any): any; -} -import ArrayElementNode from '../utils/ArrayElementNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/UserDataNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/UserDataNode.d.ts deleted file mode 100644 index e526f57c7..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/UserDataNode.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -export default UserDataNode; -export function userData(name: string, inputType: string, userData: Object | null): UserDataNode; -/** - * A special type of reference node that allows to link values in - * `userData` fields to node objects. - * ```js - * sprite.userData.rotation = 1; // stores individual rotation per sprite - * - * const material = new THREE.SpriteNodeMaterial(); - * material.rotationNode = userData( 'rotation', 'float' ); - * ``` - * Since `UserDataNode` is extended from {@link ReferenceNode}, the node value - * will automatically be updated when the `rotation` user data field changes. - * - * @augments ReferenceNode - */ -declare class UserDataNode extends ReferenceNode { - /** - * Constructs a new user data node. - * - * @param {string} property - The property name that should be referenced by the node. - * @param {string} inputType - The node data type of the reference. - * @param {?Object} [userData=null] - A reference to the `userData` object. If not provided, the `userData` property of the 3D object that uses the node material is evaluated. - */ - constructor(property: string, inputType: string, userData?: Object | null); - /** - * A reference to the `userData` object. If not provided, the `userData` - * property of the 3D object that uses the node material is evaluated. - * - * @type {?Object} - * @default null - */ - userData: Object | null; -} -import ReferenceNode from './ReferenceNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/VelocityNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/VelocityNode.d.ts deleted file mode 100644 index 476ee206d..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/VelocityNode.d.ts +++ /dev/null @@ -1,79 +0,0 @@ -export default VelocityNode; -/** - * TSL object that represents the velocity of a render pass. - * - * @tsl - * @type {VelocityNode} - */ -export const velocity: VelocityNode; -/** - * A node for representing motion or velocity vectors. Foundation - * for advanced post processing effects like motion blur or TRAA. - * - * The node keeps track of the model, view and projection matrices - * of the previous frame and uses them to compute offsets in NDC space. - * These offsets represent the final velocity. - * - * @augments TempNode - */ -declare class VelocityNode extends TempNode { - /** - * Constructs a new vertex color node. - */ - constructor(); - /** - * The current projection matrix. - * - * @type {?Matrix4} - * @default null - */ - projectionMatrix: Matrix4 | null; - /** - * Uniform node representing the previous model matrix in world space. - * - * @type {UniformNode} - * @default null - */ - previousModelWorldMatrix: UniformNode; - /** - * Uniform node representing the previous projection matrix. - * - * @type {UniformNode} - * @default null - */ - previousProjectionMatrix: UniformNode; - /** - * Uniform node representing the previous view matrix. - * - * @type {UniformNode} - * @default null - */ - previousCameraViewMatrix: UniformNode; - /** - * Sets the given projection matrix. - * - * @param {Matrix4} projectionMatrix - The projection matrix to set. - */ - setProjectionMatrix(projectionMatrix: Matrix4): void; - /** - * Updates velocity specific uniforms. - * - * @param {NodeFrame} frame - A reference to the current node frame. - */ - update({ frameId, camera, object }: NodeFrame): void; - /** - * Overwritten to updated velocity specific uniforms. - * - * @param {NodeFrame} frame - A reference to the current node frame. - */ - updateAfter({ object }: NodeFrame): void; - /** - * Implements the velocity computation based on the previous and current vertex data. - * - * @param {NodeBuilder} builder - A reference to the current node builder. - * @return {Node} The motion vector. - */ - setup(): Node; -} -import TempNode from '../core/TempNode.js'; -import { Matrix4 } from '../../math/Matrix4.js'; diff --git a/jsdoc-testing/jsdoc/nodes/accessors/VertexColorNode.d.ts b/jsdoc-testing/jsdoc/nodes/accessors/VertexColorNode.d.ts deleted file mode 100644 index c55c763bd..000000000 --- a/jsdoc-testing/jsdoc/nodes/accessors/VertexColorNode.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -export default VertexColorNode; -export function vertexColor(index?: number): VertexColorNode; -/** - * An attribute node for representing vertex colors. - * - * @augments AttributeNode - */ -declare class VertexColorNode extends AttributeNode { - /** - * Constructs a new vertex color node. - * - * @param {number} index - The attribute index. - */ - constructor(index: number); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isVertexColorNode: boolean; - /** - * The attribute index to enable more than one sets of vertex colors. - * - * @type {number} - * @default 0 - */ - index: number; -} -import AttributeNode from '../core/AttributeNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/code/CodeNode.d.ts b/jsdoc-testing/jsdoc/nodes/code/CodeNode.d.ts deleted file mode 100644 index 13ca56a3d..000000000 --- a/jsdoc-testing/jsdoc/nodes/code/CodeNode.d.ts +++ /dev/null @@ -1,79 +0,0 @@ -export default CodeNode; -/** - * TSL function for creating a code node. - * - * @tsl - * @function - * @param {string} [code] - The native code. - * @param {?Array} [includes=[]] - An array of includes. - * @param {?('js'|'wgsl'|'glsl')} [language=''] - The used language. - * @returns {CodeNode} - */ -export const code: any; -export function js(src: string, includes: Array): CodeNode; -export function wgsl(src: string, includes: Array): CodeNode; -export function glsl(src: string, includes: Array): CodeNode; -/** - * This class represents native code sections. It is the base - * class for modules like {@link FunctionNode} which allows to implement - * functions with native shader languages. - * - * @augments Node - */ -declare class CodeNode extends Node { - /** - * Constructs a new code node. - * - * @param {string} [code=''] - The native code. - * @param {Array} [includes=[]] - An array of includes. - * @param {('js'|'wgsl'|'glsl')} [language=''] - The used language. - */ - constructor(code?: string, includes?: Array, language?: ("js" | "wgsl" | "glsl")); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isCodeNode: boolean; - /** - * The native code. - * - * @type {string} - * @default '' - */ - code: string; - /** - * An array of includes - * - * @type {Array} - * @default [] - */ - includes: Array; - /** - * The used language. - * - * @type {('js'|'wgsl'|'glsl')} - * @default '' - */ - language: ("js" | "wgsl" | "glsl"); - /** - * Sets the includes of this code node. - * - * @param {Array} includes - The includes to set. - * @return {CodeNode} A reference to this node. - */ - setIncludes(includes: Array): CodeNode; - /** - * Returns the includes of this code node. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {Array} The includes. - */ - getIncludes(): Array; - generate(builder: any): any; - serialize(data: any): void; - deserialize(data: any): void; -} -import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/code/ExpressionNode.d.ts b/jsdoc-testing/jsdoc/nodes/code/ExpressionNode.d.ts deleted file mode 100644 index 47f1180ff..000000000 --- a/jsdoc-testing/jsdoc/nodes/code/ExpressionNode.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -export default ExpressionNode; -/** - * TSL function for creating an expression node. - * - * @tsl - * @function - * @param {string} [snippet] - The native code snippet. - * @param {?string} [nodeType='void'] - The node type. - * @returns {ExpressionNode} - */ -export const expression: any; -/** - * This class can be used to implement basic expressions in shader code. - * Basic examples for that are `return`, `continue` or `discard` statements. - * - * @augments Node - */ -declare class ExpressionNode extends Node { - /** - * Constructs a new expression node. - * - * @param {string} [snippet=''] - The native code snippet. - * @param {string} [nodeType='void'] - The node type. - */ - constructor(snippet?: string, nodeType?: string); - /** - * The native code snippet. - * - * @type {string} - * @default '' - */ - snippet: string; - generate(builder: any, output: any): any; -} -import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/code/FunctionCallNode.d.ts b/jsdoc-testing/jsdoc/nodes/code/FunctionCallNode.d.ts deleted file mode 100644 index 38783b5a5..000000000 --- a/jsdoc-testing/jsdoc/nodes/code/FunctionCallNode.d.ts +++ /dev/null @@ -1,70 +0,0 @@ -export default FunctionCallNode; -export function call(func: any, ...params: any[]): FunctionCallNode; -/** - * This module represents the call of a {@link FunctionNode}. Developers are usually not confronted - * with this module since they use the predefined TSL syntax `wgslFn` and `glslFn` which encapsulate - * this logic. - * - * @augments TempNode - */ -declare class FunctionCallNode extends TempNode { - /** - * Constructs a new function call node. - * - * @param {?FunctionNode} functionNode - The function node. - * @param {Object} [parameters={}] - The parameters for the function call. - */ - constructor(functionNode?: FunctionNode | null, parameters?: { - [x: string]: Node; - }); - /** - * The function node. - * - * @type {?FunctionNode} - * @default null - */ - functionNode: FunctionNode | null; - /** - * The parameters of the function call. - * - * @type {Object} - * @default {} - */ - parameters: { - [x: string]: Node; - }; - /** - * Sets the parameters of the function call node. - * - * @param {Object} parameters - The parameters to set. - * @return {FunctionCallNode} A reference to this node. - */ - setParameters(parameters: { - [x: string]: Node; - }): FunctionCallNode; - /** - * Returns the parameters of the function call node. - * - * @return {Object} The parameters of this node. - */ - getParameters(): { - [x: string]: Node; - }; - /** - * Returns the type of this function call node. - * - * @param {NodeBuilder} builder - The current node builder. - * @returns {string} The type of this node. - */ - generateNodeType(builder: NodeBuilder): string; - /** - * Returns the function node of this function call node. - * - * @param {NodeBuilder} builder - The current node builder. - * @param {string} [name] - The name of the member. - * @returns {string} The type of the member. - */ - getMemberType(builder: NodeBuilder, name?: string): string; - generate(builder: any): string; -} -import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/code/FunctionNode.d.ts b/jsdoc-testing/jsdoc/nodes/code/FunctionNode.d.ts deleted file mode 100644 index 60a1aba65..000000000 --- a/jsdoc-testing/jsdoc/nodes/code/FunctionNode.d.ts +++ /dev/null @@ -1,76 +0,0 @@ -export default FunctionNode; -export function glslFn(code: any, includes: any): { - (...params: any[]): any; - functionNode: FunctionNode; -}; -export function wgslFn(code: any, includes: any): { - (...params: any[]): any; - functionNode: FunctionNode; -}; -/** - * This class represents a native shader function. It can be used to implement - * certain aspects of a node material with native shader code. There are two predefined - * TSL functions for easier usage. - * - * - `wgslFn`: Creates a WGSL function node. - * - `glslFn`: Creates a GLSL function node. - * - * A basic example with one include looks like so: - * - * ```js - * const desaturateWGSLFn = wgslFn( ` - * fn desaturate( color:vec3 ) -> vec3 { - * let lum = vec3( 0.299, 0.587, 0.114 ); - * return vec3( dot( lum, color ) ); - * }` - *); - * const someWGSLFn = wgslFn( ` - * fn someFn( color:vec3 ) -> vec3 { - * return desaturate( color ); - * } - * `, [ desaturateWGSLFn ] ); - * material.colorNode = someWGSLFn( { color: texture( map ) } ); - *``` - * @augments CodeNode - */ -declare class FunctionNode extends CodeNode { - /** - * Constructs a new function node. - * - * @param {string} [code=''] - The native code. - * @param {Array} [includes=[]] - An array of includes. - * @param {('js'|'wgsl'|'glsl')} [language=''] - The used language. - */ - constructor(code?: string, includes?: Array, language?: ("js" | "wgsl" | "glsl")); - /** - * Returns the type of this function node. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The type. - */ - generateNodeType(builder: NodeBuilder): string; - /** - * Returns the type of a member of this function node. - * - * @param {NodeBuilder} builder - The current node builder. - * @param {string} name - The name of the member. - * @return {string} The type of the member. - */ - getMemberType(builder: NodeBuilder, name: string): string; - /** - * Returns the inputs of this function node. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {Array} The inputs. - */ - getInputs(builder: NodeBuilder): Array; - /** - * Returns the node function for this function node. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {NodeFunction} The node function. - */ - getNodeFunction(builder: NodeBuilder): NodeFunction; - generate(builder: any, output: any): any; -} -import CodeNode from './CodeNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/ArrayNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/ArrayNode.d.ts deleted file mode 100644 index 41339a0bd..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/ArrayNode.d.ts +++ /dev/null @@ -1,76 +0,0 @@ -export default ArrayNode; -export function array(...params: any[]): ArrayNode; -/** - * ArrayNode represents a collection of nodes, typically created using the {@link array} function. - * ```js - * const colors = array( [ - * vec3( 1, 0, 0 ), - * vec3( 0, 1, 0 ), - * vec3( 0, 0, 1 ) - * ] ); - * - * const redColor = tintColors.element( 0 ); - * ``` - * - * @augments TempNode - */ -declare class ArrayNode extends TempNode { - /** - * Constructs a new array node. - * - * @param {?string} nodeType - The data type of the elements. - * @param {number} count - Size of the array. - * @param {?Array} [values=null] - Array default values. - */ - constructor(nodeType: string | null, count: number, values?: Array | null); - /** - * Array size. - * - * @type {number} - */ - count: number; - /** - * Array default values. - * - * @type {?Array} - */ - values: Array | null; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isArrayNode: boolean; - /** - * Returns the number of elements in the node array. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {number} The number of elements in the node array. - */ - getArrayCount(): number; - /** - * Returns the node's type. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The type of the node. - */ - generateNodeType(builder: NodeBuilder): string; - /** - * Returns the type of a member variable. - * - * @param {NodeBuilder} builder - The current node builder. - * @param {string} name - The name of the member variable. - * @return {string} The type of the member variable. - */ - getMemberType(builder: NodeBuilder, name: string): string; - /** - * This method builds the output node and returns the resulting array as a shader string. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The generated shader string. - */ - generate(builder: NodeBuilder): string; -} -import TempNode from './TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/AssignNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/AssignNode.d.ts deleted file mode 100644 index 3f1ab4808..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/AssignNode.d.ts +++ /dev/null @@ -1,65 +0,0 @@ -export default AssignNode; -/** - * TSL function for creating an assign node. - * - * @tsl - * @function - * @param {Node} targetNode - The target node. - * @param {Node} sourceNode - The source type. - * @returns {AssignNode} - */ -export const assign: any; -/** - * These node represents an assign operation. Meaning a node is assigned - * to another node. - * - * @augments TempNode - */ -declare class AssignNode extends TempNode { - /** - * Constructs a new assign node. - * - * @param {Node} targetNode - The target node. - * @param {Node} sourceNode - The source type. - */ - constructor(targetNode: Node, sourceNode: Node); - /** - * The target node. - * - * @type {Node} - */ - targetNode: Node; - /** - * The source node. - * - * @type {Node} - */ - sourceNode: Node; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isAssignNode: boolean; - /** - * Whether this node is used more than once in context of other nodes. This method - * is overwritten since it always returns `false` (assigns are unique). - * - * @return {boolean} A flag that indicates if there is more than one dependency to other nodes. Always `false`. - */ - hasDependencies(): boolean; - generateNodeType(builder: any, output: any): any; - /** - * Whether a split is required when assigning source to target. This can happen when the component length of - * target and source data type does not match. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {boolean} Whether a split is required when assigning source to target. - */ - needsSplitAssign(builder: NodeBuilder): boolean; - setup(builder: any): void; - generate(builder: any, output: any): any; -} -import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/AttributeNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/AttributeNode.d.ts deleted file mode 100644 index 0f8b0bf15..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/AttributeNode.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -export default AttributeNode; -export function attribute(name: string, nodeType?: string | null): AttributeNode; -/** - * Base class for representing shader attributes as nodes. - * - * @augments Node - */ -declare class AttributeNode extends Node { - /** - * Constructs a new attribute node. - * - * @param {string} attributeName - The name of the attribute. - * @param {?string} nodeType - The node type. - */ - constructor(attributeName: string, nodeType?: string | null); - _attributeName: string; - getHash(builder: any): string; - generateNodeType(builder: any): string | null; - /** - * Sets the attribute name to the given value. The method can be - * overwritten in derived classes if the final name must be computed - * analytically. - * - * @param {string} attributeName - The name of the attribute. - * @return {AttributeNode} A reference to this node. - */ - setAttributeName(attributeName: string): AttributeNode; - /** - * Returns the attribute name of this node. The method can be - * overwritten in derived classes if the final name must be computed - * analytically. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The attribute name. - */ - getAttributeName(): string; - generate(builder: any): any; - serialize(data: any): void; - deserialize(data: any): void; -} -import Node from './Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/BypassNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/BypassNode.d.ts deleted file mode 100644 index db68f52f5..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/BypassNode.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -export default BypassNode; -/** - * TSL function for creating a bypass node. - * - * @tsl - * @function - * @param {Node} outputNode - The output node. - * @param {Node} callNode - The call node. - * @returns {BypassNode} - */ -export const bypass: any; -/** - * The class generates the code of a given node but returns another node in the output. - * This can be used to call a method or node that does not return a value, i.e. - * type `void` on an input where returning a value is required. Example: - * - * ```js - * material.colorNode = myColor.bypass( runVoidFn() ) - *``` - * - * @augments Node - */ -declare class BypassNode extends Node { - /** - * Constructs a new bypass node. - * - * @param {Node} outputNode - The output node. - * @param {Node} callNode - The call node. - */ - constructor(outputNode: Node, callNode: Node); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isBypassNode: boolean; - /** - * The output node. - * - * @type {Node} - */ - outputNode: Node; - /** - * The call node. - * - * @type {Node} - */ - callNode: Node; - generateNodeType(builder: any): string; - generate(builder: any): string | Node | null; -} -import Node from './Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/ConstNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/ConstNode.d.ts deleted file mode 100644 index f26ae9eb3..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/ConstNode.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -export default ConstNode; -/** - * Class for representing a constant value in the shader. - * - * @augments InputNode - */ -declare class ConstNode extends InputNode { - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isConstNode: boolean; - /** - * Generates the shader string of the value with the current node builder. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The generated value as a shader string. - */ - generateConst(builder: NodeBuilder): string; - generate(builder: any, output: any): any; -} -import InputNode from './InputNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/ContextNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/ContextNode.d.ts deleted file mode 100644 index 40becdbad..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/ContextNode.d.ts +++ /dev/null @@ -1,107 +0,0 @@ -/** - * TSL function for defining a built-in shadow context for a given node. - * - * @tsl - * @function - * @param {ShadowNode} shadowNode - The shadow node representing the light's shadow. - * @param {Light} light - The light associated with the shadow. - * @param {Node} [node=null] - The node whose context should be modified. - * @returns {ContextNode} - */ -export function builtinShadowContext(shadowNode: ShadowNode, light: Light, node?: Node): ContextNode; -/** - * TSL function for defining a built-in ambient occlusion context for a given node. - * - * @tsl - * @function - * @param {Node} aoNode - The ambient occlusion value node to apply. - * @param {Node} [node=null] - The node whose context should be modified. - * @returns {ContextNode} - */ -export function builtinAOContext(aoNode: Node, node?: Node): ContextNode; -/** - * TSL function for defining a label context value for a given node. - * - * @tsl - * @function - * @deprecated - * @param {Node} node - The node whose context should be modified. - * @param {string} name - The name/label to set. - * @returns {ContextNode} - */ -export function label(node: Node, name: string): ContextNode; -export default ContextNode; -export function context(nodeOrValue?: Node | Object, value?: Object): ContextNode; -export function uniformFlow(node: Node): ContextNode; -export function setName(node: Node, name: string): ContextNode; -import Node from './Node.js'; -/** - * This node can be used as a context management component for another node. - * {@link NodeBuilder} performs its node building process in a specific context and - * this node allows the modify the context. A typical use case is to overwrite `getUV()` e.g.: - * - * ```js - *node.context( { getUV: () => customCoord } ); - *\// or - *material.contextNode = context( { getUV: () => customCoord } ); - *\// or - *renderer.contextNode = context( { getUV: () => customCoord } ); - *\// or - *scenePass.contextNode = context( { getUV: () => customCoord } ); - *``` - * @augments Node - */ -declare class ContextNode extends Node { - /** - * Constructs a new context node. - * - * @param {Node} node - The node whose context should be modified. - * @param {Object} [value={}] - The modified context data. - */ - constructor(node?: Node, value?: Object); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isContextNode: boolean; - /** - * The node whose context should be modified. - * - * @type {Node} - */ - node: Node; - /** - * The modified context data. - * - * @type {Object} - * @default {} - */ - value: Object; - /** - * This method is overwritten to ensure it returns the type of {@link ContextNode#node}. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The node type. - */ - generateNodeType(builder: NodeBuilder): string; - /** - * Gathers the context data from all parent context nodes. - * - * @return {Object} The gathered context data. - */ - getFlowContextData(): Object; - /** - * This method is overwritten to ensure it returns the member type of {@link ContextNode#node}. - * - * @param {NodeBuilder} builder - The current node builder. - * @param {string} name - The member name. - * @returns {string} The member type. - */ - getMemberType(builder: NodeBuilder, name: string): string; - analyze(builder: any): void; - setup(builder: any): void; - generate(builder: any, output: any): string | Node | null; -} diff --git a/jsdoc-testing/jsdoc/nodes/core/IndexNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/IndexNode.d.ts deleted file mode 100644 index 6117487c5..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/IndexNode.d.ts +++ /dev/null @@ -1,88 +0,0 @@ -export default IndexNode; -/** - * TSL object that represents the index of a vertex within a mesh. - * - * @tsl - * @type {IndexNode} - */ -export const vertexIndex: IndexNode; -/** - * TSL object that represents the index of either a mesh instance or an invocation of a compute shader. - * - * @tsl - * @type {IndexNode} - */ -export const instanceIndex: IndexNode; -/** - * TSL object that represents the index of the subgroup the current compute invocation belongs to. - * - * @tsl - * @type {IndexNode} - */ -export const subgroupIndex: IndexNode; -/** - * TSL object that represents the index of a compute invocation within the scope of a subgroup. - * - * @tsl - * @type {IndexNode} - */ -export const invocationSubgroupIndex: IndexNode; -/** - * TSL object that represents the index of a compute invocation within the scope of a workgroup load. - * - * @tsl - * @type {IndexNode} - */ -export const invocationLocalIndex: IndexNode; -/** - * TSL object that represents the index of a draw call. - * - * @tsl - * @type {IndexNode} - */ -export const drawIndex: IndexNode; -/** - * This class represents shader indices of different types. The following predefined node - * objects cover frequent use cases: - * - * - `vertexIndex`: The index of a vertex within a mesh. - * - `instanceIndex`: The index of either a mesh instance or an invocation of a compute shader. - * - `drawIndex`: The index of a draw call. - * - `invocationLocalIndex`: The index of a compute invocation within the scope of a workgroup load. - * - `invocationSubgroupIndex`: The index of a compute invocation within the scope of a subgroup. - * - `subgroupIndex`: The index of a compute invocation's subgroup within its workgroup. - * - * @augments Node - */ -declare class IndexNode extends Node { - /** - * Constructs a new index node. - * - * @param {('vertex'|'instance'|'subgroup'|'invocationLocal'|'invocationGlobal'|'invocationSubgroup'|'draw')} scope - The scope of the index node. - */ - constructor(scope: ("vertex" | "instance" | "subgroup" | "invocationLocal" | "invocationGlobal" | "invocationSubgroup" | "draw")); - /** - * The scope of the index node. - * - * @type {string} - */ - scope: string; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isIndexNode: boolean; - generate(builder: any): any; -} -declare namespace IndexNode { - let VERTEX: string; - let INSTANCE: string; - let SUBGROUP: string; - let INVOCATION_LOCAL: string; - let INVOCATION_SUBGROUP: string; - let DRAW: string; -} -import Node from './Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/InputNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/InputNode.d.ts deleted file mode 100644 index fc285a964..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/InputNode.d.ts +++ /dev/null @@ -1,61 +0,0 @@ -export default InputNode; -/** - * Base class for representing data input nodes. - * - * @augments Node - */ -declare class InputNode extends Node { - /** - * Constructs a new input node. - * - * @param {any} value - The value of this node. This can be any JS primitive, functions, array buffers or even three.js objects (vector, matrices, colors). - * @param {?string} nodeType - The node type. If no explicit type is defined, the node tries to derive the type from its value. - */ - constructor(value: any, nodeType?: string | null); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isInputNode: boolean; - /** - * The value of this node. This can be any JS primitive, functions, array buffers or even three.js objects (vector, matrices, colors). - * - * @type {any} - */ - value: any; - /** - * The precision of the value in the shader. - * - * @type {?('low'|'medium'|'high')} - * @default null - */ - precision: ("low" | "medium" | "high") | null; - generateNodeType(): string | null; - /** - * Returns the input type of the node which is by default the node type. Derived modules - * might overwrite this method and use a fixed type or compute one analytically. - * - * A typical example for different input and node types are textures. The input type of a - * normal RGBA texture is `texture` whereas its node type is `vec4`. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The input type. - */ - getInputType(builder: NodeBuilder): string; - /** - * Sets the precision to the given value. The method can be - * overwritten in derived classes if the final precision must be computed - * analytically. - * - * @param {('low'|'medium'|'high')} precision - The precision of the input value in the shader. - * @return {InputNode} A reference to this node. - */ - setPrecision(precision: ("low" | "medium" | "high")): InputNode; - serialize(data: any): void; - deserialize(data: any): void; - generate(): void; -} -import Node from './Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/InspectorNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/InspectorNode.d.ts deleted file mode 100644 index 7fd327733..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/InspectorNode.d.ts +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Creates an inspector node to wrap around a given node for inspection purposes. - * - * @tsl - * @param {Node} node - The node to inspect. - * @param {string} [name=''] - Optional name for the inspector node. - * @param {Function|null} [callback=null] - Optional callback to modify the node during setup. - * @returns {Node} The inspector node. - */ -export function inspector(node: Node, name?: string, callback?: Function | null): Node; -export default InspectorNode; -import Node from './Node.js'; -/** - * InspectorNode is a wrapper node that allows inspection of node values during rendering. - * It can be used to debug or analyze node outputs in the rendering pipeline. - * - * @augments Node - */ -declare class InspectorNode extends Node { - /** - * Creates an InspectorNode. - * - * @param {Node} node - The node to inspect. - * @param {string} [name=''] - Optional name for the inspector node. - * @param {Function|null} [callback=null] - Optional callback to modify the node during setup. - */ - constructor(node: Node, name?: string, callback?: Function | null); - node: Node; - callback: Function | null; - isInspectorNode: boolean; - /** - * Returns the name of the inspector node. - * - * @returns {string} - */ - getName(): string; - /** - * Updates the inspector node, allowing inspection of the wrapped node. - * - * @param {NodeFrame} frame - A reference to the current node frame. - */ - update(frame: NodeFrame): void; - /** - * Returns the type of the wrapped node. - * - * @param {NodeBuilder} builder - The node builder. - * @returns {string} - */ - generateNodeType(builder: NodeBuilder): string; - /** - * Sets up the inspector node. - * - * @param {NodeBuilder} builder - The node builder. - * @returns {Node} The setup node. - */ - setup(builder: NodeBuilder): Node; -} diff --git a/jsdoc-testing/jsdoc/nodes/core/IsolateNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/IsolateNode.d.ts deleted file mode 100644 index 23e65acba..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/IsolateNode.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -/** - * TSL function for creating a cache node. - * - * @tsl - * @function - * @deprecated - * @param {Node} node - The node that should be cached. - * @param {boolean} [parent=true] - Whether this node refers to a shared parent cache or not. - * @returns {IsolateNode} - */ -export function cache(node: Node, parent?: boolean): IsolateNode; -export default IsolateNode; -export function isolate(node: Node): IsolateNode; -import Node from './Node.js'; -/** - * This node can be used as a cache management component for another node. - * Caching is in general used by default in {@link NodeBuilder} but this node - * allows the usage of a shared parent cache during the build process. - * - * @augments Node - */ -declare class IsolateNode extends Node { - /** - * Constructs a new cache node. - * - * @param {Node} node - The node that should be cached. - * @param {boolean} [parent=true] - Whether this node refers to a shared parent cache or not. - */ - constructor(node: Node, parent?: boolean); - /** - * The node that should be cached. - * - * @type {Node} - */ - node: Node; - /** - * Whether this node refers to a shared parent cache or not. - * - * @type {boolean} - * @default true - */ - parent: boolean; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isIsolateNode: boolean; - generateNodeType(builder: any): string; - build(builder: any, ...params: any[]): string | Node | null; - setParent(parent: any): this; - getParent(): boolean; -} diff --git a/jsdoc-testing/jsdoc/nodes/core/LightingModel.d.ts b/jsdoc-testing/jsdoc/nodes/core/LightingModel.d.ts deleted file mode 100644 index e281d8a3c..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/LightingModel.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -export default LightingModel; -/** - * Abstract class for implementing lighting models. The module defines - * multiple methods that concrete lighting models can implement. These - * methods are executed at different points during the light evaluation - * process. - */ -declare class LightingModel { - /** - * This method is intended for setting up lighting model and context data - * which are later used in the evaluation process. - * - * @abstract - * @param {NodeBuilder} builder - The current node builder. - */ - start(builder: NodeBuilder): void; - /** - * This method is intended for executing final tasks like final updates - * to the outgoing light. - * - * @abstract - * @param {NodeBuilder} builder - The current node builder. - */ - finish(): void; - /** - * This method is intended for implementing the direct light term and - * executed during the build process of directional, point and spot light nodes. - * - * @abstract - * @param {Object} lightData - The light data. - * @param {NodeBuilder} builder - The current node builder. - */ - direct(): void; - /** - * This method is intended for implementing the direct light term for - * rect area light nodes. - * - * @abstract - * @param {Object} lightData - The light data. - * @param {NodeBuilder} builder - The current node builder. - */ - directRectArea(): void; - /** - * This method is intended for implementing the indirect light term. - * - * @abstract - * @param {NodeBuilder} builder - The current node builder. - */ - indirect(): void; - /** - * This method is intended for implementing the ambient occlusion term. - * Unlike other methods, this method must be called manually by the lighting - * model in its indirect term. - * - * @abstract - * @param {NodeBuilder} builder - The current node builder. - */ - ambientOcclusion(): void; -} diff --git a/jsdoc-testing/jsdoc/nodes/core/MRTNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/MRTNode.d.ts deleted file mode 100644 index 8d1b4d0be..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/MRTNode.d.ts +++ /dev/null @@ -1,106 +0,0 @@ -/** - * Returns the MRT texture index for the given name. - * - * @param {Array} textures - The textures of a MRT-configured render target. - * @param {string} name - The name of the MRT texture which index is requested. - * @return {number} The texture index. - */ -export function getTextureIndex(textures: Array, name: string): number; -export default MRTNode; -/** - * TSL function for creating a MRT node. - * - * @tsl - * @function - * @param {Object} outputNodes - The MRT outputs. - * @returns {MRTNode} - */ -export const mrt: any; -/** - * This node can be used setup a MRT context for rendering. A typical MRT setup for - * post-processing is shown below: - * ```js - * const mrtNode = mrt( { - * output: output, - * normal: normalView - * } ) ; - * ``` - * The MRT output is defined as a dictionary. - * - * @augments OutputStructNode - */ -declare class MRTNode extends OutputStructNode { - /** - * Constructs a new output struct node. - * - * @param {Object} outputNodes - The MRT outputs. - */ - constructor(outputNodes: { - [x: string]: Node; - }); - /** - * A dictionary representing the MRT outputs. The key - * is the name of the output, the value the node which produces - * the output result. - * - * @type {Object} - */ - outputNodes: { - [x: string]: Node; - }; - /** - * A dictionary storing the blend modes for each output. - * - * @type {Object} - */ - blendModes: { - [x: string]: BlendMode; - }; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isMRTNode: boolean; - /** - * Sets the blend mode for the given output name. - * - * @param {string} name - The name of the output. - * @param {BlendMode} blend - The blending mode. - * @return {MRTNode} The current MRT node. - */ - setBlendMode(name: string, blend: BlendMode): MRTNode; - /** - * Returns the blend mode for the given output name. - * - * @param {string} name - The name of the output. - * @return {BlendMode} The blend mode. - */ - getBlendMode(name: string): BlendMode; - /** - * Returns `true` if the MRT node has an output with the given name. - * - * @param {string} name - The name of the output. - * @return {NodeBuilder} Whether the MRT node has an output for the given name or not. - */ - has(name: string): NodeBuilder; - /** - * Returns the output node for the given name. - * - * @param {string} name - The name of the output. - * @return {Node} The output node. - */ - get(name: string): Node; - /** - * Merges the outputs of the given MRT node with the outputs of this node. - * - * @param {MRTNode} mrtNode - The MRT to merge. - * @return {MRTNode} A new MRT node with merged outputs.. - */ - merge(mrtNode: MRTNode): MRTNode; - setup(builder: any): import("./Node.js").default | null; -} -import OutputStructNode from './OutputStructNode.js'; -import BlendMode from '../../renderers/common/BlendMode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/Node.d.ts b/jsdoc-testing/jsdoc/nodes/core/Node.d.ts deleted file mode 100644 index 8299d6c54..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/Node.d.ts +++ /dev/null @@ -1,437 +0,0 @@ -export default Node; -/** - * Base class for all nodes. - * - * @augments EventDispatcher - */ -declare class Node extends EventDispatcher { - static get type(): string; - /** - * Constructs a new node. - * - * @param {?string} nodeType - The node type. - */ - constructor(nodeType?: string | null); - /** - * The node type. This represents the result type of the node (e.g. `float` or `vec3`). - * - * @type {?string} - * @default null - */ - nodeType: string | null; - /** - * The update type of the node's {@link Node#update} method. Possible values are listed in {@link NodeUpdateType}. - * - * @type {string} - * @default 'none' - */ - updateType: string; - /** - * The update type of the node's {@link Node#updateBefore} method. Possible values are listed in {@link NodeUpdateType}. - * - * @type {string} - * @default 'none' - */ - updateBeforeType: string; - /** - * The update type of the node's {@link Node#updateAfter} method. Possible values are listed in {@link NodeUpdateType}. - * - * @type {string} - * @default 'none' - */ - updateAfterType: string; - /** - * The version of the node. The version automatically is increased when {@link Node#needsUpdate} is set to `true`. - * - * @type {number} - * @readonly - * @default 0 - */ - readonly version: number; - /** - * The name of the node. - * - * @type {string} - * @default '' - */ - name: string; - /** - * Whether this node is global or not. This property is relevant for the internal - * node caching system. All nodes which should be declared just once should - * set this flag to `true` (a typical example is {@link AttributeNode}). - * - * @type {boolean} - * @default false - */ - global: boolean; - /** - * Create a list of parents for this node during the build process. - * - * @type {boolean} - * @default false - */ - parents: boolean; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isNode: boolean; - _beforeNodes: any; - /** - * The cache key of this node. - * - * @private - * @type {?number} - * @default null - */ - private _cacheKey; - /** - * The UUID of the node. - * - * @type {string} - * @default null - * @private - */ - private _uuid; - /** - * The cache key's version. - * - * @private - * @type {number} - * @default 0 - */ - private _cacheKeyVersion; - /** - * The unique ID of the node. - * - * @type {number} - * @readonly - */ - readonly id: number; - /** - * The stack trace of the node for debugging purposes. - * - * @type {?string} - * @default null - */ - stackTrace: string | null; - /** - * Set this property to `true` when the node should be regenerated. - * - * @type {boolean} - * @default false - * @param {boolean} value - */ - set needsUpdate(value: boolean); - /** - * The UUID of the node. - * - * @type {string} - * @readonly - */ - readonly get uuid(): string; - /** - * The type of the class. The value is usually the constructor name. - * - * @type {string} - * @readonly - */ - readonly get type(): string; - /** - * Convenient method for defining {@link Node#update}. - * - * @param {Function} callback - The update method. - * @param {string} updateType - The update type. - * @return {Node} A reference to this node. - */ - onUpdate(callback: Function, updateType: string): Node; - /** - * The method can be implemented to update the node's internal state when it is used to render an object. - * The {@link Node#updateType} property defines how often the update is executed. - * - * @abstract - * @param {NodeFrame} frame - A reference to the current node frame. - * @return {?boolean} An optional bool that indicates whether the implementation actually performed an update or not (e.g. due to caching). - */ - update(): boolean | null; - /** - * Convenient method for defining {@link Node#update}. Similar to {@link Node#onUpdate}, but - * this method automatically sets the update type to `FRAME`. - * - * @param {Function} callback - The update method. - * @return {Node} A reference to this node. - */ - onFrameUpdate(callback: Function): Node; - /** - * Convenient method for defining {@link Node#update}. Similar to {@link Node#onUpdate}, but - * this method automatically sets the update type to `RENDER`. - * - * @param {Function} callback - The update method. - * @return {Node} A reference to this node. - */ - onRenderUpdate(callback: Function): Node; - /** - * Convenient method for defining {@link Node#update}. Similar to {@link Node#onUpdate}, but - * this method automatically sets the update type to `OBJECT`. - * - * @param {Function} callback - The update method. - * @return {Node} A reference to this node. - */ - onObjectUpdate(callback: Function): Node; - /** - * Convenient method for defining {@link Node#updateReference}. - * - * @param {Function} callback - The update method. - * @return {Node} A reference to this node. - */ - onReference(callback: Function): Node; - /** - * Nodes might refer to other objects like materials. This method allows to dynamically update the reference - * to such objects based on a given state (e.g. the current node frame or builder). - * - * @param {any} state - This method can be invocated in different contexts so `state` can refer to any object type. - * @return {any} The updated reference. - */ - updateReference(): any; - /** - * By default this method returns the value of the {@link Node#global} flag. This method - * can be overwritten in derived classes if an analytical way is required to determine the - * global cache referring to the current shader-stage. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {boolean} Whether this node is global or not. - */ - isGlobal(): boolean; - /** - * Generator function that can be used to iterate over the child nodes. - * - * @generator - * @yields {Node} A child node. - */ - getChildren(): Generator; - /** - * Calling this method dispatches the `dispose` event. This event can be used - * to register event listeners for clean up tasks. - */ - dispose(): void; - /** - * Callback for {@link Node#traverse}. - * - * @callback traverseCallback - * @param {Node} node - The current node. - */ - /** - * Can be used to traverse through the node's hierarchy. - * - * @param {traverseCallback} callback - A callback that is executed per node. - */ - traverse(callback: (node: Node) => any): void; - /** - * Returns the child nodes of this node. - * - * @private - * @param {Set} [ignores=new Set()] - A set of nodes to ignore during the search to avoid circular references. - * @returns {Array} An array of objects describing the child nodes. - */ - private _getChildren; - /** - * Returns the cache key for this node. - * - * @param {boolean} [force=false] - When set to `true`, a recomputation of the cache key is forced. - * @param {Set} [ignores=null] - A set of nodes to ignore during the computation of the cache key. - * @return {number} The cache key of the node. - */ - getCacheKey(force?: boolean, ignores?: Set): number; - /** - * Generate a custom cache key for this node. - * - * @return {number} The cache key of the node. - */ - customCacheKey(): number; - /** - * Returns the references to this node which is by default `this`. - * - * @return {Node} A reference to this node. - */ - getScope(): Node; - /** - * Returns the hash of the node which is used to identify the node. By default it's - * the {@link Node#uuid} however derived node classes might have to overwrite this method - * depending on their implementation. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The hash. - */ - getHash(): string; - /** - * Returns the update type of {@link Node#update}. - * - * @return {NodeUpdateType} The update type. - */ - getUpdateType(): { - NONE: string; - FRAME: string; - RENDER: string; - OBJECT: string; - }; - /** - * Returns the update type of {@link Node#updateBefore}. - * - * @return {NodeUpdateType} The update type. - */ - getUpdateBeforeType(): { - NONE: string; - FRAME: string; - RENDER: string; - OBJECT: string; - }; - /** - * Returns the update type of {@link Node#updateAfter}. - * - * @return {NodeUpdateType} The update type. - */ - getUpdateAfterType(): { - NONE: string; - FRAME: string; - RENDER: string; - OBJECT: string; - }; - /** - * Certain types are composed of multiple elements. For example a `vec3` - * is composed of three `float` values. This method returns the type of - * these elements. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The type of the node. - */ - getElementType(builder: NodeBuilder): string; - /** - * Returns the node member type for the given name. - * - * @param {NodeBuilder} builder - The current node builder. - * @param {string} name - The name of the member. - * @return {string} The type of the node. - */ - getMemberType(): string; - /** - * Returns the node's type. - * - * @param {NodeBuilder} builder - The current node builder. - * @param {string} [output=null] - The output of the node. - * @return {string} The type of the node. - */ - getNodeType(builder: NodeBuilder, output?: string): string; - /** - * Returns the node's type. - * - * @param {NodeBuilder} builder - The current node builder. - * @param {string} [output=null] - The output of the node. - * @return {string} The type of the node. - */ - generateNodeType(builder: NodeBuilder, output?: string): string; - /** - * This method is used during the build process of a node and ensures - * equal nodes are not built multiple times but just once. For example if - * `attribute( 'uv' )` is used multiple times by the user, the build - * process makes sure to process just the first node. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {Node} The shared node if possible. Otherwise `this` is returned. - */ - getShared(builder: NodeBuilder): Node; - /** - * Returns the number of elements in the node array. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {?number} The number of elements in the node array. - */ - getArrayCount(): number | null; - /** - * Represents the setup stage which is the first step of the build process, see {@link Node#build} method. - * This method is often overwritten in derived modules to prepare the node which is used as a node's output/result. - * If an output node is prepared, then it must be returned in the `return` statement of the derived module's setup function. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {?Node} The output node. - */ - setup(builder: NodeBuilder): Node | null; - /** - * Represents the analyze stage which is the second step of the build process, see {@link Node#build} method. - * This stage analyzes the node hierarchy and ensures descendent nodes are built. - * - * @param {NodeBuilder} builder - The current node builder. - * @param {?Node} output - The target output node. - */ - analyze(builder: NodeBuilder, output?: Node | null): void; - /** - * Represents the generate stage which is the third step of the build process, see {@link Node#build} method. - * This state builds the output node and returns the resulting shader string. - * - * @param {NodeBuilder} builder - The current node builder. - * @param {?string} [output] - Can be used to define the output type. - * @return {?string} The generated shader string. - */ - generate(builder: NodeBuilder, output?: string | null): string | null; - /** - * The method can be implemented to update the node's internal state before it is used to render an object. - * The {@link Node#updateBeforeType} property defines how often the update is executed. - * - * @abstract - * @param {NodeFrame} frame - A reference to the current node frame. - * @return {?boolean} An optional bool that indicates whether the implementation actually performed an update or not (e.g. due to caching). - */ - updateBefore(): boolean | null; - /** - * The method can be implemented to update the node's internal state after it was used to render an object. - * The {@link Node#updateAfterType} property defines how often the update is executed. - * - * @abstract - * @param {NodeFrame} frame - A reference to the current node frame. - * @return {?boolean} An optional bool that indicates whether the implementation actually performed an update or not (e.g. due to caching). - */ - updateAfter(): boolean | null; - before(node: any): this; - /** - * This method performs the build of a node. The behavior and return value depend on the current build stage: - * - **setup**: Prepares the node and its children for the build process. This process can also create new nodes. Returns the node itself or a variant. - * - **analyze**: Analyzes the node hierarchy for optimizations in the code generation stage. Returns `null`. - * - **generate**: Generates the shader code for the node. Returns the generated shader string. - * - * @param {NodeBuilder} builder - The current node builder. - * @param {?(string|Node)} [output=null] - Can be used to define the output type. - * @return {?(Node|string)} The result of the build process, depending on the build stage. - */ - build(builder: NodeBuilder, output?: (string | Node) | null): (Node | string) | null; - /** - * Returns the child nodes as a JSON object. - * - * @return {Generator} An iterable list of serialized child objects as JSON. - */ - getSerializeChildren(): Generator; - /** - * Serializes the node to JSON. - * - * @param {Object} json - The output JSON object. - */ - serialize(json: Object): void; - /** - * Deserializes the node from the given JSON. - * - * @param {Object} json - The JSON object. - */ - deserialize(json: Object): void; - /** - * Serializes the node into the three.js JSON Object/Scene format. - * - * @param {?Object} meta - An optional JSON object that already holds serialized data from other scene objects. - * @return {Object} The serialized node. - */ - toJSON(meta: Object | null): Object; -} -declare namespace Node { - let captureStackTrace: boolean; -} -import { EventDispatcher } from '../../core/EventDispatcher.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/NodeAttribute.d.ts b/jsdoc-testing/jsdoc/nodes/core/NodeAttribute.d.ts deleted file mode 100644 index d6414185f..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/NodeAttribute.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -export default NodeAttribute; -/** - * {@link NodeBuilder} is going to create instances of this class during the build process - * of nodes. They represent the final shader attributes that are going to be generated - * by the builder. Arrays of node attributes is maintained in {@link NodeBuilder#attributes} - * and {@link NodeBuilder#bufferAttributes} for this purpose. - */ -declare class NodeAttribute { - /** - * Constructs a new node attribute. - * - * @param {string} name - The name of the attribute. - * @param {string} type - The type of the attribute. - * @param {?Node} node - An optional reference to the node. - */ - constructor(name: string, type: string, node?: Node | null); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isNodeAttribute: boolean; - /** - * The name of the attribute. - * - * @type {string} - */ - name: string; - /** - * The type of the attribute. - * - * @type {string} - */ - type: string; - /** - * An optional reference to the node. - * - * @type {?Node} - * @default null - */ - node: Node | null; -} diff --git a/jsdoc-testing/jsdoc/nodes/core/NodeBuilder.d.ts b/jsdoc-testing/jsdoc/nodes/core/NodeBuilder.d.ts deleted file mode 100644 index 7cccc1b1f..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/NodeBuilder.d.ts +++ /dev/null @@ -1,1322 +0,0 @@ -export default NodeBuilder; -/** - * Base class for builders which generate a shader program based - * on a 3D object and its node material definition. - */ -declare class NodeBuilder { - /** - * Constructs a new node builder. - * - * @param {Object3D} object - The 3D object. - * @param {Renderer} renderer - The current renderer. - * @param {NodeParser} parser - A reference to a node parser. - */ - constructor(object: Object3D, renderer: Renderer, parser: NodeParser); - /** - * The 3D object. - * - * @type {Object3D} - */ - object: Object3D; - /** - * The material of the 3D object. - * - * @type {?Material} - */ - material: Material | null; - /** - * The geometry of the 3D object. - * - * @type {?BufferGeometry} - */ - geometry: BufferGeometry | null; - /** - * The current renderer. - * - * @type {Renderer} - */ - renderer: Renderer; - /** - * A reference to a node parser. - * - * @type {NodeParser} - */ - parser: NodeParser; - /** - * The scene the 3D object belongs to. - * - * @type {?Scene} - * @default null - */ - scene: Scene | null; - /** - * The camera the 3D object is rendered with. - * - * @type {?Camera} - * @default null - */ - camera: Camera | null; - /** - * A list of all nodes the builder is processing - * for this 3D object. - * - * @type {Array} - */ - nodes: Array; - /** - * A list of all nodes the builder is processing in sequential order. - * - * This is used to determine the update order of nodes, which is important for - * {@link NodeUpdateType#UPDATE_BEFORE} and {@link NodeUpdateType#UPDATE_AFTER}. - * - * @type {Array} - */ - sequentialNodes: Array; - /** - * A list of all nodes which {@link Node#update} method should be executed. - * - * @type {Array} - */ - updateNodes: Array; - /** - * A list of all nodes which {@link Node#updateBefore} method should be executed. - * - * @type {Array} - */ - updateBeforeNodes: Array; - /** - * A list of all nodes which {@link Node#updateAfter} method should be executed. - * - * @type {Array} - */ - updateAfterNodes: Array; - /** - * A dictionary that assigns each node to a unique hash. - * - * @type {Object} - */ - hashNodes: { - [x: number]: Node; - }; - /** - * A reference to a node material observer. - * - * @type {?NodeMaterialObserver} - * @default null - */ - observer: NodeMaterialObserver | null; - /** - * A reference to the current lights node. - * - * @type {?LightsNode} - * @default null - */ - lightsNode: LightsNode | null; - /** - * A reference to the current environment node. - * - * @type {?Node} - * @default null - */ - environmentNode: Node | null; - /** - * A reference to the current fog node. - * - * @type {?Node} - * @default null - */ - fogNode: Node | null; - /** - * The current clipping context. - * - * @type {?ClippingContext} - */ - clippingContext: ClippingContext | null; - /** - * The generated vertex shader. - * - * @type {?string} - */ - vertexShader: string | null; - /** - * The generated fragment shader. - * - * @type {?string} - */ - fragmentShader: string | null; - /** - * The generated compute shader. - * - * @type {?string} - */ - computeShader: string | null; - /** - * Nodes used in the primary flow of code generation. - * - * @type {Object>} - */ - flowNodes: { - [x: string]: Node[]; - }; - /** - * Nodes code from `.flowNodes`. - * - * @type {Object} - */ - flowCode: { - [x: string]: string; - }; - /** - * This dictionary holds the node uniforms of the builder. - * The uniforms are maintained in an array for each shader stage. - * - * @type {Object} - */ - uniforms: Object; - /** - * This dictionary holds the output structs of the builder. - * The structs are maintained in an array for each shader stage. - * - * @type {Object} - */ - structs: Object; - /** - * This dictionary holds the types of the builder. - * - * @type {Object} - */ - types: Object; - /** - * This dictionary holds the bindings for each shader stage. - * - * @type {Object} - */ - bindings: Object; - /** - * This dictionary maintains the binding indices per bind group. - * - * @type {Object} - */ - bindingsIndexes: Object; - /** - * Reference to the array of bind groups. - * - * @type {?Array} - */ - bindGroups: Array | null; - /** - * This array holds the node attributes of this builder - * created via {@link AttributeNode}. - * - * @type {Array} - */ - attributes: Array; - /** - * This array holds the node attributes of this builder - * created via {@link BufferAttributeNode}. - * - * @type {Array} - */ - bufferAttributes: Array; - /** - * This array holds the node varyings of this builder. - * - * @type {Array} - */ - varyings: Array; - /** - * This dictionary holds the (native) node codes of this builder. - * The codes are maintained in an array for each shader stage. - * - * @type {Object>} - */ - codes: { - [x: string]: NodeCode[]; - }; - /** - * This dictionary holds the node variables of this builder. - * The variables are maintained in an array for each shader stage. - * This dictionary is also used to count the number of variables - * according to their type (const, vars). - * - * @type {Object|number>} - */ - vars: { - [x: string]: number | NodeVar[]; - }; - /** - * This dictionary holds the declarations for each shader stage. - * - * @type {Object} - */ - declarations: Object; - /** - * Current code flow. - * All code generated in this stack will be stored in `.flow`. - * - * @type {{code: string}} - */ - flow: { - code: string; - }; - /** - * A chain of nodes. - * Used to check recursive calls in node-graph. - * - * @type {Array} - */ - chaining: Array; - /** - * The current stack. - * This reflects the current process in the code block hierarchy, - * it is useful to know if the current process is inside a conditional for example. - * - * @type {StackNode} - */ - stack: StackNode; - /** - * List of stack nodes. - * The current stack hierarchy is stored in an array. - * - * @type {Array} - */ - stacks: Array; - /** - * A tab value. Used for shader string generation. - * - * @type {string} - * @default '\t' - */ - tab: string; - /** - * Reference to the current function node. - * - * @type {?FunctionNode} - * @default null - */ - currentFunctionNode: FunctionNode | null; - /** - * The builder's context. - * - * @type {Object} - */ - context: Object; - /** - * The builder's cache. - * - * @type {NodeCache} - */ - cache: NodeCache; - /** - * Since the {@link NodeBuilder#cache} might be temporarily - * overwritten by other caches, this member retains the reference - * to the builder's own cache. - * - * @type {NodeCache} - * @default this.cache - */ - globalCache: NodeCache; - flowsData: WeakMap; - /** - * The current shader stage. - * - * @type {?('vertex'|'fragment'|'compute'|'any')} - */ - shaderStage: ("vertex" | "fragment" | "compute" | "any") | null; - /** - * The current build stage. - * - * @type {?('setup'|'analyze'|'generate')} - */ - buildStage: ("setup" | "analyze" | "generate") | null; - /** - * The sub-build layers. - * - * @type {Array} - * @default [] - */ - subBuildLayers: Array; - /** - * The active stack nodes. - * - * @type {Array} - */ - activeStacks: Array; - /** - * The current sub-build TSL function(Fn). - * - * @type {?string} - * @default null - */ - subBuildFn: string | null; - /** - * The current TSL function(Fn) call node. - * - * @type {?Node} - * @default null - */ - fnCall: Node | null; - /** - * Whether the material is using flat shading or not. - * - * @returns {boolean} Whether the material is using flat shading or not. - */ - isFlatShading(): boolean; - /** - * Whether the material is opaque or not. - * - * @return {boolean} Whether the material is opaque or not. - */ - isOpaque(): boolean; - /** - * Factory method for creating an instance of {@link RenderTarget} with the given - * dimensions and options. - * - * @param {number} width - The width of the render target. - * @param {number} height - The height of the render target. - * @param {Object} options - The options of the render target. - * @return {RenderTarget} The render target. - */ - createRenderTarget(width: number, height: number, options: Object): RenderTarget; - /** - * Factory method for creating an instance of {@link CubeRenderTarget} with the given - * dimensions and options. - * - * @param {number} size - The size of the cube render target. - * @param {Object} options - The options of the cube render target. - * @return {CubeRenderTarget} The cube render target. - */ - createCubeRenderTarget(size: number, options: Object): CubeRenderTarget; - /** - * Whether the given node is included in the internal array of nodes or not. - * - * @param {Node} node - The node to test. - * @return {boolean} Whether the given node is included in the internal array of nodes or not. - */ - includes(node: Node): boolean; - /** - * Returns the output struct name which is required by - * {@link OutputStructNode}. - * - * @abstract - * @return {string} The name of the output struct. - */ - getOutputStructName(): string; - /** - * Returns a bind group for the given group name and binding. - * - * @private - * @param {string} groupName - The group name. - * @param {Array} bindings - List of bindings. - * @return {BindGroup} The bind group - */ - private _getBindGroup; - /** - * Returns an array of node uniform groups for the given group name and shader stage. - * - * @param {string} groupName - The group name. - * @param {('vertex'|'fragment'|'compute'|'any')} shaderStage - The shader stage. - * @return {Array} The array of node uniform groups. - */ - getBindGroupArray(groupName: string, shaderStage: ("vertex" | "fragment" | "compute" | "any")): Array; - /** - * Returns a list bindings of all shader stages separated by groups. - * - * @return {Array} The list of bindings. - */ - getBindings(): Array; - /** - * Sorts the bind groups and updates {@link NodeBuilder#bindingsIndexes}. - */ - sortBindingGroups(): void; - /** - * The builder maintains each node in a hash-based dictionary. - * This method sets the given node (value) with the given hash (key) into this dictionary. - * - * @param {Node} node - The node to add. - * @param {number} hash - The hash of the node. - */ - setHashNode(node: Node, hash: number): void; - /** - * Adds a node to this builder. - * - * @param {Node} node - The node to add. - */ - addNode(node: Node): void; - /** - * It is used to add Nodes that will be used as FRAME and RENDER events, - * and need to follow a certain sequence in the calls to work correctly. - * This function should be called after 'setup()' in the 'build()' process to ensure that the child nodes are processed first. - * - * @param {Node} node - The node to add. - */ - addSequentialNode(node: Node): void; - /** - * Checks the update types of nodes - */ - buildUpdateNodes(): void; - /** - * A reference the current node which is the - * last node in the chain of nodes. - * - * @type {Node} - */ - get currentNode(): Node; - /** - * Whether the given texture is filtered or not. - * - * @param {Texture} texture - The texture to check. - * @return {boolean} Whether the given texture is filtered or not. - */ - isFilteredTexture(texture: Texture): boolean; - /** - * Returns the maximum number of bytes available for uniform buffers. - * - * @return {number} The maximum number of bytes available for uniform buffers. - */ - getUniformBufferLimit(): number; - /** - * Adds the given node to the internal node chain. - * This is used to check recursive calls in node-graph. - * - * @param {Node} node - The node to add. - */ - addChain(node: Node): void; - /** - * Removes the given node from the internal node chain. - * - * @param {Node} node - The node to remove. - */ - removeChain(node: Node): void; - /** - * Returns the native shader method name for a given generic name. E.g. - * the method name `textureDimensions` matches the WGSL name but must be - * resolved to `textureSize` in GLSL. - * - * @abstract - * @param {string} method - The method name to resolve. - * @return {string} The resolved method name. - */ - getMethod(method: string): string; - /** - * Returns the native snippet for a ternary operation. E.g. GLSL would output - * a ternary op as `cond ? x : y` whereas WGSL would output it as `select(y, x, cond)` - * - * @abstract - * @param {string} condSnippet - The condition determining which expression gets resolved. - * @param {string} ifSnippet - The expression to resolve to if the condition is true. - * @param {string} elseSnippet - The expression to resolve to if the condition is false. - * @return {string} The resolved method name. - */ - getTernary(): string; - /** - * Returns a node for the given hash, see {@link NodeBuilder#setHashNode}. - * - * @param {number} hash - The hash of the node. - * @return {Node} The found node. - */ - getNodeFromHash(hash: number): Node; - /** - * Adds the Node to a target flow so that it can generate code in the 'generate' process. - * - * @param {('vertex'|'fragment'|'compute')} shaderStage - The shader stage. - * @param {Node} node - The node to add. - * @return {Node} The node. - */ - addFlow(shaderStage: ("vertex" | "fragment" | "compute"), node: Node): Node; - /** - * Sets builder's context. - * - * @param {Object} context - The context to set. - */ - setContext(context: Object): void; - /** - * Returns the builder's current context. - * - * @return {Object} The builder's current context. - */ - getContext(): Object; - /** - * Adds context data to the builder's current context. - * - * @param {Object} context - The context to add. - * @return {Object} The previous context. - */ - addContext(context: Object): Object; - /** - * Gets a context used in shader construction that can be shared across different materials. - * This is necessary since the renderer cache can reuse shaders generated in one material and use them in another. - * - * @return {Object} The builder's current context without material. - */ - getSharedContext(): Object; - /** - * Sets builder's cache. - * - * @param {NodeCache} cache - The cache to set. - */ - setCache(cache: NodeCache): void; - /** - * Returns the builder's current cache. - * - * @return {NodeCache} The builder's current cache. - */ - getCache(): NodeCache; - /** - * Returns a cache for the given node. - * - * @param {Node} node - The node. - * @param {boolean} [parent=true] - Whether this node refers to a shared parent cache or not. - * @return {NodeCache} The cache. - */ - getCacheFromNode(node: Node, parent?: boolean): NodeCache; - /** - * Whether the requested feature is available or not. - * - * @abstract - * @param {string} name - The requested feature. - * @return {boolean} Whether the requested feature is supported or not. - */ - isAvailable(): boolean; - /** - * Returns the vertexIndex input variable as a native shader string. - * - * @abstract - * @return {string} The instanceIndex shader string. - */ - getVertexIndex(): string; - /** - * Contextually returns either the vertex stage instance index builtin - * or the linearized index of an compute invocation within a grid of workgroups. - * - * @abstract - * @return {string} The instanceIndex shader string. - */ - getInstanceIndex(): string; - /** - * Returns the drawIndex input variable as a native shader string. - * Only relevant for WebGL and its `WEBGL_multi_draw` extension. - * - * @abstract - * @return {?string} The drawIndex shader string. - */ - getDrawIndex(): string | null; - /** - * Returns the frontFacing input variable as a native shader string. - * - * @abstract - * @return {string} The frontFacing shader string. - */ - getFrontFacing(): string; - /** - * Returns the fragCoord input variable as a native shader string. - * - * @abstract - * @return {string} The fragCoord shader string. - */ - getFragCoord(): string; - /** - * Whether to flip texture data along its vertical axis or not. WebGL needs - * this method evaluate to `true`, WebGPU to `false`. - * - * @abstract - * @return {boolean} Whether to flip texture data along its vertical axis or not. - */ - isFlipY(): boolean; - /** - * Calling this method increases the usage count for the given node by one. - * - * @param {Node} node - The node to increase the usage count for. - * @return {number} The updated usage count. - */ - increaseUsage(node: Node): number; - /** - * Generates a texture sample shader string for the given texture data. - * - * @abstract - * @param {Texture} texture - The texture. - * @param {string} textureProperty - The texture property name. - * @param {string} uvSnippet - Snippet defining the texture coordinates. - * @return {string} The generated shader string. - */ - generateTexture(): string; - /** - * Generates a texture LOD shader string for the given texture data. - * - * @abstract - * @param {Texture} texture - The texture. - * @param {string} textureProperty - The texture property name. - * @param {string} uvSnippet - Snippet defining the texture coordinates. - * @param {?string} depthSnippet - Snippet defining the 0-based texture array index to sample. - * @param {string} levelSnippet - Snippet defining the mip level. - * @return {string} The generated shader string. - */ - generateTextureLod(): string; - /** - * Generates the array declaration string. - * - * @param {string} type - The type. - * @param {?number} [count] - The count. - * @return {string} The generated value as a shader string. - */ - generateArrayDeclaration(type: string, count?: number | null): string; - /** - * Generates the array shader string for the given type and value. - * - * @param {string} type - The type. - * @param {?number} [count] - The count. - * @param {?Array} [values=null] - The default values. - * @return {string} The generated value as a shader string. - */ - generateArray(type: string, count?: number | null, values?: Array | null): string; - /** - * Generates the struct shader string. - * - * @param {string} type - The type. - * @param {Array} [membersLayout] - The count. - * @param {?Array} [values=null] - The default values. - * @return {string} The generated value as a shader string. - */ - generateStruct(type: string, membersLayout?: Array, values?: Array | null): string; - /** - * Generates the shader string for the given type and value. - * - * @param {string} type - The type. - * @param {?any} [value=null] - The value. - * @return {string} The generated value as a shader string. - */ - generateConst(type: string, value?: any | null): string; - /** - * It might be necessary to convert certain data types to different ones - * so this method can be used to hide the conversion. - * - * @param {string} type - The type. - * @return {string} The updated type. - */ - getType(type: string): string; - /** - * Whether the given attribute name is defined in the geometry or not. - * - * @param {string} name - The attribute name. - * @return {boolean} Whether the given attribute name is defined in the geometry. - */ - hasGeometryAttribute(name: string): boolean; - /** - * Returns a node attribute for the given name and type. - * - * @param {string} name - The attribute's name. - * @param {string} type - The attribute's type. - * @return {NodeAttribute} The node attribute. - */ - getAttribute(name: string, type: string): NodeAttribute; - /** - * Returns for the given node and shader stage the property name for the shader. - * - * @param {Node} node - The node. - * @param {('vertex'|'fragment'|'compute'|'any')} shaderStage - The shader stage. - * @return {string} The property name. - */ - getPropertyName(node: Node): string; - /** - * Whether the given type is a vector type or not. - * - * @param {string} type - The type to check. - * @return {boolean} Whether the given type is a vector type or not. - */ - isVector(type: string): boolean; - /** - * Whether the given type is a matrix type or not. - * - * @param {string} type - The type to check. - * @return {boolean} Whether the given type is a matrix type or not. - */ - isMatrix(type: string): boolean; - /** - * Whether the given type is a reference type or not. - * - * @param {string} type - The type to check. - * @return {boolean} Whether the given type is a reference type or not. - */ - isReference(type: string): boolean; - /** - * Checks if the given texture requires a manual conversion to the working color space. - * - * @abstract - * @param {Texture} texture - The texture to check. - * @return {boolean} Whether the given texture requires a conversion to working color space or not. - */ - needsToWorkingColorSpace(): boolean; - /** - * Returns the component type of a given texture. - * - * @param {Texture} texture - The texture. - * @return {string} The component type. - */ - getComponentTypeFromTexture(texture: Texture): string; - /** - * Returns the element type for a given type. - * - * @param {string} type - The type. - * @return {string} The element type. - */ - getElementType(type: string): string; - /** - * Returns the component type for a given type. - * - * @param {string} type - The type. - * @return {string} The component type. - */ - getComponentType(type: string): string; - /** - * Returns the vector type for a given type. - * - * @param {string} type - The type. - * @return {string} The vector type. - */ - getVectorType(type: string): string; - /** - * Returns the data type for the given the length and component type. - * - * @param {number} length - The length. - * @param {string} [componentType='float'] - The component type. - * @return {string} The type. - */ - getTypeFromLength(length: number, componentType?: string): string; - /** - * Returns the type for a given typed array. - * - * @param {TypedArray} array - The typed array. - * @return {string} The type. - */ - getTypeFromArray(array: TypedArray): string; - /** - * Returns the type is an integer type. - * - * @param {string} type - The type. - * @return {boolean} Whether the type is an integer type or not. - */ - isInteger(type: string): boolean; - /** - * Returns the type for a given buffer attribute. - * - * @param {BufferAttribute} attribute - The buffer attribute. - * @return {string} The type. - */ - getTypeFromAttribute(attribute: BufferAttribute): string; - /** - * Returns the length for the given data type. - * - * @param {string} type - The data type. - * @return {number} The length. - */ - getTypeLength(type: string): number; - /** - * Returns the vector type for a given matrix type. - * - * @param {string} type - The matrix type. - * @return {string} The vector type. - */ - getVectorFromMatrix(type: string): string; - /** - * For a given type this method changes the component type to the - * given value. E.g. `vec4` should be changed to the new component type - * `uint` which results in `uvec4`. - * - * @param {string} type - The type. - * @param {string} newComponentType - The new component type. - * @return {string} The new type. - */ - changeComponentType(type: string, newComponentType: string): string; - /** - * Returns the integer type pendant for the given type. - * - * @param {string} type - The type. - * @return {string} The integer type. - */ - getIntegerType(type: string): string; - /** - * Adds an active stack to the internal stack. - * - * @param {StackNode} stack - The stack node to add. - */ - setActiveStack(stack: StackNode): void; - /** - * Removes the active stack from the internal stack. - * - * @param {StackNode} stack - The stack node to remove. - */ - removeActiveStack(stack: StackNode): void; - /** - * Returns the active stack. - * - * @return {StackNode} The active stack. - */ - getActiveStack(): StackNode; - /** - * Returns the base stack. - * - * @return {StackNode} The base stack. - */ - getBaseStack(): StackNode; - /** - * Adds a stack node to the internal stack. - * - * @return {StackNode} The added stack node. - */ - addStack(): StackNode; - /** - * Removes the last stack node from the internal stack. - * - * @return {StackNode} The removed stack node. - */ - removeStack(): StackNode; - /** - * The builder maintains (cached) data for each node during the building process. This method - * can be used to get these data for a specific shader stage and cache. - * - * @param {Node} node - The node to get the data for. - * @param {('vertex'|'fragment'|'compute'|'any')} [shaderStage=this.shaderStage] - The shader stage. - * @param {?NodeCache} cache - An optional cache. - * @return {Object} The node data. - */ - getDataFromNode(node: Node, shaderStage?: ("vertex" | "fragment" | "compute" | "any"), cache?: NodeCache | null): Object; - /** - * Returns the properties for the given node and shader stage. - * - * Properties are typically used within a build stage to reference a node's - * child node or nodes manually assigned to the properties in a separate build stage. - * A typical usage pattern for defining nodes manually would be assigning dependency nodes - * to the current node's properties in the setup stage and building those properties in the generate stage. - * - * @param {Node} node - The node to get the properties for. - * @param {('vertex'|'fragment'|'compute'|'any')} [shaderStage='any'] - The shader stage. - * @return {Object} The node properties. - */ - getNodeProperties(node: Node, shaderStage?: ("vertex" | "fragment" | "compute" | "any")): Object; - /** - * Returns an instance of {@link NodeAttribute} for the given buffer attribute node. - * - * @param {BufferAttributeNode} node - The buffer attribute node. - * @param {string} type - The node type. - * @return {NodeAttribute} The node attribute. - */ - getBufferAttributeFromNode(node: BufferAttributeNode, type: string): NodeAttribute; - /** - * Returns an instance of {@link StructType} for the given struct name and shader stage - * or null if not found. - * - * @param {string} name - The name of the struct. - * @param {('vertex'|'fragment'|'compute'|'any')} [shaderStage=this.shaderStage] - The shader stage. - * @return {?StructType} The struct type or null if not found. - */ - getStructTypeNode(name: string, shaderStage?: ("vertex" | "fragment" | "compute" | "any")): StructType | null; - /** - * Returns an instance of {@link StructType} for the given output struct node. - * - * @param {OutputStructNode} node - The output struct node. - * @param {Array} membersLayout - The output struct types. - * @param {?string} [name=null] - The name of the struct. - * @param {('vertex'|'fragment'|'compute'|'any')} [shaderStage=this.shaderStage] - The shader stage. - * @return {StructType} The struct type attribute. - */ - getStructTypeFromNode(node: OutputStructNode, membersLayout: Array, name?: string | null, shaderStage?: ("vertex" | "fragment" | "compute" | "any")): StructType; - /** - * Returns an instance of {@link StructType} for the given output struct node. - * - * @param {OutputStructNode} node - The output struct node. - * @param {Array} membersLayout - The output struct types. - * @return {StructType} The struct type attribute. - */ - getOutputStructTypeFromNode(node: OutputStructNode, membersLayout: Array): StructType; - /** - * Returns an instance of {@link NodeUniform} for the given uniform node. - * - * @param {UniformNode} node - The uniform node. - * @param {string} type - The uniform type. - * @param {('vertex'|'fragment'|'compute'|'any')} [shaderStage=this.shaderStage] - The shader stage. - * @param {?string} name - The name of the uniform. - * @return {NodeUniform} The node uniform. - */ - getUniformFromNode(node: UniformNode, type: string, shaderStage?: ("vertex" | "fragment" | "compute" | "any"), name?: string | null): NodeUniform; - /** - * Returns an instance of {@link NodeVar} for the given variable node. - * - * @param {VarNode} node - The variable node. - * @param {?string} name - The variable's name. - * @param {string} [type=node.getNodeType( this )] - The variable's type. - * @param {('vertex'|'fragment'|'compute'|'any')} [shaderStage=this.shaderStage] - The shader stage. - * @param {boolean} [readOnly=false] - Whether the variable is read-only or not. - * - * @return {NodeVar} The node variable. - */ - getVarFromNode(node: VarNode, name?: string | null, type?: string, shaderStage?: ("vertex" | "fragment" | "compute" | "any"), readOnly?: boolean): NodeVar; - /** - * Returns whether a Node or its flow is deterministic, useful for use in `const`. - * - * @param {Node} node - The varying node. - * @return {boolean} Returns true if deterministic. - */ - isDeterministic(node: Node): boolean; - /** - * Returns an instance of {@link NodeVarying} for the given varying node. - * - * @param {(VaryingNode|PropertyNode)} node - The varying node. - * @param {?string} name - The varying's name. - * @param {string} [type=node.getNodeType( this )] - The varying's type. - * @param {?string} interpolationType - The interpolation type of the varying. - * @param {?string} interpolationSampling - The interpolation sampling type of the varying. - * @return {NodeVar} The node varying. - */ - getVaryingFromNode(node: (VaryingNode | PropertyNode), name?: string | null, type?: string, interpolationType?: string | null, interpolationSampling?: string | null): NodeVar; - /** - * Registers a node declaration in the current shader stage. - * - * @param {Object} node - The node to be registered. - */ - registerDeclaration(node: Object): void; - /** - * Returns an instance of {@link NodeCode} for the given code node. - * - * @param {CodeNode} node - The code node. - * @param {string} type - The node type. - * @param {('vertex'|'fragment'|'compute'|'any')} [shaderStage=this.shaderStage] - The shader stage. - * @return {NodeCode} The node code. - */ - getCodeFromNode(node: CodeNode, type: string, shaderStage?: ("vertex" | "fragment" | "compute" | "any")): NodeCode; - /** - * Adds a code flow based on the code-block hierarchy. - - * This is used so that code-blocks like If,Else create their variables locally if the Node - * is only used inside one of these conditionals in the current shader stage. - * - * @param {Node} node - The node to add. - * @param {Node} nodeBlock - Node-based code-block. Usually 'ConditionalNode'. - */ - addFlowCodeHierarchy(node: Node, nodeBlock: Node): void; - /** - * Add a inline-code to the current flow code-block. - * - * @param {Node} node - The node to add. - * @param {string} code - The code to add. - * @param {Node} nodeBlock - Current ConditionalNode - */ - addLineFlowCodeBlock(node: Node, code: string, nodeBlock: Node): void; - /** - * Add a inline-code to the current flow. - * - * @param {string} code - The code to add. - * @param {?Node} [node= null] - Optional Node, can help the system understand if the Node is part of a code-block. - * @return {NodeBuilder} A reference to this node builder. - */ - addLineFlowCode(code: string, node?: Node | null): NodeBuilder; - /** - * Adds a code to the current code flow. - * - * @param {string} code - Shader code. - * @return {NodeBuilder} A reference to this node builder. - */ - addFlowCode(code: string): NodeBuilder; - /** - * Add tab in the code that will be generated so that other snippets respect the current tabulation. - * Typically used in codes with If,Else. - * - * @return {NodeBuilder} A reference to this node builder. - */ - addFlowTab(): NodeBuilder; - /** - * Removes a tab. - * - * @return {NodeBuilder} A reference to this node builder. - */ - removeFlowTab(): NodeBuilder; - /** - * Gets the current flow data based on a Node. - * - * @param {Node} node - Node that the flow was started. - * @param {('vertex'|'fragment'|'compute'|'any')} shaderStage - The shader stage. - * @return {Object} The flow data. - */ - getFlowData(node: Node): Object; - /** - * Executes the node flow based on a root node to generate the final shader code. - * - * @param {Node} node - The node to execute. - * @return {Object} The code flow. - */ - flowNode(node: Node): Object; - /** - * Includes a node in the current function node. - * - * @param {Node} node - The node to include. - * @returns {void} - */ - addInclude(node: Node): void; - /** - * Returns the native shader operator name for a given generic name. - * It is a similar type of method like {@link NodeBuilder#getMethod}. - * - * @param {ShaderNodeInternal} shaderNode - The shader node to build the function node with. - * @return {FunctionNode} The build function node. - */ - buildFunctionNode(shaderNode: ShaderNodeInternal): FunctionNode; - /** - * Generates a code flow based on a TSL function: Fn(). - * - * @param {ShaderNodeInternal} shaderNode - A function code will be generated based on the input. - * @return {Object} - */ - flowShaderNode(shaderNode: ShaderNodeInternal): Object; - /** - * Executes the node in a specific build stage. - * - * This function can be used to arbitrarily execute the specified build stage - * outside of the standard build process. For instance, if a node's type depends - * on properties created by the 'setup' stage, then flowBuildStage(node, 'setup') - * can be used to execute the setup build stage and access its generated nodes - * before the standard build process begins. - * - * @param {Node} node - The node to execute. - * @param {string} buildStage - The build stage to execute the node in. - * @param {?(Node|string)} [output=null] - Expected output type. For example 'vec3'. - * @return {?(Node|string)} The result of the node build. - */ - flowBuildStage(node: Node, buildStage: string, output?: (Node | string) | null): (Node | string) | null; - /** - * Runs the node flow through all the steps of creation, 'setup', 'analyze', 'generate'. - * - * @param {Node} node - The node to execute. - * @param {?string} output - Expected output type. For example 'vec3'. - * @return {Object} - */ - flowStagesNode(node: Node, output?: string | null): Object; - /** - * Returns the native shader operator name for a given generic name. - * It is a similar type of method like {@link NodeBuilder#getMethod}. - * - * @abstract - * @param {string} op - The operator name to resolve. - * @return {?string} The resolved operator name. - */ - getFunctionOperator(): string | null; - /** - * Builds the given shader node. - * - * @abstract - * @param {ShaderNodeInternal} shaderNode - The shader node. - * @return {string} The function code. - */ - buildFunctionCode(): string; - /** - * Generates a code flow based on a child Node. - * - * @param {Node} node - The node to execute. - * @param {?string} output - Expected output type. For example 'vec3'. - * @return {Object} The code flow. - */ - flowChildNode(node: Node, output?: string | null): Object; - /** - * Executes a flow of code in a different stage. - * - * Some nodes like `varying()` have the ability to compute code in vertex-stage and - * return the value in fragment-stage even if it is being executed in an input fragment. - * - * @param {('vertex'|'fragment'|'compute'|'any')} shaderStage - The shader stage. - * @param {Node} node - The node to execute. - * @param {?string} output - Expected output type. For example 'vec3'. - * @param {?string} propertyName - The property name to assign the result. - * @return {?(Object|Node)} The code flow or node.build() result. - */ - flowNodeFromShaderStage(shaderStage: ("vertex" | "fragment" | "compute" | "any"), node: Node, output?: string | null, propertyName?: string | null): (Object | Node) | null; - /** - * Returns an array holding all node attributes of this node builder. - * - * @return {Array} The node attributes of this builder. - */ - getAttributesArray(): Array; - /** - * Returns the attribute definitions as a shader string for the given shader stage. - * - * @abstract - * @param {('vertex'|'fragment'|'compute'|'any')} shaderStage - The shader stage. - * @return {string} The attribute code section. - */ - getAttributes(): string; - /** - * Returns the varying definitions as a shader string for the given shader stage. - * - * @abstract - * @param {('vertex'|'fragment'|'compute'|'any')} shaderStage - The shader stage. - * @return {string} The varying code section. - */ - getVaryings(): string; - /** - * Returns a single variable definition as a shader string for the given variable type and name. - * - * @param {string} type - The variable's type. - * @param {string} name - The variable's name. - * @param {?number} [count=null] - The array length. - * @return {string} The shader string. - */ - getVar(type: string, name: string, count?: number | null): string; - /** - * Returns the variable definitions as a shader string for the given shader stage. - * - * @param {('vertex'|'fragment'|'compute'|'any')} shaderStage - The shader stage. - * @return {string} The variable code section. - */ - getVars(shaderStage: ("vertex" | "fragment" | "compute" | "any")): string; - /** - * Returns the uniform definitions as a shader string for the given shader stage. - * - * @abstract - * @param {('vertex'|'fragment'|'compute'|'any')} shaderStage - The shader stage. - * @return {string} The uniform code section. - */ - getUniforms(): string; - /** - * Returns the native code definitions as a shader string for the given shader stage. - * - * @param {('vertex'|'fragment'|'compute'|'any')} shaderStage - The shader stage. - * @return {string} The native code section. - */ - getCodes(shaderStage: ("vertex" | "fragment" | "compute" | "any")): string; - /** - * Returns the hash of this node builder. - * - * @return {string} The hash. - */ - getHash(): string; - /** - * Sets the current shader stage. - * - * @param {?('vertex'|'fragment'|'compute'|'any')} shaderStage - The shader stage to set. - */ - setShaderStage(shaderStage: ("vertex" | "fragment" | "compute" | "any") | null): void; - /** - * Returns the current shader stage. - * - * @return {?('vertex'|'fragment'|'compute'|'any')} The current shader stage. - */ - getShaderStage(): ("vertex" | "fragment" | "compute" | "any") | null; - /** - * Sets the current build stage. - * - * @param {?('setup'|'analyze'|'generate')} buildStage - The build stage to set. - */ - setBuildStage(buildStage: ("setup" | "analyze" | "generate") | null): void; - /** - * Returns the current build stage. - * - * @return {?('setup'|'analyze'|'generate')} The current build stage. - */ - getBuildStage(): ("setup" | "analyze" | "generate") | null; - /** - * Controls the code build of the shader stages. - * - * @abstract - */ - buildCode(): void; - /** - * Returns the current sub-build layer. - * - * @return {SubBuildNode} The current sub-build layers. - */ - get subBuild(): SubBuildNode; - /** - * Adds a sub-build layer to the node builder. - * - * @param {SubBuildNode} subBuild - The sub-build layer to add. - */ - addSubBuild(subBuild: SubBuildNode): void; - /** - * Removes the last sub-build layer from the node builder. - * - * @return {SubBuildNode} The removed sub-build layer. - */ - removeSubBuild(): SubBuildNode; - /** - * Returns the closest sub-build layer for the given data. - * - * @param {Node|Set|Array} data - The data to get the closest sub-build layer from. - * @return {?string} The closest sub-build name or null if none found. - */ - getClosestSubBuild(data: Node | Set | Array): string | null; - /** - * Returns the output node of a sub-build layer. - * - * @param {Node} node - The node to get the output from. - * @return {string} The output node name. - */ - getSubBuildOutput(node: Node): string; - /** - * Returns the sub-build property name for the given property and node. - * - * @param {string} [property=''] - The property name. - * @param {?Node} [node=null] - The node to get the sub-build from. - * @return {string} The sub-build property name. - */ - getSubBuildProperty(property?: string, node?: Node | null): string; - /** - * Central build method which controls the build for the given object. - * - * @return {NodeBuilder} A reference to this node builder. - */ - build(): NodeBuilder; - /** - * Async version of build() that yields to main thread between shader stages. - * Use this in compileAsync() to prevent blocking the main thread. - * - * @return {Promise} A promise that resolves to this node builder. - */ - buildAsync(): Promise; - /** - * Returns shared data object for the given node. - * - * @param {Node} node - The node to get shared data from. - * @return {Object} The shared data. - */ - getSharedDataFromNode(node: Node): Object; - /** - * Returns a uniform representation which is later used for UBO generation and rendering. - * - * @param {NodeUniform} uniformNode - The uniform node. - * @param {string} type - The requested type. - * @return {Uniform} The uniform. - */ - getNodeUniform(uniformNode: NodeUniform, type: string): Uniform; - /** - * Formats the given shader snippet from a given type into another one. E.g. - * this method might be used to convert a simple float string `"1.0"` into a - * `vec3` representation: `"vec3( 1.0 )"`. - * - * @param {string} snippet - The shader snippet. - * @param {string} fromType - The source type. - * @param {string} toType - The target type. - * @return {string} The updated shader string. - */ - format(snippet: string, fromType: string, toType: string): string; - /** - * Returns a signature with the engine's current revision. - * - * @return {string} The signature. - */ - getSignature(): string; - /** - * Returns `true` if data from the previous frame are required. Relevant - * when computing motion vectors with {@link VelocityNode}. - * - * @return {boolean} Whether data from the previous frame are required or not. - */ - needsPreviousData(): boolean; -} -import BindGroup from '../../renderers/common/BindGroup.js'; -import NodeAttribute from './NodeAttribute.js'; -import NodeVarying from './NodeVarying.js'; -import NodeCode from './NodeCode.js'; -import NodeVar from './NodeVar.js'; -import FunctionNode from '../code/FunctionNode.js'; -import NodeCache from './NodeCache.js'; -import { RenderTarget } from '../../core/RenderTarget.js'; -import CubeRenderTarget from '../../renderers/common/CubeRenderTarget.js'; -import StructType from './StructType.js'; -import NodeUniform from './NodeUniform.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/NodeCache.d.ts b/jsdoc-testing/jsdoc/nodes/core/NodeCache.d.ts deleted file mode 100644 index 0c192004d..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/NodeCache.d.ts +++ /dev/null @@ -1,47 +0,0 @@ -export default NodeCache; -/** - * This utility class is used in {@link NodeBuilder} as an internal - * cache data structure for node data. - */ -declare class NodeCache { - /** - * Constructs a new node cache. - * - * @param {?NodeCache} parent - A reference to a parent cache. - */ - constructor(parent?: NodeCache | null); - /** - * The id of the cache. - * - * @type {number} - * @readonly - */ - readonly id: number; - /** - * A weak map for managing node data. - * - * @type {WeakMap} - */ - nodesData: WeakMap; - /** - * Reference to a parent node cache. - * - * @type {?NodeCache} - * @default null - */ - parent: NodeCache | null; - /** - * Returns the data for the given node. - * - * @param {Node} node - The node. - * @return {?Object} The data for the node. - */ - getData(node: Node): Object | null; - /** - * Sets the data for a given node. - * - * @param {Node} node - The node. - * @param {Object} data - The data that should be cached. - */ - setData(node: Node, data: Object): void; -} diff --git a/jsdoc-testing/jsdoc/nodes/core/NodeCode.d.ts b/jsdoc-testing/jsdoc/nodes/core/NodeCode.d.ts deleted file mode 100644 index f96665f26..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/NodeCode.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -export default NodeCode; -/** - * {@link NodeBuilder} is going to create instances of this class during the build process - * of nodes. They represent user-defined, native shader code portions that are going to be - * injected by the builder. A dictionary of node codes is maintained in {@link NodeBuilder#codes} - * for this purpose. - */ -declare class NodeCode { - /** - * Constructs a new code node. - * - * @param {string} name - The name of the code. - * @param {string} type - The node type. - * @param {string} [code=''] - The native shader code. - */ - constructor(name: string, type: string, code?: string); - /** - * The name of the code. - * - * @type {string} - */ - name: string; - /** - * The node type. - * - * @type {string} - */ - type: string; - /** - * The native shader code. - * - * @type {string} - * @default '' - */ - code: string; -} diff --git a/jsdoc-testing/jsdoc/nodes/core/NodeError.d.ts b/jsdoc-testing/jsdoc/nodes/core/NodeError.d.ts deleted file mode 100644 index 71d14d55f..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/NodeError.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -export default NodeError; -/** - * Custom error class for node-related errors, including stack trace information. - */ -declare class NodeError extends Error { - constructor(message: any, stackTrace?: null); - /** - * The stack trace associated with the error. - * - * @type {?StackTrace} - */ - stackTrace: StackTrace | null; -} diff --git a/jsdoc-testing/jsdoc/nodes/core/NodeFrame.d.ts b/jsdoc-testing/jsdoc/nodes/core/NodeFrame.d.ts deleted file mode 100644 index afaee4fe4..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/NodeFrame.d.ts +++ /dev/null @@ -1,133 +0,0 @@ -export default NodeFrame; -/** - * Management class for updating nodes. The module tracks metrics like - * the elapsed time, delta time, the render and frame ID to correctly - * call the node update methods {@link Node#updateBefore}, {@link Node#update} - * and {@link Node#updateAfter} depending on the node's configuration. - */ -declare class NodeFrame { - /** - * The elapsed time in seconds. - * - * @type {number} - * @default 0 - */ - time: number; - /** - * The delta time in seconds. - * - * @type {number} - * @default 0 - */ - deltaTime: number; - /** - * The frame ID. - * - * @type {number} - * @default 0 - */ - frameId: number; - /** - * The render ID. - * - * @type {number} - * @default 0 - */ - renderId: number; - /** - * Used to control the {@link Node#update} call. - * - * @type {WeakMap} - */ - updateMap: WeakMap; - /** - * Used to control the {@link Node#updateBefore} call. - * - * @type {WeakMap} - */ - updateBeforeMap: WeakMap; - /** - * Used to control the {@link Node#updateAfter} call. - * - * @type {WeakMap} - */ - updateAfterMap: WeakMap; - /** - * A reference to the current renderer. - * - * @type {?Renderer} - * @default null - */ - renderer: Renderer | null; - /** - * A reference to the current material. - * - * @type {?Material} - * @default null - */ - material: Material | null; - /** - * A reference to the current camera. - * - * @type {?Camera} - * @default null - */ - camera: Camera | null; - /** - * A reference to the current 3D object. - * - * @type {?Object3D} - * @default null - */ - object: Object3D | null; - /** - * A reference to the current scene. - * - * @type {?Scene} - * @default null - */ - scene: Scene | null; - /** - * Returns a dictionary for a given node and update map which - * is used to correctly call node update methods per frame or render. - * - * @private - * @param {WeakMap} referenceMap - The reference weak map. - * @param {Node} nodeRef - The reference to the current node. - * @return {Object>} The dictionary. - */ - private _getMaps; - /** - * This method executes the {@link Node#updateBefore} for the given node. - * It makes sure {@link Node#updateBeforeType} is honored meaning the update - * is only executed once per frame, render or object depending on the update - * type. - * - * @param {Node} node - The node that should be updated. - */ - updateBeforeNode(node: Node): void; - /** - * This method executes the {@link Node#updateAfter} for the given node. - * It makes sure {@link Node#updateAfterType} is honored meaning the update - * is only executed once per frame, render or object depending on the update - * type. - * - * @param {Node} node - The node that should be updated. - */ - updateAfterNode(node: Node): void; - /** - * This method executes the {@link Node#update} for the given node. - * It makes sure {@link Node#updateType} is honored meaning the update - * is only executed once per frame, render or object depending on the update - * type. - * - * @param {Node} node - The node that should be updated. - */ - updateNode(node: Node): void; - /** - * Updates the internal state of the node frame. This method is - * called by the renderer in its internal animation loop. - */ - update(): void; - lastTime: number | undefined; -} diff --git a/jsdoc-testing/jsdoc/nodes/core/NodeFunction.d.ts b/jsdoc-testing/jsdoc/nodes/core/NodeFunction.d.ts deleted file mode 100644 index ef2cdbc0a..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/NodeFunction.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -export default NodeFunction; -/** - * Base class for node functions. A derived module must be implemented - * for each supported native shader language. Similar to other `Node*` modules, - * this class is only relevant during the building process and not used - * in user-level code. - */ -declare class NodeFunction { - /** - * Constructs a new node function. - * - * @param {string} type - The node type. This type is the return type of the node function. - * @param {Array} inputs - The function's inputs. - * @param {string} [name=''] - The function's name. - * @param {string} [precision=''] - The precision qualifier. - */ - constructor(type: string, inputs: Array, name?: string, precision?: string); - /** - * The node type. This type is the return type of the node function. - * - * @type {string} - */ - type: string; - /** - * The function's inputs. - * - * @type {Array} - */ - inputs: Array; - /** - * The name of the uniform. - * - * @type {string} - * @default '' - */ - name: string; - /** - * The precision qualifier. - * - * @type {string} - * @default '' - */ - precision: string; - /** - * This method returns the native code of the node function. - * - * @abstract - * @param {string} name - The function's name. - * @return {string} A shader code. - */ - getCode(): string; -} -declare namespace NodeFunction { - let isNodeFunction: boolean; -} diff --git a/jsdoc-testing/jsdoc/nodes/core/NodeFunctionInput.d.ts b/jsdoc-testing/jsdoc/nodes/core/NodeFunctionInput.d.ts deleted file mode 100644 index 3df5a1b75..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/NodeFunctionInput.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -export default NodeFunctionInput; -/** - * Describes the input of a {@link NodeFunction}. - */ -declare class NodeFunctionInput { - /** - * Constructs a new node function input. - * - * @param {string} type - The input type. - * @param {string} name - The input name. - * @param {?number} [count=null] - If the input is an Array, count will be the length. - * @param {('in'|'out'|'inout')} [qualifier=''] - The parameter qualifier (only relevant for GLSL). - * @param {boolean} [isConst=false] - Whether the input uses a const qualifier or not (only relevant for GLSL). - */ - constructor(type: string, name: string, count?: number | null, qualifier?: ("in" | "out" | "inout"), isConst?: boolean); - /** - * The input type. - * - * @type {string} - */ - type: string; - /** - * The input name. - * - * @type {string} - */ - name: string; - /** - * If the input is an Array, count will be the length. - * - * @type {?number} - * @default null - */ - count: number | null; - /** - *The parameter qualifier (only relevant for GLSL). - * - * @type {('in'|'out'|'inout')} - * @default '' - */ - qualifier: ("in" | "out" | "inout"); - /** - * Whether the input uses a const qualifier or not (only relevant for GLSL). - * - * @type {boolean} - * @default false - */ - isConst: boolean; -} -declare namespace NodeFunctionInput { - let isNodeFunctionInput: boolean; -} diff --git a/jsdoc-testing/jsdoc/nodes/core/NodeParser.d.ts b/jsdoc-testing/jsdoc/nodes/core/NodeParser.d.ts deleted file mode 100644 index f15875899..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/NodeParser.d.ts +++ /dev/null @@ -1,15 +0,0 @@ -export default NodeParser; -/** - * Base class for node parsers. A derived parser must be implemented - * for each supported native shader language. - */ -declare class NodeParser { - /** - * The method parses the given native code an returns a node function. - * - * @abstract - * @param {string} source - The native shader code. - * @return {NodeFunction} A node function. - */ - parseFunction(): NodeFunction; -} diff --git a/jsdoc-testing/jsdoc/nodes/core/NodeUniform.d.ts b/jsdoc-testing/jsdoc/nodes/core/NodeUniform.d.ts deleted file mode 100644 index 3f872f033..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/NodeUniform.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -export default NodeUniform; -/** - * {@link NodeBuilder} is going to create instances of this class during the build process - * of nodes. They represent the final shader uniforms that are going to be generated - * by the builder. A dictionary of node uniforms is maintained in {@link NodeBuilder#uniforms} - * for this purpose. - */ -declare class NodeUniform { - /** - * Constructs a new node uniform. - * - * @param {string} name - The name of the uniform. - * @param {string} type - The type of the uniform. - * @param {UniformNode} node - An reference to the node. - */ - constructor(name: string, type: string, node: UniformNode); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isNodeUniform: boolean; - /** - * The name of the uniform. - * - * @type {string} - */ - name: string; - /** - * The type of the uniform. - * - * @type {string} - */ - type: string; - /** - * An reference to the node. - * - * @type {UniformNode} - */ - node: UniformNode; - set value(val: any); - /** - * The value of the uniform node. - * - * @type {any} - */ - get value(): any; - /** - * The id of the uniform node. - * - * @type {number} - */ - get id(): number; - /** - * The uniform node's group. - * - * @type {UniformGroupNode} - */ - get groupNode(): UniformGroupNode; -} diff --git a/jsdoc-testing/jsdoc/nodes/core/NodeUtils.d.ts b/jsdoc-testing/jsdoc/nodes/core/NodeUtils.d.ts deleted file mode 100644 index 08c841662..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/NodeUtils.d.ts +++ /dev/null @@ -1,93 +0,0 @@ -/** - * Returns the data type for the given the length. - * - * @private - * @method - * @param {number} length - The length. - * @return {string} The data type. - */ -export function getTypeFromLength(length: number): string; -/** - * Returns the typed array for the given data type. - * - * @private - * @method - * @param {string} type - The data type. - * @return {TypedArray} The typed array. - */ -export function getTypedArrayFromType(type: string): TypedArray; -/** - * Returns the length for the given data type. - * - * @private - * @method - * @param {string} type - The data type. - * @return {number} The length. - */ -export function getLengthFromType(type: string): number; -/** - * Returns the gpu memory length for the given data type. - * - * @private - * @method - * @param {string} type - The data type. - * @return {number} The length. - */ -export function getMemoryLengthFromType(type: string): number; -/** - * Returns the alignment requirement for the given data type. - * - * @private - * @method - * @param {string} type - The data type. - * @return {number} The alignment requirement in bytes. - */ -export function getAlignmentFromType(type: string): number; -/** - * Returns the data type for the given value. - * - * @private - * @method - * @param {any} value - The value. - * @return {?string} The data type. - */ -export function getValueType(value: any): string | null; -/** - * Returns the value/object for the given data type and parameters. - * - * @private - * @method - * @param {string} type - The given type. - * @param {...any} params - A parameter list. - * @return {any} The value/object. - */ -export function getValueFromType(type: string, ...params: any[]): any; -/** - * Gets the object data that can be shared between different rendering steps. - * - * @private - * @param {Object} object - The object to get the data for. - * @return {Object} The object data. - */ -export function getDataFromObject(object: Object): Object; -/** - * Converts the given array buffer to a Base64 string. - * - * @private - * @method - * @param {ArrayBuffer} arrayBuffer - The array buffer. - * @return {string} The Base64 string. - */ -export function arrayBufferToBase64(arrayBuffer: ArrayBuffer): string; -/** - * Converts the given Base64 string to an array buffer. - * - * @private - * @method - * @param {string} base64 - The Base64 string. - * @return {ArrayBuffer} The array buffer. - */ -export function base64ToArrayBuffer(base64: string): ArrayBuffer; -export function hashString(str: string): number; -export function hashArray(array: Array): number; -export function hash(...params: number[]): number; diff --git a/jsdoc-testing/jsdoc/nodes/core/NodeVar.d.ts b/jsdoc-testing/jsdoc/nodes/core/NodeVar.d.ts deleted file mode 100644 index 43e82262f..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/NodeVar.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -export default NodeVar; -/** - * {@link NodeBuilder} is going to create instances of this class during the build process - * of nodes. They represent the final shader variables that are going to be generated - * by the builder. A dictionary of node variables is maintained in {@link NodeBuilder#vars} for - * this purpose. - */ -declare class NodeVar { - /** - * Constructs a new node variable. - * - * @param {string} name - The name of the variable. - * @param {string} type - The type of the variable. - * @param {boolean} [readOnly=false] - The read-only flag. - * @param {?number} [count=null] - The size. - */ - constructor(name: string, type: string, readOnly?: boolean, count?: number | null); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isNodeVar: boolean; - /** - * The name of the variable. - * - * @type {string} - */ - name: string; - /** - * The type of the variable. - * - * @type {string} - */ - type: string; - /** - * The read-only flag. - * - * @type {boolean} - */ - readOnly: boolean; - /** - * The size. - * - * @type {?number} - */ - count: number | null; -} diff --git a/jsdoc-testing/jsdoc/nodes/core/NodeVarying.d.ts b/jsdoc-testing/jsdoc/nodes/core/NodeVarying.d.ts deleted file mode 100644 index 587fb0896..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/NodeVarying.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export default NodeVarying; -/** - * {@link NodeBuilder} is going to create instances of this class during the build process - * of nodes. They represent the final shader varyings that are going to be generated - * by the builder. An array of node varyings is maintained in {@link NodeBuilder#varyings} for - * this purpose. - * - * @augments NodeVar - */ -declare class NodeVarying extends NodeVar { - /** - * Constructs a new node varying. - * - * @param {string} name - The name of the varying. - * @param {string} type - The type of the varying. - * @param {?string} interpolationType - The interpolation type of the varying. - * @param {?string} interpolationSampling - The interpolation sampling type of the varying. - */ - constructor(name: string, type: string, interpolationType?: string | null, interpolationSampling?: string | null); - /** - * Whether this varying requires interpolation or not. This property can be used - * to check if the varying can be optimized for a variable. - * - * @type {boolean} - * @default false - */ - needsInterpolation: boolean; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isNodeVarying: boolean; - /** - * The interpolation type of the varying data. - * - * @type {?string} - * @default null - */ - interpolationType: string | null; - /** - * The interpolation sampling type of varying data. - * - * @type {?string} - * @default null - */ - interpolationSampling: string | null; -} -import NodeVar from './NodeVar.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/OutputStructNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/OutputStructNode.d.ts deleted file mode 100644 index ea5448089..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/OutputStructNode.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -export default OutputStructNode; -/** - * TSL function for creating an output struct node. - * - * @tsl - * @function - * @param {...Node} members - A parameter list of nodes. - * @returns {OutputStructNode} - */ -export const outputStruct: any; -/** - * This node can be used to define multiple outputs in a shader programs. - * - * @augments Node - */ -declare class OutputStructNode extends Node { - /** - * Constructs a new output struct node. The constructor can be invoked with an - * arbitrary number of nodes representing the members. - * - * @param {...Node} members - A parameter list of nodes. - */ - constructor(...members: Node[]); - /** - * An array of nodes which defines the output. - * - * @type {Array} - */ - members: Array; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isOutputStructNode: boolean; - generateNodeType(): string; - generate(builder: any): any; -} -import Node from './Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/ParameterNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/ParameterNode.d.ts deleted file mode 100644 index 6ab531096..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/ParameterNode.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -export default ParameterNode; -export function parameter(type: string, name: string | null): ParameterNode; -/** - * Special version of {@link PropertyNode} which is used for parameters. - * - * @augments PropertyNode - */ -declare class ParameterNode extends PropertyNode { - /** - * Constructs a new parameter node. - * - * @param {string} nodeType - The type of the node. - * @param {?string} [name=null] - The name of the parameter in the shader. - */ - constructor(nodeType: string, name?: string | null); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isParameterNode: boolean; - /** - * Gets the type of a member variable in the parameter node. - * - * @param {NodeBuilder} builder - The node builder. - * @param {string} name - The name of the member variable. - * @returns {string} - */ - getMemberType(builder: NodeBuilder, name: string): string; - getHash(): string; - generate(): string; -} -import PropertyNode from './PropertyNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/PropertyNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/PropertyNode.d.ts deleted file mode 100644 index ec863359d..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/PropertyNode.d.ts +++ /dev/null @@ -1,253 +0,0 @@ -export default PropertyNode; -export function property(type: string, name?: string | null): PropertyNode; -export function varyingProperty(type: string, name?: string | null): PropertyNode; -/** - * TSL object that represents the shader variable `DiffuseColor`. - * - * @tsl - * @type {PropertyNode} - */ -export const diffuseColor: PropertyNode; -/** - * TSL object that represents the shader variable `DiffuseContribution`. - * - * @tsl - * @type {PropertyNode} - */ -export const diffuseContribution: PropertyNode; -/** - * TSL object that represents the shader variable `EmissiveColor`. - * - * @tsl - * @type {PropertyNode} - */ -export const emissive: PropertyNode; -/** - * TSL object that represents the shader variable `Roughness`. - * - * @tsl - * @type {PropertyNode} - */ -export const roughness: PropertyNode; -/** - * TSL object that represents the shader variable `Metalness`. - * - * @tsl - * @type {PropertyNode} - */ -export const metalness: PropertyNode; -/** - * TSL object that represents the shader variable `Clearcoat`. - * - * @tsl - * @type {PropertyNode} - */ -export const clearcoat: PropertyNode; -/** - * TSL object that represents the shader variable `ClearcoatRoughness`. - * - * @tsl - * @type {PropertyNode} - */ -export const clearcoatRoughness: PropertyNode; -/** - * TSL object that represents the shader variable `Sheen`. - * - * @tsl - * @type {PropertyNode} - */ -export const sheen: PropertyNode; -/** - * TSL object that represents the shader variable `SheenRoughness`. - * - * @tsl - * @type {PropertyNode} - */ -export const sheenRoughness: PropertyNode; -/** - * TSL object that represents the shader variable `Iridescence`. - * - * @tsl - * @type {PropertyNode} - */ -export const iridescence: PropertyNode; -/** - * TSL object that represents the shader variable `IridescenceIOR`. - * - * @tsl - * @type {PropertyNode} - */ -export const iridescenceIOR: PropertyNode; -/** - * TSL object that represents the shader variable `IridescenceThickness`. - * - * @tsl - * @type {PropertyNode} - */ -export const iridescenceThickness: PropertyNode; -/** - * TSL object that represents the shader variable `AlphaT`. - * - * @tsl - * @type {PropertyNode} - */ -export const alphaT: PropertyNode; -/** - * TSL object that represents the shader variable `Anisotropy`. - * - * @tsl - * @type {PropertyNode} - */ -export const anisotropy: PropertyNode; -/** - * TSL object that represents the shader variable `AnisotropyT`. - * - * @tsl - * @type {PropertyNode} - */ -export const anisotropyT: PropertyNode; -/** - * TSL object that represents the shader variable `AnisotropyB`. - * - * @tsl - * @type {PropertyNode} - */ -export const anisotropyB: PropertyNode; -/** - * TSL object that represents the shader variable `SpecularColor`. - * - * @tsl - * @type {PropertyNode} - */ -export const specularColor: PropertyNode; -/** - * TSL object that represents the shader variable `SpecularColorBlended`. - * - * @tsl - * @type {PropertyNode} - */ -export const specularColorBlended: PropertyNode; -/** - * TSL object that represents the shader variable `SpecularF90`. - * - * @tsl - * @type {PropertyNode} - */ -export const specularF90: PropertyNode; -/** - * TSL object that represents the shader variable `Shininess`. - * - * @tsl - * @type {PropertyNode} - */ -export const shininess: PropertyNode; -/** - * TSL object that represents the shader variable `Output`. - * - * @tsl - * @type {PropertyNode} - */ -export const output: PropertyNode; -/** - * TSL object that represents the shader variable `dashSize`. - * - * @tsl - * @type {PropertyNode} - */ -export const dashSize: PropertyNode; -/** - * TSL object that represents the shader variable `gapSize`. - * - * @tsl - * @type {PropertyNode} - */ -export const gapSize: PropertyNode; -/** - * TSL object that represents the shader variable `pointWidth`. - * - * @tsl - * @type {PropertyNode} - */ -export const pointWidth: PropertyNode; -/** - * TSL object that represents the shader variable `IOR`. - * - * @tsl - * @type {PropertyNode} - */ -export const ior: PropertyNode; -/** - * TSL object that represents the shader variable `Transmission`. - * - * @tsl - * @type {PropertyNode} - */ -export const transmission: PropertyNode; -/** - * TSL object that represents the shader variable `Thickness`. - * - * @tsl - * @type {PropertyNode} - */ -export const thickness: PropertyNode; -/** - * TSL object that represents the shader variable `AttenuationDistance`. - * - * @tsl - * @type {PropertyNode} - */ -export const attenuationDistance: PropertyNode; -/** - * TSL object that represents the shader variable `AttenuationColor`. - * - * @tsl - * @type {PropertyNode} - */ -export const attenuationColor: PropertyNode; -/** - * TSL object that represents the shader variable `Dispersion`. - * - * @tsl - * @type {PropertyNode} - */ -export const dispersion: PropertyNode; -/** - * This class represents a shader property. It can be used - * to explicitly define a property and assign a value to it. - * - * ```js - * const threshold = property( 'float', 'threshold' ).assign( THRESHOLD ); - *``` - * `PropertyNode` is used by the engine to predefined common material properties - * for TSL code. - * - * @augments Node - */ -declare class PropertyNode extends Node { - /** - * Constructs a new property node. - * - * @param {string} nodeType - The type of the node. - * @param {?string} [name=null] - The name of the property in the shader. - * @param {boolean} [varying=false] - Whether this property is a varying or not. - */ - constructor(nodeType: string, name?: string | null, varying?: boolean); - /** - * Whether this property is a varying or not. - * - * @type {boolean} - * @default false - */ - varying: boolean; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isPropertyNode: boolean; - getHash(builder: any): string; - generate(builder: any): any; -} -import Node from './Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/StackNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/StackNode.d.ts deleted file mode 100644 index d3e391573..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/StackNode.d.ts +++ /dev/null @@ -1,145 +0,0 @@ -export default StackNode; -/** - * TSL function for creating a stack node. - * - * @tsl - * @function - * @param {?StackNode} [parent=null] - The parent stack node. - * @returns {StackNode} - */ -export const stack: any; -/** - * Stack is a helper for Nodes that need to produce stack-based code instead of continuous flow. - * They are usually needed in cases like `If`, `Else`. - * - * @augments Node - */ -declare class StackNode extends Node { - /** - * Constructs a new stack node. - * - * @param {?StackNode} [parent=null] - The parent stack node. - */ - constructor(parent?: StackNode | null); - /** - * List of nodes. - * - * @type {Array} - */ - nodes: Array; - /** - * The output node. - * - * @type {?Node} - * @default null - */ - outputNode: Node | null; - /** - * The parent stack node. - * - * @type {?StackNode} - * @default null - */ - parent: StackNode | null; - /** - * The current conditional node. - * - * @private - * @type {ConditionalNode} - * @default null - */ - private _currentCond; - /** - * The expression node. Only - * relevant for Switch/Case. - * - * @private - * @type {Node} - * @default null - */ - private _expressionNode; - /** - * The current node being processed. - * - * @private - * @type {Node} - * @default null - */ - private _currentNode; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isStackNode: boolean; - getElementType(builder: any): string; - generateNodeType(builder: any): string; - getMemberType(builder: any, name: any): string; - /** - * Adds a node to this stack. - * - * @param {Node} node - The node to add. - * @param {number} [index=this.nodes.length] - The index where the node should be added. - * @return {StackNode} A reference to this stack node. - */ - addToStack(node: Node, index?: number): StackNode; - /** - * Adds a node to the stack before the current node. - * - * @param {Node} node - The node to add. - * @return {StackNode} A reference to this stack node. - */ - addToStackBefore(node: Node): StackNode; - /** - * Represent an `if` statement in TSL. - * - * @param {Node} boolNode - Represents the condition. - * @param {Function} method - TSL code which is executed if the condition evaluates to `true`. - * @return {StackNode} A reference to this stack node. - */ - If(boolNode: Node, method: Function): StackNode; - /** - * Represent an `elseif` statement in TSL. - * - * @param {Node} boolNode - Represents the condition. - * @param {Function} method - TSL code which is executed if the condition evaluates to `true`. - * @return {StackNode} A reference to this stack node. - */ - ElseIf(boolNode: Node, method: Function): StackNode; - /** - * Represent an `else` statement in TSL. - * - * @param {Function} method - TSL code which is executed in the `else` case. - * @return {StackNode} A reference to this stack node. - */ - Else(method: Function): StackNode; - /** - * Represents a `switch` statement in TSL. - * - * @param {any} expression - Represents the expression. - * @param {Function} method - TSL code which is executed if the condition evaluates to `true`. - * @return {StackNode} A reference to this stack node. - */ - Switch(expression: any): StackNode; - /** - * Represents a `case` statement in TSL. The TSL version accepts an arbitrary numbers of values. - * The last parameter must be the callback method that should be executed in the `true` case. - * - * @param {...any} params - The values of the `Case()` statement as well as the callback method. - * @return {StackNode} A reference to this stack node. - */ - Case(...params: any[]): StackNode; - /** - * Represents the default code block of a Switch/Case statement. - * - * @param {Function} method - TSL code which is executed in the `else` case. - * @return {StackNode} A reference to this stack node. - */ - Default(method: Function): StackNode; - setup(builder: any): any; - hasOutput(builder: any): boolean | null; - build(builder: any, ...params: any[]): string | Node | null; -} -import Node from './Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/StackTrace.d.ts b/jsdoc-testing/jsdoc/nodes/core/StackTrace.d.ts deleted file mode 100644 index d870b1d2f..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/StackTrace.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -export default StackTrace; -/** - * Class representing a stack trace for debugging purposes. - */ -declare class StackTrace { - /** - * Creates a StackTrace instance by capturing and filtering the current stack trace. - * - * @param {Error|string|null} stackMessage - An optional stack trace to use instead of capturing a new one. - */ - constructor(stackMessage?: Error | string | null); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isStackTrace: boolean; - /** - * The stack trace. - * - * @type {Array<{fn: string, file: string, line: number, column: number}>} - */ - stack: Array<{ - fn: string; - file: string; - line: number; - column: number; - }>; - /** - * Returns a formatted location string of the top stack frame. - * - * @returns {string} The formatted stack trace message. - */ - getLocation(): string; - /** - * Returns the full error message including the stack trace. - * - * @param {string} message - The error message. - * @returns {string} The full error message with stack trace. - */ - getError(message: string): string; -} diff --git a/jsdoc-testing/jsdoc/nodes/core/StructNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/StructNode.d.ts deleted file mode 100644 index 0b9c6e2d8..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/StructNode.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -export default StructNode; -export function struct(membersLayout: Object, name?: string | null): Function; -/** - * StructNode allows to create custom structures with multiple members. - * This can also be used to define structures in attribute and uniform data. - * - * ```js - * // Define a custom struct - * const BoundingBox = struct( { min: 'vec3', max: 'vec3' } ); - * - * // Create a new instance of the struct - * const bb = BoundingBox( vec3( 0 ), vec3( 1 ) ); // style 1 - * const bb = BoundingBox( { min: vec3( 0 ), max: vec3( 1 ) } ); // style 2 - * - * // Access the struct members - * const min = bb.get( 'min' ); - * - * // Assign a new value to a member - * min.assign( vec3() ); - * ``` - * @augments Node - */ -declare class StructNode extends Node { - constructor(structTypeNode: any, values: any); - structTypeNode: any; - values: any; - isStructNode: boolean; - generateNodeType(builder: any): any; - getMemberType(builder: any, name: any): any; - _getChildren(): Object[]; - generate(builder: any): any; -} -import Node from './Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/StructType.d.ts b/jsdoc-testing/jsdoc/nodes/core/StructType.d.ts deleted file mode 100644 index af08042f6..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/StructType.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export default StructType; -declare class StructType { - constructor(name: any, members: any); - name: any; - members: any; - output: boolean; -} diff --git a/jsdoc-testing/jsdoc/nodes/core/StructTypeNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/StructTypeNode.d.ts deleted file mode 100644 index 5e54e0387..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/StructTypeNode.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -export default StructTypeNode; -/** - * Represents a struct type node in the node-based system. - * This class is used to define and manage the layout and types of struct members. - * It extends the base Node class and provides methods to get the length of the struct, - * retrieve member types, and generate the struct type for a builder. - * - * @augments Node - */ -declare class StructTypeNode extends Node { - /** - * Creates an instance of StructTypeNode. - * - * @param {Object} membersLayout - The layout of the members for the struct. - * @param {?string} [name=null] - The optional name of the struct. - */ - constructor(membersLayout: Object, name?: string | null); - /** - * The layout of the members for the struct - * - * @type {Array.<{name: string, type: string, atomic: boolean}>} - */ - membersLayout: Array<{ - name: string; - type: string; - atomic: boolean; - }>; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isStructLayoutNode: boolean; - /** - * Returns the length of the struct. - * The length is calculated by summing the lengths of the struct's members. - * - * @returns {number} The length of the struct. - */ - getLength(): number; - getMemberType(builder: any, name: any): string; - generateNodeType(builder: any): any; - setup(builder: any): void; - generate(builder: any): string; -} -import Node from './Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/SubBuildNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/SubBuildNode.d.ts deleted file mode 100644 index a5227f1b6..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/SubBuildNode.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -export default SubBuildNode; -export function subBuild(node: Node, name: string, type?: string | null): Node; -/** - * This node is used to build a sub-build in the node system. - * - * @augments Node - * @param {Node} node - The node to be built in the sub-build. - * @param {string} name - The name of the sub-build. - * @param {?string} [nodeType=null] - The type of the node, if known. - */ -declare class SubBuildNode extends Node { - constructor(node: any, name: any, nodeType?: null); - /** - * The node to be built in the sub-build. - * - * @type {Node} - */ - node: Node; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isSubBuildNode: boolean; - generateNodeType(builder: any): string; - build(builder: any, ...params: any[]): string | Node | null; -} -import Node from './Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/TempNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/TempNode.d.ts deleted file mode 100644 index ed3119f09..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/TempNode.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -export default TempNode; -/** - * This module uses cache management to create temporary variables - * if the node is used more than once to prevent duplicate calculations. - * - * The class acts as a base class for many other nodes types. - * - * @augments Node - */ -declare class TempNode extends Node { - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isTempNode: boolean; - /** - * Whether this node is used more than once in context of other nodes. - * - * @param {NodeBuilder} builder - The node builder. - * @return {boolean} A flag that indicates if there is more than one dependency to other nodes. - */ - hasDependencies(builder: NodeBuilder): boolean; - build(builder: any, output: any): any; -} -import Node from './Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/UniformGroupNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/UniformGroupNode.d.ts deleted file mode 100644 index f61fdbe5b..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/UniformGroupNode.d.ts +++ /dev/null @@ -1,77 +0,0 @@ -export default UniformGroupNode; -export function uniformGroup(name: string, order?: number, updateType?: null): UniformGroupNode; -export function sharedUniformGroup(name: string, order?: number, updateType?: null): UniformGroupNode; -/** - * TSL object that represents a shared uniform group node which is updated once per frame. - * - * @tsl - * @type {UniformGroupNode} - */ -export const frameGroup: UniformGroupNode; -/** - * TSL object that represents a shared uniform group node which is updated once per render. - * - * @tsl - * @type {UniformGroupNode} - */ -export const renderGroup: UniformGroupNode; -/** - * TSL object that represents a uniform group node which is updated once per object. - * - * @tsl - * @type {UniformGroupNode} - */ -export const objectGroup: UniformGroupNode; -/** - * This node can be used to group single instances of {@link UniformNode} - * and manage them as a uniform buffer. - * - * In most cases, the predefined nodes `objectGroup`, `renderGroup` and `frameGroup` - * will be used when defining the {@link UniformNode#groupNode} property. - * - * - `objectGroup`: Uniform buffer per object. - * - `renderGroup`: Shared uniform buffer, updated once per render call. - * - `frameGroup`: Shared uniform buffer, updated once per frame. - * - * @augments Node - */ -declare class UniformGroupNode extends Node { - /** - * Constructs a new uniform group node. - * - * @param {string} name - The name of the uniform group node. - * @param {boolean} [shared=false] - Whether this uniform group node is shared or not. - * @param {number} [order=1] - Influences the internal sorting. - * @param {string|null} [updateType=null] - The update type of the uniform group node. - */ - constructor(name: string, shared?: boolean, order?: number, updateType?: string | null); - /** - * Whether this uniform group node is shared or not. - * - * @type {boolean} - * @default false - */ - shared: boolean; - /** - * Influences the internal sorting. - * TODO: Add details when this property should be changed. - * - * @type {number} - * @default 1 - */ - order: number; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isUniformGroup: boolean; - /** - * Marks the uniform group node as needing an update. - * This will trigger the necessary updates in the rendering process. - */ - update(): void; -} -import Node from './Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/UniformNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/UniformNode.d.ts deleted file mode 100644 index f4cb493fb..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/UniformNode.d.ts +++ /dev/null @@ -1,65 +0,0 @@ -export default UniformNode; -export function uniform(value: any | string, type?: string): UniformNode; -/** - * Class for representing a uniform. - * - * @augments InputNode - */ -declare class UniformNode extends InputNode { - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isUniformNode: boolean; - /** - * The uniform group of this uniform. By default, uniforms are - * managed per object but they might belong to a shared group - * which is updated per frame or render call. - * - * @type {UniformGroupNode} - */ - groupNode: UniformGroupNode; - /** - * Sets the {@link UniformNode#name} property. - * - * @param {string} name - The name of the uniform. - * @return {UniformNode} A reference to this node. - */ - setName(name: string): UniformNode; - /** - * Sets the {@link UniformNode#name} property. - * - * @deprecated - * @param {string} name - The name of the uniform. - * @return {UniformNode} A reference to this node. - */ - label(name: string): UniformNode; - /** - * Sets the {@link UniformNode#groupNode} property. - * - * @param {UniformGroupNode} group - The uniform group. - * @return {UniformNode} A reference to this node. - */ - setGroup(group: UniformGroupNode): UniformNode; - /** - * Returns the {@link UniformNode#groupNode}. - * - * @return {UniformGroupNode} The uniform group. - */ - getGroup(): UniformGroupNode; - /** - * By default, this method returns the result of {@link Node#getHash} but derived - * classes might overwrite this method with a different implementation. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The uniform hash. - */ - getUniformHash(builder: NodeBuilder): string; - onUpdate(callback: any, updateType: any): import("./Node.js").default; - getInputType(builder: any): string; - generate(builder: any, output: any): any; -} -import InputNode from './InputNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/VarNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/VarNode.d.ts deleted file mode 100644 index 5e200133c..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/VarNode.d.ts +++ /dev/null @@ -1,88 +0,0 @@ -export default VarNode; -export function Var(node: Node, name?: string | null): VarNode; -export function Const(node: Node, name?: string | null): VarNode; -export function VarIntent(node: Node): VarNode; -/** - * Class for representing shader variables as nodes. Variables are created from - * existing nodes like the following: - * - * ```js - * const depth = sampleDepth( uvNode ).toVar( 'depth' ); - * ``` - * - * @augments Node - */ -declare class VarNode extends Node { - /** - * Constructs a new variable node. - * - * @param {Node} node - The node for which a variable should be created. - * @param {?string} [name=null] - The name of the variable in the shader. - * @param {boolean} [readOnly=false] - The read-only flag. - */ - constructor(node: Node, name?: string | null, readOnly?: boolean); - /** - * The node for which a variable should be created. - * - * @type {Node} - */ - node: Node; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isVarNode: boolean; - /** - * - * The read-only flag. - * - * @type {boolean} - * @default false - */ - readOnly: boolean; - /** - * This flag is used to indicate that this node is used for intent. - * - * @type {boolean} - * @default false - */ - intent: boolean; - /** - * Sets the intent flag for this node. - * - * This flag is used to indicate that this node is used for intent - * and should not be built directly. Instead, it is used to indicate that - * the node should be treated as a variable intent. - * - * It's useful for assigning variables without needing creating a new variable node. - * - * @param {boolean} value - The value to set for the intent flag. - * @returns {VarNode} This node. - */ - setIntent(value: boolean): VarNode; - /** - * Checks if this node is used for intent. - * - * @param {NodeBuilder} builder - The node builder. - * @returns {boolean} Whether this node is used for intent. - */ - isIntent(builder: NodeBuilder): boolean; - /** - * Returns the intent flag of this node. - * - * @return {boolean} The intent flag. - */ - getIntent(): boolean; - getMemberType(builder: any, name: any): string; - getElementType(builder: any): string; - generateNodeType(builder: any): string; - getArrayCount(builder: any): number | null; - isAssign(builder: any): any; - build(...params: any[]): string | Node | null; - generate(builder: any): any; - _hasStack(builder: any): boolean; -} -import Node from './Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/VaryingNode.d.ts b/jsdoc-testing/jsdoc/nodes/core/VaryingNode.d.ts deleted file mode 100644 index 4833ad311..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/VaryingNode.d.ts +++ /dev/null @@ -1,80 +0,0 @@ -export default VaryingNode; -/** - * TSL function for creating a varying node. - * - * @tsl - * @function - * @param {Node} node - The node for which a varying should be created. - * @param {?string} name - The name of the varying in the shader. - * @returns {VaryingNode} - */ -export const varying: any; -export function vertexStage(node: Node): VaryingNode; -/** - * Class for representing shader varyings as nodes. Varyings are create from - * existing nodes like the following: - * - * ```js - * const positionLocal = positionGeometry.toVarying( 'vPositionLocal' ); - * ``` - * - * @augments Node - */ -declare class VaryingNode extends Node { - /** - * Constructs a new varying node. - * - * @param {Node} node - The node for which a varying should be created. - * @param {?string} name - The name of the varying in the shader. - */ - constructor(node: Node, name?: string | null); - /** - * The node for which a varying should be created. - * - * @type {Node} - */ - node: Node; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isVaryingNode: boolean; - /** - * The interpolation type of the varying data. - * - * @type {?string} - * @default null - */ - interpolationType: string | null; - /** - * The interpolation sampling type of varying data. - * - * @type {?string} - * @default null - */ - interpolationSampling: string | null; - /** - * Defines the interpolation type of the varying. - * - * @param {string} type - The interpolation type. - * @param {?string} sampling - The interpolation sampling type - * @return {VaryingNode} A reference to this node. - */ - setInterpolation(type: string, sampling?: string | null): VaryingNode; - getHash(builder: any): string; - generateNodeType(builder: any): string; - /** - * This method performs the setup of a varying node with the current node builder. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {NodeVarying} The node varying from the node builder. - */ - setupVarying(builder: NodeBuilder): NodeVarying; - setup(builder: any): void; - analyze(builder: any): void; - generate(builder: any): any; -} -import Node from './Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/core/constants.d.ts b/jsdoc-testing/jsdoc/nodes/core/constants.d.ts deleted file mode 100644 index 5d342ff3a..000000000 --- a/jsdoc-testing/jsdoc/nodes/core/constants.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -export namespace NodeShaderStage { - let VERTEX: string; - let FRAGMENT: string; -} -export namespace NodeUpdateType { - let NONE: string; - let FRAME: string; - let RENDER: string; - let OBJECT: string; -} -export namespace NodeType { - let BOOLEAN: string; - let INTEGER: string; - let FLOAT: string; - let VECTOR2: string; - let VECTOR3: string; - let VECTOR4: string; - let MATRIX2: string; - let MATRIX3: string; - let MATRIX4: string; -} -export namespace NodeAccess { - let READ_ONLY: string; - let WRITE_ONLY: string; - let READ_WRITE: string; -} -export const defaultShaderStages: string[]; -export const defaultBuildStages: string[]; -export const shaderStages: string[]; -export const vectorComponents: string[]; diff --git a/jsdoc-testing/jsdoc/nodes/display/BlendModes.d.ts b/jsdoc-testing/jsdoc/nodes/display/BlendModes.d.ts deleted file mode 100644 index 244185457..000000000 --- a/jsdoc-testing/jsdoc/nodes/display/BlendModes.d.ts +++ /dev/null @@ -1,95 +0,0 @@ -/** - * Represents a "Color Burn" blend mode. - * - * It's designed to darken the base layer's colors based on the color of the blend layer. - * It significantly increases the contrast of the base layer, making the colors more vibrant and saturated. - * The darker the color in the blend layer, the stronger the darkening and contrast effect on the base layer. - * - * @tsl - * @function - * @param {Node} base - The base color. - * @param {Node} blend - The blend color. A white (#ffffff) blend color does not alter the base color. - * @return {Node} The result. - */ -export const blendBurn: any; -/** - * Represents a "Color Dodge" blend mode. - * - * It's designed to lighten the base layer's colors based on the color of the blend layer. - * It significantly increases the brightness of the base layer, making the colors lighter and more vibrant. - * The brighter the color in the blend layer, the stronger the lightening and contrast effect on the base layer. - * - * @tsl - * @function - * @param {Node} base - The base color. - * @param {Node} blend - The blend color. A black (#000000) blend color does not alter the base color. - * @return {Node} The result. - */ -export const blendDodge: any; -/** - * Represents a "Screen" blend mode. - * - * Similar to `blendDodge()`, this mode also lightens the base layer's colors based on the color of the blend layer. - * The "Screen" blend mode is better for general brightening whereas the "Dodge" results in more subtle and nuanced - * effects. - * - * @tsl - * @function - * @param {Node} base - The base color. - * @param {Node} blend - The blend color. A black (#000000) blend color does not alter the base color. - * @return {Node} The result. - */ -export const blendScreen: any; -/** - * Represents a "Overlay" blend mode. - * - * It's designed to increase the contrast of the base layer based on the color of the blend layer. - * It amplifies the existing colors and contrast in the base layer, making lighter areas lighter and darker areas darker. - * The color of the blend layer significantly influences the resulting contrast and color shift in the base layer. - * - * @tsl - * @function - * @param {Node} base - The base color. - * @param {Node} blend - The blend color - * @return {Node} The result. - */ -export const blendOverlay: any; -/** - * This function blends two color based on their alpha values by replicating the behavior of `THREE.NormalBlending`. - * It assumes both input colors have non-premultiplied alpha. - * - * @tsl - * @function - * @param {Node} base - The base color. - * @param {Node} blend - The blend color - * @return {Node} The result. - */ -export const blendColor: any; -/** - * Premultiplies the RGB channels of a color by its alpha channel. - * - * This function is useful for converting a non-premultiplied alpha color - * into a premultiplied alpha format, where the RGB values are scaled - * by the alpha value. Premultiplied alpha is often used in graphics - * rendering for certain operations, such as compositing and image processing. - * - * @tsl - * @function - * @param {Node} color - The input color with non-premultiplied alpha. - * @return {Node} The color with premultiplied alpha. - */ -export const premultiplyAlpha: () => void; -/** - * Unpremultiplies the RGB channels of a color by its alpha channel. - * - * This function is useful for converting a premultiplied alpha color - * back into a non-premultiplied alpha format, where the RGB values are - * divided by the alpha value. Unpremultiplied alpha is often used in graphics - * rendering for certain operations, such as compositing and image processing. - * - * @tsl - * @function - * @param {Node} color - The input color with premultiplied alpha. - * @return {Node} The color with non-premultiplied alpha. - */ -export const unpremultiplyAlpha: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/display/BumpMapNode.d.ts b/jsdoc-testing/jsdoc/nodes/display/BumpMapNode.d.ts deleted file mode 100644 index 08aa47f62..000000000 --- a/jsdoc-testing/jsdoc/nodes/display/BumpMapNode.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -export default BumpMapNode; -/** - * TSL function for creating a bump map node. - * - * @tsl - * @function - * @param {Node} textureNode - Represents the bump map data. - * @param {?Node} [scaleNode=null] - Controls the intensity of the bump effect. - * @returns {BumpMapNode} - */ -export const bumpMap: any; -/** - * This class can be used for applying bump maps to materials. - * - * ```js - * material.normalNode = bumpMap( texture( bumpTex ) ); - * ``` - * - * @augments TempNode - */ -declare class BumpMapNode extends TempNode { - /** - * Constructs a new bump map node. - * - * @param {Node} textureNode - Represents the bump map data. - * @param {?Node} [scaleNode=null] - Controls the intensity of the bump effect. - */ - constructor(textureNode: Node, scaleNode?: Node | null); - /** - * Represents the bump map data. - * - * @type {Node} - */ - textureNode: Node; - /** - * Controls the intensity of the bump effect. - * - * @type {?Node} - * @default null - */ - scaleNode: Node | null; - setup(): void; -} -import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/display/ColorAdjustment.d.ts b/jsdoc-testing/jsdoc/nodes/display/ColorAdjustment.d.ts deleted file mode 100644 index 342c82742..000000000 --- a/jsdoc-testing/jsdoc/nodes/display/ColorAdjustment.d.ts +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Computes a grayscale value for the given RGB color value. - * - * @tsl - * @function - * @param {Node} color - The color value to compute the grayscale for. - * @return {Node} The grayscale color. - */ -export const grayscale: () => void; -/** - * Super-saturates or desaturates the given RGB color. - * - * @tsl - * @function - * @param {Node} color - The input color. - * @param {Node} [adjustment=1] - Specifies the amount of the conversion. A value under `1` desaturates the color, a value over `1` super-saturates it. - * @return {Node} The saturated color. - */ -export const saturation: () => void; -/** - * Selectively enhance the intensity of less saturated RGB colors. Can result - * in a more natural and visually appealing image with enhanced color depth - * compared to {@link ColorAdjustment#saturation}. - * - * @tsl - * @function - * @param {Node} color - The input color. - * @param {Node} [adjustment=1] - Controls the intensity of the vibrance effect. - * @return {Node} The updated color. - */ -export const vibrance: () => void; -/** - * Updates the hue component of the given RGB color while preserving its luminance and saturation. - * - * @tsl - * @function - * @param {Node} color - The input color. - * @param {Node} [adjustment=1] - Defines the degree of hue rotation in radians. A positive value rotates the hue clockwise, while a negative value rotates it counterclockwise. - * @return {Node} The updated color. - */ -export const hue: () => void; -export function luminance(color: Node, luminanceCoefficients?: Node | null): Node; -/** - * Color Decision List (CDL) v1.2 - * - * Compact representation of color grading information, defined by slope, offset, power, and - * saturation. The CDL should be typically be given input in a log space (such as LogC, ACEScc, - * or AgX Log), and will return output in the same space. Output may require clamping >=0. - * - * @tsl - * @function - * @param {Node} color Input (-Infinity < input < +Infinity) - * @param {Node} slope Slope (0 ≤ slope < +Infinity) - * @param {Node} offset Offset (-Infinity < offset < +Infinity; typically -1 < offset < 1) - * @param {Node} power Power (0 < power < +Infinity) - * @param {Node} saturation Saturation (0 ≤ saturation < +Infinity; typically 0 ≤ saturation < 4) - * @param {Node} luminanceCoefficients Luminance coefficients for saturation term, typically Rec. 709 - * @return {Node} Output, -Infinity < output < +Infinity - * - * References: - * - ASC CDL v1.2 - * - {@link https://blender.stackexchange.com/a/55239/43930} - * - {@link https://docs.acescentral.com/specifications/acescc/} - */ -export const cdl: () => void; -/** - * TSL function for creating a posterize effect which reduces the number of colors - * in an image, resulting in a more blocky and stylized appearance. - * - * @tsl - * @function - * @param {Node} sourceNode - The input color. - * @param {Node} stepsNode - Controls the intensity of the posterization effect. A lower number results in a more blocky appearance. - * @returns {Node} The posterized color. - */ -export const posterize: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/display/ColorSpaceFunctions.d.ts b/jsdoc-testing/jsdoc/nodes/display/ColorSpaceFunctions.d.ts deleted file mode 100644 index 2677fb978..000000000 --- a/jsdoc-testing/jsdoc/nodes/display/ColorSpaceFunctions.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Converts the given color value from sRGB to linear-sRGB color space. - * - * @tsl - * @function - * @param {Node} color - The sRGB color. - * @return {Node} The linear-sRGB color. - */ -export const sRGBTransferEOTF: any; -/** - * Converts the given color value from linear-sRGB to sRGB color space. - * - * @tsl - * @function - * @param {Node} color - The linear-sRGB color. - * @return {Node} The sRGB color. - */ -export const sRGBTransferOETF: any; diff --git a/jsdoc-testing/jsdoc/nodes/display/ColorSpaceNode.d.ts b/jsdoc-testing/jsdoc/nodes/display/ColorSpaceNode.d.ts deleted file mode 100644 index 37eaac303..000000000 --- a/jsdoc-testing/jsdoc/nodes/display/ColorSpaceNode.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -export default ColorSpaceNode; -export function workingToColorSpace(node: Node, targetColorSpace: string): ColorSpaceNode; -export function colorSpaceToWorking(node: Node, sourceColorSpace: string): ColorSpaceNode; -export function convertColorSpace(node: Node, sourceColorSpace: string, targetColorSpace: string): ColorSpaceNode; -/** - * This node represents a color space conversion. Meaning it converts - * a color value from a source to a target color space. - * - * @augments TempNode - */ -declare class ColorSpaceNode extends TempNode { - /** - * Constructs a new color space node. - * - * @param {Node} colorNode - Represents the color to convert. - * @param {string} source - The source color space. - * @param {string} target - The target color space. - */ - constructor(colorNode: Node, source: string, target: string); - /** - * Represents the color to convert. - * - * @type {Node} - */ - colorNode: Node; - /** - * The source color space. - * - * @type {string} - */ - source: string; - /** - * The target color space. - * - * @type {string} - */ - target: string; - /** - * This method resolves the constants `WORKING_COLOR_SPACE` and - * `OUTPUT_COLOR_SPACE` based on the current configuration of the - * color management and renderer. - * - * @param {NodeBuilder} builder - The current node builder. - * @param {string} colorSpace - The color space to resolve. - * @return {string} The resolved color space. - */ - resolveColorSpace(builder: NodeBuilder, colorSpace: string): string; - setup(builder: any): Node; -} -import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/display/FrontFacingNode.d.ts b/jsdoc-testing/jsdoc/nodes/display/FrontFacingNode.d.ts deleted file mode 100644 index 8a54e2d33..000000000 --- a/jsdoc-testing/jsdoc/nodes/display/FrontFacingNode.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -export default FrontFacingNode; -/** - * TSL object that represents whether a primitive is front or back facing - * - * @tsl - * @type {FrontFacingNode} - */ -export const frontFacing: FrontFacingNode; -/** - * TSL object that represents the front facing status as a number instead of a bool. - * `1` means front facing, `-1` means back facing. - * - * @tsl - * @type {Node} - */ -export const faceDirection: Node; -/** - * Converts a direction vector to a face direction vector based on the material's side. - * - * If the material is set to `BackSide`, the direction is inverted. - * If the material is set to `DoubleSide`, the direction is multiplied by `faceDirection`. - * - * @tsl - * @param {Node} direction - The direction vector to convert. - * @returns {Node} The converted direction vector. - */ -export const directionToFaceDirection: () => void; -/** - * This node can be used to evaluate whether a primitive is front or back facing. - * - * @augments Node - */ -declare class FrontFacingNode extends Node { - /** - * Constructs a new front facing node. - */ - constructor(); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isFrontFacingNode: boolean; - generate(builder: any): any; -} -import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/display/NormalMapNode.d.ts b/jsdoc-testing/jsdoc/nodes/display/NormalMapNode.d.ts deleted file mode 100644 index a87be475f..000000000 --- a/jsdoc-testing/jsdoc/nodes/display/NormalMapNode.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -export default NormalMapNode; -/** - * TSL function for creating a normal map node. - * - * @tsl - * @function - * @param {Node} node - Represents the normal map data. - * @param {?Node} [scaleNode=null] - Controls the intensity of the effect. - * @returns {NormalMapNode} - */ -export const normalMap: any; -/** - * This class can be used for applying normals maps to materials. - * - * ```js - * material.normalNode = normalMap( texture( normalTex ) ); - * ``` - * - * @augments TempNode - */ -declare class NormalMapNode extends TempNode { - /** - * Constructs a new normal map node. - * - * @param {Node} node - Represents the normal map data. - * @param {?Node} [scaleNode=null] - Controls the intensity of the effect. - */ - constructor(node: Node, scaleNode?: Node | null); - /** - * Represents the normal map data. - * - * @type {Node} - */ - node: Node; - /** - * Controls the intensity of the effect. - * - * @type {?Node} - * @default null - */ - scaleNode: Node | null; - /** - * The normal map type. - * - * @type {(TangentSpaceNormalMap|ObjectSpaceNormalMap)} - * @default TangentSpaceNormalMap - */ - normalMapType: (number | number); - /** - * Controls how to unpack the sampled normal map values. - * - * @type {string} - * @default NoNormalPacking - */ - unpackNormalMode: string; - setup(builder: any): any; -} -import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/display/PassNode.d.ts b/jsdoc-testing/jsdoc/nodes/display/PassNode.d.ts deleted file mode 100644 index bd6dfbb24..000000000 --- a/jsdoc-testing/jsdoc/nodes/display/PassNode.d.ts +++ /dev/null @@ -1,417 +0,0 @@ -export default PassNode; -export function pass(scene: Scene, camera: Camera, options: Object): PassNode; -export function passTexture(pass: PassNode, texture: Texture): PassTextureNode; -export function depthPass(scene: Scene, camera: Camera, options: Object): PassNode; -/** - * Represents a render pass (sometimes called beauty pass) in context of post processing. - * This pass produces a render for the given scene and camera and can provide multiple outputs - * via MRT for further processing. - * - * ```js - * const postProcessing = new RenderPipeline( renderer ); - * - * const scenePass = pass( scene, camera ); - * - * postProcessing.outputNode = scenePass; - * ``` - * - * @augments TempNode - */ -declare class PassNode extends TempNode { - /** - * Constructs a new pass node. - * - * @param {('color'|'depth')} scope - The scope of the pass. The scope determines whether the node outputs color or depth. - * @param {Scene} scene - A reference to the scene. - * @param {Camera} camera - A reference to the camera. - * @param {Object} options - Options for the internal render target. - */ - constructor(scope: ("color" | "depth"), scene: Scene, camera: Camera, options?: Object); - /** - * The scope of the pass. The scope determines whether the node outputs color or depth. - * - * @type {('color'|'depth')} - */ - scope: ("color" | "depth"); - /** - * A reference to the scene. - * - * @type {Scene} - */ - scene: Scene; - /** - * A reference to the camera. - * - * @type {Camera} - */ - camera: Camera; - /** - * Options for the internal render target. - * - * @type {Object} - */ - options: Object; - /** - * The pass's pixel ratio. Will be kept automatically kept in sync with the renderer's pixel ratio. - * - * @private - * @type {number} - * @default 1 - */ - private _pixelRatio; - /** - * The pass's pixel width. Will be kept automatically kept in sync with the renderer's width. - * @private - * @type {number} - * @default 1 - */ - private _width; - /** - * The pass's pixel height. Will be kept automatically kept in sync with the renderer's height. - * @private - * @type {number} - * @default 1 - */ - private _height; - /** - * The pass's render target. - * - * @type {RenderTarget} - */ - renderTarget: RenderTarget; - /** - * An optional override material for the pass. - * - * @type {Material|null} - */ - overrideMaterial: Material | null; - /** - * Whether the pass is transparent. - * - * @type {boolean} - * @default false - */ - transparent: boolean; - /** - * Whether the pass is opaque. - * - * @type {boolean} - * @default true - */ - opaque: boolean; - /** - * An optional global context for the pass. - * - * @type {ContextNode|null} - */ - contextNode: ContextNode | null; - /** - * A cache for the context node. - * - * @private - * @type {?Object} - * @default null - */ - private _contextNodeCache; - /** - * A dictionary holding the internal result textures. - * - * @private - * @type {Object} - */ - private _textures; - /** - * A dictionary holding the internal texture nodes. - * - * @private - * @type {Object} - */ - private _textureNodes; - /** - * A dictionary holding the internal depth nodes. - * - * @private - * @type {Object} - */ - private _linearDepthNodes; - /** - * A dictionary holding the internal viewZ nodes. - * - * @private - * @type {Object} - */ - private _viewZNodes; - /** - * A dictionary holding the texture data of the previous frame. - * Used for computing velocity/motion vectors. - * - * @private - * @type {Object} - */ - private _previousTextures; - /** - * A dictionary holding the texture nodes of the previous frame. - * Used for computing velocity/motion vectors. - * - * @private - * @type {Object} - */ - private _previousTextureNodes; - /** - * The `near` property of the camera as a uniform. - * - * @private - * @type {UniformNode} - */ - private _cameraNear; - /** - * The `far` property of the camera as a uniform. - * - * @private - * @type {UniformNode} - */ - private _cameraFar; - /** - * A MRT node configuring the MRT settings. - * - * @private - * @type {?MRTNode} - * @default null - */ - private _mrt; - /** - * Layer object for configuring the camera that is used - * to produce the pass. - * - * @private - * @type {?Layers} - * @default null - */ - private _layers; - /** - * Scales the resolution of the internal render target. - * - * @private - * @type {number} - * @default 1 - */ - private _resolutionScale; - /** - * Custom viewport definition. - * - * @private - * @type {?Vector4} - * @default null - */ - private _viewport; - /** - * Custom scissor definition. - * - * @private - * @type {?Vector4} - * @default null - */ - private _scissor; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isPassNode: boolean; - /** - * Sets the resolution scale for the pass. - * The resolution scale is a factor that is multiplied with the renderer's width and height. - * - * @param {number} resolutionScale - The resolution scale to set. A value of `1` means full resolution. - * @return {PassNode} A reference to this pass. - */ - setResolutionScale(resolutionScale: number): PassNode; - /** - * Gets the current resolution scale of the pass. - * - * @return {number} The current resolution scale. A value of `1` means full resolution. - */ - getResolutionScale(): number; - /** - * Sets the resolution for the pass. - * The resolution is a factor that is multiplied with the renderer's width and height. - * - * @param {number} resolution - The resolution to set. A value of `1` means full resolution. - * @return {PassNode} A reference to this pass. - * @deprecated since r181. Use {@link PassNode#setResolutionScale `setResolutionScale()`} instead. - */ - setResolution(resolution: number): PassNode; - /** - * Gets the current resolution of the pass. - * - * @return {number} The current resolution. A value of `1` means full resolution. - * @deprecated since r181. Use {@link PassNode#getResolutionScale `getResolutionScale()`} instead. - */ - getResolution(): number; - /** - * Sets the layer configuration that should be used when rendering the pass. - * - * @param {Layers} layers - The layers object to set. - * @return {PassNode} A reference to this pass. - */ - setLayers(layers: Layers): PassNode; - /** - * Gets the current layer configuration of the pass. - * - * @return {?Layers} . - */ - getLayers(): Layers | null; - /** - * Sets the given MRT node to setup MRT for this pass. - * - * @param {MRTNode} mrt - The MRT object. - * @return {PassNode} A reference to this pass. - */ - setMRT(mrt: MRTNode): PassNode; - /** - * Returns the current MRT node. - * - * @return {MRTNode} The current MRT node. - */ - getMRT(): MRTNode; - /** - * Returns the texture for the given output name. - * - * @param {string} name - The output name to get the texture for. - * @return {Texture} The texture. - */ - getTexture(name: string): Texture; - /** - * Returns the texture holding the data of the previous frame for the given output name. - * - * @param {string} name - The output name to get the texture for. - * @return {Texture} The texture holding the data of the previous frame. - */ - getPreviousTexture(name: string): Texture; - /** - * Switches current and previous textures for the given output name. - * - * @param {string} name - The output name. - */ - toggleTexture(name: string): void; - /** - * Returns the texture node for the given output name. - * - * @param {string} [name='output'] - The output name to get the texture node for. - * @return {TextureNode} The texture node. - */ - getTextureNode(name?: string): TextureNode; - /** - * Returns the previous texture node for the given output name. - * - * @param {string} [name='output'] - The output name to get the previous texture node for. - * @return {TextureNode} The previous texture node. - */ - getPreviousTextureNode(name?: string): TextureNode; - /** - * Returns a viewZ node of this pass. - * - * @param {string} [name='depth'] - The output name to get the viewZ node for. In most cases the default `'depth'` can be used however the parameter exists for custom depth outputs. - * @return {Node} The viewZ node. - */ - getViewZNode(name?: string): Node; - /** - * Returns a linear depth node of this pass. - * - * @param {string} [name='depth'] - The output name to get the linear depth node for. In most cases the default `'depth'` can be used however the parameter exists for custom depth outputs. - * @return {Node} The linear depth node. - */ - getLinearDepthNode(name?: string): Node; - /** - * Precompiles the pass. - * - * Note that this method must be called after the pass configuration is complete. - * So calls like `setMRT()` and `getTextureNode()` must proceed the precompilation. - * - * @async - * @param {Renderer} renderer - The renderer. - * @return {Promise} A Promise that resolves when the compile has been finished. - * @see {@link Renderer#compileAsync} - */ - compileAsync(renderer: Renderer): Promise; - setup({ renderer }: { - renderer: any; - }): Node | TextureNode; - updateBefore(frame: any): void; - /** - * Sets the size of the pass's render target. Honors the pixel ratio. - * - * @param {number} width - The width to set. - * @param {number} height - The height to set. - */ - setSize(width: number, height: number): void; - /** - * This method allows to define the pass's scissor rectangle. By default, the scissor rectangle is kept - * in sync with the pass's dimensions. To reverse the process and use auto-sizing again, call the method - * with `null` as the single argument. - * - * @param {?(number | Vector4)} x - The horizontal coordinate for the lower left corner of the box in logical pixel unit. - * Instead of passing four arguments, the method also works with a single four-dimensional vector. - * @param {number} y - The vertical coordinate for the lower left corner of the box in logical pixel unit. - * @param {number} width - The width of the scissor box in logical pixel unit. - * @param {number} height - The height of the scissor box in logical pixel unit. - */ - setScissor(x: (number | Vector4) | null, y: number, width: number, height: number): void; - /** - * This method allows to define the pass's viewport. By default, the viewport is kept in sync - * with the pass's dimensions. To reverse the process and use auto-sizing again, call the method - * with `null` as the single argument. - * - * @param {number | Vector4} x - The horizontal coordinate for the lower left corner of the viewport origin in logical pixel unit. - * @param {number} y - The vertical coordinate for the lower left corner of the viewport origin in logical pixel unit. - * @param {number} width - The width of the viewport in logical pixel unit. - * @param {number} height - The height of the viewport in logical pixel unit. - */ - setViewport(x: number | Vector4, y: number, width: number, height: number): void; - /** - * Sets the pixel ratio the pass's render target and updates the size. - * - * @param {number} pixelRatio - The pixel ratio to set. - */ - setPixelRatio(pixelRatio: number): void; -} -declare namespace PassNode { - let COLOR: "color"; - let DEPTH: "depth"; -} -/** - * Represents the texture of a pass node. - * - * @augments TextureNode - */ -declare class PassTextureNode extends TextureNode { - /** - * Constructs a new pass texture node. - * - * @param {PassNode} passNode - The pass node. - * @param {Texture} texture - The output texture. - */ - constructor(passNode: PassNode, texture: Texture); - /** - * A reference to the pass node. - * - * @type {PassNode} - */ - passNode: PassNode; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @default true - * @readonly - */ - readonly isPassTextureNode: boolean; - setup(builder: any): void; - clone(): any; -} -import TempNode from '../core/TempNode.js'; -import { RenderTarget } from '../../core/RenderTarget.js'; -import { default as TextureNode } from '../accessors/TextureNode.js'; -import { Vector4 } from '../../math/Vector4.js'; diff --git a/jsdoc-testing/jsdoc/nodes/display/RenderOutputNode.d.ts b/jsdoc-testing/jsdoc/nodes/display/RenderOutputNode.d.ts deleted file mode 100644 index d469787e9..000000000 --- a/jsdoc-testing/jsdoc/nodes/display/RenderOutputNode.d.ts +++ /dev/null @@ -1,79 +0,0 @@ -export default RenderOutputNode; -export function renderOutput(color: Node, toneMapping?: number | null, outputColorSpace?: string | null): RenderOutputNode; -/** - * Normally, tone mapping and color conversion happens automatically just - * before outputting a pixel to the default (screen) framebuffer. In certain - * post processing setups this is too late because some effects such as FXAA - * require e.g. sRGB input. For such scenarios, `RenderOutputNode` can be used - * to apply tone mapping and color space conversion at an arbitrary point - * in the effect chain. - * - * When applying tone mapping and color space conversion manually with this node, - * you have to set {@link RenderPipeline#outputColorTransform} to `false`. - * - * ```js - * const postProcessing = new RenderPipeline( renderer ); - * postProcessing.outputColorTransform = false; - * - * const scenePass = pass( scene, camera ); - * const outputPass = renderOutput( scenePass ); - * - * postProcessing.outputNode = outputPass; - * ``` - * - * @augments TempNode - */ -declare class RenderOutputNode extends TempNode { - /** - * Constructs a new render output node. - * - * @param {Node} colorNode - The color node to process. - * @param {?number} toneMapping - The tone mapping type. - * @param {?string} outputColorSpace - The output color space. - */ - constructor(colorNode: Node, toneMapping: number | null, outputColorSpace: string | null); - /** - * The color node to process. - * - * @type {Node} - */ - colorNode: Node; - /** - * The tone mapping type. - * - * @private - * @type {?number} - */ - private _toneMapping; - /** - * The output color space. - * - * @type {?string} - */ - outputColorSpace: string | null; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isRenderOutputNode: boolean; - /** - * Sets the tone mapping type. - * - * @param {number} value - The tone mapping type. - * @return {ToneMappingNode} A reference to this node. - */ - setToneMapping(value: number): ToneMappingNode; - /** - * Gets the tone mapping type. - * - * @returns {number} The tone mapping type. - */ - getToneMapping(): number; - setup({ context }: { - context: any; - }): Node; -} -import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/display/ScreenNode.d.ts b/jsdoc-testing/jsdoc/nodes/display/ScreenNode.d.ts deleted file mode 100644 index b721d4072..000000000 --- a/jsdoc-testing/jsdoc/nodes/display/ScreenNode.d.ts +++ /dev/null @@ -1,127 +0,0 @@ -export default ScreenNode; -/** - * TSL object that represents the current DPR. - * - * @tsl - * @type {ScreenNode} - */ -export const screenDPR: ScreenNode; -/** - * TSL object that represents normalized screen coordinates, unitless in `[0, 1]`. - * - * @tsl - * @type {ScreenNode} - */ -export const screenUV: ScreenNode; -/** - * TSL object that represents the screen resolution in physical pixel units. - * - * @tsl - * @type {ScreenNode} - */ -export const screenSize: ScreenNode; -/** - * TSL object that represents the current `x`/`y` pixel position on the screen in physical pixel units. - * - * @tsl - * @type {ScreenNode} - */ -export const screenCoordinate: ScreenNode; -/** - * TSL object that represents the viewport rectangle as `x`, `y`, `width` and `height` in physical pixel units. - * - * @tsl - * @type {ScreenNode} - */ -export const viewport: ScreenNode; -/** - * TSL object that represents the viewport resolution in physical pixel units. - * - * @tsl - * @type {ScreenNode} - */ -export const viewportSize: ScreenNode; -/** - * TSL object that represents the current `x`/`y` pixel position on the viewport in physical pixel units. - * - * @tsl - * @type {ScreenNode} - */ -export const viewportCoordinate: ScreenNode; -/** - * TSL object that represents normalized viewport coordinates, unitless in `[0, 1]`. - * - * @tsl - * @type {ScreenNode} - */ -export const viewportUV: ScreenNode; -/** - * @deprecated since r169. Use {@link screenSize} instead. - */ -export const viewportResolution: any; -/** - * This node provides a collection of screen related metrics. - * Depending on {@link ScreenNode#scope}, the nodes can represent - * resolution or viewport data as well as fragment or uv coordinates. - * - * @augments Node - */ -declare class ScreenNode extends Node { - /** - * Constructs a new screen node. - * - * @param {('coordinate'|'viewport'|'size'|'uv'|'dpr')} scope - The node's scope. - */ - constructor(scope: ("coordinate" | "viewport" | "size" | "uv" | "dpr")); - /** - * The node represents different metric depending on which scope is selected. - * - * - `ScreenNode.COORDINATE`: Window-relative coordinates of the current fragment according to WebGPU standards. - * - `ScreenNode.VIEWPORT`: The current viewport defined as a four-dimensional vector. - * - `ScreenNode.SIZE`: The dimensions of the current bound framebuffer. - * - `ScreenNode.UV`: Normalized coordinates. - * - `ScreenNode.DPR`: Device pixel ratio. - * - * @type {('coordinate'|'viewport'|'size'|'uv'|'dpr')} - */ - scope: ("coordinate" | "viewport" | "size" | "uv" | "dpr"); - /** - * This output node. - * - * @private - * @type {?Node} - * @default null - */ - private _output; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isViewportNode: boolean; - /** - * This method is overwritten since the node type depends on the selected scope. - * - * @return {('float'|'vec2'|'vec4')} The node type. - */ - generateNodeType(): ("float" | "vec2" | "vec4"); - /** - * `ScreenNode` implements {@link Node#update} to retrieve viewport and size information - * from the current renderer. - * - * @param {NodeFrame} frame - A reference to the current node frame. - */ - update({ renderer }: NodeFrame): void; - setup(): any; - generate(builder: any): any; -} -declare namespace ScreenNode { - let COORDINATE: string; - let VIEWPORT: string; - let SIZE: string; - let UV: string; - let DPR: string; -} -import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/display/ToneMappingFunctions.d.ts b/jsdoc-testing/jsdoc/nodes/display/ToneMappingFunctions.d.ts deleted file mode 100644 index 2d04148f4..000000000 --- a/jsdoc-testing/jsdoc/nodes/display/ToneMappingFunctions.d.ts +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Linear tone mapping, exposure only. - * - * @tsl - * @function - * @param {Node} color - The color that should be tone mapped. - * @param {Node} exposure - The exposure. - * @return {Node} The tone mapped color. - */ -export const linearToneMapping: any; -/** - * Reinhard tone mapping. - * - * Reference: {@link https://www.cs.utah.edu/docs/techreports/2002/pdf/UUCS-02-001.pdf} - * - * @tsl - * @function - * @param {Node} color - The color that should be tone mapped. - * @param {Node} exposure - The exposure. - * @return {Node} The tone mapped color. - */ -export const reinhardToneMapping: any; -/** - * Cineon tone mapping. - * - * Reference: {@link http://filmicworlds.com/blog/filmic-tonemapping-operators/} - * - * @tsl - * @function - * @param {Node} color - The color that should be tone mapped. - * @param {Node} exposure - The exposure. - * @return {Node} The tone mapped color. - */ -export const cineonToneMapping: any; -/** - * ACESFilmic tone mapping. - * - * Reference: {@link https://github.com/selfshadow/ltc_code/blob/master/webgl/shaders/ltc/ltc_blit.fs} - * - * @tsl - * @function - * @param {Node} color - The color that should be tone mapped. - * @param {Node} exposure - The exposure. - * @return {Node} The tone mapped color. - */ -export const acesFilmicToneMapping: any; -/** - * AgX tone mapping. - * - * @tsl - * @function - * @param {Node} color - The color that should be tone mapped. - * @param {Node} exposure - The exposure. - * @return {Node} The tone mapped color. - */ -export const agxToneMapping: any; -/** - * Neutral tone mapping. - * - * Reference: {@link https://modelviewer.dev/examples/tone-mapping} - * - * @tsl - * @function - * @param {Node} color - The color that should be tone mapped. - * @param {Node} exposure - The exposure. - * @return {Node} The tone mapped color. - */ -export const neutralToneMapping: any; diff --git a/jsdoc-testing/jsdoc/nodes/display/ToneMappingNode.d.ts b/jsdoc-testing/jsdoc/nodes/display/ToneMappingNode.d.ts deleted file mode 100644 index 7e8ca1871..000000000 --- a/jsdoc-testing/jsdoc/nodes/display/ToneMappingNode.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -export default ToneMappingNode; -export function toneMapping(mapping: number, exposure: Node | number, color: Node | Color): ToneMappingNode; -/** - * TSL object that represents the global tone mapping exposure of the renderer. - * - * @tsl - * @type {RendererReferenceNode} - */ -export const toneMappingExposure: RendererReferenceNode; -/** - * This node represents a tone mapping operation. - * - * @augments TempNode - */ -declare class ToneMappingNode extends TempNode { - /** - * Constructs a new tone mapping node. - * - * @param {number} toneMapping - The tone mapping type. - * @param {Node} exposureNode - The tone mapping exposure. - * @param {Node} [colorNode=null] - The color node to process. - */ - constructor(toneMapping: number, exposureNode?: Node, colorNode?: Node); - /** - * The tone mapping type. - * - * @private - * @type {number} - */ - private _toneMapping; - /** - * The tone mapping exposure. - * - * @type {Node} - * @default null - */ - exposureNode: Node; - /** - * Represents the color to process. - * - * @type {?Node} - * @default null - */ - colorNode: Node | null; - /** - * Sets the tone mapping type. - * - * @param {number} value - The tone mapping type. - * @return {ToneMappingNode} A reference to this node. - */ - setToneMapping(value: number): ToneMappingNode; - /** - * Gets the tone mapping type. - * - * @returns {number} The tone mapping type. - */ - getToneMapping(): number; - setup(builder: any): any; -} -import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/display/ToonOutlinePassNode.d.ts b/jsdoc-testing/jsdoc/nodes/display/ToonOutlinePassNode.d.ts deleted file mode 100644 index cb934f4cb..000000000 --- a/jsdoc-testing/jsdoc/nodes/display/ToonOutlinePassNode.d.ts +++ /dev/null @@ -1,71 +0,0 @@ -export default ToonOutlinePassNode; -export function toonOutlinePass(scene: Scene, camera: Camera, color?: Color, thickness?: number, alpha?: number): ToonOutlinePassNode; -/** - * Represents a render pass for producing a toon outline effect on compatible objects. - * Only 3D objects with materials of type `MeshToonMaterial` and `MeshToonNodeMaterial` - * will receive the outline. - * - * ```js - * const postProcessing = new RenderPipeline( renderer ); - * - * const scenePass = toonOutlinePass( scene, camera ); - * - * postProcessing.outputNode = scenePass; - * ``` - * @augments PassNode - */ -declare class ToonOutlinePassNode extends PassNode { - /** - * Constructs a new outline pass node. - * - * @param {Scene} scene - A reference to the scene. - * @param {Camera} camera - A reference to the camera. - * @param {Node} colorNode - Defines the outline's color. - * @param {Node} thicknessNode - Defines the outline's thickness. - * @param {Node} alphaNode - Defines the outline's alpha. - */ - constructor(scene: Scene, camera: Camera, colorNode: Node, thicknessNode: Node, alphaNode: Node); - /** - * Defines the outline's color. - * - * @type {Node} - */ - colorNode: Node; - /** - * Defines the outline's thickness. - * - * @type {Node} - */ - thicknessNode: Node; - /** - * Defines the outline's alpha. - * - * @type {Node} - */ - alphaNode: Node; - /** - * An internal material cache. - * - * @private - * @type {WeakMap} - */ - private _materialCache; - /** - * Creates the material used for outline rendering. - * - * @private - * @return {NodeMaterial} The outline material. - */ - private _createMaterial; - /** - * For the given toon material, this method returns a corresponding - * outline material. - * - * @private - * @param {(MeshToonMaterial|MeshToonNodeMaterial)} originalMaterial - The toon material. - * @return {NodeMaterial} The outline material. - */ - private _getOutlineMaterial; -} -import { Color } from '../../math/Color.js'; -import PassNode from './PassNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/display/ViewportDepthNode.d.ts b/jsdoc-testing/jsdoc/nodes/display/ViewportDepthNode.d.ts deleted file mode 100644 index 6b0693f40..000000000 --- a/jsdoc-testing/jsdoc/nodes/display/ViewportDepthNode.d.ts +++ /dev/null @@ -1,105 +0,0 @@ -export default ViewportDepthNode; -export function viewZToOrthographicDepth(viewZ: Node, near: Node, far: Node): Node; -export function viewZToReversedOrthographicDepth(viewZ: Node, near: Node, far: Node): Node; -/** - * TSL function for converting an orthographic depth value to a viewZ value. - * - * @tsl - * @function - * @param {Node} depth - The orthographic depth. - * @param {Node} near - The camera's near value. - * @param {Node} far - The camera's far value. - * @returns {Node} - */ -export const orthographicDepthToViewZ: () => void; -export function viewZToPerspectiveDepth(viewZ: Node, near: Node, far: Node): Node; -export function viewZToReversedPerspectiveDepth(viewZ: Node, near: Node, far: Node): Node; -/** - * TSL function for converting a perspective depth value to a viewZ value. - * - * @tsl - * @function - * @param {Node} depth - The perspective depth. - * @param {Node} near - The camera's near value. - * @param {Node} far - The camera's far value. - * @returns {Node} - */ -export const perspectiveDepthToViewZ: () => void; -export function viewZToLogarithmicDepth(viewZ: Node, near: Node, far: Node): Node; -export function logarithmicDepthToViewZ(depth: Node, near: Node, far: Node): Node; -/** - * TSL object that represents the depth value for the current fragment. - * - * @tsl - * @type {ViewportDepthNode} - */ -export const depth: ViewportDepthNode; -/** - * TSL function for converting a perspective depth value to linear depth. - * - * @tsl - * @function - * @param {?Node} [value=null] - The perspective depth. If `null` is provided, the current fragment's depth is used. - * @returns {ViewportDepthNode} - */ -export const linearDepth: any; -/** - * TSL object that represents the linear (orthographic) depth value of the current fragment - * - * @tsl - * @type {ViewportDepthNode} - */ -export const viewportLinearDepth: ViewportDepthNode; -/** - * This node offers a collection of features in context of the depth logic in the fragment shader. - * Depending on {@link ViewportDepthNode#scope}, it can be used to define a depth value for the current - * fragment or for depth evaluation purposes. - * - * @augments Node - */ -declare class ViewportDepthNode extends Node { - /** - * Constructs a new viewport depth node. - * - * @param {('depth'|'depthBase'|'linearDepth')} scope - The node's scope. - * @param {?Node} [valueNode=null] - The value node. - */ - constructor(scope: ("depth" | "depthBase" | "linearDepth"), valueNode?: Node | null); - /** - * The node behaves differently depending on which scope is selected. - * - * - `ViewportDepthNode.DEPTH_BASE`: Allows to define a value for the current fragment's depth. - * - `ViewportDepthNode.DEPTH`: Represents the depth value for the current fragment (`valueNode` is ignored). - * - `ViewportDepthNode.LINEAR_DEPTH`: Represents the linear (orthographic) depth value of the current fragment. - * If a `valueNode` is set, the scope can be used to convert perspective depth data to linear data. - * - * @type {('depth'|'depthBase'|'linearDepth')} - */ - scope: ("depth" | "depthBase" | "linearDepth"); - /** - * Can be used to define a custom depth value. - * The property is ignored in the `ViewportDepthNode.DEPTH` scope. - * - * @type {?Node} - * @default null - */ - valueNode: Node | null; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isViewportDepthNode: boolean; - generate(builder: any): any; - setup({ camera }: { - camera: any; - }): any; -} -declare namespace ViewportDepthNode { - let DEPTH_BASE: string; - let DEPTH: string; - let LINEAR_DEPTH: string; -} -import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/display/ViewportDepthTextureNode.d.ts b/jsdoc-testing/jsdoc/nodes/display/ViewportDepthTextureNode.d.ts deleted file mode 100644 index c70252a7e..000000000 --- a/jsdoc-testing/jsdoc/nodes/display/ViewportDepthTextureNode.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -export default ViewportDepthTextureNode; -/** - * TSL function for a viewport depth texture node. - * - * @tsl - * @function - * @param {?Node} [uvNode=screenUV] - The uv node. - * @param {?Node} [levelNode=null] - The level node. - * @param {?DepthTexture} [depthTexture=null] - A depth texture. If not provided, a depth texture is created automatically. - * @returns {ViewportDepthTextureNode} - */ -export const viewportDepthTexture: any; -/** - * Represents the depth of the current viewport as a texture. This module - * can be used in combination with viewport texture to achieve effects - * that require depth evaluation. - * - * @augments ViewportTextureNode - */ -declare class ViewportDepthTextureNode extends ViewportTextureNode { - /** - * Constructs a new viewport depth texture node. - * - * @param {Node} [uvNode=screenUV] - The uv node. - * @param {?Node} [levelNode=null] - The level node. - * @param {?DepthTexture} [depthTexture=null] - A depth texture. If not provided, uses a shared depth texture. - */ - constructor(uvNode?: Node, levelNode?: Node | null, depthTexture?: DepthTexture | null); -} -import ViewportTextureNode from './ViewportTextureNode.js'; -import { DepthTexture } from '../../textures/DepthTexture.js'; diff --git a/jsdoc-testing/jsdoc/nodes/display/ViewportSharedTextureNode.d.ts b/jsdoc-testing/jsdoc/nodes/display/ViewportSharedTextureNode.d.ts deleted file mode 100644 index 46859c337..000000000 --- a/jsdoc-testing/jsdoc/nodes/display/ViewportSharedTextureNode.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -export default ViewportSharedTextureNode; -/** - * TSL function for creating a shared viewport texture node. - * - * @tsl - * @function - * @param {?Node} [uvNode=screenUV] - The uv node. - * @param {?Node} [levelNode=null] - The level node. - * @returns {ViewportSharedTextureNode} - */ -export const viewportSharedTexture: any; -/** - * `ViewportTextureNode` creates an internal texture for each node instance. This module - * shares a texture across all instances of `ViewportSharedTextureNode`. It should - * be the first choice when using data of the default/screen framebuffer for performance reasons. - * - * @augments ViewportTextureNode - */ -declare class ViewportSharedTextureNode extends ViewportTextureNode { - /** - * Constructs a new viewport shared texture node. - * - * @param {Node} [uvNode=screenUV] - The uv node. - * @param {?Node} [levelNode=null] - The level node. - */ - constructor(uvNode?: Node, levelNode?: Node | null); - /** - * Overwritten so the method always returns the unique shared - * framebuffer texture. - * - * @return {FramebufferTexture} The shared framebuffer texture. - */ - getTextureForReference(): FramebufferTexture; - updateReference(): this; -} -import ViewportTextureNode from './ViewportTextureNode.js'; -import { FramebufferTexture } from '../../textures/FramebufferTexture.js'; diff --git a/jsdoc-testing/jsdoc/nodes/display/ViewportTextureNode.d.ts b/jsdoc-testing/jsdoc/nodes/display/ViewportTextureNode.d.ts deleted file mode 100644 index 328a03fb0..000000000 --- a/jsdoc-testing/jsdoc/nodes/display/ViewportTextureNode.d.ts +++ /dev/null @@ -1,89 +0,0 @@ -export default ViewportTextureNode; -/** - * TSL function for creating a viewport texture node. - * - * @tsl - * @function - * @param {?Node} [uvNode=screenUV] - The uv node. - * @param {?Node} [levelNode=null] - The level node. - * @param {?Texture} [framebufferTexture=null] - A framebuffer texture holding the viewport data. If not provided, a framebuffer texture is created automatically. - * @returns {ViewportTextureNode} - */ -export const viewportTexture: any; -/** - * TSL function for creating a viewport texture node with enabled mipmap generation. - * - * @tsl - * @function - * @param {?Node} [uvNode=screenUV] - The uv node. - * @param {?Node} [levelNode=null] - The level node. - * @param {?Texture} [framebufferTexture=null] - A framebuffer texture holding the viewport data. If not provided, a framebuffer texture is created automatically. - * @returns {ViewportTextureNode} - */ -export const viewportMipTexture: any; -export function viewportOpaqueMipTexture(uv?: Node | null, level?: Node | null): ViewportTextureNode; -/** - * A special type of texture node which represents the data of the current viewport - * as a texture. The module extracts data from the current bound framebuffer with - * a copy operation so no extra render pass is required to produce the texture data - * (which is good for performance). `ViewportTextureNode` can be used as an input for a - * variety of effects like refractive or transmissive materials. - * - * @augments TextureNode - */ -declare class ViewportTextureNode extends TextureNode { - /** - * Constructs a new viewport texture node. - * - * @param {Node} [uvNode=screenUV] - The uv node. - * @param {?Node} [levelNode=null] - The level node. - * @param {?Texture} [framebufferTexture=null] - A framebuffer texture holding the viewport data. If not provided, a framebuffer texture is created automatically. - */ - constructor(uvNode?: Node, levelNode?: Node | null, framebufferTexture?: Texture | null); - /** - * Whether to generate mipmaps or not. - * - * @type {boolean} - * @default false - */ - generateMipmaps: boolean; - /** - * The reference framebuffer texture. This is used to store the framebuffer texture - * for the current render target. If the render target changes, a new framebuffer texture - * is created automatically. - * - * @type {FramebufferTexture} - * @default null - */ - defaultFramebuffer: FramebufferTexture; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isOutputTextureNode: boolean; - /** - * The framebuffer texture for the current renderer context. - * - * @type {WeakMap} - * @private - */ - private _cacheTextures; - /** - * This methods returns a texture for the given render target or canvas target reference. - * - * To avoid rendering errors, `ViewportTextureNode` must use unique framebuffer textures - * for different render contexts. - * - * @param {?(RenderTarget|CanvasTarget)} [reference=null] - The render target or canvas target reference. - * @return {Texture} The framebuffer texture. - */ - getTextureForReference(reference?: (RenderTarget | CanvasTarget) | null): Texture; - updateReference(frame: any): import("../../textures/Texture.js").Texture; - updateBefore(frame: any): void; - clone(): any; -} -import TextureNode from '../accessors/TextureNode.js'; -import { FramebufferTexture } from '../../textures/FramebufferTexture.js'; diff --git a/jsdoc-testing/jsdoc/nodes/fog/Fog.d.ts b/jsdoc-testing/jsdoc/nodes/fog/Fog.d.ts deleted file mode 100644 index 34f7636b6..000000000 --- a/jsdoc-testing/jsdoc/nodes/fog/Fog.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Constructs a new range factor node. - * - * @tsl - * @function - * @param {Node} near - Defines the near value. - * @param {Node} far - Defines the far value. - */ -export const rangeFogFactor: () => void; -/** - * Represents an exponential squared fog. This type of fog gives - * a clear view near the camera and a faster than exponentially - * densening fog farther from the camera. - * - * @tsl - * @function - * @param {Node} density - Defines the fog density. - */ -export const densityFogFactor: () => void; -/** - * Constructs a new height fog factor node. This fog factor requires a Y-up coordinate system. - * - * @tsl - * @function - * @param {Node} density - Defines the fog density. - * @param {Node} height - The height threshold in world space. Everything below this y-coordinate is affected by fog. - */ -export const exponentialHeightFogFactor: () => void; -/** - * This class can be used to configure a fog for the scene. - * Nodes of this type are assigned to `Scene.fogNode`. - * - * @tsl - * @function - * @param {Node} color - Defines the color of the fog. - * @param {Node} factor - Defines how the fog is factored in the scene. - */ -export const fog: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/functions/BSDF/BRDF_GGX.d.ts b/jsdoc-testing/jsdoc/nodes/functions/BSDF/BRDF_GGX.d.ts deleted file mode 100644 index c47f5559a..000000000 --- a/jsdoc-testing/jsdoc/nodes/functions/BSDF/BRDF_GGX.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export default BRDF_GGX; -declare const BRDF_GGX: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/functions/BSDF/BRDF_GGX_Multiscatter.d.ts b/jsdoc-testing/jsdoc/nodes/functions/BSDF/BRDF_GGX_Multiscatter.d.ts deleted file mode 100644 index 7da6ffd76..000000000 --- a/jsdoc-testing/jsdoc/nodes/functions/BSDF/BRDF_GGX_Multiscatter.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export default BRDF_GGX_Multiscatter; -declare const BRDF_GGX_Multiscatter: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/functions/BSDF/BRDF_Lambert.d.ts b/jsdoc-testing/jsdoc/nodes/functions/BSDF/BRDF_Lambert.d.ts deleted file mode 100644 index 71b76485d..000000000 --- a/jsdoc-testing/jsdoc/nodes/functions/BSDF/BRDF_Lambert.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export default BRDF_Lambert; -declare const BRDF_Lambert: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/functions/BSDF/BRDF_Sheen.d.ts b/jsdoc-testing/jsdoc/nodes/functions/BSDF/BRDF_Sheen.d.ts deleted file mode 100644 index eb31b60ad..000000000 --- a/jsdoc-testing/jsdoc/nodes/functions/BSDF/BRDF_Sheen.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export default BRDF_Sheen; -declare const BRDF_Sheen: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/functions/BSDF/DFGLUT.d.ts b/jsdoc-testing/jsdoc/nodes/functions/BSDF/DFGLUT.d.ts deleted file mode 100644 index 5a20667ef..000000000 --- a/jsdoc-testing/jsdoc/nodes/functions/BSDF/DFGLUT.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export default DFGLUT; -declare const DFGLUT: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/functions/BSDF/D_GGX.d.ts b/jsdoc-testing/jsdoc/nodes/functions/BSDF/D_GGX.d.ts deleted file mode 100644 index ee1081261..000000000 --- a/jsdoc-testing/jsdoc/nodes/functions/BSDF/D_GGX.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export default D_GGX; -declare const D_GGX: any; diff --git a/jsdoc-testing/jsdoc/nodes/functions/BSDF/D_GGX_Anisotropic.d.ts b/jsdoc-testing/jsdoc/nodes/functions/BSDF/D_GGX_Anisotropic.d.ts deleted file mode 100644 index 788dd6c3b..000000000 --- a/jsdoc-testing/jsdoc/nodes/functions/BSDF/D_GGX_Anisotropic.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export default D_GGX_Anisotropic; -declare const D_GGX_Anisotropic: any; diff --git a/jsdoc-testing/jsdoc/nodes/functions/BSDF/EnvironmentBRDF.d.ts b/jsdoc-testing/jsdoc/nodes/functions/BSDF/EnvironmentBRDF.d.ts deleted file mode 100644 index ebc316a79..000000000 --- a/jsdoc-testing/jsdoc/nodes/functions/BSDF/EnvironmentBRDF.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export default EnvironmentBRDF; -declare const EnvironmentBRDF: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/functions/BSDF/F_Schlick.d.ts b/jsdoc-testing/jsdoc/nodes/functions/BSDF/F_Schlick.d.ts deleted file mode 100644 index a1d2caea7..000000000 --- a/jsdoc-testing/jsdoc/nodes/functions/BSDF/F_Schlick.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export default F_Schlick; -declare const F_Schlick: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/functions/BSDF/LTC.d.ts b/jsdoc-testing/jsdoc/nodes/functions/BSDF/LTC.d.ts deleted file mode 100644 index 3f41af9a6..000000000 --- a/jsdoc-testing/jsdoc/nodes/functions/BSDF/LTC.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export const LTC_Evaluate: any; -export const LTC_Evaluate_Volume: any; -export const LTC_Uv: any; diff --git a/jsdoc-testing/jsdoc/nodes/functions/BSDF/Schlick_to_F0.d.ts b/jsdoc-testing/jsdoc/nodes/functions/BSDF/Schlick_to_F0.d.ts deleted file mode 100644 index 316542c93..000000000 --- a/jsdoc-testing/jsdoc/nodes/functions/BSDF/Schlick_to_F0.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export default Schlick_to_F0; -declare const Schlick_to_F0: any; diff --git a/jsdoc-testing/jsdoc/nodes/functions/BSDF/V_GGX_SmithCorrelated.d.ts b/jsdoc-testing/jsdoc/nodes/functions/BSDF/V_GGX_SmithCorrelated.d.ts deleted file mode 100644 index aeaeb6109..000000000 --- a/jsdoc-testing/jsdoc/nodes/functions/BSDF/V_GGX_SmithCorrelated.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export default V_GGX_SmithCorrelated; -declare const V_GGX_SmithCorrelated: any; diff --git a/jsdoc-testing/jsdoc/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.d.ts b/jsdoc-testing/jsdoc/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.d.ts deleted file mode 100644 index 7c2c87243..000000000 --- a/jsdoc-testing/jsdoc/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export default V_GGX_SmithCorrelated_Anisotropic; -declare const V_GGX_SmithCorrelated_Anisotropic: any; diff --git a/jsdoc-testing/jsdoc/nodes/functions/BasicLightingModel.d.ts b/jsdoc-testing/jsdoc/nodes/functions/BasicLightingModel.d.ts deleted file mode 100644 index 3db9024d7..000000000 --- a/jsdoc-testing/jsdoc/nodes/functions/BasicLightingModel.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -export default BasicLightingModel; -/** - * Represents the lighting model for unlit materials. The only light contribution - * is baked indirect lighting modulated with ambient occlusion and the material's - * diffuse color. Environment mapping is supported. Used in {@link MeshBasicNodeMaterial}. - * - * @augments LightingModel - */ -declare class BasicLightingModel extends LightingModel { - /** - * Implements the baked indirect lighting with its modulation. - * - * @param {NodeBuilder} builder - The current node builder. - */ - indirect({ context }: NodeBuilder): void; - /** - * Implements the environment mapping. - * - * @param {NodeBuilder} builder - The current node builder. - */ - finish(builder: NodeBuilder): void; -} -import LightingModel from '../core/LightingModel.js'; diff --git a/jsdoc-testing/jsdoc/nodes/functions/PhongLightingModel.d.ts b/jsdoc-testing/jsdoc/nodes/functions/PhongLightingModel.d.ts deleted file mode 100644 index 8d016e0a0..000000000 --- a/jsdoc-testing/jsdoc/nodes/functions/PhongLightingModel.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -export default PhongLightingModel; -/** - * Represents the lighting model for a phong material. Used in {@link MeshPhongNodeMaterial}. - * - * @augments BasicLightingModel - */ -declare class PhongLightingModel extends BasicLightingModel { - /** - * Constructs a new phong lighting model. - * - * @param {boolean} [specular=true] - Whether specular is supported or not. - */ - constructor(specular?: boolean); - /** - * Whether specular is supported or not. Set this to `false` if you are - * looking for a Lambert-like material meaning a material for non-shiny - * surfaces, without specular highlights. - * - * @type {boolean} - * @default true - */ - specular: boolean; - /** - * Implements the direct lighting. The specular portion is optional an can be controlled - * with the {@link PhongLightingModel#specular} flag. - * - * @param {Object} lightData - The light data. - */ - direct({ lightDirection, lightColor, reflectedLight }: Object): void; -} -import BasicLightingModel from './BasicLightingModel.js'; diff --git a/jsdoc-testing/jsdoc/nodes/functions/PhysicalLightingModel.d.ts b/jsdoc-testing/jsdoc/nodes/functions/PhysicalLightingModel.d.ts deleted file mode 100644 index 3b3294a26..000000000 --- a/jsdoc-testing/jsdoc/nodes/functions/PhysicalLightingModel.d.ts +++ /dev/null @@ -1,171 +0,0 @@ -export default PhysicalLightingModel; -/** - * Represents the lighting model for a PBR material. - * - * @augments LightingModel - */ -declare class PhysicalLightingModel extends LightingModel { - /** - * Constructs a new physical lighting model. - * - * @param {boolean} [clearcoat=false] - Whether clearcoat is supported or not. - * @param {boolean} [sheen=false] - Whether sheen is supported or not. - * @param {boolean} [iridescence=false] - Whether iridescence is supported or not. - * @param {boolean} [anisotropy=false] - Whether anisotropy is supported or not. - * @param {boolean} [transmission=false] - Whether transmission is supported or not. - * @param {boolean} [dispersion=false] - Whether dispersion is supported or not. - */ - constructor(clearcoat?: boolean, sheen?: boolean, iridescence?: boolean, anisotropy?: boolean, transmission?: boolean, dispersion?: boolean); - /** - * Whether clearcoat is supported or not. - * - * @type {boolean} - * @default false - */ - clearcoat: boolean; - /** - * Whether sheen is supported or not. - * - * @type {boolean} - * @default false - */ - sheen: boolean; - /** - * Whether iridescence is supported or not. - * - * @type {boolean} - * @default false - */ - iridescence: boolean; - /** - * Whether anisotropy is supported or not. - * - * @type {boolean} - * @default false - */ - anisotropy: boolean; - /** - * Whether transmission is supported or not. - * - * @type {boolean} - * @default false - */ - transmission: boolean; - /** - * Whether dispersion is supported or not. - * - * @type {boolean} - * @default false - */ - dispersion: boolean; - /** - * The clear coat radiance. - * - * @type {?Node} - * @default null - */ - clearcoatRadiance: Node | null; - /** - * The clear coat specular direct. - * - * @type {?Node} - * @default null - */ - clearcoatSpecularDirect: Node | null; - /** - * The clear coat specular indirect. - * - * @type {?Node} - * @default null - */ - clearcoatSpecularIndirect: Node | null; - /** - * The sheen specular direct. - * - * @type {?Node} - * @default null - */ - sheenSpecularDirect: Node | null; - /** - * The sheen specular indirect. - * - * @type {?Node} - * @default null - */ - sheenSpecularIndirect: Node | null; - /** - * The iridescence Fresnel. - * - * @type {?Node} - * @default null - */ - iridescenceFresnel: Node | null; - /** - * The iridescence F0. - * - * @type {?Node} - * @default null - */ - iridescenceF0: Node | null; - /** - * The iridescence F0 dielectric. - * - * @type {?Node} - * @default null - */ - iridescenceF0Dielectric: Node | null; - /** - * The iridescence F0 metallic. - * - * @type {?Node} - * @default null - */ - iridescenceF0Metallic: Node | null; - computeMultiscattering(singleScatter: any, multiScatter: any, specularF90: any, f0: any, iridescenceF0?: null): void; - /** - * Implements the direct light. - * - * @param {Object} lightData - The light data. - * @param {NodeBuilder} builder - The current node builder. - */ - direct({ lightDirection, lightColor, reflectedLight }: Object): void; - /** - * This method is intended for implementing the direct light term for - * rect area light nodes. - * - * @param {Object} input - The input data. - * @param {NodeBuilder} builder - The current node builder. - */ - directRectArea({ lightColor, lightPosition, halfWidth, halfHeight, reflectedLight, ltc_1, ltc_2 }: Object): void; - /** - * Implements the indirect lighting. - * - * @param {NodeBuilder} builder - The current node builder. - */ - indirect(builder: NodeBuilder): void; - /** - * Implements the indirect diffuse term. - * - * @param {NodeBuilder} builder - The current node builder. - */ - indirectDiffuse(builder: NodeBuilder): void; - /** - * Implements the indirect specular term. - * - * @param {NodeBuilder} builder - The current node builder. - */ - indirectSpecular(builder: NodeBuilder): void; - /** - * Implements the ambient occlusion term. - * - * @param {NodeBuilder} builder - The current node builder. - */ - ambientOcclusion(builder: NodeBuilder): void; - /** - * Used for final lighting accumulations depending on the requested features. - * - * @param {NodeBuilder} builder - The current node builder. - */ - finish({ context }: NodeBuilder): void; -} -import LightingModel from '../core/LightingModel.js'; diff --git a/jsdoc-testing/jsdoc/nodes/functions/ShadowMaskModel.d.ts b/jsdoc-testing/jsdoc/nodes/functions/ShadowMaskModel.d.ts deleted file mode 100644 index 84e3d6ecf..000000000 --- a/jsdoc-testing/jsdoc/nodes/functions/ShadowMaskModel.d.ts +++ /dev/null @@ -1,27 +0,0 @@ -export default ShadowMaskModel; -/** - * Represents lighting model for a shadow material. Used in {@link ShadowNodeMaterial}. - * - * @augments LightingModel - */ -declare class ShadowMaskModel extends LightingModel { - /** - * The shadow mask node. - * - * @type {Node} - */ - shadowNode: Node; - /** - * Only used to save the shadow mask. - * - * @param {Object} input - The input data. - */ - direct({ lightNode }: Object): void; - /** - * Uses the shadow mask to produce the final color. - * - * @param {NodeBuilder} builder - The current node builder. - */ - finish({ context }: NodeBuilder): void; -} -import LightingModel from '../core/LightingModel.js'; diff --git a/jsdoc-testing/jsdoc/nodes/functions/ToonLightingModel.d.ts b/jsdoc-testing/jsdoc/nodes/functions/ToonLightingModel.d.ts deleted file mode 100644 index 420e9ee87..000000000 --- a/jsdoc-testing/jsdoc/nodes/functions/ToonLightingModel.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -export default ToonLightingModel; -/** - * Represents the lighting model for a toon material. Used in {@link MeshToonNodeMaterial}. - * - * @augments LightingModel - */ -declare class ToonLightingModel extends LightingModel { - /** - * Implements the direct lighting. Instead of using a conventional smooth irradiance, the irradiance is - * reduced to a small number of discrete shades to create a comic-like, flat look. - * - * @param {Object} lightData - The light data. - * @param {NodeBuilder} builder - The current node builder. - */ - direct({ lightDirection, lightColor, reflectedLight }: Object, builder: NodeBuilder): void; - /** - * Implements the indirect lighting. - * - * @param {NodeBuilder} builder - The current node builder. - */ - indirect(builder: NodeBuilder): void; -} -import LightingModel from '../core/LightingModel.js'; diff --git a/jsdoc-testing/jsdoc/nodes/functions/VolumetricLightingModel.d.ts b/jsdoc-testing/jsdoc/nodes/functions/VolumetricLightingModel.d.ts deleted file mode 100644 index 1cf33cba5..000000000 --- a/jsdoc-testing/jsdoc/nodes/functions/VolumetricLightingModel.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -export default VolumetricLightingModel; -/** - * VolumetricLightingModel class extends the LightingModel to implement volumetric lighting effects. - * This model calculates the scattering and transmittance of light through a volumetric medium. - * It dynamically adjusts the direction of the ray based on the camera and object positions. - * The model supports custom scattering and depth nodes to enhance the lighting effects. - * - * @augments LightingModel - */ -declare class VolumetricLightingModel extends LightingModel { - start(builder: any): void; - scatteringLight(lightColor: any, builder: any): void; - direct({ lightNode, lightColor }: { - lightNode: any; - lightColor: any; - }, builder: any): void; - directRectArea({ lightColor, lightPosition, halfWidth, halfHeight }: { - lightColor: any; - lightPosition: any; - halfWidth: any; - halfHeight: any; - }, builder: any): void; - finish(builder: any): void; -} -import LightingModel from '../core/LightingModel.js'; diff --git a/jsdoc-testing/jsdoc/nodes/functions/material/getAlphaHashThreshold.d.ts b/jsdoc-testing/jsdoc/nodes/functions/material/getAlphaHashThreshold.d.ts deleted file mode 100644 index 30b15c98e..000000000 --- a/jsdoc-testing/jsdoc/nodes/functions/material/getAlphaHashThreshold.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export default getAlphaHashThreshold; -declare const getAlphaHashThreshold: any; diff --git a/jsdoc-testing/jsdoc/nodes/functions/material/getGeometryRoughness.d.ts b/jsdoc-testing/jsdoc/nodes/functions/material/getGeometryRoughness.d.ts deleted file mode 100644 index 30ea57be5..000000000 --- a/jsdoc-testing/jsdoc/nodes/functions/material/getGeometryRoughness.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export default getGeometryRoughness; -declare const getGeometryRoughness: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/functions/material/getParallaxCorrectNormal.d.ts b/jsdoc-testing/jsdoc/nodes/functions/material/getParallaxCorrectNormal.d.ts deleted file mode 100644 index 4c4a103a4..000000000 --- a/jsdoc-testing/jsdoc/nodes/functions/material/getParallaxCorrectNormal.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -export default getParallaxCorrectNormal; -/** - * This computes a parallax corrected normal which is used for box-projected cube mapping (BPCEM). - * - * Reference: {@link https://devlog-martinsh.blogspot.com/2011/09/box-projected-cube-environment-mapping.html} - * - * ```js - * const uvNode = getParallaxCorrectNormal( reflectVector, vec3( 200, 100, 100 ), vec3( 0, - 50, 0 ) ); - * material.envNode = pmremTexture( renderTarget.texture, uvNode ); - * ``` - * - * @tsl - * @function - * @param {Node} normal - The normal to correct. - * @param {Node} cubeSize - The cube size should reflect the size of the environment (BPCEM is usually applied in closed environments like rooms). - * @param {Node} cubePos - The cube position. - * @return {Node} The parallax corrected normal. - */ -declare const getParallaxCorrectNormal: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/functions/material/getRoughness.d.ts b/jsdoc-testing/jsdoc/nodes/functions/material/getRoughness.d.ts deleted file mode 100644 index 18eff5982..000000000 --- a/jsdoc-testing/jsdoc/nodes/functions/material/getRoughness.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export default getRoughness; -declare const getRoughness: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/functions/material/getShIrradianceAt.d.ts b/jsdoc-testing/jsdoc/nodes/functions/material/getShIrradianceAt.d.ts deleted file mode 100644 index 627b15982..000000000 --- a/jsdoc-testing/jsdoc/nodes/functions/material/getShIrradianceAt.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export default getShIrradianceAt; -declare const getShIrradianceAt: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/geometry/RangeNode.d.ts b/jsdoc-testing/jsdoc/nodes/geometry/RangeNode.d.ts deleted file mode 100644 index 3630a9978..000000000 --- a/jsdoc-testing/jsdoc/nodes/geometry/RangeNode.d.ts +++ /dev/null @@ -1,68 +0,0 @@ -export default RangeNode; -/** - * TSL function for creating a range node. - * - * @tsl - * @function - * @param {Node} [minNode=float()] - A node defining the lower bound of the range. - * @param {Node} [maxNode=float()] - A node defining the upper bound of the range. - * @returns {RangeNode} - */ -export const range: any; -/** - * `RangeNode` generates random instanced attribute data in a defined range. - * An exemplary use case for this utility node is to generate random per-instance - * colors: - * ```js - * const material = new MeshBasicNodeMaterial(); - * material.colorNode = range( new Color( 0x000000 ), new Color( 0xFFFFFF ) ); - * const mesh = new InstancedMesh( geometry, material, count ); - * ``` - * @augments Node - */ -declare class RangeNode extends Node { - /** - * Constructs a new range node. - * - * @param {Node} [minNode=float()] - A node defining the lower bound of the range. - * @param {Node} [maxNode=float()] - A node defining the upper bound of the range. - */ - constructor(minNode?: Node, maxNode?: Node); - /** - * A node defining the lower bound of the range. - * - * @type {Node} - * @default float() - */ - minNode: Node; - /** - * A node defining the upper bound of the range. - * - * @type {Node} - * @default float() - */ - maxNode: Node; - /** - * Returns the vector length which is computed based on the range definition. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {number} The vector length. - */ - getVectorLength(builder: NodeBuilder): number; - /** - * This method is overwritten since the node type is inferred from range definition. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The node type. - */ - generateNodeType(builder: NodeBuilder): string; - /** - * Returns a constant node from the given node by traversing it. - * - * @param {Node} node - The node to traverse. - * @returns {Node} The constant node, if found. - */ - getConstNode(node: Node): Node; - setup(builder: any): any; -} -import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/gpgpu/AtomicFunctionNode.d.ts b/jsdoc-testing/jsdoc/nodes/gpgpu/AtomicFunctionNode.d.ts deleted file mode 100644 index 956f26c33..000000000 --- a/jsdoc-testing/jsdoc/nodes/gpgpu/AtomicFunctionNode.d.ts +++ /dev/null @@ -1,78 +0,0 @@ -export default AtomicFunctionNode; -export function atomicFunc(method: string, pointerNode: Node, valueNode: Node): AtomicFunctionNode; -export function atomicLoad(pointerNode: Node): AtomicFunctionNode; -export function atomicStore(pointerNode: Node, valueNode: Node): AtomicFunctionNode; -export function atomicAdd(pointerNode: Node, valueNode: Node): AtomicFunctionNode; -export function atomicSub(pointerNode: Node, valueNode: Node): AtomicFunctionNode; -export function atomicMax(pointerNode: Node, valueNode: Node): AtomicFunctionNode; -export function atomicMin(pointerNode: Node, valueNode: Node): AtomicFunctionNode; -export function atomicAnd(pointerNode: Node, valueNode: Node): AtomicFunctionNode; -export function atomicOr(pointerNode: Node, valueNode: Node): AtomicFunctionNode; -export function atomicXor(pointerNode: Node, valueNode: Node): AtomicFunctionNode; -/** - * `AtomicFunctionNode` represents any function that can operate on atomic variable types - * within a shader. In an atomic function, any modification to an atomic variable will - * occur as an indivisible step with a defined order relative to other modifications. - * Accordingly, even if multiple atomic functions are modifying an atomic variable at once - * atomic operations will not interfere with each other. - * - * This node can only be used with a WebGPU backend. - * - * @augments Node - */ -declare class AtomicFunctionNode extends Node { - /** - * Constructs a new atomic function node. - * - * @param {string} method - The signature of the atomic function to construct. - * @param {Node} pointerNode - An atomic variable or element of an atomic buffer. - * @param {Node} valueNode - The value that mutates the atomic variable. - */ - constructor(method: string, pointerNode: Node, valueNode: Node); - /** - * The signature of the atomic function to construct. - * - * @type {string} - */ - method: string; - /** - * An atomic variable or element of an atomic buffer. - * - * @type {Node} - */ - pointerNode: Node; - /** - * A value that modifies the atomic variable. - * - * @type {Node} - */ - valueNode: Node; - /** - * Overwrites the default implementation to return the type of - * the pointer node. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The input type. - */ - getInputType(builder: NodeBuilder): string; - /** - * Overwritten since the node type is inferred from the input type. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The node type. - */ - generateNodeType(builder: NodeBuilder): string; - generate(builder: any): any; -} -declare namespace AtomicFunctionNode { - let ATOMIC_LOAD: string; - let ATOMIC_STORE: string; - let ATOMIC_ADD: string; - let ATOMIC_SUB: string; - let ATOMIC_MAX: string; - let ATOMIC_MIN: string; - let ATOMIC_AND: string; - let ATOMIC_OR: string; - let ATOMIC_XOR: string; -} -import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/gpgpu/BarrierNode.d.ts b/jsdoc-testing/jsdoc/nodes/gpgpu/BarrierNode.d.ts deleted file mode 100644 index 2f799556f..000000000 --- a/jsdoc-testing/jsdoc/nodes/gpgpu/BarrierNode.d.ts +++ /dev/null @@ -1,23 +0,0 @@ -export default BarrierNode; -export function workgroupBarrier(): BarrierNode; -export function storageBarrier(): BarrierNode; -export function textureBarrier(): BarrierNode; -/** - * Represents a GPU control barrier that synchronizes compute operations within a given scope. - * - * This node can only be used with a WebGPU backend. - * - * @augments Node - */ -declare class BarrierNode extends Node { - /** - * Constructs a new barrier node. - * - * @param {string} scope - The scope defines the behavior of the node. - */ - constructor(scope: string); - scope: string; - isBarrierNode: boolean; - generate(builder: any): void; -} -import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/gpgpu/ComputeBuiltinNode.d.ts b/jsdoc-testing/jsdoc/nodes/gpgpu/ComputeBuiltinNode.d.ts deleted file mode 100644 index d5dbfe59e..000000000 --- a/jsdoc-testing/jsdoc/nodes/gpgpu/ComputeBuiltinNode.d.ts +++ /dev/null @@ -1,135 +0,0 @@ -export default ComputeBuiltinNode; -/** - * Represents the number of workgroups dispatched by the compute shader. - * ```js - * // Run 512 invocations/threads with a workgroup size of 128. - * const computeFn = Fn(() => { - * - * // numWorkgroups.x = 4 - * storageBuffer.element(0).assign(numWorkgroups.x) - * - * })().compute(512, [128]); - * - * // Run 512 invocations/threads with the default workgroup size of 64. - * const computeFn = Fn(() => { - * - * // numWorkgroups.x = 8 - * storageBuffer.element(0).assign(numWorkgroups.x) - * - * })().compute(512); - * ``` - * - * @tsl - * @type {ComputeBuiltinNode} - */ -export const numWorkgroups: ComputeBuiltinNode; -/** - * Represents the 3-dimensional index of the workgroup the current compute invocation belongs to. - * ```js - * // Execute 12 compute threads with a workgroup size of 3. - * const computeFn = Fn( () => { - * - * If( workgroupId.x.mod( 2 ).equal( 0 ), () => { - * - * storageBuffer.element( instanceIndex ).assign( instanceIndex ); - * - * } ).Else( () => { - * - * storageBuffer.element( instanceIndex ).assign( 0 ); - * - * } ); - * - * } )().compute( 12, [ 3 ] ); - * - * // workgroupId.x = [0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3]; - * // Buffer Output = [0, 1, 2, 0, 0, 0, 6, 7, 8, 0, 0, 0]; - * ``` - * - * @tsl - * @type {ComputeBuiltinNode} - */ -export const workgroupId: ComputeBuiltinNode; -/** - * A non-linearized 3-dimensional representation of the current invocation's position within a 3D global grid. - * - * @tsl - * @type {ComputeBuiltinNode} - */ -export const globalId: ComputeBuiltinNode; -/** - * A non-linearized 3-dimensional representation of the current invocation's position within a 3D workgroup grid. - * - * @tsl - * @type {ComputeBuiltinNode} - */ -export const localId: ComputeBuiltinNode; -/** - * A device dependent variable that exposes the size of the current invocation's subgroup. - * - * @tsl - * @type {ComputeBuiltinNode} - */ -export const subgroupSize: ComputeBuiltinNode; -/** - * `ComputeBuiltinNode` represents a compute-scope builtin value that expose information - * about the currently running dispatch and/or the device it is running on. - * - * This node can only be used with a WebGPU backend. - * - * @augments Node - */ -declare class ComputeBuiltinNode extends Node { - /** - * Constructs a new compute builtin node. - * - * @param {string} builtinName - The built-in name. - * @param {string} nodeType - The node type. - */ - constructor(builtinName: string, nodeType: string); - /** - * The built-in name. - * - * @private - * @type {string} - */ - private _builtinName; - /** - * This method is overwritten since hash is derived from the built-in name. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The hash. - */ - getHash(builder: NodeBuilder): string; - /** - * This method is overwritten since the node type is simply derived from `nodeType`.. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The node type. - */ - generateNodeType(): string; - /** - * Sets the builtin name. - * - * @param {string} builtinName - The built-in name. - * @return {ComputeBuiltinNode} A reference to this node. - */ - setBuiltinName(builtinName: string): ComputeBuiltinNode; - /** - * Returns the builtin name. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The builtin name. - */ - getBuiltinName(): string; - /** - * Whether the current node builder has the builtin or not. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {boolean} Whether the builder has the builtin or not. - */ - hasBuiltin(builder: NodeBuilder): boolean; - generate(builder: any, output: any): any; - serialize(data: any): void; - deserialize(data: any): void; -} -import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/gpgpu/ComputeNode.d.ts b/jsdoc-testing/jsdoc/nodes/gpgpu/ComputeNode.d.ts deleted file mode 100644 index 66213c478..000000000 --- a/jsdoc-testing/jsdoc/nodes/gpgpu/ComputeNode.d.ts +++ /dev/null @@ -1,96 +0,0 @@ -export default ComputeNode; -export function computeKernel(node: Node, workgroupSize?: Array): ComputeNode; -export function compute(node: Node, count: number | Array, workgroupSize?: Array): ComputeNode; -/** - * Represents a compute shader node. - * - * @augments Node - */ -declare class ComputeNode extends Node { - /** - * Constructs a new compute node. - * - * @param {Node} computeNode - The node that defines the compute shader logic. - * @param {Array} workgroupSize - An array defining the X, Y, and Z dimensions of the workgroup for compute shader execution. - */ - constructor(computeNode: Node, workgroupSize: Array); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isComputeNode: boolean; - /** - * The node that defines the compute shader logic. - * - * @type {Node} - */ - computeNode: Node; - /** - * An array defining the X, Y, and Z dimensions of the workgroup for compute shader execution. - * - * @type {Array} - * @default [ 64 ] - */ - workgroupSize: Array; - /** - * The total number of threads (invocations) to execute. If it is a number, it will be used - * to automatically generate bounds checking against `instanceIndex`. - * - * @type {number|Array} - */ - count: number | Array; - /** - * The dispatch size for workgroups on X, Y, and Z axes. - * Used directly if `count` is not provided. - * - * @type {number|Array} - */ - dispatchSize: number | Array; - /** - * A callback executed when the compute node finishes initialization. - * - * @type {?Function} - */ - onInitFunction: Function | null; - /** - * A uniform node holding the dispatch count for bounds checking. - * Created automatically when `count` is a number. - * - * @type {?UniformNode} - */ - countNode: UniformNode | null; - /** - * Sets the {@link ComputeNode#name} property. - * - * @param {string} name - The name of the uniform. - * @return {ComputeNode} A reference to this node. - */ - setName(name: string): ComputeNode; - /** - * Sets the {@link ComputeNode#name} property. - * - * @deprecated - * @param {string} name - The name of the uniform. - * @return {ComputeNode} A reference to this node. - */ - label(name: string): ComputeNode; - /** - * Sets the callback to run during initialization. - * - * @param {Function} callback - The callback function. - * @return {ComputeNode} A reference to this node. - */ - onInit(callback: Function): ComputeNode; - /** - * The method execute the compute for this node. - * - * @param {NodeFrame} frame - A reference to the current node frame. - */ - updateBefore({ renderer }: NodeFrame): void; - setup(builder: any): string | Node | null; - generate(builder: any, output: any): any; -} -import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/gpgpu/SubgroupFunctionNode.d.ts b/jsdoc-testing/jsdoc/nodes/gpgpu/SubgroupFunctionNode.d.ts deleted file mode 100644 index 19c603f9b..000000000 --- a/jsdoc-testing/jsdoc/nodes/gpgpu/SubgroupFunctionNode.d.ts +++ /dev/null @@ -1,303 +0,0 @@ -export default SubgroupFunctionNode; -/** - * Returns true if this invocation has the lowest subgroup_invocation_id - * among active invocations in the subgroup. - * - * @tsl - * @method - * @return {bool} The result of the computation. - */ -export const subgroupElect: any; -/** - * Returns a set of bitfields where the bit corresponding to subgroup_invocation_id - * is 1 if pred is true for that active invocation and 0 otherwise. - * - * @tsl - * @method - * @param {bool} pred - A boolean that sets the bit corresponding to the invocations subgroup invocation id. - * @return {vec4}- A bitfield corresponding to the pred value of each subgroup invocation. - */ -export const subgroupBallot: any; -/** - * A reduction that adds e among all active invocations and returns that result. - * - * @tsl - * @method - * @param {number} e - The value provided to the reduction by the current invocation. - * @return {number} The accumulated result of the reduction operation. - */ -export const subgroupAdd: any; -/** - * An inclusive scan returning the sum of e for all active invocations with subgroup_invocation_id less than or equal to this invocation. - * - * @tsl - * @method - * @param {number} e - The value provided to the inclusive scan by the current invocation. - * @return {number} The accumulated result of the inclusive scan operation. - */ -export const subgroupInclusiveAdd: any; -/** - * An exclusive scan that returns the sum of e for all active invocations with subgroup_invocation_id less than this invocation. - * - * @tsl - * @method - * @param {number} e - The value provided to the exclusive scan by the current invocation. - * @return {number} The accumulated result of the exclusive scan operation. - */ -export const subgroupExclusiveAdd: any; -/** - * A reduction that multiplies e among all active invocations and returns that result. - * - * @tsl - * @method - * @param {number} e - The value provided to the reduction by the current invocation. - * @return {number} The accumulated result of the reduction operation. - */ -export const subgroupMul: any; -/** - * An inclusive scan returning the product of e for all active invocations with subgroup_invocation_id less than or equal to this invocation. - * - * @tsl - * @method - * @param {number} e - The value provided to the inclusive scan by the current invocation. - * @return {number} The accumulated result of the inclusive scan operation. - */ -export const subgroupInclusiveMul: any; -/** - * An exclusive scan that returns the product of e for all active invocations with subgroup_invocation_id less than this invocation. - * - * @tsl - * @method - * @param {number} e - The value provided to the exclusive scan by the current invocation. - * @return {number} The accumulated result of the exclusive scan operation. - */ -export const subgroupExclusiveMul: any; -/** - * A reduction that performs a bitwise and of e among all active invocations and returns that result. - * - * @tsl - * @method - * @param {number} e - The value provided to the reduction by the current invocation. - * @return {number} The result of the reduction operation. - */ -export const subgroupAnd: any; -/** - * A reduction that performs a bitwise or of e among all active invocations and returns that result. - * - * @tsl - * @method - * @param {number} e - The value provided to the reduction by the current invocation. - * @return {number} The result of the reduction operation. - */ -export const subgroupOr: any; -/** - * A reduction that performs a bitwise xor of e among all active invocations and returns that result. - * - * @tsl - * @method - * @param {number} e - The value provided to the reduction by the current invocation. - * @return {number} The result of the reduction operation. - */ -export const subgroupXor: any; -/** - * A reduction that performs a min of e among all active invocations and returns that result. - * - * @tsl - * @method - * @param {number} e - The value provided to the reduction by the current invocation. - * @return {number} The result of the reduction operation. - */ -export const subgroupMin: any; -/** - * A reduction that performs a max of e among all active invocations and returns that result. - * - * @tsl - * @method - * @param {number} e - The value provided to the reduction by the current invocation. - * @return {number} The result of the reduction operation. - */ -export const subgroupMax: any; -/** - * Returns true if e is true for all active invocations in the subgroup. - * - * @tsl - * @method - * @return {bool} The result of the computation. - */ -export const subgroupAll: any; -/** - * Returns true if e is true for any active invocation in the subgroup - * - * @tsl - * @method - * @return {bool} The result of the computation. - */ -export const subgroupAny: any; -/** - * Broadcasts e from the active invocation with the lowest subgroup_invocation_id in the subgroup to all other active invocations. - * - * @tsl - * @method - * @param {number} e - The value to broadcast from the lowest subgroup invocation. - * @param {number} id - The subgroup invocation to broadcast from. - * @return {number} The broadcast value. - */ -export const subgroupBroadcastFirst: any; -/** - * Swaps e between invocations in the quad in the X direction. - * - * @tsl - * @method - * @param {number} e - The value to swap from the current invocation. - * @return {number} The value received from the swap operation. - */ -export const quadSwapX: any; -/** - * Swaps e between invocations in the quad in the Y direction. - * - * @tsl - * @method - * @param {number} e - The value to swap from the current invocation. - * @return {number} The value received from the swap operation. - */ -export const quadSwapY: any; -/** - * Swaps e between invocations in the quad diagonally. - * - * @tsl - * @method - * @param {number} e - The value to swap from the current invocation. - * @return {number} The value received from the swap operation. - */ -export const quadSwapDiagonal: any; -/** - * Broadcasts e from the invocation whose subgroup_invocation_id matches id, to all active invocations. - * - * @tsl - * @method - * @param {number} e - The value to broadcast from subgroup invocation 'id'. - * @param {number} id - The subgroup invocation to broadcast from. - * @return {number} The broadcast value. - */ -export const subgroupBroadcast: any; -/** - * Returns v from the active invocation whose subgroup_invocation_id matches id - * - * @tsl - * @method - * @param {number} v - The value to return from subgroup invocation id^mask. - * @param {number} id - The subgroup invocation which returns the value v. - * @return {number} The broadcast value. - */ -export const subgroupShuffle: any; -/** - * Returns v from the active invocation whose subgroup_invocation_id matches subgroup_invocation_id ^ mask. - * - * @tsl - * @method - * @param {number} v - The value to return from subgroup invocation id^mask. - * @param {number} mask - A bitmask that determines the target invocation via a XOR operation. - * @return {number} The broadcast value. - */ -export const subgroupShuffleXor: any; -/** - * Returns v from the active invocation whose subgroup_invocation_id matches subgroup_invocation_id - delta - * - * @tsl - * @method - * @param {number} v - The value to return from subgroup invocation id^mask. - * @param {number} delta - A value that offsets the current in. - * @return {number} The broadcast value. - */ -export const subgroupShuffleUp: any; -/** - * Returns v from the active invocation whose subgroup_invocation_id matches subgroup_invocation_id + delta - * - * @tsl - * @method - * @param {number} v - The value to return from subgroup invocation id^mask. - * @param {number} delta - A value that offsets the current subgroup invocation. - * @return {number} The broadcast value. - */ -export const subgroupShuffleDown: any; -/** - * Broadcasts e from the quad invocation with id equal to id. - * - * @tsl - * @method - * @param {number} e - The value to broadcast. - * @return {number} The broadcast value. - */ -export const quadBroadcast: any; -/** - * This class represents a set of built in WGSL shader functions that sync - * synchronously execute an operation across a subgroup, or 'warp', of compute - * or fragment shader invocations within a workgroup. Typically, these functions - * will synchronously execute an operation using data from all active invocations - * within the subgroup, then broadcast that result to all active invocations. In - * other graphics APIs, subgroup functions are also referred to as wave intrinsics - * (DirectX/HLSL) or warp intrinsics (CUDA). - * - * @augments TempNode - */ -declare class SubgroupFunctionNode extends TempNode { - /** - * Constructs a new function node. - * - * @param {string} method - The subgroup/wave intrinsic method to construct. - * @param {Node} [aNode=null] - The method's first argument. - * @param {Node} [bNode=null] - The method's second argument. - */ - constructor(method: string, aNode?: Node, bNode?: Node); - /** - * The subgroup/wave intrinsic method to construct. - * - * @type {string} - */ - method: string; - /** - * The method's first argument. - * - * @type {Node} - */ - aNode: Node; - /** - * The method's second argument. - * - * @type {Node} - */ - bNode: Node; - getInputType(builder: any): any; - generateNodeType(builder: any): any; - generate(builder: any, output: any): any; - serialize(data: any): void; - deserialize(data: any): void; -} -declare namespace SubgroupFunctionNode { - let SUBGROUP_ELECT: string; - let SUBGROUP_BALLOT: string; - let SUBGROUP_ADD: string; - let SUBGROUP_INCLUSIVE_ADD: string; - let SUBGROUP_EXCLUSIVE_AND: string; - let SUBGROUP_MUL: string; - let SUBGROUP_INCLUSIVE_MUL: string; - let SUBGROUP_EXCLUSIVE_MUL: string; - let SUBGROUP_AND: string; - let SUBGROUP_OR: string; - let SUBGROUP_XOR: string; - let SUBGROUP_MIN: string; - let SUBGROUP_MAX: string; - let SUBGROUP_ALL: string; - let SUBGROUP_ANY: string; - let SUBGROUP_BROADCAST_FIRST: string; - let QUAD_SWAP_X: string; - let QUAD_SWAP_Y: string; - let QUAD_SWAP_DIAGONAL: string; - let SUBGROUP_BROADCAST: string; - let SUBGROUP_SHUFFLE: string; - let SUBGROUP_SHUFFLE_XOR: string; - let SUBGROUP_SHUFFLE_UP: string; - let SUBGROUP_SHUFFLE_DOWN: string; - let QUAD_BROADCAST: string; -} -import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/gpgpu/WorkgroupInfoNode.d.ts b/jsdoc-testing/jsdoc/nodes/gpgpu/WorkgroupInfoNode.d.ts deleted file mode 100644 index 2d1de77bc..000000000 --- a/jsdoc-testing/jsdoc/nodes/gpgpu/WorkgroupInfoNode.d.ts +++ /dev/null @@ -1,119 +0,0 @@ -export default WorkgroupInfoNode; -export function workgroupArray(type: string, count?: number): WorkgroupInfoNode; -/** - * A node allowing the user to create a 'workgroup' scoped buffer within the - * context of a compute shader. Typically, workgroup scoped buffers are - * created to hold data that is transferred from a global storage scope into - * a local workgroup scope. For invocations within a workgroup, data - * access speeds on 'workgroup' scoped buffers can be significantly faster - * than similar access operations on globally accessible storage buffers. - * - * This node can only be used with a WebGPU backend. - * - * @augments Node - */ -declare class WorkgroupInfoNode extends Node { - /** - * Constructs a new buffer scoped to type scope. - * - * @param {string} scope - TODO. - * @param {string} bufferType - The data type of a 'workgroup' scoped buffer element. - * @param {number} [bufferCount=0] - The number of elements in the buffer. - */ - constructor(scope: string, bufferType: string, bufferCount?: number); - /** - * The buffer type. - * - * @type {string} - */ - bufferType: string; - /** - * The buffer count. - * - * @type {number} - * @default 0 - */ - bufferCount: number; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isWorkgroupInfoNode: boolean; - /** - * The data type of the array buffer. - * - * @type {string} - */ - elementType: string; - /** - * TODO. - * - * @type {string} - */ - scope: string; - /** - * Sets the name of this node. - * - * @param {string} name - The name to set. - * @return {WorkgroupInfoNode} A reference to this node. - */ - setName(name: string): WorkgroupInfoNode; - /** - * Sets the name/label of this node. - * - * @deprecated - * @param {string} name - The name to set. - * @return {WorkgroupInfoNode} A reference to this node. - */ - label(name: string): WorkgroupInfoNode; - /** - * Sets the scope of this node. - * - * @param {string} scope - The scope to set. - * @return {WorkgroupInfoNode} A reference to this node. - */ - setScope(scope: string): WorkgroupInfoNode; - /** - * The data type of the array buffer. - * - * @return {string} The element type. - */ - getElementType(): string; - /** - * Overwrites the default implementation since the input type - * is inferred from the scope. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The input type. - */ - getInputType(): string; - /** - * This method can be used to access elements via an index node. - * - * @param {IndexNode} indexNode - indexNode. - * @return {WorkgroupInfoElementNode} A reference to an element. - */ - element(indexNode: IndexNode): WorkgroupInfoElementNode; - generate(builder: any): any; -} -import Node from '../core/Node.js'; -/** - * Represents an element of a 'workgroup' scoped buffer. - * - * @augments ArrayElementNode - */ -declare class WorkgroupInfoElementNode extends ArrayElementNode { - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isWorkgroupInfoElementNode: boolean; - generate(builder: any, output: any): any; -} -import ArrayElementNode from '../utils/ArrayElementNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/AONode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/AONode.d.ts deleted file mode 100644 index 5c4e49ae2..000000000 --- a/jsdoc-testing/jsdoc/nodes/lighting/AONode.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -export default AONode; -/** - * A generic class that can be used by nodes which contribute - * ambient occlusion to the scene. E.g. an ambient occlusion map - * node can be used as input for this module. Used in {@link NodeMaterial}. - * - * @augments LightingNode - */ -declare class AONode extends LightingNode { - /** - * Constructs a new AO node. - * - * @param {?Node} [aoNode=null] - The ambient occlusion node. - */ - constructor(aoNode?: Node | null); - /** - * The ambient occlusion node. - * - * @type {?Node} - * @default null - */ - aoNode: Node | null; - setup(builder: any): void; -} -import LightingNode from './LightingNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/AmbientLightNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/AmbientLightNode.d.ts deleted file mode 100644 index 5705b1d91..000000000 --- a/jsdoc-testing/jsdoc/nodes/lighting/AmbientLightNode.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -export default AmbientLightNode; -/** - * Module for representing ambient lights as nodes. - * - * @augments AnalyticLightNode - */ -declare class AmbientLightNode extends AnalyticLightNode { - setup({ context }: { - context: any; - }): void; -} -import AnalyticLightNode from './AnalyticLightNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/AnalyticLightNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/AnalyticLightNode.d.ts deleted file mode 100644 index e1c0209aa..000000000 --- a/jsdoc-testing/jsdoc/nodes/lighting/AnalyticLightNode.d.ts +++ /dev/null @@ -1,127 +0,0 @@ -export default AnalyticLightNode; -/** - * Base class for analytic light nodes. - * - * @augments LightingNode - */ -declare class AnalyticLightNode extends LightingNode { - /** - * Constructs a new analytic light node. - * - * @param {?Light} [light=null] - The light source. - */ - constructor(light?: Light | null); - /** - * The light source. - * - * @type {?Light} - * @default null - */ - light: Light | null; - /** - * The light's color value. - * - * @type {Color} - */ - color: Color; - /** - * The light's color node. Points to `colorNode` of the light source, if set. Otherwise - * it creates a uniform node based on {@link AnalyticLightNode#color}. - * - * @type {Node} - */ - colorNode: Node; - /** - * This property is used to retain a reference to the original value of {@link AnalyticLightNode#colorNode}. - * The final color node is represented by a different node when using shadows. - * - * @type {?Node} - * @default null - */ - baseColorNode: Node | null; - /** - * Represents the light's shadow. - * - * @type {?ShadowNode} - * @default null - */ - shadowNode: ShadowNode | null; - /** - * Represents the light's shadow color. - * - * @type {?Node} - * @default null - */ - shadowColorNode: Node | null; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isAnalyticLightNode: boolean; - _shadowDisposeListener: (() => void) | undefined; - /** - * Frees internal resources related to shadows. - */ - disposeShadow(): void; - getHash(): any; - /** - * Returns a node representing a direction vector which points from the current - * position in view space to the light's position in view space. - * - * @param {NodeBuilder} builder - The builder object used for setting up the light. - * @return {Node} The light vector node. - */ - getLightVector(builder: NodeBuilder): Node; - /** - * Sets up the direct lighting for the analytic light node. - * - * @abstract - * @param {NodeBuilder} builder - The builder object used for setting up the light. - * @return {Object|undefined} The direct light data (color and direction). - */ - setupDirect(): Object | undefined; - /** - * Sets up the direct rect area lighting for the analytic light node. - * - * @abstract - * @param {NodeBuilder} builder - The builder object used for setting up the light. - * @return {Object|undefined} The direct rect area light data. - */ - setupDirectRectArea(): Object | undefined; - /** - * Setups the shadow node for this light. The method exists so concrete light classes - * can setup different types of shadow nodes. - * - * @return {ShadowNode} The created shadow node. - */ - setupShadowNode(): ShadowNode; - /** - * Setups the shadow for this light. This method is only executed if the light - * cast shadows and the current build object receives shadows. It incorporates - * shadows into the lighting computation. - * - * @param {NodeBuilder} builder - The current node builder. - */ - setupShadow(builder: NodeBuilder): void; - /** - * Unlike most other nodes, lighting nodes do not return a output node in {@link Node#setup}. - * The main purpose of lighting nodes is to configure the current {@link LightingModel} and/or - * invocate the respective interface methods. - * - * @param {NodeBuilder} builder - The current node builder. - */ - setup(builder: NodeBuilder): void; - /** - * The update method is used to update light uniforms per frame. - * Potentially overwritten in concrete light nodes to update light - * specific uniforms. - * - * @param {NodeFrame} frame - A reference to the current node frame. - */ - update(): void; -} -import LightingNode from './LightingNode.js'; -import { Color } from '../../math/Color.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/BasicEnvironmentNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/BasicEnvironmentNode.d.ts deleted file mode 100644 index 701118341..000000000 --- a/jsdoc-testing/jsdoc/nodes/lighting/BasicEnvironmentNode.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -export default BasicEnvironmentNode; -/** - * Represents a basic model for Image-based lighting (IBL). The environment - * is defined via environment maps in the equirectangular or cube map format. - * `BasicEnvironmentNode` is intended for non-PBR materials like {@link MeshBasicNodeMaterial} - * or {@link MeshPhongNodeMaterial}. - * - * @augments LightingNode - */ -declare class BasicEnvironmentNode extends LightingNode { - /** - * Constructs a new basic environment node. - * - * @param {Node} [envNode=null] - A node representing the environment. - */ - constructor(envNode?: Node); - /** - * A node representing the environment. - * - * @type {Node} - * @default null - */ - envNode: Node; - setup(builder: any): void; -} -import LightingNode from './LightingNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/BasicLightMapNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/BasicLightMapNode.d.ts deleted file mode 100644 index b5173c497..000000000 --- a/jsdoc-testing/jsdoc/nodes/lighting/BasicLightMapNode.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -export default BasicLightMapNode; -/** - * A specific version of {@link IrradianceNode} that is only relevant - * for {@link MeshBasicNodeMaterial}. Since the material is unlit, it - * requires a special scaling factor for the light map. - * - * @augments LightingNode - */ -declare class BasicLightMapNode extends LightingNode { - /** - * Constructs a new basic light map node. - * - * @param {?Node} [lightMapNode=null] - The light map node. - */ - constructor(lightMapNode?: Node | null); - /** - * The light map node. - * - * @type {?Node} - */ - lightMapNode: Node | null; - setup(builder: any): void; -} -import LightingNode from './LightingNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/DirectionalLightNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/DirectionalLightNode.d.ts deleted file mode 100644 index 723a2afc6..000000000 --- a/jsdoc-testing/jsdoc/nodes/lighting/DirectionalLightNode.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -export default DirectionalLightNode; -/** - * Module for representing directional lights as nodes. - * - * @augments AnalyticLightNode - */ -declare class DirectionalLightNode extends AnalyticLightNode { - setupDirect(): { - lightDirection: any; - lightColor: Node; - }; -} -import AnalyticLightNode from './AnalyticLightNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/EnvironmentNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/EnvironmentNode.d.ts deleted file mode 100644 index 6b87431fc..000000000 --- a/jsdoc-testing/jsdoc/nodes/lighting/EnvironmentNode.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -export default EnvironmentNode; -/** - * Represents a physical model for Image-based lighting (IBL). The environment - * is defined via environment maps in the equirectangular, cube map or cubeUV (PMREM) format. - * `EnvironmentNode` is intended for PBR materials like {@link MeshStandardNodeMaterial}. - * - * @augments LightingNode - */ -declare class EnvironmentNode extends LightingNode { - /** - * Constructs a new environment node. - * - * @param {Node} [envNode=null] - A node representing the environment. - */ - constructor(envNode?: Node); - /** - * A node representing the environment. - * - * @type {?Node} - * @default null - */ - envNode: Node | null; - setup(builder: any): void; - /** - * Returns the PMREM node cache of the current renderer. - * - * @private - * @param {Renderer} renderer - The current renderer. - * @return {WeakMap} The node cache. - */ - private _getPMREMNodeCache; -} -import LightingNode from './LightingNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/HemisphereLightNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/HemisphereLightNode.d.ts deleted file mode 100644 index 6612f6067..000000000 --- a/jsdoc-testing/jsdoc/nodes/lighting/HemisphereLightNode.d.ts +++ /dev/null @@ -1,34 +0,0 @@ -export default HemisphereLightNode; -/** - * Module for representing hemisphere lights as nodes. - * - * @augments AnalyticLightNode - */ -declare class HemisphereLightNode extends AnalyticLightNode { - /** - * Uniform node representing the light's position. - * - * @type {UniformNode} - */ - lightPositionNode: UniformNode; - /** - * A node representing the light's direction. - * - * @type {Node} - */ - lightDirectionNode: Node; - /** - * Uniform node representing the light's ground color. - * - * @type {UniformNode} - */ - groundColorNode: UniformNode; - /** - * Overwritten to updated hemisphere light specific uniforms. - * - * @param {NodeFrame} frame - A reference to the current node frame. - */ - update(frame: NodeFrame): void; - setup(builder: any): void; -} -import AnalyticLightNode from './AnalyticLightNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/IESSpotLightNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/IESSpotLightNode.d.ts deleted file mode 100644 index ae6eeffb5..000000000 --- a/jsdoc-testing/jsdoc/nodes/lighting/IESSpotLightNode.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export default IESSpotLightNode; -/** - * An IES version of the default spot light node. - * - * @augments SpotLightNode - */ -declare class IESSpotLightNode extends SpotLightNode { -} -import SpotLightNode from './SpotLightNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/IrradianceNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/IrradianceNode.d.ts deleted file mode 100644 index 0498aea05..000000000 --- a/jsdoc-testing/jsdoc/nodes/lighting/IrradianceNode.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -export default IrradianceNode; -/** - * A generic class that can be used by nodes which contribute - * irradiance to the scene. E.g. a light map node can be used - * as input for this module. Used in {@link NodeMaterial}. - * - * @augments LightingNode - */ -declare class IrradianceNode extends LightingNode { - /** - * Constructs a new irradiance node. - * - * @param {Node} node - A node contributing irradiance. - */ - constructor(node: Node); - /** - * A node contributing irradiance. - * - * @type {Node} - */ - node: Node; - setup(builder: any): void; -} -import LightingNode from './LightingNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/LightProbeNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/LightProbeNode.d.ts deleted file mode 100644 index 02fd000fd..000000000 --- a/jsdoc-testing/jsdoc/nodes/lighting/LightProbeNode.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -export default LightProbeNode; -/** - * Module for representing light probes as nodes. - * - * @augments AnalyticLightNode - */ -declare class LightProbeNode extends AnalyticLightNode { - /** - * Light probe represented as a uniform of spherical harmonics. - * - * @type {UniformArrayNode} - */ - lightProbe: UniformArrayNode; - /** - * Overwritten to updated light probe specific uniforms. - * - * @param {NodeFrame} frame - A reference to the current node frame. - */ - update(frame: NodeFrame): void; - setup(builder: any): void; -} -import AnalyticLightNode from './AnalyticLightNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/LightUtils.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/LightUtils.d.ts deleted file mode 100644 index 9a60548b3..000000000 --- a/jsdoc-testing/jsdoc/nodes/lighting/LightUtils.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Represents a `discard` shader operation in TSL. - * - * @method - * @param {Object} inputs - The input parameter object. - * @param {Node} inputs.lightDistance - The distance of the light's position to the current fragment position. - * @param {Node} inputs.cutoffDistance - The light's cutoff distance. - * @param {Node} inputs.decayExponent - The light's decay exponent. - * @return {Node} The distance falloff. - */ -export const getDistanceAttenuation: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/LightingContextNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/LightingContextNode.d.ts deleted file mode 100644 index 2917f05e4..000000000 --- a/jsdoc-testing/jsdoc/nodes/lighting/LightingContextNode.d.ts +++ /dev/null @@ -1,83 +0,0 @@ -export default LightingContextNode; -export const lightingContext: any; -/** - * `LightingContextNode` represents an extension of the {@link ContextNode} module - * by adding lighting specific context data. It represents the runtime context of - * {@link LightsNode}. - * - * @augments ContextNode - */ -declare class LightingContextNode extends ContextNode { - /** - * Constructs a new lighting context node. - * - * @param {LightsNode} lightsNode - The lights node. - * @param {?LightingModel} [lightingModel=null] - The current lighting model. - * @param {?Node} [backdropNode=null] - A backdrop node. - * @param {?Node} [backdropAlphaNode=null] - A backdrop alpha node. - */ - constructor(lightsNode: LightsNode, lightingModel?: LightingModel | null, backdropNode?: Node | null, backdropAlphaNode?: Node | null); - /** - * The current lighting model. - * - * @type {?LightingModel} - * @default null - */ - lightingModel: LightingModel | null; - /** - * A backdrop node. - * - * @type {?Node} - * @default null - */ - backdropNode: Node | null; - /** - * A backdrop alpha node. - * - * @type {?Node} - * @default null - */ - backdropAlphaNode: Node | null; - _value: { - radiance: Node; - irradiance: Node; - iblIrradiance: Node; - ambientOcclusion: Node; - reflectedLight: { - directDiffuse: Node; - directSpecular: Node; - indirectDiffuse: Node; - indirectSpecular: Node; - }; - backdrop: Node; - backdropAlpha: Node; - } | null; - /** - * Returns a lighting context object. - * - * @return {{ - * radiance: Node, - * irradiance: Node, - * iblIrradiance: Node, - * ambientOcclusion: Node, - * reflectedLight: {directDiffuse: Node, directSpecular: Node, indirectDiffuse: Node, indirectSpecular: Node}, - * backdrop: Node, - * backdropAlpha: Node - * }} The lighting context object. - */ - getContext(): { - radiance: Node; - irradiance: Node; - iblIrradiance: Node; - ambientOcclusion: Node; - reflectedLight: { - directDiffuse: Node; - directSpecular: Node; - indirectDiffuse: Node; - indirectSpecular: Node; - }; - backdrop: Node; - backdropAlpha: Node; - }; -} -import ContextNode from '../core/ContextNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/LightingNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/LightingNode.d.ts deleted file mode 100644 index adc145155..000000000 --- a/jsdoc-testing/jsdoc/nodes/lighting/LightingNode.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -export default LightingNode; -/** - * Base class for lighting nodes. - * - * @augments Node - */ -declare class LightingNode extends Node { - /** - * Constructs a new lighting node. - */ - constructor(); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isLightingNode: boolean; -} -import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/LightsNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/LightsNode.d.ts deleted file mode 100644 index 6ecec5a31..000000000 --- a/jsdoc-testing/jsdoc/nodes/lighting/LightsNode.d.ts +++ /dev/null @@ -1,119 +0,0 @@ -export default LightsNode; -export function lights(lights?: Array): LightsNode; -/** - * This node represents the scene's lighting and manages the lighting model's life cycle - * for the current build 3D object. It is responsible for computing the total outgoing - * light in a given lighting context. - * - * @augments Node - */ -declare class LightsNode extends Node { - /** - * Constructs a new lights node. - */ - constructor(); - /** - * A node representing the total diffuse light. - * - * @type {Node} - */ - totalDiffuseNode: Node; - /** - * A node representing the total specular light. - * - * @type {Node} - */ - totalSpecularNode: Node; - /** - * A node representing the outgoing light. - * - * @type {Node} - */ - outgoingLightNode: Node; - /** - * An array representing the lights in the scene. - * - * @private - * @type {Array} - */ - private _lights; - /** - * For each light in the scene, this node will create a - * corresponding light node. - * - * @private - * @type {?Array} - * @default null - */ - private _lightNodes; - /** - * A hash for identifying the current light nodes setup. - * - * @private - * @type {?string} - * @default null - */ - private _lightNodesHash; - /** - * Computes a hash value for identifying the current light nodes setup. - * - * @param {NodeBuilder} builder - A reference to the current node builder. - * @return {string} The computed hash. - */ - getHash(builder: NodeBuilder): string; - analyze(builder: any): void; - /** - * Creates lighting nodes for each scene light. This makes it possible to further - * process lights in the node system. - * - * @param {NodeBuilder} builder - A reference to the current node builder. - */ - setupLightsNode(builder: NodeBuilder): void; - /** - * Sets up a direct light in the lighting model. - * - * @param {Object} builder - The builder object containing the context and stack. - * @param {Object} lightNode - The light node. - * @param {Object} lightData - The light object containing color and direction properties. - */ - setupDirectLight(builder: Object, lightNode: Object, lightData: Object): void; - setupDirectRectAreaLight(builder: any, lightNode: any, lightData: any): void; - /** - * Setups the internal lights by building all respective - * light nodes. - * - * @param {NodeBuilder} builder - A reference to the current node builder. - * @param {Array} lightNodes - An array of lighting nodes. - */ - setupLights(builder: NodeBuilder, lightNodes: Array): void; - getLightNodes(builder: any): LightingNode[] | null; - /** - * The implementation makes sure that for each light in the scene - * there is a corresponding light node. By building the light nodes - * and evaluating the lighting model the outgoing light is computed. - * - * @param {NodeBuilder} builder - A reference to the current node builder. - * @return {Node} A node representing the outgoing light. - */ - setup(builder: NodeBuilder): Node; - /** - * Configures this node with an array of lights. - * - * @param {Array} lights - An array of lights. - * @return {LightsNode} A reference to this node. - */ - setLights(lights: Array): LightsNode; - /** - * Returns an array of the scene's lights. - * - * @return {Array} The scene's lights. - */ - getLights(): Array; - /** - * Whether the scene has lights or not. - * - * @type {boolean} - */ - get hasLights(): boolean; -} -import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/PointLightNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/PointLightNode.d.ts deleted file mode 100644 index 4dee5e49c..000000000 --- a/jsdoc-testing/jsdoc/nodes/lighting/PointLightNode.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -export function directPointLight({ color, lightVector, cutoffDistance, decayExponent }: { - color: any; - lightVector: any; - cutoffDistance: any; - decayExponent: any; -}): { - lightDirection: any; - lightColor: any; -}; -export default PointLightNode; -/** - * Module for representing point lights as nodes. - * - * @augments AnalyticLightNode - */ -declare class PointLightNode extends AnalyticLightNode { - /** - * Uniform node representing the cutoff distance. - * - * @type {UniformNode} - */ - cutoffDistanceNode: UniformNode; - /** - * Uniform node representing the decay exponent. - * - * @type {UniformNode} - */ - decayExponentNode: UniformNode; - /** - * Overwritten to updated point light specific uniforms. - * - * @param {NodeFrame} frame - A reference to the current node frame. - */ - update(frame: NodeFrame): void; - setupDirect(builder: any): { - lightDirection: any; - lightColor: any; - }; -} -import AnalyticLightNode from './AnalyticLightNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/PointShadowNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/PointShadowNode.d.ts deleted file mode 100644 index 6215b48a3..000000000 --- a/jsdoc-testing/jsdoc/nodes/lighting/PointShadowNode.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -export const BasicPointShadowFilter: () => void; -/** - * A shadow filtering function for point lights using Vogel disk sampling and IGN. - * - * Uses 5 samples distributed via Vogel disk pattern in tangent space around the - * sample direction, rotated per-pixel using Interleaved Gradient Noise (IGN). - * - * @method - * @param {Object} inputs - The input parameter object. - * @param {CubeDepthTexture} inputs.depthTexture - A reference to the shadow cube map. - * @param {Node} inputs.bd3D - The normalized direction from light to fragment. - * @param {Node} inputs.dp - The depth value to compare against. - * @param {LightShadow} inputs.shadow - The light shadow. - * @return {Node} The filtering result. - */ -export const PointShadowFilter: () => void; -export default PointShadowNode; -export function pointShadow(light: PointLight, shadow?: PointLightShadow | null): PointShadowNode; -/** - * Represents the shadow implementation for point light nodes. - * - * @augments ShadowNode - */ -declare class PointShadowNode extends ShadowNode { - /** - * Overwrites the default implementation to only use point light specific - * shadow filter functions. - * - * @param {NodeBuilder} builder - A reference to the current node builder. - * @param {Object} inputs - A configuration object that defines the shadow filtering. - * @param {Function} inputs.filterFn - This function defines the filtering type of the shadow map e.g. PCF. - * @param {DepthTexture} inputs.depthTexture - A reference to the shadow map's depth texture. - * @param {Node} inputs.shadowCoord - Shadow coordinates which are used to sample from the shadow map. - * @param {LightShadow} inputs.shadow - The light shadow. - * @return {Node} The result node of the shadow filtering. - */ - setupShadowFilter(builder: NodeBuilder, { filterFn, depthTexture, shadowCoord, shadow }: { - filterFn: Function; - depthTexture: DepthTexture; - shadowCoord: Node; - shadow: LightShadow; - }): Node; - /** - * Overwrites the default implementation to create a CubeRenderTarget with CubeDepthTexture. - * - * @param {LightShadow} shadow - The light shadow object. - * @param {NodeBuilder} builder - A reference to the current node builder. - * @return {Object} An object containing the shadow map and depth texture. - */ - setupRenderTarget(shadow: LightShadow, builder: NodeBuilder): Object; -} -import ShadowNode from './ShadowNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/ProjectorLightNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/ProjectorLightNode.d.ts deleted file mode 100644 index 22f3ffe8b..000000000 --- a/jsdoc-testing/jsdoc/nodes/lighting/ProjectorLightNode.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -export default ProjectorLightNode; -/** - * An implementation of a projector light node. - * - * @augments SpotLightNode - */ -declare class ProjectorLightNode extends SpotLightNode { - update(frame: any): void; - /** - * Overwrites the default implementation to compute projection attenuation. - * - * @param {NodeBuilder} builder - The node builder. - * @return {Node} The spot attenuation. - */ - getSpotAttenuation(builder: NodeBuilder): Node; -} -import SpotLightNode from './SpotLightNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/RectAreaLightNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/RectAreaLightNode.d.ts deleted file mode 100644 index 0b4d56420..000000000 --- a/jsdoc-testing/jsdoc/nodes/lighting/RectAreaLightNode.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -export default RectAreaLightNode; -/** - * Module for representing rect area lights as nodes. - * - * @augments AnalyticLightNode - */ -declare class RectAreaLightNode extends AnalyticLightNode { - /** - * Used to configure the internal BRDF approximation texture data. - * - * @param {RectAreaLightTexturesLib} ltc - The BRDF approximation texture data. - */ - static setLTC(ltc: RectAreaLightTexturesLib): void; - /** - * Uniform node representing the half height of the are light. - * - * @type {UniformNode} - */ - halfHeight: UniformNode; - /** - * Uniform node representing the half width of the are light. - * - * @type {UniformNode} - */ - halfWidth: UniformNode; - /** - * Overwritten to updated rect area light specific uniforms. - * - * @param {NodeFrame} frame - A reference to the current node frame. - */ - update(frame: NodeFrame): void; - setupDirectRectArea(builder: any): { - lightColor: Node; - lightPosition: UniformNode; - halfWidth: UniformNode; - halfHeight: UniformNode; - ltc_1: import("../accessors/TextureNode.js").default; - ltc_2: import("../accessors/TextureNode.js").default; - }; -} -import AnalyticLightNode from './AnalyticLightNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/ShadowBaseNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/ShadowBaseNode.d.ts deleted file mode 100644 index fbbfa5fd2..000000000 --- a/jsdoc-testing/jsdoc/nodes/lighting/ShadowBaseNode.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * TSL object that represents the vertex position in world space during the shadow pass. - * - * @tsl - * @type {Node} - */ -export const shadowPositionWorld: Node; -export default ShadowBaseNode; -import Node from '../core/Node.js'; -/** - * Base class for all shadow nodes. - * - * Shadow nodes encapsulate shadow related logic and are always coupled to lighting nodes. - * Lighting nodes might share the same shadow node type or use specific ones depending on - * their requirements. - * - * @augments Node - */ -declare class ShadowBaseNode extends Node { - /** - * Constructs a new shadow base node. - * - * @param {Light} light - The shadow casting light. - */ - constructor(light: Light); - /** - * The shadow casting light. - * - * @type {Light} - */ - light: Light; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isShadowBaseNode: boolean; - /** - * Setups the shadow position node which is by default the predefined TSL node object `shadowPositionWorld`. - * - * @param {NodeBuilder} object - A configuration object that must at least hold a material reference. - */ - setupShadowPosition({ context, material }: NodeBuilder): void; -} diff --git a/jsdoc-testing/jsdoc/nodes/lighting/ShadowFilterNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/ShadowFilterNode.d.ts deleted file mode 100644 index 2fb0664f6..000000000 --- a/jsdoc-testing/jsdoc/nodes/lighting/ShadowFilterNode.d.ts +++ /dev/null @@ -1,50 +0,0 @@ -/** - * A shadow filtering function performing basic filtering. This is in fact an unfiltered version of the shadow map - * with a binary `[0,1]` result. - * - * @method - * @param {Object} inputs - The input parameter object. - * @param {DepthTexture} inputs.depthTexture - A reference to the shadow map's texture data. - * @param {Node} inputs.shadowCoord - The shadow coordinates. - * @return {Node} The filtering result. - */ -export const BasicShadowFilter: () => void; -/** - * A shadow filtering function performing PCF filtering with Vogel disk sampling and IGN. - * - * Uses 5 samples distributed via Vogel disk pattern, rotated per-pixel using Interleaved - * Gradient Noise (IGN) to break up banding artifacts. Combined with hardware PCF (4-tap - * filtering per sample), this effectively provides 20 filtered taps with better distribution. - * - * @method - * @param {Object} inputs - The input parameter object. - * @param {DepthTexture} inputs.depthTexture - A reference to the shadow map's texture data. - * @param {Node} inputs.shadowCoord - The shadow coordinates. - * @param {LightShadow} inputs.shadow - The light shadow. - * @return {Node} The filtering result. - */ -export const PCFShadowFilter: () => void; -/** - * A shadow filtering function performing PCF soft filtering. - * - * @method - * @param {Object} inputs - The input parameter object. - * @param {DepthTexture} inputs.depthTexture - A reference to the shadow map's texture data. - * @param {Node} inputs.shadowCoord - The shadow coordinates. - * @param {LightShadow} inputs.shadow - The light shadow. - * @return {Node} The filtering result. - */ -export const PCFSoftShadowFilter: () => void; -/** - * A shadow filtering function performing VSM filtering. - * - * @method - * @param {Object} inputs - The input parameter object. - * @param {DepthTexture} inputs.depthTexture - A reference to the shadow map's texture data. - * @param {Node} inputs.shadowCoord - The shadow coordinates. - * @return {Node} The filtering result. - */ -export const VSMShadowFilter: () => void; -export function getShadowMaterial(light: Light): NodeMaterial; -export function disposeShadowMaterial(light: Light): void; -import NodeMaterial from '../../materials/nodes/NodeMaterial.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/ShadowNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/ShadowNode.d.ts deleted file mode 100644 index d98fa7418..000000000 --- a/jsdoc-testing/jsdoc/nodes/lighting/ShadowNode.d.ts +++ /dev/null @@ -1,193 +0,0 @@ -export function getShadowRenderObjectFunction(renderer: Renderer, shadow: LightShadow, shadowType: number, useVelocity: boolean): shadowRenderObjectFunction; -export default ShadowNode; -export function shadow(light: Light, shadow?: LightShadow | null): ShadowNode; -/** - * Represents the default shadow implementation for lighting nodes. - * - * @augments ShadowBaseNode - */ -declare class ShadowNode extends ShadowBaseNode { - /** - * Constructs a new shadow node. - * - * @param {Light} light - The shadow casting light. - * @param {?LightShadow} [shadow=null] - An optional light shadow. - */ - constructor(light: Light, shadow?: LightShadow | null); - /** - * The light shadow which defines the properties light's - * shadow. - * - * @type {?LightShadow} - * @default null - */ - shadow: LightShadow | null; - /** - * A reference to the shadow map which is a render target. - * - * @type {?RenderTarget} - * @default null - */ - shadowMap: RenderTarget | null; - /** - * Only relevant for VSM shadows. Render target for the - * first VSM render pass. - * - * @type {?RenderTarget} - * @default null - */ - vsmShadowMapVertical: RenderTarget | null; - /** - * Only relevant for VSM shadows. Render target for the - * second VSM render pass. - * - * @type {?RenderTarget} - * @default null - */ - vsmShadowMapHorizontal: RenderTarget | null; - /** - * Only relevant for VSM shadows. Node material which - * is used to render the first VSM pass. - * - * @type {?NodeMaterial} - * @default null - */ - vsmMaterialVertical: NodeMaterial | null; - /** - * Only relevant for VSM shadows. Node material which - * is used to render the second VSM pass. - * - * @type {?NodeMaterial} - * @default null - */ - vsmMaterialHorizontal: NodeMaterial | null; - /** - * A reference to the output node which defines the - * final result of this shadow node. - * - * @type {?Node} - * @private - * @default null - */ - private _node; - /** - * The current shadow map type of this shadow node. - * - * @type {?number} - * @private - * @default null - */ - private _currentShadowType; - /** - * A Weak Map holding the current frame ID per camera. Used - * to control the update of shadow maps. - * - * @type {WeakMap} - * @private - */ - private _cameraFrameId; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isShadowNode: boolean; - /** - * This index can be used when overriding setupRenderTarget with a RenderTarget Array to specify the depth layer. - * - * @type {number} - * @readonly - * @default true - */ - readonly depthLayer: number; - /** - * Setups the shadow filtering. - * - * @param {NodeBuilder} builder - A reference to the current node builder. - * @param {Object} inputs - A configuration object that defines the shadow filtering. - * @param {Function} inputs.filterFn - This function defines the filtering type of the shadow map e.g. PCF. - * @param {DepthTexture} inputs.depthTexture - A reference to the shadow map's texture data. - * @param {Node} inputs.shadowCoord - Shadow coordinates which are used to sample from the shadow map. - * @param {LightShadow} inputs.shadow - The light shadow. - * @return {Node} The result node of the shadow filtering. - */ - setupShadowFilter(builder: NodeBuilder, { filterFn, depthTexture, shadowCoord, shadow, depthLayer }: { - filterFn: Function; - depthTexture: DepthTexture; - shadowCoord: Node; - shadow: LightShadow; - }): Node; - /** - * Setups the shadow coordinates. - * - * @param {NodeBuilder} builder - A reference to the current node builder. - * @param {Node} shadowPosition - A node representing the shadow position. - * @return {Node} The shadow coordinates. - */ - setupShadowCoord(builder: NodeBuilder, shadowPosition: Node): Node; - /** - * Returns the shadow filtering function for the given shadow type. - * - * @param {number} type - The shadow type. - * @return {Function} The filtering function. - */ - getShadowFilterFn(type: number): Function; - setupRenderTarget(shadow: any, builder: any): { - shadowMap: any; - depthTexture: DepthTexture; - }; - /** - * Setups the shadow output node. - * - * @param {NodeBuilder} builder - A reference to the current node builder. - * @return {Node} The shadow output node. - */ - setupShadow(builder: NodeBuilder): Node; - /** - * The implementation performs the setup of the output node. An output is only - * produces if shadow mapping is globally enabled in the renderer. - * - * @param {NodeBuilder} builder - A reference to the current node builder. - * @return {ShaderCallNodeInternal} The output node. - */ - setup(builder: NodeBuilder): ShaderCallNodeInternal; - /** - * Renders the shadow. The logic of this function could be included - * into {@link ShadowNode#updateShadow} however more specialized shadow - * nodes might require a custom shadow map rendering. By having a - * dedicated method, it's easier to overwrite the default behavior. - * - * @param {NodeFrame} frame - A reference to the current node frame. - */ - renderShadow(frame: NodeFrame): void; - /** - * Updates the shadow. - * - * @param {NodeFrame} frame - A reference to the current node frame. - */ - updateShadow(frame: NodeFrame): void; - _depthVersionCached: any; - /** - * For VSM additional render passes are required. - * - * @param {Renderer} renderer - A reference to the current renderer. - */ - vsmPass(renderer: Renderer): void; - /** - * Resets the resouce state of this shadow node. - * - * @private - */ - private _reset; - /** - * The implementation performs the update of the shadow map if necessary. - * - * @param {NodeFrame} frame - A reference to the current node frame. - */ - updateBefore(frame: NodeFrame): void; -} -import ShadowBaseNode from './ShadowBaseNode.js'; -import NodeMaterial from '../../materials/nodes/NodeMaterial.js'; -import { DepthTexture } from '../../textures/DepthTexture.js'; diff --git a/jsdoc-testing/jsdoc/nodes/lighting/SpotLightNode.d.ts b/jsdoc-testing/jsdoc/nodes/lighting/SpotLightNode.d.ts deleted file mode 100644 index 84f17e937..000000000 --- a/jsdoc-testing/jsdoc/nodes/lighting/SpotLightNode.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -export default SpotLightNode; -/** - * Module for representing spot lights as nodes. - * - * @augments AnalyticLightNode - */ -declare class SpotLightNode extends AnalyticLightNode { - /** - * Uniform node representing the cone cosine. - * - * @type {UniformNode} - */ - coneCosNode: UniformNode; - /** - * Uniform node representing the penumbra cosine. - * - * @type {UniformNode} - */ - penumbraCosNode: UniformNode; - /** - * Uniform node representing the cutoff distance. - * - * @type {UniformNode} - */ - cutoffDistanceNode: UniformNode; - /** - * Uniform node representing the decay exponent. - * - * @type {UniformNode} - */ - decayExponentNode: UniformNode; - /** - * Overwritten to updated spot light specific uniforms. - * - * @param {NodeFrame} frame - A reference to the current node frame. - */ - update(frame: NodeFrame): void; - /** - * Computes the spot attenuation for the given angle. - * - * @param {NodeBuilder} builder - The node builder. - * @param {Node} angleCosine - The angle to compute the spot attenuation for. - * @return {Node} The spot attenuation. - */ - getSpotAttenuation(builder: NodeBuilder, angleCosine: Node): Node; - getLightCoord(builder: any): any; - setupDirect(builder: any): { - lightColor: any; - lightDirection: any; - }; -} -import AnalyticLightNode from './AnalyticLightNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/materialx/MaterialXNodes.d.ts b/jsdoc-testing/jsdoc/nodes/materialx/MaterialXNodes.d.ts deleted file mode 100644 index c994857f8..000000000 --- a/jsdoc-testing/jsdoc/nodes/materialx/MaterialXNodes.d.ts +++ /dev/null @@ -1,44 +0,0 @@ -export function mx_aastep(threshold: any, value: any): any; -export function mx_ramplr(valuel: any, valuer: any, texcoord?: AttributeNode): any; -export function mx_ramptb(valuet: any, valueb: any, texcoord?: AttributeNode): any; -export function mx_ramp4(valuetl: any, valuetr: any, valuebl: any, valuebr: any, texcoord?: AttributeNode): any; -export function mx_splitlr(valuel: any, valuer: any, center: any, texcoord?: AttributeNode): any; -export function mx_splittb(valuet: any, valueb: any, center: any, texcoord?: AttributeNode): any; -export function mx_transform_uv(uv_scale?: number, uv_offset?: number, uv_geo?: AttributeNode): any; -export function mx_safepower(in1: any, in2?: number): any; -export function mx_contrast(input: any, amount?: number, pivot?: number): any; -export function mx_noise_float(texcoord?: AttributeNode, amplitude?: number, pivot?: number): any; -export function mx_noise_vec3(texcoord?: AttributeNode, amplitude?: number, pivot?: number): any; -export function mx_noise_vec4(texcoord?: AttributeNode, amplitude?: number, pivot?: number): any; -export function mx_unifiednoise2d(noiseType: any, texcoord?: AttributeNode, freq?: any, offset?: any, jitter?: number, outmin?: number, outmax?: number, clampoutput?: boolean, octaves?: number, lacunarity?: number, diminish?: number): any; -export function mx_unifiednoise3d(noiseType: any, texcoord?: AttributeNode, freq?: any, offset?: any, jitter?: number, outmin?: number, outmax?: number, clampoutput?: boolean, octaves?: number, lacunarity?: number, diminish?: number): any; -export function mx_worley_noise_float(texcoord?: AttributeNode, jitter?: number): any; -export function mx_worley_noise_vec2(texcoord?: AttributeNode, jitter?: number): any; -export function mx_worley_noise_vec3(texcoord?: AttributeNode, jitter?: number): any; -export function mx_cell_noise_float(texcoord?: AttributeNode): any; -export function mx_fractal_noise_float(position?: AttributeNode, octaves?: number, lacunarity?: number, diminish?: number, amplitude?: number): any; -export function mx_fractal_noise_vec2(position?: AttributeNode, octaves?: number, lacunarity?: number, diminish?: number, amplitude?: number): any; -export function mx_fractal_noise_vec3(position?: AttributeNode, octaves?: number, lacunarity?: number, diminish?: number, amplitude?: number): any; -export function mx_fractal_noise_vec4(position?: AttributeNode, octaves?: number, lacunarity?: number, diminish?: number, amplitude?: number): any; -export function mx_add(in1: any, in2?: any): any; -export function mx_subtract(in1: any, in2?: any): any; -export function mx_multiply(in1: any, in2?: any): any; -export function mx_divide(in1: any, in2?: any): any; -export function mx_modulo(in1: any, in2?: any): any; -export function mx_power(in1: any, in2?: any): any; -export function mx_atan2(in1?: any, in2?: any): any; -export function mx_timer(): UniformNode; -export function mx_frame(): UniformNode; -export function mx_invert(in1: any, amount?: any): any; -export function mx_ifgreater(value1: any, value2: any, in1: any, in2: any): any; -export function mx_ifgreatereq(value1: any, value2: any, in1: any, in2: any): any; -export function mx_ifequal(value1: any, value2: any, in1: any, in2: any): any; -export function mx_separate(in1: any, channelOrOut?: null): any; -export function mx_place2d(texcoord: any, pivot?: any, scale?: any, rotate?: any, offset?: any): any; -export function mx_rotate2d(input: any, amount: any): any; -export function mx_rotate3d(input: any, amount: any, axis: any): any; -export function mx_heighttonormal(input: any, scale: any): any; -import { mx_hsvtorgb } from './lib/mx_hsv.js'; -import { mx_rgbtohsv } from './lib/mx_hsv.js'; -import { mx_srgb_texture_to_lin_rec709 } from './lib/mx_transform_color.js'; -export { mx_hsvtorgb, mx_rgbtohsv, mx_srgb_texture_to_lin_rec709 }; diff --git a/jsdoc-testing/jsdoc/nodes/materialx/lib/mx_hsv.d.ts b/jsdoc-testing/jsdoc/nodes/materialx/lib/mx_hsv.d.ts deleted file mode 100644 index 27d194964..000000000 --- a/jsdoc-testing/jsdoc/nodes/materialx/lib/mx_hsv.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export const mx_hsvtorgb: any; -export const mx_rgbtohsv: any; diff --git a/jsdoc-testing/jsdoc/nodes/materialx/lib/mx_noise.d.ts b/jsdoc-testing/jsdoc/nodes/materialx/lib/mx_noise.d.ts deleted file mode 100644 index d22a57d41..000000000 --- a/jsdoc-testing/jsdoc/nodes/materialx/lib/mx_noise.d.ts +++ /dev/null @@ -1,70 +0,0 @@ -export const mx_select: any; -export const mx_negate_if: any; -export const mx_floor: any; -export const mx_floorfrac: () => void; -export const mx_bilerp_0: any; -export const mx_bilerp_1: any; -export const mx_bilerp: import("../../utils/FunctionOverloadingNode.js").default; -export const mx_trilerp_0: any; -export const mx_trilerp_1: any; -export const mx_trilerp: import("../../utils/FunctionOverloadingNode.js").default; -export const mx_gradient_float_0: any; -export const mx_gradient_float_1: any; -export const mx_gradient_float: import("../../utils/FunctionOverloadingNode.js").default; -export const mx_gradient_vec3_0: any; -export const mx_gradient_vec3_1: any; -export const mx_gradient_vec3: import("../../utils/FunctionOverloadingNode.js").default; -export const mx_gradient_scale2d_0: any; -export const mx_gradient_scale3d_0: any; -export const mx_gradient_scale2d_1: any; -export const mx_gradient_scale2d: import("../../utils/FunctionOverloadingNode.js").default; -export const mx_gradient_scale3d_1: any; -export const mx_gradient_scale3d: import("../../utils/FunctionOverloadingNode.js").default; -export const mx_rotl32: any; -export const mx_bjmix: () => void; -export const mx_bjfinal: any; -export const mx_bits_to_01: any; -export const mx_fade: any; -export const mx_hash_int_0: any; -export const mx_hash_int_1: any; -export const mx_hash_int_2: any; -export const mx_hash_int_3: any; -export const mx_hash_int_4: any; -export const mx_hash_int: import("../../utils/FunctionOverloadingNode.js").default; -export const mx_hash_vec3_0: any; -export const mx_hash_vec3_1: any; -export const mx_hash_vec3: import("../../utils/FunctionOverloadingNode.js").default; -export const mx_perlin_noise_float_0: any; -export const mx_perlin_noise_float_1: any; -export const mx_perlin_noise_float: import("../../utils/FunctionOverloadingNode.js").default; -export const mx_perlin_noise_vec3_0: any; -export const mx_perlin_noise_vec3_1: any; -export const mx_perlin_noise_vec3: import("../../utils/FunctionOverloadingNode.js").default; -export const mx_cell_noise_float_0: any; -export const mx_cell_noise_float_1: any; -export const mx_cell_noise_float_2: any; -export const mx_cell_noise_float_3: any; -export const mx_cell_noise_float: import("../../utils/FunctionOverloadingNode.js").default; -export const mx_cell_noise_vec3_0: any; -export const mx_cell_noise_vec3_1: any; -export const mx_cell_noise_vec3_2: any; -export const mx_cell_noise_vec3_3: any; -export const mx_cell_noise_vec3: import("../../utils/FunctionOverloadingNode.js").default; -export const mx_fractal_noise_float: any; -export const mx_fractal_noise_vec3: any; -export const mx_fractal_noise_vec2: any; -export const mx_fractal_noise_vec4: any; -export const mx_worley_distance_0: any; -export const mx_worley_distance_1: any; -export const mx_worley_distance: import("../../utils/FunctionOverloadingNode.js").default; -export const mx_worley_noise_float_0: any; -export const mx_worley_noise_vec2_0: any; -export const mx_worley_noise_vec3_0: any; -export const mx_worley_noise_float_1: any; -export const mx_worley_noise_float: import("../../utils/FunctionOverloadingNode.js").default; -export const mx_worley_noise_vec2_1: any; -export const mx_worley_noise_vec2: import("../../utils/FunctionOverloadingNode.js").default; -export const mx_worley_noise_vec3_1: any; -export const mx_worley_noise_vec3: import("../../utils/FunctionOverloadingNode.js").default; -export const mx_unifiednoise2d: any; -export const mx_unifiednoise3d: any; diff --git a/jsdoc-testing/jsdoc/nodes/materialx/lib/mx_transform_color.d.ts b/jsdoc-testing/jsdoc/nodes/materialx/lib/mx_transform_color.d.ts deleted file mode 100644 index 521d93346..000000000 --- a/jsdoc-testing/jsdoc/nodes/materialx/lib/mx_transform_color.d.ts +++ /dev/null @@ -1 +0,0 @@ -export const mx_srgb_texture_to_lin_rec709: any; diff --git a/jsdoc-testing/jsdoc/nodes/math/BitcastNode.d.ts b/jsdoc-testing/jsdoc/nodes/math/BitcastNode.d.ts deleted file mode 100644 index f15d7989b..000000000 --- a/jsdoc-testing/jsdoc/nodes/math/BitcastNode.d.ts +++ /dev/null @@ -1,62 +0,0 @@ -export default BitcastNode; -/** - * Reinterpret the bit representation of a value in one type as a value in another type. - * - * @tsl - * @function - * @param {Node | number} x - The parameter. - * @param {string} y - The new type. - * @returns {Node} - */ -export const bitcast: any; -export function floatBitsToInt(value: Node): BitcastNode; -export function floatBitsToUint(value: Node): BitcastNode; -export function intBitsToFloat(value: Node): BitcastNode; -export function uintBitsToFloat(value: Node): BitcastNode; -/** - * This node represents an operation that reinterprets the bit representation of a value - * in one type as a value in another type. - * - * @augments TempNode - */ -declare class BitcastNode extends TempNode { - /** - * Constructs a new bitcast node. - * - * @param {Node} valueNode - The value to convert. - * @param {string} conversionType - The type to convert to. - * @param {?string} [inputType = null] - The expected input data type of the bitcast operation. - */ - constructor(valueNode: Node, conversionType: string, inputType?: string | null); - /** - * The data to bitcast to a new type. - * - * @type {Node} - */ - valueNode: Node; - /** - * The type the value will be converted to. - * - * @type {string} - */ - conversionType: string; - /** - * The expected input data type of the bitcast operation. - * - * - * @type {string} - * @default null - */ - inputType: string; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isBitcastNode: boolean; - generateNodeType(builder: any): any; - generate(builder: any): string; -} -import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/math/BitcountNode.d.ts b/jsdoc-testing/jsdoc/nodes/math/BitcountNode.d.ts deleted file mode 100644 index 5a85b0585..000000000 --- a/jsdoc-testing/jsdoc/nodes/math/BitcountNode.d.ts +++ /dev/null @@ -1,111 +0,0 @@ -export default BitcountNode; -/** - * Finds the number of consecutive 0 bits from the least significant bit of the input value, - * which is also the index of the least significant bit of the input value. - * - * Can only be used with {@link WebGPURenderer} and a WebGPU backend. - * - * @tsl - * @function - * @param {Node | number} x - The input value. - * @returns {Node} - */ -export const countTrailingZeros: any; -/** - * Finds the number of consecutive 0 bits starting from the most significant bit of the input value. - * - * Can only be used with {@link WebGPURenderer} and a WebGPU backend. - * - * @tsl - * @function - * @param {Node | number} x - The input value. - * @returns {Node} - */ -export const countLeadingZeros: any; -/** - * Finds the number of '1' bits set in the input value - * - * Can only be used with {@link WebGPURenderer} and a WebGPU backend. - * - * @tsl - * @function - * @returns {Node} - */ -export const countOneBits: any; -/** - * This node represents an operation that counts the bits of a piece of shader data. - * - * @augments MathNode - */ -declare class BitcountNode extends MathNode { - /** - * Constructs a new math node. - * - * @param {'countTrailingZeros'|'countLeadingZeros'|'countOneBits'} method - The method name. - * @param {Node} aNode - The first input. - */ - constructor(method: "countTrailingZeros" | "countLeadingZeros" | "countOneBits", aNode: Node); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isBitcountNode: boolean; - /** - * Casts the input value of the function to an integer if necessary. - * - * @private - * @param {Node|Node} inputNode - The input value. - * @param {Node} outputNode - The output value. - * @param {string} elementType - The type of the input value. - */ - private _resolveElementType; - _returnDataNode(inputType: any): any; - /** - * Creates and registers a reusable GLSL function that emulates the behavior of countTrailingZeros. - * - * @private - * @param {string} method - The name of the function to create. - * @param {string} elementType - The type of the input value. - * @returns {Function} - The generated function - */ - private _createTrailingZerosBaseLayout; - /** - * Creates and registers a reusable GLSL function that emulates the behavior of countLeadingZeros. - * - * @private - * @param {string} method - The name of the function to create. - * @param {string} elementType - The type of the input value. - * @returns {Function} - The generated function - */ - private _createLeadingZerosBaseLayout; - /** - * Creates and registers a reusable GLSL function that emulates the behavior of countOneBits. - * - * @private - * @param {string} method - The name of the function to create. - * @param {string} elementType - The type of the input value. - * @returns {Function} - The generated function - */ - private _createOneBitsBaseLayout; - /** - * Creates and registers a reusable GLSL function that emulates the behavior of the specified bitcount function. - * including considerations for component-wise bitcounts on vector type inputs. - * - * @private - * @param {string} method - The name of the function to create. - * @param {string} inputType - The type of the input value. - * @param {number} typeLength - The vec length of the input value. - * @param {Function} baseFn - The base function that operates on an individual component of the vector. - * @returns {Function} - The alias function for the specified bitcount method. - */ - private _createMainLayout; -} -declare namespace BitcountNode { - let COUNT_TRAILING_ZEROS: string; - let COUNT_LEADING_ZEROS: string; - let COUNT_ONE_BITS: string; -} -import MathNode from './MathNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/math/ConditionalNode.d.ts b/jsdoc-testing/jsdoc/nodes/math/ConditionalNode.d.ts deleted file mode 100644 index 660aa3fb6..000000000 --- a/jsdoc-testing/jsdoc/nodes/math/ConditionalNode.d.ts +++ /dev/null @@ -1,65 +0,0 @@ -export default ConditionalNode; -/** - * TSL function for creating a conditional node. - * - * @tsl - * @function - * @param {Node} condNode - The node that defines the condition. - * @param {Node} ifNode - The node that is evaluate when the condition ends up `true`. - * @param {?Node} [elseNode=null] - The node that is evaluate when the condition ends up `false`. - * @returns {ConditionalNode} - */ -export const select: any; -/** - * Represents a logical `if/else` statement. Can be used as an alternative - * to the `If()`/`Else()` syntax. - * - * The corresponding TSL `select()` looks like so: - * ```js - * velocity = position.greaterThanEqual( limit ).select( velocity.negate(), velocity ); - * ``` - * The `select()` method is called in a chaining fashion on a condition. The parameter nodes of `select()` - * determine the outcome of the entire statement. - * - * @augments Node - */ -declare class ConditionalNode extends Node { - /** - * Constructs a new conditional node. - * - * @param {Node} condNode - The node that defines the condition. - * @param {Node} ifNode - The node that is evaluate when the condition ends up `true`. - * @param {?Node} [elseNode=null] - The node that is evaluate when the condition ends up `false`. - */ - constructor(condNode: Node, ifNode: Node, elseNode?: Node | null); - /** - * The node that defines the condition. - * - * @type {Node} - */ - condNode: Node; - /** - * The node that is evaluate when the condition ends up `true`. - * - * @type {Node} - */ - ifNode: Node; - /** - * The node that is evaluate when the condition ends up `false`. - * - * @type {?Node} - * @default null - */ - elseNode: Node | null; - /** - * This method is overwritten since the node type is inferred from the if/else - * nodes. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The node type. - */ - generateNodeType(builder: NodeBuilder): string; - setup(builder: any): void; - generate(builder: any, output: any): any; -} -import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/math/Hash.d.ts b/jsdoc-testing/jsdoc/nodes/math/Hash.d.ts deleted file mode 100644 index e42866ba8..000000000 --- a/jsdoc-testing/jsdoc/nodes/math/Hash.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Generates a hash value in the range `[0, 1]` from the given seed. - * - * @tsl - * @function - * @param {Node} seed - The seed. - * @return {Node} The hash value. - */ -export const hash: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/math/MathNode.d.ts b/jsdoc-testing/jsdoc/nodes/math/MathNode.d.ts deleted file mode 100644 index 8cdc4720d..000000000 --- a/jsdoc-testing/jsdoc/nodes/math/MathNode.d.ts +++ /dev/null @@ -1,701 +0,0 @@ -export default MathNode; -/** - * A small value used to handle floating-point precision errors. - * - * @tsl - * @type {Node} - */ -export const EPSILON: Node; -/** - * Represents infinity. - * - * @tsl - * @type {Node} - */ -export const INFINITY: Node; -/** - * Represents PI. - * - * @tsl - * @type {Node} - */ -export const PI: Node; -/** - * Represents PI * 2. Please use the non-deprecated version `TWO_PI`. - * - * @tsl - * @deprecated - * @type {Node} - */ -export const PI2: Node; -/** - * Represents PI * 2. - * - * @tsl - * @type {Node} - */ -export const TWO_PI: Node; -/** - * Represents PI / 2. - * - * @tsl - * @type {Node} - */ -export const HALF_PI: Node; -/** - * Returns `true` if all components of `x` are `true`. - * - * @tsl - * @function - * @param {Node | number} x - The parameter. - * @returns {Node} - */ -export const all: any; -/** - * Returns `true` if any components of `x` are `true`. - * - * @tsl - * @function - * @param {Node | number} x - The parameter. - * @returns {Node} - */ -export const any: any; -/** - * Converts a quantity in degrees to radians. - * - * @tsl - * @function - * @param {Node | number} x - The input in degrees. - * @returns {Node} - */ -export const radians: any; -/** - * Convert a quantity in radians to degrees. - * - * @tsl - * @function - * @param {Node | number} x - The input in radians. - * @returns {Node} - */ -export const degrees: any; -/** - * Returns the natural exponentiation of the parameter. - * - * @tsl - * @function - * @param {Node | number} x - The parameter. - * @returns {Node} - */ -export const exp: any; -/** - * Returns 2 raised to the power of the parameter. - * - * @tsl - * @function - * @param {Node | number} x - The parameter. - * @returns {Node} - */ -export const exp2: any; -/** - * Returns the natural logarithm of the parameter. - * - * @tsl - * @function - * @param {Node | number} x - The parameter. - * @returns {Node} - */ -export const log: any; -/** - * Returns the base 2 logarithm of the parameter. - * - * @tsl - * @function - * @param {Node | number} x - The parameter. - * @returns {Node} - */ -export const log2: any; -/** - * Returns the square root of the parameter. - * - * @tsl - * @function - * @param {Node | number} x - The parameter. - * @returns {Node} - */ -export const sqrt: any; -/** - * Returns the inverse of the square root of the parameter. - * - * @tsl - * @function - * @param {Node | number} x - The parameter. - * @returns {Node} - */ -export const inverseSqrt: any; -/** - * Finds the nearest integer less than or equal to the parameter. - * - * @tsl - * @function - * @param {Node | number} x - The parameter. - * @returns {Node} - */ -export const floor: any; -/** - * Finds the nearest integer that is greater than or equal to the parameter. - * - * @tsl - * @function - * @param {Node | number} x - The parameter. - * @returns {Node} - */ -export const ceil: any; -/** - * Calculates the unit vector in the same direction as the original vector. - * - * @tsl - * @function - * @param {Node} x - The input vector. - * @returns {Node} - */ -export const normalize: any; -/** - * Computes the fractional part of the parameter. - * - * @tsl - * @function - * @param {Node | number} x - The parameter. - * @returns {Node} - */ -export const fract: any; -/** - * Returns the sine of the parameter. - * - * @tsl - * @function - * @param {Node | number} x - The parameter. - * @returns {Node} - */ -export const sin: any; -/** - * Returns the hyperbolic sine of the parameter. - * - * @tsl - * @function - * @param {Node | number} x - The parameter. - * @returns {Node} - */ -export const sinh: any; -/** - * Returns the cosine of the parameter. - * - * @tsl - * @function - * @param {Node | number} x - The parameter. - * @returns {Node} - */ -export const cos: any; -/** - * Returns the hyperbolic cosine of the parameter. - * - * @tsl - * @function - * @param {Node | number} x - The parameter. - * @returns {Node} - */ -export const cosh: any; -/** - * Returns the tangent of the parameter. - * - * @tsl - * @function - * @param {Node | number} x - The parameter. - * @returns {Node} - */ -export const tan: any; -/** - * Returns the hyperbolic tangent of the parameter. - * - * @tsl - * @function - * @param {Node | number} x - The parameter. - * @returns {Node} - */ -export const tanh: any; -/** - * Returns the arcsine of the parameter. - * - * @tsl - * @function - * @param {Node | number} x - The parameter. - * @returns {Node} - */ -export const asin: any; -/** - * Returns the inverse hyperbolic sine of the parameter. - * - * @tsl - * @function - * @param {Node | number} x - The parameter. - * @returns {Node} - */ -export const asinh: any; -/** - * Returns the arccosine of the parameter. - * - * @tsl - * @function - * @param {Node | number} x - The parameter. - * @returns {Node} - */ -export const acos: any; -/** - * Returns the inverse hyperbolic cosine of the parameter. - * - * @tsl - * @function - * @param {Node | number} x - The parameter. - * @returns {Node} - */ -export const acosh: any; -/** - * Returns the arc-tangent of the parameter. - * If two parameters are provided, the result is `atan2(y/x)`. - * - * @tsl - * @function - * @param {Node | number} y - The y parameter. - * @param {?(Node | number)} x - The x parameter. - * @returns {Node} - */ -export const atan: any; -/** - * Returns the inverse hyperbolic tangent of the parameter. - * - * @tsl - * @function - * @param {Node | number} x - The parameter. - * @returns {Node} - */ -export const atanh: any; -/** - * Returns the absolute value of the parameter. - * - * @tsl - * @function - * @param {Node | number} x - The parameter. - * @returns {Node} - */ -export const abs: any; -/** - * Extracts the sign of the parameter. - * - * @tsl - * @function - * @param {Node | number} x - The parameter. - * @returns {Node} - */ -export const sign: any; -/** - * Calculates the length of a vector. - * - * @tsl - * @function - * @param {Node} x - The parameter. - * @returns {Node} - */ -export const length: any; -/** - * Negates the value of the parameter (-x). - * - * @tsl - * @function - * @param {Node | number} x - The parameter. - * @returns {Node} - */ -export const negate: any; -/** - * Return `1` minus the parameter. - * - * @tsl - * @function - * @param {Node | number} x - The parameter. - * @returns {Node} - */ -export const oneMinus: any; -/** - * Returns the partial derivative of the parameter with respect to x. - * - * @tsl - * @function - * @param {Node | number} x - The parameter. - * @returns {Node} - */ -export const dFdx: any; -/** - * Returns the partial derivative of the parameter with respect to y. - * - * @tsl - * @function - * @param {Node | number} x - The parameter. - * @returns {Node} - */ -export const dFdy: any; -/** - * Rounds the parameter to the nearest integer. - * - * @tsl - * @function - * @param {Node | number} x - The parameter. - * @returns {Node} - */ -export const round: any; -/** - * Returns the reciprocal of the parameter `(1/x)`. - * - * @tsl - * @function - * @param {Node | number} x - The parameter. - * @returns {Node} - */ -export const reciprocal: any; -/** - * Truncates the parameter, removing the fractional part. - * - * @tsl - * @function - * @param {Node | number} x - The parameter. - * @returns {Node} - */ -export const trunc: any; -/** - * Returns the sum of the absolute derivatives in x and y. - * - * @tsl - * @function - * @param {Node | number} x - The parameter. - * @returns {Node} - */ -export const fwidth: any; -/** - * Returns the transpose of a matrix. - * - * @tsl - * @function - * @param {Node} x - The parameter. - * @returns {Node} - */ -export const transpose: any; -/** - * Returns the determinant of a matrix. - * - * @tsl - * @function - * @param {Node} x - The parameter. - * @returns {Node} - */ -export const determinant: any; -/** - * Returns the inverse of a matrix. - * - * @tsl - * @function - * @param {Node} x - The parameter. - * @returns {Node} - */ -export const inverse: any; -/** - * Returns the least of the given values. - * - * @tsl - * @function - * @param {...(Node | number)} values - The values to compare. - * @returns {Node} - */ -export const min: any; -/** - * Returns the greatest of the given values. - * - * @tsl - * @function - * @param {...(Node | number)} values - The values to compare. - * @returns {Node} - */ -export const max: any; -/** - * Generate a step function by comparing two values. - * - * @tsl - * @function - * @param {Node | number} x - The y parameter. - * @param {Node | number} y - The x parameter. - * @returns {Node} - */ -export const step: any; -/** - * Calculates the reflection direction for an incident vector. - * - * @tsl - * @function - * @param {Node} I - The incident vector. - * @param {Node} N - The normal vector. - * @returns {Node} - */ -export const reflect: any; -/** - * Calculates the distance between two points. - * - * @tsl - * @function - * @param {Node} x - The first point. - * @param {Node} y - The second point. - * @returns {Node} - */ -export const distance: any; -/** - * Calculates the absolute difference between two values. - * - * @tsl - * @function - * @param {Node | number} x - The first parameter. - * @param {Node | number} y - The second parameter. - * @returns {Node} - */ -export const difference: any; -/** - * Calculates the dot product of two vectors. - * - * @tsl - * @function - * @param {Node} x - The first vector. - * @param {Node} y - The second vector. - * @returns {Node} - */ -export const dot: any; -/** - * Calculates the cross product of two vectors. - * - * @tsl - * @function - * @param {Node} x - The first vector. - * @param {Node} y - The second vector. - * @returns {Node} - */ -export const cross: any; -/** - * Return the value of the first parameter raised to the power of the second one. - * - * @tsl - * @function - * @param {Node | number} x - The first parameter. - * @param {Node | number} y - The second parameter. - * @returns {Node} - */ -export const pow: any; -export function pow2(x: Node | number): Node; -export function pow3(x: Node | number): Node; -export function pow4(x: Node | number): Node; -/** - * Transforms the direction of a vector by a matrix and then normalizes the result. - * - * @tsl - * @function - * @param {Node} direction - The direction vector. - * @param {Node} matrix - The transformation matrix. - * @returns {Node} - */ -export const transformDirection: any; -export function cbrt(a: Node | number): Node; -export function lengthSq(a: Node): Node; -/** - * Linearly interpolates between two values. - * - * @tsl - * @function - * @param {Node | number} a - The first parameter. - * @param {Node | number} b - The second parameter. - * @param {Node | number} t - The interpolation value. - * @returns {Node} - */ -export const mix: any; -export function clamp(value: Node | number, low?: Node | number, high?: Node | number): Node; -export function saturate(value: Node | number): Node; -/** - * Calculates the refraction direction for an incident vector. - * - * @tsl - * @function - * @param {Node} I - The incident vector. - * @param {Node} N - The normal vector. - * @param {Node} eta - The ratio of indices of refraction. - * @returns {Node} - */ -export const refract: any; -/** - * Performs a Hermite interpolation between two values. - * - * @tsl - * @function - * @param {Node | number} low - The value of the lower edge of the Hermite function. - * @param {Node | number} high - The value of the upper edge of the Hermite function. - * @param {Node | number} x - The source value for interpolation. - * @returns {Node} - */ -export const smoothstep: any; -/** - * Returns a vector pointing in the same direction as another. - * - * @tsl - * @function - * @param {Node} N - The vector to orient. - * @param {Node} I - The incident vector. - * @param {Node} Nref - The reference vector. - * @returns {Node} - */ -export const faceForward: any; -/** - * Returns a random value for the given uv. - * - * @tsl - * @function - * @param {Node} uv - The uv node. - * @returns {Node} - */ -export const rand: () => void; -export function mixElement(t: Node | number, e1: Node | number, e2: Node | number): Node; -export function smoothstepElement(x: Node | number, low: Node | number, high: Node | number): Node; -export function stepElement(x: Node | number, edge: Node | number): Node; -export const faceforward: any; -export const inversesqrt: any; -/** - * This node represents a variety of mathematical methods available in shaders. - * They are divided into three categories: - * - * - Methods with one input like `sin`, `cos` or `normalize`. - * - Methods with two inputs like `dot`, `cross` or `pow`. - * - Methods with three inputs like `mix`, `clamp` or `smoothstep`. - * - * @augments TempNode - */ -declare class MathNode extends TempNode { - /** - * Constructs a new math node. - * - * @param {string} method - The method name. - * @param {Node} aNode - The first input. - * @param {?Node} [bNode=null] - The second input. - * @param {?Node} [cNode=null] - The third input. - */ - constructor(method: string, aNode: Node, bNode?: Node | null, cNode?: Node | null, ...args: any[]); - /** - * The method name. - * - * @type {string} - */ - method: string; - /** - * The first input. - * - * @type {Node} - */ - aNode: Node; - /** - * The second input. - * - * @type {?Node} - * @default null - */ - bNode: Node | null; - /** - * The third input. - * - * @type {?Node} - * @default null - */ - cNode: Node | null; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isMathNode: boolean; - /** - * The input type is inferred from the node types of the input nodes. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The input type. - */ - getInputType(builder: NodeBuilder): string; - /** - * The selected method as well as the input type determine the node type of this node. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The node type. - */ - generateNodeType(builder: NodeBuilder): string; - setup(builder: any): any; - generate(builder: any, output: any): any; - serialize(data: any): void; - deserialize(data: any): void; -} -declare namespace MathNode { - let ALL: string; - let ANY: string; - let RADIANS: string; - let DEGREES: string; - let EXP: string; - let EXP2: string; - let LOG: string; - let LOG2: string; - let SQRT: string; - let INVERSE_SQRT: string; - let FLOOR: string; - let CEIL: string; - let NORMALIZE: string; - let FRACT: string; - let SIN: string; - let SINH: string; - let COS: string; - let COSH: string; - let TAN: string; - let TANH: string; - let ASIN: string; - let ASINH: string; - let ACOS: string; - let ACOSH: string; - let ATAN: string; - let ATANH: string; - let ABS: string; - let SIGN: string; - let LENGTH: string; - let NEGATE: string; - let ONE_MINUS: string; - let DFDX: string; - let DFDY: string; - let ROUND: string; - let RECIPROCAL: string; - let TRUNC: string; - let FWIDTH: string; - let TRANSPOSE: string; - let DETERMINANT: string; - let INVERSE: string; - let EQUALS: string; - let MIN: string; - let MAX: string; - let STEP: string; - let REFLECT: string; - let DISTANCE: string; - let DIFFERENCE: string; - let DOT: string; - let CROSS: string; - let POW: string; - let TRANSFORM_DIRECTION: string; - let MIX: string; - let CLAMP: string; - let REFRACT: string; - let SMOOTHSTEP: string; - let FACEFORWARD: string; -} -import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/math/MathUtils.d.ts b/jsdoc-testing/jsdoc/nodes/math/MathUtils.d.ts deleted file mode 100644 index 69ed7ec52..000000000 --- a/jsdoc-testing/jsdoc/nodes/math/MathUtils.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export function parabola(x: Node, k: Node): Node; -export function gain(x: Node, k: Node): Node; -export function pcurve(x: Node, a: Node, b: Node): Node; -export function sinc(x: Node, k: Node): Node; diff --git a/jsdoc-testing/jsdoc/nodes/math/OperatorNode.d.ts b/jsdoc-testing/jsdoc/nodes/math/OperatorNode.d.ts deleted file mode 100644 index 6b14bf599..000000000 --- a/jsdoc-testing/jsdoc/nodes/math/OperatorNode.d.ts +++ /dev/null @@ -1,313 +0,0 @@ -export default OperatorNode; -/** - * Returns the addition of two or more value. - * - * @tsl - * @function - * @param {Node} a - The first input. - * @param {Node} b - The second input. - * @param {...Node} params - Additional input parameters. - * @returns {OperatorNode} - */ -export const add: any; -/** - * Returns the subtraction of two or more value. - * - * @tsl - * @function - * @param {Node} a - The first input. - * @param {Node} b - The second input. - * @param {...Node} params - Additional input parameters. - * @returns {OperatorNode} - */ -export const sub: any; -/** - * Returns the multiplication of two or more value. - * - * @tsl - * @function - * @param {Node} a - The first input. - * @param {Node} b - The second input. - * @param {...Node} params - Additional input parameters. - * @returns {OperatorNode} - */ -export const mul: any; -/** - * Returns the division of two or more value. - * - * @tsl - * @function - * @param {Node} a - The first input. - * @param {Node} b - The second input. - * @param {...Node} params - Additional input parameters. - * @returns {OperatorNode} - */ -export const div: any; -/** - * Computes the remainder of dividing the first node by the second one. - * - * @tsl - * @function - * @param {Node} a - The first input. - * @param {Node} b - The second input. - * @returns {OperatorNode} - */ -export const mod: any; -/** - * Checks if two nodes are equal. - * - * @tsl - * @function - * @param {Node} a - The first input. - * @param {Node} b - The second input. - * @returns {OperatorNode} - */ -export const equal: any; -/** - * Checks if two nodes are not equal. - * - * @tsl - * @function - * @param {Node} a - The first input. - * @param {Node} b - The second input. - * @returns {OperatorNode} - */ -export const notEqual: any; -/** - * Checks if the first node is less than the second. - * - * @tsl - * @function - * @param {Node} a - The first input. - * @param {Node} b - The second input. - * @returns {OperatorNode} - */ -export const lessThan: any; -/** - * Checks if the first node is greater than the second. - * - * @tsl - * @function - * @param {Node} a - The first input. - * @param {Node} b - The second input. - * @returns {OperatorNode} - */ -export const greaterThan: any; -/** - * Checks if the first node is less than or equal to the second. - * - * @tsl - * @function - * @param {Node} a - The first input. - * @param {Node} b - The second input. - * @returns {OperatorNode} - */ -export const lessThanEqual: any; -/** - * Checks if the first node is greater than or equal to the second. - * - * @tsl - * @function - * @param {Node} a - The first input. - * @param {Node} b - The second input. - * @returns {OperatorNode} - */ -export const greaterThanEqual: any; -/** - * Performs a logical AND operation on multiple nodes. - * - * @tsl - * @function - * @param {...Node} nodes - The input nodes to be combined using AND. - * @returns {OperatorNode} - */ -export const and: any; -/** - * Performs a logical OR operation on multiple nodes. - * - * @tsl - * @function - * @param {...Node} nodes - The input nodes to be combined using OR. - * @returns {OperatorNode} - */ -export const or: any; -/** - * Performs logical NOT on a node. - * - * @tsl - * @function - * @param {Node} value - The value. - * @returns {OperatorNode} - */ -export const not: any; -/** - * Performs logical XOR on two nodes. - * - * @tsl - * @function - * @param {Node} a - The first input. - * @param {Node} b - The second input. - * @returns {OperatorNode} - */ -export const xor: any; -/** - * Performs bitwise AND on two nodes. - * - * @tsl - * @function - * @param {Node} a - The first input. - * @param {Node} b - The second input. - * @returns {OperatorNode} - */ -export const bitAnd: any; -/** - * Performs bitwise NOT on a node. - * - * @tsl - * @function - * @param {Node} a - The first input. - * @param {Node} b - The second input. - * @returns {OperatorNode} - */ -export const bitNot: any; -/** - * Performs bitwise OR on two nodes. - * - * @tsl - * @function - * @param {Node} a - The first input. - * @param {Node} b - The second input. - * @returns {OperatorNode} - */ -export const bitOr: any; -/** - * Performs bitwise XOR on two nodes. - * - * @tsl - * @function - * @param {Node} a - The first input. - * @param {Node} b - The second input. - * @returns {OperatorNode} - */ -export const bitXor: any; -/** - * Shifts a node to the left. - * - * @tsl - * @function - * @param {Node} a - The node to shift. - * @param {Node} b - The value to shift. - * @returns {OperatorNode} - */ -export const shiftLeft: any; -/** - * Shifts a node to the right. - * - * @tsl - * @function - * @param {Node} a - The node to shift. - * @param {Node} b - The value to shift. - * @returns {OperatorNode} - */ -export const shiftRight: any; -/** - * Increments a node by 1. - * - * @tsl - * @function - * @param {Node} a - The node to increment. - * @returns {OperatorNode} - */ -export const incrementBefore: () => void; -/** - * Decrements a node by 1. - * - * @tsl - * @function - * @param {Node} a - The node to decrement. - * @returns {OperatorNode} - */ -export const decrementBefore: () => void; -/** - * Increments a node by 1 and returns the previous value. - * - * @tsl - * @function - * @param {Node} a - The node to increment. - * @returns {OperatorNode} - */ -export const increment: () => void; -/** - * Decrements a node by 1 and returns the previous value. - * - * @tsl - * @function - * @param {Node} a - The node to decrement. - * @returns {OperatorNode} - */ -export const decrement: () => void; -export function modInt(a: Node, b: Node): OperatorNode; -/** - * This node represents basic mathematical and logical operations like addition, - * subtraction or comparisons (e.g. `equal()`). - * - * @augments TempNode - */ -declare class OperatorNode extends TempNode { - /** - * Constructs a new operator node. - * - * @param {string} op - The operator. - * @param {Node} aNode - The first input. - * @param {Node} bNode - The second input. - * @param {...Node} params - Additional input parameters. - */ - constructor(op: string, aNode: Node, bNode: Node, ...params: Node[]); - /** - * The operator. - * - * @type {string} - */ - op: string; - /** - * The first input. - * - * @type {Node} - */ - aNode: Node; - /** - * The second input. - * - * @type {Node} - */ - bNode: Node; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isOperatorNode: boolean; - /** - * Returns the operator method name. - * - * @param {NodeBuilder} builder - The current node builder. - * @param {string} output - The output type. - * @returns {string} The operator method name. - */ - getOperatorMethod(builder: NodeBuilder, output: string): string; - /** - * This method is overwritten since the node type is inferred from the operator - * and the input node types. - * - * @param {NodeBuilder} builder - The current node builder. - * @param {?string} [output=null] - The output type. - * @return {string} The node type. - */ - generateNodeType(builder: NodeBuilder, output?: string | null): string; - generate(builder: any, output: any): any; - serialize(data: any): void; - deserialize(data: any): void; -} -import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/math/PackFloatNode.d.ts b/jsdoc-testing/jsdoc/nodes/math/PackFloatNode.d.ts deleted file mode 100644 index d59976ffb..000000000 --- a/jsdoc-testing/jsdoc/nodes/math/PackFloatNode.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -export default PackFloatNode; -/** - * Converts each component of the normalized float to 16-bit integer values. The results are packed into a single unsigned integer. - * round(clamp(c, -1, +1) * 32767.0) - * - * @tsl - * @function - * @param {Node} value - The 2-component vector to be packed - * @returns {Node} - */ -export const packSnorm2x16: any; -/** - * Converts each component of the normalized float to 16-bit integer values. The results are packed into a single unsigned integer. - * round(clamp(c, 0, +1) * 65535.0) - * - * @tsl - * @function - * @param {Node} value - The 2-component vector to be packed - * @returns {Node} - */ -export const packUnorm2x16: any; -/** - * Converts each component of the vec2 to 16-bit floating-point values. The results are packed into a single unsigned integer. - * - * @tsl - * @function - * @param {Node} value - The 2-component vector to be packed - * @returns {Node} - */ -export const packHalf2x16: any; -/** - * This node represents an operation that packs floating-point values of a vector into an unsigned 32-bit integer - * - * @augments TempNode - */ -declare class PackFloatNode extends TempNode { - /** - * - * @param {'snorm' | 'unorm' | 'float16'} encoding - The numeric encoding that describes how the float values are mapped to the integer range. - * @param {Node} vectorNode - The vector node to be packed - */ - constructor(encoding: "snorm" | "unorm" | "float16", vectorNode: Node); - /** - * The vector to be packed. - * - * @type {Node} - */ - vectorNode: Node; - /** - * The numeric encoding. - * - * @type {string} - */ - encoding: string; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isPackFloatNode: boolean; - generateNodeType(): string; - generate(builder: any): string; -} -import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/math/TriNoise3D.d.ts b/jsdoc-testing/jsdoc/nodes/math/TriNoise3D.d.ts deleted file mode 100644 index 15dad5e5f..000000000 --- a/jsdoc-testing/jsdoc/nodes/math/TriNoise3D.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Generates a noise value from the given position, speed and time parameters. - * - * @tsl - * @function - * @param {Node} position - The position. - * @param {Node} speed - The speed. - * @param {Node} time - The time. - * @return {Node} The generated noise. - */ -export const triNoise3D: any; diff --git a/jsdoc-testing/jsdoc/nodes/math/UnpackFloatNode.d.ts b/jsdoc-testing/jsdoc/nodes/math/UnpackFloatNode.d.ts deleted file mode 100644 index 9a47ed9e4..000000000 --- a/jsdoc-testing/jsdoc/nodes/math/UnpackFloatNode.d.ts +++ /dev/null @@ -1,64 +0,0 @@ -export default UnpackFloatNode; -/** - * Unpacks a 32-bit unsigned integer into two 16-bit values, interpreted as normalized signed integers. Returns a vec2 with both values. - * - * @tsl - * @function - * @param {Node} value - The unsigned integer to be unpacked - * @returns {Node} - */ -export const unpackSnorm2x16: any; -/** - * Unpacks a 32-bit unsigned integer into two 16-bit values, interpreted as normalized unsigned integers. Returns a vec2 with both values. - * - * @tsl - * @function - * @param {Node} value - The unsigned integer to be unpacked - * @returns {Node} - */ -export const unpackUnorm2x16: any; -/** - * Unpacks a 32-bit unsigned integer into two 16-bit values, interpreted as 16-bit floating-point numbers. Returns a vec2 with both values. - * - * @tsl - * @function - * @param {Node} value - The unsigned integer to be unpacked - * @returns {Node} - */ -export const unpackHalf2x16: any; -/** - * This node represents an operation that unpacks values from a 32-bit unsigned integer, reinterpreting the results as a floating-point vector - * - * @augments TempNode - */ -declare class UnpackFloatNode extends TempNode { - /** - * - * @param {'snorm' | 'unorm' | 'float16'} encoding - The numeric encoding that describes how the integer values are mapped to the float range - * @param {Node} uintNode - The uint node to be unpacked - */ - constructor(encoding: "snorm" | "unorm" | "float16", uintNode: Node); - /** - * The unsigned integer to be unpacked. - * - * @type {Node} - */ - uintNode: Node; - /** - * The numeric encoding. - * - * @type {string} - */ - encoding: string; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isUnpackFloatNode: boolean; - generateNodeType(): string; - generate(builder: any): string; -} -import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/parsers/GLSLNodeFunction.d.ts b/jsdoc-testing/jsdoc/nodes/parsers/GLSLNodeFunction.d.ts deleted file mode 100644 index 3b3ed5efe..000000000 --- a/jsdoc-testing/jsdoc/nodes/parsers/GLSLNodeFunction.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -export default GLSLNodeFunction; -/** - * This class represents a GLSL node function. - * - * @augments NodeFunction - */ -declare class GLSLNodeFunction extends NodeFunction { - /** - * Constructs a new GLSL node function. - * - * @param {string} source - The GLSL source. - */ - constructor(source: string); - inputsCode: any; - blockCode: any; - headerCode: any; - /** - * This method returns the GLSL code of the node function. - * - * @param {string} [name=this.name] - The function's name. - * @return {string} The shader code. - */ - getCode(name?: string): string; -} -import NodeFunction from '../core/NodeFunction.js'; diff --git a/jsdoc-testing/jsdoc/nodes/parsers/GLSLNodeParser.d.ts b/jsdoc-testing/jsdoc/nodes/parsers/GLSLNodeParser.d.ts deleted file mode 100644 index 4219e9d0e..000000000 --- a/jsdoc-testing/jsdoc/nodes/parsers/GLSLNodeParser.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -export default GLSLNodeParser; -/** - * A GLSL node parser. - * - * @augments NodeParser - */ -declare class GLSLNodeParser extends NodeParser { - /** - * The method parses the given GLSL code an returns a node function. - * - * @param {string} source - The GLSL code. - * @return {GLSLNodeFunction} A node function. - */ - parseFunction(source: string): GLSLNodeFunction; -} -import NodeParser from '../core/NodeParser.js'; -import GLSLNodeFunction from './GLSLNodeFunction.js'; diff --git a/jsdoc-testing/jsdoc/nodes/pmrem/PMREMNode.d.ts b/jsdoc-testing/jsdoc/nodes/pmrem/PMREMNode.d.ts deleted file mode 100644 index 0ddba7546..000000000 --- a/jsdoc-testing/jsdoc/nodes/pmrem/PMREMNode.d.ts +++ /dev/null @@ -1,113 +0,0 @@ -export default PMREMNode; -/** - * TSL function for creating a PMREM node. - * - * @tsl - * @function - * @param {Texture} value - The input texture. - * @param {?Node} [uvNode=null] - The uv node. - * @param {?Node} [levelNode=null] - The level node. - * @returns {PMREMNode} - */ -export const pmremTexture: any; -/** - * This node represents a PMREM which is a special type of preprocessed - * environment map intended for PBR materials. - * - * ```js - * const material = new MeshStandardNodeMaterial(); - * material.envNode = pmremTexture( envMap ); - * ``` - * - * @augments TempNode - */ -declare class PMREMNode extends TempNode { - /** - * Constructs a new function overloading node. - * - * @param {Texture} value - The input texture. - * @param {Node} [uvNode=null] - The uv node. - * @param {Node} [levelNode=null] - The level node. - */ - constructor(value: Texture, uvNode?: Node, levelNode?: Node); - /** - * Reference to the input texture. - * - * @private - * @type {Texture} - */ - private _value; - /** - * Reference to the generated PMREM. - * - * @private - * @type {Texture | null} - * @default null - */ - private _pmrem; - /** - * The uv node. - * - * @type {Node} - */ - uvNode: Node; - /** - * The level node. - * - * @type {Node} - */ - levelNode: Node; - /** - * Reference to a PMREM generator. - * - * @private - * @type {?PMREMGenerator} - * @default null - */ - private _generator; - /** - * The texture node holding the generated PMREM. - * - * @private - * @type {TextureNode} - */ - private _texture; - /** - * A uniform representing the PMREM's width. - * - * @private - * @type {UniformNode} - */ - private _width; - /** - * A uniform representing the PMREM's height. - * - * @private - * @type {UniformNode} - */ - private _height; - /** - * A uniform representing the PMREM's max Mip. - * - * @private - * @type {UniformNode} - */ - private _maxMip; - set value(value: Texture); - /** - * The node's texture value. - * - * @type {Texture} - */ - get value(): Texture; - /** - * Uses the given PMREM texture to update internal values. - * - * @param {Texture} texture - The PMREM texture. - */ - updateFromTexture(texture: Texture): void; - updateBefore(frame: any): void; - setup(builder: any): void; -} -import TempNode from '../core/TempNode.js'; -import { Texture } from '../../textures/Texture.js'; diff --git a/jsdoc-testing/jsdoc/nodes/pmrem/PMREMUtils.d.ts b/jsdoc-testing/jsdoc/nodes/pmrem/PMREMUtils.d.ts deleted file mode 100644 index 8c287ef83..000000000 --- a/jsdoc-testing/jsdoc/nodes/pmrem/PMREMUtils.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export const getDirection: any; -export const textureCubeUV: () => void; -export const blur: () => void; -export const ggxConvolution: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/procedural/Checker.d.ts b/jsdoc-testing/jsdoc/nodes/procedural/Checker.d.ts deleted file mode 100644 index 622cf3968..000000000 --- a/jsdoc-testing/jsdoc/nodes/procedural/Checker.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Creates a 2x2 checkerboard pattern that can be used as procedural texture data. - * - * @tsl - * @function - * @param {Node} coord - The uv coordinates. - * @return {Node} The result data. - */ -export const checker: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/shapes/Shapes.d.ts b/jsdoc-testing/jsdoc/nodes/shapes/Shapes.d.ts deleted file mode 100644 index 0777cf76d..000000000 --- a/jsdoc-testing/jsdoc/nodes/shapes/Shapes.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Generates a circle based on the uv coordinates. - * - * @tsl - * @function - * @param {Node} coord - The uv to generate the circle. - * @return {Node} The circle shape. - */ -export const shapeCircle: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/tsl/TSLBase.d.ts b/jsdoc-testing/jsdoc/nodes/tsl/TSLBase.d.ts deleted file mode 100644 index cbad0a788..000000000 --- a/jsdoc-testing/jsdoc/nodes/tsl/TSLBase.d.ts +++ /dev/null @@ -1,26 +0,0 @@ -export function addNodeElement(name: any): void; -export * from "./TSLCore.js"; -export * from "../core/ArrayNode.js"; -export * from "../core/UniformNode.js"; -export * from "../core/PropertyNode.js"; -export * from "../core/AssignNode.js"; -export * from "../code/FunctionCallNode.js"; -export * from "../math/OperatorNode.js"; -export * from "../math/MathNode.js"; -export * from "../math/ConditionalNode.js"; -export * from "../core/ContextNode.js"; -export * from "../core/VarNode.js"; -export * from "../core/VaryingNode.js"; -export * from "../display/ColorSpaceNode.js"; -export * from "../display/ToneMappingNode.js"; -export * from "../accessors/BufferAttributeNode.js"; -export * from "../gpgpu/ComputeNode.js"; -export * from "../core/IsolateNode.js"; -export * from "../core/BypassNode.js"; -export * from "../utils/Remap.js"; -export * from "../code/ExpressionNode.js"; -export * from "../utils/Discard.js"; -export * from "../display/RenderOutputNode.js"; -export * from "../utils/DebugNode.js"; -export * from "../core/SubBuildNode.js"; -export * from "../core/InspectorNode.js"; diff --git a/jsdoc-testing/jsdoc/nodes/tsl/TSLCore.d.ts b/jsdoc-testing/jsdoc/nodes/tsl/TSLCore.d.ts deleted file mode 100644 index f9935cf11..000000000 --- a/jsdoc-testing/jsdoc/nodes/tsl/TSLCore.d.ts +++ /dev/null @@ -1,77 +0,0 @@ -export function addMethodChaining(name: any, nodeElement: any): void; -export function defined(value: any): boolean; -export function ShaderNode(jsFunc: any, nodeType: any): ShaderNodeInternal; -export function Fn(jsFunc: any, layout?: null): () => void; -/** - * Add the given node to the current stack. - * - * @param {Node} node - The node to add. - * @returns {Node} The node that was added to the stack. - */ -export function Stack(node: Node): Node; -export function getConstNodeType(value: any): any; -export function nodeObject(val: any, altType?: null): any; -export function nodeObjectIntent(val: any, altType?: null): any; -export function nodeObjects(val: any, altType?: null): any; -export function nodeArray(val: any, altType?: null): any; -export function nodeProxy(NodeClass: any, scope?: null, factor?: null, settings?: null): any; -export function nodeImmutable(NodeClass: any, ...params: any[]): any; -export function nodeProxyIntent(NodeClass: any, scope?: null, factor?: null, settings?: {}): any; -export function setCurrentStack(stack: any): void; -export function getCurrentStack(): any; -export function If(...params: any[]): StackNode; -export function Switch(...params: any[]): StackNode; -export const color: any; -export const float: any; -export const int: any; -export const uint: any; -export const bool: any; -export const vec2: any; -export const ivec2: any; -export const uvec2: any; -export const bvec2: any; -export const vec3: any; -export const ivec3: any; -export const uvec3: any; -export const bvec3: any; -export const vec4: any; -export const ivec4: any; -export const uvec4: any; -export const bvec4: any; -export const mat2: any; -export const mat3: any; -export const mat4: any; -export function string(value?: string): ConstNode; -export function arrayBuffer(value: any): ConstNode; -export const element: any; -export function convert(node: any, types: any): ConvertNode; -export function split(node: any, channels: any): SplitNode; -export function append(node: Node): Function; -declare class ShaderNodeInternal extends Node { - constructor(jsFunc: any, nodeType: any); - jsFunc: any; - layout: any; - once: boolean; - setLayout(layout: any): this; - getLayout(): any; - call(rawInputs?: null): ShaderCallNodeInternal; - setup(): ShaderCallNodeInternal; -} -import Node from '../core/Node.js'; -import ConstNode from '../core/ConstNode.js'; -import ConvertNode from '../utils/ConvertNode.js'; -import SplitNode from '../utils/SplitNode.js'; -declare class ShaderCallNodeInternal extends Node { - constructor(shaderNode: any, rawInputs: any); - shaderNode: any; - rawInputs: any; - isShaderCallNodeInternal: boolean; - generateNodeType(builder: any): any; - getElementType(builder: any): any; - getMemberType(builder: any, name: any): any; - call(builder: any): any; - setupOutput(builder: any): any; - getOutputNode(builder: any): any; - build(builder: any, output?: null): any; -} -export {}; diff --git a/jsdoc-testing/jsdoc/nodes/utils/ArrayElementNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/ArrayElementNode.d.ts deleted file mode 100644 index e5669d2f2..000000000 --- a/jsdoc-testing/jsdoc/nodes/utils/ArrayElementNode.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -export default ArrayElementNode; -/** - * Base class for representing element access on an array-like - * node data structures. - * - * @augments Node - */ -declare class ArrayElementNode extends Node { - /** - * Constructs an array element node. - * - * @param {Node} node - The array-like node. - * @param {Node} indexNode - The index node that defines the element access. - */ - constructor(node: Node, indexNode: Node); - /** - * The array-like node. - * - * @type {Node} - */ - node: Node; - /** - * The index node that defines the element access. - * - * @type {Node} - */ - indexNode: Node; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isArrayElementNode: boolean; - /** - * This method is overwritten since the node type is inferred from the array-like node. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The node type. - */ - generateNodeType(builder: NodeBuilder): string; - /** - * This method is overwritten since the member type is inferred from the array-like node. - * - * @param {NodeBuilder} builder - The current node builder. - * @param {string} name - The member name. - * @return {string} The member type. - */ - getMemberType(builder: NodeBuilder, name: string): string; - generate(builder: any): string; -} -import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/ConvertNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/ConvertNode.d.ts deleted file mode 100644 index 77f0ea2f7..000000000 --- a/jsdoc-testing/jsdoc/nodes/utils/ConvertNode.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -export default ConvertNode; -/** - * This module is part of the TSL core and usually not used in app level code. - * It represents a convert operation during the shader generation process - * meaning it converts the data type of a node to a target data type. - * - * @augments Node - */ -declare class ConvertNode extends Node { - /** - * Constructs a new convert node. - * - * @param {Node} node - The node which type should be converted. - * @param {string} convertTo - The target node type. Multiple types can be defined by separating them with a `|` sign. - */ - constructor(node: Node, convertTo: string); - /** - * The node which type should be converted. - * - * @type {Node} - */ - node: Node; - /** - * The target node type. Multiple types can be defined by separating them with a `|` sign. - * - * @type {string} - */ - convertTo: string; - /** - * This method is overwritten since the implementation tries to infer the best - * matching type from the {@link ConvertNode#convertTo} property. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The node type. - */ - generateNodeType(builder: NodeBuilder): string; - serialize(data: any): void; - deserialize(data: any): void; - generate(builder: any, output: any): any; -} -import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/CubeMapNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/CubeMapNode.d.ts deleted file mode 100644 index a24a72427..000000000 --- a/jsdoc-testing/jsdoc/nodes/utils/CubeMapNode.d.ts +++ /dev/null @@ -1,57 +0,0 @@ -export default CubeMapNode; -/** - * TSL function for creating a cube map node. - * - * @tsl - * @function - * @param {Node} envNode - The node representing the environment map. - * @returns {CubeMapNode} - */ -export const cubeMapNode: any; -/** - * This node can be used to automatically convert environment maps in the - * equirectangular format into the cube map format. - * - * @augments TempNode - */ -declare class CubeMapNode extends TempNode { - /** - * Constructs a new cube map node. - * - * @param {Node} envNode - The node representing the environment map. - */ - constructor(envNode: Node); - /** - * The node representing the environment map. - * - * @type {Node} - */ - envNode: Node; - /** - * A reference to the internal cube texture. - * - * @private - * @type {?CubeTexture} - * @default null - */ - private _cubeTexture; - /** - * A reference to the internal cube texture node. - * - * @private - * @type {CubeTextureNode} - */ - private _cubeTextureNode; - /** - * A default cube texture that acts as a placeholder. - * It is used when the conversion from equirectangular to cube - * map has not finished yet for a given texture. - * - * @private - * @type {CubeTexture} - */ - private _defaultTexture; - updateBefore(frame: any): void; - setup(builder: any): CubeTextureNode; -} -import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/DebugNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/DebugNode.d.ts deleted file mode 100644 index 526033e08..000000000 --- a/jsdoc-testing/jsdoc/nodes/utils/DebugNode.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -export default DebugNode; -export function debug(node: Node, callback?: Function | null): DebugNode; -declare class DebugNode extends TempNode { - constructor(node: any, callback?: null); - node: any; - callback: any; - generateNodeType(builder: any): any; - setup(builder: any): any; - analyze(builder: any): any; - generate(builder: any): any; -} -import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/Discard.d.ts b/jsdoc-testing/jsdoc/nodes/utils/Discard.d.ts deleted file mode 100644 index 2d21a4048..000000000 --- a/jsdoc-testing/jsdoc/nodes/utils/Discard.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export function Discard(conditional: ConditionalNode | null): Node; -export function Return(): ExpressionNode; diff --git a/jsdoc-testing/jsdoc/nodes/utils/EquirectUV.d.ts b/jsdoc-testing/jsdoc/nodes/utils/EquirectUV.d.ts deleted file mode 100644 index a3e78acf6..000000000 --- a/jsdoc-testing/jsdoc/nodes/utils/EquirectUV.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * TSL function for creating an equirect uv node. - * - * Can be used to compute texture coordinates for projecting an - * equirectangular texture onto a mesh for using it as the scene's - * background. - * - * ```js - * scene.backgroundNode = texture( equirectTexture, equirectUV() ); - * ``` - * - * @tsl - * @function - * @param {?Node} [dirNode=positionWorldDirection] - A direction vector for sampling which is by default `positionWorldDirection`. - * @returns {Node} - */ -export const equirectUV: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/utils/EventNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/EventNode.d.ts deleted file mode 100644 index e0330e7a6..000000000 --- a/jsdoc-testing/jsdoc/nodes/utils/EventNode.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -export default EventNode; -export function OnObjectUpdate(callback: Function): EventNode; -export function OnMaterialUpdate(callback: Function): EventNode; -export function OnBeforeObjectUpdate(callback: Function): EventNode; -export function OnBeforeMaterialUpdate(callback: Function): EventNode; -/** - * EventNode is a node that executes a callback during specific update phases. - * - * @augments Node - */ -declare class EventNode extends Node { - /** - * Creates an EventNode. - * - * @param {string} eventType - The type of event - * @param {Function} callback - The callback to execute on update. - */ - constructor(eventType: string, callback: Function); - eventType: string; - callback: Function; - update(frame: any): void; - updateBefore(frame: any): void; -} -declare namespace EventNode { - let OBJECT: string; - let MATERIAL: string; - let BEFORE_OBJECT: string; - let BEFORE_MATERIAL: string; -} -import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/FlipNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/FlipNode.d.ts deleted file mode 100644 index 15e36f325..000000000 --- a/jsdoc-testing/jsdoc/nodes/utils/FlipNode.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -export default FlipNode; -/** - * This module is part of the TSL core and usually not used in app level code. - * It represents a flip operation during the shader generation process - * meaning it flips normalized values with the following formula: - * ``` - * x = 1 - x; - * ``` - * `FlipNode` is internally used to implement any `flipXYZW()`, `flipRGBA()` and - * `flipSTPQ()` method invocations on node objects. For example: - * ```js - * uvNode = uvNode.flipY(); - * ``` - * - * @augments TempNode - */ -declare class FlipNode extends TempNode { - /** - * Constructs a new flip node. - * - * @param {Node} sourceNode - The node which component(s) should be flipped. - * @param {string} components - The components that should be flipped e.g. `'x'` or `'xy'`. - */ - constructor(sourceNode: Node, components: string); - /** - * The node which component(s) should be flipped. - * - * @type {Node} - */ - sourceNode: Node; - /** - * The components that should be flipped e.g. `'x'` or `'xy'`. - * - * @type {string} - */ - components: string; - /** - * This method is overwritten since the node type is inferred from the source node. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The node type. - */ - generateNodeType(builder: NodeBuilder): string; - generate(builder: any): string; -} -import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/FunctionOverloadingNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/FunctionOverloadingNode.d.ts deleted file mode 100644 index 765ca535c..000000000 --- a/jsdoc-testing/jsdoc/nodes/utils/FunctionOverloadingNode.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -export default FunctionOverloadingNode; -export function overloadingFn(functionNodes: Array): FunctionOverloadingNode; -/** - * This class allows to define multiple overloaded versions - * of the same function. Depending on the parameters of the function - * call, the node picks the best-fit overloaded version. - * - * @augments Node - */ -declare class FunctionOverloadingNode extends Node { - /** - * Constructs a new function overloading node. - * - * @param {Array} functionNodes - Array of `Fn` function definitions. - * @param {...Node} parametersNodes - A list of parameter nodes. - */ - constructor(functionNodes?: Array, ...parametersNodes: Node[]); - /** - * Array of `Fn` function definitions. - * - * @type {Array} - */ - functionNodes: Array; - /** - * A list of parameter nodes. - * - * @type {Array} - */ - parametersNodes: Array; - /** - * The selected overloaded function call. - * - * @private - * @type {ShaderCallNodeInternal} - */ - private _candidateFn; - /** - * This method is overwritten since the node type is inferred from - * the function's return type. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The node type. - */ - generateNodeType(builder: NodeBuilder): string; - /** - * Returns the candidate function for the current parameters. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {FunctionNode} The candidate function. - */ - getCandidateFn(builder: NodeBuilder): FunctionNode; - /** - * Sets up the node for the current parameters. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {Node} The setup node. - */ - setup(builder: NodeBuilder): Node; -} -import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/JoinNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/JoinNode.d.ts deleted file mode 100644 index 70dfe5537..000000000 --- a/jsdoc-testing/jsdoc/nodes/utils/JoinNode.d.ts +++ /dev/null @@ -1,33 +0,0 @@ -export default JoinNode; -/** - * This module is part of the TSL core and usually not used in app level code. - * It represents a join operation during the shader generation process. - * For example in can compose/join two single floats into a `vec2` type. - * - * @augments TempNode - */ -declare class JoinNode extends TempNode { - /** - * Constructs a new join node. - * - * @param {Array} nodes - An array of nodes that should be joined. - * @param {?string} [nodeType=null] - The node type. - */ - constructor(nodes?: Array, nodeType?: string | null); - /** - * An array of nodes that should be joined. - * - * @type {Array} - */ - nodes: Array; - /** - * This method is overwritten since the node type must be inferred from the - * joined data length if not explicitly defined. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The node type. - */ - generateNodeType(builder: NodeBuilder): string; - generate(builder: any, output: any): any; -} -import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/LoopNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/LoopNode.d.ts deleted file mode 100644 index 84ca0c5f4..000000000 --- a/jsdoc-testing/jsdoc/nodes/utils/LoopNode.d.ts +++ /dev/null @@ -1,67 +0,0 @@ -export default LoopNode; -export function Loop(...params: any[]): LoopNode; -export function Continue(): ExpressionNode; -export function Break(): ExpressionNode; -/** - * This module offers a variety of ways to implement loops in TSL. In it's basic form it's: - * ```js - * Loop( count, ( { i } ) => { - * - * } ); - * ``` - * However, it is also possible to define a start and end ranges, data types and loop conditions: - * ```js - * Loop( { start: int( 0 ), end: int( 10 ), type: 'int', condition: '<' }, ( { i } ) => { - * - * } ); - *``` - * Nested loops can be defined in a compacted form: - * ```js - * Loop( 10, 5, ( { i, j } ) => { - * - * } ); - * ``` - * Loops that should run backwards can be defined like so: - * ```js - * Loop( { start: 10 }, () => {} ); - * ``` - * It is possible to execute with boolean values, similar to the `while` syntax. - * ```js - * const value = float( 0 ).toVar(); - * - * Loop( value.lessThan( 10 ), () => { - * - * value.addAssign( 1 ); - * - * } ); - * ``` - * The module also provides `Break()` and `Continue()` TSL expression for loop control. - * @augments Node - */ -declare class LoopNode extends Node { - /** - * Constructs a new loop node. - * - * @param {Array} params - Depending on the loop type, array holds different parameterization values for the loop. - */ - constructor(params?: Array); - params: any[]; - /** - * Returns a loop variable name based on an index. The pattern is - * `0` = `i`, `1`= `j`, `2`= `k` and so on. - * - * @param {number} index - The index. - * @return {string} The loop variable name. - */ - getVarName(index: number): string; - /** - * Returns properties about this node. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {Object} The node properties. - */ - getProperties(builder: NodeBuilder): Object; - setup(builder: any): void; - generate(builder: any): void; -} -import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/MatcapUV.d.ts b/jsdoc-testing/jsdoc/nodes/utils/MatcapUV.d.ts deleted file mode 100644 index 11ccf7d5a..000000000 --- a/jsdoc-testing/jsdoc/nodes/utils/MatcapUV.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -/** - * TSL function for creating a matcap uv node. - * - * Can be used to compute texture coordinates for projecting a - * matcap onto a mesh. Used by {@link MeshMatcapNodeMaterial}. - * - * @tsl - * @function - * @returns {Node} The matcap UV coordinates. - */ -export const matcapUV: any; diff --git a/jsdoc-testing/jsdoc/nodes/utils/MaxMipLevelNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/MaxMipLevelNode.d.ts deleted file mode 100644 index a54346cc2..000000000 --- a/jsdoc-testing/jsdoc/nodes/utils/MaxMipLevelNode.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export default MaxMipLevelNode; -/** - * TSL function for creating a max mip level node. - * - * @tsl - * @function - * @param {TextureNode} textureNode - The texture node to compute the max mip level for. - * @returns {MaxMipLevelNode} - */ -export const maxMipLevel: any; -/** - * A special type of uniform node that computes the - * maximum mipmap level for a given texture node. - * - * ```js - * const level = maxMipLevel( textureNode ); - * ``` - * - * @augments UniformNode - */ -declare class MaxMipLevelNode extends UniformNode { - /** - * Constructs a new max mip level node. - * - * @param {TextureNode} textureNode - The texture node to compute the max mip level for. - */ - constructor(textureNode: TextureNode); - /** - * The texture node to compute the max mip level for. - * - * @private - * @type {TextureNode} - */ - private _textureNode; - /** - * The texture node to compute the max mip level for. - * - * @readonly - * @type {TextureNode} - */ - readonly get textureNode(): TextureNode; - /** - * The texture. - * - * @readonly - * @type {Texture} - */ - readonly get texture(): Texture; - update(): void; -} -import UniformNode from '../core/UniformNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/MemberNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/MemberNode.d.ts deleted file mode 100644 index 45fabbe06..000000000 --- a/jsdoc-testing/jsdoc/nodes/utils/MemberNode.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -export default MemberNode; -/** - * Base class for representing member access on an object-like - * node data structures. - * - * @augments Node - */ -declare class MemberNode extends Node { - /** - * Constructs a member node. - * - * @param {Node} structNode - The struct node. - * @param {string} property - The property name. - */ - constructor(structNode: Node, property: string); - /** - * The struct node. - * - * @type {Node} - */ - structNode: Node; - /** - * The property name. - * - * @type {Node} - */ - property: Node; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isMemberNode: boolean; - hasMember(builder: any): boolean; - generateNodeType(builder: any): string; - getMemberType(builder: any, name: any): any; - generate(builder: any): any; -} -import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/Oscillators.d.ts b/jsdoc-testing/jsdoc/nodes/utils/Oscillators.d.ts deleted file mode 100644 index 08bd81824..000000000 --- a/jsdoc-testing/jsdoc/nodes/utils/Oscillators.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export function oscSine(t?: Node): Node; -export function oscSquare(t?: Node): Node; -export function oscTriangle(t?: Node): Node; -export function oscSawtooth(t?: Node): Node; diff --git a/jsdoc-testing/jsdoc/nodes/utils/Packing.d.ts b/jsdoc-testing/jsdoc/nodes/utils/Packing.d.ts deleted file mode 100644 index dcae33557..000000000 --- a/jsdoc-testing/jsdoc/nodes/utils/Packing.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -export function directionToColor(node: Node): Node; -export function colorToDirection(node: Node): Node; -export function unpackNormal(xy: Node): Node; diff --git a/jsdoc-testing/jsdoc/nodes/utils/PostProcessingUtils.d.ts b/jsdoc-testing/jsdoc/nodes/utils/PostProcessingUtils.d.ts deleted file mode 100644 index 2e88343c5..000000000 --- a/jsdoc-testing/jsdoc/nodes/utils/PostProcessingUtils.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Computes a position in view space based on a fragment's screen position expressed as uv coordinates, the fragments - * depth value and the camera's inverse projection matrix. - * - * @tsl - * @function - * @param {Node} screenPosition - The fragment's screen position expressed as uv coordinates. - * @param {Node} depth - The fragment's depth value. - * @param {Node} projectionMatrixInverse - The camera's inverse projection matrix. - * @return {Node} The fragments position in view space. - */ -export const getViewPosition: () => void; -/** - * Computes a screen position expressed as uv coordinates based on a fragment's position in view space - * and the camera's projection matrix - * - * @tsl - * @function - * @param {Node} viewPosition - The fragments position in view space. - * @param {Node} projectionMatrix - The camera's projection matrix. - * @return {Node} The fragment's screen position expressed as uv coordinates. - */ -export const getScreenPosition: () => void; -/** - * Computes a normal vector based on depth data. Can be used as a fallback when no normal render - * target is available or if flat surface normals are required. - * - * @tsl - * @function - * @param {Node} uv - The texture coordinate. - * @param {DepthTexture} depthTexture - The depth texture. - * @param {Node} projectionMatrixInverse - The camera's inverse projection matrix. - * @return {Node} The computed normal vector. - */ -export const getNormalFromDepth: () => void; -/** - * Interleaved Gradient Noise (IGN) from Jimenez 2014. - * - * IGN has "low discrepancy" resulting in evenly distributed samples. It's superior compared to - * default white noise, blue noise or Bayer. - * - * References: - * - {@link https://www.iryoku.com/next-generation-post-processing-in-call-of-duty-advanced-warfare/} - * - {@link https://blog.demofox.org/2022/01/01/interleaved-gradient-noise-a-different-kind-of-low-discrepancy-sequence/} - * - * @tsl - * @function - * @param {Node} position - The input position, usually screen coordinates. - * @return {Node} The noise value. - */ -export const interleavedGradientNoise: any; -/** - * Vogel disk sampling for uniform circular distribution. - * - * This function generates sample points distributed uniformly on a disk using the golden angle, - * resulting in an efficient low-discrepancy sequence for sampling. The rotation parameter (phi) - * allows randomizing the pattern per-pixel when combined with IGN. - * - * @tsl - * @function - * @param {Node} sampleIndex - The index of the current sample (0-based). - * @param {Node} samplesCount - The total number of samples. - * @param {Node} phi - Rotation angle in radians (typically from IGN * 2π). - * @return {Node} A 2D point on the unit disk. - */ -export const vogelDiskSample: any; diff --git a/jsdoc-testing/jsdoc/nodes/utils/RTTNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/RTTNode.d.ts deleted file mode 100644 index ed96e2902..000000000 --- a/jsdoc-testing/jsdoc/nodes/utils/RTTNode.d.ts +++ /dev/null @@ -1,120 +0,0 @@ -export default RTTNode; -export function rtt(node: Node, ...params: any[]): RTTNode; -export function convertToTexture(node: Node, ...params: any[]): RTTNode; -/** - * `RTTNode` takes another node and uses it with a `QuadMesh` to render into a texture (RTT). - * This module is especially relevant in context of post processing where certain nodes require - * texture input for their effects. With the helper function `convertToTexture()` which is based - * on this module, the node system can automatically ensure texture input if required. - * - * @augments TextureNode - */ -declare class RTTNode extends TextureNode { - /** - * Constructs a new RTT node. - * - * @param {Node} node - The node to render a texture with. - * @param {?number} [width=null] - The width of the internal render target. If not width is applied, the render target is automatically resized. - * @param {?number} [height=null] - The height of the internal render target. - * @param {Object} [options={type:HalfFloatType}] - The options for the internal render target. - */ - constructor(node: Node, width?: number | null, height?: number | null, options?: Object); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isRTTNode: boolean; - /** - * The node to render a texture with. - * - * @type {Node} - */ - node: Node; - /** - * The width of the internal render target. - * If not width is applied, the render target is automatically resized. - * - * @type {?number} - * @default null - */ - width: number | null; - /** - * The height of the internal render target. - * - * @type {?number} - * @default null - */ - height: number | null; - /** - * The pixel ratio - * - * @type {number} - * @default 1 - */ - pixelRatio: number; - /** - * The render target - * - * @type {RenderTarget} - */ - renderTarget: RenderTarget; - /** - * Whether the texture requires an update or not. - * - * @type {boolean} - * @default true - */ - textureNeedsUpdate: boolean; - /** - * Whether the texture should automatically be updated or not. - * - * @type {boolean} - * @default true - */ - autoUpdate: boolean; - /** - * The node which is used with the quad mesh for RTT. - * - * @private - * @type {Node} - * @default null - */ - private _rttNode; - /** - * The internal quad mesh for RTT. - * - * @private - * @type {QuadMesh} - */ - private _quadMesh; - /** - * Whether the internal render target should automatically be resized or not. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly get autoResize(): boolean; - setup(builder: any): void; - /** - * Sets the size of the internal render target - * - * @param {number} width - The width to set. - * @param {number} height - The width to set. - */ - setSize(width: number, height: number): void; - /** - * Sets the pixel ratio. This will also resize the render target. - * - * @param {number} pixelRatio - The pixel ratio to set. - */ - setPixelRatio(pixelRatio: number): void; - updateBefore({ renderer }: { - renderer: any; - }): void; -} -import TextureNode from '../accessors/TextureNode.js'; -import { RenderTarget } from '../../core/RenderTarget.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/ReflectorNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/ReflectorNode.d.ts deleted file mode 100644 index 0ea38a3c6..000000000 --- a/jsdoc-testing/jsdoc/nodes/utils/ReflectorNode.d.ts +++ /dev/null @@ -1,233 +0,0 @@ -export function reflector(parameters?: { - target?: Object3D | undefined; - resolution?: number | undefined; - generateMipmaps?: boolean | undefined; - bounces?: boolean | undefined; - depth?: boolean | undefined; - samples?: number | undefined; - defaultTexture?: TextureNode | undefined; - reflector?: ReflectorBaseNode | undefined; -}): ReflectorNode; -export default ReflectorNode; -import { Object3D } from '../../core/Object3D.js'; -import TextureNode from '../accessors/TextureNode.js'; -/** - * Holds the actual implementation of the reflector. - * - * TODO: Explain why `ReflectorBaseNode`. Originally the entire logic was implemented - * in `ReflectorNode`, see #29619. - * - * @private - * @augments Node - */ -declare class ReflectorBaseNode extends Node { - /** - * Constructs a new reflector base node. - * - * @param {TextureNode} textureNode - Represents the rendered reflections as a texture node. - * @param {Object} [parameters={}] - An object holding configuration parameters. - * @param {Object3D} [parameters.target=new Object3D()] - The 3D object the reflector is linked to. - * @param {number} [parameters.resolutionScale=1] - The resolution scale. - * @param {boolean} [parameters.generateMipmaps=false] - Whether mipmaps should be generated or not. - * @param {boolean} [parameters.bounces=true] - Whether reflectors can render other reflector nodes or not. - * @param {boolean} [parameters.depth=false] - Whether depth data should be generated or not. - * @param {number} [parameters.samples] - Anti-Aliasing samples of the internal render-target. - */ - constructor(textureNode: TextureNode, parameters?: { - target?: Object3D | undefined; - resolutionScale?: number | undefined; - generateMipmaps?: boolean | undefined; - bounces?: boolean | undefined; - depth?: boolean | undefined; - samples?: number | undefined; - }); - /** - * Represents the rendered reflections as a texture node. - * - * @type {TextureNode} - */ - textureNode: TextureNode; - /** - * The 3D object the reflector is linked to. - * - * @type {Object3D} - * @default {new Object3D()} - */ - target: Object3D; - /** - * The resolution scale. - * - * @type {number} - * @default {1} - */ - resolutionScale: number; - /** - * Whether mipmaps should be generated or not. - * - * @type {boolean} - * @default {false} - */ - generateMipmaps: boolean; - /** - * Whether reflectors can render other reflector nodes or not. - * - * @type {boolean} - * @default {true} - */ - bounces: boolean; - /** - * Whether depth data should be generated or not. - * - * @type {boolean} - * @default {false} - */ - depth: boolean; - /** - * The number of anti-aliasing samples for the render-target - * - * @type {number} - * @default {0} - */ - samples: number; - /** - * Weak map for managing virtual cameras. - * - * @type {WeakMap} - */ - virtualCameras: WeakMap; - /** - * Weak map for managing render targets. - * - * @type {Map} - */ - renderTargets: Map; - /** - * Force render even if reflector is facing away from camera. - * - * @type {boolean} - * @default {false} - */ - forceUpdate: boolean; - /** - * Whether the reflector has been rendered or not. - * - * When the reflector is facing away from the camera, - * this flag is set to `false` and the texture will be empty(black). - * - * @type {boolean} - * @default {false} - */ - hasOutput: boolean; - /** - * Updates the resolution of the internal render target. - * - * @private - * @param {RenderTarget} renderTarget - The render target to resize. - * @param {Renderer} renderer - The renderer that is used to determine the new size. - */ - private _updateResolution; - setup(builder: any): Node | null; - /** - * Returns a virtual camera for the given camera. The virtual camera is used to - * render the scene from the reflector's view so correct reflections can be produced. - * - * @param {Camera} camera - The scene's camera. - * @return {Camera} The corresponding virtual camera. - */ - getVirtualCamera(camera: Camera): Camera; - /** - * Returns a render target for the given camera. The reflections are rendered - * into this render target. - * - * @param {Camera} camera - The scene's camera. - * @return {RenderTarget} The render target. - */ - getRenderTarget(camera: Camera): RenderTarget; - updateBefore(frame: any): false | undefined; - set resolution(value: number); - /** - * The resolution scale. - * - * @deprecated - * @type {number} - * @default {1} - */ - get resolution(): number; -} -/** - * This node can be used to implement mirror-like flat reflective surfaces. - * - * ```js - * const groundReflector = reflector(); - * material.colorNode = groundReflector; - * - * const plane = new Mesh( geometry, material ); - * plane.add( groundReflector.target ); - * ``` - * - * @augments TextureNode - */ -declare class ReflectorNode extends TextureNode { - /** - * Constructs a new reflector node. - * - * @param {Object} [parameters={}] - An object holding configuration parameters. - * @param {Object3D} [parameters.target=new Object3D()] - The 3D object the reflector is linked to. - * @param {number} [parameters.resolutionScale=1] - The resolution scale. - * @param {boolean} [parameters.generateMipmaps=false] - Whether mipmaps should be generated or not. - * @param {boolean} [parameters.bounces=true] - Whether reflectors can render other reflector nodes or not. - * @param {boolean} [parameters.depth=false] - Whether depth data should be generated or not. - * @param {number} [parameters.samples] - Anti-Aliasing samples of the internal render-target. - * @param {TextureNode} [parameters.defaultTexture] - The default texture node. - * @param {ReflectorBaseNode} [parameters.reflector] - The reflector base node. - */ - constructor(parameters?: { - target?: Object3D | undefined; - resolutionScale?: number | undefined; - generateMipmaps?: boolean | undefined; - bounces?: boolean | undefined; - depth?: boolean | undefined; - samples?: number | undefined; - defaultTexture?: TextureNode | undefined; - reflector?: ReflectorBaseNode | undefined; - }); - /** - * A reference to the internal reflector base node which holds the actual implementation. - * - * @private - * @type {ReflectorBaseNode} - * @default ReflectorBaseNode - */ - private _reflectorBaseNode; - /** - * A reference to the internal depth node. - * - * @private - * @type {?Node} - * @default null - */ - private _depthNode; - /** - * A reference to the internal reflector node. - * - * @type {ReflectorBaseNode} - */ - get reflector(): ReflectorBaseNode; - /** - * A reference to 3D object the reflector is linked to. - * - * @type {Object3D} - */ - get target(): Object3D; - /** - * Returns a node representing the mirror's depth. That can be used - * to implement more advanced reflection effects like distance attenuation. - * - * @return {Node} The depth node. - */ - getDepthNode(): Node; - setup(builder: any): void; - clone(): any; -} -import Node from '../core/Node.js'; -import { RenderTarget } from '../../core/RenderTarget.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/Remap.d.ts b/jsdoc-testing/jsdoc/nodes/utils/Remap.d.ts deleted file mode 100644 index b6aacd043..000000000 --- a/jsdoc-testing/jsdoc/nodes/utils/Remap.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -/** - * This node allows to remap a node value from one range into another but with enabled clamping. E.g a value of - * `0.4` in the range `[ 0.3, 0.5 ]` should be remapped into the normalized range `[ 0, 1 ]`. - * `remapClamp` takes care of that and converts the original value of `0.4` to `0.5`. - * - * @tsl - * @function - * @param {Node} node - The node that should be remapped. - * @param {Node} inLowNode - The source or current lower bound of the range. - * @param {Node} inHighNode - The source or current upper bound of the range. - * @param {?Node} [outLowNode=float(0)] - The target lower bound of the range. - * @param {?Node} [outHighNode=float(1)] - The target upper bound of the range. - * @returns {Node} - */ -export function remapClamp(node: Node, inLowNode: Node, inHighNode: Node, outLowNode?: Node | null, outHighNode?: Node | null): Node; -/** - * This node allows to remap a node value from one range into another. E.g a value of - * `0.4` in the range `[ 0.3, 0.5 ]` should be remapped into the normalized range `[ 0, 1 ]`. - * `remap` takes care of that and converts the original value of `0.4` to `0.5`. - * - * @tsl - * @function - * @param {Node} node - The node that should be remapped. - * @param {Node} inLowNode - The source or current lower bound of the range. - * @param {Node} inHighNode - The source or current upper bound of the range. - * @param {?Node} [outLowNode=float(0)] - The target lower bound of the range. - * @param {?Node} [outHighNode=float(1)] - The target upper bound of the range. - * @returns {Node} - */ -export const remap: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/utils/RotateNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/RotateNode.d.ts deleted file mode 100644 index ed6dfe36b..000000000 --- a/jsdoc-testing/jsdoc/nodes/utils/RotateNode.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -export default RotateNode; -/** - * TSL function for creating a rotate node. - * - * @tsl - * @function - * @param {Node} positionNode - The position node. - * @param {Node} rotationNode - Represents the rotation that is applied to the position node. Depending - * on whether the position data are 2D or 3D, the rotation is expressed a single float value or an Euler value. - * @returns {RotateNode} - */ -export const rotate: any; -/** - * Applies a rotation to the given position node. - * - * @augments TempNode - */ -declare class RotateNode extends TempNode { - /** - * Constructs a new rotate node. - * - * @param {Node} positionNode - The position node. - * @param {Node} rotationNode - Represents the rotation that is applied to the position node. Depending - * on whether the position data are 2D or 3D, the rotation is expressed a single float value or an Euler value. - */ - constructor(positionNode: Node, rotationNode: Node); - /** - * The position node. - * - * @type {Node} - */ - positionNode: Node; - /** - * Represents the rotation that is applied to the position node. - * Depending on whether the position data are 2D or 3D, the rotation is expressed a single float value or an Euler value. - * - * @type {Node} - */ - rotationNode: Node; - /** - * The type of the {@link RotateNode#positionNode} defines the node's type. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The node's type. - */ - generateNodeType(builder: NodeBuilder): string; - setup(builder: any): any; -} -import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/SampleNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/SampleNode.d.ts deleted file mode 100644 index 6fb9d738c..000000000 --- a/jsdoc-testing/jsdoc/nodes/utils/SampleNode.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -export default SampleNode; -export function sample(callback: Function, uv?: Node | null): SampleNode; -/** - * Class representing a node that samples a value using a provided callback function. - * - * @extends Node - */ -declare class SampleNode extends Node { - /** - * Creates an instance of SampleNode. - * - * @param {Function} callback - The function to be called when sampling. Should accept a UV node and return a value. - * @param {?Node} [uvNode=null] - The UV node to be used in the texture sampling. - */ - constructor(callback: Function, uvNode?: Node | null); - callback: Function; - /** - * Represents the texture coordinates. - * - * @type {?Node} - * @default null - */ - uvNode: Node | null; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isSampleNode: boolean; - /** - * Sets up the node by sampling with the default UV accessor. - * - * @returns {Node} The result of the callback function when called with the UV node. - */ - setup(): Node; - /** - * Calls the callback function with the provided UV node. - * - * @param {Node} uv - The UV node or value to be passed to the callback. - * @returns {Node} The result of the callback function. - */ - sample(uv: Node): Node; -} -import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/SetNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/SetNode.d.ts deleted file mode 100644 index 4dcfbd1b9..000000000 --- a/jsdoc-testing/jsdoc/nodes/utils/SetNode.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -export default SetNode; -/** - * This module is part of the TSL core and usually not used in app level code. - * `SetNode` represents a set operation which means it is used to implement any - * `setXYZW()`, `setRGBA()` and `setSTPQ()` method invocations on node objects. - * For example: - * ```js - * materialLine.colorNode = color( 0, 0, 0 ).setR( float( 1 ) ); - * ``` - * - * @augments TempNode - */ -declare class SetNode extends TempNode { - /** - * Constructs a new set node. - * - * @param {Node} sourceNode - The node that should be updated. - * @param {string} components - The components that should be updated. - * @param {Node} targetNode - The value node. - */ - constructor(sourceNode: Node, components: string, targetNode: Node); - /** - * The node that should be updated. - * - * @type {Node} - */ - sourceNode: Node; - /** - * The components that should be updated. - * - * @type {string} - */ - components: string; - /** - * The value node. - * - * @type {Node} - */ - targetNode: Node; - /** - * This method is overwritten since the node type is inferred from {@link SetNode#sourceNode}. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The node type. - */ - generateNodeType(builder: NodeBuilder): string; - generate(builder: any): string; -} -import TempNode from '../core/TempNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/SplitNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/SplitNode.d.ts deleted file mode 100644 index 9941f1852..000000000 --- a/jsdoc-testing/jsdoc/nodes/utils/SplitNode.d.ts +++ /dev/null @@ -1,65 +0,0 @@ -export default SplitNode; -/** - * This module is part of the TSL core and usually not used in app level code. - * `SplitNode` represents a property access operation which means it is - * used to implement any `.xyzw`, `.rgba` and `stpq` usage on node objects. - * For example: - * ```js - * const redValue = color.r; - * ``` - * - * @augments Node - */ -declare class SplitNode extends Node { - /** - * Constructs a new split node. - * - * @param {Node} node - The node that should be accessed. - * @param {string} [components='x'] - The components that should be accessed. - */ - constructor(node: Node, components?: string); - /** - * The node that should be accessed. - * - * @type {Node} - */ - node: Node; - /** - * The components that should be accessed. - * - * @type {string} - */ - components: string; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isSplitNode: boolean; - /** - * Returns the vector length which is computed based on the requested components. - * - * @return {number} The vector length. - */ - getVectorLength(): number; - /** - * Returns the component type of the node's type. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The component type. - */ - getComponentType(builder: NodeBuilder): string; - /** - * This method is overwritten since the node type is inferred from requested components. - * - * @param {NodeBuilder} builder - The current node builder. - * @return {string} The node type. - */ - generateNodeType(builder: NodeBuilder): string; - generate(builder: any, output: any): any; - serialize(data: any): void; - deserialize(data: any): void; -} -import Node from '../core/Node.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/SpriteSheetUV.d.ts b/jsdoc-testing/jsdoc/nodes/utils/SpriteSheetUV.d.ts deleted file mode 100644 index 572dccc2c..000000000 --- a/jsdoc-testing/jsdoc/nodes/utils/SpriteSheetUV.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * TSL function for computing texture coordinates for animated sprite sheets. - * - * ```js - * const uvNode = spritesheetUV( vec2( 6, 6 ), uv(), time.mul( animationSpeed ) ); - * - * material.colorNode = texture( spriteSheet, uvNode ); - * ``` - * - * @tsl - * @function - * @param {Node} countNode - The node that defines the number of sprites in the x and y direction (e.g 6x6). - * @param {?Node} [uvNode=uv()] - The uv node. - * @param {?Node} [frameNode=float(0)] - The node that defines the current frame/sprite. - * @returns {Node} - */ -export const spritesheetUV: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/utils/SpriteUtils.d.ts b/jsdoc-testing/jsdoc/nodes/utils/SpriteUtils.d.ts deleted file mode 100644 index 5350a7581..000000000 --- a/jsdoc-testing/jsdoc/nodes/utils/SpriteUtils.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -/** - * This can be used to achieve a billboarding behavior for flat meshes. That means they are - * oriented always towards the camera. - * - * ```js - * material.vertexNode = billboarding(); - * ``` - * - * @tsl - * @function - * @param {Object} config - The configuration object. - * @param {?Node} [config.position=null] - Can be used to define the vertex positions in world space. - * @param {boolean} [config.horizontal=true] - Whether to follow the camera rotation horizontally or not. - * @param {boolean} [config.vertical=false] - Whether to follow the camera rotation vertically or not. - * @return {Node} The updated vertex position in clip space. - */ -export const billboarding: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/utils/StorageArrayElementNode.d.ts b/jsdoc-testing/jsdoc/nodes/utils/StorageArrayElementNode.d.ts deleted file mode 100644 index 5257eebfd..000000000 --- a/jsdoc-testing/jsdoc/nodes/utils/StorageArrayElementNode.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export default StorageArrayElementNode; -/** - * TSL function for creating a storage element node. - * - * @tsl - * @function - * @param {StorageBufferNode} storageBufferNode - The storage buffer node. - * @param {Node} indexNode - The index node that defines the element access. - * @returns {StorageArrayElementNode} - */ -export const storageElement: any; -/** - * This class enables element access on instances of {@link StorageBufferNode}. - * In most cases, it is indirectly used when accessing elements with the - * {@link StorageBufferNode#element} method. - * - * ```js - * const position = positionStorage.element( instanceIndex ); - * ``` - * - * @augments ArrayElementNode - */ -declare class StorageArrayElementNode extends ArrayElementNode { - /** - * Constructs storage buffer element node. - * - * @param {StorageBufferNode} storageBufferNode - The storage buffer node. - * @param {Node} indexNode - The index node that defines the element access. - */ - constructor(storageBufferNode: StorageBufferNode, indexNode: Node); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isStorageArrayElementNode: boolean; - /** - * The storage buffer node. - * - * @param {Node} value - * @type {StorageBufferNode} - */ - set storageBufferNode(value: Node); - get storageBufferNode(): Node; - getMemberType(builder: any, name: any): any; - setup(builder: any): import("../Nodes.js").Node | null; - generate(builder: any, output: any): any; -} -import ArrayElementNode from './ArrayElementNode.js'; diff --git a/jsdoc-testing/jsdoc/nodes/utils/Timer.d.ts b/jsdoc-testing/jsdoc/nodes/utils/Timer.d.ts deleted file mode 100644 index 9131612ca..000000000 --- a/jsdoc-testing/jsdoc/nodes/utils/Timer.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * Represents the elapsed time in seconds. - * - * @tsl - * @type {UniformNode} - */ -export const time: UniformNode; -/** - * Represents the delta time in seconds. - * - * @tsl - * @type {UniformNode} - */ -export const deltaTime: UniformNode; -/** - * Represents the current frame ID. - * - * @tsl - * @type {UniformNode} - */ -export const frameId: UniformNode; diff --git a/jsdoc-testing/jsdoc/nodes/utils/TriplanarTextures.d.ts b/jsdoc-testing/jsdoc/nodes/utils/TriplanarTextures.d.ts deleted file mode 100644 index df819d30b..000000000 --- a/jsdoc-testing/jsdoc/nodes/utils/TriplanarTextures.d.ts +++ /dev/null @@ -1,21 +0,0 @@ -/** - * TSL function for creating a triplanar textures node. - * - * Can be used for triplanar texture mapping. - * - * ```js - * material.colorNode = triplanarTexture( texture( diffuseMap ) ); - * ``` - * - * @tsl - * @function - * @param {Node} textureXNode - First texture node. - * @param {?Node} [textureYNode=null] - Second texture node. When not set, the shader will sample from `textureXNode` instead. - * @param {?Node} [textureZNode=null] - Third texture node. When not set, the shader will sample from `textureXNode` instead. - * @param {?Node} [scaleNode=float(1)] - The scale node. - * @param {?Node} [positionNode=positionLocal] - Vertex positions in local space. - * @param {?Node} [normalNode=normalLocal] - Normals in local space. - * @returns {Node} - */ -export const triplanarTextures: () => void; -export function triplanarTexture(...params: any[]): Node; diff --git a/jsdoc-testing/jsdoc/nodes/utils/UVUtils.d.ts b/jsdoc-testing/jsdoc/nodes/utils/UVUtils.d.ts deleted file mode 100644 index fb078e354..000000000 --- a/jsdoc-testing/jsdoc/nodes/utils/UVUtils.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Replaces the default UV coordinates used in texture lookups. - * - * ```js - *material.contextNode = replaceDefaultUV( ( textureNode ) => { - * - * // ... - * return customUVCoordinates; - * - *} ); - *``` - * - * @tsl - * @function - * @param {function(Node):Node|Node} callback - A callback that receives the texture node - * and must return the new uv coordinates. - * @param {Node} [node=null] - An optional node to which the context will be applied. - * @return {ContextNode} A context node that replaces the default UV coordinates. - */ -export function replaceDefaultUV(callback: (arg0: Node) => Node | Node, node?: Node): ContextNode; -/** - * Rotates the given uv coordinates around a center point - * - * @tsl - * @function - * @param {Node} uv - The uv coordinates. - * @param {Node} rotation - The rotation defined in radians. - * @param {Node} center - The center of rotation - * @return {Node} The rotated uv coordinates. - */ -export const rotateUV: () => void; -/** - * Applies a spherical warping effect to the given uv coordinates. - * - * @tsl - * @function - * @param {Node} uv - The uv coordinates. - * @param {Node} strength - The strength of the effect. - * @param {Node} center - The center point - * @return {Node} The updated uv coordinates. - */ -export const spherizeUV: () => void; diff --git a/jsdoc-testing/jsdoc/nodes/utils/ViewportUtils.d.ts b/jsdoc-testing/jsdoc/nodes/utils/ViewportUtils.d.ts deleted file mode 100644 index 8622c377b..000000000 --- a/jsdoc-testing/jsdoc/nodes/utils/ViewportUtils.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** - * A special version of a screen uv function that involves a depth comparison - * when computing the final uvs. The function mitigates visual errors when - * using viewport texture nodes for refraction purposes. Without this function - * objects in front of a refractive surface might appear on the refractive surface - * which is incorrect. - * - * @tsl - * @function - * @param {?Node} uv - Optional uv coordinates. By default `screenUV` is used. - * @return {Node} The update uv coordinates. - */ -export const viewportSafeUV: () => void; diff --git a/jsdoc-testing/jsdoc/objects/Group.d.ts b/jsdoc-testing/jsdoc/objects/Group.d.ts deleted file mode 100644 index 4def40910..000000000 --- a/jsdoc-testing/jsdoc/objects/Group.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * This is almost identical to an {@link Object3D}. Its purpose is to - * make working with groups of objects syntactically clearer. - * - * ```js - * // Create a group and add the two cubes. - * // These cubes can now be rotated / scaled etc as a group. - * const group = new THREE.Group(); - * - * group.add( meshA ); - * group.add( meshB ); - * - * scene.add( group ); - * ``` - * - * @augments Object3D - */ -export class Group extends Object3D { - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isGroup: boolean; - type: string; -} -import { Object3D } from '../core/Object3D.js'; diff --git a/jsdoc-testing/jsdoc/objects/Line.d.ts b/jsdoc-testing/jsdoc/objects/Line.d.ts deleted file mode 100644 index 204db3fa8..000000000 --- a/jsdoc-testing/jsdoc/objects/Line.d.ts +++ /dev/null @@ -1,94 +0,0 @@ -/** - * A continuous line. The line are rendered by connecting consecutive - * vertices with straight lines. - * - * ```js - * const material = new THREE.LineBasicMaterial( { color: 0x0000ff } ); - * - * const points = []; - * points.push( new THREE.Vector3( - 10, 0, 0 ) ); - * points.push( new THREE.Vector3( 0, 10, 0 ) ); - * points.push( new THREE.Vector3( 10, 0, 0 ) ); - * - * const geometry = new THREE.BufferGeometry().setFromPoints( points ); - * - * const line = new THREE.Line( geometry, material ); - * scene.add( line ); - * ``` - * - * @augments Object3D - */ -export class Line extends Object3D { - /** - * Constructs a new line. - * - * @param {BufferGeometry} [geometry] - The line geometry. - * @param {Material|Array} [material] - The line material. - */ - constructor(geometry?: BufferGeometry, material?: Material | Array); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isLine: boolean; - type: string; - /** - * The line geometry. - * - * @type {BufferGeometry} - */ - geometry: BufferGeometry; - /** - * The line material. - * - * @type {Material|Array} - * @default LineBasicMaterial - */ - material: Material | Array; - /** - * A dictionary representing the morph targets in the geometry. The key is the - * morph targets name, the value its attribute index. This member is `undefined` - * by default and only set when morph targets are detected in the geometry. - * - * @type {Object|undefined} - * @default undefined - */ - morphTargetDictionary: { - [x: string]: number; - } | undefined; - /** - * An array of weights typically in the range `[0,1]` that specify how much of the morph - * is applied. This member is `undefined` by default and only set when morph targets are - * detected in the geometry. - * - * @type {Array|undefined} - * @default undefined - */ - morphTargetInfluences: Array | undefined; - copy(source: any, recursive: any): this; - /** - * Computes an array of distance values which are necessary for rendering dashed lines. - * For each vertex in the geometry, the method calculates the cumulative length from the - * current point to the very beginning of the line. - * - * @return {Line} A reference to this line. - */ - computeLineDistances(): Line; - /** - * Computes intersection points between a casted ray and this line. - * - * @param {Raycaster} raycaster - The raycaster. - * @param {Array} intersects - The target array that holds the intersection points. - */ - raycast(raycaster: Raycaster, intersects: Array): void; - /** - * Sets the values of {@link Line#morphTargetDictionary} and {@link Line#morphTargetInfluences} - * to make sure existing morph targets can influence this 3D object. - */ - updateMorphTargets(): void; -} -import { Object3D } from '../core/Object3D.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; diff --git a/jsdoc-testing/jsdoc/objects/LineSegments.d.ts b/jsdoc-testing/jsdoc/objects/LineSegments.d.ts deleted file mode 100644 index 88df8f57f..000000000 --- a/jsdoc-testing/jsdoc/objects/LineSegments.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -/** - * A series of lines drawn between pairs of vertices. - * - * @augments Line - */ -export class LineSegments extends Line { - /** - * Constructs a new line segments. - * - * @param {BufferGeometry} [geometry] - The line geometry. - * @param {Material|Array} [material] - The line material. - */ - constructor(geometry?: BufferGeometry, material?: Material | Array); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isLineSegments: boolean; - computeLineDistances(): this; -} -import { Line } from './Line.js'; diff --git a/jsdoc-testing/jsdoc/objects/Mesh.d.ts b/jsdoc-testing/jsdoc/objects/Mesh.d.ts deleted file mode 100644 index a377e9c7d..000000000 --- a/jsdoc-testing/jsdoc/objects/Mesh.d.ts +++ /dev/null @@ -1,97 +0,0 @@ -/** - * Class representing triangular polygon mesh based objects. - * - * ```js - * const geometry = new THREE.BoxGeometry( 1, 1, 1 ); - * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } ); - * const mesh = new THREE.Mesh( geometry, material ); - * scene.add( mesh ); - * ``` - * - * @augments Object3D - */ -export class Mesh extends Object3D { - /** - * Constructs a new mesh. - * - * @param {BufferGeometry} [geometry] - The mesh geometry. - * @param {Material|Array} [material] - The mesh material. - */ - constructor(geometry?: BufferGeometry, material?: Material | Array); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isMesh: boolean; - type: string; - /** - * The mesh geometry. - * - * @type {BufferGeometry} - */ - geometry: BufferGeometry; - /** - * The mesh material. - * - * @type {Material|Array} - * @default MeshBasicMaterial - */ - material: Material | Array; - /** - * A dictionary representing the morph targets in the geometry. The key is the - * morph targets name, the value its attribute index. This member is `undefined` - * by default and only set when morph targets are detected in the geometry. - * - * @type {Object|undefined} - * @default undefined - */ - morphTargetDictionary: { - [x: string]: number; - } | undefined; - /** - * An array of weights typically in the range `[0,1]` that specify how much of the morph - * is applied. This member is `undefined` by default and only set when morph targets are - * detected in the geometry. - * - * @type {Array|undefined} - * @default undefined - */ - morphTargetInfluences: Array | undefined; - /** - * The number of instances of this mesh. - * Can only be used with {@link WebGPURenderer}. - * - * @type {number} - * @default 1 - */ - count: number; - copy(source: any, recursive: any): this; - /** - * Sets the values of {@link Mesh#morphTargetDictionary} and {@link Mesh#morphTargetInfluences} - * to make sure existing morph targets can influence this 3D object. - */ - updateMorphTargets(): void; - /** - * Returns the local-space position of the vertex at the given index, taking into - * account the current animation state of both morph targets and skinning. - * - * @param {number} index - The vertex index. - * @param {Vector3} target - The target object that is used to store the method's result. - * @return {Vector3} The vertex position in local space. - */ - getVertexPosition(index: number, target: Vector3): Vector3; - /** - * Computes intersection points between a casted ray and this line. - * - * @param {Raycaster} raycaster - The raycaster. - * @param {Array} intersects - The target array that holds the intersection points. - */ - raycast(raycaster: Raycaster, intersects: Array): void; - _computeIntersections(raycaster: any, intersects: any, rayLocalSpace: any): void; -} -import { Object3D } from '../core/Object3D.js'; -import { BufferGeometry } from '../core/BufferGeometry.js'; -import { Vector3 } from '../math/Vector3.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/Animation.d.ts b/jsdoc-testing/jsdoc/renderers/common/Animation.d.ts deleted file mode 100644 index 276e5a64c..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/Animation.d.ts +++ /dev/null @@ -1,92 +0,0 @@ -export default Animation; -/** - * This module manages the internal animation loop of the renderer. - * - * @private - */ -declare class Animation { - /** - * Constructs a new animation loop management component. - * - * @param {Renderer} renderer - A reference to the main renderer. - * @param {NodeManager} nodes - Renderer component for managing nodes related logic. - * @param {Info} info - Renderer component for managing metrics and monitoring data. - */ - constructor(renderer: Renderer, nodes: NodeManager, info: Info); - /** - * A reference to the main renderer. - * - * @type {Renderer} - */ - renderer: Renderer; - /** - * Renderer component for managing nodes related logic. - * - * @type {NodeManager} - */ - nodes: NodeManager; - /** - * Renderer component for managing metrics and monitoring data. - * - * @type {Info} - */ - info: Info; - /** - * A reference to the context from `requestAnimationFrame()` can - * be called (usually `window`). - * - * @type {?(Window|XRSession)} - */ - _context: (Window | XRSession) | null; - /** - * The user-defined animation loop. - * - * @type {?Function} - * @default null - */ - _animationLoop: Function | null; - /** - * The requestId which is returned from the `requestAnimationFrame()` call. - * Can be used to cancel the stop the animation loop. - * - * @type {?number} - * @default null - */ - _requestId: number | null; - /** - * Starts the internal animation loop. - */ - start(): void; - /** - * Stops the internal animation loop. - */ - stop(): void; - /** - * Returns the user-level animation loop. - * - * @return {?Function} The animation loop. - */ - getAnimationLoop(): Function | null; - /** - * Defines the user-level animation loop. - * - * @param {?Function} callback - The animation loop. - */ - setAnimationLoop(callback: Function | null): void; - /** - * Returns the animation context. - * - * @return {Window|XRSession} The animation context. - */ - getContext(): Window | XRSession; - /** - * Defines the context in which `requestAnimationFrame()` is executed. - * - * @param {Window|XRSession} context - The context to set. - */ - setContext(context: Window | XRSession): void; - /** - * Frees all internal resources and stops the animation loop. - */ - dispose(): void; -} diff --git a/jsdoc-testing/jsdoc/renderers/common/Attributes.d.ts b/jsdoc-testing/jsdoc/renderers/common/Attributes.d.ts deleted file mode 100644 index 40b80e84c..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/Attributes.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -export default Attributes; -/** - * This renderer module manages geometry attributes. - * - * @private - * @augments DataMap - */ -declare class Attributes extends DataMap { - /** - * Constructs a new attribute management component. - * - * @param {Backend} backend - The renderer's backend. - * @param {Info} info - Renderer component for managing metrics and monitoring data. - */ - constructor(backend: Backend, info: Info); - /** - * The renderer's backend. - * - * @type {Backend} - */ - backend: Backend; - /** - * Renderer component for managing metrics and monitoring data. - * - * @type {Info} - */ - info: Info; - /** - * Deletes the data for the given attribute. - * - * @param {BufferAttribute} attribute - The attribute. - * @return {?Object} The deleted attribute data. - */ - delete(attribute: BufferAttribute): Object | null; - /** - * Updates the given attribute. This method creates attribute buffers - * for new attributes and updates data for existing ones. - * - * @param {BufferAttribute} attribute - The attribute to update. - * @param {number} type - The attribute type. - */ - update(attribute: BufferAttribute, type: number): void; - /** - * Utility method for handling interleaved buffer attributes correctly. - * To process them, their `InterleavedBuffer` is returned. - * - * @param {BufferAttribute} attribute - The attribute. - * @return {BufferAttribute|InterleavedBuffer} - */ - _getBufferAttribute(attribute: BufferAttribute): BufferAttribute | InterleavedBuffer; -} -import DataMap from './DataMap.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/Backend.d.ts b/jsdoc-testing/jsdoc/renderers/common/Backend.d.ts deleted file mode 100644 index 12bf8ae33..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/Backend.d.ts +++ /dev/null @@ -1,531 +0,0 @@ -export default Backend; -/** - * Most of the rendering related logic is implemented in the - * {@link Renderer} module and related management components. - * Sometimes it is required though to execute commands which are - * specific to the current 3D backend (which is WebGPU or WebGL 2). - * This abstract base class defines an interface that encapsulates - * all backend-related logic. Derived classes for each backend must - * implement the interface. - * - * @abstract - * @private - */ -declare class Backend { - /** - * Constructs a new backend. - * - * @param {Object} parameters - An object holding parameters for the backend. - */ - constructor(parameters?: Object); - /** - * The parameters of the backend. - * - * @type {Object} - */ - parameters: Object; - /** - * This weak map holds backend-specific data of objects - * like textures, attributes or render targets. - * - * @type {WeakMap} - */ - data: WeakMap; - /** - * A reference to the renderer. - * - * @type {?Renderer} - * @default null - */ - renderer: Renderer | null; - /** - * A reference to the canvas element the renderer is drawing to. - * - * @type {?(HTMLCanvasElement|OffscreenCanvas)} - * @default null - */ - domElement: (HTMLCanvasElement | OffscreenCanvas) | null; - /** - * A reference to the timestamp query pool. - * - * @type {{render: ?TimestampQueryPool, compute: ?TimestampQueryPool}} - */ - timestampQueryPool: { - render: TimestampQueryPool | null; - compute: TimestampQueryPool | null; - }; - /** - * Whether to track timestamps with a Timestamp Query API or not. - * - * @type {boolean} - * @default false - */ - trackTimestamp: boolean; - /** - * Initializes the backend so it is ready for usage. Concrete backends - * are supposed to implement their rendering context creation and related - * operations in this method. - * - * @async - * @param {Renderer} renderer - The renderer. - * @return {Promise} A Promise that resolves when the backend has been initialized. - */ - init(renderer: Renderer): Promise; - /** - * The coordinate system of the backend. - * - * @abstract - * @type {number} - * @readonly - */ - readonly get coordinateSystem(): number; - /** - * This method is executed at the beginning of a render call and - * can be used by the backend to prepare the state for upcoming - * draw calls. - * - * @abstract - * @param {RenderContext} renderContext - The render context. - */ - beginRender(): void; - /** - * This method is executed at the end of a render call and - * can be used by the backend to finalize work after draw - * calls. - * - * @abstract - * @param {RenderContext} renderContext - The render context. - */ - finishRender(): void; - /** - * This method is executed at the beginning of a compute call and - * can be used by the backend to prepare the state for upcoming - * compute tasks. - * - * @abstract - * @param {Node|Array} computeGroup - The compute node(s). - */ - beginCompute(): void; - /** - * This method is executed at the end of a compute call and - * can be used by the backend to finalize work after compute - * tasks. - * - * @abstract - * @param {Node|Array} computeGroup - The compute node(s). - */ - finishCompute(): void; - /** - * Executes a draw command for the given render object. - * - * @abstract - * @param {RenderObject} renderObject - The render object to draw. - * @param {Info} info - Holds a series of statistical information about the GPU memory and the rendering process. - */ - draw(): void; - /** - * Executes a compute command for the given compute node. - * - * @abstract - * @param {Node|Array} computeGroup - The group of compute nodes of a compute call. Can be a single compute node. - * @param {Node} computeNode - The compute node. - * @param {Array} bindings - The bindings. - * @param {ComputePipeline} computePipeline - The compute pipeline. - */ - compute(): void; - /** - * Creates a shader program from the given programmable stage. - * - * @abstract - * @param {ProgrammableStage} program - The programmable stage. - */ - createProgram(): void; - /** - * Destroys the shader program of the given programmable stage. - * - * @abstract - * @param {ProgrammableStage} program - The programmable stage. - */ - destroyProgram(): void; - /** - * Creates bindings from the given bind group definition. - * - * @abstract - * @param {BindGroup} bindGroup - The bind group. - * @param {Array} bindings - Array of bind groups. - * @param {number} cacheIndex - The cache index. - * @param {number} version - The version. - */ - createBindings(): void; - /** - * Updates the given bind group definition. - * - * @abstract - * @param {BindGroup} bindGroup - The bind group. - * @param {Array} bindings - Array of bind groups. - * @param {number} cacheIndex - The cache index. - * @param {number} version - The version. - */ - updateBindings(): void; - /** - * Updates a buffer binding. - * - * @abstract - * @param {Buffer} binding - The buffer binding to update. - */ - updateBinding(): void; - /** - * Creates a render pipeline for the given render object. - * - * @abstract - * @param {RenderObject} renderObject - The render object. - * @param {Array} promises - An array of compilation promises which are used in `compileAsync()`. - */ - createRenderPipeline(): void; - /** - * Creates a compute pipeline for the given compute node. - * - * @abstract - * @param {ComputePipeline} computePipeline - The compute pipeline. - * @param {Array} bindings - The bindings. - */ - createComputePipeline(): void; - /** - * Returns `true` if the render pipeline requires an update. - * - * @abstract - * @param {RenderObject} renderObject - The render object. - * @return {boolean} Whether the render pipeline requires an update or not. - */ - needsRenderUpdate(): boolean; - /** - * Returns a cache key that is used to identify render pipelines. - * - * @abstract - * @param {RenderObject} renderObject - The render object. - * @return {string} The cache key. - */ - getRenderCacheKey(): string; - /** - * Returns a node builder for the given render object. - * - * @abstract - * @param {RenderObject} renderObject - The render object. - * @param {Renderer} renderer - The renderer. - * @return {NodeBuilder} The node builder. - */ - createNodeBuilder(): NodeBuilder; - /** - * Updates a GPU sampler for the given texture. - * - * @abstract - * @param {Texture} texture - The texture to update the sampler for. - * @return {string} The current sampler key. - */ - updateSampler(): string; - /** - * Creates a default texture for the given texture that can be used - * as a placeholder until the actual texture is ready for usage. - * - * @abstract - * @param {Texture} texture - The texture to create a default texture for. - */ - createDefaultTexture(): void; - /** - * Defines a texture on the GPU for the given texture object. - * - * @abstract - * @param {Texture} texture - The texture. - * @param {Object} [options={}] - Optional configuration parameter. - */ - createTexture(): void; - /** - * Uploads the updated texture data to the GPU. - * - * @abstract - * @param {Texture} texture - The texture. - * @param {Object} [options={}] - Optional configuration parameter. - */ - updateTexture(): void; - /** - * Generates mipmaps for the given texture. - * - * @abstract - * @param {Texture} texture - The texture. - */ - generateMipmaps(): void; - /** - * Destroys the GPU data for the given texture object. - * - * @abstract - * @param {Texture} texture - The texture. - * @param {boolean} [isDefaultTexture=false] - Whether the texture uses a default GPU texture or not. - */ - destroyTexture(): void; - /** - * Returns texture data as a typed array. - * - * @abstract - * @async - * @param {Texture} texture - The texture to copy. - * @param {number} x - The x coordinate of the copy origin. - * @param {number} y - The y coordinate of the copy origin. - * @param {number} width - The width of the copy. - * @param {number} height - The height of the copy. - * @param {number} faceIndex - The face index. - * @return {Promise} A Promise that resolves with a typed array when the copy operation has finished. - */ - copyTextureToBuffer(): Promise; - /** - * Copies data of the given source texture to the given destination texture. - * - * @abstract - * @param {Texture} srcTexture - The source texture. - * @param {Texture} dstTexture - The destination texture. - * @param {?(Box3|Box2)} [srcRegion=null] - The region of the source texture to copy. - * @param {?(Vector2|Vector3)} [dstPosition=null] - The destination position of the copy. - * @param {number} [srcLevel=0] - The source mip level to copy from. - * @param {number} [dstLevel=0] - The destination mip level to copy to. - */ - copyTextureToTexture(): void; - /** - * Copies the current bound framebuffer to the given texture. - * - * @abstract - * @param {Texture} texture - The destination texture. - * @param {RenderContext} renderContext - The render context. - * @param {Vector4} rectangle - A four dimensional vector defining the origin and dimension of the copy. - */ - copyFramebufferToTexture(): void; - /** - * Creates the GPU buffer of a shader attribute. - * - * @abstract - * @param {BufferAttribute} attribute - The buffer attribute. - */ - createAttribute(): void; - /** - * Creates the GPU buffer of an indexed shader attribute. - * - * @abstract - * @param {BufferAttribute} attribute - The indexed buffer attribute. - */ - createIndexAttribute(): void; - /** - * Creates the GPU buffer of a storage attribute. - * - * @abstract - * @param {BufferAttribute} attribute - The buffer attribute. - */ - createStorageAttribute(): void; - /** - * Updates the GPU buffer of a shader attribute. - * - * @abstract - * @param {BufferAttribute} attribute - The buffer attribute to update. - */ - updateAttribute(): void; - /** - * Destroys the GPU buffer of a shader attribute. - * - * @abstract - * @param {BufferAttribute} attribute - The buffer attribute to destroy. - */ - destroyAttribute(): void; - /** - * Returns the backend's rendering context. - * - * @abstract - * @return {Object} The rendering context. - */ - getContext(): Object; - /** - * Backends can use this method if they have to run - * logic when the renderer gets resized. - * - * @abstract - */ - updateSize(): void; - /** - * Updates the viewport with the values from the given render context. - * - * @abstract - * @param {RenderContext} renderContext - The render context. - */ - updateViewport(): void; - /** - * Updates a unique identifier for the given render context that can be used - * to allocate resources like occlusion queries or timestamp queries. - * - * @param {RenderContext|ComputeNode} abstractRenderContext - The render context. - */ - updateTimeStampUID(abstractRenderContext: RenderContext | ComputeNode): void; - /** - * Returns a unique identifier for the given render context that can be used - * to allocate resources like occlusion queries or timestamp queries. - * - * @param {RenderContext|ComputeNode} abstractRenderContext - The render context. - * @return {string} The unique identifier. - */ - getTimestampUID(abstractRenderContext: RenderContext | ComputeNode): string; - /** - * Returns all timestamp frames for the given type. - * - * @param {string} type - The type of the time stamp. - * @return {Array} The timestamp frames. - */ - getTimestampFrames(type: string): Array; - /** - * Returns the query pool for the given uid. - * - * @param {string} uid - The unique identifier. - * @return {TimestampQueryPool} The query pool. - */ - _getQueryPool(uid: string): TimestampQueryPool; - /** - * Returns the timestamp for the given uid. - * - * @param {string} uid - The unique identifier. - * @return {number} The timestamp. - */ - getTimestamp(uid: string): number; - /** - * Returns `true` if a timestamp for the given uid is available. - * - * @param {string} uid - The unique identifier. - * @return {boolean} Whether the timestamp is available or not. - */ - hasTimestamp(uid: string): boolean; - /** - * Returns `true` if the given 3D object is fully occluded by other - * 3D objects in the scene. Backends must implement this method by using - * a Occlusion Query API. - * - * @abstract - * @param {RenderContext} renderContext - The render context. - * @param {Object3D} object - The 3D object to test. - * @return {boolean} Whether the 3D object is fully occluded or not. - */ - isOccluded(): boolean; - /** - * Resolves the time stamp for the given render context and type. - * - * @async - * @abstract - * @param {string} [type='render'] - The type of the time stamp. - * @return {Promise} A Promise that resolves with the time stamp. - */ - resolveTimestampsAsync(type?: string): Promise; - /** - * This method performs a readback operation by moving buffer data from - * a storage buffer attribute from the GPU to the CPU. - * - * @async - * @param {StorageBufferAttribute} attribute - The storage buffer attribute. - * @return {Promise} A promise that resolves with the buffer data when the data are ready. - */ - getArrayBufferAsync(): Promise; - /** - * Checks if the given feature is supported by the backend. - * - * @async - * @abstract - * @param {string} name - The feature's name. - * @return {Promise} A Promise that resolves with a bool that indicates whether the feature is supported or not. - */ - hasFeatureAsync(): Promise; - /** - * Checks if the given feature is supported by the backend. - * - * @abstract - * @param {string} name - The feature's name. - * @return {boolean} Whether the feature is supported or not. - */ - hasFeature(): boolean; - /** - * Returns the drawing buffer size. - * - * @return {Vector2} The drawing buffer size. - */ - getDrawingBufferSize(): Vector2; - /** - * Defines the scissor test. - * - * @abstract - * @param {boolean} boolean - Whether the scissor test should be enabled or not. - */ - setScissorTest(): void; - /** - * Returns the clear color and alpha into a single - * color object. - * - * @return {Color4} The clear color. - */ - getClearColor(): Color4; - /** - * Returns the DOM element. If no DOM element exists, the backend - * creates a new one. - * - * @return {HTMLCanvasElement} The DOM element. - */ - getDomElement(): HTMLCanvasElement; - /** - * Checks if the backend has the given compatibility. - * - * @abstract - * @param {string} name - The compatibility. - * @return {boolean} Whether the backend has the given compatibility or not. - */ - hasCompatibility(): boolean; - /** - * Initializes the render target defined in the given render context. - * - * @abstract - * @param {RenderContext} renderContext - The render context. - */ - initRenderTarget(): void; - /** - * Sets a dictionary for the given object into the - * internal data structure. - * - * @param {Object} object - The object. - * @param {Object} value - The dictionary to set. - */ - set(object: Object, value: Object): void; - /** - * Returns the dictionary for the given object. - * - * @param {Object} object - The object. - * @return {Object} The object's dictionary. - */ - get(object: Object): Object; - /** - * Checks if the given object has a dictionary - * with data defined. - * - * @param {Object} object - The object. - * @return {boolean} Whether a dictionary for the given object as been defined or not. - */ - has(object: Object): boolean; - /** - * Deletes an object from the internal data structure. - * - * @param {Object} object - The object to delete. - */ - delete(object: Object): void; - /** - * Delete GPU data associated with a bind group. - * - * @abstract - * @param {BindGroup} bindGroup - The bind group. - */ - deleteBindGroupData(): void; - /** - * Frees internal resources. - * - * @abstract - */ - dispose(): void; -} -import { Vector2 } from '../../math/Vector2.js'; -import Color4 from './Color4.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/Background.d.ts b/jsdoc-testing/jsdoc/renderers/common/Background.d.ts deleted file mode 100644 index f8262c348..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/Background.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -export default Background; -/** - * This renderer module manages the background. - * - * @private - * @augments DataMap - */ -declare class Background extends DataMap { - /** - * Constructs a new background management component. - * - * @param {Renderer} renderer - The renderer. - * @param {NodeManager} nodes - Renderer component for managing nodes related logic. - */ - constructor(renderer: Renderer, nodes: NodeManager); - /** - * The renderer. - * - * @type {Renderer} - */ - renderer: Renderer; - /** - * Renderer component for managing nodes related logic. - * - * @type {NodeManager} - */ - nodes: NodeManager; - /** - * Updates the background for the given scene. Depending on how `Scene.background` - * or `Scene.backgroundNode` are configured, this method might configure a simple clear - * or add a mesh to the render list for rendering the background as a textured plane - * or skybox. - * - * @param {Scene} scene - The scene. - * @param {RenderList} renderList - The current render list. - * @param {RenderContext} renderContext - The current render context. - */ - update(scene: Scene, renderList: RenderList, renderContext: RenderContext): void; -} -import DataMap from './DataMap.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/BindGroup.d.ts b/jsdoc-testing/jsdoc/renderers/common/BindGroup.d.ts deleted file mode 100644 index b31f45e55..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/BindGroup.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -export default BindGroup; -/** - * A bind group represents a collection of bindings and thus a collection - * or resources. Bind groups are assigned to pipelines to provide them - * with the required resources (like uniform buffers or textures). - * - * @private - */ -declare class BindGroup { - /** - * Constructs a new bind group. - * - * @param {string} name - The bind group's name. - * @param {Array} bindings - An array of bindings. - * @param {number} index - The group index. - */ - constructor(name?: string, bindings?: Array); - /** - * The bind group's name. - * - * @type {string} - */ - name: string; - /** - * An array of bindings. - * - * @type {Array} - */ - bindings: Array; - /** - * The group's ID. - * - * @type {number} - */ - id: number; -} diff --git a/jsdoc-testing/jsdoc/renderers/common/Binding.d.ts b/jsdoc-testing/jsdoc/renderers/common/Binding.d.ts deleted file mode 100644 index 46356fdc4..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/Binding.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -export default Binding; -/** - * A binding represents the connection between a resource (like a texture, sampler - * or uniform buffer) and the resource definition in a shader stage. - * - * This module is an abstract base class for all concrete bindings types. - * - * @abstract - * @private - */ -declare class Binding { - /** - * Constructs a new binding. - * - * @param {string} [name=''] - The binding's name. - */ - constructor(name?: string); - /** - * The binding's name. - * - * @type {string} - */ - name: string; - /** - * A bitmask that defines in what shader stages the - * binding's resource is accessible. - * - * @type {number} - */ - visibility: number; - /** - * Makes sure binding's resource is visible for the given shader stage. - * - * @param {number} visibility - The shader stage. - */ - setVisibility(visibility: number): void; - /** - * The shader stages in which the binding's resource is visible. - * - * @return {number} The visibility bitmask. - */ - getVisibility(): number; - /** - * Clones the binding. - * - * @return {Binding} The cloned binding. - */ - clone(): Binding; -} diff --git a/jsdoc-testing/jsdoc/renderers/common/Bindings.d.ts b/jsdoc-testing/jsdoc/renderers/common/Bindings.d.ts deleted file mode 100644 index ed9d0eca7..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/Bindings.d.ts +++ /dev/null @@ -1,114 +0,0 @@ -export default Bindings; -/** - * This renderer module manages the bindings of the renderer. - * - * @private - * @augments DataMap - */ -declare class Bindings extends DataMap { - /** - * Constructs a new bindings management component. - * - * @param {Backend} backend - The renderer's backend. - * @param {NodeManager} nodes - Renderer component for managing nodes related logic. - * @param {Textures} textures - Renderer component for managing textures. - * @param {Attributes} attributes - Renderer component for managing attributes. - * @param {Pipelines} pipelines - Renderer component for managing pipelines. - * @param {Info} info - Renderer component for managing metrics and monitoring data. - */ - constructor(backend: Backend, nodes: NodeManager, textures: Textures, attributes: Attributes, pipelines: Pipelines, info: Info); - /** - * The renderer's backend. - * - * @type {Backend} - */ - backend: Backend; - /** - * Renderer component for managing textures. - * - * @type {Textures} - */ - textures: Textures; - /** - * Renderer component for managing pipelines. - * - * @type {Pipelines} - */ - pipelines: Pipelines; - /** - * Renderer component for managing attributes. - * - * @type {Attributes} - */ - attributes: Attributes; - /** - * Renderer component for managing nodes related logic. - * - * @type {NodeManager} - */ - nodes: NodeManager; - /** - * Renderer component for managing metrics and monitoring data. - * - * @type {Info} - */ - info: Info; - /** - * Returns the bind groups for the given render object. - * - * @param {RenderObject} renderObject - The render object. - * @return {Array} The bind groups. - */ - getForRender(renderObject: RenderObject): Array; - /** - * Returns the bind groups for the given compute node. - * - * @param {Node} computeNode - The compute node. - * @return {Array} The bind groups. - */ - getForCompute(computeNode: Node): Array; - /** - * Updates the bindings for the given compute node. - * - * @param {Node} computeNode - The compute node. - */ - updateForCompute(computeNode: Node): void; - /** - * Updates the bindings for the given render object. - * - * @param {RenderObject} renderObject - The render object. - */ - updateForRender(renderObject: RenderObject): void; - /** - * Deletes the bindings for the given compute node. - * - * @param {Node} computeNode - The compute node. - */ - deleteForCompute(computeNode: Node): void; - /** - * Deletes the bindings for the given renderObject node. - * - * @param {RenderObject} renderObject - The renderObject. - */ - deleteForRender(renderObject: RenderObject): void; - /** - * Updates the given array of bindings. - * - * @param {Array} bindings - The bind groups. - */ - _updateBindings(bindings: Array): void; - /** - * Initializes the given bind group. - * - * @param {BindGroup} bindGroup - The bind group to initialize. - */ - _init(bindGroup: BindGroup): void; - /** - * Updates the given bind group. - * - * @param {BindGroup} bindGroup - The bind group to update. - * @param {Array} bindings - The bind groups. - */ - _update(bindGroup: BindGroup, bindings: Array): void; -} -import DataMap from './DataMap.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/BlendMode.d.ts b/jsdoc-testing/jsdoc/renderers/common/BlendMode.d.ts deleted file mode 100644 index 29223086e..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/BlendMode.d.ts +++ /dev/null @@ -1,109 +0,0 @@ -export default BlendMode; -/** - * Represents blending configuration. - * - * This class encapsulates all blending-related properties that control how - * a material's colors are combined with the colors already in the frame buffer. - */ -declare class BlendMode { - /** - * Constructs a new blending configuration. - * - * @param {(NoBlending|NormalBlending|AdditiveBlending|SubtractiveBlending|MultiplyBlending|CustomBlending|MaterialBlending)} [blending=NormalBlending] - The blending mode. - */ - constructor(blending?: (NoBlending | number | AdditiveBlending | SubtractiveBlending | MultiplyBlending | CustomBlending | MaterialBlending)); - /** - * Defines the blending type. - * - * It must be set to `CustomBlending` if custom blending properties like - * {@link BlendMode#blendSrc}, {@link BlendMode#blendDst} or {@link BlendMode#blendEquation} - * should have any effect. - * - * @type {(NoBlending|NormalBlending|AdditiveBlending|SubtractiveBlending|MultiplyBlending|CustomBlending|MaterialBlending)} - * @default NormalBlending - */ - blending: (NoBlending | number | AdditiveBlending | SubtractiveBlending | MultiplyBlending | CustomBlending | MaterialBlending); - /** - * Defines the blending source factor. - * - * This determines how the source (incoming) fragment color is factored before being added - * to the destination (existing) fragment color in the frame buffer. - * - * @type {(ZeroFactor|OneFactor|SrcColorFactor|OneMinusSrcColorFactor|SrcAlphaFactor|OneMinusSrcAlphaFactor|DstAlphaFactor|OneMinusDstAlphaFactor|DstColorFactor|OneMinusDstColorFactor|SrcAlphaSaturateFactor|ConstantColorFactor|OneMinusConstantColorFactor|ConstantAlphaFactor|OneMinusConstantAlphaFactor)} - * @default SrcAlphaFactor - */ - blendSrc: (ZeroFactor | OneFactor | SrcColorFactor | OneMinusSrcColorFactor | number | number | DstAlphaFactor | OneMinusDstAlphaFactor | DstColorFactor | OneMinusDstColorFactor | SrcAlphaSaturateFactor | ConstantColorFactor | OneMinusConstantColorFactor | ConstantAlphaFactor | OneMinusConstantAlphaFactor); - /** - * Defines the blending destination factor. - * - * This determines how the destination (existing) fragment color in the frame buffer - * is factored before being combined with the source (incoming) fragment color. - * - * @type {(ZeroFactor|OneFactor|SrcColorFactor|OneMinusSrcColorFactor|SrcAlphaFactor|OneMinusSrcAlphaFactor|DstAlphaFactor|OneMinusDstAlphaFactor|DstColorFactor|OneMinusDstColorFactor|SrcAlphaSaturateFactor|ConstantColorFactor|OneMinusConstantColorFactor|ConstantAlphaFactor|OneMinusConstantAlphaFactor)} - * @default OneMinusSrcAlphaFactor - */ - blendDst: (ZeroFactor | OneFactor | SrcColorFactor | OneMinusSrcColorFactor | number | number | DstAlphaFactor | OneMinusDstAlphaFactor | DstColorFactor | OneMinusDstColorFactor | SrcAlphaSaturateFactor | ConstantColorFactor | OneMinusConstantColorFactor | ConstantAlphaFactor | OneMinusConstantAlphaFactor); - /** - * Defines the blending equation. - * - * This determines how the source and destination colors are combined. - * - * @type {(AddEquation|SubtractEquation|ReverseSubtractEquation|MinEquation|MaxEquation)} - * @default AddEquation - */ - blendEquation: (number | SubtractEquation | ReverseSubtractEquation | MinEquation | MaxEquation); - /** - * Defines the blending source alpha factor. - * - * When set, this allows separate control of the alpha channel's source blending factor. - * If `null`, {@link BlendMode#blendSrc} is used for the alpha channel as well. - * - * @type {?(ZeroFactor|OneFactor|SrcColorFactor|OneMinusSrcColorFactor|SrcAlphaFactor|OneMinusSrcAlphaFactor|DstAlphaFactor|OneMinusDstAlphaFactor|DstColorFactor|OneMinusDstColorFactor|SrcAlphaSaturateFactor|ConstantColorFactor|OneMinusConstantColorFactor|ConstantAlphaFactor|OneMinusConstantAlphaFactor)} - * @default null - */ - blendSrcAlpha: (ZeroFactor | OneFactor | SrcColorFactor | OneMinusSrcColorFactor | number | number | DstAlphaFactor | OneMinusDstAlphaFactor | DstColorFactor | OneMinusDstColorFactor | SrcAlphaSaturateFactor | ConstantColorFactor | OneMinusConstantColorFactor | ConstantAlphaFactor | OneMinusConstantAlphaFactor) | null; - /** - * Defines the blending destination alpha factor. - * - * When set, this allows separate control of the alpha channel's destination blending factor. - * If `null`, {@link BlendMode#blendDst} is used for the alpha channel as well. - * - * @type {?(ZeroFactor|OneFactor|SrcColorFactor|OneMinusSrcColorFactor|SrcAlphaFactor|OneMinusSrcAlphaFactor|DstAlphaFactor|OneMinusDstAlphaFactor|DstColorFactor|OneMinusDstColorFactor|SrcAlphaSaturateFactor|ConstantColorFactor|OneMinusConstantColorFactor|ConstantAlphaFactor|OneMinusConstantAlphaFactor)} - * @default null - */ - blendDstAlpha: (ZeroFactor | OneFactor | SrcColorFactor | OneMinusSrcColorFactor | number | number | DstAlphaFactor | OneMinusDstAlphaFactor | DstColorFactor | OneMinusDstColorFactor | SrcAlphaSaturateFactor | ConstantColorFactor | OneMinusConstantColorFactor | ConstantAlphaFactor | OneMinusConstantAlphaFactor) | null; - /** - * Defines the blending equation of the alpha channel. - * - * When set, this allows separate control of the alpha channel's blending equation. - * If `null`, {@link BlendMode#blendEquation} is used for the alpha channel as well. - * - * @type {?(AddEquation|SubtractEquation|ReverseSubtractEquation|MinEquation|MaxEquation)} - * @default null - */ - blendEquationAlpha: (number | SubtractEquation | ReverseSubtractEquation | MinEquation | MaxEquation) | null; - /** - * Defines whether to premultiply the alpha (transparency) value. - * - * If `true`, the RGB color of the texture or material is multiplied by its alpha value. - * This is useful for transparent textures/materials where the color data - * should already include the transparency information. - * - * @type {boolean} - * @default false - */ - premultiplyAlpha: boolean; - /** - * Copies the blending properties from the given source to this instance. - * - * @param {BlendMode} source - The blending configuration to copy from. - * @return {BlendMode} A reference to this instance. - */ - copy(source: BlendMode): BlendMode; - /** - * Returns a clone of this blending configuration. - * - * @return {BlendMode} A new Blending instance with the same properties. - */ - clone(): BlendMode; -} diff --git a/jsdoc-testing/jsdoc/renderers/common/Buffer.d.ts b/jsdoc-testing/jsdoc/renderers/common/Buffer.d.ts deleted file mode 100644 index 79c9ae48f..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/Buffer.d.ts +++ /dev/null @@ -1,87 +0,0 @@ -export default Buffer; -/** - * Represents a buffer binding type. - * - * @private - * @abstract - * @augments Binding - */ -declare class Buffer extends Binding { - /** - * Constructs a new buffer. - * - * @param {string} name - The buffer's name. - * @param {TypedArray} [buffer=null] - The buffer. - */ - constructor(name: string, buffer?: TypedArray); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isBuffer: boolean; - /** - * The bytes per element. - * - * @type {number} - */ - bytesPerElement: number; - /** - * A reference to the internal buffer. - * - * @private - * @type {TypedArray} - */ - private _buffer; - /** - * An array of update ranges. - * - * @private - * @type {Array<{start: number, count: number}>} - */ - private _updateRanges; - /** - * The array of update ranges. - * - * @type {Array<{start: number, count: number}>} - */ - get updateRanges(): Array<{ - start: number; - count: number; - }>; - /** - * Adds an update range. - * - * @param {number} start - The start index. - * @param {number} count - The number of elements. - */ - addUpdateRange(start: number, count: number): void; - /** - * Clears all update ranges. - */ - clearUpdateRanges(): void; - /** - * The buffer's byte length. - * - * @type {number} - * @readonly - */ - readonly get byteLength(): number; - /** - * A reference to the internal buffer. - * - * @type {Float32Array} - * @readonly - */ - readonly get buffer(): Float32Array; - /** - * Updates the binding. - * - * @return {boolean} Whether the buffer has been updated and must be - * uploaded to the GPU. - */ - update(): boolean; -} -import Binding from './Binding.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/BufferUtils.d.ts b/jsdoc-testing/jsdoc/renderers/common/BufferUtils.d.ts deleted file mode 100644 index 4d149b3a7..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/BufferUtils.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * This function is usually called with the length in bytes of an array buffer. - * It returns an padded value which ensure chunk size alignment according to STD140 layout. - * - * @function - * @param {number} floatLength - The buffer length. - * @return {number} The padded length. - */ -export function getFloatLength(floatLength: number): number; -/** - * Given the count of vectors and their vector length, this function computes - * a total length in bytes with buffer alignment according to STD140 layout. - * - * @function - * @param {number} count - The number of vectors. - * @param {number} [vectorLength=4] - The vector length. - * @return {number} The padded length. - */ -export function getVectorLength(count: number, vectorLength?: number): number; -/** - * This function is called with a vector length and ensure the computed length - * matches a predefined stride (in this case `4`). - * - * @function - * @param {number} vectorLength - The vector length. - * @return {number} The padded length. - */ -export function getStrideLength(vectorLength: number): number; diff --git a/jsdoc-testing/jsdoc/renderers/common/BundleGroup.d.ts b/jsdoc-testing/jsdoc/renderers/common/BundleGroup.d.ts deleted file mode 100644 index 90e98b1aa..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/BundleGroup.d.ts +++ /dev/null @@ -1,40 +0,0 @@ -export default BundleGroup; -/** - * A specialized group which enables applications access to the - * Render Bundle API of WebGPU. The group with all its descendant nodes - * are considered as one render bundle and processed as such by - * the renderer. - * - * This module is only fully supported by `WebGPURenderer` with a WebGPU backend. - * With a WebGL backend, the group can technically be rendered but without - * any performance improvements. - * - * @augments Group - */ -declare class BundleGroup extends Group { - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isBundleGroup: boolean; - /** - * The bundle group's version. - * - * @type {number} - * @readonly - * @default 0 - */ - readonly version: number; - /** - * Set this property to `true` when the bundle group has changed. - * - * @type {boolean} - * @default false - * @param {boolean} value - */ - set needsUpdate(value: boolean); -} -import { Group } from '../../objects/Group.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/CanvasTarget.d.ts b/jsdoc-testing/jsdoc/renderers/common/CanvasTarget.d.ts deleted file mode 100644 index 9932067a0..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/CanvasTarget.d.ts +++ /dev/null @@ -1,189 +0,0 @@ -export default CanvasTarget; -/** - * CanvasTarget is a class that represents the final output destination of the renderer. - * - * @augments EventDispatcher - */ -declare class CanvasTarget extends EventDispatcher { - /** - * Constructs a new CanvasTarget. - * - * @param {HTMLCanvasElement|OffscreenCanvas} domElement - The canvas element to render to. - */ - constructor(domElement: HTMLCanvasElement | OffscreenCanvas); - /** - * A reference to the canvas element the renderer is drawing to. - * This value of this property will automatically be created by - * the renderer. - * - * @type {HTMLCanvasElement|OffscreenCanvas} - */ - domElement: HTMLCanvasElement | OffscreenCanvas; - /** - * The renderer's pixel ratio. - * - * @private - * @type {number} - * @default 1 - */ - private _pixelRatio; - /** - * The width of the renderer's default framebuffer in logical pixel unit. - * - * @private - * @type {number} - */ - private _width; - /** - * The height of the renderer's default framebuffer in logical pixel unit. - * - * @private - * @type {number} - */ - private _height; - /** - * The viewport of the renderer in logical pixel unit. - * - * @private - * @type {Vector4} - */ - private _viewport; - /** - * The scissor rectangle of the renderer in logical pixel unit. - * - * @private - * @type {Vector4} - */ - private _scissor; - /** - * Whether the scissor test should be enabled or not. - * - * @private - * @type {boolean} - */ - private _scissorTest; - /** - * The color texture of the default framebuffer. - * - * @type {FramebufferTexture} - */ - colorTexture: FramebufferTexture; - /** - * The depth texture of the default framebuffer. - * - * @type {DepthTexture} - */ - depthTexture: DepthTexture; - /** - * Returns the pixel ratio. - * - * @return {number} The pixel ratio. - */ - getPixelRatio(): number; - /** - * Returns the drawing buffer size in physical pixels. This method honors the pixel ratio. - * - * @param {Vector2} target - The method writes the result in this target object. - * @return {Vector2} The drawing buffer size. - */ - getDrawingBufferSize(target: Vector2): Vector2; - /** - * Returns the renderer's size in logical pixels. This method does not honor the pixel ratio. - * - * @param {Vector2} target - The method writes the result in this target object. - * @return {Vector2} The renderer's size in logical pixels. - */ - getSize(target: Vector2): Vector2; - /** - * Sets the given pixel ratio and resizes the canvas if necessary. - * - * @param {number} [value=1] - The pixel ratio. - */ - setPixelRatio(value?: number): void; - /** - * This method allows to define the drawing buffer size by specifying - * width, height and pixel ratio all at once. The size of the drawing - * buffer is computed with this formula: - * ```js - * size.x = width * pixelRatio; - * size.y = height * pixelRatio; - * ``` - * - * @param {number} width - The width in logical pixels. - * @param {number} height - The height in logical pixels. - * @param {number} pixelRatio - The pixel ratio. - */ - setDrawingBufferSize(width: number, height: number, pixelRatio: number): void; - /** - * Sets the size of the renderer. - * - * @param {number} width - The width in logical pixels. - * @param {number} height - The height in logical pixels. - * @param {boolean} [updateStyle=true] - Whether to update the `style` attribute of the canvas or not. - */ - setSize(width: number, height: number, updateStyle?: boolean): void; - /** - * Returns the scissor rectangle. - * - * @param {Vector4} target - The method writes the result in this target object. - * @return {Vector4} The scissor rectangle. - */ - getScissor(target: Vector4): Vector4; - /** - * Defines the scissor rectangle. - * - * @param {number | Vector4} x - The horizontal coordinate for the lower left corner of the box in logical pixel unit. - * Instead of passing four arguments, the method also works with a single four-dimensional vector. - * @param {number} y - The vertical coordinate for the lower left corner of the box in logical pixel unit. - * @param {number} width - The width of the scissor box in logical pixel unit. - * @param {number} height - The height of the scissor box in logical pixel unit. - */ - setScissor(x: number | Vector4, y: number, width: number, height: number): void; - /** - * Returns the scissor test value. - * - * @return {boolean} Whether the scissor test should be enabled or not. - */ - getScissorTest(): boolean; - /** - * Defines the scissor test. - * - * @param {boolean} boolean - Whether the scissor test should be enabled or not. - */ - setScissorTest(boolean: boolean): void; - /** - * Returns the viewport definition. - * - * @param {Vector4} target - The method writes the result in this target object. - * @return {Vector4} The viewport definition. - */ - getViewport(target: Vector4): Vector4; - /** - * Defines the viewport. - * - * @param {number | Vector4} x - The horizontal coordinate for the lower left corner of the viewport origin in logical pixel unit. - * @param {number} y - The vertical coordinate for the lower left corner of the viewport origin in logical pixel unit. - * @param {number} width - The width of the viewport in logical pixel unit. - * @param {number} height - The height of the viewport in logical pixel unit. - * @param {number} minDepth - The minimum depth value of the viewport. WebGPU only. - * @param {number} maxDepth - The maximum depth value of the viewport. WebGPU only. - */ - setViewport(x: number | Vector4, y: number, width: number, height: number, minDepth?: number, maxDepth?: number): void; - /** - * Dispatches the resize event. - * - * @private - */ - private _dispatchResize; - /** - * Frees the GPU-related resources allocated by this instance. Call this - * method whenever this instance is no longer used in your app. - * - * @fires RenderTarget#dispose - */ - dispose(): void; -} -import { EventDispatcher } from '../../core/EventDispatcher.js'; -import { FramebufferTexture } from '../../textures/FramebufferTexture.js'; -import { DepthTexture } from '../../textures/DepthTexture.js'; -import { Vector4 } from '../../math/Vector4.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/ChainMap.d.ts b/jsdoc-testing/jsdoc/renderers/common/ChainMap.d.ts deleted file mode 100644 index 97e504734..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/ChainMap.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -export default ChainMap; -/** - * Data structure for the renderer. It allows defining values - * with chained, hierarchical keys. Keys are meant to be - * objects since the module internally works with Weak Maps - * for performance reasons. - * - * @private - */ -declare class ChainMap { - /** - * A map of Weak Maps by their key length. - * - * @type {Object} - */ - weakMaps: { - [x: number]: WeakMap; - }; - /** - * Returns the Weak Map for the given keys. - * - * @param {Array} keys - List of keys. - * @return {WeakMap} The weak map. - */ - _getWeakMap(keys: Array): WeakMap; - /** - * Returns the value for the given array of keys. - * - * @param {Array} keys - List of keys. - * @return {any} The value. Returns `undefined` if no value was found. - */ - get(keys: Array): any; - /** - * Sets the value for the given keys. - * - * @param {Array} keys - List of keys. - * @param {any} value - The value to set. - * @return {ChainMap} A reference to this Chain Map. - */ - set(keys: Array, value: any): ChainMap; - /** - * Deletes a value for the given keys. - * - * @param {Array} keys - The keys. - * @return {boolean} Returns `true` if the value has been removed successfully and `false` if the value has not be found. - */ - delete(keys: Array): boolean; -} diff --git a/jsdoc-testing/jsdoc/renderers/common/ClippingContext.d.ts b/jsdoc-testing/jsdoc/renderers/common/ClippingContext.d.ts deleted file mode 100644 index ab6124b41..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/ClippingContext.d.ts +++ /dev/null @@ -1,116 +0,0 @@ -export default ClippingContext; -/** - * Represents the state that is used to perform clipping via clipping planes. - * There is a default clipping context for each render context. When the - * scene holds instances of `ClippingGroup`, there will be a context for each - * group. - * - * @private - */ -declare class ClippingContext { - /** - * Constructs a new clipping context. - * - * @param {?ClippingContext} [parentContext=null] - A reference to the parent clipping context. - */ - constructor(parentContext?: ClippingContext | null); - /** - * The clipping context's version. - * - * @type {number} - * @readonly - */ - readonly version: number; - /** - * Whether the intersection of the clipping planes is used to clip objects, rather than their union. - * - * @type {?boolean} - * @default null - */ - clipIntersection: boolean | null; - /** - * The clipping context's cache key. - * - * @type {string} - */ - cacheKey: string; - /** - * Whether the shadow pass is active or not. - * - * @type {boolean} - * @default false - */ - shadowPass: boolean; - /** - * The view normal matrix. - * - * @type {Matrix3} - */ - viewNormalMatrix: Matrix3; - /** - * Internal cache for maintaining clipping contexts. - * - * @type {WeakMap} - */ - clippingGroupContexts: WeakMap; - /** - * The intersection planes. - * - * @type {Array} - */ - intersectionPlanes: Array; - /** - * The intersection planes. - * - * @type {Array} - */ - unionPlanes: Array; - /** - * The version of the clipping context's parent context. - * - * @type {?number} - * @readonly - */ - readonly parentVersion: number | null; - viewMatrix: any; - /** - * Projects the given source clipping planes and writes the result into the - * destination array. - * - * @param {Array} source - The source clipping planes. - * @param {Array} destination - The destination. - * @param {number} offset - The offset. - */ - projectPlanes(source: Array, destination: Array, offset: number): void; - /** - * Updates the root clipping context of a scene. - * - * @param {Scene} scene - The scene. - * @param {Camera} camera - The camera that is used to render the scene. - */ - updateGlobal(scene: Scene, camera: Camera): void; - /** - * Updates the clipping context. - * - * @param {ClippingContext} parentContext - The parent context. - * @param {ClippingGroup} clippingGroup - The clipping group this context belongs to. - */ - update(parentContext: ClippingContext, clippingGroup: ClippingGroup): void; - /** - * Returns a clipping context for the given clipping group. - * - * @param {ClippingGroup} clippingGroup - The clipping group. - * @return {ClippingContext} The clipping context. - */ - getGroupContext(clippingGroup: ClippingGroup): ClippingContext; - /** - * The count of union clipping planes. - * - * @type {number} - * @readonly - */ - readonly get unionClippingCount(): number; -} -import { Matrix3 } from '../../math/Matrix3.js'; -import { Vector4 } from '../../math/Vector4.js'; -import { Plane } from '../../math/Plane.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/Color4.d.ts b/jsdoc-testing/jsdoc/renderers/common/Color4.d.ts deleted file mode 100644 index 6f01003df..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/Color4.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -export default Color4; -/** - * A four-component version of {@link Color} which is internally - * used by the renderer to represents clear color with alpha as - * one object. - * - * @private - * @augments Color - */ -declare class Color4 extends Color { - /** - * Constructs a new four-component color. - * You can also pass a single THREE.Color, hex or - * string argument to this constructor. - * - * @param {number|string} [r=1] - The red value. - * @param {number} [g=1] - The green value. - * @param {number} [b=1] - The blue value. - * @param {number} [a=1] - The alpha value. - */ - constructor(r?: number | string, g?: number, b?: number, a?: number); - a: number; - /** - * Overwrites the default to honor alpha. - * You can also pass a single THREE.Color, hex or - * string argument to this method. - * - * @param {number|string|Color} r - The red value. - * @param {number} [g] - The green value. - * @param {number} [b] - The blue value. - * @param {number} [a=1] - The alpha value. - * @return {Color4} A reference to this object. - */ - set(r: number | string | Color, g?: number, b?: number, a?: number): Color4; - /** - * Overwrites the default to honor alpha. - * - * @param {Color4} color - The color to copy. - * @return {Color4} A reference to this object. - */ - copy(color: Color4): Color4; - /** - * Overwrites the default to honor alpha. - * - * @return {Color4} The cloned color. - */ - clone(): Color4; -} -import { Color } from '../../math/Color.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/ComputePipeline.d.ts b/jsdoc-testing/jsdoc/renderers/common/ComputePipeline.d.ts deleted file mode 100644 index c8740c38d..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/ComputePipeline.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -export default ComputePipeline; -/** - * Class for representing compute pipelines. - * - * @private - * @augments Pipeline - */ -declare class ComputePipeline extends Pipeline { - /** - * Constructs a new compute pipeline. - * - * @param {string} cacheKey - The pipeline's cache key. - * @param {ProgrammableStage} computeProgram - The pipeline's compute shader. - */ - constructor(cacheKey: string, computeProgram: ProgrammableStage); - /** - * The pipeline's compute shader. - * - * @type {ProgrammableStage} - */ - computeProgram: ProgrammableStage; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isComputePipeline: boolean; -} -import Pipeline from './Pipeline.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/Constants.d.ts b/jsdoc-testing/jsdoc/renderers/common/Constants.d.ts deleted file mode 100644 index cf3261af0..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/Constants.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export namespace AttributeType { - let VERTEX: number; - let INDEX: number; - let STORAGE: number; - let INDIRECT: number; -} -export const GPU_CHUNK_BYTES: 16; -export const BlendColorFactor: 211; -export const OneMinusBlendColorFactor: 212; diff --git a/jsdoc-testing/jsdoc/renderers/common/CubeRenderTarget.d.ts b/jsdoc-testing/jsdoc/renderers/common/CubeRenderTarget.d.ts deleted file mode 100644 index e6cad71cf..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/CubeRenderTarget.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -export default CubeRenderTarget; -/** - * This class represents a cube render target. It is a special version - * of `WebGLCubeRenderTarget` which is compatible with `WebGPURenderer`. - * - * @augments RenderTarget - */ -declare class CubeRenderTarget extends RenderTarget { - /** - * Constructs a new cube render target. - * - * @param {number} [size=1] - The size of the render target. - * @param {RenderTarget~Options} [options] - The configuration object. - */ - constructor(size?: number, options?: {}); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isCubeRenderTarget: boolean; - /** - * Converts the given equirectangular texture to a cube map. - * - * @param {Renderer} renderer - The renderer. - * @param {Texture} texture - The equirectangular texture. - * @return {CubeRenderTarget} A reference to this cube render target. - */ - fromEquirectangularTexture(renderer: Renderer, texture: Texture): CubeRenderTarget; - /** - * Clears this cube render target. - * - * @param {Renderer} renderer - The renderer. - * @param {boolean} [color=true] - Whether the color buffer should be cleared or not. - * @param {boolean} [depth=true] - Whether the depth buffer should be cleared or not. - * @param {boolean} [stencil=true] - Whether the stencil buffer should be cleared or not. - */ - clear(renderer: Renderer, color?: boolean, depth?: boolean, stencil?: boolean): void; -} -import { RenderTarget } from '../../core/RenderTarget.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/DataMap.d.ts b/jsdoc-testing/jsdoc/renderers/common/DataMap.d.ts deleted file mode 100644 index 5b407575a..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/DataMap.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -export default DataMap; -/** - * Data structure for the renderer. It is intended to manage - * data of objects in dictionaries. - * - * @private - */ -declare class DataMap { - /** - * `DataMap` internally uses a weak map - * to manage its data. - * - * @type {WeakMap} - */ - data: WeakMap; - /** - * Returns the dictionary for the given object. - * - * @param {Object} object - The object. - * @return {Object} The dictionary. - */ - get(object: Object): Object; - /** - * Deletes the dictionary for the given object. - * - * @param {Object} object - The object. - * @return {?Object} The deleted dictionary. - */ - delete(object: Object): Object | null; - /** - * Returns `true` if the given object has a dictionary defined. - * - * @param {Object} object - The object to test. - * @return {boolean} Whether a dictionary is defined or not. - */ - has(object: Object): boolean; - /** - * Frees internal resources. - */ - dispose(): void; -} diff --git a/jsdoc-testing/jsdoc/renderers/common/Geometries.d.ts b/jsdoc-testing/jsdoc/renderers/common/Geometries.d.ts deleted file mode 100644 index a1cd970c9..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/Geometries.d.ts +++ /dev/null @@ -1,103 +0,0 @@ -export default Geometries; -/** - * This renderer module manages geometries. - * - * @private - * @augments DataMap - */ -declare class Geometries extends DataMap { - /** - * Constructs a new geometry management component. - * - * @param {Attributes} attributes - Renderer component for managing attributes. - * @param {Info} info - Renderer component for managing metrics and monitoring data. - */ - constructor(attributes: Attributes, info: Info); - /** - * Renderer component for managing attributes. - * - * @type {Attributes} - */ - attributes: Attributes; - /** - * Renderer component for managing metrics and monitoring data. - * - * @type {Info} - */ - info: Info; - /** - * Weak Map for managing attributes for wireframe rendering. - * - * @type {WeakMap} - */ - wireframes: WeakMap; - /** - * This Weak Map is used to make sure buffer attributes are - * updated only once per render call. - * - * @type {WeakMap} - */ - attributeCall: WeakMap; - /** - * Stores the event listeners attached to geometries. - * - * @private - * @type {Map} - */ - private _geometryDisposeListeners; - /** - * Returns `true` if the given render object has an initialized geometry. - * - * @param {RenderObject} renderObject - The render object. - * @return {boolean} Whether if the given render object has an initialized geometry or not. - */ - has(renderObject: RenderObject): boolean; - /** - * Prepares the geometry of the given render object for rendering. - * - * @param {RenderObject} renderObject - The render object. - */ - updateForRender(renderObject: RenderObject): void; - /** - * Initializes the geometry of the given render object. - * - * @param {RenderObject} renderObject - The render object. - */ - initGeometry(renderObject: RenderObject): void; - /** - * Updates the geometry attributes of the given render object. - * - * @param {RenderObject} renderObject - The render object. - */ - updateAttributes(renderObject: RenderObject): void; - /** - * Updates the given attribute. - * - * @param {BufferAttribute} attribute - The attribute to update. - * @param {number} type - The attribute type. - */ - updateAttribute(attribute: BufferAttribute, type: number): void; - /** - * Returns the indirect buffer attribute of the given render object. - * - * @param {RenderObject} renderObject - The render object. - * @return {?BufferAttribute} The indirect attribute. `null` if no indirect drawing is used. - */ - getIndirect(renderObject: RenderObject): BufferAttribute | null; - /** - * Returns the byte offset into the indirect attribute buffer of the given render object. - * - * @param {RenderObject} renderObject - The render object. - * @return {number} The byte offset into the indirect attribute buffer. - */ - getIndirectOffset(renderObject: RenderObject): number; - /** - * Returns the index of the given render object's geometry. This is implemented - * in a method to return a wireframe index if necessary. - * - * @param {RenderObject} renderObject - The render object. - * @return {?BufferAttribute} The index. Returns `null` for non-indexed geometries. - */ - getIndex(renderObject: RenderObject): BufferAttribute | null; -} -import DataMap from './DataMap.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/IndirectStorageBufferAttribute.d.ts b/jsdoc-testing/jsdoc/renderers/common/IndirectStorageBufferAttribute.d.ts deleted file mode 100644 index 9084444e7..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/IndirectStorageBufferAttribute.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -export default IndirectStorageBufferAttribute; -/** - * This special type of buffer attribute is intended for compute shaders. - * It can be used to encode draw parameters for indirect draw calls. - * - * Note: This type of buffer attribute can only be used with `WebGPURenderer` - * and a WebGPU backend. - * - * @augments StorageBufferAttribute - */ -declare class IndirectStorageBufferAttribute extends StorageBufferAttribute { - /** - * Constructs a new storage buffer attribute. - * - * @param {number|Uint32Array} count - The item count. It is also valid to pass a `Uint32Array` as an argument. - * The subsequent parameter is then obsolete. - * @param {number} itemSize - The item size. - */ - constructor(count: number | Uint32Array, itemSize: number); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isIndirectStorageBufferAttribute: boolean; -} -import StorageBufferAttribute from './StorageBufferAttribute.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/Info.d.ts b/jsdoc-testing/jsdoc/renderers/common/Info.d.ts deleted file mode 100644 index 4ea7e1d9f..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/Info.d.ts +++ /dev/null @@ -1,183 +0,0 @@ -export default Info; -/** - * This renderer module provides a series of statistical information - * about the GPU memory and the rendering process. Useful for debugging - * and monitoring. - */ -declare class Info { - /** - * Whether frame related metrics should automatically - * be resetted or not. This property should be set to `false` - * by apps which manage their own animation loop. They must - * then call `renderer.info.reset()` once per frame manually. - * - * @type {boolean} - * @default true - */ - autoReset: boolean; - /** - * The current frame ID. This ID is managed - * by `NodeFrame`. - * - * @type {number} - * @readonly - * @default 0 - */ - readonly frame: number; - /** - * The number of render calls since the - * app has been started. - * - * @type {number} - * @readonly - * @default 0 - */ - readonly calls: number; - /** - * Render related metrics. - * - * @type {Object} - * @readonly - * @property {number} calls - The number of render calls since the app has been started. - * @property {number} frameCalls - The number of render calls of the current frame. - * @property {number} drawCalls - The number of draw calls of the current frame. - * @property {number} triangles - The number of rendered triangle primitives of the current frame. - * @property {number} points - The number of rendered point primitives of the current frame. - * @property {number} lines - The number of rendered line primitives of the current frame. - * @property {number} timestamp - The timestamp of the frame. - */ - readonly render: Object; - /** - * Compute related metrics. - * - * @type {Object} - * @readonly - * @property {number} calls - The number of compute calls since the app has been started. - * @property {number} frameCalls - The number of compute calls of the current frame. - * @property {number} timestamp - The timestamp of the frame when using `renderer.computeAsync()`. - */ - readonly compute: Object; - /** - * Memory related metrics. - * - * @type {Object} - * @readonly - * @property {number} geometries - The number of active geometries. - * @property {number} textures - The number of active textures. - * @property {number} attributes - The number of active attributes. - * @property {number} indexAttributes - The number of active index attributes. - * @property {number} storageAttributes - The number of active storage attributes. - * @property {number} indirectStorageAttributes - The number of active indirect storage attributes. - * @property {number} programs - The number of active programs. - * @property {number} renderTargets - The number of active renderTargets. - * @property {number} total - The total memory size in bytes. - * @property {number} texturesSize - The memory size of active textures in bytes. - * @property {number} attributesSize - The memory size of active attributes in bytes. - * @property {number} indexAttributesSize - The memory size of active index attributes in bytes. - * @property {number} storageAttributesSize - The memory size of active storage attributes in bytes. - * @property {number} indirectStorageAttributesSize - The memory size of active indirect storage attributes in bytes. - * @property {number} programsSize - The memory size of active programs in bytes. - */ - readonly memory: Object; - /** - * Map for storing calculated byte sizes of tracked objects. - * - * @type {Map} - * @private - */ - private memoryMap; - /** - * This method should be executed per draw call and updates the corresponding metrics. - * - * @param {Object3D} object - The 3D object that is going to be rendered. - * @param {number} count - The vertex or index count. - * @param {number} instanceCount - The instance count. - */ - update(object: Object3D, count: number, instanceCount: number): void; - /** - * Resets frame related metrics. - */ - reset(): void; - /** - * Performs a complete reset of the object. - */ - dispose(): void; - /** - * Tracks texture memory explicitly, updating counts and byte tracking. - * - * @param {Texture} texture - */ - createTexture(texture: Texture): void; - /** - * Tracks texture memory explicitly, updating counts and byte tracking. - * - * @param {Texture} texture - */ - destroyTexture(texture: Texture): void; - /** - * Tracks attribute memory explicitly, updating counts and byte tracking. - * - * @param {BufferAttribute} attribute - * @param {string} type - type of attribute - * @private - */ - private _createAttribute; - /** - * Tracks a regular attribute memory explicitly. - * - * @param {BufferAttribute} attribute - The attribute to track. - */ - createAttribute(attribute: BufferAttribute): void; - /** - * Tracks an index attribute memory explicitly. - * - * @param {BufferAttribute} attribute - The index attribute to track. - */ - createIndexAttribute(attribute: BufferAttribute): void; - /** - * Tracks a storage attribute memory explicitly. - * - * @param {BufferAttribute} attribute - The storage attribute to track. - */ - createStorageAttribute(attribute: BufferAttribute): void; - /** - * Tracks an indirect storage attribute memory explicitly. - * - * @param {BufferAttribute} attribute - The indirect storage attribute to track. - */ - createIndirectStorageAttribute(attribute: BufferAttribute): void; - /** - * Tracks attribute memory explicitly, updating counts and byte tracking. - * - * @param {BufferAttribute} attribute - */ - destroyAttribute(attribute: BufferAttribute): void; - /** - * Tracks program memory explicitly, updating counts and byte tracking. - * - * @param {ProgrammableStage} program - The program to track. - */ - createProgram(program: ProgrammableStage): void; - /** - * Tracks program memory explicitly, updating counts and byte tracking. - * - * @param {Object} program - The program to track. - */ - destroyProgram(program: Object): void; - /** - * Calculates the memory size of a texture in bytes. - * - * @param {Texture} texture - The texture to calculate the size for. - * @return {number} The calculated size in bytes. - * @private - */ - private _getTextureMemorySize; - /** - * Calculates the memory size of an attribute in bytes. - * - * @param {BufferAttribute} attribute - The attribute to calculate the size for. - * @return {number} The calculated size in bytes. - * @private - */ - private _getAttributeMemorySize; -} diff --git a/jsdoc-testing/jsdoc/renderers/common/InspectorBase.d.ts b/jsdoc-testing/jsdoc/renderers/common/InspectorBase.d.ts deleted file mode 100644 index 7deedcbb7..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/InspectorBase.d.ts +++ /dev/null @@ -1,109 +0,0 @@ -export default InspectorBase; -/** - * InspectorBase is the base class for all inspectors. - * - * @class InspectorBase - * @augments EventDispatcher - */ -declare class InspectorBase extends EventDispatcher { - /** - * The renderer associated with this inspector. - * - * @type {WebGLRenderer} - * @private - */ - private _renderer; - /** - * The current frame being processed. - * - * @type {Object} - */ - currentFrame: Object; - /** - * Returns the node frame for the current renderer. - * - * @return {Object} The node frame. - */ - get nodeFrame(): Object; - /** - * Sets the renderer for this inspector. - * - * @param {WebGLRenderer} renderer - The renderer to associate with this inspector. - * @return {InspectorBase} This inspector instance. - */ - setRenderer(renderer: WebGLRenderer): InspectorBase; - /** - * Returns the renderer associated with this inspector. - * - * @return {WebGLRenderer} The associated renderer. - */ - getRenderer(): WebGLRenderer; - /** - * Initializes the inspector. - */ - init(): void; - /** - * Called when a frame begins. - */ - begin(): void; - /** - * Called when a frame ends. - */ - finish(): void; - /** - * Inspects a node. - * - * @param {Node} node - The node to inspect. - */ - inspect(): void; - /** - * When a compute operation is performed. - * - * @param {ComputeNode} computeNode - The compute node being executed. - * @param {number|Array} dispatchSizeOrCount - The dispatch size or count. - */ - computeAsync(): void; - /** - * Called when a compute operation begins. - * - * @param {string} uid - A unique identifier for the render context. - * @param {ComputeNode} computeNode - The compute node being executed. - */ - beginCompute(): void; - /** - * Called when a compute operation ends. - * - * @param {string} uid - A unique identifier for the render context. - * @param {ComputeNode} computeNode - The compute node being executed. - */ - finishCompute(): void; - /** - * Called when a render operation begins. - * - * @param {string} uid - A unique identifier for the render context. - * @param {Scene} scene - The scene being rendered. - * @param {Camera} camera - The camera being used for rendering. - * @param {?WebGLRenderTarget} renderTarget - The render target, if any. - */ - beginRender(): void; - /** - * Called when an animation loop ends. - * - * @param {string} uid - A unique identifier for the render context. - */ - finishRender(): void; - /** - * Called when a texture copy operation is performed. - * - * @param {Texture} srcTexture - The source texture. - * @param {Texture} dstTexture - The destination texture. - */ - copyTextureToTexture(): void; - /** - * Called when a framebuffer copy operation is performed. - * - * @param {Texture} framebufferTexture - The texture associated with the framebuffer. - */ - copyFramebufferToTexture(): void; -} -import { EventDispatcher } from '../../core/EventDispatcher.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/Lighting.d.ts b/jsdoc-testing/jsdoc/renderers/common/Lighting.d.ts deleted file mode 100644 index b15d96025..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/Lighting.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -export default Lighting; -/** - * This renderer module manages the lights nodes which are unique - * per scene and camera combination. - * - * The lights node itself is later configured in the render list - * with the actual lights from the scene. - * - * @private - */ -declare class Lighting { - /** - * Creates a new lights node for the given array of lights. - * - * @param {Array} lights - The render object. - * @return {LightsNode} The lights node. - */ - createNode(lights?: Array): LightsNode; - /** - * Returns a lights node for the given scene and camera. - * - * @param {Scene} scene - The scene. - * @param {Camera} camera - The camera. - * @return {LightsNode} The lights node. - */ - getNode(scene: Scene): LightsNode; -} -import { LightsNode } from '../../nodes/Nodes.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/Pipeline.d.ts b/jsdoc-testing/jsdoc/renderers/common/Pipeline.d.ts deleted file mode 100644 index db30b30a6..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/Pipeline.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -export default Pipeline; -/** - * Abstract class for representing pipelines. - * - * @private - * @abstract - */ -declare class Pipeline { - /** - * Constructs a new pipeline. - * - * @param {string} cacheKey - The pipeline's cache key. - */ - constructor(cacheKey: string); - /** - * The pipeline's cache key. - * - * @type {string} - */ - cacheKey: string; - /** - * How often the pipeline is currently in use. - * - * @type {number} - * @default 0 - */ - usedTimes: number; -} diff --git a/jsdoc-testing/jsdoc/renderers/common/Pipelines.d.ts b/jsdoc-testing/jsdoc/renderers/common/Pipelines.d.ts deleted file mode 100644 index 182374e08..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/Pipelines.d.ts +++ /dev/null @@ -1,174 +0,0 @@ -export default Pipelines; -/** - * This renderer module manages the pipelines of the renderer. - * - * @private - * @augments DataMap - */ -declare class Pipelines extends DataMap { - /** - * Constructs a new pipeline management component. - * - * @param {Backend} backend - The renderer's backend. - * @param {NodeManager} nodes - Renderer component for managing nodes related logic. - * @param {Info} info - Renderer component for managing metrics and monitoring data. - */ - constructor(backend: Backend, nodes: NodeManager, info: Info); - /** - * The renderer's backend. - * - * @type {Backend} - */ - backend: Backend; - /** - * Renderer component for managing nodes related logic. - * - * @type {NodeManager} - */ - nodes: NodeManager; - /** - * Renderer component for managing metrics and monitoring data. - * - * @type {Info} - */ - info: Info; - /** - * A references to the bindings management component. - * This reference will be set inside the `Bindings` - * constructor. - * - * @type {?Bindings} - * @default null - */ - bindings: Bindings | null; - /** - * Internal cache for maintaining pipelines. - * The key of the map is a cache key, the value the pipeline. - * - * @type {Map} - */ - caches: Map; - /** - * This dictionary maintains for each shader stage type (vertex, - * fragment and compute) the programmable stage objects which - * represent the actual shader code. - * - * @type {Object>} - */ - programs: { - [x: string]: Map; - }; - /** - * Returns a compute pipeline for the given compute node. - * - * @param {Node} computeNode - The compute node. - * @param {Array} bindings - The bindings. - * @return {ComputePipeline} The compute pipeline. - */ - getForCompute(computeNode: Node, bindings: Array): ComputePipeline; - /** - * Returns a render pipeline for the given render object. - * - * @param {RenderObject} renderObject - The render object. - * @param {?Array} [promises=null] - An array of compilation promises which is only relevant in context of `Renderer.compileAsync()`. - * @return {RenderObjectPipeline} The render pipeline. - */ - getForRender(renderObject: RenderObject, promises?: Array> | null): RenderObjectPipeline; - /** - * Checks if the render pipeline for the given render object is ready for drawing. - * Returns false if the GPU pipeline is still being compiled asynchronously. - * - * @param {RenderObject} renderObject - The render object. - * @return {boolean} True if the pipeline is ready for drawing. - */ - isReady(renderObject: RenderObject): boolean; - /** - * Deletes the pipeline for the given render object. - * - * @param {RenderObject} object - The render object. - * @return {?Object} The deleted dictionary. - */ - delete(object: RenderObject): Object | null; - /** - * Updates the pipeline for the given render object. - * - * @param {RenderObject} renderObject - The render object. - */ - updateForRender(renderObject: RenderObject): void; - /** - * Returns a compute pipeline for the given parameters. - * - * @private - * @param {Node} computeNode - The compute node. - * @param {ProgrammableStage} stageCompute - The programmable stage representing the compute shader. - * @param {string} cacheKey - The cache key. - * @param {Array} bindings - The bindings. - * @return {ComputePipeline} The compute pipeline. - */ - private _getComputePipeline; - /** - * Returns a render pipeline for the given parameters. - * - * @private - * @param {RenderObject} renderObject - The render object. - * @param {ProgrammableStage} stageVertex - The programmable stage representing the vertex shader. - * @param {ProgrammableStage} stageFragment - The programmable stage representing the fragment shader. - * @param {string} cacheKey - The cache key. - * @param {?Array} promises - An array of compilation promises which is only relevant in context of `Renderer.compileAsync()`. - * @return {RenderObjectPipeline} The render pipeline. - */ - private _getRenderPipeline; - /** - * Computes a cache key representing a compute pipeline. - * - * @private - * @param {Node} computeNode - The compute node. - * @param {ProgrammableStage} stageCompute - The programmable stage representing the compute shader. - * @return {string} The cache key. - */ - private _getComputeCacheKey; - /** - * Computes a cache key representing a render pipeline. - * - * @private - * @param {RenderObject} renderObject - The render object. - * @param {ProgrammableStage} stageVertex - The programmable stage representing the vertex shader. - * @param {ProgrammableStage} stageFragment - The programmable stage representing the fragment shader. - * @return {string} The cache key. - */ - private _getRenderCacheKey; - /** - * Releases the given pipeline. - * - * @private - * @param {Pipeline} pipeline - The pipeline to release. - */ - private _releasePipeline; - /** - * Releases the shader program. - * - * @private - * @param {Object} program - The shader program to release. - */ - private _releaseProgram; - /** - * Returns `true` if the compute pipeline for the given compute node requires an update. - * - * @private - * @param {Node} computeNode - The compute node. - * @return {boolean} Whether the compute pipeline for the given compute node requires an update or not. - */ - private _needsComputeUpdate; - /** - * Returns `true` if the render pipeline for the given render object requires an update. - * - * @private - * @param {RenderObject} renderObject - The render object. - * @return {boolean} Whether the render object for the given render object requires an update or not. - */ - private _needsRenderUpdate; -} -import DataMap from './DataMap.js'; -import ProgrammableStage from './ProgrammableStage.js'; -import ComputePipeline from './ComputePipeline.js'; -import RenderObjectPipeline from './RenderObjectPipeline.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/PostProcessing.d.ts b/jsdoc-testing/jsdoc/renderers/common/PostProcessing.d.ts deleted file mode 100644 index 7bf242f58..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/PostProcessing.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -export default PostProcessing; -/** - * @deprecated since r183. Use {@link RenderPipeline} instead. PostProcessing has been renamed to RenderPipeline. - * - * This class is a wrapper for backward compatibility and will be removed in a future version. - */ -declare class PostProcessing extends RenderPipeline { - /** - * Constructs a new post processing management module. - * - * @param {Renderer} renderer - A reference to the renderer. - * @param {Node} outputNode - An optional output node. - * @deprecated since r183. Use {@link RenderPipeline} instead. - */ - constructor(renderer: Renderer, outputNode: Node); -} -import RenderPipeline from './RenderPipeline.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/ProgrammableStage.d.ts b/jsdoc-testing/jsdoc/renderers/common/ProgrammableStage.d.ts deleted file mode 100644 index 5fdbd4d68..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/ProgrammableStage.d.ts +++ /dev/null @@ -1,64 +0,0 @@ -export default ProgrammableStage; -/** - * Class for representing programmable stages which are vertex, - * fragment or compute shaders. Unlike fixed-function states (like blending), - * they represent the programmable part of a pipeline. - * - * @private - */ -declare class ProgrammableStage { - /** - * Constructs a new programmable stage. - * - * @param {string} code - The shader code. - * @param {('vertex'|'fragment'|'compute')} stage - The type of stage. - * @param {string} name - The name of the shader. - * @param {?Array} [transforms=null] - The transforms (only relevant for compute stages with WebGL 2 which uses Transform Feedback). - * @param {?Array} [attributes=null] - The attributes (only relevant for compute stages with WebGL 2 which uses Transform Feedback). - */ - constructor(code: string, stage: ("vertex" | "fragment" | "compute"), name: string, transforms?: Array | null, attributes?: Array | null); - /** - * The id of the programmable stage. - * - * @type {number} - */ - id: number; - /** - * The shader code. - * - * @type {string} - */ - code: string; - /** - * The type of stage. - * - * @type {string} - */ - stage: string; - /** - * The name of the stage. - * This is used for debugging purposes. - * - * @type {string} - */ - name: string; - /** - * The transforms (only relevant for compute stages with WebGL 2 which uses Transform Feedback). - * - * @type {?Array} - */ - transforms: Array | null; - /** - * The attributes (only relevant for compute stages with WebGL 2 which uses Transform Feedback). - * - * @type {?Array} - */ - attributes: Array | null; - /** - * How often the programmable stage is currently in use. - * - * @type {number} - * @default 0 - */ - usedTimes: number; -} diff --git a/jsdoc-testing/jsdoc/renderers/common/QuadMesh.d.ts b/jsdoc-testing/jsdoc/renderers/common/QuadMesh.d.ts deleted file mode 100644 index 5e42e77e0..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/QuadMesh.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -export default QuadMesh; -/** - * This module is a helper for passes which need to render a full - * screen effect which is quite common in context of post processing. - * - * The intended usage is to reuse a single quad mesh for rendering - * subsequent passes by just reassigning the `material` reference. - * - * Note: This module can only be used with `WebGPURenderer`. - * - * @augments Mesh - */ -declare class QuadMesh extends Mesh { - /** - * Constructs a new quad mesh. - * - * @param {?Material} [material=null] - The material to render the quad mesh with. - */ - constructor(material?: Material | null); - /** - * The camera to render the quad mesh with. - * - * @type {OrthographicCamera} - * @readonly - */ - readonly camera: OrthographicCamera; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isQuadMesh: boolean; - /** - * Async version of `render()`. - * - * @async - * @deprecated - * @param {Renderer} renderer - The renderer. - * @return {Promise} A Promise that resolves when the render has been finished. - */ - renderAsync(renderer: Renderer): Promise; - /** - * Renders the quad mesh - * - * @param {Renderer} renderer - The renderer. - */ - render(renderer: Renderer): void; -} -import { Mesh } from '../../objects/Mesh.js'; -import { OrthographicCamera } from '../../cameras/OrthographicCamera.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/RenderBundle.d.ts b/jsdoc-testing/jsdoc/renderers/common/RenderBundle.d.ts deleted file mode 100644 index 52308ff19..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/RenderBundle.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -export default RenderBundle; -/** - * This module is used to represent render bundles inside the renderer - * for further processing. - * - * @private - */ -declare class RenderBundle { - /** - * Constructs a new bundle group. - * - * @param {BundleGroup} bundleGroup - The bundle group. - * @param {Camera} camera - The camera the bundle group is rendered with. - */ - constructor(bundleGroup: BundleGroup, camera: Camera); - bundleGroup: BundleGroup; - camera: Camera; -} diff --git a/jsdoc-testing/jsdoc/renderers/common/RenderBundles.d.ts b/jsdoc-testing/jsdoc/renderers/common/RenderBundles.d.ts deleted file mode 100644 index 7919fc3ac..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/RenderBundles.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -export default RenderBundles; -/** - * This renderer module manages render bundles. - * - * @private - */ -declare class RenderBundles { - /** - * A chain map for maintaining the render bundles. - * - * @type {ChainMap} - */ - bundles: ChainMap; - /** - * Returns a render bundle for the given bundle group and camera. - * - * @param {BundleGroup} bundleGroup - The bundle group. - * @param {Camera} camera - The camera the bundle group is rendered with. - * @return {RenderBundle} The render bundle. - */ - get(bundleGroup: BundleGroup, camera: Camera): RenderBundle; - /** - * Frees all internal resources. - */ - dispose(): void; -} -import ChainMap from './ChainMap.js'; -import RenderBundle from './RenderBundle.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/RenderContext.d.ts b/jsdoc-testing/jsdoc/renderers/common/RenderContext.d.ts deleted file mode 100644 index f0ef10337..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/RenderContext.d.ts +++ /dev/null @@ -1,221 +0,0 @@ -/** - * Computes a cache key for the given render context. This key - * should identify the render target state so it is possible to - * configure the correct attachments in the respective backend. - * - * @param {RenderContext} renderContext - The render context. - * @return {number} The cache key. - */ -export function getCacheKey(renderContext: RenderContext): number; -export default RenderContext; -/** - * Any render or compute command is executed in a specific context that defines - * the state of the renderer and its backend. Typical examples for such context - * data are the current clear values or data from the active framebuffer. This - * module is used to represent these contexts as objects. - * - * @private - */ -declare class RenderContext { - /** - * The context's ID. - * - * @type {number} - */ - id: number; - /** - * The MRT configuration. - * - * @type {?MRTNode} - * @default null - */ - mrt: MRTNode | null; - /** - * Whether the current active framebuffer has a color attachment. - * - * @type {boolean} - * @default true - */ - color: boolean; - /** - * Whether the color attachment should be cleared or not. - * - * @type {boolean} - * @default true - */ - clearColor: boolean; - /** - * The clear color value. - * - * @type {Object} - * @default true - */ - clearColorValue: Object; - /** - * Whether the current active framebuffer has a depth attachment. - * - * @type {boolean} - * @default true - */ - depth: boolean; - /** - * Whether the depth attachment should be cleared or not. - * - * @type {boolean} - * @default true - */ - clearDepth: boolean; - /** - * The clear depth value. - * - * @type {number} - * @default 1 - */ - clearDepthValue: number; - /** - * Whether the current active framebuffer has a stencil attachment. - * - * @type {boolean} - * @default false - */ - stencil: boolean; - /** - * Whether the stencil attachment should be cleared or not. - * - * @type {boolean} - * @default true - */ - clearStencil: boolean; - /** - * The clear stencil value. - * - * @type {number} - * @default 1 - */ - clearStencilValue: number; - /** - * By default the viewport encloses the entire framebuffer If a smaller - * viewport is manually defined, this property is to `true` by the renderer. - * - * @type {boolean} - * @default false - */ - viewport: boolean; - /** - * The viewport value. This value is in physical pixels meaning it incorporates - * the renderer's pixel ratio. The viewport property of render targets or - * the renderer is in logical pixels. - * - * @type {Vector4} - */ - viewportValue: Vector4; - /** - * When the scissor test is active and scissor rectangle smaller than the - * framebuffers dimensions, this property is to `true` by the renderer. - * - * @type {boolean} - * @default false - */ - scissor: boolean; - /** - * The scissor rectangle. - * - * @type {Vector4} - */ - scissorValue: Vector4; - /** - * The active render target. - * - * @type {?RenderTarget} - * @default null - */ - renderTarget: RenderTarget | null; - /** - * The textures of the active render target. - * `null` when no render target is set. - * - * @type {?Array} - * @default null - */ - textures: Array | null; - /** - * The depth texture of the active render target. - * `null` when no render target is set. - * - * @type {?DepthTexture} - * @default null - */ - depthTexture: DepthTexture | null; - /** - * The active cube face. - * - * @type {number} - * @default 0 - */ - activeCubeFace: number; - /** - * The active mipmap level. - * - * @type {number} - * @default 0 - */ - activeMipmapLevel: number; - /** - * The number of MSAA samples. This value is always `1` when - * MSAA isn't used. - * - * @type {number} - * @default 1 - */ - sampleCount: number; - /** - * The active render target's width in physical pixels. - * - * @type {number} - * @default 0 - */ - width: number; - /** - * The active render target's height in physical pixels. - * - * @type {number} - * @default 0 - */ - height: number; - /** - * The occlusion query count. - * - * @type {number} - * @default 0 - */ - occlusionQueryCount: number; - /** - * The current clipping context. - * - * @type {?ClippingContext} - * @default null - */ - clippingContext: ClippingContext | null; - /** - * The current camera. - * - * @type {?Camera} - * @default null - */ - camera: Camera | null; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isRenderContext: boolean; - /** - * Returns the cache key of this render context. - * - * @return {number} The cache key. - */ - getCacheKey(): number; -} -import { Vector4 } from '../../math/Vector4.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/RenderContexts.d.ts b/jsdoc-testing/jsdoc/renderers/common/RenderContexts.d.ts deleted file mode 100644 index ff6dfc870..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/RenderContexts.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -export default RenderContexts; -/** - * This module manages the render contexts of the renderer. - * - * @private - */ -declare class RenderContexts { - /** - * Constructs a new render context management component. - * - * @param {Renderer} renderer - The renderer. - */ - constructor(renderer: Renderer); - /** - * The renderer. - * - * @type {Renderer} - */ - renderer: Renderer; - /** - * A dictionary that manages render contexts. - * - * @type {Object} - */ - _renderContexts: { - [x: string]: RenderContext; - }; - /** - * Returns a render context for the given scene, camera and render target. - * - * @param {?RenderTarget} [renderTarget=null] - The active render target. - * @param {?MRTNode} [mrt=null] - The MRT configuration - * @param {?number} [callDepth=0] - The call depth of the renderer. - * @return {RenderContext} The render context. - */ - get(renderTarget?: RenderTarget | null, mrt?: MRTNode | null, callDepth?: number | null): RenderContext; - /** - * Frees internal resources. - */ - dispose(): void; -} -import RenderContext from './RenderContext.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/RenderList.d.ts b/jsdoc-testing/jsdoc/renderers/common/RenderList.d.ts deleted file mode 100644 index bc360b020..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/RenderList.d.ts +++ /dev/null @@ -1,169 +0,0 @@ -export default RenderList; -/** - * When the renderer analyzes the scene at the beginning of a render call, - * it stores 3D object for further processing in render lists. Depending on the - * properties of a 3D objects (like their transformation or material state), the - * objects are maintained in ordered lists for the actual rendering. - * - * Render lists are unique per scene and camera combination. - * - * @private - * @augments Pipeline - */ -declare class RenderList { - /** - * Constructs a render list. - * - * @param {Lighting} lighting - The lighting management component. - * @param {Scene} scene - The scene. - * @param {Camera} camera - The camera the scene is rendered with. - */ - constructor(lighting: Lighting, scene: Scene, camera: Camera); - /** - * 3D objects are transformed into render items and stored in this array. - * - * @type {Array} - */ - renderItems: Array; - /** - * The current render items index. - * - * @type {number} - * @default 0 - */ - renderItemsIndex: number; - /** - * A list with opaque render items. - * - * @type {Array} - */ - opaque: Array; - /** - * A list with transparent render items which require - * double pass rendering (e.g. transmissive objects). - * - * @type {Array} - */ - transparentDoublePass: Array; - /** - * A list with transparent render items. - * - * @type {Array} - */ - transparent: Array; - /** - * A list with transparent render bundle data. - * - * @type {Array} - */ - bundles: Array; - /** - * The render list's lights node. This node is later - * relevant for the actual analytical light nodes which - * compute the scene's lighting in the shader. - * - * @type {LightsNode} - */ - lightsNode: LightsNode; - /** - * The scene's lights stored in an array. This array - * is used to setup the lights node. - * - * @type {Array} - */ - lightsArray: Array; - /** - * The scene. - * - * @type {Scene} - */ - scene: Scene; - /** - * The camera the scene is rendered with. - * - * @type {Camera} - */ - camera: Camera; - /** - * How many objects perform occlusion query tests. - * - * @type {number} - * @default 0 - */ - occlusionQueryCount: number; - /** - * This method is called right at the beginning of a render call - * before the scene is analyzed. It prepares the internal data - * structures for the upcoming render lists generation. - * - * @return {RenderList} A reference to this render list. - */ - begin(): RenderList; - /** - * Returns a render item for the giving render item state. The state is defined - * by a series of object-related parameters. - * - * The method avoids object creation by holding render items and reusing them in - * subsequent render calls (just with different property values). - * - * @param {Object3D} object - The 3D object. - * @param {BufferGeometry} geometry - The 3D object's geometry. - * @param {Material} material - The 3D object's material. - * @param {number} groupOrder - The current group order. - * @param {number} z - Th 3D object's depth value (z value in clip space). - * @param {?number} group - {?Object} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. - * @param {ClippingContext} clippingContext - The current clipping context. - * @return {Object} The render item. - */ - getNextRenderItem(object: Object3D, geometry: BufferGeometry, material: Material, groupOrder: number, z: number, group: number | null, clippingContext: ClippingContext): Object; - /** - * Pushes the given object as a render item to the internal render lists. - * The selected lists depend on the object properties. - * - * @param {Object3D} object - The 3D object. - * @param {BufferGeometry} geometry - The 3D object's geometry. - * @param {Material} material - The 3D object's material. - * @param {number} groupOrder - The current group order. - * @param {number} z - Th 3D object's depth value (z value in clip space). - * @param {?number} group - {?Object} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. - * @param {ClippingContext} clippingContext - The current clipping context. - */ - push(object: Object3D, geometry: BufferGeometry, material: Material, groupOrder: number, z: number, group: number | null, clippingContext: ClippingContext): void; - /** - * Inserts the given object as a render item at the start of the internal render lists. - * The selected lists depend on the object properties. - * - * @param {Object3D} object - The 3D object. - * @param {BufferGeometry} geometry - The 3D object's geometry. - * @param {Material} material - The 3D object's material. - * @param {number} groupOrder - The current group order. - * @param {number} z - Th 3D object's depth value (z value in clip space). - * @param {?number} group - {?Object} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. - * @param {ClippingContext} clippingContext - The current clipping context. - */ - unshift(object: Object3D, geometry: BufferGeometry, material: Material, groupOrder: number, z: number, group: number | null, clippingContext: ClippingContext): void; - /** - * Pushes render bundle group data into the render list. - * - * @param {Object} group - Bundle group data. - */ - pushBundle(group: Object): void; - /** - * Pushes a light into the render list. - * - * @param {Light} light - The light. - */ - pushLight(light: Light): void; - /** - * Sorts the internal render lists. - * - * @param {?function(any, any): number} customOpaqueSort - A custom sort function for opaque objects. - * @param {?function(any, any): number} customTransparentSort - A custom sort function for transparent objects. - */ - sort(customOpaqueSort: ((arg0: any, arg1: any) => number) | null, customTransparentSort: ((arg0: any, arg1: any) => number) | null): void; - /** - * This method performs finalizing tasks right after the render lists - * have been generated. - */ - finish(): void; -} diff --git a/jsdoc-testing/jsdoc/renderers/common/RenderLists.d.ts b/jsdoc-testing/jsdoc/renderers/common/RenderLists.d.ts deleted file mode 100644 index d8d26670c..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/RenderLists.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -export default RenderLists; -/** - * This renderer module manages the render lists which are unique - * per scene and camera combination. - * - * @private - */ -declare class RenderLists { - /** - * Constructs a render lists management component. - * - * @param {Lighting} lighting - The lighting management component. - */ - constructor(lighting: Lighting); - /** - * The lighting management component. - * - * @type {Lighting} - */ - lighting: Lighting; - /** - * The internal chain map which holds the render lists. - * - * @type {ChainMap} - */ - lists: ChainMap; - /** - * Returns a render list for the given scene and camera. - * - * @param {Scene} scene - The scene. - * @param {Camera} camera - The camera. - * @return {RenderList} The render list. - */ - get(scene: Scene, camera: Camera): RenderList; - /** - * Frees all internal resources. - */ - dispose(): void; -} -import ChainMap from './ChainMap.js'; -import RenderList from './RenderList.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/RenderObject.d.ts b/jsdoc-testing/jsdoc/renderers/common/RenderObject.d.ts deleted file mode 100644 index 36c013119..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/RenderObject.d.ts +++ /dev/null @@ -1,409 +0,0 @@ -export default RenderObject; -/** - * A render object is the renderer's representation of single entity that gets drawn - * with a draw command. There is no unique mapping of render objects to 3D objects in the - * scene since render objects also depend from the used material, the current render context - * and the current scene's lighting. - * - * In general, the basic process of the renderer is: - * - * - Analyze the 3D objects in the scene and generate render lists containing render items. - * - Process the render lists by calling one or more render commands for each render item. - * - For each render command, request a render object and perform the draw. - * - * The module provides an interface to get data required for the draw command like the actual - * draw parameters or vertex buffers. It also holds a series of caching related methods since - * creating render objects should only be done when necessary. - * - * @private - */ -declare class RenderObject { - /** - * Constructs a new render object. - * - * @param {NodeManager} nodes - Renderer component for managing nodes related logic. - * @param {Geometries} geometries - Renderer component for managing geometries. - * @param {Renderer} renderer - The renderer. - * @param {Object3D} object - The 3D object. - * @param {Material} material - The 3D object's material. - * @param {Scene} scene - The scene the 3D object belongs to. - * @param {Camera} camera - The camera the object should be rendered with. - * @param {LightsNode} lightsNode - The lights node. - * @param {RenderContext} renderContext - The render context. - * @param {ClippingContext} clippingContext - The clipping context. - */ - constructor(nodes: NodeManager, geometries: Geometries, renderer: Renderer, object: Object3D, material: Material, scene: Scene, camera: Camera, lightsNode: LightsNode, renderContext: RenderContext, clippingContext: ClippingContext); - id: number; - /** - * Renderer component for managing nodes related logic. - * - * @type {NodeManager} - * @private - */ - private _nodes; - /** - * Renderer component for managing geometries. - * - * @type {Geometries} - * @private - */ - private _geometries; - /** - * The renderer. - * - * @type {Renderer} - */ - renderer: Renderer; - /** - * The 3D object. - * - * @type {Object3D} - */ - object: Object3D; - /** - * The 3D object's material. - * - * @type {Material} - */ - material: Material; - /** - * The scene the 3D object belongs to. - * - * @type {Scene} - */ - scene: Scene; - /** - * The camera the 3D object should be rendered with. - * - * @type {Camera} - */ - camera: Camera; - /** - * The lights node. - * - * @type {LightsNode} - */ - lightsNode: LightsNode; - /** - * The render context. - * - * @type {RenderContext} - */ - context: RenderContext; - /** - * The 3D object's geometry. - * - * @type {BufferGeometry} - */ - geometry: BufferGeometry; - /** - * The render object's version. - * - * @type {number} - */ - version: number; - /** - * The draw range of the geometry. - * - * @type {?Object} - * @default null - */ - drawRange: Object | null; - /** - * An array holding the buffer attributes - * of the render object. This entails attribute - * definitions on geometry and node level. - * - * @type {?Array} - * @default null - */ - attributes: Array | null; - /** - * An object holding the version of the - * attributes. The keys are the attribute names - * and the values are the attribute versions. - * - * @type {?Object} - * @default null - */ - attributesId: { - [x: string]: number; - } | null; - /** - * A reference to a render pipeline the render - * object is processed with. - * - * @type {RenderPipeline} - * @default null - */ - pipeline: RenderPipeline; - /** - * Only relevant for objects using - * multiple materials. This represents a group entry - * from the respective `BufferGeometry`. - * - * @type {?{start: number, count: number}} - * @default null - */ - group: { - start: number; - count: number; - } | null; - /** - * An array holding the vertex buffers which can - * be buffer attributes but also interleaved buffers. - * - * @type {?Array} - * @default null - */ - vertexBuffers: Array | null; - /** - * The parameters for the draw command. - * - * @type {?Object} - * @default null - */ - drawParams: Object | null; - /** - * If this render object is used inside a render bundle, - * this property points to the respective bundle group. - * - * @type {?BundleGroup} - * @default null - */ - bundle: BundleGroup | null; - /** - * The clipping context. - * - * @type {ClippingContext} - */ - clippingContext: ClippingContext; - /** - * The clipping context's cache key. - * - * @type {string} - */ - clippingContextCacheKey: string; - /** - * The initial node cache key. - * - * @type {number} - */ - initialNodesCacheKey: number; - /** - * The initial cache key. - * - * @type {number} - */ - initialCacheKey: number; - /** - * The node builder state. - * - * @type {?NodeBuilderState} - * @private - * @default null - */ - private _nodeBuilderState; - /** - * An array of bindings. - * - * @type {?Array} - * @private - * @default null - */ - private _bindings; - /** - * Reference to the node material observer. - * - * @type {?NodeMaterialObserver} - * @private - * @default null - */ - private _monitor; - /** - * An event listener which is defined by `RenderObjects`. It performs - * clean up tasks when `dispose()` on this render object. - * - * @method - */ - onDispose: any; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isRenderObject: boolean; - /** - * An event listener which is executed when `dispose()` is called on - * the material of this render object. - * - * @method - */ - onMaterialDispose: () => void; - /** - * An event listener which is executed when `dispose()` is called on - * the geometry of this render object. - * - * @method - */ - onGeometryDispose: () => void; - /** - * Updates the clipping context. - * - * @param {ClippingContext} context - The clipping context to set. - */ - updateClipping(context: ClippingContext): void; - /** - * Whether the clipping requires an update or not. - * - * @type {boolean} - * @readonly - */ - readonly get clippingNeedsUpdate(): boolean; - /** - * The number of clipping planes defined in context of hardware clipping. - * - * @type {number} - * @readonly - */ - readonly get hardwareClippingPlanes(): number; - /** - * Returns the node builder state of this render object. - * - * @return {NodeBuilderState} The node builder state. - */ - getNodeBuilderState(): NodeBuilderState; - /** - * Returns the node material observer of this render object. - * - * @return {NodeMaterialObserver} The node material observer. - */ - getMonitor(): NodeMaterialObserver; - /** - * Returns an array of bind groups of this render object. - * - * @return {Array} The bindings. - */ - getBindings(): Array; - /** - * Returns a binding group by group name of this render object. - * - * @param {string} name - The name of the binding group. - * @return {?BindGroup} The bindings. - */ - getBindingGroup(name: string): BindGroup | null; - /** - * Returns the index of the render object's geometry. - * - * @return {?BufferAttribute} The index. Returns `null` for non-indexed geometries. - */ - getIndex(): BufferAttribute | null; - /** - * Returns the indirect buffer attribute. - * - * @return {?BufferAttribute} The indirect attribute. `null` if no indirect drawing is used. - */ - getIndirect(): BufferAttribute | null; - /** - * Returns the byte offset into the indirect attribute buffer. - * - * @return {number|Array} The byte offset into the indirect attribute buffer. - */ - getIndirectOffset(): number | Array; - /** - * Returns an array that acts as a key for identifying the render object in a chain map. - * - * @return {Array} An array with object references. - */ - getChainArray(): Array; - /** - * This method is used when the geometry of a 3D object has been exchanged and the - * respective render object now requires an update. - * - * @param {BufferGeometry} geometry - The geometry to set. - */ - setGeometry(geometry: BufferGeometry): void; - /** - * Returns the buffer attributes of the render object. The returned array holds - * attribute definitions on geometry and node level. - * - * @return {Array} An array with buffer attributes. - */ - getAttributes(): Array; - /** - * Returns the vertex buffers of the render object. - * - * @return {Array} An array with buffer attribute or interleaved buffers. - */ - getVertexBuffers(): Array; - /** - * Returns the draw parameters for the render object. - * - * @return {?{vertexCount: number, firstVertex: number, instanceCount: number, firstInstance: number}} The draw parameters. - */ - getDrawParameters(): { - vertexCount: number; - firstVertex: number; - instanceCount: number; - firstInstance: number; - } | null; - /** - * Returns the render object's geometry cache key. - * - * The geometry cache key is part of the material cache key. - * - * @return {string} The geometry cache key. - */ - getGeometryCacheKey(): string; - /** - * Returns the render object's material cache key. - * - * The material cache key is part of the render object cache key. - * - * @return {number} The material cache key. - */ - getMaterialCacheKey(): number; - /** - * Whether the geometry requires an update or not. - * - * @type {boolean} - * @readonly - */ - readonly get needsGeometryUpdate(): boolean; - /** - * Whether the render object requires an update or not. - * - * Note: There are two distinct places where render objects are checked for an update. - * - * 1. In `RenderObjects.get()` which is executed when the render object is request. This - * method checks the `needsUpdate` flag and recreates the render object if necessary. - * 2. In `Renderer._renderObjectDirect()` right after getting the render object via - * `RenderObjects.get()`. The render object's NodeMaterialObserver is then used to detect - * a need for a refresh due to material, geometry or object related value changes. - * - * TODO: Investigate if it's possible to merge both steps so there is only a single place - * that performs the 'needsUpdate' check. - * - * @type {boolean} - * @readonly - */ - readonly get needsUpdate(): boolean; - /** - * Returns the dynamic cache key which represents a key that is computed per draw command. - * - * @return {number} The cache key. - */ - getDynamicCacheKey(): number; - /** - * Returns the render object's cache key. - * - * @return {number} The cache key. - */ - getCacheKey(): number; - /** - * Frees internal resources. - */ - dispose(): void; -} diff --git a/jsdoc-testing/jsdoc/renderers/common/RenderObjectPipeline.d.ts b/jsdoc-testing/jsdoc/renderers/common/RenderObjectPipeline.d.ts deleted file mode 100644 index d9631c32e..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/RenderObjectPipeline.d.ts +++ /dev/null @@ -1,30 +0,0 @@ -export default RenderObjectPipeline; -/** - * Class for representing render pipelines. - * - * @private - * @augments Pipeline - */ -declare class RenderObjectPipeline extends Pipeline { - /** - * Constructs a new render object pipeline. - * - * @param {string} cacheKey - The pipeline's cache key. - * @param {ProgrammableStage} vertexProgram - The pipeline's vertex shader. - * @param {ProgrammableStage} fragmentProgram - The pipeline's fragment shader. - */ - constructor(cacheKey: string, vertexProgram: ProgrammableStage, fragmentProgram: ProgrammableStage); - /** - * The pipeline's vertex shader. - * - * @type {ProgrammableStage} - */ - vertexProgram: ProgrammableStage; - /** - * The pipeline's fragment shader. - * - * @type {ProgrammableStage} - */ - fragmentProgram: ProgrammableStage; -} -import Pipeline from './Pipeline.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/RenderObjects.d.ts b/jsdoc-testing/jsdoc/renderers/common/RenderObjects.d.ts deleted file mode 100644 index fcb34a2e6..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/RenderObjects.d.ts +++ /dev/null @@ -1,108 +0,0 @@ -export default RenderObjects; -/** - * This module manages the render objects of the renderer. - * - * @private - */ -declare class RenderObjects { - /** - * Constructs a new render object management component. - * - * @param {Renderer} renderer - The renderer. - * @param {NodeManager} nodes - Renderer component for managing nodes related logic. - * @param {Geometries} geometries - Renderer component for managing geometries. - * @param {Pipelines} pipelines - Renderer component for managing pipelines. - * @param {Bindings} bindings - Renderer component for managing bindings. - * @param {Info} info - Renderer component for managing metrics and monitoring data. - */ - constructor(renderer: Renderer, nodes: NodeManager, geometries: Geometries, pipelines: Pipelines, bindings: Bindings, info: Info); - /** - * The renderer. - * - * @type {Renderer} - */ - renderer: Renderer; - /** - * Renderer component for managing nodes related logic. - * - * @type {NodeManager} - */ - nodes: NodeManager; - /** - * Renderer component for managing geometries. - * - * @type {Geometries} - */ - geometries: Geometries; - /** - * Renderer component for managing pipelines. - * - * @type {Pipelines} - */ - pipelines: Pipelines; - /** - * Renderer component for managing bindings. - * - * @type {Bindings} - */ - bindings: Bindings; - /** - * Renderer component for managing metrics and monitoring data. - * - * @type {Info} - */ - info: Info; - /** - * A dictionary that manages render contexts in chain maps - * for each pass ID. - * - * @type {Object} - */ - chainMaps: { - [x: string]: ChainMap; - }; - /** - * Returns a render object for the given object and state data. - * - * @param {Object3D} object - The 3D object. - * @param {Material} material - The 3D object's material. - * @param {Scene} scene - The scene the 3D object belongs to. - * @param {Camera} camera - The camera the 3D object should be rendered with. - * @param {LightsNode} lightsNode - The lights node. - * @param {RenderContext} renderContext - The render context. - * @param {ClippingContext} clippingContext - The clipping context. - * @param {string} [passId] - An optional ID for identifying the pass. - * @return {RenderObject} The render object. - */ - get(object: Object3D, material: Material, scene: Scene, camera: Camera, lightsNode: LightsNode, renderContext: RenderContext, clippingContext: ClippingContext, passId?: string): RenderObject; - /** - * Returns a chain map for the given pass ID. - * - * @param {string} [passId='default'] - The pass ID. - * @return {ChainMap} The chain map. - */ - getChainMap(passId?: string): ChainMap; - /** - * Frees internal resources. - */ - dispose(): void; - /** - * Factory method for creating render objects with the given list of parameters. - * - * @param {NodeManager} nodes - Renderer component for managing nodes related logic. - * @param {Geometries} geometries - Renderer component for managing geometries. - * @param {Renderer} renderer - The renderer. - * @param {Object3D} object - The 3D object. - * @param {Material} material - The object's material. - * @param {Scene} scene - The scene the 3D object belongs to. - * @param {Camera} camera - The camera the object should be rendered with. - * @param {LightsNode} lightsNode - The lights node. - * @param {RenderContext} renderContext - The render context. - * @param {ClippingContext} clippingContext - The clipping context. - * @param {string} [passId] - An optional ID for identifying the pass. - * @return {RenderObject} The render object. - */ - createRenderObject(nodes: NodeManager, geometries: Geometries, renderer: Renderer, object: Object3D, material: Material, scene: Scene, camera: Camera, lightsNode: LightsNode, renderContext: RenderContext, clippingContext: ClippingContext, passId?: string): RenderObject; -} -import ChainMap from './ChainMap.js'; -import RenderObject from './RenderObject.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/RenderPipeline.d.ts b/jsdoc-testing/jsdoc/renderers/common/RenderPipeline.d.ts deleted file mode 100644 index 51a232c3c..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/RenderPipeline.d.ts +++ /dev/null @@ -1,126 +0,0 @@ -export default RenderPipeline; -/** - * This module is responsible to manage the rendering pipeline setups in apps. - * You usually create a single instance of this class and use it to define - * the output of your render pipeline and post processing effect chain. - * ```js - * const renderPipeline = new RenderPipeline( renderer ); - * - * const scenePass = pass( scene, camera ); - * - * renderPipeline.outputNode = scenePass; - * ``` - * - * Note: This module can only be used with `WebGPURenderer`. - */ -declare class RenderPipeline { - /** - * Constructs a new render pipeline management module. - * - * @param {Renderer} renderer - A reference to the renderer. - * @param {Node} outputNode - An optional output node. - */ - constructor(renderer: Renderer, outputNode?: Node); - /** - * A reference to the renderer. - * - * @type {Renderer} - */ - renderer: Renderer; - /** - * A node which defines the final output of the rendering - * pipeline. This is usually the last node in a chain - * of effect nodes. - * - * @type {Node} - */ - outputNode: Node; - /** - * Whether the default output tone mapping and color - * space transformation should be enabled or not. - * - * This is enabled by default but it must be disabled for - * effects that expect to be executed after tone mapping and color - * space conversion. A typical example is FXAA which - * requires sRGB input. - * - * When set to `false`, the app must control the output - * transformation with `RenderOutputNode`. - * - * ```js - * const outputPass = renderOutput( scenePass ); - * ``` - * - * @type {boolean} - */ - outputColorTransform: boolean; - /** - * Must be set to `true` when the output node changes. - * - * @type {Node} - */ - needsUpdate: Node; - /** - * The full screen quad that is used to render - * the effects. - * - * @private - * @type {QuadMesh} - */ - private _quadMesh; - /** - * The context of the render pipeline stack. - * - * @private - * @type {?Object} - * @default null - */ - private _context; - /** - * The current tone mapping. - * - * @private - * @type {ToneMapping} - */ - private _toneMapping; - /** - * The current output color space. - * - * @private - * @type {ColorSpace} - */ - private _outputColorSpace; - /** - * When `RenderPipeline` is used to apply rendering pipeline and post processing effects, - * the application must use this version of `render()` inside - * its animation loop (not the one from the renderer). - */ - render(): void; - /** - * Returns the current context of the render pipeline stack. - * - * @readonly - * @type {?Object} - */ - readonly get context(): Object | null; - /** - * Frees internal resources. - */ - dispose(): void; - /** - * Updates the state of the module. - * - * @private - */ - private _update; - /** - * When `RenderPipeline` is used to apply rendering pipeline and post processing effects, - * the application must use this version of `renderAsync()` inside - * its animation loop (not the one from the renderer). - * - * @async - * @deprecated - * @return {Promise} A Promise that resolves when the render has been finished. - */ - renderAsync(): Promise; -} diff --git a/jsdoc-testing/jsdoc/renderers/common/Renderer.d.ts b/jsdoc-testing/jsdoc/renderers/common/Renderer.d.ts deleted file mode 100644 index a43a970a5..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/Renderer.d.ts +++ /dev/null @@ -1,1401 +0,0 @@ -export default Renderer; -/** - * Animation loop parameter of `renderer.setAnimationLoop()`. - */ -export type onAnimationCallback = (time: DOMHighResTimeStamp, frame?: XRFrame) => any; -/** - * Base class for renderers. - */ -declare class Renderer { - /** - * Renderer options. - * - * @typedef {Object} Renderer~Options - * @property {boolean} [logarithmicDepthBuffer=false] - Whether logarithmic depth buffer is enabled or not. - * @property {boolean} [reversedDepthBuffer=false] - Whether reversed depth buffer is enabled or not. - * @property {boolean} [alpha=true] - Whether the default framebuffer (which represents the final contents of the canvas) should be transparent or opaque. - * @property {boolean} [depth=true] - Whether the default framebuffer should have a depth buffer or not. - * @property {boolean} [stencil=false] - Whether the default framebuffer should have a stencil buffer or not. - * @property {boolean} [antialias=false] - Whether MSAA as the default anti-aliasing should be enabled or not. - * @property {number} [samples=0] - When `antialias` is `true`, `4` samples are used by default. This parameter can set to any other integer value than 0 - * to overwrite the default. - * @property {?Function} [getFallback=null] - This callback function can be used to provide a fallback backend, if the primary backend can't be targeted. - * @property {number} [outputBufferType=HalfFloatType] - Defines the type of output buffers. The default `HalfFloatType` is recommend for best - * quality. To save memory and bandwidth, `UnsignedByteType` might be used. This will reduce rendering quality though. - * @property {boolean} [multiview=false] - If set to `true`, the renderer will use multiview during WebXR rendering if supported. - */ - /** - * Constructs a new renderer. - * - * @param {Backend} backend - The backend the renderer is targeting (e.g. WebGPU or WebGL 2). - * @param {Renderer~Options} [parameters] - The configuration parameter. - - */ - constructor(backend: Backend, parameters?: {}); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isRenderer: boolean; - /** - * A reference to the current backend. - * - * @type {Backend} - */ - backend: Backend; - /** - * Whether the renderer should automatically clear the current rendering target - * before execute a `render()` call. The target can be the canvas (default framebuffer) - * or the current bound render target (custom framebuffer). - * - * @type {boolean} - * @default true - */ - autoClear: boolean; - /** - * When `autoClear` is set to `true`, this property defines whether the renderer - * should clear the color buffer. - * - * @type {boolean} - * @default true - */ - autoClearColor: boolean; - /** - * When `autoClear` is set to `true`, this property defines whether the renderer - * should clear the depth buffer. - * - * @type {boolean} - * @default true - */ - autoClearDepth: boolean; - /** - * When `autoClear` is set to `true`, this property defines whether the renderer - * should clear the stencil buffer. - * - * @type {boolean} - * @default true - */ - autoClearStencil: boolean; - /** - * Whether the default framebuffer should be transparent or opaque. - * - * @type {boolean} - * @default true - */ - alpha: boolean; - /** - * Whether logarithmic depth buffer is enabled or not. - * - * @type {boolean} - * @default false - * @readonly - */ - readonly logarithmicDepthBuffer: boolean; - /** - * Whether reversed depth buffer is enabled or not. - * - * @type {boolean} - * @default false - * @readonly - */ - readonly reversedDepthBuffer: boolean; - /** - * Defines the output color space of the renderer. - * - * @type {string} - * @default SRGBColorSpace - */ - outputColorSpace: string; - /** - * Defines the tone mapping of the renderer. - * - * @type {number} - * @default NoToneMapping - */ - toneMapping: number; - /** - * Defines the tone mapping exposure. - * - * @type {number} - * @default 1 - */ - toneMappingExposure: number; - /** - * Whether the renderer should sort its render lists or not. - * - * Note: Sorting is used to attempt to properly render objects that have some degree of transparency. - * By definition, sorting objects may not work in all cases. Depending on the needs of application, - * it may be necessary to turn off sorting and use other methods to deal with transparency rendering - * e.g. manually determining each object's rendering order. - * - * @type {boolean} - * @default true - */ - sortObjects: boolean; - /** - * Whether the default framebuffer should have a depth buffer or not. - * - * @type {boolean} - * @default true - */ - depth: boolean; - /** - * Whether the default framebuffer should have a stencil buffer or not. - * - * @type {boolean} - * @default false - */ - stencil: boolean; - /** - * Holds a series of statistical information about the GPU memory - * and the rendering process. Useful for debugging and monitoring. - * - * @type {Info} - */ - info: Info; - /** - * A global context node that stores override nodes for specific transformations or calculations. - * These nodes can be used to replace default behavior in the rendering pipeline. - * - * @type {ContextNode} - * @property {Object} value - The context value object. - */ - contextNode: ContextNode; - /** - * The node library defines how certain library objects like materials, lights - * or tone mapping functions are mapped to node types. This is required since - * although instances of classes like `MeshBasicMaterial` or `PointLight` can - * be part of the scene graph, they are internally represented as nodes for - * further processing. - * - * @type {NodeLibrary} - */ - library: NodeLibrary; - /** - * A map-like data structure for managing lights. - * - * @type {Lighting} - */ - lighting: Lighting; - /** - * The number of MSAA samples. - * - * @private - * @type {number} - * @default 0 - */ - private _samples; - /** - * Callback when the canvas has been resized. - * - * @private - */ - private _onCanvasTargetResize; - /** - * The canvas target for rendering. - * - * @private - * @type {CanvasTarget} - */ - private _canvasTarget; - /** - * The inspector provides information about the internal renderer state. - * - * @private - * @type {InspectorBase} - */ - private _inspector; - /** - * This callback function can be used to provide a fallback backend, if the primary backend can't be targeted. - * - * @private - * @type {?Function} - */ - private _getFallback; - /** - * A reference to a renderer module for managing shader attributes. - * - * @private - * @type {?Attributes} - * @default null - */ - private _attributes; - /** - * A reference to a renderer module for managing geometries. - * - * @private - * @type {?Geometries} - * @default null - */ - private _geometries; - /** - * A reference to a renderer module for managing node related logic. - * - * @private - * @type {?NodeManager} - * @default null - */ - private _nodes; - /** - * A reference to a renderer module for managing the internal animation loop. - * - * @private - * @type {?Animation} - * @default null - */ - private _animation; - /** - * A reference to a renderer module for managing shader program bindings. - * - * @private - * @type {?Bindings} - * @default null - */ - private _bindings; - /** - * A reference to a renderer module for managing render objects. - * - * @private - * @type {?RenderObjects} - * @default null - */ - private _objects; - /** - * A reference to a renderer module for managing render and compute pipelines. - * - * @private - * @type {?Pipelines} - * @default null - */ - private _pipelines; - /** - * A reference to a renderer module for managing render bundles. - * - * @private - * @type {?RenderBundles} - * @default null - */ - private _bundles; - /** - * A reference to a renderer module for managing render lists. - * - * @private - * @type {?RenderLists} - * @default null - */ - private _renderLists; - /** - * A reference to a renderer module for managing render contexts. - * - * @private - * @type {?RenderContexts} - * @default null - */ - private _renderContexts; - /** - * A reference to a renderer module for managing textures. - * - * @private - * @type {?Textures} - * @default null - */ - private _textures; - /** - * A reference to a renderer module for backgrounds. - * - * @private - * @type {?Background} - * @default null - */ - private _background; - /** - * Cache for the fullscreen quad. - * This fullscreen quad is used for internal render passes - * like the tone mapping and color space output pass. - * - * @private - * @type {Map} - */ - private _quadCache; - /** - * A reference to the current render context. - * - * @private - * @type {?RenderContext} - * @default null - */ - private _currentRenderContext; - /** - * A custom sort function for the opaque render list. - * - * @private - * @type {?Function} - * @default null - */ - private _opaqueSort; - /** - * A custom sort function for the transparent render list. - * - * @private - * @type {?Function} - * @default null - */ - private _transparentSort; - /** - * Cache of framebuffer targets per canvas target. - * - * @private - * @type {Map} - */ - private _frameBufferTargets; - /** - * The clear color value. - * - * @private - * @type {Color4} - */ - private _clearColor; - /** - * The clear depth value. - * - * @private - * @type {number} - * @default 1 - */ - private _clearDepth; - /** - * The clear stencil value. - * - * @private - * @type {number} - * @default 0 - */ - private _clearStencil; - /** - * The current render target. - * - * @private - * @type {?RenderTarget} - * @default null - */ - private _renderTarget; - /** - * The active cube face. - * - * @private - * @type {number} - * @default 0 - */ - private _activeCubeFace; - /** - * The active mipmap level. - * - * @private - * @type {number} - * @default 0 - */ - private _activeMipmapLevel; - /** - * The current output render target. - * - * @private - * @type {?RenderTarget} - * @default null - */ - private _outputRenderTarget; - /** - * The MRT setting. - * - * @private - * @type {?MRTNode} - * @default null - */ - private _mrt; - /** - * This function defines how a render object is going - * to be rendered. - * - * @private - * @type {?Function} - * @default null - */ - private _renderObjectFunction; - /** - * Used to keep track of the current render object function. - * - * @private - * @type {?Function} - * @default null - */ - private _currentRenderObjectFunction; - /** - * Used to keep track of the current render bundle. - * - * @private - * @type {?RenderBundle} - * @default null - */ - private _currentRenderBundle; - /** - * Next to `_renderObjectFunction()`, this function provides another hook - * for influencing the render process of a render object. It is meant for internal - * use and only relevant for `compileAsync()` right now. Instead of using - * the default logic of `_renderObjectDirect()` which actually draws the render object, - * a different function might be used which performs no draw but just the node - * and pipeline updates. - * - * @private - * @type {Function} - */ - private _handleObjectFunction; - /** - * Indicates whether the device has been lost or not. In WebGL terms, the device - * lost is considered as a context lost. When this is set to `true`, rendering - * isn't possible anymore. - * - * @private - * @type {boolean} - * @default false - */ - private _isDeviceLost; - /** - * A callback function that defines what should happen when a device/context lost occurs. - * - * @type {Function} - */ - onDeviceLost: Function; - /** - * Defines the type of output buffers. The default `HalfFloatType` is recommend for - * best quality. To save memory and bandwidth, `UnsignedByteType` might be used. - * This will reduce rendering quality though. - * - * @private - * @type {number} - * @default HalfFloatType - */ - private _outputBufferType; - /** - * A cache for shadow nodes per material - * - * @private - * @type {WeakMap} - */ - private _cacheShadowNodes; - /** - * Whether the renderer has been initialized or not. - * - * @private - * @type {boolean} - * @default false - */ - private _initialized; - /** - * The call depth of the renderer. Counts the number of - * nested render calls. - * - * @private - * @type {number} - * @default - 1 - */ - private _callDepth; - /** - * A reference to the promise which initializes the renderer. - * - * @private - * @type {?Promise} - * @default null - */ - private _initPromise; - /** - * An array of compilation promises which are used in `compileAsync()`. - * - * @private - * @type {?Array} - * @default null - */ - private _compilationPromises; - /** - * Whether the renderer should render transparent render objects or not. - * - * @type {boolean} - * @default true - */ - transparent: boolean; - /** - * Whether the renderer should render opaque render objects or not. - * - * @type {boolean} - * @default true - */ - opaque: boolean; - /** - * Shadow map configuration - * @typedef {Object} ShadowMapConfig - * @property {boolean} enabled - Whether to globally enable shadows or not. - * @property {boolean} transmitted - Whether to enable light transmission through non-opaque materials. - * @property {number} type - The shadow map type. - */ - /** - * The renderer's shadow configuration. - * - * @type {ShadowMapConfig} - */ - shadowMap: { - /** - * - Whether to globally enable shadows or not. - */ - enabled: boolean; - /** - * - Whether to enable light transmission through non-opaque materials. - */ - transmitted: boolean; - /** - * - The shadow map type. - */ - type: number; - }; - /** - * XR configuration. - * @typedef {Object} XRConfig - * @property {boolean} enabled - Whether to globally enable XR or not. - */ - /** - * The renderer's XR manager. - * - * @type {XRManager} - */ - xr: XRManager; - /** - * Debug configuration. - * @typedef {Object} DebugConfig - * @property {boolean} checkShaderErrors - Whether shader errors should be checked or not. - * @property {?Function} onShaderError - A callback function that is executed when a shader error happens. Only supported with WebGL 2 right now. - * @property {Function} getShaderAsync - Allows the get the raw shader code for the given scene, camera and 3D object. - */ - /** - * The renderer's debug configuration. - * - * @type {DebugConfig} - */ - debug: { - /** - * - Whether shader errors should be checked or not. - */ - checkShaderErrors: boolean; - /** - * - A callback function that is executed when a shader error happens. Only supported with WebGL 2 right now. - */ - onShaderError: Function | null; - /** - * - Allows the get the raw shader code for the given scene, camera and 3D object. - */ - getShaderAsync: Function; - }; - /** - * Initializes the renderer so it is ready for usage. - * - * @async - * @return {Promise} A Promise that resolves when the renderer has been initialized. - */ - init(): Promise; - /** - * A reference to the canvas element the renderer is drawing to. - * This value of this property will automatically be created by - * the renderer. - * - * @type {HTMLCanvasElement|OffscreenCanvas} - */ - get domElement(): HTMLCanvasElement | OffscreenCanvas; - /** - * The coordinate system of the renderer. The value of this property - * depends on the selected backend. Either `THREE.WebGLCoordinateSystem` or - * `THREE.WebGPUCoordinateSystem`. - * - * @readonly - * @type {number} - */ - readonly get coordinateSystem(): number; - /** - * Compiles all materials in the given scene. This can be useful to avoid a - * phenomenon which is called "shader compilation stutter", which occurs when - * rendering an object with a new shader for the first time. - * - * If you want to add a 3D object to an existing scene, use the third optional - * parameter for applying the target scene. Note that the (target) scene's lighting - * and environment must be configured before calling this method. - * - * @async - * @param {Object3D} scene - The scene or 3D object to precompile. - * @param {Camera} camera - The camera that is used to render the scene. - * @param {?Scene} targetScene - If the first argument is a 3D object, this parameter must represent the scene the 3D object is going to be added. - * @return {Promise} A Promise that resolves when the compile has been finished. - */ - compileAsync(scene: Object3D, camera: Camera, targetScene?: Scene | null): Promise; - /** - * Renders the scene in an async fashion. - * - * @async - * @deprecated - * @param {Object3D} scene - The scene or 3D object to render. - * @param {Camera} camera - The camera. - * @return {Promise} A Promise that resolves when the render has been finished. - */ - renderAsync(scene: Object3D, camera: Camera): Promise; - /** - * Can be used to synchronize CPU operations with GPU tasks. So when this method is called, - * the CPU waits for the GPU to complete its operation (e.g. a compute task). - * - * @async - * @deprecated - * @return {Promise} A Promise that resolves when synchronization has been finished. - */ - waitForGPU(): Promise; - set inspector(value: InspectorBase); - /** - * The inspector instance. The inspector can be any class that extends from `InspectorBase`. - * - * @type {InspectorBase} - */ - get inspector(): InspectorBase; - /** - * Enables or disables high precision for model-view and normal-view matrices. - * When enabled, will use CPU 64-bit precision for higher precision instead of GPU 32-bit for higher performance. - * - * NOTE: 64-bit precision is not compatible with `InstancedMesh` and `SkinnedMesh`. - * - * @param {boolean} value - Whether to enable or disable high precision. - * @type {boolean} - */ - set highPrecision(value: boolean); - /** - * Returns whether high precision is enabled or not. - * - * @return {boolean} Whether high precision is enabled or not. - * @type {boolean} - */ - get highPrecision(): boolean; - /** - * Sets the given MRT configuration. - * - * @param {MRTNode} mrt - The MRT node to set. - * @return {Renderer} A reference to this renderer. - */ - setMRT(mrt: MRTNode): Renderer; - /** - * Returns the MRT configuration. - * - * @return {MRTNode} The MRT configuration. - */ - getMRT(): MRTNode; - /** - * Returns the output buffer type. - * - * @return {number} The output buffer type. - */ - getOutputBufferType(): number; - /** - * Returns the output buffer type. - * - * @deprecated since r182. Use `.getOutputBufferType()` instead. - * @return {number} The output buffer type. - */ - getColorBufferType(): number; - /** - * Default implementation of the device lost callback. - * - * @private - * @param {Object} info - Information about the context lost. - */ - private _onDeviceLost; - /** - * Renders the given render bundle. - * - * @private - * @param {Object} bundle - Render bundle data. - * @param {Scene} sceneRef - The scene the render bundle belongs to. - * @param {LightsNode} lightsNode - The lights node. - */ - private _renderBundle; - /** - * Renders the scene or 3D object with the given camera. This method can only be called - * if the renderer has been initialized. When using `render()` inside an animation loop, - * it's guaranteed the renderer will be initialized. The animation loop must be defined - * with {@link Renderer#setAnimationLoop} though. - * - * For all other use cases (like when using on-demand rendering), you must call - * {@link Renderer#init} before rendering. - * - * The target of the method is the default framebuffer (meaning the canvas) - * or alternatively a render target when specified via `setRenderTarget()`. - * - * @param {Object3D} scene - The scene or 3D object to render. - * @param {Camera} camera - The camera to render the scene with. - */ - render(scene: Object3D, camera: Camera): void; - /** - * Returns whether the renderer has been initialized or not. - * - * @readonly - * @return {boolean} Whether the renderer has been initialized or not. - */ - readonly get initialized(): boolean; - /** - * Returns an internal render target which is used when computing the output tone mapping - * and color space conversion. Unlike in `WebGLRenderer`, this is done in a separate render - * pass and not inline to achieve more correct results. - * - * @private - * @return {?RenderTarget} The render target. The method returns `null` if no output conversion should be applied. - */ - private _getFrameBufferTarget; - /** - * Renders the scene or 3D object with the given camera. - * - * @private - * @param {Object3D} scene - The scene or 3D object to render. - * @param {Camera} camera - The camera to render the scene with. - * @param {boolean} [useFrameBufferTarget=true] - Whether to use a framebuffer target or not. - * @return {RenderContext} The current render context. - */ - private _renderScene; - _setXRLayerSize(width: any, height: any): void; - /** - * The output pass performs tone mapping and color space conversion. - * - * @private - * @param {RenderTarget} renderTarget - The current render target. - */ - private _renderOutput; - /** - * Returns the maximum available anisotropy for texture filtering. - * - * @return {number} The maximum available anisotropy. - */ - getMaxAnisotropy(): number; - /** - * Returns the active cube face. - * - * @return {number} The active cube face. - */ - getActiveCubeFace(): number; - /** - * Returns the active mipmap level. - * - * @return {number} The active mipmap level. - */ - getActiveMipmapLevel(): number; - /** - * Applications are advised to always define the animation loop - * with this method and not manually with `requestAnimationFrame()` - * for best compatibility. - * - * @async - * @param {?onAnimationCallback} callback - The application's animation loop. - * @return {Promise} A Promise that resolves when the set has been executed. - */ - setAnimationLoop(callback: onAnimationCallback | null): Promise; - /** - * Returns the current animation loop callback. - * - * @return {?Function} The current animation loop callback. - */ - getAnimationLoop(): Function | null; - /** - * Can be used to transfer buffer data from a storage buffer attribute - * from the GPU to the CPU in context of compute shaders. - * - * @async - * @param {StorageBufferAttribute} attribute - The storage buffer attribute. - * @return {Promise} A promise that resolves with the buffer data when the data are ready. - */ - getArrayBufferAsync(attribute: StorageBufferAttribute): Promise; - /** - * Returns the rendering context. - * - * @return {GPUCanvasContext|WebGL2RenderingContext} The rendering context. - */ - getContext(): GPUCanvasContext | WebGL2RenderingContext; - /** - * Returns the pixel ratio. - * - * @return {number} The pixel ratio. - */ - getPixelRatio(): number; - /** - * Returns the drawing buffer size in physical pixels. This method honors the pixel ratio. - * - * @param {Vector2} target - The method writes the result in this target object. - * @return {Vector2} The drawing buffer size. - */ - getDrawingBufferSize(target: Vector2): Vector2; - /** - * Returns the renderer's size in logical pixels. This method does not honor the pixel ratio. - * - * @param {Vector2} target - The method writes the result in this target object. - * @return {Vector2} The renderer's size in logical pixels. - */ - getSize(target: Vector2): Vector2; - /** - * Sets the given pixel ratio and resizes the canvas if necessary. - * - * @param {number} [value=1] - The pixel ratio. - */ - setPixelRatio(value?: number): void; - /** - * This method allows to define the drawing buffer size by specifying - * width, height and pixel ratio all at once. The size of the drawing - * buffer is computed with this formula: - * ```js - * size.x = width * pixelRatio; - * size.y = height * pixelRatio; - * ``` - * - * @param {number} width - The width in logical pixels. - * @param {number} height - The height in logical pixels. - * @param {number} pixelRatio - The pixel ratio. - */ - setDrawingBufferSize(width: number, height: number, pixelRatio: number): void; - /** - * Sets the size of the renderer. - * - * @param {number} width - The width in logical pixels. - * @param {number} height - The height in logical pixels. - * @param {boolean} [updateStyle=true] - Whether to update the `style` attribute of the canvas or not. - */ - setSize(width: number, height: number, updateStyle?: boolean): void; - /** - * Defines a manual sort function for the opaque render list. - * Pass `null` to use the default sort. - * - * @param {Function} method - The sort function. - */ - setOpaqueSort(method: Function): void; - /** - * Defines a manual sort function for the transparent render list. - * Pass `null` to use the default sort. - * - * @param {Function} method - The sort function. - */ - setTransparentSort(method: Function): void; - /** - * Returns the scissor rectangle. - * - * @param {Vector4} target - The method writes the result in this target object. - * @return {Vector4} The scissor rectangle. - */ - getScissor(target: Vector4): Vector4; - /** - * Defines the scissor rectangle. - * - * @param {number | Vector4} x - The horizontal coordinate for the upper left corner of the box in logical pixel unit. - * Instead of passing four arguments, the method also works with a single four-dimensional vector. - * @param {number} y - The vertical coordinate for the upper left corner of the box in logical pixel unit. - * @param {number} width - The width of the scissor box in logical pixel unit. - * @param {number} height - The height of the scissor box in logical pixel unit. - */ - setScissor(x: number | Vector4, y: number, width: number, height: number): void; - /** - * Returns the scissor test value. - * - * @return {boolean} Whether the scissor test should be enabled or not. - */ - getScissorTest(): boolean; - /** - * Defines the scissor test. - * - * @param {boolean} boolean - Whether the scissor test should be enabled or not. - */ - setScissorTest(boolean: boolean): void; - /** - * Returns the viewport definition. - * - * @param {Vector4} target - The method writes the result in this target object. - * @return {Vector4} The viewport definition. - */ - getViewport(target: Vector4): Vector4; - /** - * Defines the viewport. - * - * @param {number | Vector4} x - The horizontal coordinate for the upper left corner of the viewport origin in logical pixel unit. - * @param {number} y - The vertical coordinate for the upper left corner of the viewport origin in logical pixel unit. - * @param {number} width - The width of the viewport in logical pixel unit. - * @param {number} height - The height of the viewport in logical pixel unit. - * @param {number} minDepth - The minimum depth value of the viewport. WebGPU only. - * @param {number} maxDepth - The maximum depth value of the viewport. WebGPU only. - */ - setViewport(x: number | Vector4, y: number, width: number, height: number, minDepth?: number, maxDepth?: number): void; - /** - * Returns the clear color. - * - * @param {Color} target - The method writes the result in this target object. - * @return {Color} The clear color. - */ - getClearColor(target: Color): Color; - /** - * Defines the clear color and optionally the clear alpha. - * - * @param {Color} color - The clear color. - * @param {number} [alpha=1] - The clear alpha. - */ - setClearColor(color: Color, alpha?: number): void; - /** - * Returns the clear alpha. - * - * @return {number} The clear alpha. - */ - getClearAlpha(): number; - /** - * Defines the clear alpha. - * - * @param {number} alpha - The clear alpha. - */ - setClearAlpha(alpha: number): void; - /** - * Returns the clear depth. - * - * @return {number} The clear depth. - */ - getClearDepth(): number; - /** - * Defines the clear depth. - * - * @param {number} depth - The clear depth. - */ - setClearDepth(depth: number): void; - /** - * Returns the clear stencil. - * - * @return {number} The clear stencil. - */ - getClearStencil(): number; - /** - * Defines the clear stencil. - * - * @param {number} stencil - The clear stencil. - */ - setClearStencil(stencil: number): void; - /** - * This method performs an occlusion query for the given 3D object. - * It returns `true` if the given 3D object is fully occluded by other - * 3D objects in the scene. - * - * @param {Object3D} object - The 3D object to test. - * @return {boolean} Whether the 3D object is fully occluded or not. - */ - isOccluded(object: Object3D): boolean; - /** - * Performs a manual clear operation. This method ignores `autoClear` properties. - * - * @param {boolean} [color=true] - Whether the color buffer should be cleared or not. - * @param {boolean} [depth=true] - Whether the depth buffer should be cleared or not. - * @param {boolean} [stencil=true] - Whether the stencil buffer should be cleared or not. - */ - clear(color?: boolean, depth?: boolean, stencil?: boolean): void; - /** - * Performs a manual clear operation of the color buffer. This method ignores `autoClear` properties. - */ - clearColor(): void; - /** - * Performs a manual clear operation of the depth buffer. This method ignores `autoClear` properties. - */ - clearDepth(): void; - /** - * Performs a manual clear operation of the stencil buffer. This method ignores `autoClear` properties. - */ - clearStencil(): void; - /** - * Async version of {@link Renderer#clear}. - * - * @async - * @deprecated - * @param {boolean} [color=true] - Whether the color buffer should be cleared or not. - * @param {boolean} [depth=true] - Whether the depth buffer should be cleared or not. - * @param {boolean} [stencil=true] - Whether the stencil buffer should be cleared or not. - * @return {Promise} A Promise that resolves when the clear operation has been executed. - */ - clearAsync(color?: boolean, depth?: boolean, stencil?: boolean): Promise; - /** - * Async version of {@link Renderer#clearColor}. - * - * @async - * @deprecated - * @return {Promise} A Promise that resolves when the clear operation has been executed. - */ - clearColorAsync(): Promise; - /** - * Async version of {@link Renderer#clearDepth}. - * - * @async - * @deprecated - * @return {Promise} A Promise that resolves when the clear operation has been executed. - */ - clearDepthAsync(): Promise; - /** - * Async version of {@link Renderer#clearStencil}. - * - * @async - * @deprecated - * @return {Promise} A Promise that resolves when the clear operation has been executed. - */ - clearStencilAsync(): Promise; - /** - * Returns `true` if a framebuffer target is needed to perform tone mapping or color space conversion. - * If this is the case, the renderer allocates an internal render target for that purpose. - * - */ - get needsFrameBufferTarget(): boolean; - /** - * The number of samples used for multi-sample anti-aliasing (MSAA). - * - * @type {number} - * @default 0 - */ - get samples(): number; - /** - * The current number of samples used for multi-sample anti-aliasing (MSAA). - * - * When rendering to a custom render target, the number of samples of that render target is used. - * If the renderer needs an internal framebuffer target for tone mapping or color space conversion, - * the number of samples is set to 0. - * - * @type {number} - */ - get currentSamples(): number; - /** - * The current tone mapping of the renderer. When not producing screen output, - * the tone mapping is always `NoToneMapping`. - * - * @type {number} - */ - get currentToneMapping(): number; - /** - * The current color space of the renderer. When not producing screen output, - * the color space is always the working color space. - * - * @type {string} - */ - get currentColorSpace(): string; - /** - * Returns `true` if the rendering settings are set to screen output. - * - * @returns {boolean} True if the current render target is the same of output render target or `null`, otherwise false. - */ - get isOutputTarget(): boolean; - /** - * Frees all internal resources of the renderer. Call this method if the renderer - * is no longer in use by your app. - */ - dispose(): void; - /** - * Sets the given render target. Calling this method means the renderer does not - * target the default framebuffer (meaning the canvas) anymore but a custom framebuffer. - * Use `null` as the first argument to reset the state. - * - * @param {?RenderTarget} renderTarget - The render target to set. - * @param {number} [activeCubeFace=0] - The active cube face. - * @param {number} [activeMipmapLevel=0] - The active mipmap level. - */ - setRenderTarget(renderTarget: RenderTarget | null, activeCubeFace?: number, activeMipmapLevel?: number): void; - /** - * Returns the current render target. - * - * @return {?RenderTarget} The render target. Returns `null` if no render target is set. - */ - getRenderTarget(): RenderTarget | null; - /** - * Sets the output render target for the renderer. - * - * @param {?RenderTarget} renderTarget - The render target to set as the output target. - */ - setOutputRenderTarget(renderTarget: RenderTarget | null): void; - /** - * Returns the current output target. - * - * @return {?RenderTarget} The current output render target. Returns `null` if no output target is set. - */ - getOutputRenderTarget(): RenderTarget | null; - /** - * Sets the canvas target. The canvas target manages the HTML canvas - * or the offscreen canvas the renderer draws into. - * - * @param {CanvasTarget} canvasTarget - The canvas target. - */ - setCanvasTarget(canvasTarget: CanvasTarget): void; - /** - * Returns the current canvas target. - * - * @return {CanvasTarget} The current canvas target. - */ - getCanvasTarget(): CanvasTarget; - /** - * Resets the renderer to the initial state before WebXR started. - * - * @private - */ - private _resetXRState; - /** - * Callback for {@link Renderer#setRenderObjectFunction}. - * - * @callback renderObjectFunction - * @param {Object3D} object - The 3D object. - * @param {Scene} scene - The scene the 3D object belongs to. - * @param {Camera} camera - The camera the object should be rendered with. - * @param {BufferGeometry} geometry - The object's geometry. - * @param {Material} material - The object's material. - * @param {?Object} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. - * @param {LightsNode} lightsNode - The current lights node. - * @param {ClippingContext} clippingContext - The clipping context. - * @param {?string} [passId=null] - An optional ID for identifying the pass. - */ - /** - * Sets the given render object function. Calling this method overwrites the default implementation - * which is {@link Renderer#renderObject}. Defining a custom function can be useful - * if you want to modify the way objects are rendered. For example you can define things like "every - * object that has material of a certain type should perform a pre-pass with a special overwrite material". - * The custom function must always call `renderObject()` in its implementation. - * - * Use `null` as the first argument to reset the state. - * - * @param {?renderObjectFunction} renderObjectFunction - The render object function. - */ - setRenderObjectFunction(renderObjectFunction: ((object: Object3D, scene: Scene, camera: Camera, geometry: BufferGeometry, material: Material, group: Object | null, lightsNode: LightsNode, clippingContext: ClippingContext, passId?: string | null | undefined) => any) | null): void; - /** - * Returns the current render object function. - * - * @return {?Function} The current render object function. Returns `null` if no function is set. - */ - getRenderObjectFunction(): Function | null; - /** - * Execute a single or an array of compute nodes. This method can only be called - * if the renderer has been initialized. - * - * @param {Node|Array} computeNodes - The compute node(s). - * @param {number|Array|IndirectStorageBufferAttribute} [dispatchSize=null] - * - A single number representing count, or - * - An array [x, y, z] representing dispatch size, or - * - A IndirectStorageBufferAttribute for indirect dispatch size. - * @return {Promise|undefined} A Promise that resolve when the compute has finished. Only returned when the renderer has not been initialized. - */ - compute(computeNodes: Node | Array, dispatchSize?: number | Array | IndirectStorageBufferAttribute): Promise | undefined; - /** - * Execute a single or an array of compute nodes. - * - * @async - * @param {Node|Array} computeNodes - The compute node(s). - * @param {number|Array|IndirectStorageBufferAttribute} [dispatchSize=null] - * - A single number representing count, or - * - An array [x, y, z] representing dispatch size, or - * - A IndirectStorageBufferAttribute for indirect dispatch size. - * @return {Promise} A Promise that resolve when the compute has finished. - */ - computeAsync(computeNodes: Node | Array, dispatchSize?: number | Array | IndirectStorageBufferAttribute): Promise; - /** - * Checks if the given feature is supported by the selected backend. - * - * @async - * @deprecated - * @param {string} name - The feature's name. - * @return {Promise} A Promise that resolves with a bool that indicates whether the feature is supported or not. - */ - hasFeatureAsync(name: string): Promise; - resolveTimestampsAsync(type?: string): Promise; - /** - * Checks if the given feature is supported by the selected backend. If the - * renderer has not been initialized, this method always returns `false`. - * - * @param {string} name - The feature's name. - * @return {boolean} Whether the feature is supported or not. - */ - hasFeature(name: string): boolean; - /** - * Returns `true` when the renderer has been initialized. - * - * @return {boolean} Whether the renderer has been initialized or not. - */ - hasInitialized(): boolean; - /** - * Initializes the given textures. Useful for preloading a texture rather than waiting until first render - * (which can cause noticeable lags due to decode and GPU upload overhead). - * - * @async - * @deprecated - * @param {Texture} texture - The texture. - * @return {Promise} A Promise that resolves when the texture has been initialized. - */ - initTextureAsync(texture: Texture): Promise; - /** - * Initializes the given texture. Useful for preloading a texture rather than waiting until first render - * (which can cause noticeable lags due to decode and GPU upload overhead). - * - * This method can only be used if the renderer has been initialized. - * - * @param {Texture} texture - The texture. - */ - initTexture(texture: Texture): void; - /** - * Initializes the given render target. - * - * @param {RenderTarget} renderTarget - The render target to intialize. - */ - initRenderTarget(renderTarget: RenderTarget): void; - /** - * Copies the current bound framebuffer into the given texture. - * - * @param {FramebufferTexture} framebufferTexture - The texture. - * @param {?(Vector2|Vector4)} [rectangle=null] - A two or four dimensional vector that defines the rectangular portion of the framebuffer that should be copied. - */ - copyFramebufferToTexture(framebufferTexture: FramebufferTexture, rectangle?: (Vector2 | Vector4) | null): void; - /** - * Copies data of the given source texture into a destination texture. - * - * @param {Texture} srcTexture - The source texture. - * @param {Texture} dstTexture - The destination texture. - * @param {Box2|Box3} [srcRegion=null] - A bounding box which describes the source region. Can be two or three-dimensional. - * @param {Vector2|Vector3} [dstPosition=null] - A vector that represents the origin of the destination region. Can be two or three-dimensional. - * @param {number} [srcLevel=0] - The source mip level to copy from. - * @param {number} [dstLevel=0] - The destination mip level to copy to. - */ - copyTextureToTexture(srcTexture: Texture, dstTexture: Texture, srcRegion?: Box2 | Box3, dstPosition?: Vector2 | Vector3, srcLevel?: number, dstLevel?: number): void; - /** - * Reads pixel data from the given render target. - * - * @async - * @param {RenderTarget} renderTarget - The render target to read from. - * @param {number} x - The `x` coordinate of the copy region's origin. - * @param {number} y - The `y` coordinate of the copy region's origin. - * @param {number} width - The width of the copy region. - * @param {number} height - The height of the copy region. - * @param {number} [textureIndex=0] - The texture index of a MRT render target. - * @param {number} [faceIndex=0] - The active cube face index. - * @return {Promise} A Promise that resolves when the read has been finished. The resolve provides the read data as a typed array. - */ - readRenderTargetPixelsAsync(renderTarget: RenderTarget, x: number, y: number, width: number, height: number, textureIndex?: number, faceIndex?: number): Promise; - /** - * Analyzes the given 3D object's hierarchy and builds render lists from the - * processed hierarchy. - * - * @private - * @param {Object3D} object - The 3D object to process (usually a scene). - * @param {Camera} camera - The camera the object is rendered with. - * @param {number} groupOrder - The group order is derived from the `renderOrder` of groups and is used to group 3D objects within groups. - * @param {RenderList} renderList - The current render list. - * @param {ClippingContext} clippingContext - The current clipping context. - */ - private _projectObject; - /** - * Renders the given render bundles. - * - * @private - * @param {Array} bundles - Array with render bundle data. - * @param {Scene} sceneRef - The scene the render bundles belong to. - * @param {LightsNode} lightsNode - The current lights node. - */ - private _renderBundles; - /** - * Renders the transparent objects from the given render lists. - * - * @private - * @param {Array} renderList - The transparent render list. - * @param {Array} doublePassList - The list of transparent objects which require a double pass (e.g. because of transmission). - * @param {Camera} camera - The camera the render list should be rendered with. - * @param {Scene} scene - The scene the render list belongs to. - * @param {LightsNode} lightsNode - The current lights node. - */ - private _renderTransparents; - /** - * Renders the objects from the given render list. - * - * @private - * @param {Array} renderList - The render list. - * @param {Camera} camera - The camera the render list should be rendered with. - * @param {Scene} scene - The scene the render list belongs to. - * @param {LightsNode} lightsNode - The current lights node. - * @param {?string} [passId=null] - An optional ID for identifying the pass. - */ - private _renderObjects; - /** - * Retrieves shadow nodes for the given material. This is used to setup shadow passes. - * The result is cached per material and updated when the material's version changes. - * - * @private - * @param {Material} material - * @returns {Object} - The shadow nodes for the material. - */ - private _getShadowNodes; - /** - * This method represents the default render object function that manages the render lifecycle - * of the object. - * - * @param {Object3D} object - The 3D object. - * @param {Scene} scene - The scene the 3D object belongs to. - * @param {Camera} camera - The camera the object should be rendered with. - * @param {BufferGeometry} geometry - The object's geometry. - * @param {Material} material - The object's material. - * @param {?Object} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. - * @param {LightsNode} lightsNode - The current lights node. - * @param {?ClippingContext} clippingContext - The clipping context. - * @param {?string} [passId=null] - An optional ID for identifying the pass. - */ - renderObject(object: Object3D, scene: Scene, camera: Camera, geometry: BufferGeometry, material: Material, group: Object | null, lightsNode: LightsNode, clippingContext?: ClippingContext | null, passId?: string | null): void; - /** - * Checks if the given compatibility is supported by the selected backend. - * - * @param {string} name - The compatibility's name. - * @return {boolean} Whether the compatibility is supported or not. - */ - hasCompatibility(name: string): boolean; - /** - * This method represents the default `_handleObjectFunction` implementation which creates - * a render object from the given data and performs the draw command with the selected backend. - * - * @private - * @param {Object3D} object - The 3D object. - * @param {Material} material - The object's material. - * @param {Scene} scene - The scene the 3D object belongs to. - * @param {Camera} camera - The camera the object should be rendered with. - * @param {LightsNode} lightsNode - The current lights node. - * @param {?{start: number, count: number}} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. - * @param {ClippingContext} clippingContext - The clipping context. - * @param {string} [passId] - An optional ID for identifying the pass. - */ - private _renderObjectDirect; - /** - * A different implementation for `_handleObjectFunction` which only makes sure the object is ready for rendering. - * Used in `compileAsync()`. - * - * @private - * @param {Object3D} object - The 3D object. - * @param {Material} material - The object's material. - * @param {Scene} scene - The scene the 3D object belongs to. - * @param {Camera} camera - The camera the object should be rendered with. - * @param {LightsNode} lightsNode - The current lights node. - * @param {?{start: number, count: number}} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`. - * @param {ClippingContext} clippingContext - The clipping context. - * @param {string} [passId] - An optional ID for identifying the pass. - */ - private _createObjectPipeline; - /** - * Alias for `compileAsync()`. - * - * @method - * @param {Object3D} scene - The scene or 3D object to precompile. - * @param {Camera} camera - The camera that is used to render the scene. - * @param {Scene} targetScene - If the first argument is a 3D object, this parameter must represent the scene the 3D object is going to be added. - * @return {function(Object3D, Camera, ?Scene): Promise|undefined} A Promise that resolves when the compile has been finished. - */ - get compile(): (arg0: Object3D, arg1: Camera, arg2: Scene | null) => Promise | undefined; -} -import Info from './Info.js'; -import NodeLibrary from './nodes/NodeLibrary.js'; -import Lighting from './Lighting.js'; -import XRManager from './XRManager.js'; -import { Scene } from '../../scenes/Scene.js'; -import InspectorBase from './InspectorBase.js'; -import { Vector2 } from '../../math/Vector2.js'; -import { Vector4 } from '../../math/Vector4.js'; -import { RenderTarget } from '../../core/RenderTarget.js'; -import CanvasTarget from './CanvasTarget.js'; -import ClippingContext from './ClippingContext.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/RendererUtils.d.ts b/jsdoc-testing/jsdoc/renderers/common/RendererUtils.d.ts deleted file mode 100644 index 8809693b3..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/RendererUtils.d.ts +++ /dev/null @@ -1,105 +0,0 @@ -/** - * Saves the state of the given renderer and stores it into the given state object. - * - * If not state object is provided, the function creates one. - * - * @private - * @function - * @param {Renderer} renderer - The renderer. - * @param {Object} [state={}] - The state. - * @return {Object} The state. - */ -export function saveRendererState(renderer: Renderer, state?: Object): Object; -/** - * Saves the state of the given renderer and stores it into the given state object. - * Besides, the function also resets the state of the renderer to its default values. - * - * If not state object is provided, the function creates one. - * - * @private - * @function - * @param {Renderer} renderer - The renderer. - * @param {Object} [state={}] - The state. - * @return {Object} The state. - */ -export function resetRendererState(renderer: Renderer, state?: Object): Object; -/** - * Restores the state of the given renderer from the given state object. - * - * @private - * @function - * @param {Renderer} renderer - The renderer. - * @param {Object} state - The state to restore. - */ -export function restoreRendererState(renderer: Renderer, state: Object): void; -/** - * Saves the state of the given scene and stores it into the given state object. - * - * If not state object is provided, the function creates one. - * - * @private - * @function - * @param {Scene} scene - The scene. - * @param {Object} [state={}] - The state. - * @return {Object} The state. - */ -export function saveSceneState(scene: Scene, state?: Object): Object; -/** - * Saves the state of the given scene and stores it into the given state object. - * Besides, the function also resets the state of the scene to its default values. - * - * If not state object is provided, the function creates one. - * - * @private - * @function - * @param {Scene} scene - The scene. - * @param {Object} [state={}] - The state. - * @return {Object} The state. - */ -export function resetSceneState(scene: Scene, state?: Object): Object; -/** - * Restores the state of the given scene from the given state object. - * - * @private - * @function - * @param {Scene} scene - The scene. - * @param {Object} state - The state to restore. - */ -export function restoreSceneState(scene: Scene, state: Object): void; -/** - * Saves the state of the given renderer and scene and stores it into the given state object. - * - * If not state object is provided, the function creates one. - * - * @private - * @function - * @param {Renderer} renderer - The renderer. - * @param {Scene} scene - The scene. - * @param {Object} [state={}] - The state. - * @return {Object} The state. - */ -export function saveRendererAndSceneState(renderer: Renderer, scene: Scene, state?: Object): Object; -/** - * Saves the state of the given renderer and scene and stores it into the given state object. - * Besides, the function also resets the state of the renderer and scene to its default values. - * - * If not state object is provided, the function creates one. - * - * @private - * @function - * @param {Renderer} renderer - The renderer. - * @param {Scene} scene - The scene. - * @param {Object} [state={}] - The state. - * @return {Object} The state. - */ -export function resetRendererAndSceneState(renderer: Renderer, scene: Scene, state?: Object): Object; -/** - * Restores the state of the given renderer and scene from the given state object. - * - * @private - * @function - * @param {Renderer} renderer - The renderer. - * @param {Scene} scene - The scene. - * @param {Object} state - The state to restore. - */ -export function restoreRendererAndSceneState(renderer: Renderer, scene: Scene, state: Object): void; diff --git a/jsdoc-testing/jsdoc/renderers/common/SampledTexture.d.ts b/jsdoc-testing/jsdoc/renderers/common/SampledTexture.d.ts deleted file mode 100644 index 990534644..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/SampledTexture.d.ts +++ /dev/null @@ -1,85 +0,0 @@ -/** - * Represents a sampled texture binding type. - * - * @private - * @augments Sampler - */ -export class SampledTexture extends Sampler { - /** - * This identifier. - * - * @type {number} - */ - id: number; - /** - * Whether the texture is a storage texture or not. - * - * @type {boolean} - * @default false - */ - store: boolean; - /** - * The mip level to bind for storage textures. - * - * @type {number} - * @default 0 - */ - mipLevel: number; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isSampledTexture: boolean; -} -/** - * Represents a sampled array texture binding type. - * - * @private - * @augments SampledTexture - */ -export class SampledArrayTexture extends SampledTexture { - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isSampledArrayTexture: boolean; -} -/** - * Represents a sampled 3D texture binding type. - * - * @private - * @augments SampledTexture - */ -export class Sampled3DTexture extends SampledTexture { - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isSampled3DTexture: boolean; -} -/** - * Represents a sampled cube texture binding type. - * - * @private - * @augments SampledTexture - */ -export class SampledCubeTexture extends SampledTexture { - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isSampledCubeTexture: boolean; -} -import Sampler from './Sampler.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/Sampler.d.ts b/jsdoc-testing/jsdoc/renderers/common/Sampler.d.ts deleted file mode 100644 index afde1540d..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/Sampler.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -export default Sampler; -/** - * Represents a sampler binding type. - * - * @private - * @augments Binding - */ -declare class Sampler extends Binding { - /** - * Constructs a new sampler. - * - * @param {string} name - The samplers's name. - * @param {?Texture} texture - The texture this binding is referring to. - */ - constructor(name: string, texture: Texture | null); - /** - * The texture the sampler is referring to. - * - * @private - * @type {?Texture} - */ - private _texture; - /** - * An event listener which is added to {@link texture}'s dispose event. - * - * @private - * @type {Function} - */ - private _onTextureDispose; - generation: number | null; - version: number; - /** - * Sets the texture of this sampler. - * - * @param {Texture} value - The texture to set. - */ - set texture(value: Texture); - /** - * Gets the texture of this sampler. - * @return {?Texture} The texture. - */ - get texture(): Texture | null; - /** - * The binding's sampler key. - * - * @type {string} - * @default '' - */ - samplerKey: string; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isSampler: boolean; - /** - * Updates the binding. - * - * @return {boolean} Whether the texture has been updated and must be - * uploaded to the GPU. - */ - update(): boolean; -} -import Binding from './Binding.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/Storage3DTexture.d.ts b/jsdoc-testing/jsdoc/renderers/common/Storage3DTexture.d.ts deleted file mode 100644 index 5ea5a3e6b..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/Storage3DTexture.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -export default Storage3DTexture; -/** - * This special type of texture is intended for compute shaders. - * It can be used to compute the data of a texture with a compute shader. - * - * Note: This type of texture can only be used with `WebGPURenderer` - * and a WebGPU backend. - * - * @augments Texture - */ -declare class Storage3DTexture extends Texture { - /** - * Constructs a new storage texture. - * - * @param {number} [width=1] - The storage texture's width. - * @param {number} [height=1] - The storage texture's height. - * @param {number} [depth=1] - The storage texture's depth. - */ - constructor(width?: number, height?: number, depth?: number); - isArrayTexture: boolean; - /** - * This defines how the texture is wrapped in the depth direction and corresponds to - * *W* in UVW mapping. - * - * @type {number} - */ - wrapR: number; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isStorageTexture: boolean; - /** - * Indicates whether this texture is a 3D texture. - * - * @type {boolean} - * - */ - is3DTexture: boolean; - /** - * Sets the size of the storage 3d texture. - * - * @param {number} width - The new width of the storage texture. - * @param {number} height - The new height of the storage texture. - * @param {number} depth - The new depth of the storage texture. - */ - setSize(width: number, height: number, depth: number): void; -} -import { Texture } from '../../textures/Texture.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/StorageArrayTexture.d.ts b/jsdoc-testing/jsdoc/renderers/common/StorageArrayTexture.d.ts deleted file mode 100644 index 27581e2fc..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/StorageArrayTexture.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -export default StorageArrayTexture; -/** - * This special type of texture is intended for compute shaders. - * It can be used to compute the data of a texture with a compute shader. - * - * Note: This type of texture can only be used with `WebGPURenderer` - * and a WebGPU backend. - * - * @augments Texture - */ -declare class StorageArrayTexture extends Texture { - /** - * Constructs a new storage texture. - * - * @param {number} [width=1] - The storage texture's width. - * @param {number} [height=1] - The storage texture's height. - * @param {number} [depth=1] - The storage texture's depth. - */ - constructor(width?: number, height?: number, depth?: number); - isArrayTexture: boolean; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isStorageTexture: boolean; - /** - * Sets the size of the storage array texture. - * - * @param {number} width - The new width of the storage texture. - * @param {number} height - The new height of the storage texture. - * @param {number} depth - The new depth of the storage texture. - */ - setSize(width: number, height: number, depth: number): void; -} -import { Texture } from '../../textures/Texture.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/StorageBuffer.d.ts b/jsdoc-testing/jsdoc/renderers/common/StorageBuffer.d.ts deleted file mode 100644 index d4de63398..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/StorageBuffer.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -export default StorageBuffer; -/** - * Represents a storage buffer binding type. - * - * @private - * @augments Buffer - */ -declare class StorageBuffer extends Buffer { - /** - * Constructs a new uniform buffer. - * - * @param {string} name - The buffer's name. - * @param {BufferAttribute} attribute - The buffer attribute. - */ - constructor(name: string, attribute: BufferAttribute); - /** - * This flag can be used for type testing. - * - * @private - * @type {BufferAttribute} - */ - private _attribute; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isStorageBuffer: boolean; - /** - * The storage buffer attribute. - * - * @type {BufferAttribute} - */ - get attribute(): BufferAttribute; -} -import Buffer from './Buffer.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/StorageBufferAttribute.d.ts b/jsdoc-testing/jsdoc/renderers/common/StorageBufferAttribute.d.ts deleted file mode 100644 index d53cac3dc..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/StorageBufferAttribute.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -export default StorageBufferAttribute; -/** - * This special type of buffer attribute is intended for compute shaders. - * In earlier three.js versions it was only possible to update attribute data - * on the CPU via JavaScript and then upload the data to the GPU. With the - * new material system and renderer it is now possible to use compute shaders - * to compute the data for an attribute more efficiently on the GPU. - * - * The idea is to create an instance of this class and provide it as an input - * to {@link StorageBufferNode}. - * - * Note: This type of buffer attribute can only be used with `WebGPURenderer`. - * - * @augments BufferAttribute - */ -declare class StorageBufferAttribute extends BufferAttribute { - /** - * Constructs a new storage buffer attribute. - * - * @param {number|TypedArray} count - The item count. It is also valid to pass a typed array as an argument. - * The subsequent parameters are then obsolete. - * @param {number} itemSize - The item size. - * @param {TypedArray.constructor} [typeClass=Float32Array] - A typed array constructor. - */ - constructor(count: number | TypedArray, itemSize: number, typeClass?: TypedArray.constructor); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isStorageBufferAttribute: boolean; -} -import { BufferAttribute } from '../../core/BufferAttribute.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/StorageInstancedBufferAttribute.d.ts b/jsdoc-testing/jsdoc/renderers/common/StorageInstancedBufferAttribute.d.ts deleted file mode 100644 index 6f8614323..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/StorageInstancedBufferAttribute.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -export default StorageInstancedBufferAttribute; -/** - * This special type of instanced buffer attribute is intended for compute shaders. - * In earlier three.js versions it was only possible to update attribute data - * on the CPU via JavaScript and then upload the data to the GPU. With the - * new material system and renderer it is now possible to use compute shaders - * to compute the data for an attribute more efficiently on the GPU. - * - * The idea is to create an instance of this class and provide it as an input - * to {@link StorageBufferNode}. - * - * Note: This type of buffer attribute can only be used with `WebGPURenderer`. - * - * @augments InstancedBufferAttribute - */ -declare class StorageInstancedBufferAttribute extends InstancedBufferAttribute { - /** - * Constructs a new storage instanced buffer attribute. - * - * @param {number|TypedArray} count - The item count. It is also valid to pass a typed array as an argument. - * The subsequent parameters are then obsolete. - * @param {number} itemSize - The item size. - * @param {TypedArray.constructor} [typeClass=Float32Array] - A typed array constructor. - */ - constructor(count: number | TypedArray, itemSize: number, typeClass?: TypedArray.constructor); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isStorageInstancedBufferAttribute: boolean; -} -import { InstancedBufferAttribute } from '../../core/InstancedBufferAttribute.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/StorageTexture.d.ts b/jsdoc-testing/jsdoc/renderers/common/StorageTexture.d.ts deleted file mode 100644 index a369bd6e8..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/StorageTexture.d.ts +++ /dev/null @@ -1,43 +0,0 @@ -export default StorageTexture; -/** - * This special type of texture is intended for compute shaders. - * It can be used to compute the data of a texture with a compute shader. - * - * Note: This type of texture can only be used with `WebGPURenderer` - * and a WebGPU backend. - * - * @augments Texture - */ -declare class StorageTexture extends Texture { - /** - * Constructs a new storage texture. - * - * @param {number} [width=1] - The storage texture's width. - * @param {number} [height=1] - The storage texture's height. - */ - constructor(width?: number, height?: number); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isStorageTexture: boolean; - /** - * When `true`, mipmaps will be auto-generated after compute writes. - * When `false`, mipmaps must be written manually via compute shaders. - * - * @type {boolean} - * @default true - */ - mipmapsAutoUpdate: boolean; - /** - * Sets the size of the storage texture. - * - * @param {number} width - The new width of the storage texture. - * @param {number} height - The new height of the storage texture. - */ - setSize(width: number, height: number): void; -} -import { Texture } from '../../textures/Texture.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/Textures.d.ts b/jsdoc-testing/jsdoc/renderers/common/Textures.d.ts deleted file mode 100644 index 760132d9d..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/Textures.d.ts +++ /dev/null @@ -1,110 +0,0 @@ -export default Textures; -/** - * This module manages the textures of the renderer. - * - * @private - * @augments DataMap - */ -declare class Textures extends DataMap { - /** - * Constructs a new texture management component. - * - * @param {Renderer} renderer - The renderer. - * @param {Backend} backend - The renderer's backend. - * @param {Info} info - Renderer component for managing metrics and monitoring data. - */ - constructor(renderer: Renderer, backend: Backend, info: Info); - /** - * The renderer. - * - * @type {Renderer} - */ - renderer: Renderer; - /** - * The backend. - * - * @type {Backend} - */ - backend: Backend; - /** - * Renderer component for managing metrics and monitoring data. - * - * @type {Info} - */ - info: Info; - /** - * Updates the given render target. Based on the given render target configuration, - * it updates the texture states representing the attachments of the framebuffer. - * - * @param {RenderTarget} renderTarget - The render target to update. - * @param {number} [activeMipmapLevel=0] - The active mipmap level. - */ - updateRenderTarget(renderTarget: RenderTarget, activeMipmapLevel?: number): void; - /** - * Updates the given texture. Depending on the texture state, this method - * triggers the upload of texture data to the GPU memory. If the texture data are - * not yet ready for the upload, it uses default texture data for as a placeholder. - * - * @param {Texture} texture - The texture to update. - * @param {Object} [options={}] - The options. - */ - updateTexture(texture: Texture, options?: Object): void; - /** - * Updates the sampler for the given texture. This method has no effect - * for the WebGL backend since it has no concept of samplers. Texture - * parameters are configured with the `texParameter()` command for each - * texture. - * - * In WebGPU, samplers are objects like textures and it's possible to share - * them when the texture parameters match. - * - * @param {Texture} texture - The texture to update the sampler for. - * @return {string} The current sampler key. - */ - updateSampler(texture: Texture): string; - /** - * Computes the size of the given texture and writes the result - * into the target vector. This vector is also returned by the - * method. - * - * If no texture data are available for the compute yet, the method - * returns default size values. - * - * @param {Texture} texture - The texture to compute the size for. - * @param {Vector3} target - The target vector. - * @return {Vector3} The target vector. - */ - getSize(texture: Texture, target?: Vector3): Vector3; - /** - * Computes the number of mipmap levels for the given texture. - * - * @param {Texture} texture - The texture. - * @param {number} width - The texture's width. - * @param {number} height - The texture's height. - * @return {number} The number of mipmap levels. - */ - getMipLevels(texture: Texture, width: number, height: number): number; - /** - * Returns `true` if the given texture makes use of mipmapping. - * - * @param {Texture} texture - The texture. - * @return {boolean} Whether mipmaps are required or not. - */ - needsMipmaps(texture: Texture): boolean; - /** - * Frees internal resources when the given render target isn't - * required anymore. - * - * @param {RenderTarget} renderTarget - The render target to destroy. - */ - _destroyRenderTarget(renderTarget: RenderTarget): void; - /** - * Frees internal resource when the given texture isn't - * required anymore. - * - * @param {Texture} texture - The texture to destroy. - */ - _destroyTexture(texture: Texture): void; -} -import DataMap from './DataMap.js'; -import { Vector3 } from '../../math/Vector3.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/TimestampQueryPool.d.ts b/jsdoc-testing/jsdoc/renderers/common/TimestampQueryPool.d.ts deleted file mode 100644 index 82eedbdd9..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/TimestampQueryPool.d.ts +++ /dev/null @@ -1,119 +0,0 @@ -export default TimestampQueryPool; -/** - * Abstract base class of a timestamp query pool. - * - * @abstract - */ -declare class TimestampQueryPool { - /** - * Creates a new timestamp query pool. - * - * @param {number} [maxQueries=256] - Maximum number of queries this pool can hold. - */ - constructor(maxQueries?: number); - /** - * Whether to track timestamps or not. - * - * @type {boolean} - * @default true - */ - trackTimestamp: boolean; - /** - * Maximum number of queries this pool can hold. - * - * @type {number} - * @default 256 - */ - maxQueries: number; - /** - * How many queries allocated so far. - * - * @type {number} - * @default 0 - */ - currentQueryIndex: number; - /** - * Tracks offsets for different contexts. - * - * @type {Map} - */ - queryOffsets: Map; - /** - * Whether the pool has been disposed or not. - * - * @type {boolean} - * @default false - */ - isDisposed: boolean; - /** - * The total frame duration until the next update. - * - * @type {number} - * @default 0 - */ - lastValue: number; - /** - * Stores all timestamp frames. - * - * @type {Array} - */ - frames: Array; - /** - * This property is used to avoid multiple concurrent resolve operations. - * The WebGL backend uses it as a boolean flag. In context of WebGPU, it holds - * the promise of the current resolve operation. - * - * @type {boolean|Promise} - * @default false - */ - pendingResolve: boolean | Promise; - /** - * Stores the latest timestamp for each render context. - * - * @type {Map} - */ - timestamps: Map; - /** - * Returns all timestamp frames. - * - * @return {Array} The timestamp frames. - */ - getTimestampFrames(): Array; - /** - * Returns the timestamp for a given render context. - * - * @param {string} uid - A unique identifier for the render context. - * @return {?number} The timestamp, or undefined if not available. - */ - getTimestamp(uid: string): number | null; - /** - * Returns whether a timestamp is available for a given render context. - * - * @param {string} uid - A unique identifier for the render context. - * @return {boolean} True if a timestamp is available, false otherwise. - */ - hasTimestamp(uid: string): boolean; - /** - * Allocate queries for a specific uid. - * - * @abstract - * @param {string} uid - A unique identifier for the render context. - * @param {number} frameId - The current frame identifier. - * @returns {?number} - */ - allocateQueriesForContext(): number | null; - /** - * Resolve all timestamps and return data (or process them). - * - * @abstract - * @async - * @returns {Promise|number} The resolved timestamp value. - */ - resolveQueriesAsync(): Promise | number; - /** - * Dispose of the query pool. - * - * @abstract - */ - dispose(): void; -} diff --git a/jsdoc-testing/jsdoc/renderers/common/Uniform.d.ts b/jsdoc-testing/jsdoc/renderers/common/Uniform.d.ts deleted file mode 100644 index d8d107299..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/Uniform.d.ts +++ /dev/null @@ -1,260 +0,0 @@ -/** - * Represents a Number uniform. - * - * @private - * @augments Uniform - */ -export class NumberUniform extends Uniform { - /** - * Constructs a new Number uniform. - * - * @param {string} name - The uniform's name. - * @param {number} value - The uniform's value. - */ - constructor(name: string, value?: number); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isNumberUniform: boolean; -} -/** - * Represents a Vector2 uniform. - * - * @private - * @augments Uniform - */ -export class Vector2Uniform extends Uniform { - /** - * Constructs a new Number uniform. - * - * @param {string} name - The uniform's name. - * @param {Vector2} value - The uniform's value. - */ - constructor(name: string, value?: Vector2); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isVector2Uniform: boolean; -} -/** - * Represents a Vector3 uniform. - * - * @private - * @augments Uniform - */ -export class Vector3Uniform extends Uniform { - /** - * Constructs a new Number uniform. - * - * @param {string} name - The uniform's name. - * @param {Vector3} value - The uniform's value. - */ - constructor(name: string, value?: Vector3); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isVector3Uniform: boolean; -} -/** - * Represents a Vector4 uniform. - * - * @private - * @augments Uniform - */ -export class Vector4Uniform extends Uniform { - /** - * Constructs a new Number uniform. - * - * @param {string} name - The uniform's name. - * @param {Vector4} value - The uniform's value. - */ - constructor(name: string, value?: Vector4); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isVector4Uniform: boolean; -} -/** - * Represents a Color uniform. - * - * @private - * @augments Uniform - */ -export class ColorUniform extends Uniform { - /** - * Constructs a new Number uniform. - * - * @param {string} name - The uniform's name. - * @param {Color} value - The uniform's value. - */ - constructor(name: string, value?: Color); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isColorUniform: boolean; -} -/** - * Represents a Matrix2 uniform. - * - * @private - * @augments Uniform - */ -export class Matrix2Uniform extends Uniform { - /** - * Constructs a new Number uniform. - * - * @param {string} name - The uniform's name. - * @param {Matrix2} value - The uniform's value. - */ - constructor(name: string, value?: Matrix2); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isMatrix2Uniform: boolean; -} -/** - * Represents a Matrix3 uniform. - * - * @private - * @augments Uniform - */ -export class Matrix3Uniform extends Uniform { - /** - * Constructs a new Number uniform. - * - * @param {string} name - The uniform's name. - * @param {Matrix3} value - The uniform's value. - */ - constructor(name: string, value?: Matrix3); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isMatrix3Uniform: boolean; -} -/** - * Represents a Matrix4 uniform. - * - * @private - * @augments Uniform - */ -export class Matrix4Uniform extends Uniform { - /** - * Constructs a new Number uniform. - * - * @param {string} name - The uniform's name. - * @param {Matrix4} value - The uniform's value. - */ - constructor(name: string, value?: Matrix4); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isMatrix4Uniform: boolean; -} -/** - * Abstract base class for uniforms. - * - * @abstract - * @private - */ -declare class Uniform { - /** - * Constructs a new uniform. - * - * @param {string} name - The uniform's name. - * @param {any} value - The uniform's value. - */ - constructor(name: string, value: any); - /** - * The uniform's name. - * - * @type {string} - */ - name: string; - /** - * The uniform's value. - * - * @type {any} - */ - value: any; - /** - * Used to build the uniform buffer according to the STD140 layout. - * Derived uniforms will set this property to a data type specific - * value. - * - * @type {number} - */ - boundary: number; - /** - * The item size. Derived uniforms will set this property to a data - * type specific value. - * - * @type {number} - */ - itemSize: number; - /** - * This property is set by {@link UniformsGroup} and marks - * the start position in the uniform buffer. - * - * @type {number} - */ - offset: number; - /** - * This property is set by {@link UniformsGroup} and marks - * the index position in the uniform array. - * - * @type {number} - */ - index: number; - /** - * Sets the uniform's value. - * - * @param {any} value - The value to set. - */ - setValue(value: any): void; - /** - * Returns the uniform's value. - * - * @return {any} The value. - */ - getValue(): any; -} -import { Vector2 } from '../../math/Vector2.js'; -import { Vector3 } from '../../math/Vector3.js'; -import { Vector4 } from '../../math/Vector4.js'; -import { Color } from '../../math/Color.js'; -import { Matrix2 } from '../../math/Matrix2.js'; -import { Matrix3 } from '../../math/Matrix3.js'; -import { Matrix4 } from '../../math/Matrix4.js'; -export {}; diff --git a/jsdoc-testing/jsdoc/renderers/common/UniformBuffer.d.ts b/jsdoc-testing/jsdoc/renderers/common/UniformBuffer.d.ts deleted file mode 100644 index 15af25d88..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/UniformBuffer.d.ts +++ /dev/null @@ -1,18 +0,0 @@ -export default UniformBuffer; -/** - * Represents a uniform buffer binding type. - * - * @private - * @augments Buffer - */ -declare class UniformBuffer extends Buffer { - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isUniformBuffer: boolean; -} -import Buffer from './Buffer.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/UniformsGroup.d.ts b/jsdoc-testing/jsdoc/renderers/common/UniformsGroup.d.ts deleted file mode 100644 index 4cf3fe53c..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/UniformsGroup.d.ts +++ /dev/null @@ -1,139 +0,0 @@ -export default UniformsGroup; -/** - * This class represents a uniform buffer binding but with - * an API that allows to maintain individual uniform objects. - * - * @private - * @augments UniformBuffer - */ -declare class UniformsGroup extends UniformBuffer { - /** - * Constructs a new uniforms group. - * - * @param {string} name - The group's name. - */ - constructor(name: string); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isUniformsGroup: boolean; - /** - * An array with the raw uniform values. - * - * @private - * @type {?Array} - * @default null - */ - private _values; - /** - * An array of uniform objects. - * - * The order of uniforms in this array must match the order of uniforms in the shader. - * - * @type {Array} - */ - uniforms: Array; - /** - * A cache for the uniform update ranges. - * - * @private - * @type {Map} - */ - private _updateRangeCache; - /** - * Adds a uniform's update range to this buffer. - * - * @param {Uniform} uniform - The uniform. - */ - addUniformUpdateRange(uniform: Uniform): void; - /** - * Adds a uniform to this group. - * - * @param {Uniform} uniform - The uniform to add. - * @return {UniformsGroup} A reference to this group. - */ - addUniform(uniform: Uniform): UniformsGroup; - /** - * Removes a uniform from this group. - * - * @param {Uniform} uniform - The uniform to remove. - * @return {UniformsGroup} A reference to this group. - */ - removeUniform(uniform: Uniform): UniformsGroup; - /** - * An array with the raw uniform values. - * - * @type {Array} - */ - get values(): Array; - /** - * Updates a given uniform by calling an update method matching - * the uniforms type. - * - * @param {Uniform} uniform - The uniform to update. - * @return {boolean} Whether the uniform has been updated or not. - */ - updateByType(uniform: Uniform): boolean; - /** - * Updates a given Number uniform. - * - * @param {NumberUniform} uniform - The Number uniform. - * @return {boolean} Whether the uniform has been updated or not. - */ - updateNumber(uniform: NumberUniform): boolean; - /** - * Updates a given Vector2 uniform. - * - * @param {Vector2Uniform} uniform - The Vector2 uniform. - * @return {boolean} Whether the uniform has been updated or not. - */ - updateVector2(uniform: Vector2Uniform): boolean; - /** - * Updates a given Vector3 uniform. - * - * @param {Vector3Uniform} uniform - The Vector3 uniform. - * @return {boolean} Whether the uniform has been updated or not. - */ - updateVector3(uniform: Vector3Uniform): boolean; - /** - * Updates a given Vector4 uniform. - * - * @param {Vector4Uniform} uniform - The Vector4 uniform. - * @return {boolean} Whether the uniform has been updated or not. - */ - updateVector4(uniform: Vector4Uniform): boolean; - /** - * Updates a given Color uniform. - * - * @param {ColorUniform} uniform - The Color uniform. - * @return {boolean} Whether the uniform has been updated or not. - */ - updateColor(uniform: ColorUniform): boolean; - /** - * Updates a given Matrix3 uniform. - * - * @param {Matrix3Uniform} uniform - The Matrix3 uniform. - * @return {boolean} Whether the uniform has been updated or not. - */ - updateMatrix3(uniform: Matrix3Uniform): boolean; - /** - * Updates a given Matrix4 uniform. - * - * @param {Matrix4Uniform} uniform - The Matrix4 uniform. - * @return {boolean} Whether the uniform has been updated or not. - */ - updateMatrix4(uniform: Matrix4Uniform): boolean; - /** - * Returns a typed array that matches the given data type. - * - * @private - * @param {string} type - The data type. - * @return {TypedArray} The typed array. - */ - private _getBufferForType; -} -import UniformBuffer from './UniformBuffer.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/XRManager.d.ts b/jsdoc-testing/jsdoc/renderers/common/XRManager.d.ts deleted file mode 100644 index dafd87882..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/XRManager.d.ts +++ /dev/null @@ -1,516 +0,0 @@ -export default XRManager; -/** - * The XR manager is built on top of the WebXR Device API to - * manage XR sessions with `WebGPURenderer`. - * - * XR is currently only supported with a WebGL 2 backend. - * - * @augments EventDispatcher - */ -declare class XRManager extends EventDispatcher { - /** - * Constructs a new XR manager. - * - * @param {Renderer} renderer - The renderer. - * @param {boolean} [multiview=false] - Enables multiview if the device supports it. - */ - constructor(renderer: Renderer, multiview?: boolean); - /** - * This flag globally enables XR rendering. - * - * @type {boolean} - * @default false - */ - enabled: boolean; - /** - * Whether the XR device is currently presenting or not. - * - * @type {boolean} - * @default false - * @readonly - */ - readonly isPresenting: boolean; - /** - * Whether the XR camera should automatically be updated or not. - * - * @type {boolean} - * @default true - */ - cameraAutoUpdate: boolean; - /** - * The renderer. - * - * @private - * @type {Renderer} - */ - private _renderer; - /** - * Represents the camera for the left eye. - * - * @private - * @type {PerspectiveCamera} - */ - private _cameraL; - /** - * Represents the camera for the right eye. - * - * @private - * @type {PerspectiveCamera} - */ - private _cameraR; - /** - * A list of cameras used for rendering the XR views. - * - * @private - * @type {Array} - */ - private _cameras; - /** - * The main XR camera. - * - * @private - * @type {ArrayCamera} - */ - private _cameraXR; - /** - * The current near value of the XR camera. - * - * @private - * @type {?number} - * @default null - */ - private _currentDepthNear; - /** - * The current far value of the XR camera. - * - * @private - * @type {?number} - * @default null - */ - private _currentDepthFar; - /** - * A list of WebXR controllers requested by the application. - * - * @private - * @type {Array} - */ - private _controllers; - /** - * A list of XR input source. Each input source belongs to - * an instance of WebXRController. - * - * @private - * @type {Array} - */ - private _controllerInputSources; - /** - * The XR render target that represents the rendering destination - * during an active XR session. - * - * @private - * @type {?RenderTarget} - * @default null - */ - private _xrRenderTarget; - /** - * An array holding all the non-projection layers - * - * @private - * @type {Array} - * @default [] - */ - private _layers; - /** - * Whether the XR session uses layers. - * - * @private - * @type {boolean} - * @default false - */ - private _sessionUsesLayers; - /** - * Whether the device supports binding gl objects. - * - * @private - * @type {boolean} - * @readonly - */ - private readonly _supportsGlBinding; - /** - * Helper function to create native WebXR Layer. - * - * @private - * @type {Function} - */ - private _createXRLayer; - /** - * The current WebGL context. - * - * @private - * @type {?WebGL2RenderingContext} - * @default null - */ - private _gl; - /** - * The current animation context. - * - * @private - * @type {?Window} - * @default null - */ - private _currentAnimationContext; - /** - * The current animation loop. - * - * @private - * @type {?Function} - * @default null - */ - private _currentAnimationLoop; - /** - * The current pixel ratio. - * - * @private - * @type {?number} - * @default null - */ - private _currentPixelRatio; - /** - * The current size of the renderer's canvas - * in logical pixel unit. - * - * @private - * @type {Vector2} - */ - private _currentSize; - /** - * The default event listener for handling events inside a XR session. - * - * @private - * @type {Function} - */ - private _onSessionEvent; - /** - * The event listener for handling the end of a XR session. - * - * @private - * @type {Function} - */ - private _onSessionEnd; - /** - * The event listener for handling the `inputsourceschange` event. - * - * @private - * @type {Function} - */ - private _onInputSourcesChange; - /** - * The animation loop which is used as a replacement for the default - * animation loop of the application. It is only used when a XR session - * is active. - * - * @private - * @type {Function} - */ - private _onAnimationFrame; - /** - * The current XR reference space. - * - * @private - * @type {?XRReferenceSpace} - * @default null - */ - private _referenceSpace; - /** - * The current XR reference space type. - * - * @private - * @type {XRReferenceSpaceType} - * @default 'local-floor' - */ - private _referenceSpaceType; - /** - * A custom reference space defined by the application. - * - * @private - * @type {?XRReferenceSpace} - * @default null - */ - private _customReferenceSpace; - /** - * The framebuffer scale factor. - * - * @private - * @type {number} - * @default 1 - */ - private _framebufferScaleFactor; - /** - * The foveation factor. - * - * @private - * @type {number} - * @default 1 - */ - private _foveation; - /** - * A reference to the current XR session. - * - * @private - * @type {?XRSession} - * @default null - */ - private _session; - /** - * A reference to the current XR base layer. - * - * @private - * @type {?XRWebGLLayer} - * @default null - */ - private _glBaseLayer; - /** - * A reference to the current XR binding. - * - * @private - * @type {?XRWebGLBinding} - * @default null - */ - private _glBinding; - /** - * A reference to the current XR projection layer. - * - * @private - * @type {?XRProjectionLayer} - * @default null - */ - private _glProjLayer; - /** - * A reference to the current XR frame. - * - * @private - * @type {?XRFrame} - * @default null - */ - private _xrFrame; - /** - * Whether the browser supports the APIs necessary to use XRProjectionLayers. - * - * Note: this does not represent XRSession explicitly requesting - * `'layers'` as a feature - see `_sessionUsesLayers` and #30112 - * - * @private - * @type {boolean} - * @readonly - */ - private readonly _supportsLayers; - /** - * Whether the usage of multiview has been requested by the application or not. - * - * @private - * @type {boolean} - * @default false - * @readonly - */ - private readonly _useMultiviewIfPossible; - /** - * Whether the usage of multiview is actually enabled. This flag only evaluates to `true` - * if multiview has been requested by the application and the `OVR_multiview2` is available. - * - * @private - * @type {boolean} - * @readonly - */ - private readonly _useMultiview; - /** - * Returns an instance of `THREE.Group` that represents the transformation - * of a XR controller in target ray space. The requested controller is defined - * by the given index. - * - * @param {number} index - The index of the XR controller. - * @return {Group} A group that represents the controller's transformation. - */ - getController(index: number): Group; - /** - * Returns an instance of `THREE.Group` that represents the transformation - * of a XR controller in grip space. The requested controller is defined - * by the given index. - * - * @param {number} index - The index of the XR controller. - * @return {Group} A group that represents the controller's transformation. - */ - getControllerGrip(index: number): Group; - /** - * Returns an instance of `THREE.Group` that represents the transformation - * of a XR controller in hand space. The requested controller is defined - * by the given index. - * - * @param {number} index - The index of the XR controller. - * @return {Group} A group that represents the controller's transformation. - */ - getHand(index: number): Group; - /** - * Returns the foveation value. - * - * @return {number|undefined} The foveation value. Returns `undefined` if no base or projection layer is defined. - */ - getFoveation(): number | undefined; - /** - * Sets the foveation value. - * - * @param {number} foveation - A number in the range `[0,1]` where `0` means no foveation (full resolution) - * and `1` means maximum foveation (the edges render at lower resolution). - */ - setFoveation(foveation: number): void; - /** - * Returns the framebuffer scale factor. - * - * @return {number} The framebuffer scale factor. - */ - getFramebufferScaleFactor(): number; - /** - * Sets the framebuffer scale factor. - * - * This method can not be used during a XR session. - * - * @param {number} factor - The framebuffer scale factor. - */ - setFramebufferScaleFactor(factor: number): void; - /** - * Returns the reference space type. - * - * @return {XRReferenceSpaceType} The reference space type. - */ - getReferenceSpaceType(): XRReferenceSpaceType; - /** - * Sets the reference space type. - * - * This method can not be used during a XR session. - * - * @param {XRReferenceSpaceType} type - The reference space type. - */ - setReferenceSpaceType(type: XRReferenceSpaceType): void; - /** - * Returns the XR reference space. - * - * @return {XRReferenceSpace} The XR reference space. - */ - getReferenceSpace(): XRReferenceSpace; - /** - * Sets a custom XR reference space. - * - * @param {XRReferenceSpace} space - The XR reference space. - */ - setReferenceSpace(space: XRReferenceSpace): void; - /** - * Returns the XR camera. - * - * @return {ArrayCamera} The XR camera. - */ - getCamera(): ArrayCamera; - /** - * Returns the environment blend mode from the current XR session. - * - * @return {'opaque'|'additive'|'alpha-blend'|undefined} The environment blend mode. Returns `undefined` when used outside of a XR session. - */ - getEnvironmentBlendMode(): "opaque" | "additive" | "alpha-blend" | undefined; - /** - * Returns the current XR binding. - * - * Creates a new binding if needed and the browser is - * capable of doing so. - * - * @return {?XRWebGLBinding} The XR binding. Returns `null` if one cannot be created. - */ - getBinding(): XRWebGLBinding | null; - /** - * Returns the current XR frame. - * - * @return {?XRFrame} The XR frame. Returns `null` when used outside a XR session. - */ - getFrame(): XRFrame | null; - /** - * Returns `true` if the engine renders to a multiview target. - * - * @return {boolean} Whether the engine renders to a multiview render target or not. - */ - useMultiview(): boolean; - /** - * This method can be used in XR applications to create a quadratic layer that presents a separate - * rendered scene. - * - * @param {number} width - The width of the layer plane in world units. - * @param {number} height - The height of the layer plane in world units. - * @param {Vector3} translation - The position/translation of the layer plane in world units. - * @param {Quaternion} quaternion - The orientation of the layer plane expressed as a quaternion. - * @param {number} pixelwidth - The width of the layer's render target in pixels. - * @param {number} pixelheight - The height of the layer's render target in pixels. - * @param {Function} rendercall - A callback function that renders the layer. Similar to code in - * the default animation loop, this method can be used to update/transform 3D object in the layer's scene. - * @param {Object} [attributes={}] - Allows to configure the layer's render target. - * @return {Mesh} A mesh representing the quadratic XR layer. This mesh should be added to the XR scene. - */ - createQuadLayer(width: number, height: number, translation: Vector3, quaternion: Quaternion, pixelwidth: number, pixelheight: number, rendercall: Function, attributes?: Object): Mesh; - /** - * This method can be used in XR applications to create a cylindrical layer that presents a separate - * rendered scene. - * - * @param {number} radius - The radius of the cylinder in world units. - * @param {number} centralAngle - The central angle of the cylinder in radians. - * @param {number} aspectratio - The aspect ratio. - * @param {Vector3} translation - The position/translation of the layer plane in world units. - * @param {Quaternion} quaternion - The orientation of the layer plane expressed as a quaternion. - * @param {number} pixelwidth - The width of the layer's render target in pixels. - * @param {number} pixelheight - The height of the layer's render target in pixels. - * @param {Function} rendercall - A callback function that renders the layer. Similar to code in - * the default animation loop, this method can be used to update/transform 3D object in the layer's scene. - * @param {Object} [attributes={}] - Allows to configure the layer's render target. - * @return {Mesh} A mesh representing the cylindrical XR layer. This mesh should be added to the XR scene. - */ - createCylinderLayer(radius: number, centralAngle: number, aspectratio: number, translation: Vector3, quaternion: Quaternion, pixelwidth: number, pixelheight: number, rendercall: Function, attributes?: Object): Mesh; - /** - * Renders the XR layers that have been previously added to the scene. - * - * This method is usually called in your animation loop before rendering - * the actual scene via `renderer.render( scene, camera );`. - */ - renderLayers(): void; - /** - * Returns the current XR session. - * - * @return {?XRSession} The XR session. Returns `null` when used outside a XR session. - */ - getSession(): XRSession | null; - /** - * After a XR session has been requested usually with one of the `*Button` modules, it - * is injected into the renderer with this method. This method triggers the start of - * the actual XR rendering. - * - * @async - * @param {XRSession} session - The XR session to set. - * @return {Promise} A Promise that resolves when the session has been set. - */ - setSession(session: XRSession): Promise; - /** - * This method is called by the renderer per frame and updates the XR camera - * and it sub cameras based on the given camera. The given camera is the "user" - * camera created on application level and used for non-XR rendering. - * - * @param {PerspectiveCamera} camera - The camera. - */ - updateCamera(camera: PerspectiveCamera): void; - /** - * Returns a WebXR controller for the given controller index. - * - * @private - * @param {number} index - The controller index. - * @return {WebXRController} The XR controller. - */ - private _getController; -} -import { EventDispatcher } from '../../core/EventDispatcher.js'; -import { ArrayCamera } from '../../cameras/ArrayCamera.js'; -import { Vector3 } from '../../math/Vector3.js'; -import { Quaternion } from '../../math/Quaternion.js'; -import { Mesh } from '../../objects/Mesh.js'; -import { PerspectiveCamera } from '../../cameras/PerspectiveCamera.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/XRRenderTarget.d.ts b/jsdoc-testing/jsdoc/renderers/common/XRRenderTarget.d.ts deleted file mode 100644 index e397d7c26..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/XRRenderTarget.d.ts +++ /dev/null @@ -1,66 +0,0 @@ -/** - * A special type of render target that is used when rendering - * with the WebXR Device API. - * - * @private - * @augments RenderTarget - */ -export class XRRenderTarget extends RenderTarget { - /** - * Constructs a new XR render target. - * - * @param {number} [width=1] - The width of the render target. - * @param {number} [height=1] - The height of the render target. - * @param {Object} [options={}] - The configuration options. - */ - constructor(width?: number, height?: number, options?: Object); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isXRRenderTarget: boolean; - /** - * Whether the attachments of the render target - * are defined by external textures. This flag is - * set to `true` when using the WebXR Layers API. - * - * @private - * @type {boolean} - * @default false - */ - private _hasExternalTextures; - /** - * Whether a depth buffer should automatically be allocated - * for this XR render target or not. - * - * Allocating a depth buffer is the default behavior of XR render - * targets. However, when using the WebXR Layers API, this flag - * must be set to `false` when the `ignoreDepthValues` property of - * the projection layers evaluates to `false`. - * - * Reference: {@link https://www.w3.org/TR/webxrlayers-1/#dom-xrprojectionlayer-ignoredepthvalues}. - * - * @private - * @type {boolean} - * @default true - */ - private _autoAllocateDepthBuffer; - /** - * Whether this render target is associated with a XRWebGLLayer. - * - * A XRWebGLLayer points to an opaque framebuffer. Basically, - * this means that you don't have access to its bound color, - * stencil and depth buffers. We need to handle this framebuffer - * differently since its textures are always bound. - * - * @private - * @type {boolean} - * @default false - * */ - private _isOpaqueFramebuffer; - copy(source: any): this; -} -import { RenderTarget } from '../../core/RenderTarget.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/extras/PMREMGenerator.d.ts b/jsdoc-testing/jsdoc/renderers/common/extras/PMREMGenerator.d.ts deleted file mode 100644 index fec78edd5..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/extras/PMREMGenerator.d.ts +++ /dev/null @@ -1,196 +0,0 @@ -export default PMREMGenerator; -/** - * This class generates a Prefiltered, Mipmapped Radiance Environment Map - * (PMREM) from a cubeMap environment texture. This allows different levels of - * blur to be quickly accessed based on material roughness. It is packed into a - * special CubeUV format that allows us to perform custom interpolation so that - * we can support nonlinear formats such as RGBE. Unlike a traditional mipmap - * chain, it only goes down to the LOD_MIN level (above), and then creates extra - * even more filtered 'mips' at the same LOD_MIN resolution, associated with - * higher roughness levels. In this way we maintain resolution to smoothly - * interpolate diffuse lighting while limiting sampling computation. - * - * The prefiltering uses GGX VNDF (Visible Normal Distribution Function) - * importance sampling based on "Sampling the GGX Distribution of Visible Normals" - * (Heitz, 2018) to generate environment maps that accurately match the GGX BRDF - * used in material rendering for physically-based image-based lighting. - */ -declare class PMREMGenerator { - /** - * Constructs a new PMREM generator. - * - * @param {Renderer} renderer - The renderer. - */ - constructor(renderer: Renderer); - _renderer: Renderer; - _pingPongRenderTarget: RenderTarget | null; - _lodMax: number; - _cubeSize: number; - _sizeLods: any[]; - _sigmas: any[]; - _lodMeshes: any[]; - _blurMaterial: NodeMaterial | null; - _ggxMaterial: NodeMaterial | null; - _cubemapMaterial: NodeMaterial | null; - _equirectMaterial: NodeMaterial | null; - _backgroundBox: Mesh | null; - get _hasInitialized(): any; - /** - * Generates a PMREM from a supplied Scene, which can be faster than using an - * image if networking bandwidth is low. Optional sigma specifies a blur radius - * in radians to be applied to the scene before PMREM generation. Optional near - * and far planes ensure the scene is rendered in its entirety. - * - * @param {Scene} scene - The scene to be captured. - * @param {number} [sigma=0] - The blur radius in radians. - * @param {number} [near=0.1] - The near plane distance. - * @param {number} [far=100] - The far plane distance. - * @param {Object} [options={}] - The configuration options. - * @param {number} [options.size=256] - The texture size of the PMREM. - * @param {Vector3} [options.renderTarget=origin] - The position of the internal cube camera that renders the scene. - * @param {?RenderTarget} [options.renderTarget=null] - The render target to use. - * @return {RenderTarget} The resulting PMREM. - * @see {@link PMREMGenerator#fromScene} - */ - fromScene(scene: Scene, sigma?: number, near?: number, far?: number, options?: { - size?: number | undefined; - renderTarget?: Vector3 | undefined; - renderTarget?: Vector3 | undefined; - }): RenderTarget; - /** - * Generates a PMREM from a supplied Scene, which can be faster than using an - * image if networking bandwidth is low. Optional sigma specifies a blur radius - * in radians to be applied to the scene before PMREM generation. Optional near - * and far planes ensure the scene is rendered in its entirety (the cubeCamera - * is placed at the origin). - * - * @deprecated - * @param {Scene} scene - The scene to be captured. - * @param {number} [sigma=0] - The blur radius in radians. - * @param {number} [near=0.1] - The near plane distance. - * @param {number} [far=100] - The far plane distance. - * @param {Object} [options={}] - The configuration options. - * @param {number} [options.size=256] - The texture size of the PMREM. - * @param {Vector3} [options.position=origin] - The position of the internal cube camera that renders the scene. - * @param {?RenderTarget} [options.renderTarget=null] - The render target to use. - * @return {Promise} A Promise that resolve with the PMREM when the generation has been finished. - * @see {@link PMREMGenerator#fromScene} - */ - fromSceneAsync(scene: Scene, sigma?: number, near?: number, far?: number, options?: { - size?: number | undefined; - position?: Vector3 | undefined; - renderTarget?: RenderTarget | null | undefined; - }): Promise; - /** - * Generates a PMREM from an equirectangular texture, which can be either LDR - * or HDR. The ideal input image size is 1k (1024 x 512), - * as this matches best with the 256 x 256 cubemap output. - * - * @param {Texture} equirectangular - The equirectangular texture to be converted. - * @param {?RenderTarget} [renderTarget=null] - The render target to use. - * @return {RenderTarget} The resulting PMREM. - * @see {@link PMREMGenerator#fromEquirectangularAsync} - */ - fromEquirectangular(equirectangular: Texture, renderTarget?: RenderTarget | null): RenderTarget; - /** - * Generates a PMREM from an equirectangular texture, which can be either LDR - * or HDR. The ideal input image size is 1k (1024 x 512), - * as this matches best with the 256 x 256 cubemap output. - * - * @deprecated - * @param {Texture} equirectangular - The equirectangular texture to be converted. - * @param {?RenderTarget} [renderTarget=null] - The render target to use. - * @return {Promise} The resulting PMREM. - * @see {@link PMREMGenerator#fromEquirectangular} - */ - fromEquirectangularAsync(equirectangular: Texture, renderTarget?: RenderTarget | null): Promise; - /** - * Generates a PMREM from an cubemap texture, which can be either LDR - * or HDR. The ideal input cube size is 256 x 256, - * as this matches best with the 256 x 256 cubemap output. - * - * @param {Texture} cubemap - The cubemap texture to be converted. - * @param {?RenderTarget} [renderTarget=null] - The render target to use. - * @return {RenderTarget} The resulting PMREM. - * @see {@link PMREMGenerator#fromCubemapAsync} - */ - fromCubemap(cubemap: Texture, renderTarget?: RenderTarget | null): RenderTarget; - /** - * Generates a PMREM from an cubemap texture, which can be either LDR - * or HDR. The ideal input cube size is 256 x 256, - * with the 256 x 256 cubemap output. - * - * @deprecated - * @param {Texture} cubemap - The cubemap texture to be converted. - * @param {?RenderTarget} [renderTarget=null] - The render target to use. - * @return {Promise} The resulting PMREM. - * @see {@link PMREMGenerator#fromCubemap} - */ - fromCubemapAsync(cubemap: Texture, renderTarget?: RenderTarget | null): Promise; - /** - * Pre-compiles the cubemap shader. You can get faster start-up by invoking this method during - * your texture's network fetch for increased concurrency. - * - * @returns {Promise} - */ - compileCubemapShader(): Promise; - /** - * Pre-compiles the equirectangular shader. You can get faster start-up by invoking this method during - * your texture's network fetch for increased concurrency. - * - * @returns {Promise} - */ - compileEquirectangularShader(): Promise; - /** - * Disposes of the PMREMGenerator's internal memory. Note that PMREMGenerator is a static class, - * so you should not need more than one PMREMGenerator object. If you do, calling dispose() on - * one of them will cause any others to also become unusable. - */ - dispose(): void; - _setSizeFromTexture(texture: any): void; - _setSize(cubeSize: any): void; - _dispose(): void; - _cleanup(outputTarget: any): void; - _fromTexture(texture: any, renderTarget: any): any; - _allocateTarget(): RenderTarget; - _init(renderTarget: any): void; - _compileMaterial(material: any): Promise; - _sceneToCubeUV(scene: any, near: any, far: any, cubeUVRenderTarget: any, position: any): void; - _textureToCubeUV(texture: any, cubeUVRenderTarget: any): void; - _applyPMREM(cubeUVRenderTarget: any): void; - /** - * Applies GGX VNDF importance sampling filter to generate a prefiltered environment map. - * Uses Monte Carlo integration with VNDF importance sampling to accurately represent the - * GGX BRDF for physically-based rendering. Reads from the previous LOD level and - * applies incremental roughness filtering to avoid over-blurring. - * - * @private - * @param {RenderTarget} cubeUVRenderTarget - * @param {number} lodIn - Source LOD level to read from - * @param {number} lodOut - Target LOD level to write to - */ - private _applyGGXFilter; - /** - * This is a two-pass Gaussian blur for a cubemap. Normally this is done - * vertically and horizontally, but this breaks down on a cube. Here we apply - * the blur latitudinally (around the poles), and then longitudinally (towards - * the poles) to approximate the orthogonally-separable blur. It is least - * accurate at the poles, but still does a decent job. - * - * Used for initial scene blur in fromScene() method when sigma > 0. - * - * @private - * @param {RenderTarget} cubeUVRenderTarget - The cubemap render target. - * @param {number} lodIn - The input level-of-detail. - * @param {number} lodOut - The output level-of-detail. - * @param {number} sigma - The blur radius in radians. - * @param {Vector3} [poleAxis] - The pole axis. - */ - private _blur; - _halfBlur(targetIn: any, targetOut: any, lodIn: any, lodOut: any, sigmaRadians: any, direction: any, poleAxis: any): void; - _setViewport(target: any, x: any, y: any, width: any, height: any): void; -} -import { RenderTarget } from '../../../core/RenderTarget.js'; -import NodeMaterial from '../../../materials/nodes/NodeMaterial.js'; -import { Mesh } from '../../../objects/Mesh.js'; -import { Vector3 } from '../../../math/Vector3.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/nodes/NodeBuilderState.d.ts b/jsdoc-testing/jsdoc/renderers/common/nodes/NodeBuilderState.d.ts deleted file mode 100644 index 876698dc2..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/nodes/NodeBuilderState.d.ts +++ /dev/null @@ -1,105 +0,0 @@ -export default NodeBuilderState; -/** - * This module represents the state of a node builder after it was - * used to build the nodes for a render object. The state holds the - * results of the build for further processing in the renderer. - * - * Render objects with identical cache keys share the same node builder state. - * - * @private - */ -declare class NodeBuilderState { - /** - * Constructs a new node builder state. - * - * @param {string} vertexShader - The native vertex shader code. - * @param {string} fragmentShader - The native fragment shader code. - * @param {string} computeShader - The native compute shader code. - * @param {Array} nodeAttributes - An array of node attributes. - * @param {Array} bindings - An array of bind groups. - * @param {Array} updateNodes - An array of nodes that implement their `update()` method. - * @param {Array} updateBeforeNodes - An array of nodes that implement their `updateBefore()` method. - * @param {Array} updateAfterNodes - An array of nodes that implement their `updateAfter()` method. - * @param {NodeMaterialObserver} observer - A node material observer. - * @param {Array} transforms - An array with transform attribute objects. Only relevant when using compute shaders with WebGL 2. - */ - constructor(vertexShader: string, fragmentShader: string, computeShader: string, nodeAttributes: Array, bindings: Array, updateNodes: Array, updateBeforeNodes: Array, updateAfterNodes: Array, observer: NodeMaterialObserver, transforms?: Array); - /** - * The native vertex shader code. - * - * @type {string} - */ - vertexShader: string; - /** - * The native fragment shader code. - * - * @type {string} - */ - fragmentShader: string; - /** - * The native compute shader code. - * - * @type {string} - */ - computeShader: string; - /** - * An array with transform attribute objects. - * Only relevant when using compute shaders with WebGL 2. - * - * @type {Array} - */ - transforms: Array; - /** - * An array of node attributes representing - * the attributes of the shaders. - * - * @type {Array} - */ - nodeAttributes: Array; - /** - * An array of bind groups representing the uniform or storage - * buffers, texture or samplers of the shader. - * - * @type {Array} - */ - bindings: Array; - /** - * An array of nodes that implement their `update()` method. - * - * @type {Array} - */ - updateNodes: Array; - /** - * An array of nodes that implement their `updateBefore()` method. - * - * @type {Array} - */ - updateBeforeNodes: Array; - /** - * An array of nodes that implement their `updateAfter()` method. - * - * @type {Array} - */ - updateAfterNodes: Array; - /** - * A node material observer. - * - * @type {NodeMaterialObserver} - */ - observer: NodeMaterialObserver; - /** - * How often this state is used by render objects. - * - * @type {number} - */ - usedTimes: number; - /** - * This method is used to create a array of bind groups based - * on the existing bind groups of this state. Shared groups are - * not cloned. - * - * @return {Array} A array of bind groups. - */ - createBindings(): Array; -} -import BindGroup from '../BindGroup.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/nodes/NodeLibrary.d.ts b/jsdoc-testing/jsdoc/renderers/common/nodes/NodeLibrary.d.ts deleted file mode 100644 index 0121dd34b..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/nodes/NodeLibrary.d.ts +++ /dev/null @@ -1,99 +0,0 @@ -export default NodeLibrary; -/** - * The purpose of a node library is to assign node implementations - * to existing library features. In `WebGPURenderer` lights, materials - * which are not based on `NodeMaterial` as well as tone mapping techniques - * are implemented with node-based modules. - * - * @private - */ -declare class NodeLibrary { - /** - * A weak map that maps lights to light nodes. - * - * @type {WeakMap} - */ - lightNodes: WeakMap; - /** - * A map that maps materials to node materials. - * - * @type {Map} - */ - materialNodes: Map; - /** - * A map that maps tone mapping techniques (constants) - * to tone mapping node functions. - * - * @type {Map} - */ - toneMappingNodes: Map; - /** - * Returns a matching node material instance for the given material object. - * - * This method also assigns/copies the properties of the given material object - * to the node material. This is done to make sure the current material - * configuration carries over to the node version. - * - * @param {Material} material - A material. - * @return {NodeMaterial} The corresponding node material. - */ - fromMaterial(material: Material): NodeMaterial; - /** - * Adds a tone mapping node function for a tone mapping technique (constant). - * - * @param {Function} toneMappingNode - The tone mapping node function. - * @param {number} toneMapping - The tone mapping. - */ - addToneMapping(toneMappingNode: Function, toneMapping: number): void; - /** - * Returns a tone mapping node function for a tone mapping technique (constant). - * - * @param {number} toneMapping - The tone mapping. - * @return {?Function} The tone mapping node function. Returns `null` if no node function is found. - */ - getToneMappingFunction(toneMapping: number): Function | null; - /** - * Returns a node material class definition for a material type. - * - * @param {string} materialType - The material type. - * @return {?NodeMaterial.constructor} The node material class definition. Returns `null` if no node material is found. - */ - getMaterialNodeClass(materialType: string): NodeMaterial.constructor | null; - /** - * Adds a node material class definition for a given material type. - * - * @param {NodeMaterial.constructor} materialNodeClass - The node material class definition. - * @param {string} materialClassType - The material type. - */ - addMaterial(materialNodeClass: NodeMaterial.constructor, materialClassType: string): void; - /** - * Returns a light node class definition for a light class definition. - * - * @param {Light.constructor} light - The light class definition. - * @return {?AnalyticLightNode.constructor} The light node class definition. Returns `null` if no light node is found. - */ - getLightNodeClass(light: Light.constructor): AnalyticLightNode.constructor | null; - /** - * Adds a light node class definition for a given light class definition. - * - * @param {AnalyticLightNode.constructor} lightNodeClass - The light node class definition. - * @param {Light.constructor} lightClass - The light class definition. - */ - addLight(lightNodeClass: AnalyticLightNode.constructor, lightClass: Light.constructor): void; - /** - * Adds a node class definition for the given type to the provided type library. - * - * @param {Node.constructor} nodeClass - The node class definition. - * @param {number|string} type - The object type. - * @param {Map} library - The type library. - */ - addType(nodeClass: Node.constructor, type: number | string, library: Map): void; - /** - * Adds a node class definition for the given class definition to the provided type library. - * - * @param {Node.constructor} nodeClass - The node class definition. - * @param {Node.constructor} baseClass - The class definition. - * @param {WeakMap} library - The type library. - */ - addClass(nodeClass: Node.constructor, baseClass: Node.constructor, library: WeakMap): void; -} diff --git a/jsdoc-testing/jsdoc/renderers/common/nodes/NodeManager.d.ts b/jsdoc-testing/jsdoc/renderers/common/nodes/NodeManager.d.ts deleted file mode 100644 index a7840ba9f..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/nodes/NodeManager.d.ts +++ /dev/null @@ -1,280 +0,0 @@ -export default NodeManager; -/** - * This renderer module manages node-related objects and is the - * primary interface between the renderer and the node system. - * - * @private - * @augments DataMap - */ -declare class NodeManager extends DataMap { - /** - * Constructs a new nodes management component. - * - * @param {Renderer} renderer - The renderer. - * @param {Backend} backend - The renderer's backend. - */ - constructor(renderer: Renderer, backend: Backend); - /** - * The renderer. - * - * @type {Renderer} - */ - renderer: Renderer; - /** - * The renderer's backend. - * - * @type {Backend} - */ - backend: Backend; - /** - * The node frame. - * - * @type {Renderer} - */ - nodeFrame: Renderer; - /** - * A cache for managing node builder states. - * - * @type {Map} - */ - nodeBuilderCache: Map; - /** - * A cache for managing data cache key data. - * - * @type {ChainMap} - */ - callHashCache: ChainMap; - /** - * A cache for managing node uniforms group data. - * - * @type {ChainMap} - */ - groupsData: ChainMap; - /** - * Queue for pending async builds to limit concurrent compilation. - * - * @private - * @type {Array} - */ - private _buildQueue; - /** - * Whether an async build is currently in progress. - * - * @private - * @type {boolean} - */ - private _buildInProgress; - /** - * A cache for managing node objects of - * scene properties like fog or environments. - * - * @type {Object} - */ - cacheLib: { - [x: string]: WeakMap; - }; - /** - * Returns `true` if the given node uniforms group must be updated or not. - * - * @param {NodeUniformsGroup} nodeUniformsGroup - The node uniforms group. - * @return {boolean} Whether the node uniforms group requires an update or not. - */ - updateGroup(nodeUniformsGroup: NodeUniformsGroup): boolean; - /** - * Returns the cache key for the given render object. - * - * @param {RenderObject} renderObject - The render object. - * @return {number} The cache key. - */ - getForRenderCacheKey(renderObject: RenderObject): number; - /** - * Creates a node builder configured for the given render object and material. - * - * @private - * @param {RenderObject} renderObject - The render object. - * @param {Material} material - The material to use. - * @return {NodeBuilder} The configured node builder. - */ - private _createNodeBuilder; - /** - * Returns a node builder state for the given render object. - * - * @param {RenderObject} renderObject - The render object. - * @param {boolean} [useAsync=false] - Whether to use async build with yielding. - * @return {NodeBuilderState|Promise} The node builder state (or Promise if async). - */ - getForRender(renderObject: RenderObject, useAsync?: boolean): NodeBuilderState | Promise; - /** - * Async version of getForRender() that yields to main thread during build. - * Use this in compileAsync() to prevent blocking the main thread. - * - * @param {RenderObject} renderObject - The render object. - * @return {Promise} A promise that resolves to the node builder state. - */ - getForRenderAsync(renderObject: RenderObject): Promise; - /** - * Returns nodeBuilderState if ready, null if pending async build. - * Queues async build on first call for cache miss. - * Use this in render() path to enable non-blocking compilation. - * - * @param {RenderObject} renderObject - The render object. - * @return {?NodeBuilderState} The node builder state, or null if still building. - */ - getForRenderDeferred(renderObject: RenderObject): NodeBuilderState | null; - /** - * Processes the build queue one item at a time. - * This ensures builds don't all run simultaneously and freeze the main thread. - * - * @private - */ - private _processBuildQueue; - /** - * Deletes the given object from the internal data map - * - * @param {any} object - The object to delete. - * @return {?Object} The deleted dictionary. - */ - delete(object: any): Object | null; - /** - * Returns a node builder state for the given compute node. - * - * @param {Node} computeNode - The compute node. - * @return {NodeBuilderState} The node builder state. - */ - getForCompute(computeNode: Node): NodeBuilderState; - /** - * Creates a node builder state for the given node builder. - * - * @private - * @param {NodeBuilder} nodeBuilder - The node builder. - * @return {NodeBuilderState} The node builder state. - */ - private _createNodeBuilderState; - /** - * Returns an environment node for the current configured - * scene environment. - * - * @param {Scene} scene - The scene. - * @return {Node} A node representing the current scene environment. - */ - getEnvironmentNode(scene: Scene): Node; - /** - * Returns a background node for the current configured - * scene background. - * - * @param {Scene} scene - The scene. - * @return {Node} A node representing the current scene background. - */ - getBackgroundNode(scene: Scene): Node; - /** - * Returns a fog node for the current configured scene fog. - * - * @param {Scene} scene - The scene. - * @return {Node} A node representing the current scene fog. - */ - getFogNode(scene: Scene): Node; - /** - * Returns a cache key for the given scene and lights node. - * This key is used by `RenderObject` as a part of the dynamic - * cache key (a key that must be checked every time the render - * objects is drawn). - * - * @param {Scene} scene - The scene. - * @param {LightsNode} lightsNode - The lights node. - * @return {number} The cache key. - */ - getCacheKey(scene: Scene, lightsNode: LightsNode): number; - /** - * A boolean that indicates whether tone mapping should be enabled - * or not. - * - * @type {boolean} - */ - get isToneMappingState(): boolean; - /** - * If a scene background is configured, this method makes sure to - * represent the background with a corresponding node-based implementation. - * - * @param {Scene} scene - The scene. - */ - updateBackground(scene: Scene): void; - /** - * This method is part of the caching of nodes which are used to represents the - * scene's background, fog or environment. - * - * @param {string} type - The type of object to cache. - * @param {Object} object - The object. - * @param {Function} callback - A callback that produces a node representation for the given object. - * @param {boolean} [forceUpdate=false] - Whether an update should be enforced or not. - * @return {Node} The node representation. - */ - getCacheNode(type: string, object: Object, callback: Function, forceUpdate?: boolean): Node; - /** - * If a scene fog is configured, this method makes sure to - * represent the fog with a corresponding node-based implementation. - * - * @param {Scene} scene - The scene. - */ - updateFog(scene: Scene): void; - /** - * If a scene environment is configured, this method makes sure to - * represent the environment with a corresponding node-based implementation. - * - * @param {Scene} scene - The scene. - */ - updateEnvironment(scene: Scene): void; - getNodeFrame(renderer?: Renderer, scene?: null, object?: null, camera?: null, material?: null): Renderer; - getNodeFrameForRender(renderObject: any): Renderer; - /** - * Returns the current output cache key. - * - * @return {string} The output cache key. - */ - getOutputCacheKey(): string; - /** - * Returns a node that represents the output configuration (tone mapping and - * color space) for the current target. - * - * @param {Texture} outputTarget - The output target. - * @return {Node} The output node. - */ - getOutputNode(outputTarget: Texture): Node; - /** - * Triggers the call of `updateBefore()` methods - * for all nodes of the given render object. - * - * @param {RenderObject} renderObject - The render object. - */ - updateBefore(renderObject: RenderObject): void; - /** - * Triggers the call of `updateAfter()` methods - * for all nodes of the given render object. - * - * @param {RenderObject} renderObject - The render object. - */ - updateAfter(renderObject: RenderObject): void; - /** - * Triggers the call of `update()` methods - * for all nodes of the given compute node. - * - * @param {Node} computeNode - The compute node. - */ - updateForCompute(computeNode: Node): void; - /** - * Triggers the call of `update()` methods - * for all nodes of the given render object. - * - * @param {RenderObject} renderObject - The render object. - */ - updateForRender(renderObject: RenderObject): void; - /** - * Returns `true` if the given render object requires a refresh. - * - * @param {RenderObject} renderObject - The render object. - * @return {boolean} Whether the given render object requires a refresh or not. - */ - needsRefresh(renderObject: RenderObject): boolean; -} -import DataMap from '../DataMap.js'; -import NodeBuilderState from './NodeBuilderState.js'; -import ChainMap from '../ChainMap.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/nodes/NodeSampledTexture.d.ts b/jsdoc-testing/jsdoc/renderers/common/nodes/NodeSampledTexture.d.ts deleted file mode 100644 index 3c380c248..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/nodes/NodeSampledTexture.d.ts +++ /dev/null @@ -1,72 +0,0 @@ -/** - * A special form of sampled texture binding type. - * It's texture value is managed by a node object. - * - * @private - * @augments SampledTexture - */ -export class NodeSampledTexture extends SampledTexture { - /** - * Constructs a new node-based sampled texture. - * - * @param {string} name - The textures's name. - * @param {TextureNode} textureNode - The texture node. - * @param {UniformGroupNode} groupNode - The uniform group node. - * @param {?string} [access=null] - The access type. - */ - constructor(name: string, textureNode: TextureNode, groupNode: UniformGroupNode, access?: string | null); - /** - * The texture node. - * - * @type {TextureNode} - */ - textureNode: TextureNode; - /** - * The uniform group node. - * - * @type {UniformGroupNode} - */ - groupNode: UniformGroupNode; - /** - * The access type. - * - * @type {?string} - * @default null - */ - access: string | null; -} -/** - * A special form of sampled cube texture binding type. - * It's texture value is managed by a node object. - * - * @private - * @augments NodeSampledTexture - */ -export class NodeSampledCubeTexture extends NodeSampledTexture { - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isSampledCubeTexture: boolean; -} -/** - * A special form of sampled 3D texture binding type. - * It's texture value is managed by a node object. - * - * @private - * @augments NodeSampledTexture - */ -export class NodeSampledTexture3D extends NodeSampledTexture { - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isSampledTexture3D: boolean; -} -import { SampledTexture } from '../SampledTexture.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/nodes/NodeSampler.d.ts b/jsdoc-testing/jsdoc/renderers/common/nodes/NodeSampler.d.ts deleted file mode 100644 index b5ad4701d..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/nodes/NodeSampler.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -export default NodeSampler; -/** - * A special form of sampler binding type. - * It's texture value is managed by a node object. - * - * @private - * @augments Sampler - */ -declare class NodeSampler extends Sampler { - /** - * Constructs a new node-based sampler. - * - * @param {string} name - The samplers's name. - * @param {TextureNode} textureNode - The texture node. - * @param {UniformGroupNode} groupNode - The uniform group node. - */ - constructor(name: string, textureNode: TextureNode, groupNode: UniformGroupNode); - /** - * The texture node. - * - * @type {TextureNode} - */ - textureNode: TextureNode; - /** - * The uniform group node. - * - * @type {UniformGroupNode} - */ - groupNode: UniformGroupNode; -} -import Sampler from '../Sampler.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/nodes/NodeStorageBuffer.d.ts b/jsdoc-testing/jsdoc/renderers/common/nodes/NodeStorageBuffer.d.ts deleted file mode 100644 index ca5196126..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/nodes/NodeStorageBuffer.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -export default NodeStorageBuffer; -/** - * A special form of storage buffer binding type. - * It's buffer value is managed by a node object. - * - * @private - * @augments StorageBuffer - */ -declare class NodeStorageBuffer extends StorageBuffer { - /** - * Constructs a new node-based storage buffer. - * - * @param {StorageBufferNode} nodeUniform - The storage buffer node. - * @param {UniformGroupNode} groupNode - The uniform group node. - */ - constructor(nodeUniform: StorageBufferNode, groupNode: UniformGroupNode); - /** - * The node uniform. - * - * @type {StorageBufferNode} - */ - nodeUniform: StorageBufferNode; - /** - * The access type. - * - * @type {string} - */ - access: string; - /** - * The uniform group node. - * - * @type {UniformGroupNode} - */ - groupNode: UniformGroupNode; -} -import StorageBuffer from '../StorageBuffer.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/nodes/NodeUniform.d.ts b/jsdoc-testing/jsdoc/renderers/common/nodes/NodeUniform.d.ts deleted file mode 100644 index 47673f68d..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/nodes/NodeUniform.d.ts +++ /dev/null @@ -1,230 +0,0 @@ -/** - * A special form of Number uniform binding type. - * It's value is managed by a node object. - * - * @private - * @augments NumberUniform - */ -export class NumberNodeUniform extends NumberUniform { - /** - * Constructs a new node-based Number uniform. - * - * @param {NodeUniform} nodeUniform - The node uniform. - */ - constructor(nodeUniform: NodeUniform); - /** - * The node uniform. - * - * @type {NodeUniform} - */ - nodeUniform: NodeUniform; - /** - * Overwritten to return the value of the node uniform. - * - * @return {number} The value. - */ - getValue(): number; - /** - * Returns the node uniform data type. - * - * @return {string} The data type. - */ - getType(): string; -} -/** - * A special form of Vector2 uniform binding type. - * It's value is managed by a node object. - * - * @private - * @augments Vector2Uniform - */ -export class Vector2NodeUniform extends Vector2Uniform { - /** - * Constructs a new node-based Vector2 uniform. - * - * @param {NodeUniform} nodeUniform - The node uniform. - */ - constructor(nodeUniform: NodeUniform); - /** - * The node uniform. - * - * @type {NodeUniform} - */ - nodeUniform: NodeUniform; - /** - * Returns the node uniform data type. - * - * @return {string} The data type. - */ - getType(): string; -} -/** - * A special form of Vector3 uniform binding type. - * It's value is managed by a node object. - * - * @private - * @augments Vector3Uniform - */ -export class Vector3NodeUniform extends Vector3Uniform { - /** - * Constructs a new node-based Vector3 uniform. - * - * @param {NodeUniform} nodeUniform - The node uniform. - */ - constructor(nodeUniform: NodeUniform); - /** - * The node uniform. - * - * @type {NodeUniform} - */ - nodeUniform: NodeUniform; - /** - * Returns the node uniform data type. - * - * @return {string} The data type. - */ - getType(): string; -} -/** - * A special form of Vector4 uniform binding type. - * It's value is managed by a node object. - * - * @private - * @augments Vector4Uniform - */ -export class Vector4NodeUniform extends Vector4Uniform { - /** - * Constructs a new node-based Vector4 uniform. - * - * @param {NodeUniform} nodeUniform - The node uniform. - */ - constructor(nodeUniform: NodeUniform); - /** - * The node uniform. - * - * @type {NodeUniform} - */ - nodeUniform: NodeUniform; - /** - * Returns the node uniform data type. - * - * @return {string} The data type. - */ - getType(): string; -} -/** - * A special form of Color uniform binding type. - * It's value is managed by a node object. - * - * @private - * @augments ColorUniform - */ -export class ColorNodeUniform extends ColorUniform { - /** - * Constructs a new node-based Color uniform. - * - * @param {NodeUniform} nodeUniform - The node uniform. - */ - constructor(nodeUniform: NodeUniform); - /** - * The node uniform. - * - * @type {NodeUniform} - */ - nodeUniform: NodeUniform; - /** - * Returns the node uniform data type. - * - * @return {string} The data type. - */ - getType(): string; -} -/** - * A special form of Matrix2 uniform binding type. - * It's value is managed by a node object. - * - * @private - * @augments Matrix2Uniform - */ -export class Matrix2NodeUniform extends Matrix2Uniform { - /** - * Constructs a new node-based Matrix2 uniform. - * - * @param {NodeUniform} nodeUniform - The node uniform. - */ - constructor(nodeUniform: NodeUniform); - /** - * The node uniform. - * - * @type {NodeUniform} - */ - nodeUniform: NodeUniform; - /** - * Returns the node uniform data type. - * - * @return {string} The data type. - */ - getType(): string; -} -/** - * A special form of Matrix3 uniform binding type. - * It's value is managed by a node object. - * - * @private - * @augments Matrix3Uniform - */ -export class Matrix3NodeUniform extends Matrix3Uniform { - /** - * Constructs a new node-based Matrix3 uniform. - * - * @param {NodeUniform} nodeUniform - The node uniform. - */ - constructor(nodeUniform: NodeUniform); - /** - * The node uniform. - * - * @type {NodeUniform} - */ - nodeUniform: NodeUniform; - /** - * Returns the node uniform data type. - * - * @return {string} The data type. - */ - getType(): string; -} -/** - * A special form of Matrix4 uniform binding type. - * It's value is managed by a node object. - * - * @private - * @augments Matrix4Uniform - */ -export class Matrix4NodeUniform extends Matrix4Uniform { - /** - * Constructs a new node-based Matrix4 uniform. - * - * @param {NodeUniform} nodeUniform - The node uniform. - */ - constructor(nodeUniform: NodeUniform); - /** - * The node uniform. - * - * @type {NodeUniform} - */ - nodeUniform: NodeUniform; - /** - * Returns the node uniform data type. - * - * @return {string} The data type. - */ - getType(): string; -} -import { NumberUniform } from '../Uniform.js'; -import { Vector2Uniform } from '../Uniform.js'; -import { Vector3Uniform } from '../Uniform.js'; -import { Vector4Uniform } from '../Uniform.js'; -import { ColorUniform } from '../Uniform.js'; -import { Matrix2Uniform } from '../Uniform.js'; -import { Matrix3Uniform } from '../Uniform.js'; -import { Matrix4Uniform } from '../Uniform.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/nodes/NodeUniformBuffer.d.ts b/jsdoc-testing/jsdoc/renderers/common/nodes/NodeUniformBuffer.d.ts deleted file mode 100644 index 495dc5d8c..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/nodes/NodeUniformBuffer.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -export default NodeUniformBuffer; -/** - * A special form of uniform buffer binding type. - * It's buffer value is managed by a node object. - * - * @private - * @augments UniformBuffer - */ -declare class NodeUniformBuffer extends UniformBuffer { - /** - * Constructs a new node-based uniform buffer. - * - * @param {BufferNode} nodeUniform - The uniform buffer node. - * @param {UniformGroupNode} groupNode - The uniform group node. - */ - constructor(nodeUniform: BufferNode, groupNode: UniformGroupNode); - /** - * The uniform buffer node. - * - * @type {BufferNode} - */ - nodeUniform: BufferNode; - /** - * The uniform group node. - * - * @type {UniformGroupNode} - */ - groupNode: UniformGroupNode; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isNodeUniformBuffer: boolean; - /** - * The array of update ranges. - * - * @param {Array<{start: number, count: number}>} value - The update ranges. - */ - set updateRanges(value: Array<{ - start: number; - count: number; - }>); - /** - * The array of update ranges. - * - * @type {Array<{start: number, count: number}>} - */ - get updateRanges(): Array<{ - start: number; - count: number; - }>; -} -import UniformBuffer from '../UniformBuffer.js'; diff --git a/jsdoc-testing/jsdoc/renderers/common/nodes/NodeUniformsGroup.d.ts b/jsdoc-testing/jsdoc/renderers/common/nodes/NodeUniformsGroup.d.ts deleted file mode 100644 index c196bbe56..000000000 --- a/jsdoc-testing/jsdoc/renderers/common/nodes/NodeUniformsGroup.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -export default NodeUniformsGroup; -/** - * A special form of uniforms group that represents - * the individual uniforms as node-based uniforms. - * - * @private - * @augments UniformsGroup - */ -declare class NodeUniformsGroup extends UniformsGroup { - /** - * Constructs a new node-based uniforms group. - * - * @param {string} name - The group's name. - * @param {UniformGroupNode} groupNode - The uniform group node. - */ - constructor(name: string, groupNode: UniformGroupNode); - /** - * The group's ID. - * - * @type {number} - */ - id: number; - /** - * The uniform group node. - * - * @type {UniformGroupNode} - */ - groupNode: UniformGroupNode; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isNodeUniformsGroup: boolean; -} -import UniformsGroup from '../UniformsGroup.js'; diff --git a/jsdoc-testing/jsdoc/renderers/shaders/ShaderChunk/default_fragment.glsl.d.ts b/jsdoc-testing/jsdoc/renderers/shaders/ShaderChunk/default_fragment.glsl.d.ts deleted file mode 100644 index 0ec477406..000000000 --- a/jsdoc-testing/jsdoc/renderers/shaders/ShaderChunk/default_fragment.glsl.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const _default: "\nvoid main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}\n"; -export default _default; diff --git a/jsdoc-testing/jsdoc/renderers/shaders/ShaderChunk/default_vertex.glsl.d.ts b/jsdoc-testing/jsdoc/renderers/shaders/ShaderChunk/default_vertex.glsl.d.ts deleted file mode 100644 index c8a2405ff..000000000 --- a/jsdoc-testing/jsdoc/renderers/shaders/ShaderChunk/default_vertex.glsl.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const _default: "\nvoid main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n"; -export default _default; diff --git a/jsdoc-testing/jsdoc/renderers/shaders/UniformsUtils.d.ts b/jsdoc-testing/jsdoc/renderers/shaders/UniformsUtils.d.ts deleted file mode 100644 index 2789a045c..000000000 --- a/jsdoc-testing/jsdoc/renderers/shaders/UniformsUtils.d.ts +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Provides utility functions for managing uniforms. - * - * @module UniformsUtils - */ -/** - * Clones the given uniform definitions by performing a deep-copy. That means - * if the value of a uniform refers to an object like a Vector3 or Texture, - * the cloned uniform will refer to a new object reference. - * - * @param {Object} src - An object representing uniform definitions. - * @return {Object} The cloned uniforms. - */ -export function cloneUniforms(src: Object): Object; -/** - * Merges the given uniform definitions into a single object. Since the - * method internally uses cloneUniforms(), it performs a deep-copy when - * producing the merged uniform definitions. - * - * @param {Array} uniforms - An array of objects containing uniform definitions. - * @return {Object} The merged uniforms. - */ -export function mergeUniforms(uniforms: any[]): Object; -export function cloneUniformsGroups(src: any): any[]; -export function getUnlitUniformColorSpace(renderer: any): any; -export namespace UniformsUtils { - export { cloneUniforms as clone }; - export { mergeUniforms as merge }; -} diff --git a/jsdoc-testing/jsdoc/renderers/webgl-fallback/WebGLBackend.d.ts b/jsdoc-testing/jsdoc/renderers/webgl-fallback/WebGLBackend.d.ts deleted file mode 100644 index cd1ee41da..000000000 --- a/jsdoc-testing/jsdoc/renderers/webgl-fallback/WebGLBackend.d.ts +++ /dev/null @@ -1,631 +0,0 @@ -export default WebGLBackend; -/** - * A backend implementation targeting WebGL 2. - * - * @private - * @augments Backend - */ -declare class WebGLBackend extends Backend { - /** - * WebGLBackend options. - * - * @typedef {Object} WebGLBackend~Options - * @property {boolean} [logarithmicDepthBuffer=false] - Whether logarithmic depth buffer is enabled or not. - * @property {boolean} [reversedDepthBuffer=false] - Whether reversed depth buffer is enabled or not. - * @property {boolean} [alpha=true] - Whether the default framebuffer (which represents the final contents of the canvas) should be transparent or opaque. - * @property {boolean} [depth=true] - Whether the default framebuffer should have a depth buffer or not. - * @property {boolean} [stencil=false] - Whether the default framebuffer should have a stencil buffer or not. - * @property {boolean} [antialias=false] - Whether MSAA as the default anti-aliasing should be enabled or not. - * @property {number} [samples=0] - When `antialias` is `true`, `4` samples are used by default. Set this parameter to any other integer value than 0 to overwrite the default. - * @property {boolean} [forceWebGL=false] - If set to `true`, the renderer uses a WebGL 2 backend no matter if WebGPU is supported or not. - * @property {WebGL2RenderingContext} [context=undefined] - A WebGL 2 rendering context. - */ - /** - * Constructs a new WebGPU backend. - * - * @param {WebGLBackend~Options} [parameters] - The configuration parameter. - */ - constructor(parameters?: {}); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isWebGLBackend: boolean; - /** - * A reference to a backend module holding shader attribute-related - * utility functions. - * - * @type {?WebGLAttributeUtils} - * @default null - */ - attributeUtils: WebGLAttributeUtils | null; - /** - * A reference to a backend module holding extension-related - * utility functions. - * - * @type {?WebGLExtensions} - * @default null - */ - extensions: WebGLExtensions | null; - /** - * A reference to a backend module holding capability-related - * utility functions. - * - * @type {?WebGLCapabilities} - * @default null - */ - capabilities: WebGLCapabilities | null; - /** - * A reference to a backend module holding texture-related - * utility functions. - * - * @type {?WebGLTextureUtils} - * @default null - */ - textureUtils: WebGLTextureUtils | null; - /** - * A reference to a backend module holding renderer-related - * utility functions. - * - * @type {?WebGLBufferRenderer} - * @default null - */ - bufferRenderer: WebGLBufferRenderer | null; - /** - * A reference to the rendering context. - * - * @type {?WebGL2RenderingContext} - * @default null - */ - gl: WebGL2RenderingContext | null; - /** - * A reference to a backend module holding state-related - * utility functions. - * - * @type {?WebGLState} - * @default null - */ - state: WebGLState | null; - /** - * A reference to a backend module holding common - * utility functions. - * - * @type {?WebGLUtils} - * @default null - */ - utils: WebGLUtils | null; - /** - * Dictionary for caching VAOs. - * - * @type {Object} - */ - vaoCache: { - [x: string]: WebGLVertexArrayObject; - }; - /** - * Dictionary for caching transform feedback objects. - * - * @type {Object} - */ - transformFeedbackCache: { - [x: string]: WebGLTransformFeedback; - }; - /** - * Controls if `gl.RASTERIZER_DISCARD` should be enabled or not. - * Only relevant when using compute shaders. - * - * @type {boolean} - * @default false - */ - discard: boolean; - /** - * A reference to the `EXT_disjoint_timer_query_webgl2` extension. `null` if the - * device does not support the extension. - * - * @type {?EXTDisjointTimerQueryWebGL2} - * @default null - */ - disjoint: EXTDisjointTimerQueryWebGL2 | null; - /** - * A reference to the `KHR_parallel_shader_compile` extension. `null` if the - * device does not support the extension. - * - * @type {?KHRParallelShaderCompile} - * @default null - */ - parallel: KHRParallelShaderCompile | null; - /** - * A reference to the current render context. - * - * @private - * @type {RenderContext} - * @default null - */ - private _currentContext; - /** - * A unique collection of bindings. - * - * @private - * @type {WeakSet>} - */ - private _knownBindings; - /** - * Whether the device supports framebuffers invalidation or not. - * - * @private - * @type {boolean} - */ - private _supportsInvalidateFramebuffer; - /** - * The target framebuffer when rendering with - * the WebXR device API. - * - * @private - * @type {?WebGLFramebuffer} - * @default null - */ - private _xrFramebuffer; - /** - * Initializes the backend so it is ready for usage. - * - * @param {Renderer} renderer - The renderer. - */ - init(renderer: Renderer): void; - _onContextLost: ((event: any) => void) | undefined; - drawBuffersIndexedExt: Object | undefined; - /** - * This method performs a readback operation by moving buffer data from - * a storage buffer attribute from the GPU to the CPU. - * - * @async - * @param {StorageBufferAttribute} attribute - The storage buffer attribute. - * @return {Promise} A promise that resolves with the buffer data when the data are ready. - */ - getArrayBufferAsync(attribute: StorageBufferAttribute): Promise; - /** - * Ensures the backend is XR compatible. - * - * @async - * @return {Promise} A Promise that resolve when the renderer is XR compatible. - */ - makeXRCompatible(): Promise; - /** - * Sets the XR rendering destination. - * - * @param {WebGLFramebuffer} xrFramebuffer - The XR framebuffer. - */ - setXRTarget(xrFramebuffer: WebGLFramebuffer): void; - /** - * Configures the given XR render target with external textures. - * - * This method is only relevant when using the WebXR Layers API. - * - * @param {XRRenderTarget} renderTarget - The XR render target. - * @param {WebGLTexture} colorTexture - A native color texture. - * @param {?WebGLTexture} [depthTexture=null] - A native depth texture. - */ - setXRRenderTargetTextures(renderTarget: XRRenderTarget, colorTexture: WebGLTexture, depthTexture?: WebGLTexture | null): void; - /** - * Inits a time stamp query for the given render context. - * - * @param {string} type - The type of the timestamp query. - * @param {string} uid - A unique identifier for the timestamp query. - */ - initTimestampQuery(type: string, uid: string): void; - /** - * Prepares the timestamp buffer. - * - * @param {string} type - The type of the timestamp query. - * @param {string} uid - A unique identifier for the timestamp query. - */ - prepareTimestampBuffer(type: string, uid: string): void; - /** - * Returns the backend's rendering context. - * - * @return {WebGL2RenderingContext} The rendering context. - */ - getContext(): WebGL2RenderingContext; - /** - * This method is executed at the beginning of a render call and prepares - * the WebGL state for upcoming render calls - * - * @param {RenderContext} renderContext - The render context. - */ - beginRender(renderContext: RenderContext): void; - /** - * This method is executed at the end of a render call and finalizes work - * after draw calls. - * - * @param {RenderContext} renderContext - The render context. - */ - finishRender(renderContext: RenderContext): void; - /** - * This method processes the result of occlusion queries and writes it - * into render context data. - * - * @async - * @param {RenderContext} renderContext - The render context. - */ - resolveOccludedAsync(renderContext: RenderContext): void; - /** - * Returns `true` if the given 3D object is fully occluded by other - * 3D objects in the scene. - * - * @param {RenderContext} renderContext - The render context. - * @param {Object3D} object - The 3D object to test. - * @return {boolean} Whether the 3D object is fully occluded or not. - */ - isOccluded(renderContext: RenderContext, object: Object3D): boolean; - /** - * Updates the viewport with the values from the given render context. - * - * @param {RenderContext} renderContext - The render context. - */ - updateViewport(renderContext: RenderContext): void; - /** - * Updates the scissor with the values from the given render context. - * - * @param {RenderContext} renderContext - The render context. - */ - updateScissor(renderContext: RenderContext): void; - /** - * Defines the scissor test. - * - * @param {boolean} boolean - Whether the scissor test should be enabled or not. - */ - setScissorTest(boolean: boolean): void; - /** - * Returns the clear color and alpha into a single - * color object. - * - * @return {Color4} The clear color. - */ - getClearColor(): Color4; - /** - * Performs a clear operation. - * - * @param {boolean} color - Whether the color buffer should be cleared or not. - * @param {boolean} depth - Whether the depth buffer should be cleared or not. - * @param {boolean} stencil - Whether the stencil buffer should be cleared or not. - * @param {?Object} [descriptor=null] - The render context of the current set render target. - * @param {boolean} [setFrameBuffer=true] - Controls whether the intermediate framebuffer should be set or not. - * @param {boolean} [resolveRenderTarget=true] - Controls whether an active render target should be resolved - * or not. Only relevant for explicit clears. - */ - clear(color: boolean, depth: boolean, stencil: boolean, descriptor?: Object | null, setFrameBuffer?: boolean, resolveRenderTarget?: boolean): void; - /** - * This method is executed at the beginning of a compute call and - * prepares the state for upcoming compute tasks. - * - * @param {Node|Array} computeGroup - The compute node(s). - */ - beginCompute(computeGroup: Node | Array): void; - /** - * Executes a compute command for the given compute node. - * - * @param {Node|Array} computeGroup - The group of compute nodes of a compute call. Can be a single compute node. - * @param {Node} computeNode - The compute node. - * @param {Array} bindings - The bindings. - * @param {ComputePipeline} pipeline - The compute pipeline. - * @param {?number} [count=null] - The count of compute invocations. If `null`, the count is determined by the compute node. - */ - compute(computeGroup: Node | Array, computeNode: Node, bindings: Array, pipeline: ComputePipeline, count?: number | null): void; - /** - * This method is executed at the end of a compute call and - * finalizes work after compute tasks. - * - * @param {Node|Array} computeGroup - The compute node(s). - */ - finishCompute(computeGroup: Node | Array): void; - /** - * Internal to determine if the current render target is a render target array with depth 2D array texture. - * - * @param {RenderContext} renderContext - The render context. - * @return {boolean} Whether the render target is a render target array with depth 2D array texture. - * - * @private - */ - private _isRenderCameraDepthArray; - /** - * Internal draw function. - * - * @private - * @param {Object3D} object - The object to render. - * @param {WebGLBufferRenderer} renderer - The internal renderer. - * @param {number} firstVertex - The first vertex to render. - * @param {number} vertexCount - The vertex count. - * @param {number} instanceCount - The intance count. - */ - private _draw; - /** - * Executes a draw command for the given render object. - * - * @param {RenderObject} renderObject - The render object to draw. - * @param {Info} info - Holds a series of statistical information about the GPU memory and the rendering process. - */ - draw(renderObject: RenderObject): void; - /** - * Creates a default texture for the given texture that can be used - * as a placeholder until the actual texture is ready for usage. - * - * @param {Texture} texture - The texture to create a default texture for. - */ - createDefaultTexture(texture: Texture): void; - /** - * Defines a texture on the GPU for the given texture object. - * - * @param {Texture} texture - The texture. - * @param {Object} [options={}] - Optional configuration parameter. - */ - createTexture(texture: Texture, options?: Object): void; - /** - * Uploads the updated texture data to the GPU. - * - * @param {Texture} texture - The texture. - * @param {Object} [options={}] - Optional configuration parameter. - */ - updateTexture(texture: Texture, options?: Object): void; - /** - * Generates mipmaps for the given texture. - * - * @param {Texture} texture - The texture. - */ - generateMipmaps(texture: Texture): void; - /** - * Destroys the GPU data for the given texture object. - * - * @param {Texture} texture - The texture. - * @param {boolean} [isDefaultTexture=false] - Whether the texture uses a default GPU texture or not. - */ - destroyTexture(texture: Texture, isDefaultTexture?: boolean): void; - /** - * Returns texture data as a typed array. - * - * @async - * @param {Texture} texture - The texture to copy. - * @param {number} x - The x coordinate of the copy origin. - * @param {number} y - The y coordinate of the copy origin. - * @param {number} width - The width of the copy. - * @param {number} height - The height of the copy. - * @param {number} faceIndex - The face index. - * @return {Promise} A Promise that resolves with a typed array when the copy operation has finished. - */ - copyTextureToBuffer(texture: Texture, x: number, y: number, width: number, height: number, faceIndex: number): Promise; - /** - * Returns a node builder for the given render object. - * - * @param {RenderObject} object - The render object. - * @param {Renderer} renderer - The renderer. - * @return {GLSLNodeBuilder} The node builder. - */ - createNodeBuilder(object: RenderObject, renderer: Renderer): GLSLNodeBuilder; - /** - * Creates a shader program from the given programmable stage. - * - * @param {ProgrammableStage} program - The programmable stage. - */ - createProgram(program: ProgrammableStage): void; - /** - * Destroys the shader program of the given programmable stage. - * - * @param {ProgrammableStage} program - The programmable stage. - */ - destroyProgram(program: ProgrammableStage): void; - /** - * Creates a render pipeline for the given render object. - * - * @param {RenderObject} renderObject - The render object. - * @param {Array} promises - An array of compilation promises which are used in `compileAsync()`. - */ - createRenderPipeline(renderObject: RenderObject, promises: Array>): void; - /** - * Formats the source code of error messages. - * - * @private - * @param {string} string - The code. - * @param {number} errorLine - The error line. - * @return {string} The formatted code. - */ - private _handleSource; - /** - * Gets the shader compilation errors from the info log. - * - * @private - * @param {WebGL2RenderingContext} gl - The rendering context. - * @param {WebGLShader} shader - The WebGL shader object. - * @param {string} type - The shader type. - * @return {string} The shader errors. - */ - private _getShaderErrors; - /** - * Logs shader compilation errors. - * - * @private - * @param {WebGLProgram} programGPU - The WebGL program. - * @param {WebGLShader} glFragmentShader - The fragment shader as a native WebGL shader object. - * @param {WebGLShader} glVertexShader - The vertex shader as a native WebGL shader object. - */ - private _logProgramError; - /** - * Completes the shader program setup for the given render object. - * - * @private - * @param {RenderObject} renderObject - The render object. - * @param {RenderPipeline} pipeline - The render pipeline. - */ - private _completeCompile; - /** - * Creates a compute pipeline for the given compute node. - * - * @param {ComputePipeline} computePipeline - The compute pipeline. - * @param {Array} bindings - The bindings. - */ - createComputePipeline(computePipeline: ComputePipeline, bindings: Array): void; - /** - * Creates bindings from the given bind group definition. - * - * @param {BindGroup} bindGroup - The bind group. - * @param {Array} bindings - Array of bind groups. - * @param {number} cacheIndex - The cache index. - * @param {number} version - The version. - */ - createBindings(bindGroup: BindGroup, bindings: Array): void; - /** - * Updates the given bind group definition. - * - * @param {BindGroup} bindGroup - The bind group. - * @param {Array} bindings - Array of bind groups. - * @param {number} cacheIndex - The cache index. - * @param {number} version - The version. - */ - updateBindings(bindGroup: BindGroup): void; - /** - * Updates a buffer binding. - * - * @param {Buffer} binding - The buffer binding to update. - */ - updateBinding(binding: Buffer): void; - /** - * Creates the GPU buffer of an indexed shader attribute. - * - * @param {BufferAttribute} attribute - The indexed buffer attribute. - */ - createIndexAttribute(attribute: BufferAttribute): void; - /** - * Creates the GPU buffer of a shader attribute. - * - * @param {BufferAttribute} attribute - The buffer attribute. - */ - createAttribute(attribute: BufferAttribute): void; - /** - * Creates the GPU buffer of a storage attribute. - * - * @param {BufferAttribute} attribute - The buffer attribute. - */ - createStorageAttribute(attribute: BufferAttribute): void; - /** - * Updates the GPU buffer of a shader attribute. - * - * @param {BufferAttribute} attribute - The buffer attribute to update. - */ - updateAttribute(attribute: BufferAttribute): void; - /** - * Destroys the GPU buffer of a shader attribute. - * - * @param {BufferAttribute} attribute - The buffer attribute to destroy. - */ - destroyAttribute(attribute: BufferAttribute): void; - /** - * Checks if the given feature is supported by the backend. - * - * @param {string} name - The feature's name. - * @return {boolean} Whether the feature is supported or not. - */ - hasFeature(name: string): boolean; - /** - * Copies data of the given source texture to the given destination texture. - * - * @param {Texture} srcTexture - The source texture. - * @param {Texture} dstTexture - The destination texture. - * @param {?(Box3|Box2)} [srcRegion=null] - The region of the source texture to copy. - * @param {?(Vector2|Vector3)} [dstPosition=null] - The destination position of the copy. - * @param {number} [srcLevel=0] - The source mip level to copy from. - * @param {number} [dstLevel=0] - The destination mip level to copy to. - */ - copyTextureToTexture(srcTexture: Texture, dstTexture: Texture, srcRegion?: (Box3 | Box2) | null, dstPosition?: (Vector2 | Vector3) | null, srcLevel?: number, dstLevel?: number): void; - /** - * Copies the current bound framebuffer to the given texture. - * - * @param {Texture} texture - The destination texture. - * @param {RenderContext} renderContext - The render context. - * @param {Vector4} rectangle - A four dimensional vector defining the origin and dimension of the copy. - */ - copyFramebufferToTexture(texture: Texture, renderContext: RenderContext, rectangle: Vector4): void; - /** - * Checks if the given compatibility is supported by the backend. - * - * @param {string} name - The compatibility name. - * @return {boolean} Whether the compatibility is supported or not. - */ - hasCompatibility(name: string): boolean; - /** - * Initializes the render target defined in the given render context. - * - * @param {RenderContext} renderContext - The render context. - */ - initRenderTarget(renderContext: RenderContext): void; - /** - * Configures the active framebuffer from the given render context. - * - * @private - * @param {RenderContext} descriptor - The render context. - */ - private _setFramebuffer; - /** - * Computes the VAO key for the given index and attributes. - * - * @private - * @param {Array} attributes - An array of buffer attributes. - * @return {string} The VAO key. - */ - private _getVaoKey; - /** - * Creates a VAO from the index and attributes. - * - * @private - * @param {Array} attributes - An array of buffer attributes. - * @return {Object} The VAO data. - */ - private _createVao; - /** - * Creates a transform feedback from the given transform buffers. - * - * @private - * @param {Array} transformBuffers - The transform buffers. - * @return {WebGLTransformFeedback} The transform feedback. - */ - private _getTransformFeedback; - /** - * Setups the given bindings. - * - * @private - * @param {Array} bindings - The bindings. - * @param {WebGLProgram} programGPU - The WebGL program. - */ - private _setupBindings; - /** - * Binds the given uniforms. - * - * @private - * @param {Array} bindings - The bindings. - */ - private _bindUniforms; - /** - * The method ensures multisampled render targets are resolved. - * - * @private - * @param {RenderContext} renderContext - The render context. - */ - private _resolveRenderTarget; - /** - * Returns `true` if the `WEBGL_multisampled_render_to_texture` extension - * should be used when MSAA is enabled. - * - * @private - * @param {RenderTarget} renderTarget - The render target that should be multisampled. - * @return {boolean} Whether to use the `WEBGL_multisampled_render_to_texture` extension for MSAA or not. - */ - private _useMultisampledExtension; -} -import Backend from '../common/Backend.js'; -import WebGLAttributeUtils from './utils/WebGLAttributeUtils.js'; -import WebGLExtensions from './utils/WebGLExtensions.js'; -import WebGLCapabilities from './utils/WebGLCapabilities.js'; -import WebGLTextureUtils from './utils/WebGLTextureUtils.js'; -import { WebGLBufferRenderer } from './WebGLBufferRenderer.js'; -import WebGLState from './utils/WebGLState.js'; -import WebGLUtils from './utils/WebGLUtils.js'; -import GLSLNodeBuilder from './nodes/GLSLNodeBuilder.js'; diff --git a/jsdoc-testing/jsdoc/renderers/webgl-fallback/WebGLBufferRenderer.d.ts b/jsdoc-testing/jsdoc/renderers/webgl-fallback/WebGLBufferRenderer.d.ts deleted file mode 100644 index c297252cb..000000000 --- a/jsdoc-testing/jsdoc/renderers/webgl-fallback/WebGLBufferRenderer.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -export class WebGLBufferRenderer { - constructor(backend: any); - gl: any; - extensions: any; - info: any; - mode: any; - index: number; - type: any; - object: any; - render(start: any, count: any): void; - renderInstances(start: any, count: any, primcount: any): void; - renderMultiDraw(starts: any, counts: any, drawCount: any): void; -} diff --git a/jsdoc-testing/jsdoc/renderers/webgl-fallback/nodes/GLSLNodeBuilder.d.ts b/jsdoc-testing/jsdoc/renderers/webgl-fallback/nodes/GLSLNodeBuilder.d.ts deleted file mode 100644 index f1e09dc23..000000000 --- a/jsdoc-testing/jsdoc/renderers/webgl-fallback/nodes/GLSLNodeBuilder.d.ts +++ /dev/null @@ -1,365 +0,0 @@ -export default GLSLNodeBuilder; -/** - * A node builder targeting GLSL. - * - * This module generates GLSL shader code from node materials and also - * generates the respective bindings and vertex buffer definitions. These - * data are later used by the renderer to create render and compute pipelines - * for render objects. - * - * @augments NodeBuilder - */ -declare class GLSLNodeBuilder extends NodeBuilder { - /** - * Constructs a new GLSL node builder renderer. - * - * @param {Object3D} object - The 3D object. - * @param {Renderer} renderer - The renderer. - */ - constructor(object: Object3D, renderer: Renderer); - /** - * A dictionary holds for each shader stage ('vertex', 'fragment', 'compute') - * another dictionary which manages UBOs per group ('render','frame','object'). - * - * @type {Object>} - */ - uniformGroups: { - [x: string]: { - [x: string]: NodeUniformsGroup; - }; - }; - /** - * An array that holds objects defining the varying and attribute data in - * context of Transform Feedback. - * - * @type {Array>} - */ - transforms: Array<{ - [x: string]: AttributeNode | string; - }>; - /** - * A dictionary that holds for each shader stage a Map of used extensions. - * - * @type {Object>} - */ - extensions: { - [x: string]: Map; - }; - /** - * A dictionary that holds for each shader stage an Array of used builtins. - * - * @type {Object>} - */ - builtins: { - [x: string]: string[]; - }; - /** - * Checks if the given texture requires a manual conversion to the working color space. - * - * @param {Texture} texture - The texture to check. - * @return {boolean} Whether the given texture requires a conversion to working color space or not. - */ - needsToWorkingColorSpace(texture: Texture): boolean; - /** - * Includes the given method name into the current - * function node. - * - * @private - * @param {string} name - The method name to include. - * @return {CodeNode} The respective code node. - */ - private _include; - /** - * Returns the bitcast method name for a given input and outputType. - * - * @param {string} type - The output type to bitcast to. - * @param {string} inputType - The input type of the. - * @return {string} The resolved WGSL bitcast invocation. - */ - getBitcastMethod(type: string, inputType: string): string; - /** - * Returns the float packing method name for a given numeric encoding. - * - * @param {string} encoding - The numeric encoding that describes how the float values are mapped to the integer range. - * @returns {string} The resolved GLSL float packing method name. - */ - getFloatPackingMethod(encoding: string): string; - /** - * Returns the float unpacking method name for a given numeric encoding. - * - * @param {string} encoding - The numeric encoding that describes how the integer values are mapped to the float range. - * @returns {string} The resolved GLSL float unpacking method name. - */ - getFloatUnpackingMethod(encoding: string): string; - /** - * Returns the native snippet for a ternary operation. - * - * @param {string} condSnippet - The condition determining which expression gets resolved. - * @param {string} ifSnippet - The expression to resolve to if the condition is true. - * @param {string} elseSnippet - The expression to resolve to if the condition is false. - * @return {string} The resolved method name. - */ - getTernary(condSnippet: string, ifSnippet: string, elseSnippet: string): string; - /** - * Builds the given shader node. - * - * @param {ShaderNodeInternal} shaderNode - The shader node. - * @return {string} The GLSL function code. - */ - buildFunctionCode(shaderNode: ShaderNodeInternal): string; - /** - * Setups the Pixel Buffer Object (PBO) for the given storage - * buffer node. - * - * @param {StorageBufferNode} storageBufferNode - The storage buffer node. - */ - setupPBO(storageBufferNode: StorageBufferNode): void; - /** - * Returns a GLSL snippet that represents the property name of the given node. - * - * @param {Node} node - The node. - * @param {string} [shaderStage=this.shaderStage] - The shader stage this code snippet is generated for. - * @return {string} The property name. - */ - getPropertyName(node: Node, shaderStage?: string): string; - /** - * Setups the Pixel Buffer Object (PBO) for the given storage - * buffer node. - * - * @param {StorageArrayElementNode} storageArrayElementNode - The storage array element node. - * @return {string} The property name. - */ - generatePBO(storageArrayElementNode: StorageArrayElementNode): string; - /** - * Generates the GLSL snippet that reads a single texel from a texture without sampling or filtering. - * - * @param {?Texture} texture - The texture. - * @param {string} textureProperty - The name of the texture uniform in the shader. - * @param {string} uvIndexSnippet - A GLSL snippet that represents texture coordinates used for sampling. - * @param {?string} levelSnippet - A GLSL snippet that represents the mip level, with level 0 containing a full size version of the texture. - * @param {?string} depthSnippet - A GLSL snippet that represents the 0-based texture array index to sample. - * @param {?string} offsetSnippet - A GLSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture. - * @return {string} The GLSL snippet. - */ - generateTextureLoad(texture: Texture | null, textureProperty: string, uvIndexSnippet: string, levelSnippet: string | null, depthSnippet: string | null, offsetSnippet: string | null): string; - /** - * Generates the GLSL snippet for sampling/loading the given texture. - * - * @param {Texture} texture - The texture. - * @param {string} textureProperty - The name of the texture uniform in the shader. - * @param {string} uvSnippet - A GLSL snippet that represents texture coordinates used for sampling. - * @param {?string} depthSnippet - A GLSL snippet that represents the 0-based texture array index to sample. - * @param {?string} offsetSnippet - A GLSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture. - * @return {string} The GLSL snippet. - */ - generateTexture(texture: Texture, textureProperty: string, uvSnippet: string, depthSnippet: string | null, offsetSnippet: string | null): string; - /** - * Generates the GLSL snippet when sampling textures with explicit mip level. - * - * @param {Texture} texture - The texture. - * @param {string} textureProperty - The name of the texture uniform in the shader. - * @param {string} uvSnippet - A GLSL snippet that represents texture coordinates used for sampling. - * @param {string} levelSnippet - A GLSL snippet that represents the mip level, with level 0 containing a full size version of the texture. - * @param {?string} depthSnippet - A GLSL snippet that represents 0-based texture array index to sample. - * @param {?string} offsetSnippet - A GLSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture. - * @return {string} The GLSL snippet. - */ - generateTextureLevel(texture: Texture, textureProperty: string, uvSnippet: string, levelSnippet: string, depthSnippet: string | null, offsetSnippet: string | null): string; - /** - * Generates the GLSL snippet when sampling textures with a bias to the mip level. - * - * @param {Texture} texture - The texture. - * @param {string} textureProperty - The name of the texture uniform in the shader. - * @param {string} uvSnippet - A GLSL snippet that represents texture coordinates used for sampling. - * @param {string} biasSnippet - A GLSL snippet that represents the bias to apply to the mip level before sampling. - * @param {?string} depthSnippet - A GLSL snippet that represents 0-based texture array index to sample. - * @param {?string} offsetSnippet - A GLSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture. - * @return {string} The GLSL snippet. - */ - generateTextureBias(texture: Texture, textureProperty: string, uvSnippet: string, biasSnippet: string, depthSnippet: string | null, offsetSnippet: string | null): string; - /** - * Generates the GLSL snippet for sampling/loading the given texture using explicit gradients. - * - * @param {Texture} texture - The texture. - * @param {string} textureProperty - The name of the texture uniform in the shader. - * @param {string} uvSnippet - A GLSL snippet that represents texture coordinates used for sampling. - * @param {Array} gradSnippet - An array holding both gradient GLSL snippets. - * @param {?string} depthSnippet - A GLSL snippet that represents 0-based texture array index to sample. - * @param {?string} offsetSnippet - A GLSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture. - * @return {string} The GLSL snippet. - */ - generateTextureGrad(texture: Texture, textureProperty: string, uvSnippet: string, gradSnippet: Array, depthSnippet: string | null, offsetSnippet: string | null): string; - /** - * Generates the GLSL snippet for sampling a depth texture and comparing the sampled depth values - * against a reference value. - * - * @param {Texture} texture - The texture. - * @param {string} textureProperty - The name of the texture uniform in the shader. - * @param {string} uvSnippet - A GLSL snippet that represents texture coordinates used for sampling. - * @param {string} compareSnippet - A GLSL snippet that represents the reference value. - * @param {?string} depthSnippet - A GLSL snippet that represents 0-based texture array index to sample. - * @param {?string} offsetSnippet - A GLSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture. - * @param {string} [shaderStage=this.shaderStage] - The shader stage this code snippet is generated for. - * @return {string} The GLSL snippet. - */ - generateTextureCompare(texture: Texture, textureProperty: string, uvSnippet: string, compareSnippet: string, depthSnippet: string | null, offsetSnippet: string | null, shaderStage?: string): string; - /** - * Returns the variables of the given shader stage as a GLSL string. - * - * @param {string} shaderStage - The shader stage. - * @return {string} The GLSL snippet that defines the variables. - */ - getVars(shaderStage: string): string; - /** - * Returns the uniforms of the given shader stage as a GLSL string. - * - * @param {string} shaderStage - The shader stage. - * @return {string} The GLSL snippet that defines the uniforms. - */ - getUniforms(shaderStage: string): string; - /** - * Returns the shader attributes of the given shader stage as a GLSL string. - * - * @param {string} shaderStage - The shader stage. - * @return {string} The GLSL snippet that defines the shader attributes. - */ - getAttributes(shaderStage: string): string; - /** - * Returns the members of the given struct type node as a GLSL string. - * - * @param {StructTypeNode} struct - The struct type node. - * @return {string} The GLSL snippet that defines the struct members. - */ - getStructMembers(struct: StructTypeNode): string; - /** - * Returns the structs of the given shader stage as a GLSL string. - * - * @param {string} shaderStage - The shader stage. - * @return {string} The GLSL snippet that defines the structs. - */ - getStructs(shaderStage: string): string; - /** - * Returns the varyings of the given shader stage as a GLSL string. - * - * @param {string} shaderStage - The shader stage. - * @return {string} The GLSL snippet that defines the varyings. - */ - getVaryings(shaderStage: string): string; - /** - * Returns a builtin representing the index of an invocation within its workgroup. - * - * @return {string} The invocation local index. - */ - getInvocationLocalIndex(): string; - /** - * Returns a builtin representing the size of a subgroup within the current shader. - */ - getSubgroupSize(): void; - /** - * Returns a builtin representing the index of an invocation within its subgroup. - */ - getInvocationSubgroupIndex(): void; - /** - * Returns a builtin representing the index of the current invocation's subgroup within its workgroup. - */ - getSubgroupIndex(): void; - /** - * Returns the frag depth builtin. - * - * @return {string} The frag depth builtin. - */ - getFragDepth(): string; - /** - * Enables the given extension. - * - * @param {string} name - The extension name. - * @param {string} behavior - The extension behavior. - * @param {string} [shaderStage=this.shaderStage] - The shader stage. - */ - enableExtension(name: string, behavior: string, shaderStage?: string): void; - /** - * Returns the enabled extensions of the given shader stage as a GLSL string. - * - * @param {string} shaderStage - The shader stage. - * @return {string} The GLSL snippet that defines the enabled extensions. - */ - getExtensions(shaderStage: string): string; - /** - * Returns the clip distances builtin. - * - * @return {string} The clip distances builtin. - */ - getClipDistance(): string; - /** - * Whether the requested feature is available or not. - * - * @param {string} name - The requested feature. - * @return {boolean} Whether the requested feature is supported or not. - */ - isAvailable(name: string): boolean; - /** - * Enables hardware clipping. - * - * @param {string} planeCount - The clipping plane count. - */ - enableHardwareClipping(planeCount: string): void; - /** - * Enables multiview. - */ - enableMultiview(): void; - /** - * Registers a transform in context of Transform Feedback. - * - * @param {string} varyingName - The varying name. - * @param {AttributeNode} attributeNode - The attribute node. - */ - registerTransform(varyingName: string, attributeNode: AttributeNode): void; - /** - * Returns the transforms of the given shader stage as a GLSL string. - * - * @param {string} shaderStage - The shader stage. - * @return {string} The GLSL snippet that defines the transforms. - */ - getTransforms(): string; - /** - * Returns a GLSL struct based on the given name and variables. - * - * @private - * @param {string} name - The struct name. - * @param {string} vars - The struct variables. - * @return {string} The GLSL snippet representing a struct. - */ - private _getGLSLUniformStruct; - /** - * Returns a GLSL vertex shader based on the given shader data. - * - * @private - * @param {Object} shaderData - The shader data. - * @return {string} The vertex shader. - */ - private _getGLSLVertexCode; - /** - * Returns a GLSL fragment shader based on the given shader data. - * - * @private - * @param {Object} shaderData - The shader data. - * @return {string} The vertex shader. - */ - private _getGLSLFragmentCode; - /** - * This method is one of the more important ones since it's responsible - * for generating a matching binding instance for the given uniform node. - * - * These bindings are later used in the renderer to create bind groups - * and layouts. - * - * @param {UniformNode} node - The uniform node. - * @param {string} type - The node data type. - * @param {string} shaderStage - The shader stage. - * @param {?string} [name=null] - An optional uniform name. - * @return {NodeUniform} The node uniform object. - */ - getUniformFromNode(node: UniformNode, type: string, shaderStage: string, name?: string | null): NodeUniform; -} -import { NodeBuilder } from '../../../nodes/Nodes.js'; -import NodeUniformsGroup from '../../common/nodes/NodeUniformsGroup.js'; diff --git a/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLAttributeUtils.d.ts b/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLAttributeUtils.d.ts deleted file mode 100644 index 7703a4235..000000000 --- a/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLAttributeUtils.d.ts +++ /dev/null @@ -1,59 +0,0 @@ -export default WebGLAttributeUtils; -/** - * A WebGL 2 backend utility module for managing shader attributes. - * - * @private - */ -declare class WebGLAttributeUtils { - /** - * Constructs a new utility object. - * - * @param {WebGLBackend} backend - The WebGL 2 backend. - */ - constructor(backend: WebGLBackend); - /** - * A reference to the WebGL 2 backend. - * - * @type {WebGLBackend} - */ - backend: WebGLBackend; - /** - * Creates the GPU buffer for the given buffer attribute. - * - * @param {BufferAttribute} attribute - The buffer attribute. - * @param {GLenum } bufferType - A flag that indicates the buffer type and thus binding point target. - */ - createAttribute(attribute: BufferAttribute, bufferType: GLenum): void; - /** - * Updates the GPU buffer of the given buffer attribute. - * - * @param {BufferAttribute} attribute - The buffer attribute. - */ - updateAttribute(attribute: BufferAttribute): void; - /** - * Destroys the GPU buffer of the given buffer attribute. - * - * @param {BufferAttribute} attribute - The buffer attribute. - */ - destroyAttribute(attribute: BufferAttribute): void; - /** - * This method performs a readback operation by moving buffer data from - * a storage buffer attribute from the GPU to the CPU. - * - * @async - * @param {StorageBufferAttribute} attribute - The storage buffer attribute. - * @return {Promise} A promise that resolves with the buffer data when the data are ready. - */ - getArrayBufferAsync(attribute: StorageBufferAttribute): Promise; - /** - * Creates a WebGL buffer with the given data. - * - * @private - * @param {WebGL2RenderingContext} gl - The rendering context. - * @param {GLenum } bufferType - A flag that indicates the buffer type and thus binding point target. - * @param {TypedArray} array - The array of the buffer attribute. - * @param {GLenum} usage - The usage. - * @return {WebGLBuffer} The WebGL buffer. - */ - private _createBuffer; -} diff --git a/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLCapabilities.d.ts b/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLCapabilities.d.ts deleted file mode 100644 index 095e4ee8c..000000000 --- a/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLCapabilities.d.ts +++ /dev/null @@ -1,48 +0,0 @@ -export default WebGLCapabilities; -/** - * A WebGL 2 backend utility module for managing the device's capabilities. - * - * @private - */ -declare class WebGLCapabilities { - /** - * Constructs a new utility object. - * - * @param {WebGLBackend} backend - The WebGL 2 backend. - */ - constructor(backend: WebGLBackend); - /** - * A reference to the WebGL 2 backend. - * - * @type {WebGLBackend} - */ - backend: WebGLBackend; - /** - * This value holds the cached max anisotropy value. - * - * @type {?number} - * @default null - */ - maxAnisotropy: number | null; - /** - * This value holds the cached max uniform block size value. - * - * @type {?number} - * @default null - */ - maxUniformBlockSize: number | null; - /** - * Returns the maximum anisotropy texture filtering value. This value - * depends on the device and is reported by the `EXT_texture_filter_anisotropic` - * WebGL extension. - * - * @return {number} The maximum anisotropy texture filtering value. - */ - getMaxAnisotropy(): number; - /** - * Returns the maximum number of bytes available for uniform buffers. - * - * @return {number} The maximum number of bytes available for uniform buffers. - */ - getUniformBufferLimit(): number; -} diff --git a/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLConstants.d.ts b/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLConstants.d.ts deleted file mode 100644 index d8093bad2..000000000 --- a/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLConstants.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export namespace GLFeatureName { - let WEBGL_multi_draw: string; - let WEBGL_compressed_texture_astc: string; - let WEBGL_compressed_texture_etc: string; - let WEBGL_compressed_texture_etc1: string; - let WEBGL_compressed_texture_pvrtc: string; - let WEBGL_compressed_texture_s3tc: string; - let EXT_texture_compression_bptc: string; - let EXT_disjoint_timer_query_webgl2: string; - let OVR_multiview2: string; -} diff --git a/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLExtensions.d.ts b/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLExtensions.d.ts deleted file mode 100644 index be5b14a6e..000000000 --- a/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLExtensions.d.ts +++ /dev/null @@ -1,56 +0,0 @@ -export default WebGLExtensions; -/** - * A WebGL 2 backend utility module for managing extensions. - * - * @private - */ -declare class WebGLExtensions { - /** - * Constructs a new utility object. - * - * @param {WebGLBackend} backend - The WebGL 2 backend. - */ - constructor(backend: WebGLBackend); - /** - * A reference to the WebGL 2 backend. - * - * @type {WebGLBackend} - */ - backend: WebGLBackend; - /** - * A reference to the rendering context. - * - * @type {WebGL2RenderingContext} - */ - gl: WebGL2RenderingContext; - /** - * A list with all the supported WebGL extensions. - * - * @type {Array} - */ - availableExtensions: Array; - /** - * A dictionary with requested WebGL extensions. - * The key is the name of the extension, the value - * the requested extension object. - * - * @type {Object} - */ - extensions: { - [x: string]: Object; - }; - /** - * Returns the extension object for the given extension name. - * - * @param {string} name - The extension name. - * @return {Object} The extension object. - */ - get(name: string): Object; - /** - * Returns `true` if the requested extension is available. - * - * @param {string} name - The extension name. - * @return {boolean} Whether the given extension is available or not. - */ - has(name: string): boolean; -} diff --git a/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLState.d.ts b/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLState.d.ts deleted file mode 100644 index 2aca5c6c5..000000000 --- a/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLState.d.ts +++ /dev/null @@ -1,372 +0,0 @@ -export default WebGLState; -/** - * A WebGL 2 backend utility module for managing the WebGL state. - * - * The major goal of this module is to reduce the number of state changes - * by caching the WEbGL state with a series of variables. In this way, the - * renderer only executes state change commands when necessary which - * improves the overall performance. - * - * @private - */ -declare class WebGLState { - /** - * Constructs a new utility object. - * - * @param {WebGLBackend} backend - The WebGL 2 backend. - */ - constructor(backend: WebGLBackend); - /** - * A reference to the WebGL 2 backend. - * - * @type {WebGLBackend} - */ - backend: WebGLBackend; - /** - * A reference to the rendering context. - * - * @type {WebGL2RenderingContext} - */ - gl: WebGL2RenderingContext; - enabled: {}; - parameters: {}; - currentFlipSided: any; - currentCullFace: any; - currentProgram: any; - currentBlendingEnabled: boolean; - currentBlending: any; - currentBlendSrc: any; - currentBlendDst: number | null; - currentBlendSrcAlpha: number | null; - currentBlendDstAlpha: number | null; - currentPremultipledAlpha: boolean | null; - currentPolygonOffsetFactor: any; - currentPolygonOffsetUnits: number | null; - currentColorMask: any; - currentDepthReversed: boolean; - currentDepthFunc: any; - currentDepthMask: any; - currentStencilFunc: any; - currentStencilRef: number | null; - currentStencilFuncMask: number | null; - currentStencilFail: any; - currentStencilZFail: number | null; - currentStencilZPass: number | null; - currentStencilMask: any; - currentLineWidth: any; - currentClippingPlanes: number; - currentVAO: any; - currentIndex: WebGLBuffer | null; - currentBoundFramebuffers: {}; - currentDrawbuffers: WeakMap; - maxTextures: any; - currentTextureSlot: any; - currentBoundTextures: {}; - currentBoundBufferBases: {}; - /** - * Inits the state of the utility. - * - * @private - */ - private _init; - currentScissor: Vector4 | undefined; - currentViewport: Vector4 | undefined; - _tempVec4: Vector4 | undefined; - /** - * Enables the given WebGL capability. - * - * This method caches the capability state so - * `gl.enable()` is only called when necessary. - * - * @param {GLenum} id - The capability to enable. - */ - enable(id: GLenum): void; - /** - * Disables the given WebGL capability. - * - * This method caches the capability state so - * `gl.disable()` is only called when necessary. - * - * @param {GLenum} id - The capability to enable. - */ - disable(id: GLenum): void; - /** - * Specifies whether polygons are front- or back-facing - * by setting the winding orientation. - * - * This method caches the state so `gl.frontFace()` is only - * called when necessary. - * - * @param {boolean} flipSided - Whether triangles flipped their sides or not. - */ - setFlipSided(flipSided: boolean): void; - /** - * Specifies whether or not front- and/or back-facing - * polygons can be culled. - * - * This method caches the state so `gl.cullFace()` is only - * called when necessary. - * - * @param {number} cullFace - Defines which polygons are candidates for culling. - */ - setCullFace(cullFace: number): void; - /** - * Specifies the width of line primitives. - * - * This method caches the state so `gl.lineWidth()` is only - * called when necessary. - * - * @param {number} width - The line width. - */ - setLineWidth(width: number): void; - setMRTBlending(textures: any, mrt: any, material: any): void; - /** - * Applies blending configuration for a specific draw buffer index. - * - * @private - * @param {number} index - The draw buffer index. - * @param {Object} blending - The blending configuration (material or BlendMode). - */ - private _setMRTBlendingIndex; - /** - * Defines the blending. - * - * This method caches the state so `gl.blendEquation()`, `gl.blendEquationSeparate()`, - * `gl.blendFunc()` and `gl.blendFuncSeparate()` are only called when necessary. - * - * @param {number} blending - The blending type. - * @param {number} blendEquation - The blending equation. - * @param {number} blendSrc - Only relevant for custom blending. The RGB source blending factor. - * @param {number} blendDst - Only relevant for custom blending. The RGB destination blending factor. - * @param {number} blendEquationAlpha - Only relevant for custom blending. The blending equation for alpha. - * @param {number} blendSrcAlpha - Only relevant for custom blending. The alpha source blending factor. - * @param {number} blendDstAlpha - Only relevant for custom blending. The alpha destination blending factor. - * @param {boolean} premultipliedAlpha - Whether premultiplied alpha is enabled or not. - */ - setBlending(blending: number, blendEquation: number, blendSrc: number, blendDst: number, blendEquationAlpha: number, blendSrcAlpha: number, blendDstAlpha: number, premultipliedAlpha: boolean): void; - currentBlendEquation: any; - currentBlendEquationAlpha: number | undefined; - /** - * Specifies whether colors can be written when rendering - * into a framebuffer or not. - * - * This method caches the state so `gl.colorMask()` is only - * called when necessary. - * - * @param {boolean} colorMask - The color mask. - */ - setColorMask(colorMask: boolean): void; - /** - * Specifies whether the depth test is enabled or not. - * - * @param {boolean} depthTest - Whether the depth test is enabled or not. - */ - setDepthTest(depthTest: boolean): void; - /** - * Configures the WebGL state to use a reversed depth buffer. - * - * @param {boolean} reversed - Whether the depth buffer is reversed or not. - */ - setReversedDepth(reversed: boolean): void; - /** - * Specifies whether depth values can be written when rendering - * into a framebuffer or not. - * - * This method caches the state so `gl.depthMask()` is only - * called when necessary. - * - * @param {boolean} depthMask - The depth mask. - */ - setDepthMask(depthMask: boolean): void; - /** - * Specifies the depth compare function. - * - * This method caches the state so `gl.depthFunc()` is only - * called when necessary. - * - * @param {number} depthFunc - The depth compare function. - */ - setDepthFunc(depthFunc: number): void; - /** - * Specifies the scissor box. - * - * @param {number} x - The x-coordinate of the lower left corner of the viewport. - * @param {number} y - The y-coordinate of the lower left corner of the viewport. - * @param {number} width - The width of the viewport. - * @param {number} height - The height of the viewport. - * - */ - scissor(x: number, y: number, width: number, height: number): void; - /** - * Specifies the viewport. - * - * @param {number} x - The x-coordinate of the lower left corner of the viewport. - * @param {number} y - The y-coordinate of the lower left corner of the viewport. - * @param {number} width - The width of the viewport. - * @param {number} height - The height of the viewport. - * - */ - viewport(x: number, y: number, width: number, height: number): void; - /** - * Defines the scissor test. - * - * @param {boolean} boolean - Whether the scissor test should be enabled or not. - */ - setScissorTest(boolean: boolean): void; - /** - * Specifies whether the stencil test is enabled or not. - * - * @param {boolean} stencilTest - Whether the stencil test is enabled or not. - */ - setStencilTest(stencilTest: boolean): void; - /** - * Specifies whether stencil values can be written when rendering - * into a framebuffer or not. - * - * This method caches the state so `gl.stencilMask()` is only - * called when necessary. - * - * @param {boolean} stencilMask - The stencil mask. - */ - setStencilMask(stencilMask: boolean): void; - /** - * Specifies whether the stencil test functions. - * - * This method caches the state so `gl.stencilFunc()` is only - * called when necessary. - * - * @param {number} stencilFunc - The stencil compare function. - * @param {number} stencilRef - The reference value for the stencil test. - * @param {number} stencilMask - A bit-wise mask that is used to AND the reference value and the stored stencil value when the test is done. - */ - setStencilFunc(stencilFunc: number, stencilRef: number, stencilMask: number): void; - /** - * Specifies whether the stencil test operation. - * - * This method caches the state so `gl.stencilOp()` is only - * called when necessary. - * - * @param {number} stencilFail - The function to use when the stencil test fails. - * @param {number} stencilZFail - The function to use when the stencil test passes, but the depth test fail. - * @param {number} stencilZPass - The function to use when both the stencil test and the depth test pass, - * or when the stencil test passes and there is no depth buffer or depth testing is disabled. - */ - setStencilOp(stencilFail: number, stencilZFail: number, stencilZPass: number): void; - /** - * Configures the WebGL state for the given material. - * - * @param {Material} material - The material to configure the state for. - * @param {number} frontFaceCW - Whether the front faces are counter-clockwise or not. - * @param {number} hardwareClippingPlanes - The number of hardware clipping planes. - */ - setMaterial(material: Material, frontFaceCW: number, hardwareClippingPlanes: number): void; - /** - * Specifies the polygon offset. - * - * This method caches the state so `gl.polygonOffset()` is only - * called when necessary. - * - * @param {boolean} polygonOffset - Whether polygon offset is enabled or not. - * @param {number} factor - The scale factor for the variable depth offset for each polygon. - * @param {number} units - The multiplier by which an implementation-specific value is multiplied with to create a constant depth offset. - */ - setPolygonOffset(polygonOffset: boolean, factor: number, units: number): void; - /** - * Defines the usage of the given WebGL program. - * - * This method caches the state so `gl.useProgram()` is only - * called when necessary. - * - * @param {WebGLProgram} program - The WebGL program to use. - * @return {boolean} Whether a program change has been executed or not. - */ - useProgram(program: WebGLProgram): boolean; - /** - * Sets the vertex state by binding the given VAO and element buffer. - * - * @param {WebGLVertexArrayObject} vao - The VAO. - * @param {?WebGLBuffer} indexBuffer - The index buffer. - * @return {boolean} Whether a vertex state has been changed or not. - */ - setVertexState(vao: WebGLVertexArrayObject, indexBuffer?: WebGLBuffer | null): boolean; - /** - * Resets the vertex array state by resetting the VAO and element buffer. - */ - resetVertexState(): void; - /** - * Binds the given framebuffer. - * - * This method caches the state so `gl.bindFramebuffer()` is only - * called when necessary. - * - * @param {number} target - The binding point (target). - * @param {WebGLFramebuffer} framebuffer - The WebGL framebuffer to bind. - * @return {boolean} Whether a bind has been executed or not. - */ - bindFramebuffer(target: number, framebuffer: WebGLFramebuffer): boolean; - /** - * Defines draw buffers to which fragment colors are written into. - * Configures the MRT setup of custom framebuffers. - * - * This method caches the state so `gl.drawBuffers()` is only - * called when necessary. - * - * @param {RenderContext} renderContext - The render context. - * @param {WebGLFramebuffer} framebuffer - The WebGL framebuffer. - */ - drawBuffers(renderContext: RenderContext, framebuffer: WebGLFramebuffer): void; - /** - * Makes the given texture unit active. - * - * This method caches the state so `gl.activeTexture()` is only - * called when necessary. - * - * @param {number} webglSlot - The texture unit to make active. - */ - activeTexture(webglSlot: number): void; - /** - * Binds the given WebGL texture to a target. - * - * This method caches the state so `gl.bindTexture()` is only - * called when necessary. - * - * @param {number} webglType - The binding point (target). - * @param {WebGLTexture} webglTexture - The WebGL texture to bind. - * @param {number} webglSlot - The texture. - */ - bindTexture(webglType: number, webglTexture: WebGLTexture, webglSlot: number): void; - /** - * Binds a given WebGL buffer to a given binding point (target) at a given index. - * - * This method caches the state so `gl.bindBufferBase()` is only - * called when necessary. - * - * @param {number} target - The target for the bind operation. - * @param {number} index - The index of the target. - * @param {WebGLBuffer} buffer - The WebGL buffer. - * @return {boolean} Whether a bind has been executed or not. - */ - bindBufferBase(target: number, index: number, buffer: WebGLBuffer): boolean; - /** - * Unbinds the current bound texture. - * - * This method caches the state so `gl.bindTexture()` is only - * called when necessary. - */ - unbindTexture(): void; - /** - * Returns the value for the given parameter. - * - * @param {number} name - The paramter to get the value for. - * @return {any} The value for the given parameter. - */ - getParameter(name: number): any; - /** - * Specifies a pixel storage mode. - * - * @param {number} name - The parameter to set. - * @param {any} value - A value to set the parameter to. - */ - pixelStorei(name: number, value: any): void; -} -import { Vector4 } from '../../../math/Vector4.js'; diff --git a/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLTextureUtils.d.ts b/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLTextureUtils.d.ts deleted file mode 100644 index 8f8378cc1..000000000 --- a/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLTextureUtils.d.ts +++ /dev/null @@ -1,197 +0,0 @@ -export default WebGLTextureUtils; -/** - * A WebGL 2 backend utility module for managing textures. - * - * @private - */ -declare class WebGLTextureUtils { - /** - * Constructs a new utility object. - * - * @param {WebGLBackend} backend - The WebGL 2 backend. - */ - constructor(backend: WebGLBackend); - /** - * A reference to the WebGL 2 backend. - * - * @type {WebGLBackend} - */ - backend: WebGLBackend; - /** - * A reference to the rendering context. - * - * @type {WebGL2RenderingContext} - */ - gl: WebGL2RenderingContext; - /** - * A reference to a backend module holding extension-related - * utility functions. - * - * @type {WebGLExtensions} - */ - extensions: WebGLExtensions; - /** - * A dictionary for managing default textures. The key - * is the binding point (target), the value the WEbGL texture object. - * - * @type {Object} - */ - defaultTextures: any; - /** - * A scratch framebuffer used for attaching the source texture in - * {@link copyTextureToTexture}. - * - * @private - * @type {?WebGLFramebuffer} - */ - private _srcFramebuffer; - /** - * A scratch framebuffer used for attaching the destination texture in - * {@link copyTextureToTexture}. - * - * @private - * @type {?WebGLFramebuffer} - */ - private _dstFramebuffer; - /** - * Inits the state of the utility. - * - * @private - */ - private _init; - /** - * Returns the native texture type for the given texture. - * - * @param {Texture} texture - The texture. - * @return {GLenum} The native texture type. - */ - getGLTextureType(texture: Texture): GLenum; - /** - * Returns the native texture type for the given texture. - * - * @param {?string} internalFormatName - The internal format name. When `null`, the internal format is derived from the subsequent parameters. - * @param {GLenum} glFormat - The WebGL format. - * @param {GLenum} glType - The WebGL type. - * @param {string} colorSpace - The texture's color space. - * @param {boolean} [forceLinearTransfer=false] - Whether to force a linear transfer or not. - * @return {GLenum} The internal format. - */ - getInternalFormat(internalFormatName: string | null, glFormat: GLenum, glType: GLenum, colorSpace: string, forceLinearTransfer?: boolean): GLenum; - /** - * Sets the texture parameters for the given texture. - * - * @param {GLenum} textureType - The texture type. - * @param {Texture} texture - The texture. - */ - setTextureParameters(textureType: GLenum, texture: Texture): void; - /** - * Creates a default texture for the given texture that can be used - * as a placeholder until the actual texture is ready for usage. - * - * @param {Texture} texture - The texture to create a default texture for. - */ - createDefaultTexture(texture: Texture): void; - /** - * Defines a texture on the GPU for the given texture object. - * - * @param {Texture} texture - The texture. - * @param {Object} [options={}] - Optional configuration parameter. - * @return {undefined} - */ - createTexture(texture: Texture, options?: Object): undefined; - /** - * Uploads texture buffer data to the GPU memory. - * - * @param {WebGLBuffer} buffer - The buffer data. - * @param {Texture} texture - The texture, - */ - copyBufferToTexture(buffer: WebGLBuffer, texture: Texture): void; - /** - * Uploads the updated texture data to the GPU. - * - * @param {Texture} texture - The texture. - * @param {Object} [options={}] - Optional configuration parameter. - */ - updateTexture(texture: Texture, options?: Object): void; - /** - * Generates mipmaps for the given texture. - * - * @param {Texture} texture - The texture. - */ - generateMipmaps(texture: Texture): void; - /** - * Deallocates the render buffers of the given render target. - * - * @param {RenderTarget} renderTarget - The render target. - */ - deallocateRenderBuffers(renderTarget: RenderTarget): void; - /** - * Destroys the GPU data for the given texture object. - * - * @param {Texture} texture - The texture. - * @param {boolean} [isDefaultTexture=false] - Whether the texture uses a default GPU texture or not. - */ - destroyTexture(texture: Texture, isDefaultTexture?: boolean): void; - /** - * Copies data of the given source texture to the given destination texture. - * - * @param {Texture} srcTexture - The source texture. - * @param {Texture} dstTexture - The destination texture. - * @param {?(Box3|Box2)} [srcRegion=null] - The region of the source texture to copy. - * @param {?(Vector2|Vector3)} [dstPosition=null] - The destination position of the copy. - * @param {number} [srcLevel=0] - The source mip level to copy from. - * @param {number} [dstLevel=0] - The destination mip level to copy to. - */ - copyTextureToTexture(srcTexture: Texture, dstTexture: Texture, srcRegion?: (Box3 | Box2) | null, dstPosition?: (Vector2 | Vector3) | null, srcLevel?: number, dstLevel?: number): void; - /** - * Copies the current bound framebuffer to the given texture. - * - * @param {Texture} texture - The destination texture. - * @param {RenderContext} renderContext - The render context. - * @param {Vector4} rectangle - A four dimensional vector defining the origin and dimension of the copy. - */ - copyFramebufferToTexture(texture: Texture, renderContext: RenderContext, rectangle: Vector4): void; - /** - * SetupS storage for internal depth/stencil buffers and bind to correct framebuffer. - * - * @param {WebGLRenderbuffer} renderbuffer - The render buffer. - * @param {RenderContext} renderContext - The render context. - * @param {number} samples - The MSAA sample count. - * @param {boolean} [useMultisampledRTT=false] - Whether to use WEBGL_multisampled_render_to_texture or not. - */ - setupRenderBufferStorage(renderbuffer: WebGLRenderbuffer, renderContext: RenderContext, samples: number, useMultisampledRTT?: boolean): void; - /** - * Returns texture data as a typed array. - * - * @async - * @param {Texture} texture - The texture to copy. - * @param {number} x - The x coordinate of the copy origin. - * @param {number} y - The y coordinate of the copy origin. - * @param {number} width - The width of the copy. - * @param {number} height - The height of the copy. - * @param {number} faceIndex - The face index. - * @return {Promise} A Promise that resolves with a typed array when the copy operation has finished. - */ - copyTextureToBuffer(texture: Texture, x: number, y: number, width: number, height: number, faceIndex: number): Promise; - /** - * Returns the corresponding typed array type for the given WebGL data type. - * - * @private - * @param {GLenum} glType - The WebGL data type. - * @return {TypedArray.constructor} The typed array type. - */ - private _getTypedArrayType; - /** - * Returns the bytes-per-texel value for the given WebGL data type and texture format. - * - * @private - * @param {GLenum} glType - The WebGL data type. - * @param {GLenum} glFormat - The WebGL texture format. - * @return {number} The bytes-per-texel. - */ - private _getBytesPerTexel; - /** - * Frees the internal resources. - */ - dispose(): void; -} diff --git a/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.d.ts b/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.d.ts deleted file mode 100644 index c6a325c47..000000000 --- a/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.d.ts +++ /dev/null @@ -1,58 +0,0 @@ -export default WebGLTimestampQueryPool; -/** - * Manages a pool of WebGL timestamp queries for performance measurement. - * Handles creation, execution, and resolution of timer queries using WebGL extensions. - * - * @augments TimestampQueryPool - */ -declare class WebGLTimestampQueryPool extends TimestampQueryPool { - /** - * Creates a new WebGL timestamp query pool. - * - * @param {WebGLRenderingContext|WebGL2RenderingContext} gl - The WebGL context. - * @param {string} type - The type identifier for this query pool. - * @param {number} [maxQueries=2048] - Maximum number of queries this pool can hold. - */ - constructor(gl: WebGLRenderingContext | WebGL2RenderingContext, type: string, maxQueries?: number); - gl: WebGLRenderingContext | WebGL2RenderingContext; - type: string; - ext: any; - queries: any[] | undefined; - activeQuery: number | null; - queryStates: Map | undefined; - /** - * Allocates a pair of queries for a given render context. - * - * @param {string} uid - A unique identifier for the render context. - * @returns {?number} The base offset for the allocated queries, or null if allocation failed. - */ - allocateQueriesForContext(uid: string): number | null; - /** - * Begins a timestamp query for the specified render context. - * - * @param {string} uid - A unique identifier for the render context. - */ - beginQuery(uid: string): void; - /** - * Ends the active timestamp query for the specified render context. - * - * @param {string} uid - A unique identifier for the render context. - */ - endQuery(uid: string): void; - /** - * Asynchronously resolves all completed queries and returns the total duration. - * - * @async - * @returns {Promise} The total duration in milliseconds, or the last valid value if resolution fails. - */ - resolveQueriesAsync(): Promise; - /** - * Resolves a single query, checking for completion and disjoint operation. - * - * @async - * @param {WebGLQuery} query - The query object to resolve. - * @returns {Promise} The elapsed time in milliseconds. - */ - resolveQuery(query: WebGLQuery): Promise; -} -import TimestampQueryPool from '../../common/TimestampQueryPool.js'; diff --git a/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLUtils.d.ts b/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLUtils.d.ts deleted file mode 100644 index 1f75ec7e8..000000000 --- a/jsdoc-testing/jsdoc/renderers/webgl-fallback/utils/WebGLUtils.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -export default WebGLUtils; -/** - * A WebGL 2 backend utility module with common helpers. - * - * @private - */ -declare class WebGLUtils { - /** - * Constructs a new utility object. - * - * @param {WebGLBackend} backend - The WebGL 2 backend. - */ - constructor(backend: WebGLBackend); - /** - * A reference to the WebGL 2 backend. - * - * @type {WebGLBackend} - */ - backend: WebGLBackend; - /** - * A reference to the rendering context. - * - * @type {WebGL2RenderingContext} - */ - gl: WebGL2RenderingContext; - /** - * A reference to a backend module holding extension-related - * utility functions. - * - * @type {WebGLExtensions} - */ - extensions: WebGLExtensions; - /** - * Converts the given three.js constant into a WebGL constant. - * The method currently supports the conversion of texture formats - * and types. - * - * @param {number} p - The three.js constant. - * @param {string} [colorSpace=NoColorSpace] - The color space. - * @return {?number} The corresponding WebGL constant. - */ - convert(p: number, colorSpace?: string): number | null; - /** - * This method can be used to synchronize the CPU with the GPU by waiting until - * ongoing GPU commands have been completed. - * - * @private - * @return {Promise} A promise that resolves when all ongoing GPU commands have been completed. - */ - private _clientWaitAsync; -} diff --git a/jsdoc-testing/jsdoc/renderers/webgpu/WebGPUBackend.d.ts b/jsdoc-testing/jsdoc/renderers/webgpu/WebGPUBackend.d.ts deleted file mode 100644 index 15058f911..000000000 --- a/jsdoc-testing/jsdoc/renderers/webgpu/WebGPUBackend.d.ts +++ /dev/null @@ -1,537 +0,0 @@ -export default WebGPUBackend; -/** - * A backend implementation targeting WebGPU. - * - * @private - * @augments Backend - */ -declare class WebGPUBackend extends Backend { - /** - * WebGPUBackend options. - * - * @typedef {Object} WebGPUBackend~Options - * @property {boolean} [logarithmicDepthBuffer=false] - Whether logarithmic depth buffer is enabled or not. - * @property {boolean} [reversedDepthBuffer=false] - Whether reversed depth buffer is enabled or not. - * @property {boolean} [alpha=true] - Whether the default framebuffer (which represents the final contents of the canvas) should be transparent or opaque. - * @property {boolean} [depth=true] - Whether the default framebuffer should have a depth buffer or not. - * @property {boolean} [stencil=false] - Whether the default framebuffer should have a stencil buffer or not. - * @property {boolean} [antialias=false] - Whether MSAA as the default anti-aliasing should be enabled or not. - * @property {number} [samples=0] - When `antialias` is `true`, `4` samples are used by default. Set this parameter to any other integer value than 0 to overwrite the default. - * @property {boolean} [forceWebGL=false] - If set to `true`, the renderer uses a WebGL 2 backend no matter if WebGPU is supported or not. - * @property {boolean} [trackTimestamp=false] - Whether to track timestamps with a Timestamp Query API or not. - * @property {string} [powerPreference=undefined] - The power preference. - * @property {Object} [requiredLimits=undefined] - Specifies the limits that are required by the device request. The request will fail if the adapter cannot provide these limits. - * @property {GPUDevice} [device=undefined] - If there is an existing GPU device on app level, it can be passed to the renderer as a parameter. - * @property {number} [outputType=undefined] - Texture type for output to canvas. By default, device's preferred format is used; other formats may incur overhead. - */ - /** - * Constructs a new WebGPU backend. - * - * @param {WebGPUBackend~Options} [parameters] - The configuration parameter. - */ - constructor(parameters?: {}); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isWebGPUBackend: boolean; - /** - * Indicates whether the backend is in WebGPU compatibility mode or not. - * The backend must be initialized before the property can be evaluated. - * - * @type {?boolean} - * @readonly - * @default null - */ - readonly compatibilityMode: boolean | null; - /** - * A reference to the device. - * - * @type {?GPUDevice} - * @default null - */ - device: GPUDevice | null; - /** - * A reference to the default render pass descriptor. - * - * @type {?Object} - * @default null - */ - defaultRenderPassdescriptor: Object | null; - /** - * A reference to a backend module holding common utility functions. - * - * @type {WebGPUUtils} - */ - utils: WebGPUUtils; - /** - * A reference to a backend module holding shader attribute-related - * utility functions. - * - * @type {WebGPUAttributeUtils} - */ - attributeUtils: WebGPUAttributeUtils; - /** - * A reference to a backend module holding shader binding-related - * utility functions. - * - * @type {WebGPUBindingUtils} - */ - bindingUtils: WebGPUBindingUtils; - /** - * A reference to a backend module holding device capability related - * utility functions. - * - * @type {WebGPUCapabilities} - */ - capabilities: WebGPUCapabilities; - /** - * A reference to a backend module holding shader pipeline-related - * utility functions. - * - * @type {WebGPUPipelineUtils} - */ - pipelineUtils: WebGPUPipelineUtils; - /** - * A reference to a backend module holding shader texture-related - * utility functions. - * - * @type {WebGPUTextureUtils} - */ - textureUtils: WebGPUTextureUtils; - /** - * A map that manages the resolve buffers for occlusion queries. - * - * @type {Map} - */ - occludedResolveCache: Map; - /** - * A map of compatibility checks. - * - * @type {Object} - */ - _compatibility: Object; - /** - * A reference to the context. - * - * @type {?GPUCanvasContext} - * @default null - */ - get context(): GPUCanvasContext | null; - /** - * This method performs a readback operation by moving buffer data from - * a storage buffer attribute from the GPU to the CPU. - * - * @async - * @param {StorageBufferAttribute} attribute - The storage buffer attribute. - * @return {Promise} A promise that resolves with the buffer data when the data are ready. - */ - getArrayBufferAsync(attribute: StorageBufferAttribute): Promise; - /** - * Returns the backend's rendering context. - * - * @return {GPUCanvasContext} The rendering context. - */ - getContext(): GPUCanvasContext; - /** - * Returns the default render pass descriptor. - * - * In WebGPU, the default framebuffer must be configured - * like custom framebuffers so the backend needs a render - * pass descriptor even when rendering directly to screen. - * - * @private - * @return {Object} The render pass descriptor. - */ - private _getDefaultRenderPassDescriptor; - /** - * Internal to determine if the current render target is a render target array with depth 2D array texture. - * - * @param {RenderContext} renderContext - The render context. - * @return {boolean} Whether the render target is a render target array with depth 2D array texture. - * - * @private - */ - private _isRenderCameraDepthArray; - /** - * Returns the render pass descriptor for the given render context. - * - * @private - * @param {RenderContext} renderContext - The render context. - * @param {Object} colorAttachmentsConfig - Configuration object for the color attachments. - * @return {Object} The render pass descriptor. - */ - private _getRenderPassDescriptor; - /** - * This method is executed at the beginning of a render call and prepares - * the WebGPU state for upcoming render calls - * - * @param {RenderContext} renderContext - The render context. - */ - beginRender(renderContext: RenderContext): void; - /** - * This method creates layer descriptors for each camera in an array camera - * to prepare for rendering to a depth array texture. - * - * @param {RenderContext} renderContext - The render context. - * @param {Object} renderContextData - The render context data. - * @param {Object} descriptor - The render pass descriptor. - * @param {ArrayCamera} cameras - The array camera. - * - * @private - */ - private _createDepthLayerDescriptors; - /** - * This method updates the layer descriptors for each camera in an array camera - * to prepare for rendering to a depth array texture. - * - * @param {RenderContext} renderContext - The render context. - * @param {Object} renderContextData - The render context data. - * @param {ArrayCamera} cameras - The array camera. - * - */ - _updateDepthLayerDescriptors(renderContext: RenderContext, renderContextData: Object, cameras: ArrayCamera): void; - /** - * This method is executed at the end of a render call and finalizes work - * after draw calls. - * - * @param {RenderContext} renderContext - The render context. - */ - finishRender(renderContext: RenderContext): void; - /** - * Returns `true` if the given 3D object is fully occluded by other - * 3D objects in the scene. - * - * @param {RenderContext} renderContext - The render context. - * @param {Object3D} object - The 3D object to test. - * @return {boolean} Whether the 3D object is fully occluded or not. - */ - isOccluded(renderContext: RenderContext, object: Object3D): boolean; - /** - * This method processes the result of occlusion queries and writes it - * into render context data. - * - * @async - * @param {RenderContext} renderContext - The render context. - * @return {Promise} A Promise that resolves when the occlusion query results have been processed. - */ - resolveOccludedAsync(renderContext: RenderContext): Promise; - /** - * Updates the viewport with the values from the given render context. - * - * @param {RenderContext} renderContext - The render context. - */ - updateViewport(renderContext: RenderContext): void; - /** - * Updates the scissor with the values from the given render context. - * - * @param {RenderContext} renderContext - The render context. - */ - updateScissor(renderContext: RenderContext): void; - /** - * Returns the clear color and alpha into a single - * color object. - * - * @return {Color4} The clear color. - */ - getClearColor(): Color4; - /** - * Performs a clear operation. - * - * @param {boolean} color - Whether the color buffer should be cleared or not. - * @param {boolean} depth - Whether the depth buffer should be cleared or not. - * @param {boolean} stencil - Whether the stencil buffer should be cleared or not. - * @param {?RenderContext} [renderTargetContext=null] - The render context of the current set render target. - */ - clear(color: boolean, depth: boolean, stencil: boolean, renderTargetContext?: RenderContext | null): void; - /** - * This method is executed at the beginning of a compute call and - * prepares the state for upcoming compute tasks. - * - * @param {Node|Array} computeGroup - The compute node(s). - */ - beginCompute(computeGroup: Node | Array): void; - /** - * Executes a compute command for the given compute node. - * - * @param {Node|Array} computeGroup - The group of compute nodes of a compute call. Can be a single compute node. - * @param {Node} computeNode - The compute node. - * @param {Array} bindings - The bindings. - * @param {ComputePipeline} pipeline - The compute pipeline. - * @param {number|Array|IndirectStorageBufferAttribute} [dispatchSize=null] - * - A single number representing count, or - * - An array [x, y, z] representing dispatch size, or - * - A IndirectStorageBufferAttribute for indirect dispatch size. - */ - compute(computeGroup: Node | Array, computeNode: Node, bindings: Array, pipeline: ComputePipeline, dispatchSize?: number | Array | IndirectStorageBufferAttribute): void; - /** - * This method is executed at the end of a compute call and - * finalizes work after compute tasks. - * - * @param {Node|Array} computeGroup - The compute node(s). - */ - finishCompute(computeGroup: Node | Array): void; - /** - * Internal draw function that performs the draw with the given pass encoder. - * - * @private - * @param {RenderObject} renderObject - The render object. - * @param {Info} info - Holds a series of statistical information about the GPU memory and the rendering process. - * @param {Object} renderContextData - The render context data object, holding current pass state and occlusion query tracking. - * @param {GPURenderPipeline} pipelineGPU - The GPU render pipeline. - * @param {Array} bindings - The bind groups. - * @param {Array} vertexBuffers - The vertex buffers. - * @param {{vertexCount: number, firstVertex: number, instanceCount: number, firstInstance: number}} drawParams - The draw parameters. - * @param {GPURenderPassEncoder|GPURenderBundleEncoder} passEncoderGPU - The GPU pass encoder used for recording draw commands. - * @param {Object} currentSets - Tracking object for currently set pipeline, attributes, bind groups, and index state. - */ - private _draw; - /** - * Executes a draw command for the given render object. - * - * @param {RenderObject} renderObject - The render object to draw. - * @param {Info} info - Holds a series of statistical information about the GPU memory and the rendering process. - */ - draw(renderObject: RenderObject, info: Info): void; - /** - * Returns `true` if the render pipeline requires an update. - * - * @param {RenderObject} renderObject - The render object. - * @return {boolean} Whether the render pipeline requires an update or not. - */ - needsRenderUpdate(renderObject: RenderObject): boolean; - /** - * Returns a cache key that is used to identify render pipelines. - * - * @param {RenderObject} renderObject - The render object. - * @return {string} The cache key. - */ - getRenderCacheKey(renderObject: RenderObject): string; - /** - * Updates a GPU sampler for the given texture. - * - * @param {Texture} texture - The texture to update the sampler for. - * @return {string} The current sampler key. - */ - updateSampler(texture: Texture): string; - /** - * Creates a default texture for the given texture that can be used - * as a placeholder until the actual texture is ready for usage. - * - * @param {Texture} texture - The texture to create a default texture for. - * @return {boolean} Whether the sampler has been updated or not. - */ - createDefaultTexture(texture: Texture): boolean; - /** - * Defines a texture on the GPU for the given texture object. - * - * @param {Texture} texture - The texture. - * @param {Object} [options={}] - Optional configuration parameter. - */ - createTexture(texture: Texture, options?: Object): void; - /** - * Uploads the updated texture data to the GPU. - * - * @param {Texture} texture - The texture. - * @param {Object} [options={}] - Optional configuration parameter. - */ - updateTexture(texture: Texture, options?: Object): void; - /** - * Generates mipmaps for the given texture. - * - * @param {Texture} texture - The texture. - */ - generateMipmaps(texture: Texture): void; - /** - * Destroys the GPU data for the given texture object. - * - * @param {Texture} texture - The texture. - * @param {boolean} [isDefaultTexture=false] - Whether the texture uses a default GPU texture or not. - */ - destroyTexture(texture: Texture, isDefaultTexture?: boolean): void; - /** - * Returns texture data as a typed array. - * - * @async - * @param {Texture} texture - The texture to copy. - * @param {number} x - The x coordinate of the copy origin. - * @param {number} y - The y coordinate of the copy origin. - * @param {number} width - The width of the copy. - * @param {number} height - The height of the copy. - * @param {number} faceIndex - The face index. - * @return {Promise} A Promise that resolves with a typed array when the copy operation has finished. - */ - copyTextureToBuffer(texture: Texture, x: number, y: number, width: number, height: number, faceIndex: number): Promise; - /** - * Inits a time stamp query for the given render context. - * - * @param {string} type - The type of the timestamp query (e.g. 'render', 'compute'). - * @param {number} uid - Unique id for the context (e.g. render context id). - * @param {Object} descriptor - The query descriptor. - */ - initTimestampQuery(type: string, uid: number, descriptor: Object): void; - /** - * Returns a node builder for the given render object. - * - * @param {RenderObject} object - The render object. - * @param {Renderer} renderer - The renderer. - * @return {WGSLNodeBuilder} The node builder. - */ - createNodeBuilder(object: RenderObject, renderer: Renderer): WGSLNodeBuilder; - /** - * Creates a shader program from the given programmable stage. - * - * @param {ProgrammableStage} program - The programmable stage. - */ - createProgram(program: ProgrammableStage): void; - /** - * Destroys the shader program of the given programmable stage. - * - * @param {ProgrammableStage} program - The programmable stage. - */ - destroyProgram(program: ProgrammableStage): void; - /** - * Creates a render pipeline for the given render object. - * - * @param {RenderObject} renderObject - The render object. - * @param {Array} promises - An array of compilation promises which are used in `compileAsync()`. - */ - createRenderPipeline(renderObject: RenderObject, promises: Array>): void; - /** - * Creates a compute pipeline for the given compute node. - * - * @param {ComputePipeline} computePipeline - The compute pipeline. - * @param {Array} bindings - The bindings. - */ - createComputePipeline(computePipeline: ComputePipeline, bindings: Array): void; - /** - * Prepares the state for encoding render bundles. - * - * @param {RenderContext} renderContext - The render context. - */ - beginBundle(renderContext: RenderContext): void; - /** - * After processing render bundles this method finalizes related work. - * - * @param {RenderContext} renderContext - The render context. - * @param {RenderBundle} bundle - The render bundle. - */ - finishBundle(renderContext: RenderContext, bundle: RenderBundle): void; - /** - * Adds a render bundle to the render context data. - * - * @param {RenderContext} renderContext - The render context. - * @param {RenderBundle} bundle - The render bundle to add. - */ - addBundle(renderContext: RenderContext, bundle: RenderBundle): void; - /** - * Creates bindings from the given bind group definition. - * - * @param {BindGroup} bindGroup - The bind group. - * @param {Array} bindings - Array of bind groups. - * @param {number} cacheIndex - The cache index. - * @param {number} version - The version. - */ - createBindings(bindGroup: BindGroup, bindings: Array, cacheIndex: number, version: number): void; - /** - * Updates the given bind group definition. - * - * @param {BindGroup} bindGroup - The bind group. - * @param {Array} bindings - Array of bind groups. - * @param {number} cacheIndex - The cache index. - * @param {number} version - The version. - */ - updateBindings(bindGroup: BindGroup, bindings: Array, cacheIndex: number, version: number): void; - /** - * Updates a buffer binding. - * - * @param {Buffer} binding - The buffer binding to update. - */ - updateBinding(binding: Buffer): void; - /** - * Delete data associated with the current bind group. - * - * @param {BindGroup} bindGroup - The bind group. - */ - deleteBindGroupData(bindGroup: BindGroup): void; - /** - * Creates the buffer of an indexed shader attribute. - * - * @param {BufferAttribute} attribute - The indexed buffer attribute. - */ - createIndexAttribute(attribute: BufferAttribute): void; - /** - * Creates the GPU buffer of a shader attribute. - * - * @param {BufferAttribute} attribute - The buffer attribute. - */ - createAttribute(attribute: BufferAttribute): void; - /** - * Creates the GPU buffer of a storage attribute. - * - * @param {BufferAttribute} attribute - The buffer attribute. - */ - createStorageAttribute(attribute: BufferAttribute): void; - /** - * Creates the GPU buffer of an indirect storage attribute. - * - * @param {BufferAttribute} attribute - The buffer attribute. - */ - createIndirectStorageAttribute(attribute: BufferAttribute): void; - /** - * Updates the GPU buffer of a shader attribute. - * - * @param {BufferAttribute} attribute - The buffer attribute to update. - */ - updateAttribute(attribute: BufferAttribute): void; - /** - * Destroys the GPU buffer of a shader attribute. - * - * @param {BufferAttribute} attribute - The buffer attribute to destroy. - */ - destroyAttribute(attribute: BufferAttribute): void; - /** - * Checks if the given feature is supported by the backend. - * - * @param {string} name - The feature's name. - * @return {boolean} Whether the feature is supported or not. - */ - hasFeature(name: string): boolean; - /** - * Copies data of the given source texture to the given destination texture. - * - * @param {Texture} srcTexture - The source texture. - * @param {Texture} dstTexture - The destination texture. - * @param {?(Box3|Box2)} [srcRegion=null] - The region of the source texture to copy. - * @param {?(Vector2|Vector3)} [dstPosition=null] - The destination position of the copy. - * @param {number} [srcLevel=0] - The mipmap level to copy. - * @param {number} [dstLevel=0] - The destination mip level to copy to. - */ - copyTextureToTexture(srcTexture: Texture, dstTexture: Texture, srcRegion?: (Box3 | Box2) | null, dstPosition?: (Vector2 | Vector3) | null, srcLevel?: number, dstLevel?: number): void; - /** - * Copies the current bound framebuffer to the given texture. - * - * @param {Texture} texture - The destination texture. - * @param {RenderContext} renderContext - The render context. - * @param {Vector4} rectangle - A four dimensional vector defining the origin and dimension of the copy. - */ - copyFramebufferToTexture(texture: Texture, renderContext: RenderContext, rectangle: Vector4): void; - /** - * Checks if the given compatibility is supported by the backend. - * - * @param {string} name - The compatibility name. - * @return {boolean} Whether the compatibility is supported or not. - */ - hasCompatibility(name: string): boolean; -} -import Backend from '../common/Backend.js'; -import WebGPUUtils from './utils/WebGPUUtils.js'; -import WebGPUAttributeUtils from './utils/WebGPUAttributeUtils.js'; -import WebGPUBindingUtils from './utils/WebGPUBindingUtils.js'; -import WebGPUCapabilities from './utils/WebGPUCapabilities.js'; -import WebGPUPipelineUtils from './utils/WebGPUPipelineUtils.js'; -import WebGPUTextureUtils from './utils/WebGPUTextureUtils.js'; -import WGSLNodeBuilder from './nodes/WGSLNodeBuilder.js'; diff --git a/jsdoc-testing/jsdoc/renderers/webgpu/WebGPURenderer.Nodes.d.ts b/jsdoc-testing/jsdoc/renderers/webgpu/WebGPURenderer.Nodes.d.ts deleted file mode 100644 index dfbe8d022..000000000 --- a/jsdoc-testing/jsdoc/renderers/webgpu/WebGPURenderer.Nodes.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -export default WebGPURenderer; -/** - * This alternative version of {@link WebGPURenderer} only supports node materials. - * So classes like `MeshBasicMaterial` are not compatible. - * - * @private - * @augments Renderer - */ -declare class WebGPURenderer extends Renderer { - /** - * Constructs a new WebGPU renderer. - * - * @param {WebGPURenderer~Options} [parameters] - The configuration parameter. - */ - constructor(parameters?: {}); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isWebGPURenderer: boolean; -} -import Renderer from '../common/Renderer.js'; diff --git a/jsdoc-testing/jsdoc/renderers/webgpu/WebGPURenderer.d.ts b/jsdoc-testing/jsdoc/renderers/webgpu/WebGPURenderer.d.ts deleted file mode 100644 index 546c6744b..000000000 --- a/jsdoc-testing/jsdoc/renderers/webgpu/WebGPURenderer.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -export default WebGPURenderer; -/** - * This renderer is the new alternative of `WebGLRenderer`. `WebGPURenderer` has the ability - * to target different backends. By default, the renderer tries to use a WebGPU backend if the - * browser supports WebGPU. If not, `WebGPURenderer` falls backs to a WebGL 2 backend. - * - * @augments Renderer - */ -declare class WebGPURenderer extends Renderer { - /** - * WebGPURenderer options. - * - * @typedef {Object} WebGPURenderer~Options - * @property {boolean} [logarithmicDepthBuffer=false] - Whether logarithmic depth buffer is enabled or not. - * @property {boolean} [reversedDepthBuffer=false] - Whether reversed depth buffer is enabled or not. - * @property {boolean} [alpha=true] - Whether the default framebuffer (which represents the final contents of the canvas) should be transparent or opaque. - * @property {boolean} [depth=true] - Whether the default framebuffer should have a depth buffer or not. - * @property {boolean} [stencil=false] - Whether the default framebuffer should have a stencil buffer or not. - * @property {boolean} [antialias=false] - Whether MSAA as the default anti-aliasing should be enabled or not. - * @property {number} [samples=0] - When `antialias` is `true`, `4` samples are used by default. Set this parameter to any other integer value than 0 to overwrite the default. - * @property {boolean} [forceWebGL=false] - If set to `true`, the renderer uses a WebGL 2 backend no matter if WebGPU is supported or not. - * @property {boolean} [multiview=false] - If set to `true`, the renderer will use multiview during WebXR rendering if supported. - * @property {number} [outputType=undefined] - Texture type for output to canvas. By default, device's preferred format is used; other formats may incur overhead. - * @property {number} [outputBufferType=HalfFloatType] - Defines the type of output buffers. The default `HalfFloatType` is recommend for best - * quality. To save memory and bandwidth, `UnsignedByteType` might be used. This will reduce rendering quality though. - */ - /** - * Constructs a new WebGPU renderer. - * - * @param {WebGPURenderer~Options} [parameters] - The configuration parameter. - */ - constructor(parameters?: {}); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isWebGPURenderer: boolean; -} -import Renderer from '../common/Renderer.js'; diff --git a/jsdoc-testing/jsdoc/renderers/webgpu/nodes/BasicNodeLibrary.d.ts b/jsdoc-testing/jsdoc/renderers/webgpu/nodes/BasicNodeLibrary.d.ts deleted file mode 100644 index f6f699f14..000000000 --- a/jsdoc-testing/jsdoc/renderers/webgpu/nodes/BasicNodeLibrary.d.ts +++ /dev/null @@ -1,11 +0,0 @@ -export default BasicNodeLibrary; -/** - * This version of a node library represents a basic version - * just focusing on lights and tone mapping techniques. - * - * @private - * @augments NodeLibrary - */ -declare class BasicNodeLibrary extends NodeLibrary { -} -import NodeLibrary from '../../common/nodes/NodeLibrary.js'; diff --git a/jsdoc-testing/jsdoc/renderers/webgpu/nodes/StandardNodeLibrary.d.ts b/jsdoc-testing/jsdoc/renderers/webgpu/nodes/StandardNodeLibrary.d.ts deleted file mode 100644 index 1d2893798..000000000 --- a/jsdoc-testing/jsdoc/renderers/webgpu/nodes/StandardNodeLibrary.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -export default StandardNodeLibrary; -/** - * This version of a node library represents the standard version - * used in {@link WebGPURenderer}. It maps lights, tone mapping - * techniques and materials to node-based implementations. - * - * @private - * @augments NodeLibrary - */ -declare class StandardNodeLibrary extends NodeLibrary { -} -import NodeLibrary from '../../common/nodes/NodeLibrary.js'; diff --git a/jsdoc-testing/jsdoc/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts b/jsdoc-testing/jsdoc/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts deleted file mode 100644 index 73b4c48ce..000000000 --- a/jsdoc-testing/jsdoc/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts +++ /dev/null @@ -1,590 +0,0 @@ -export default WGSLNodeBuilder; -/** - * A node builder targeting WGSL. - * - * This module generates WGSL shader code from node materials and also - * generates the respective bindings and vertex buffer definitions. These - * data are later used by the renderer to create render and compute pipelines - * for render objects. - * - * @augments NodeBuilder - */ -declare class WGSLNodeBuilder extends NodeBuilder { - /** - * Constructs a new WGSL node builder renderer. - * - * @param {Object3D} object - The 3D object. - * @param {Renderer} renderer - The renderer. - */ - constructor(object: Object3D, renderer: Renderer); - /** - * A dictionary that holds for each shader stage ('vertex', 'fragment', 'compute') - * another dictionary which manages UBOs per group ('render','frame','object'). - * - * @type {Object>} - */ - uniformGroups: { - [x: string]: { - [x: string]: NodeUniformsGroup; - }; - }; - /** - * A dictionary that holds the assigned binding indices for each uniform group. - * This ensures the same binding index is used across all shader stages. - * - * @type {Object} - */ - uniformGroupsBindings: { - [x: string]: { - index: number; - id: number; - }; - }; - /** - * A dictionary that holds for each shader stage a Map of builtins. - * - * @type {Object>} - */ - builtins: { - [x: string]: Map; - }; - /** - * A dictionary that holds for each shader stage a Set of directives. - * - * @type {Object>} - */ - directives: { - [x: string]: Set; - }; - /** - * A map for managing scope arrays. Only relevant for when using - * {@link WorkgroupInfoNode} in context of compute shaders. - * - * @type {Map} - */ - scopedArrays: Map; - /** - * A flag that indicates that early returns are allowed. - * - * @type {boolean} - * @default true - */ - allowEarlyReturns: boolean; - /** - * Generates the WGSL snippet for sampled textures. - * - * @private - * @param {Texture} texture - The texture. - * @param {string} textureProperty - The name of the texture uniform in the shader. - * @param {string} uvSnippet - A WGSL snippet that represents texture coordinates used for sampling. - * @param {?string} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. - * @param {?string} offsetSnippet - A WGSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture. - * @param {string} [shaderStage=this.shaderStage] - The shader stage this code snippet is generated for. - * @return {string} The WGSL snippet. - */ - private _generateTextureSample; - /** - * Generates the WGSL snippet when sampling textures with explicit mip level. - * - * @private - * @param {Texture} texture - The texture. - * @param {string} textureProperty - The name of the texture uniform in the shader. - * @param {string} uvSnippet - A WGSL snippet that represents texture coordinates used for sampling. - * @param {string} levelSnippet - A WGSL snippet that represents the mip level, with level 0 containing a full size version of the texture. - * @param {string} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. - * @param {?string} offsetSnippet - A WGSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture. - * @return {string} The WGSL snippet. - */ - private generateTextureSampleLevel; - /** - * Generates a wrap function used in context of textures. - * - * @param {Texture} texture - The texture to generate the function for. - * @return {string} The name of the generated function. - */ - generateWrapFunction(texture: Texture): string; - /** - * Generates a WGSL variable that holds the texture dimension of the given texture. - * It also returns information about the number of layers (elements) of an arrayed - * texture as well as the cube face count of cube textures. - * - * @param {Texture} texture - The texture to generate the function for. - * @param {string} textureProperty - The name of the video texture uniform in the shader. - * @param {string} levelSnippet - A WGSL snippet that represents the mip level, with level 0 containing a full size version of the texture. - * @return {string} The name of the dimension variable. - */ - generateTextureDimension(texture: Texture, textureProperty: string, levelSnippet: string): string; - /** - * Generates the WGSL snippet for a manual filtered texture. - * - * @param {Texture} texture - The texture. - * @param {string} textureProperty - The name of the texture uniform in the shader. - * @param {string} uvSnippet - A WGSL snippet that represents texture coordinates used for sampling. - * @param {?string} offsetSnippet - A WGSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture. - * @param {string} [levelSnippet='0u'] - A WGSL snippet that represents the mip level, with level 0 containing a full size version of the texture. - * @param {?string} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. - * @return {string} The WGSL snippet. - */ - generateFilteredTexture(texture: Texture, textureProperty: string, uvSnippet: string, offsetSnippet: string | null, levelSnippet?: string, depthSnippet: string | null): string; - /** - * Generates the WGSL snippet for a texture lookup with explicit level-of-detail. - * Since it's a lookup, no sampling or filtering is applied. - * - * @param {Texture} texture - The texture. - * @param {string} textureProperty - The name of the texture uniform in the shader. - * @param {string} uvSnippet - A WGSL snippet that represents texture coordinates used for sampling. - * @param {?string} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. - * @param {?string} offsetSnippet - A WGSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture. - * @param {string} [levelSnippet='0u'] - A WGSL snippet that represents the mip level, with level 0 containing a full size version of the texture. - * @return {string} The WGSL snippet. - */ - generateTextureLod(texture: Texture, textureProperty: string, uvSnippet: string, depthSnippet: string | null, offsetSnippet: string | null, levelSnippet?: string): string; - /** - * Generates the WGSL snippet that reads a single texel from a storage texture. - * - * @param {Texture} texture - The texture. - * @param {string} textureProperty - The name of the texture uniform in the shader. - * @param {string} uvIndexSnippet - A WGSL snippet that represents texture coordinates used for sampling. - * @param {?string} levelSnippet - A WGSL snippet that represents the mip level, with level 0 containing a full size version of the texture. - * @param {?string} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. - * @param {?string} offsetSnippet - A WGSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture. - * @return {string} The WGSL snippet. - */ - generateStorageTextureLoad(texture: Texture, textureProperty: string, uvIndexSnippet: string, levelSnippet: string | null, depthSnippet: string | null, offsetSnippet: string | null): string; - /** - * Generates the WGSL snippet that reads a single texel from a texture without sampling or filtering. - * - * @param {Texture} texture - The texture. - * @param {string} textureProperty - The name of the texture uniform in the shader. - * @param {string} uvIndexSnippet - A WGSL snippet that represents texture coordinates used for sampling. - * @param {?string} levelSnippet - A WGSL snippet that represents the mip level, with level 0 containing a full size version of the texture. - * @param {?string} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. - * @param {?string} offsetSnippet - A WGSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture. - * @return {string} The WGSL snippet. - */ - generateTextureLoad(texture: Texture, textureProperty: string, uvIndexSnippet: string, levelSnippet: string | null, depthSnippet: string | null, offsetSnippet: string | null): string; - /** - * Generates the WGSL snippet that writes a single texel to a texture. - * - * @param {Texture} texture - The texture. - * @param {string} textureProperty - The name of the texture uniform in the shader. - * @param {string} uvIndexSnippet - A WGSL snippet that represents texture coordinates used for sampling. - * @param {?string} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. - * @param {string} valueSnippet - A WGSL snippet that represent the new texel value. - * @return {string} The WGSL snippet. - */ - generateTextureStore(texture: Texture, textureProperty: string, uvIndexSnippet: string, depthSnippet: string | null, valueSnippet: string): string; - /** - * Returns `true` if the sampled values of the given texture should be compared against a reference value. - * - * @param {Texture} texture - The texture. - * @return {boolean} Whether the sampled values of the given texture should be compared against a reference value or not. - */ - isSampleCompare(texture: Texture): boolean; - /** - * Returns `true` if the given texture is unfilterable. - * - * @param {Texture} texture - The texture. - * @return {boolean} Whether the given texture is unfilterable or not. - */ - isUnfilterable(texture: Texture): boolean; - /** - * Generates the WGSL snippet for sampling/loading the given texture. - * - * @param {Texture} texture - The texture. - * @param {string} textureProperty - The name of the texture uniform in the shader. - * @param {string} uvSnippet - A WGSL snippet that represents texture coordinates used for sampling. - * @param {?string} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. - * @param {?string} offsetSnippet - A WGSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture. - * @param {string} [shaderStage=this.shaderStage] - The shader stage this code snippet is generated for. - * @return {string} The WGSL snippet. - */ - generateTexture(texture: Texture, textureProperty: string, uvSnippet: string, depthSnippet: string | null, offsetSnippet: string | null, shaderStage?: string): string; - /** - * Generates the WGSL snippet for sampling/loading the given texture using explicit gradients. - * - * @param {Texture} texture - The texture. - * @param {string} textureProperty - The name of the texture uniform in the shader. - * @param {string} uvSnippet - A WGSL snippet that represents texture coordinates used for sampling. - * @param {Array} gradSnippet - An array holding both gradient WGSL snippets. - * @param {?string} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. - * @param {?string} offsetSnippet - A WGSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture. - * @param {string} [shaderStage=this.shaderStage] - The shader stage this code snippet is generated for. - * @return {string} The WGSL snippet. - */ - generateTextureGrad(texture: Texture, textureProperty: string, uvSnippet: string, gradSnippet: Array, depthSnippet: string | null, offsetSnippet: string | null, shaderStage?: string): string; - /** - * Generates the WGSL snippet for sampling a depth texture and comparing the sampled depth values - * against a reference value. - * - * @param {Texture} texture - The texture. - * @param {string} textureProperty - The name of the texture uniform in the shader. - * @param {string} uvSnippet - A WGSL snippet that represents texture coordinates used for sampling. - * @param {string} compareSnippet - A WGSL snippet that represents the reference value. - * @param {?string} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. - * @param {?string} offsetSnippet - A WGSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture. - * @param {string} [shaderStage=this.shaderStage] - The shader stage this code snippet is generated for. - * @return {string} The WGSL snippet. - */ - generateTextureCompare(texture: Texture, textureProperty: string, uvSnippet: string, compareSnippet: string, depthSnippet: string | null, offsetSnippet: string | null, shaderStage?: string): string; - /** - * Generates the WGSL snippet when sampling textures with explicit mip level. - * - * @param {Texture} texture - The texture. - * @param {string} textureProperty - The name of the texture uniform in the shader. - * @param {string} uvSnippet - A WGSL snippet that represents texture coordinates used for sampling. - * @param {string} levelSnippet - A WGSL snippet that represents the mip level, with level 0 containing a full size version of the texture. - * @param {?string} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. - * @param {?string} offsetSnippet - A WGSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture. - * @param {string} [shaderStage=this.shaderStage] - The shader stage this code snippet is generated for. - * @return {string} The WGSL snippet. - */ - generateTextureLevel(texture: Texture, textureProperty: string, uvSnippet: string, levelSnippet: string, depthSnippet: string | null, offsetSnippet: string | null): string; - /** - * Generates the WGSL snippet when sampling textures with a bias to the mip level. - * - * @param {Texture} texture - The texture. - * @param {string} textureProperty - The name of the texture uniform in the shader. - * @param {string} uvSnippet - A WGSL snippet that represents texture coordinates used for sampling. - * @param {string} biasSnippet - A WGSL snippet that represents the bias to apply to the mip level before sampling. - * @param {?string} depthSnippet - A WGSL snippet that represents 0-based texture array index to sample. - * @param {?string} offsetSnippet - A WGSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture. - * @param {string} [shaderStage=this.shaderStage] - The shader stage this code snippet is generated for. - * @return {string} The WGSL snippet. - */ - generateTextureBias(texture: Texture, textureProperty: string, uvSnippet: string, biasSnippet: string, depthSnippet: string | null, offsetSnippet: string | null, shaderStage?: string): string; - /** - * Returns a WGSL snippet that represents the property name of the given node. - * - * @param {Node} node - The node. - * @param {string} [shaderStage=this.shaderStage] - The shader stage this code snippet is generated for. - * @return {string} The property name. - */ - getPropertyName(node: Node, shaderStage?: string): string; - /** - * Returns the native shader operator name for a given generic name. - * - * @param {string} op - The operator name to resolve. - * @return {?string} The resolved operator name. - */ - getFunctionOperator(op: string): string | null; - /** - * Returns the node access for the given node and shader stage. - * - * @param {StorageTextureNode|StorageBufferNode} node - The storage node. - * @param {string} shaderStage - The shader stage. - * @return {string} The node access. - */ - getNodeAccess(node: StorageTextureNode | StorageBufferNode, shaderStage: string): string; - /** - * Returns A WGSL snippet representing the storage access. - * - * @param {StorageTextureNode|StorageBufferNode} node - The storage node. - * @param {string} shaderStage - The shader stage. - * @return {string} The WGSL snippet representing the storage access. - */ - getStorageAccess(node: StorageTextureNode | StorageBufferNode, shaderStage: string): string; - /** - * This method is one of the more important ones since it's responsible - * for generating a matching binding instance for the given uniform node. - * - * These bindings are later used in the renderer to create bind groups - * and layouts. - * - * @param {UniformNode} node - The uniform node. - * @param {string} type - The node data type. - * @param {string} shaderStage - The shader stage. - * @param {?string} [name=null] - An optional uniform name. - * @return {NodeUniform} The node uniform object. - */ - getUniformFromNode(node: UniformNode, type: string, shaderStage: string, name?: string | null): NodeUniform; - /** - * This method should be used whenever builtins are required in nodes. - * The internal builtins data structure will make sure builtins are - * defined in the WGSL source. - * - * @param {string} name - The builtin name. - * @param {string} property - The property name. - * @param {string} type - The node data type. - * @param {string} [shaderStage=this.shaderStage] - The shader stage this code snippet is generated for. - * @return {string} The property name. - */ - getBuiltin(name: string, property: string, type: string, shaderStage?: string): string; - /** - * Returns `true` if the given builtin is defined in the given shader stage. - * - * @param {string} name - The builtin name. - * @param {string} [shaderStage=this.shaderStage] - The shader stage this code snippet is generated for. - * @return {boolean} Whether the given builtin is defined in the given shader stage or not. - */ - hasBuiltin(name: string, shaderStage?: string): boolean; - /** - * Builds the given shader node. - * - * @param {ShaderNodeInternal} shaderNode - The shader node. - * @return {string} The WGSL function code. - */ - buildFunctionCode(shaderNode: ShaderNodeInternal): string; - /** - * Returns a builtin representing the index of a compute invocation within the scope of a workgroup load. - * - * @return {string} The invocation local index. - */ - getInvocationLocalIndex(): string; - /** - * Returns a builtin representing the size of a subgroup within the current shader. - * - * @return {string} The subgroup size. - */ - getSubgroupSize(): string; - /** - * Returns a builtin representing the index of a compute invocation within the scope of a subgroup. - * - * @return {string} The invocation subgroup index. - */ - getInvocationSubgroupIndex(): string; - /** - * Returns a builtin representing the index of a compute invocation's subgroup within its workgroup. - * - * @return {string} The subgroup index. - */ - getSubgroupIndex(): string; - /** - * Overwritten as a NOP since this method is intended for the WebGL 2 backend. - * - * @return {null} Null. - */ - getDrawIndex(): null; - /** - * Returns the frag depth builtin. - * - * @return {string} The frag depth builtin. - */ - getFragDepth(): string; - /** - * Returns the clip distances builtin. - * - * @return {string} The clip distances builtin. - */ - getClipDistance(): string; - /** - * Enables the given directive for the given shader stage. - * - * @param {string} name - The directive name. - * @param {string} [shaderStage=this.shaderStage] - The shader stage to enable the directive for. - */ - enableDirective(name: string, shaderStage?: string): void; - /** - * Returns the directives of the given shader stage as a WGSL string. - * - * @param {string} shaderStage - The shader stage. - * @return {string} A WGSL snippet that enables the directives of the given stage. - */ - getDirectives(shaderStage: string): string; - /** - * Enables the 'subgroups' directive. - */ - enableSubGroups(): void; - /** - * Enables the 'subgroups-f16' directive. - */ - enableSubgroupsF16(): void; - /** - * Enables the 'clip_distances' directive. - */ - enableClipDistances(): void; - /** - * Enables the 'f16' directive. - */ - enableShaderF16(): void; - /** - * Enables the 'dual_source_blending' directive. - */ - enableDualSourceBlending(): void; - /** - * Enables hardware clipping. - * - * @param {string} planeCount - The clipping plane count. - */ - enableHardwareClipping(planeCount: string): void; - /** - * Returns the builtins of the given shader stage as a WGSL string. - * - * @param {string} shaderStage - The shader stage. - * @return {string} A WGSL snippet that represents the builtins of the given stage. - */ - getBuiltins(shaderStage: string): string; - /** - * This method should be used when a new scoped buffer is used in context of - * compute shaders. It adds the array to the internal data structure which is - * later used to generate the respective WGSL. - * - * @param {string} name - The array name. - * @param {string} scope - The scope. - * @param {string} bufferType - The buffer type. - * @param {string} bufferCount - The buffer count. - * @return {string} The array name. - */ - getScopedArray(name: string, scope: string, bufferType: string, bufferCount: string): string; - /** - * Returns the scoped arrays of the given shader stage as a WGSL string. - * - * @param {string} shaderStage - The shader stage. - * @return {string|undefined} The WGSL snippet that defines the scoped arrays. - * Returns `undefined` when used in the vertex or fragment stage. - */ - getScopedArrays(shaderStage: string): string | undefined; - /** - * Returns the shader attributes of the given shader stage as a WGSL string. - * - * @param {string} shaderStage - The shader stage. - * @return {string} The WGSL snippet that defines the shader attributes. - */ - getAttributes(shaderStage: string): string; - /** - * Returns the members of the given struct type node as a WGSL string. - * - * @param {StructTypeNode} struct - The struct type node. - * @return {string} The WGSL snippet that defines the struct members. - */ - getStructMembers(struct: StructTypeNode): string; - /** - * Returns the structs of the given shader stage as a WGSL string. - * - * @param {string} shaderStage - The shader stage. - * @return {string} The WGSL snippet that defines the structs. - */ - getStructs(shaderStage: string): string; - /** - * Returns the variables of the given shader stage as a WGSL string. - * - * @param {string} shaderStage - The shader stage. - * @return {string} The WGSL snippet that defines the variables. - */ - getVars(shaderStage: string): string; - /** - * Returns the varyings of the given shader stage as a WGSL string. - * - * @param {string} shaderStage - The shader stage. - * @return {string} The WGSL snippet that defines the varyings. - */ - getVaryings(shaderStage: string): string; - isCustomStruct(nodeUniform: any): any; - /** - * Returns the uniforms of the given shader stage as a WGSL string. - * - * @param {string} shaderStage - The shader stage. - * @return {string} The WGSL snippet that defines the uniforms. - */ - getUniforms(shaderStage: string): string; - /** - * Returns the native shader method name for a given generic name. - * - * @param {string} method - The method name to resolve. - * @param {?string} [output=null] - An optional output. - * @return {string} The resolved WGSL method name. - */ - getMethod(method: string, output?: string | null): string; - /** - * Returns the bitcast method name for a given input and outputType. - * - * @param {string} type - The output type to bitcast to. - * @return {string} The resolved WGSL bitcast invocation. - */ - getBitcastMethod(type: string): string; - /** - * Returns the float packing method name for a given numeric encoding. - * - * @param {string} encoding - The numeric encoding that describes how the float values are mapped to the integer range. - * @returns {string} The resolve WGSL float packing method name. - */ - getFloatPackingMethod(encoding: string): string; - /** - * Returns the float unpacking method name for a given numeric encoding. - * - * @param {string} encoding - The numeric encoding that describes how the integer values are mapped to the float range. - * @returns {string} The resolve WGSL float unpacking method name. - */ - getFloatUnpackingMethod(encoding: string): string; - /** - * Returns the native snippet for a ternary operation. - * - * @param {string} condSnippet - The condition determining which expression gets resolved. - * @param {string} ifSnippet - The expression to resolve to if the condition is true. - * @param {string} elseSnippet - The expression to resolve to if the condition is false. - * @return {string} The resolved method name. - */ - getTernary(condSnippet: string, ifSnippet: string, elseSnippet: string): string; - /** - * Whether the requested feature is available or not. - * - * @param {string} name - The requested feature. - * @return {boolean} Whether the requested feature is supported or not. - */ - isAvailable(name: string): boolean; - /** - * Returns the native shader method name for a given generic name. - * - * @private - * @param {string} method - The method name to resolve. - * @return {string} The resolved WGSL method name. - */ - private _getWGSLMethod; - /** - * Includes the given method name into the current - * function node. - * - * @private - * @param {string} name - The method name to include. - * @return {CodeNode} The respective code node. - */ - private _include; - /** - * Returns a WGSL vertex shader based on the given shader data. - * - * @private - * @param {Object} shaderData - The shader data. - * @return {string} The vertex shader. - */ - private _getWGSLVertexCode; - /** - * Returns a WGSL fragment shader based on the given shader data. - * - * @private - * @param {Object} shaderData - The shader data. - * @return {string} The vertex shader. - */ - private _getWGSLFragmentCode; - /** - * Returns a WGSL compute shader based on the given shader data. - * - * @private - * @param {Object} shaderData - The shader data. - * @param {string} workgroupSize - The workgroup size. - * @return {string} The vertex shader. - */ - private _getWGSLComputeCode; - /** - * Returns a WGSL struct based on the given name and variables. - * - * @private - * @param {string} name - The struct name. - * @param {string} vars - The struct variables. - * @return {string} The WGSL snippet representing a struct. - */ - private _getWGSLStruct; - /** - * Returns a WGSL struct binding. - * - * @private - * @param {string} name - The struct name. - * @param {string} vars - The struct variables. - * @param {string} access - The access. - * @param {number} [binding=0] - The binding index. - * @param {number} [group=0] - The group index. - * @return {string} The WGSL snippet representing a struct binding. - */ - private _getWGSLStructBinding; -} -import { NodeBuilder } from '../../../nodes/Nodes.js'; -import NodeUniformsGroup from '../../common/nodes/NodeUniformsGroup.js'; diff --git a/jsdoc-testing/jsdoc/renderers/webgpu/nodes/WGSLNodeFunction.d.ts b/jsdoc-testing/jsdoc/renderers/webgpu/nodes/WGSLNodeFunction.d.ts deleted file mode 100644 index 3cbe9f2f5..000000000 --- a/jsdoc-testing/jsdoc/renderers/webgpu/nodes/WGSLNodeFunction.d.ts +++ /dev/null @@ -1,25 +0,0 @@ -export default WGSLNodeFunction; -/** - * This class represents a WSL node function. - * - * @augments NodeFunction - */ -declare class WGSLNodeFunction extends NodeFunction { - /** - * Constructs a new WGSL node function. - * - * @param {string} source - The WGSL source. - */ - constructor(source: string); - inputsCode: any; - blockCode: any; - outputType: any; - /** - * This method returns the WGSL code of the node function. - * - * @param {string} [name=this.name] - The function's name. - * @return {string} The shader code. - */ - getCode(name?: string): string; -} -import NodeFunction from '../../../nodes/core/NodeFunction.js'; diff --git a/jsdoc-testing/jsdoc/renderers/webgpu/nodes/WGSLNodeParser.d.ts b/jsdoc-testing/jsdoc/renderers/webgpu/nodes/WGSLNodeParser.d.ts deleted file mode 100644 index 58ab25284..000000000 --- a/jsdoc-testing/jsdoc/renderers/webgpu/nodes/WGSLNodeParser.d.ts +++ /dev/null @@ -1,17 +0,0 @@ -export default WGSLNodeParser; -/** - * A WGSL node parser. - * - * @augments NodeParser - */ -declare class WGSLNodeParser extends NodeParser { - /** - * The method parses the given WGSL code an returns a node function. - * - * @param {string} source - The WGSL code. - * @return {WGSLNodeFunction} A node function. - */ - parseFunction(source: string): WGSLNodeFunction; -} -import NodeParser from '../../../nodes/core/NodeParser.js'; -import WGSLNodeFunction from './WGSLNodeFunction.js'; diff --git a/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUAttributeUtils.d.ts b/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUAttributeUtils.d.ts deleted file mode 100644 index 0d27c5e0c..000000000 --- a/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUAttributeUtils.d.ts +++ /dev/null @@ -1,73 +0,0 @@ -export default WebGPUAttributeUtils; -/** - * A WebGPU backend utility module for managing shader attributes. - * - * @private - */ -declare class WebGPUAttributeUtils { - /** - * Constructs a new utility object. - * - * @param {WebGPUBackend} backend - The WebGPU backend. - */ - constructor(backend: WebGPUBackend); - /** - * A reference to the WebGPU backend. - * - * @type {WebGPUBackend} - */ - backend: WebGPUBackend; - /** - * Creates the GPU buffer for the given buffer attribute. - * - * @param {BufferAttribute} attribute - The buffer attribute. - * @param {GPUBufferUsage} usage - A flag that indicates how the buffer may be used after its creation. - */ - createAttribute(attribute: BufferAttribute, usage: GPUBufferUsage): void; - /** - * Updates the GPU buffer of the given buffer attribute. - * - * @param {BufferAttribute} attribute - The buffer attribute. - */ - updateAttribute(attribute: BufferAttribute): void; - /** - * This method creates the vertex buffer layout data which are - * require when creating a render pipeline for the given render object. - * - * @param {RenderObject} renderObject - The render object. - * @return {Array} An array holding objects which describe the vertex buffer layout. - */ - createShaderVertexBuffers(renderObject: RenderObject): Array; - /** - * Destroys the GPU buffer of the given buffer attribute. - * - * @param {BufferAttribute} attribute - The buffer attribute. - */ - destroyAttribute(attribute: BufferAttribute): void; - /** - * This method performs a readback operation by moving buffer data from - * a storage buffer attribute from the GPU to the CPU. - * - * @async - * @param {StorageBufferAttribute} attribute - The storage buffer attribute. - * @return {Promise} A promise that resolves with the buffer data when the data are ready. - */ - getArrayBufferAsync(attribute: StorageBufferAttribute): Promise; - /** - * Returns the vertex format of the given buffer attribute. - * - * @private - * @param {BufferAttribute} geometryAttribute - The buffer attribute. - * @return {string|undefined} The vertex format (e.g. 'float32x3'). - */ - private _getVertexFormat; - /** - * Utility method for handling interleaved buffer attributes correctly. - * To process them, their `InterleavedBuffer` is returned. - * - * @private - * @param {BufferAttribute} attribute - The attribute. - * @return {BufferAttribute|InterleavedBuffer} - */ - private _getBufferAttribute; -} diff --git a/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUBindingUtils.d.ts b/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUBindingUtils.d.ts deleted file mode 100644 index 9c5208097..000000000 --- a/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUBindingUtils.d.ts +++ /dev/null @@ -1,88 +0,0 @@ -export default WebGPUBindingUtils; -/** - * A WebGPU backend utility module for managing bindings. - * - * When reading the documentation it's helpful to keep in mind that - * all class definitions starting with 'GPU*' are modules from the - * WebGPU API. So for example `BindGroup` is a class from the engine - * whereas `GPUBindGroup` is a class from WebGPU. - * - * @private - */ -declare class WebGPUBindingUtils { - /** - * Constructs a new utility object. - * - * @param {WebGPUBackend} backend - The WebGPU backend. - */ - constructor(backend: WebGPUBackend); - /** - * A reference to the WebGPU backend. - * - * @type {WebGPUBackend} - */ - backend: WebGPUBackend; - /** - * A cache that maps combinations of layout entries to existing bind group layouts. - * - * @private - * @type {Map} - */ - private _bindGroupLayoutCache; - /** - * Creates a GPU bind group layout for the given bind group. - * - * @param {BindGroup} bindGroup - The bind group. - * @return {GPUBindGroupLayout} The GPU bind group layout. - */ - createBindingsLayout(bindGroup: BindGroup): GPUBindGroupLayout; - /** - * Creates bindings from the given bind group definition. - * - * @param {BindGroup} bindGroup - The bind group. - * @param {Array} bindings - Array of bind groups. - * @param {number} cacheIndex - The cache index. - * @param {number} version - The version. - */ - createBindings(bindGroup: BindGroup, bindings: Array, cacheIndex: number, version?: number): void; - /** - * Updates a buffer binding. - * - * @param {Buffer} binding - The buffer binding to update. - */ - updateBinding(binding: Buffer): void; - /** - * Creates a GPU bind group for the camera index. - * - * @param {Uint32Array} data - The index data. - * @param {GPUBindGroupLayout} layoutGPU - The GPU bind group layout. - * @return {GPUBindGroup} The GPU bind group. - */ - createBindGroupIndex(data: Uint32Array, layoutGPU: GPUBindGroupLayout): GPUBindGroup; - /** - * Creates a GPU bind group for the given bind group and GPU layout. - * - * @param {BindGroup} bindGroup - The bind group. - * @param {GPUBindGroupLayout} layoutGPU - The GPU bind group layout. - * @return {GPUBindGroup} The GPU bind group. - */ - createBindGroup(bindGroup: BindGroup, layoutGPU: GPUBindGroupLayout): GPUBindGroup; - /** - * Creates a GPU bind group layout entries for the given bind group. - * - * @private - * @param {BindGroup} bindGroup - The bind group. - * @return {Array} The GPU bind group layout entries. - */ - private _createLayoutEntries; - /** - * Delete the data associated with a bind group. - * - * @param {BindGroup} bindGroup - The bind group. - */ - deleteBindGroupData(bindGroup: BindGroup): void; - /** - * Frees internal resources. - */ - dispose(): void; -} diff --git a/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUCapabilities.d.ts b/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUCapabilities.d.ts deleted file mode 100644 index c56d99d65..000000000 --- a/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUCapabilities.d.ts +++ /dev/null @@ -1,32 +0,0 @@ -export default WebGPUCapabilities; -/** - * A WebGPU backend utility module for managing the device's capabilities. - * - * @private - */ -declare class WebGPUCapabilities { - /** - * Constructs a new utility object. - * - * @param {WebGPUBackend} backend - The WebGPU backend. - */ - constructor(backend: WebGPUBackend); - /** - * A reference to the WebGPU backend. - * - * @type {WebGPUBackend} - */ - backend: WebGPUBackend; - /** - * Returns the maximum anisotropy texture filtering value. - * - * @return {number} The maximum anisotropy texture filtering value. - */ - getMaxAnisotropy(): number; - /** - * Returns the maximum number of bytes available for uniform buffers. - * - * @return {number} The maximum number of bytes available for uniform buffers. - */ - getUniformBufferLimit(): number; -} diff --git a/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUConstants.d.ts b/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUConstants.d.ts deleted file mode 100644 index a610756f3..000000000 --- a/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUConstants.d.ts +++ /dev/null @@ -1,295 +0,0 @@ -export namespace GPUPrimitiveTopology { - let PointList: string; - let LineList: string; - let LineStrip: string; - let TriangleList: string; - let TriangleStrip: string; -} -export const GPUShaderStage: any; -export namespace GPUCompareFunction { - let Never: string; - let Less: string; - let Equal: string; - let LessEqual: string; - let Greater: string; - let NotEqual: string; - let GreaterEqual: string; - let Always: string; -} -export namespace GPUStoreOp { - let Store: string; - let Discard: string; -} -export namespace GPULoadOp { - let Load: string; - let Clear: string; -} -export namespace GPUFrontFace { - let CCW: string; - let CW: string; -} -export namespace GPUCullMode { - let None: string; - let Front: string; - let Back: string; -} -export namespace GPUIndexFormat { - let Uint16: string; - let Uint32: string; -} -export namespace GPUVertexFormat { - export let Uint8x2: string; - export let Uint8x4: string; - export let Sint8x2: string; - export let Sint8x4: string; - export let Unorm8x2: string; - export let Unorm8x4: string; - export let Snorm8x2: string; - export let Snorm8x4: string; - export let Uint16x2: string; - export let Uint16x4: string; - export let Sint16x2: string; - export let Sint16x4: string; - export let Unorm16x2: string; - export let Unorm16x4: string; - export let Snorm16x2: string; - export let Snorm16x4: string; - export let Float16x2: string; - export let Float16x4: string; - export let Float32: string; - export let Float32x2: string; - export let Float32x3: string; - export let Float32x4: string; - let Uint32_1: string; - export { Uint32_1 as Uint32 }; - export let Uint32x2: string; - export let Uint32x3: string; - export let Uint32x4: string; - export let Sint32: string; - export let Sint32x2: string; - export let Sint32x3: string; - export let Sint32x4: string; -} -export namespace GPUTextureFormat { - let R8Unorm: string; - let R8Snorm: string; - let R8Uint: string; - let R8Sint: string; - let R16Uint: string; - let R16Sint: string; - let R16Float: string; - let RG8Unorm: string; - let RG8Snorm: string; - let RG8Uint: string; - let RG8Sint: string; - let R32Uint: string; - let R32Sint: string; - let R32Float: string; - let RG16Uint: string; - let RG16Sint: string; - let RG16Float: string; - let RGBA8Unorm: string; - let RGBA8UnormSRGB: string; - let RGBA8Snorm: string; - let RGBA8Uint: string; - let RGBA8Sint: string; - let BGRA8Unorm: string; - let BGRA8UnormSRGB: string; - let RGB9E5UFloat: string; - let RGB10A2Unorm: string; - let RG11B10UFloat: string; - let RG32Uint: string; - let RG32Sint: string; - let RG32Float: string; - let RGBA16Uint: string; - let RGBA16Sint: string; - let RGBA16Float: string; - let RGBA32Uint: string; - let RGBA32Sint: string; - let RGBA32Float: string; - let Stencil8: string; - let Depth16Unorm: string; - let Depth24Plus: string; - let Depth24PlusStencil8: string; - let Depth32Float: string; - let Depth32FloatStencil8: string; - let BC1RGBAUnorm: string; - let BC1RGBAUnormSRGB: string; - let BC2RGBAUnorm: string; - let BC2RGBAUnormSRGB: string; - let BC3RGBAUnorm: string; - let BC3RGBAUnormSRGB: string; - let BC4RUnorm: string; - let BC4RSnorm: string; - let BC5RGUnorm: string; - let BC5RGSnorm: string; - let BC6HRGBUFloat: string; - let BC6HRGBFloat: string; - let BC7RGBAUnorm: string; - let BC7RGBAUnormSRGB: string; - let ETC2RGB8Unorm: string; - let ETC2RGB8UnormSRGB: string; - let ETC2RGB8A1Unorm: string; - let ETC2RGB8A1UnormSRGB: string; - let ETC2RGBA8Unorm: string; - let ETC2RGBA8UnormSRGB: string; - let EACR11Unorm: string; - let EACR11Snorm: string; - let EACRG11Unorm: string; - let EACRG11Snorm: string; - let ASTC4x4Unorm: string; - let ASTC4x4UnormSRGB: string; - let ASTC5x4Unorm: string; - let ASTC5x4UnormSRGB: string; - let ASTC5x5Unorm: string; - let ASTC5x5UnormSRGB: string; - let ASTC6x5Unorm: string; - let ASTC6x5UnormSRGB: string; - let ASTC6x6Unorm: string; - let ASTC6x6UnormSRGB: string; - let ASTC8x5Unorm: string; - let ASTC8x5UnormSRGB: string; - let ASTC8x6Unorm: string; - let ASTC8x6UnormSRGB: string; - let ASTC8x8Unorm: string; - let ASTC8x8UnormSRGB: string; - let ASTC10x5Unorm: string; - let ASTC10x5UnormSRGB: string; - let ASTC10x6Unorm: string; - let ASTC10x6UnormSRGB: string; - let ASTC10x8Unorm: string; - let ASTC10x8UnormSRGB: string; - let ASTC10x10Unorm: string; - let ASTC10x10UnormSRGB: string; - let ASTC12x10Unorm: string; - let ASTC12x10UnormSRGB: string; - let ASTC12x12Unorm: string; - let ASTC12x12UnormSRGB: string; -} -export namespace GPUAddressMode { - let ClampToEdge: string; - let Repeat: string; - let MirrorRepeat: string; -} -export namespace GPUFilterMode { - let Linear: string; - let Nearest: string; -} -export namespace GPUBlendFactor { - let Zero: string; - let One: string; - let Src: string; - let OneMinusSrc: string; - let SrcAlpha: string; - let OneMinusSrcAlpha: string; - let Dst: string; - let OneMinusDst: string; - let DstAlpha: string; - let OneMinusDstAlpha: string; - let SrcAlphaSaturated: string; - let Constant: string; - let OneMinusConstant: string; -} -export namespace GPUBlendOperation { - let Add: string; - let Subtract: string; - let ReverseSubtract: string; - let Min: string; - let Max: string; -} -export namespace GPUColorWriteFlags { - let None_1: number; - export { None_1 as None }; - export let Red: number; - export let Green: number; - export let Blue: number; - export let Alpha: number; - export let All: number; -} -export namespace GPUStencilOperation { - export let Keep: string; - let Zero_1: string; - export { Zero_1 as Zero }; - export let Replace: string; - export let Invert: string; - export let IncrementClamp: string; - export let DecrementClamp: string; - export let IncrementWrap: string; - export let DecrementWrap: string; -} -export namespace GPUBufferBindingType { - let Uniform: string; - let Storage: string; - let ReadOnlyStorage: string; -} -export namespace GPUStorageTextureAccess { - let WriteOnly: string; - let ReadOnly: string; - let ReadWrite: string; -} -export namespace GPUSamplerBindingType { - let Filtering: string; - let NonFiltering: string; - let Comparison: string; -} -export namespace GPUTextureSampleType { - let Float: string; - let UnfilterableFloat: string; - let Depth: string; - let SInt: string; - let UInt: string; -} -export namespace GPUTextureDimension { - let OneD: string; - let TwoD: string; - let ThreeD: string; -} -export namespace GPUTextureViewDimension { - let OneD_1: string; - export { OneD_1 as OneD }; - let TwoD_1: string; - export { TwoD_1 as TwoD }; - export let TwoDArray: string; - export let Cube: string; - export let CubeArray: string; - let ThreeD_1: string; - export { ThreeD_1 as ThreeD }; -} -export namespace GPUTextureAspect { - let All_1: string; - export { All_1 as All }; - export let StencilOnly: string; - export let DepthOnly: string; -} -export namespace GPUInputStepMode { - let Vertex: string; - let Instance: string; -} -export namespace GPUFeatureName { - export let CoreFeaturesAndLimits: string; - export let DepthClipControl: string; - let Depth32FloatStencil8_1: string; - export { Depth32FloatStencil8_1 as Depth32FloatStencil8 }; - export let TextureCompressionBC: string; - export let TextureCompressionBCSliced3D: string; - export let TextureCompressionETC2: string; - export let TextureCompressionASTC: string; - export let TextureCompressionASTCSliced3D: string; - export let TimestampQuery: string; - export let IndirectFirstInstance: string; - export let ShaderF16: string; - let RG11B10UFloat_1: string; - export { RG11B10UFloat_1 as RG11B10UFloat }; - export let BGRA8UNormStorage: string; - export let Float32Filterable: string; - export let Float32Blendable: string; - export let ClipDistances: string; - export let DualSourceBlending: string; - export let Subgroups: string; - export let TextureFormatsTier1: string; - export let TextureFormatsTier2: string; -} -export const GPUFeatureMap: { - 'texture-compression-s3tc': string; - 'texture-compression-etc1': string; -}; diff --git a/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUPipelineUtils.d.ts b/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUPipelineUtils.d.ts deleted file mode 100644 index 6db6ec9d1..000000000 --- a/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUPipelineUtils.d.ts +++ /dev/null @@ -1,133 +0,0 @@ -export default WebGPUPipelineUtils; -/** - * A WebGPU backend utility module for managing pipelines. - * - * @private - */ -declare class WebGPUPipelineUtils { - /** - * Constructs a new utility object. - * - * @param {WebGPUBackend} backend - The WebGPU backend. - */ - constructor(backend: WebGPUBackend); - /** - * A reference to the WebGPU backend. - * - * @type {WebGPUBackend} - */ - backend: WebGPUBackend; - /** - * A Weak Map that tracks the active pipeline for render or compute passes. - * - * @private - * @type {WeakMap<(GPURenderPassEncoder|GPUComputePassEncoder),(GPURenderPipeline|GPUComputePipeline)>} - */ - private _activePipelines; - /** - * Sets the given pipeline for the given pass. The method makes sure to only set the - * pipeline when necessary. - * - * @param {(GPURenderPassEncoder|GPUComputePassEncoder)} pass - The pass encoder. - * @param {(GPURenderPipeline|GPUComputePipeline)} pipeline - The pipeline. - */ - setPipeline(pass: (GPURenderPassEncoder | GPUComputePassEncoder), pipeline: (GPURenderPipeline | GPUComputePipeline)): void; - /** - * Returns the sample count derived from the given render context. - * - * @private - * @param {RenderContext} renderContext - The render context. - * @return {number} The sample count. - */ - private _getSampleCount; - /** - * Creates a render pipeline for the given render object. - * - * @param {RenderObject} renderObject - The render object. - * @param {Array} promises - An array of compilation promises which are used in `compileAsync()`. - */ - createRenderPipeline(renderObject: RenderObject, promises: Array>): void; - /** - * Creates GPU render bundle encoder for the given render context. - * - * @param {RenderContext} renderContext - The render context. - * @param {?string} [label='renderBundleEncoder'] - The label. - * @return {GPURenderBundleEncoder} The GPU render bundle encoder. - */ - createBundleEncoder(renderContext: RenderContext, label?: string | null): GPURenderBundleEncoder; - /** - * Creates a compute pipeline for the given compute node. - * - * @param {ComputePipeline} pipeline - The compute pipeline. - * @param {Array} bindings - The bindings. - */ - createComputePipeline(pipeline: ComputePipeline, bindings: Array): void; - /** - * Returns the blending state as a descriptor object required - * for the pipeline creation. - * - * @private - * @param {Material|BlendMode} object - The object containing blending information. - * @return {Object} The blending state. - */ - private _getBlending; - /** - * Returns the GPU blend factor which is required for the pipeline creation. - * - * @private - * @param {number} blend - The blend factor as a three.js constant. - * @return {string} The GPU blend factor. - */ - private _getBlendFactor; - /** - * Returns the GPU stencil compare function which is required for the pipeline creation. - * - * @private - * @param {Material} material - The material. - * @return {string} The GPU stencil compare function. - */ - private _getStencilCompare; - /** - * Returns the GPU stencil operation which is required for the pipeline creation. - * - * @private - * @param {number} op - A three.js constant defining the stencil operation. - * @return {string} The GPU stencil operation. - */ - private _getStencilOperation; - /** - * Returns the GPU blend operation which is required for the pipeline creation. - * - * @private - * @param {number} blendEquation - A three.js constant defining the blend equation. - * @return {string} The GPU blend operation. - */ - private _getBlendOperation; - /** - * Returns the primitive state as a descriptor object required - * for the pipeline creation. - * - * @private - * @param {Object3D} object - The 3D object. - * @param {BufferGeometry} geometry - The geometry. - * @param {Material} material - The material. - * @return {Object} The primitive state. - */ - private _getPrimitiveState; - /** - * Returns the GPU color write mask which is required for the pipeline creation. - * - * @private - * @param {Material} material - The material. - * @return {number} The GPU color write mask. - */ - private _getColorWriteMask; - /** - * Returns the GPU depth compare function which is required for the pipeline creation. - * - * @private - * @param {Material} material - The material. - * @return {string} The GPU depth compare function. - */ - private _getDepthCompare; -} diff --git a/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUTexturePassUtils.d.ts b/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUTexturePassUtils.d.ts deleted file mode 100644 index 5d39f8906..000000000 --- a/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUTexturePassUtils.d.ts +++ /dev/null @@ -1,97 +0,0 @@ -export default WebGPUTexturePassUtils; -/** - * A WebGPU backend utility module used by {@link WebGPUTextureUtils}. - * - * @private - */ -declare class WebGPUTexturePassUtils extends DataMap { - /** - * Constructs a new utility object. - * - * @param {GPUDevice} device - The WebGPU device. - */ - constructor(device: GPUDevice); - /** - * The WebGPU device. - * - * @type {GPUDevice} - */ - device: GPUDevice; - /** - * The mipmap GPU sampler. - * - * @type {GPUSampler} - */ - mipmapSampler: GPUSampler; - /** - * The flipY GPU sampler. - * - * @type {GPUSampler} - */ - flipYSampler: GPUSampler; - /** - * flip uniform buffer - * @type {GPUBuffer} - */ - flipUniformBuffer: GPUBuffer; - /** - * no flip uniform buffer - * @type {GPUBuffer} - */ - noFlipUniformBuffer: GPUBuffer; - /** - * A cache for GPU render pipelines used for copy/transfer passes. - * Every texture format and textureBindingViewDimension combo requires a unique pipeline. - * - * @type {Object} - */ - transferPipelines: { - [x: string]: GPURenderPipeline; - }; - /** - * The mipmap shader module. - * - * @type {GPUShaderModule} - */ - mipmapShaderModule: GPUShaderModule; - /** - * Returns a render pipeline for the internal copy render pass. The pass - * requires a unique render pipeline for each texture format. - * - * @param {string} format - The GPU texture format - * @param {string?} textureBindingViewDimension - The GPU texture binding view dimension - * @return {GPURenderPipeline} The GPU render pipeline. - */ - getTransferPipeline(format: string, textureBindingViewDimension: string | null): GPURenderPipeline; - /** - * Flip the contents of the given GPU texture along its vertical axis. - * - * @param {GPUTexture} textureGPU - The GPU texture object. - * @param {Object} textureGPUDescriptor - The texture descriptor. - * @param {number} [baseArrayLayer=0] - The index of the first array layer accessible to the texture view. - */ - flipY(textureGPU: GPUTexture, textureGPUDescriptor: Object, baseArrayLayer?: number): void; - /** - * Generates mipmaps for the given GPU texture. - * - * @param {GPUTexture} textureGPU - The GPU texture object. - * @param {?GPUCommandEncoder} [encoder=null] - An optional command encoder used to generate mipmaps. - */ - generateMipmaps(textureGPU: GPUTexture, encoder?: GPUCommandEncoder | null): void; - /** - * Since multiple copy render passes are required to generate mipmaps, the passes - * are managed as render bundles to improve performance. - * - * @param {GPUTexture} textureGPU - The GPU texture object. - * @return {Array} An array of render bundles. - */ - _mipmapCreateBundles(textureGPU: GPUTexture): Array; - /** - * Executes the render bundles. - * - * @param {GPUCommandEncoder} commandEncoder - The GPU command encoder. - * @param {Array} passes - An array of render bundles. - */ - _mipmapRunBundles(commandEncoder: GPUCommandEncoder, passes: Array): void; -} -import DataMap from '../../common/DataMap.js'; diff --git a/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUTextureUtils.d.ts b/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUTextureUtils.d.ts deleted file mode 100644 index c7fd90459..000000000 --- a/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUTextureUtils.d.ts +++ /dev/null @@ -1,278 +0,0 @@ -/** - * Returns the GPU format for the given texture. - * - * @param {Texture} texture - The texture. - * @param {?GPUDevice} [device=null] - The GPU device which is used for feature detection. - * It is not necessary to apply the device for most formats. - * @return {string} The GPU format. - */ -export function getFormat(texture: Texture, device?: GPUDevice | null): string; -export default WebGPUTextureUtils; -import { Texture } from '../../../textures/Texture.js'; -/** - * A WebGPU backend utility module for managing textures. - * - * @private - */ -declare class WebGPUTextureUtils { - /** - * Constructs a new utility object. - * - * @param {WebGPUBackend} backend - The WebGPU backend. - */ - constructor(backend: WebGPUBackend); - /** - * A reference to the WebGPU backend. - * - * @type {WebGPUBackend} - */ - backend: WebGPUBackend; - /** - * A reference to the pass utils. - * - * @type {?WebGPUTexturePassUtils} - * @default null - */ - _passUtils: WebGPUTexturePassUtils | null; - /** - * A dictionary for managing default textures. The key - * is the texture format, the value the texture object. - * - * @type {Object} - */ - defaultTexture: { - [x: string]: Texture; - }; - /** - * A dictionary for managing default cube textures. The key - * is the texture format, the value the texture object. - * - * @type {Object} - */ - defaultCubeTexture: { - [x: string]: CubeTexture; - }; - /** - * A default video frame. - * - * @type {?VideoFrame} - * @default null - */ - defaultVideoFrame: VideoFrame | null; - /** - * A cache of shared texture samplers. - * - * @type {Map} - */ - _samplerCache: Map; - /** - * Creates a GPU sampler for the given texture. - * - * @param {Texture} texture - The texture to create the sampler for. - * @return {string} The current sampler key. - */ - updateSampler(texture: Texture): string; - /** - * Creates a default texture for the given texture that can be used - * as a placeholder until the actual texture is ready for usage. - * - * @param {Texture} texture - The texture to create a default texture for. - */ - createDefaultTexture(texture: Texture): void; - /** - * Defines a texture on the GPU for the given texture object. - * - * @param {Texture} texture - The texture. - * @param {Object} [options={}] - Optional configuration parameter. - */ - createTexture(texture: Texture, options?: Object): void; - /** - * Destroys the GPU data for the given texture object. - * - * @param {Texture} texture - The texture. - * @param {boolean} [isDefaultTexture=false] - Whether the texture uses a default GPU texture or not. - */ - destroyTexture(texture: Texture, isDefaultTexture?: boolean): void; - /** - * Generates mipmaps for the given texture. - * - * @param {Texture} texture - The texture. - * @param {?GPUCommandEncoder} [encoder=null] - An optional command encoder used to generate mipmaps. - */ - generateMipmaps(texture: Texture, encoder?: GPUCommandEncoder | null): void; - /** - * Returns the color buffer representing the color - * attachment of the default framebuffer. - * - * @return {GPUTexture} The color buffer. - */ - getColorBuffer(): GPUTexture; - /** - * Returns the depth buffer representing the depth - * attachment of the default framebuffer. - * - * @param {boolean} [depth=true] - Whether depth is enabled or not. - * @param {boolean} [stencil=false] - Whether stencil is enabled or not. - * @return {GPUTexture} The depth buffer. - */ - getDepthBuffer(depth?: boolean, stencil?: boolean): GPUTexture; - /** - * Uploads the updated texture data to the GPU. - * - * @param {Texture} texture - The texture. - * @param {Object} [options={}] - Optional configuration parameter. - */ - updateTexture(texture: Texture, options?: Object): void; - /** - * Returns texture data as a typed array. - * - * @async - * @param {Texture} texture - The texture to copy. - * @param {number} x - The x coordinate of the copy origin. - * @param {number} y - The y coordinate of the copy origin. - * @param {number} width - The width of the copy. - * @param {number} height - The height of the copy. - * @param {number} faceIndex - The face index. - * @return {Promise} A Promise that resolves with a typed array when the copy operation has finished. - */ - copyTextureToBuffer(texture: Texture, x: number, y: number, width: number, height: number, faceIndex: number): Promise; - /** - * Frees all internal resources. - */ - dispose(): void; - /** - * Returns the default GPU texture for the given format. - * - * @private - * @param {string} format - The GPU format. - * @return {GPUTexture} The GPU texture. - */ - private _getDefaultTextureGPU; - /** - * Returns the default GPU cube texture for the given format. - * - * @private - * @param {string} format - The GPU format. - * @return {GPUTexture} The GPU texture. - */ - private _getDefaultCubeTextureGPU; - /** - * Uploads cube texture image data to the GPU memory. - * - * @private - * @param {CubeTexture} texture - The cube texture. - * @param {GPUTexture} textureGPU - The GPU texture. - * @param {Object} textureDescriptorGPU - The GPU texture descriptor. - */ - private _copyCubeMapToTexture; - /** - * Uploads texture image data to the GPU memory. - * - * @private - * @param {HTMLImageElement|ImageBitmap|HTMLCanvasElement} image - The image data. - * @param {GPUTexture} textureGPU - The GPU texture. - * @param {Object} textureDescriptorGPU - The GPU texture descriptor. - * @param {number} originDepth - The origin depth. - * @param {boolean} flipY - Whether to flip texture data along their vertical axis or not. - * @param {boolean} premultiplyAlpha - Whether the texture should have its RGB channels premultiplied by the alpha channel or not. - * @param {number} [mipLevel=0] - The mip level where the data should be copied to. - */ - private _copyImageToTexture; - /** - * Returns the pass utils singleton. - * - * @private - * @return {WebGPUTexturePassUtils} The utils instance. - */ - private _getPassUtils; - /** - * Generates mipmaps for the given GPU texture. - * - * @private - * @param {GPUTexture} textureGPU - The GPU texture object. - * @param {?GPUCommandEncoder} [encoder=null] - An optional command encoder used to generate mipmaps. - */ - private _generateMipmaps; - /** - * Flip the contents of the given GPU texture along its vertical axis. - * - * @private - * @param {GPUTexture} textureGPU - The GPU texture object. - * @param {Object} textureDescriptorGPU - The texture descriptor. - * @param {number} [originDepth=0] - The origin depth. - */ - private _flipY; - /** - * Uploads texture buffer data to the GPU memory. - * - * @private - * @param {Object} image - An object defining the image buffer data. - * @param {GPUTexture} textureGPU - The GPU texture. - * @param {Object} textureDescriptorGPU - The GPU texture descriptor. - * @param {number} originDepth - The origin depth. - * @param {boolean} flipY - Whether to flip texture data along their vertical axis or not. - * @param {number} [depth=0] - The depth offset when copying array or 3D texture data. - * @param {number} [mipLevel=0] - The mip level where the data should be copied to. - */ - private _copyBufferToTexture; - /** - * Uploads compressed texture data to the GPU memory. - * - * @private - * @param {Array} mipmaps - An array with mipmap data. - * @param {GPUTexture} textureGPU - The GPU texture. - * @param {Object} textureDescriptorGPU - The GPU texture descriptor. - */ - private _copyCompressedBufferToTexture; - /** - * This method is only relevant for compressed texture formats. It returns a block - * data descriptor for the given GPU compressed texture format. - * - * @private - * @param {string} format - The GPU compressed texture format. - * @return {Object} The block data descriptor. - */ - private _getBlockData; - /** - * Converts the three.js uv wrapping constants to GPU address mode constants. - * - * @private - * @param {number} value - The three.js constant defining a uv wrapping mode. - * @return {string} The GPU address mode. - */ - private _convertAddressMode; - /** - * Converts the three.js filter constants to GPU filter constants. - * - * @private - * @param {number} value - The three.js constant defining a filter mode. - * @return {string} The GPU filter mode. - */ - private _convertFilterMode; - /** - * Returns the bytes-per-texel value for the given GPU texture format. - * - * @private - * @param {string} format - The GPU texture format. - * @return {number} The bytes-per-texel. - */ - private _getBytesPerTexel; - /** - * Returns the corresponding typed array type for the given GPU texture format. - * - * @private - * @param {string} format - The GPU texture format. - * @return {TypedArray.constructor} The typed array type. - */ - private _getTypedArrayType; - /** - * Returns the GPU dimensions for the given texture. - * - * @private - * @param {Texture} texture - The texture. - * @return {string} The GPU dimension. - */ - private _getDimension; -} -import WebGPUTexturePassUtils from './WebGPUTexturePassUtils.js'; -import { CubeTexture } from '../../../textures/CubeTexture.js'; diff --git a/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUTimestampQueryPool.d.ts b/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUTimestampQueryPool.d.ts deleted file mode 100644 index cd337afe1..000000000 --- a/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUTimestampQueryPool.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -export default WebGPUTimestampQueryPool; -/** - * Manages a pool of WebGPU timestamp queries for performance measurement. - * Extends the base TimestampQueryPool to provide WebGPU-specific implementation. - * - * @augments TimestampQueryPool - */ -declare class WebGPUTimestampQueryPool extends TimestampQueryPool { - /** - * Creates a new WebGPU timestamp query pool. - * - * @param {GPUDevice} device - The WebGPU device to create queries on. - * @param {string} type - The type identifier for this query pool. - * @param {number} [maxQueries=2048] - Maximum number of queries this pool can hold. - */ - constructor(device: GPUDevice, type: string, maxQueries?: number); - device: GPUDevice; - type: string; - querySet: any; - resolveBuffer: any; - resultBuffer: any; - /** - * Allocates a pair of queries for a given render context. - * - * @param {string} uid - A unique identifier for the render context. - * @returns {?number} The base offset for the allocated queries, or null if allocation failed. - */ - allocateQueriesForContext(uid: string): number | null; - /** - * Asynchronously resolves all pending queries and returns the total duration. - * If there's already a pending resolve operation, returns that promise instead. - * - * @async - * @returns {Promise} The total duration in milliseconds, or the last valid value if resolution fails. - */ - resolveQueriesAsync(): Promise; - /** - * Internal method to resolve queries and calculate total duration. - * - * @async - * @private - * @returns {Promise} The total duration in milliseconds. - */ - private _resolveQueries; - /** - * Dispose of the query pool. - * - * @async - * @returns {Promise} A Promise that resolves when the dispose has been executed. - */ - dispose(): Promise; -} -import TimestampQueryPool from '../../common/TimestampQueryPool.js'; diff --git a/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUUtils.d.ts b/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUUtils.d.ts deleted file mode 100644 index 8c301d0a7..000000000 --- a/jsdoc-testing/jsdoc/renderers/webgpu/utils/WebGPUUtils.d.ts +++ /dev/null @@ -1,95 +0,0 @@ -export default WebGPUUtils; -/** - * A WebGPU backend utility module with common helpers. - * - * @private - */ -declare class WebGPUUtils { - /** - * Constructs a new utility object. - * - * @param {WebGPUBackend} backend - The WebGPU backend. - */ - constructor(backend: WebGPUBackend); - /** - * A reference to the WebGPU backend. - * - * @type {WebGPUBackend} - */ - backend: WebGPUBackend; - /** - * Returns the depth/stencil GPU format for the given render context. - * - * @param {RenderContext} renderContext - The render context. - * @return {string} The depth/stencil GPU texture format. - */ - getCurrentDepthStencilFormat(renderContext: RenderContext): string; - /** - * Returns the GPU format for the given texture. - * - * @param {Texture} texture - The texture. - * @return {string} The GPU texture format. - */ - getTextureFormatGPU(texture: Texture): string; - /** - * Returns an object that defines the multi-sampling state of the given texture. - * - * @param {Texture} texture - The texture. - * @return {Object} The multi-sampling state. - */ - getTextureSampleData(texture: Texture): Object; - /** - * Returns the default color attachment's GPU format of the current render context. - * - * @param {RenderContext} renderContext - The render context. - * @return {string} The GPU texture format of the default color attachment. - */ - getCurrentColorFormat(renderContext: RenderContext): string; - /** - * Returns the GPU formats of all color attachments of the current render context. - * - * @param {RenderContext} renderContext - The render context. - * @return {Array} The GPU texture formats of all color attachments. - */ - getCurrentColorFormats(renderContext: RenderContext): Array; - /** - * Returns the output color space of the current render context. - * - * @param {RenderContext} renderContext - The render context. - * @return {string} The output color space. - */ - getCurrentColorSpace(renderContext: RenderContext): string; - /** - * Returns GPU primitive topology for the given object and material. - * - * @param {Object3D} object - The 3D object. - * @param {Material} material - The material. - * @return {string} The GPU primitive topology. - */ - getPrimitiveTopology(object: Object3D, material: Material): string; - /** - * Returns a modified sample count from the given sample count value. - * - * That is required since WebGPU only supports either 1 or 4. - * - * @param {number} sampleCount - The input sample count. - * @return {number} The (potentially updated) output sample count. - */ - getSampleCount(sampleCount: number): number; - /** - * Returns the sample count of the given render context. - * - * @param {RenderContext} renderContext - The render context. - * @return {number} The sample count. - */ - getSampleCountRenderContext(renderContext: RenderContext): number; - /** - * Returns the preferred canvas format. - * - * There is a separate method for this so it's possible to - * honor edge cases for specific devices. - * - * @return {string} The GPU texture format of the canvas. - */ - getPreferredCanvasFormat(): string; -} diff --git a/jsdoc-testing/jsdoc/renderers/webxr/WebXRController.d.ts b/jsdoc-testing/jsdoc/renderers/webxr/WebXRController.d.ts deleted file mode 100644 index 91dbb3340..000000000 --- a/jsdoc-testing/jsdoc/renderers/webxr/WebXRController.d.ts +++ /dev/null @@ -1,96 +0,0 @@ -/** - * Class for representing a XR controller with its - * different coordinate systems. - * - * @private - */ -export class WebXRController { - /** - * A group representing the target ray space - * of the XR controller. - * - * @private - * @type {?Group} - * @default null - */ - private _targetRay; - /** - * A group representing the grip space - * of the XR controller. - * - * @private - * @type {?Group} - * @default null - */ - private _grip; - /** - * A group representing the hand space - * of the XR controller. - * - * @private - * @type {?Group} - * @default null - */ - private _hand; - /** - * Returns a group representing the hand space of the XR controller. - * - * @return {Group} A group representing the hand space of the XR controller. - */ - getHandSpace(): Group; - /** - * Returns a group representing the target ray space of the XR controller. - * - * @return {Group} A group representing the target ray space of the XR controller. - */ - getTargetRaySpace(): Group; - /** - * Returns a group representing the grip space of the XR controller. - * - * @return {Group} A group representing the grip space of the XR controller. - */ - getGripSpace(): Group; - /** - * Dispatches the given event to the groups representing - * the different coordinate spaces of the XR controller. - * - * @param {Object} event - The event to dispatch. - * @return {WebXRController} A reference to this instance. - */ - dispatchEvent(event: Object): WebXRController; - /** - * Connects the controller with the given XR input source. - * - * @param {XRInputSource} inputSource - The input source. - * @return {WebXRController} A reference to this instance. - */ - connect(inputSource: XRInputSource): WebXRController; - /** - * Disconnects the controller from the given XR input source. - * - * @param {XRInputSource} inputSource - The input source. - * @return {WebXRController} A reference to this instance. - */ - disconnect(inputSource: XRInputSource): WebXRController; - /** - * Updates the controller with the given input source, XR frame and reference space. - * This updates the transformations of the groups that represent the different - * coordinate systems of the controller. - * - * @param {XRInputSource} inputSource - The input source. - * @param {XRFrame} frame - The XR frame. - * @param {XRReferenceSpace} referenceSpace - The reference space. - * @return {WebXRController} A reference to this instance. - */ - update(inputSource: XRInputSource, frame: XRFrame, referenceSpace: XRReferenceSpace): WebXRController; - /** - * Returns a group representing the hand joint for the given input joint. - * - * @private - * @param {Group} hand - The group representing the hand space. - * @param {XRJointSpace} inputjoint - The hand joint data. - * @return {Group} A group representing the hand joint for the given input joint. - */ - private _getHandJoint; -} -import { Group } from '../../objects/Group.js'; diff --git a/jsdoc-testing/jsdoc/scenes/Fog.d.ts b/jsdoc-testing/jsdoc/scenes/Fog.d.ts deleted file mode 100644 index 3c17089bd..000000000 --- a/jsdoc-testing/jsdoc/scenes/Fog.d.ts +++ /dev/null @@ -1,70 +0,0 @@ -/** - * This class can be used to define a linear fog that grows linearly denser - * with the distance. - * - * ```js - * const scene = new THREE.Scene(); - * scene.fog = new THREE.Fog( 0xcccccc, 10, 15 ); - * ``` - */ -export class Fog { - /** - * Constructs a new fog. - * - * @param {number|Color} color - The fog's color. - * @param {number} [near=1] - The minimum distance to start applying fog. - * @param {number} [far=1000] - The maximum distance at which fog stops being calculated and applied. - */ - constructor(color: number | Color, near?: number, far?: number); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isFog: boolean; - /** - * The name of the fog. - * - * @type {string} - */ - name: string; - /** - * The fog's color. - * - * @type {Color} - */ - color: Color; - /** - * The minimum distance to start applying fog. Objects that are less than - * `near` units from the active camera won't be affected by fog. - * - * @type {number} - * @default 1 - */ - near: number; - /** - * The maximum distance at which fog stops being calculated and applied. - * Objects that are more than `far` units away from the active camera won't - * be affected by fog. - * - * @type {number} - * @default 1000 - */ - far: number; - /** - * Returns a new fog with copied values from this instance. - * - * @return {Fog} A clone of this instance. - */ - clone(): Fog; - /** - * Serializes the fog into JSON. - * - * @param {?(Object|string)} meta - An optional value holding meta information about the serialization. - * @return {Object} A JSON object representing the serialized fog - */ - toJSON(): Object; -} -import { Color } from '../math/Color.js'; diff --git a/jsdoc-testing/jsdoc/scenes/FogExp2.d.ts b/jsdoc-testing/jsdoc/scenes/FogExp2.d.ts deleted file mode 100644 index e11462391..000000000 --- a/jsdoc-testing/jsdoc/scenes/FogExp2.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -/** - * This class can be used to define an exponential squared fog, - * which gives a clear view near the camera and a faster than exponentially - * densening fog farther from the camera. - * - * ```js - * const scene = new THREE.Scene(); - * scene.fog = new THREE.FogExp2( 0xcccccc, 0.002 ); - * ``` - */ -export class FogExp2 { - /** - * Constructs a new fog. - * - * @param {number|Color} color - The fog's color. - * @param {number} [density=0.00025] - Defines how fast the fog will grow dense. - */ - constructor(color: number | Color, density?: number); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isFogExp2: boolean; - /** - * The name of the fog. - * - * @type {string} - */ - name: string; - /** - * The fog's color. - * - * @type {Color} - */ - color: Color; - /** - * Defines how fast the fog will grow dense. - * - * @type {number} - * @default 0.00025 - */ - density: number; - /** - * Returns a new fog with copied values from this instance. - * - * @return {FogExp2} A clone of this instance. - */ - clone(): FogExp2; - /** - * Serializes the fog into JSON. - * - * @param {?(Object|string)} meta - An optional value holding meta information about the serialization. - * @return {Object} A JSON object representing the serialized fog - */ - toJSON(): Object; -} -import { Color } from '../math/Color.js'; diff --git a/jsdoc-testing/jsdoc/scenes/Scene.d.ts b/jsdoc-testing/jsdoc/scenes/Scene.d.ts deleted file mode 100644 index 91ed09ab6..000000000 --- a/jsdoc-testing/jsdoc/scenes/Scene.d.ts +++ /dev/null @@ -1,97 +0,0 @@ -/** - * Scenes allow you to set up what is to be rendered and where by three.js. - * This is where you place 3D objects like meshes, lines or lights. - * - * @augments Object3D - */ -export class Scene extends Object3D { - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isScene: boolean; - type: string; - /** - * Defines the background of the scene. Valid inputs are: - * - * - A color for defining a uniform colored background. - * - A texture for defining a (flat) textured background. - * - Cube textures or equirectangular textures for defining a skybox. - * - * @type {?(Color|Texture)} - * @default null - */ - background: (Color | Texture) | null; - /** - * Sets the environment map for all physical materials in the scene. However, - * it's not possible to overwrite an existing texture assigned to the `envMap` - * material property. - * - * @type {?Texture} - * @default null - */ - environment: Texture | null; - /** - * A fog instance defining the type of fog that affects everything - * rendered in the scene. - * - * @type {?(Fog|FogExp2)} - * @default null - */ - fog: (Fog | FogExp2) | null; - /** - * Sets the blurriness of the background. Only influences environment maps - * assigned to {@link Scene#background}. Valid input is a float between `0` - * and `1`. - * - * @type {number} - * @default 0 - */ - backgroundBlurriness: number; - /** - * Attenuates the color of the background. Only applies to background textures. - * - * @type {number} - * @default 1 - */ - backgroundIntensity: number; - /** - * The rotation of the background in radians. Only influences environment maps - * assigned to {@link Scene#background}. - * - * @type {Euler} - * @default (0,0,0) - */ - backgroundRotation: Euler; - /** - * Attenuates the color of the environment. Only influences environment maps - * assigned to {@link Scene#environment}. - * - * @type {number} - * @default 1 - */ - environmentIntensity: number; - /** - * The rotation of the environment map in radians. Only influences physical materials - * in the scene when {@link Scene#environment} is used. - * - * @type {Euler} - * @default (0,0,0) - */ - environmentRotation: Euler; - /** - * Forces everything in the scene to be rendered with the defined material. It is possible - * to exclude materials from override by setting {@link Material#allowOverride} to `false`. - * - * @type {?Material} - * @default null - */ - overrideMaterial: Material | null; - copy(source: any, recursive: any): this; - toJSON(meta: any): Object; -} -import { Object3D } from '../core/Object3D.js'; -import { Euler } from '../math/Euler.js'; diff --git a/jsdoc-testing/jsdoc/textures/CubeDepthTexture.d.ts b/jsdoc-testing/jsdoc/textures/CubeDepthTexture.d.ts deleted file mode 100644 index c436fb9e7..000000000 --- a/jsdoc-testing/jsdoc/textures/CubeDepthTexture.d.ts +++ /dev/null @@ -1,51 +0,0 @@ -/** - * This class can be used to automatically save the depth information of a - * cube rendering into a cube texture with depth format. Used for PointLight shadows. - * - * @augments DepthTexture - */ -export class CubeDepthTexture extends DepthTexture { - /** - * Constructs a new cube depth texture. - * - * @param {number} size - The size (width and height) of each cube face. - * @param {number} [type=UnsignedIntType] - The texture type. - * @param {number} [mapping=CubeReflectionMapping] - The texture mapping. - * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value. - * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value. - * @param {number} [magFilter=NearestFilter] - The mag filter value. - * @param {number} [minFilter=NearestFilter] - The min filter value. - * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value. - * @param {number} [format=DepthFormat] - The texture format. - */ - constructor(size: number, type?: number, mapping?: number, wrapS?: number, wrapT?: number, magFilter?: number, minFilter?: number, anisotropy?: number, format?: number); - image: { - width: number; - height: number; - depth: number; - }[]; - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isCubeDepthTexture: boolean; - /** - * Set to true for cube texture handling in WebGLTextures. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isCubeTexture: boolean; - set images(value: Array HTMLImageElement>); - /** - * Alias for {@link CubeDepthTexture#image}. - * - * @type {Array} - */ - get images(): Array HTMLImageElement>; -} -import { DepthTexture } from './DepthTexture.js'; diff --git a/jsdoc-testing/jsdoc/textures/CubeTexture.d.ts b/jsdoc-testing/jsdoc/textures/CubeTexture.d.ts deleted file mode 100644 index 76c1ce43d..000000000 --- a/jsdoc-testing/jsdoc/textures/CubeTexture.d.ts +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Creates a cube texture made up of six images. - * - * ```js - * const loader = new THREE.CubeTextureLoader(); - * loader.setPath( 'textures/cube/pisa/' ); - * - * const textureCube = loader.load( [ - * 'px.png', 'nx.png', 'py.png', 'ny.png', 'pz.png', 'nz.png' - * ] ); - * - * const material = new THREE.MeshBasicMaterial( { color: 0xffffff, envMap: textureCube } ); - * ``` - * - * @augments Texture - */ -export class CubeTexture extends Texture { - /** - * Constructs a new cube texture. - * - * @param {Array} [images=[]] - An array holding a image for each side of a cube. - * @param {number} [mapping=CubeReflectionMapping] - The texture mapping. - * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value. - * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value. - * @param {number} [magFilter=LinearFilter] - The mag filter value. - * @param {number} [minFilter=LinearMipmapLinearFilter] - The min filter value. - * @param {number} [format=RGBAFormat] - The texture format. - * @param {number} [type=UnsignedByteType] - The texture type. - * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value. - * @param {string} [colorSpace=NoColorSpace] - The color space value. - */ - constructor(images?: Array HTMLImageElement>, mapping?: number, wrapS?: number, wrapT?: number, magFilter?: number, minFilter?: number, format?: number, type?: number, anisotropy?: number, colorSpace?: string); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isCubeTexture: boolean; - set images(value: Array HTMLImageElement>); - /** - * Alias for {@link CubeTexture#image}. - * - * @type {Array} - */ - get images(): Array HTMLImageElement>; -} -import { Texture } from './Texture.js'; diff --git a/jsdoc-testing/jsdoc/textures/DataArrayTexture.d.ts b/jsdoc-testing/jsdoc/textures/DataArrayTexture.d.ts deleted file mode 100644 index 7b9225b8e..000000000 --- a/jsdoc-testing/jsdoc/textures/DataArrayTexture.d.ts +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Creates an array of textures directly from raw buffer data. - * - * @augments Texture - */ -export class DataArrayTexture extends Texture { - /** - * Constructs a new data array texture. - * - * @param {?TypedArray} [data=null] - The buffer data. - * @param {number} [width=1] - The width of the texture. - * @param {number} [height=1] - The height of the texture. - * @param {number} [depth=1] - The depth of the texture. - */ - constructor(data?: TypedArray | null, width?: number, height?: number, depth?: number); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isDataArrayTexture: boolean; - /** - * This defines how the texture is wrapped in the depth and corresponds to - * *W* in UVW mapping. - * - * @type {(RepeatWrapping|ClampToEdgeWrapping|MirroredRepeatWrapping)} - * @default ClampToEdgeWrapping - */ - wrapR: (RepeatWrapping | number | MirroredRepeatWrapping); - /** - * A set of all layers which need to be updated in the texture. - * - * @type {Set} - */ - layerUpdates: Set; - /** - * Describes that a specific layer of the texture needs to be updated. - * Normally when {@link Texture#needsUpdate} is set to `true`, the - * entire data texture array is sent to the GPU. Marking specific - * layers will only transmit subsets of all mipmaps associated with a - * specific depth in the array which is often much more performant. - * - * @param {number} layerIndex - The layer index that should be updated. - */ - addLayerUpdate(layerIndex: number): void; - /** - * Resets the layer updates registry. - */ - clearLayerUpdates(): void; -} -import { Texture } from './Texture.js'; diff --git a/jsdoc-testing/jsdoc/textures/DataTexture.d.ts b/jsdoc-testing/jsdoc/textures/DataTexture.d.ts deleted file mode 100644 index 8bec07e5d..000000000 --- a/jsdoc-testing/jsdoc/textures/DataTexture.d.ts +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Creates a texture directly from raw buffer data. - * - * The interpretation of the data depends on type and format: If the type is - * `UnsignedByteType`, a `Uint8Array` will be useful for addressing the - * texel data. If the format is `RGBAFormat`, data needs four values for - * one texel; Red, Green, Blue and Alpha (typically the opacity). - * - * @augments Texture - */ -export class DataTexture extends Texture { - /** - * Constructs a new data texture. - * - * @param {?TypedArray} [data=null] - The buffer data. - * @param {number} [width=1] - The width of the texture. - * @param {number} [height=1] - The height of the texture. - * @param {number} [format=RGBAFormat] - The texture format. - * @param {number} [type=UnsignedByteType] - The texture type. - * @param {number} [mapping=Texture.DEFAULT_MAPPING] - The texture mapping. - * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value. - * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value. - * @param {number} [magFilter=NearestFilter] - The mag filter value. - * @param {number} [minFilter=NearestFilter] - The min filter value. - * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value. - * @param {string} [colorSpace=NoColorSpace] - The color space. - */ - constructor(data?: TypedArray | null, width?: number, height?: number, format?: number, type?: number, mapping?: number, wrapS?: number, wrapT?: number, magFilter?: number, minFilter?: number, anisotropy?: number, colorSpace?: string); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isDataTexture: boolean; -} -import { Texture } from './Texture.js'; diff --git a/jsdoc-testing/jsdoc/textures/DepthTexture.d.ts b/jsdoc-testing/jsdoc/textures/DepthTexture.d.ts deleted file mode 100644 index 7d3a969ed..000000000 --- a/jsdoc-testing/jsdoc/textures/DepthTexture.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * This class can be used to automatically save the depth information of a - * rendering into a texture. - * - * @augments Texture - */ -export class DepthTexture extends Texture { - /** - * Constructs a new depth texture. - * - * @param {number} width - The width of the texture. - * @param {number} height - The height of the texture. - * @param {number} [type=UnsignedIntType] - The texture type. - * @param {number} [mapping=Texture.DEFAULT_MAPPING] - The texture mapping. - * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value. - * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value. - * @param {number} [magFilter=LinearFilter] - The mag filter value. - * @param {number} [minFilter=LinearFilter] - The min filter value. - * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value. - * @param {number} [format=DepthFormat] - The texture format. - * @param {number} [depth=1] - The depth of the texture. - */ - constructor(width: number, height: number, type?: number, mapping?: number, wrapS?: number, wrapT?: number, magFilter?: number, minFilter?: number, anisotropy?: number, format?: number, depth?: number); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isDepthTexture: boolean; - /** - * Code corresponding to the depth compare function. - * - * @type {?(NeverCompare|LessCompare|EqualCompare|LessEqualCompare|GreaterCompare|NotEqualCompare|GreaterEqualCompare|AlwaysCompare)} - * @default null - */ - compareFunction: (NeverCompare | LessCompare | EqualCompare | LessEqualCompare | GreaterCompare | NotEqualCompare | GreaterEqualCompare | AlwaysCompare) | null; - copy(source: any): this; - toJSON(meta: any): Object; -} -import { Texture } from './Texture.js'; diff --git a/jsdoc-testing/jsdoc/textures/FramebufferTexture.d.ts b/jsdoc-testing/jsdoc/textures/FramebufferTexture.d.ts deleted file mode 100644 index 0de9064c8..000000000 --- a/jsdoc-testing/jsdoc/textures/FramebufferTexture.d.ts +++ /dev/null @@ -1,42 +0,0 @@ -/** - * This class can only be used in combination with `copyFramebufferToTexture()` methods - * of renderers. It extracts the contents of the current bound framebuffer and provides it - * as a texture for further usage. - * - * ```js - * const pixelRatio = window.devicePixelRatio; - * const textureSize = 128 * pixelRatio; - * - * const frameTexture = new FramebufferTexture( textureSize, textureSize ); - * - * // calculate start position for copying part of the frame data - * const vector = new Vector2(); - * vector.x = ( window.innerWidth * pixelRatio / 2 ) - ( textureSize / 2 ); - * vector.y = ( window.innerHeight * pixelRatio / 2 ) - ( textureSize / 2 ); - * - * renderer.render( scene, camera ); - * - * // copy part of the rendered frame into the framebuffer texture - * renderer.copyFramebufferToTexture( frameTexture, vector ); - * ``` - * - * @augments Texture - */ -export class FramebufferTexture extends Texture { - /** - * Constructs a new framebuffer texture. - * - * @param {number} [width] - The width of the texture. - * @param {number} [height] - The height of the texture. - */ - constructor(width?: number, height?: number); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isFramebufferTexture: boolean; -} -import { Texture } from './Texture.js'; diff --git a/jsdoc-testing/jsdoc/textures/Source.d.ts b/jsdoc-testing/jsdoc/textures/Source.d.ts deleted file mode 100644 index d4fbed15c..000000000 --- a/jsdoc-testing/jsdoc/textures/Source.d.ts +++ /dev/null @@ -1,78 +0,0 @@ -/** - * Represents the data source of a texture. - * - * The main purpose of this class is to decouple the data definition from the texture - * definition so the same data can be used with multiple texture instances. - */ -export class Source { - /** - * Constructs a new video texture. - * - * @param {any} [data=null] - The data definition of a texture. - */ - constructor(data?: any); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isSource: boolean; - /** - * The UUID of the source. - * - * @type {string} - * @readonly - */ - readonly uuid: string; - /** - * The data definition of a texture. - * - * @type {any} - */ - data: any; - /** - * This property is only relevant when {@link Source#needsUpdate} is set to `true` and - * provides more control on how texture data should be processed. When `dataReady` is set - * to `false`, the engine performs the memory allocation (if necessary) but does not transfer - * the data into the GPU memory. - * - * @type {boolean} - * @default true - */ - dataReady: boolean; - /** - * This starts at `0` and counts how many times {@link Source#needsUpdate} is set to `true`. - * - * @type {number} - * @readonly - * @default 0 - */ - readonly version: number; - /** - * Returns the dimensions of the source into the given target vector. - * - * @param {(Vector2|Vector3)} target - The target object the result is written into. - * @return {(Vector2|Vector3)} The dimensions of the source. - */ - getSize(target: (Vector2 | Vector3)): (Vector2 | Vector3); - /** - * When the property is set to `true`, the engine allocates the memory - * for the texture (if necessary) and triggers the actual texture upload - * to the GPU next time the source is used. - * - * @type {boolean} - * @default false - * @param {boolean} value - */ - set needsUpdate(value: boolean); - /** - * Serializes the source into JSON. - * - * @param {?(Object|string)} meta - An optional value holding meta information about the serialization. - * @return {Object} A JSON object representing the serialized source. - * @see {@link ObjectLoader#parse} - */ - toJSON(meta: (Object | string) | null): Object; -} diff --git a/jsdoc-testing/jsdoc/textures/Texture.d.ts b/jsdoc-testing/jsdoc/textures/Texture.d.ts deleted file mode 100644 index 49013a925..000000000 --- a/jsdoc-testing/jsdoc/textures/Texture.d.ts +++ /dev/null @@ -1,405 +0,0 @@ -/** - * Base class for all textures. - * - * Note: After the initial use of a texture, its dimensions, format, and type - * cannot be changed. Instead, call {@link Texture#dispose} on the texture and instantiate a new one. - * - * @augments EventDispatcher - */ -export class Texture extends EventDispatcher { - /** - * Constructs a new texture. - * - * @param {?Object} [image=Texture.DEFAULT_IMAGE] - The image holding the texture data. - * @param {number} [mapping=Texture.DEFAULT_MAPPING] - The texture mapping. - * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value. - * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value. - * @param {number} [magFilter=LinearFilter] - The mag filter value. - * @param {number} [minFilter=LinearMipmapLinearFilter] - The min filter value. - * @param {number} [format=RGBAFormat] - The texture format. - * @param {number} [type=UnsignedByteType] - The texture type. - * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value. - * @param {string} [colorSpace=NoColorSpace] - The color space. - */ - constructor(image?: Object | null, mapping?: number, wrapS?: number, wrapT?: number, magFilter?: number, minFilter?: number, format?: number, type?: number, anisotropy?: number, colorSpace?: string); - /** - * This flag can be used for type testing. - * - * @type {boolean} - * @readonly - * @default true - */ - readonly isTexture: boolean; - /** - * The UUID of the texture. - * - * @type {string} - * @readonly - */ - readonly uuid: string; - /** - * The name of the texture. - * - * @type {string} - */ - name: string; - /** - * The data definition of a texture. A reference to the data source can be - * shared across textures. This is often useful in context of spritesheets - * where multiple textures render the same data but with different texture - * transformations. - * - * @type {Source} - */ - source: Source; - /** - * An array holding user-defined mipmaps. - * - * @type {Array} - */ - mipmaps: Array; - /** - * How the texture is applied to the object. The value `UVMapping` - * is the default, where texture or uv coordinates are used to apply the map. - * - * @type {(UVMapping|CubeReflectionMapping|CubeRefractionMapping|EquirectangularReflectionMapping|EquirectangularRefractionMapping|CubeUVReflectionMapping)} - * @default UVMapping - */ - mapping: (number | CubeReflectionMapping | CubeRefractionMapping | EquirectangularReflectionMapping | EquirectangularRefractionMapping | CubeUVReflectionMapping); - /** - * Lets you select the uv attribute to map the texture to. `0` for `uv`, - * `1` for `uv1`, `2` for `uv2` and `3` for `uv3`. - * - * @type {number} - * @default 0 - */ - channel: number; - /** - * This defines how the texture is wrapped horizontally and corresponds to - * *U* in UV mapping. - * - * @type {(RepeatWrapping|ClampToEdgeWrapping|MirroredRepeatWrapping)} - * @default ClampToEdgeWrapping - */ - wrapS: (number | number | number); - /** - * This defines how the texture is wrapped horizontally and corresponds to - * *V* in UV mapping. - * - * @type {(RepeatWrapping|ClampToEdgeWrapping|MirroredRepeatWrapping)} - * @default ClampToEdgeWrapping - */ - wrapT: (number | number | number); - /** - * How the texture is sampled when a texel covers more than one pixel. - * - * @type {(NearestFilter|NearestMipmapNearestFilter|NearestMipmapLinearFilter|LinearFilter|LinearMipmapNearestFilter|LinearMipmapLinearFilter)} - * @default LinearFilter - */ - magFilter: (NearestFilter | NearestMipmapNearestFilter | NearestMipmapLinearFilter | number | LinearMipmapNearestFilter | number); - /** - * How the texture is sampled when a texel covers less than one pixel. - * - * @type {(NearestFilter|NearestMipmapNearestFilter|NearestMipmapLinearFilter|LinearFilter|LinearMipmapNearestFilter|LinearMipmapLinearFilter)} - * @default LinearMipmapLinearFilter - */ - minFilter: (NearestFilter | NearestMipmapNearestFilter | NearestMipmapLinearFilter | number | LinearMipmapNearestFilter | number); - /** - * The number of samples taken along the axis through the pixel that has the - * highest density of texels. By default, this value is `1`. A higher value - * gives a less blurry result than a basic mipmap, at the cost of more - * texture samples being used. - * - * @type {number} - * @default Texture.DEFAULT_ANISOTROPY - */ - anisotropy: number; - /** - * The format of the texture. - * - * @type {number} - * @default RGBAFormat - */ - format: number; - /** - * The default internal format is derived from {@link Texture#format} and {@link Texture#type} and - * defines how the texture data is going to be stored on the GPU. - * - * This property allows to overwrite the default format. - * - * @type {?string} - * @default null - */ - internalFormat: string | null; - /** - * The data type of the texture. - * - * @type {number} - * @default UnsignedByteType - */ - type: number; - /** - * How much a single repetition of the texture is offset from the beginning, - * in each direction U and V. Typical range is `0.0` to `1.0`. - * - * @type {Vector2} - * @default (0,0) - */ - offset: Vector2; - /** - * How many times the texture is repeated across the surface, in each - * direction U and V. If repeat is set greater than `1` in either direction, - * the corresponding wrap parameter should also be set to `RepeatWrapping` - * or `MirroredRepeatWrapping` to achieve the desired tiling effect. - * - * @type {Vector2} - * @default (1,1) - */ - repeat: Vector2; - /** - * The point around which rotation occurs. A value of `(0.5, 0.5)` corresponds - * to the center of the texture. Default is `(0, 0)`, the lower left. - * - * @type {Vector2} - * @default (0,0) - */ - center: Vector2; - /** - * How much the texture is rotated around the center point, in radians. - * Positive values are counter-clockwise. - * - * @type {number} - * @default 0 - */ - rotation: number; - /** - * Whether to update the texture's uv-transformation {@link Texture#matrix} - * from the properties {@link Texture#offset}, {@link Texture#repeat}, - * {@link Texture#rotation}, and {@link Texture#center}. - * - * Set this to `false` if you are specifying the uv-transform matrix directly. - * - * @type {boolean} - * @default true - */ - matrixAutoUpdate: boolean; - /** - * The uv-transformation matrix of the texture. - * - * @type {Matrix3} - */ - matrix: Matrix3; - /** - * Whether to generate mipmaps (if possible) for a texture. - * - * Set this to `false` if you are creating mipmaps manually. - * - * @type {boolean} - * @default true - */ - generateMipmaps: boolean; - /** - * If set to `true`, the alpha channel, if present, is multiplied into the - * color channels when the texture is uploaded to the GPU. - * - * Note that this property has no effect when using `ImageBitmap`. You need to - * configure premultiply alpha on bitmap creation instead. - * - * @type {boolean} - * @default false - */ - premultiplyAlpha: boolean; - /** - * If set to `true`, the texture is flipped along the vertical axis when - * uploaded to the GPU. - * - * Note that this property has no effect when using `ImageBitmap`. You need to - * configure the flip on bitmap creation instead. - * - * @type {boolean} - * @default true - */ - flipY: boolean; - /** - * Specifies the alignment requirements for the start of each pixel row in memory. - * The allowable values are `1` (byte-alignment), `2` (rows aligned to even-numbered bytes), - * `4` (word-alignment), and `8` (rows start on double-word boundaries). - * - * @type {number} - * @default 4 - */ - unpackAlignment: number; - /** - * Textures containing color data should be annotated with `SRGBColorSpace` or `LinearSRGBColorSpace`. - * - * @type {string} - * @default NoColorSpace - */ - colorSpace: string; - /** - * An object that can be used to store custom data about the texture. It - * should not hold references to functions as these will not be cloned. - * - * @type {Object} - */ - userData: Object; - /** - * This can be used to only update a subregion or specific rows of the texture (for example, just the - * first 3 rows). Use the `addUpdateRange()` function to add ranges to this array. - * - * @type {Array} - */ - updateRanges: Array; - /** - * This starts at `0` and counts how many times {@link Texture#needsUpdate} is set to `true`. - * - * @type {number} - * @readonly - * @default 0 - */ - readonly version: number; - /** - * A callback function, called when the texture is updated (e.g., when - * {@link Texture#needsUpdate} has been set to true and then the texture is used). - * - * @type {?Function} - * @default null - */ - onUpdate: Function | null; - /** - * An optional back reference to the textures render target. - * - * @type {?(RenderTarget|WebGLRenderTarget)} - * @default null - */ - renderTarget: (RenderTarget | WebGLRenderTarget) | null; - /** - * Indicates whether a texture belongs to a render target or not. - * - * @type {boolean} - * @readonly - * @default false - */ - readonly isRenderTargetTexture: boolean; - /** - * Indicates if a texture should be handled like a texture array. - * - * @type {boolean} - * @readonly - * @default false - */ - readonly isArrayTexture: boolean; - /** - * Indicates whether this texture should be processed by `PMREMGenerator` or not - * (only relevant for render target textures). - * - * @type {number} - * @readonly - * @default 0 - */ - readonly pmremVersion: number; - /** - * The width of the texture in pixels. - */ - get width(): any; - /** - * The height of the texture in pixels. - */ - get height(): any; - /** - * The depth of the texture in pixels. - */ - get depth(): any; - set image(value: Object | null); - /** - * The image object holding the texture data. - * - * @type {?Object} - */ - get image(): Object | null; - /** - * Updates the texture transformation matrix from the properties {@link Texture#offset}, - * {@link Texture#repeat}, {@link Texture#rotation}, and {@link Texture#center}. - */ - updateMatrix(): void; - /** - * Adds a range of data in the data texture to be updated on the GPU. - * - * @param {number} start - Position at which to start update. - * @param {number} count - The number of components to update. - */ - addUpdateRange(start: number, count: number): void; - /** - * Clears the update ranges. - */ - clearUpdateRanges(): void; - /** - * Returns a new texture with copied values from this instance. - * - * @return {Texture} A clone of this instance. - */ - clone(): Texture; - /** - * Copies the values of the given texture to this instance. - * - * @param {Texture} source - The texture to copy. - * @return {Texture} A reference to this instance. - */ - copy(source: Texture): Texture; - /** - * Setting this property to `true` indicates the engine the texture - * must be updated in the next render. This triggers a texture upload - * to the GPU and ensures correct texture parameter configuration. - * - * @type {boolean} - * @default false - * @param {boolean} value - */ - set needsUpdate(value: boolean); - /** - * Sets this texture's properties based on `values`. - * @param {Object} values - A container with texture parameters. - */ - setValues(values: Object): void; - /** - * Serializes the texture into JSON. - * - * @param {?(Object|string)} meta - An optional value holding meta information about the serialization. - * @return {Object} A JSON object representing the serialized texture. - * @see {@link ObjectLoader#parse} - */ - toJSON(meta: (Object | string) | null): Object; - /** - * Frees the GPU-related resources allocated by this instance. Call this - * method whenever this instance is no longer used in your app. - * - * @fires Texture#dispose - */ - dispose(): void; - /** - * Transforms the given uv vector with the textures uv transformation matrix. - * - * @param {Vector2} uv - The uv vector. - * @return {Vector2} The transformed uv vector. - */ - transformUv(uv: Vector2): Vector2; - /** - * Setting this property to `true` indicates the engine the PMREM - * must be regenerated. - * - * @type {boolean} - * @default false - * @param {boolean} value - */ - set needsPMREMUpdate(value: boolean); -} -export namespace Texture { - export let DEFAULT_IMAGE: (new (width?: number, height?: number) => HTMLImageElement) | null; - export { UVMapping as DEFAULT_MAPPING }; - export let DEFAULT_ANISOTROPY: number; -} -import { EventDispatcher } from '../core/EventDispatcher.js'; -import { Source } from './Source.js'; -import { Vector2 } from '../math/Vector2.js'; -import { Matrix3 } from '../math/Matrix3.js'; -import { UVMapping } from '../constants.js'; diff --git a/jsdoc-testing/jsdoc/utils.d.ts b/jsdoc-testing/jsdoc/utils.d.ts deleted file mode 100644 index 21c16ba39..000000000 --- a/jsdoc-testing/jsdoc/utils.d.ts +++ /dev/null @@ -1,185 +0,0 @@ -/** - * Finds the minimum value in an array. - * - * @private - * @param {Array} array - The array to search for the minimum value. - * @return {number} The minimum value in the array, or Infinity if the array is empty. - */ -export function arrayMin(array: Array): number; -/** - * Finds the maximum value in an array. - * - * @private - * @param {Array} array - The array to search for the maximum value. - * @return {number} The maximum value in the array, or -Infinity if the array is empty. - */ -export function arrayMax(array: Array): number; -/** - * Checks if an array contains values that require Uint32 representation. - * - * This function determines whether the array contains any values >= 65535, - * which would require a Uint32Array rather than a Uint16Array for proper storage. - * The function iterates from the end of the array, assuming larger values are - * typically located at the end. - * - * @private - * @param {Array} array - The array to check. - * @return {boolean} True if the array contains values >= 65535, false otherwise. - */ -export function arrayNeedsUint32(array: Array): boolean; -/** - * Creates a typed array of the specified type from the given buffer. - * - * @private - * @param {string} type - The name of the typed array type (e.g., 'Float32Array', 'Uint16Array'). - * @param {ArrayBuffer} buffer - The buffer to create the typed array from. - * @return {TypedArray} A new typed array of the specified type. - */ -export function getTypedArray(type: string, buffer: ArrayBuffer): TypedArray; -/** - * Creates an XHTML element with the specified tag name. - * - * This function uses the XHTML namespace to create DOM elements, - * ensuring proper element creation in XML-based contexts. - * - * @private - * @param {string} name - The tag name of the element to create (e.g., 'canvas', 'div'). - * @return {HTMLElement} The created XHTML element. - */ -export function createElementNS(name: string): HTMLElement; -/** - * Creates a canvas element configured for block display. - * - * This is a convenience function that creates a canvas element with - * display style set to 'block', which is commonly used in three.js - * rendering contexts to avoid inline element spacing issues. - * - * @return {HTMLCanvasElement} A canvas element with display set to 'block'. - */ -export function createCanvasElement(): HTMLCanvasElement; -/** - * Sets a custom function to handle console output. - * - * This allows external code to intercept and handle console.log, console.warn, - * and console.error calls made by three.js, which is useful for custom logging, - * testing, or debugging workflows. - * - * @param {Function} fn - The function to handle console output. Should accept - * (type, message, ...params) where type is 'log', 'warn', or 'error'. - */ -export function setConsoleFunction(fn: Function): void; -/** - * Gets the currently set custom console function. - * - * @return {Function|null} The custom console function, or null if not set. - */ -export function getConsoleFunction(): Function | null; -/** - * Logs an informational message with the 'THREE.' prefix. - * - * If a custom console function is set via setConsoleFunction(), it will be used - * instead of the native console.log. The first parameter is treated as the - * method name and is automatically prefixed with 'THREE.'. - * - * @param {...any} params - The message components. The first param is used as - * the method name and prefixed with 'THREE.'. - */ -export function log(...params: any[]): void; -/** - * Logs a warning message with the 'THREE.' prefix. - * - * If a custom console function is set via setConsoleFunction(), it will be used - * instead of the native console.warn. The first parameter is treated as the - * method name and is automatically prefixed with 'THREE.'. - * - * @param {...any} params - The message components. The first param is used as - * the method name and prefixed with 'THREE.'. - */ -export function warn(...params: any[]): void; -/** - * Logs an error message with the 'THREE.' prefix. - * - * If a custom console function is set via setConsoleFunction(), it will be used - * instead of the native console.error. The first parameter is treated as the - * method name and is automatically prefixed with 'THREE.'. - * - * @param {...any} params - The message components. The first param is used as - * the method name and prefixed with 'THREE.'. - */ -export function error(...params: any[]): void; -/** - * Logs a warning message only once, preventing duplicate warnings. - * - * This function maintains an internal cache of warning messages and will only - * output each unique warning message once. Useful for warnings that may be - * triggered repeatedly but should only be shown to the user once. - * - * @param {...any} params - The warning message components. - */ -export function warnOnce(...params: any[]): void; -/** - * Asynchronously probes for WebGL sync object completion. - * - * This function creates a promise that resolves when the WebGL sync object - * signals completion or rejects if the sync operation fails. It uses polling - * at the specified interval to check the sync status without blocking the - * main thread. This is useful for GPU-CPU synchronization in WebGL contexts. - * - * @private - * @param {WebGL2RenderingContext} gl - The WebGL rendering context. - * @param {WebGLSync} sync - The WebGL sync object to wait for. - * @param {number} interval - The polling interval in milliseconds. - * @return {Promise} A promise that resolves when the sync completes or rejects if it fails. - */ -export function probeAsync(gl: WebGL2RenderingContext, sync: WebGLSync, interval: number): Promise; -/** - * Yields execution to the main thread to allow rendering and other tasks. - * Uses scheduler.yield() when available (Chrome 115+), falls back to requestAnimationFrame. - * - * @return {Promise} - */ -export function yieldToMain(): Promise; -/** - * Converts a projection matrix from normalized device coordinates (NDC) - * range [-1, 1] to [0, 1]. - * - * This conversion is commonly needed when working with depth textures or - * render targets that expect depth values in the [0, 1] range rather than - * the standard OpenGL NDC range of [-1, 1]. The function modifies the - * projection matrix in place. - * - * @private - * @param {Matrix4} projectionMatrix - The projection matrix to convert (modified in place). - */ -export function toNormalizedProjectionMatrix(projectionMatrix: Matrix4): void; -/** - * Reverses the depth range of a projection matrix. - * - * This function inverts the depth mapping of a projection matrix, which is - * useful for reversed-Z depth buffer techniques that can improve depth - * precision. The function handles both perspective and orthographic projection - * matrices differently and modifies the matrix in place. - * - * For perspective matrices (where m[11] === -1), the depth mapping is - * reversed with an offset. For orthographic matrices, a simpler reversal - * is applied. - * - * @private - * @param {Matrix4} projectionMatrix - The projection matrix to reverse (modified in place). - */ -export function toReversedProjectionMatrix(projectionMatrix: Matrix4): void; -/** - * Returns `true` if the given object is a typed array. - * - * @param {any} array - The object to check. - * @return {boolean} Whether the given object is a typed array. - */ -export function isTypedArray(array: any): boolean; -/** - * Used to select the correct depth functions - * when reversed depth buffer is used. - * - * @private - * @type {Object} - */ -export const ReversedDepthFuncs: Object; From 902f8ae0258135d0f178e1e090cea1bf87e547b1 Mon Sep 17 00:00:00 2001 From: Nathan Bierema Date: Wed, 25 Mar 2026 21:39:38 -0400 Subject: [PATCH 4/4] Update declarations --- types/three/src/renderers/common/Info.d.ts | 15 +++++++++++++++ types/three/src/renderers/common/Renderer.d.ts | 5 +++-- .../src/renderers/common/nodes/NodeManager.d.ts | 8 -------- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/types/three/src/renderers/common/Info.d.ts b/types/three/src/renderers/common/Info.d.ts index 50612ce86..ef4a3cd96 100644 --- a/types/three/src/renderers/common/Info.d.ts +++ b/types/three/src/renderers/common/Info.d.ts @@ -1,6 +1,7 @@ import { BufferAttribute } from "../../core/BufferAttribute.js"; import { Object3D } from "../../core/Object3D.js"; import { Texture } from "../../textures/Texture.js"; +import ProgrammableStage from "./ProgrammableStage.js"; /** * This renderer module provides a series of statistical information @@ -91,6 +92,7 @@ declare class Info { * @property {number} indexAttributesSize - The memory size of active index attributes in bytes. * @property {number} storageAttributesSize - The memory size of active storage attributes in bytes. * @property {number} indirectStorageAttributesSize - The memory size of active indirect storage attributes in bytes. + * @property {number} programsSize - The memory size of active programs in bytes. */ readonly memory: { geometries: number; @@ -107,6 +109,7 @@ declare class Info { indexAttributesSize: number; storageAttributesSize: number; indirectStorageAttributesSize: number; + programsSize: number; }; /** * Map for storing calculated byte sizes of tracked objects. @@ -181,6 +184,18 @@ declare class Info { * @param {BufferAttribute} attribute */ destroyAttribute(attribute: BufferAttribute): void; + /** + * Tracks program memory explicitly, updating counts and byte tracking. + * + * @param {ProgrammableStage} program - The program to track. + */ + createProgram(program: ProgrammableStage): void; + /** + * Tracks program memory explicitly, updating counts and byte tracking. + * + * @param {Object} program - The program to track. + */ + destroyProgram(program: ProgrammableStage): void; /** * Calculates the memory size of a texture in bytes. * diff --git a/types/three/src/renderers/common/Renderer.d.ts b/types/three/src/renderers/common/Renderer.d.ts index 6d0bf0f19..e65664213 100644 --- a/types/three/src/renderers/common/Renderer.d.ts +++ b/types/three/src/renderers/common/Renderer.d.ts @@ -359,13 +359,14 @@ declare class Renderer { */ private _background; /** + * Cache for the fullscreen quad. * This fullscreen quad is used for internal render passes * like the tone mapping and color space output pass. * * @private - * @type {QuadMesh} + * @type {Map} */ - private _quad; + private _quadCache; /** * A reference to the current render context. * diff --git a/types/three/src/renderers/common/nodes/NodeManager.d.ts b/types/three/src/renderers/common/nodes/NodeManager.d.ts index e04c43685..2acfc4502 100644 --- a/types/three/src/renderers/common/nodes/NodeManager.d.ts +++ b/types/three/src/renderers/common/nodes/NodeManager.d.ts @@ -261,14 +261,6 @@ declare class NodeManager extends DataMap { * @return {string} The output cache key. */ getOutputCacheKey(): string; - /** - * Checks if the output configuration (tone mapping and color space) for - * the given target has changed. - * - * @param {Texture} outputTarget - The output target. - * @return {boolean} Whether the output configuration has changed or not. - */ - hasOutputChange(outputTarget: Texture): boolean; /** * Returns a node that represents the output configuration (tone mapping and * color space) for the current target.