From e8f01744e2097d9671af0b24e5c41aaf1bd704a9 Mon Sep 17 00:00:00 2001 From: Nathan Bierema Date: Sun, 22 Sep 2024 14:33:19 -0400 Subject: [PATCH] TSL: Export color space, tone mapping methods --- types/three/src/nodes/TSL.d.ts | 276 ++++++------------ .../src/nodes/accessors/MaterialNode.d.ts | 1 - .../nodes/display/ColorSpaceFunctions.d.ts | 4 +- .../nodes/display/ToneMappingFunctions.d.ts | 12 +- 4 files changed, 98 insertions(+), 195 deletions(-) diff --git a/types/three/src/nodes/TSL.d.ts b/types/three/src/nodes/TSL.d.ts index 916f93faa..330db889a 100644 --- a/types/three/src/nodes/TSL.d.ts +++ b/types/three/src/nodes/TSL.d.ts @@ -23,32 +23,21 @@ export * from "./math/MathUtils.js"; export * from "./math/TriNoise3D.js"; // utils -export { default as EquirectUVNode, equirectUV } from "./utils/EquirectUVNode.js"; -export { default as FunctionOverloadingNode, overloadingFn } from "./utils/FunctionOverloadingNode.js"; -export { Break, Continue, default as LoopNode, Loop } from "./utils/LoopNode.js"; -export { default as MatcapUVNode, matcapUV } from "./utils/MatcapUVNode.js"; -export { default as MaxMipLevelNode, maxMipLevel } from "./utils/MaxMipLevelNode.js"; -export { default as OscNode, OscNodeMethod, oscSawtooth, oscSine, oscSquare, oscTriangle } from "./utils/OscNode.js"; +export * from "./utils/EquirectUVNode.js"; +export * from "./utils/FunctionOverloadingNode.js"; +export * from "./utils/LoopNode.js"; +export * from "./utils/MatcapUVNode.js"; +export * from "./utils/MaxMipLevelNode.js"; +export * from "./utils/OscNode.js"; export * from "./utils/Packing.js"; -export { default as ReflectorNode, reflector, ReflectorNodeParameters } from "./utils/ReflectorNode.js"; -export { default as RemapNode, remap, remapClamp } from "./utils/RemapNode.js"; -export { default as RotateNode, rotate } from "./utils/RotateNode.js"; -export { convertToTexture, default as RTTNode, rtt, RTTNodeOptions } from "./utils/RTTNode.js"; -export { default as SpriteSheetUVNode, spritesheetUV } from "./utils/SpriteSheetUVNode.js"; +export * from "./utils/ReflectorNode.js"; +export * from "./utils/RemapNode.js"; +export * from "./utils/RotateNode.js"; +export * from "./utils/RTTNode.js"; +export * from "./utils/SpriteSheetUVNode.js"; export * from "./utils/SpriteUtils.js"; -export { - default as TimerNode, - frameId, - timerDelta, - timerGlobal, - timerLocal, - TimerNodeScope, -} from "./utils/TimerNode.js"; -export { - default as TriplanarTexturesNode, - triplanarTexture, - triplanarTextures, -} from "./utils/TriplanarTexturesNode.js"; +export * from "./utils/TimerNode.js"; +export * from "./utils/TriplanarTexturesNode.js"; export * from "./utils/UVUtils.js"; export * from "./utils/ViewportUtils.js"; @@ -57,195 +46,110 @@ export * from "./tsl/TSLBase.js"; // accessors export * from "./accessors/AccessorsUtils.js"; -export { batch, default as BatchNode } from "./accessors/BatchNode.js"; +export * from "./accessors/BatchNode.js"; export * from "./accessors/Bitangent.js"; -export { - bufferAttribute, - default as BufferAttributeNode, - dynamicBufferAttribute, - instancedBufferAttribute, - instancedDynamicBufferAttribute, -} from "./accessors/BufferAttributeNode.js"; -export { buffer, default as BufferNode } from "./accessors/BufferNode.js"; +export * from "./accessors/BufferAttributeNode.js"; +export * from "./accessors/BufferNode.js"; export * from "./accessors/Camera.js"; -export { cubeTexture, default as CubeTextureNode } from "./accessors/CubeTextureNode.js"; -export { default as InstanceNode, instance } from "./accessors/InstanceNode.js"; -export { - default as MaterialNode, - materialAlphaTest, - materialAnisotropy, - materialAnisotropyVector, - materialAOMap, - materialClearcoat, - materialClearcoatNormal, - materialClearcoatRoughness, - materialColor, - materialDispersion, - materialEmissive, - materialIridescence, - materialIridescenceIOR, - materialIridescenceThickness, - materialLightMap, - materialLineDashOffset, - materialLineDashSize, - materialLineGapSize, - materialLineScale, - materialLineWidth, - materialMetalness, - MaterialNodeScope, - materialNormal, - materialOpacity, - materialPointWidth, - materialReflectivity, - materialRotation, - materialRoughness, - materialSheen, - materialSheenRoughness, - materialShininess, - materialSpecular, - materialSpecularStrength, -} from "./accessors/MaterialNode.js"; +export * from "./accessors/CubeTextureNode.js"; +export * from "./accessors/InstanceNode.js"; +export * from "./accessors/MaterialNode.js"; export * from "./accessors/MaterialProperties.js"; -export { default as MaterialReferenceNode, materialReference } from "./accessors/MaterialReferenceNode.js"; -export { - default as ModelNode, - modelDirection, - modelNormalMatrix, - modelPosition, - modelScale, - modelViewMatrix, - modelViewPosition, - modelWorldMatrix, - modelWorldMatrixInverse, -} from "./accessors/ModelNode.js"; -export { default as ModelViewProjectionNode, modelViewProjection } from "./accessors/ModelViewProjectionNode.js"; -export { default as MorphNode, morphReference } from "./accessors/MorphNode.js"; +export * from "./accessors/MaterialReferenceNode.js"; +export * from "./accessors/ModelNode.js"; +export * from "./accessors/ModelViewProjectionNode.js"; +export * from "./accessors/MorphNode.js"; export * from "./accessors/Normal.js"; -export { - default as Object3DNode, - objectDirection, - objectNormalMatrix, - objectPosition, - objectScale, - objectViewMatrix, - objectViewPosition, - objectWorldMatrix, -} from "./accessors/Object3DNode.js"; -export { default as PointUVNode, pointUV } from "./accessors/PointUVNode.js"; +export * from "./accessors/Object3DNode.js"; +export * from "./accessors/PointUVNode.js"; export * from "./accessors/Position.js"; -export { default as ReferenceNode, reference, referenceBuffer } from "./accessors/ReferenceNode.js"; +export * from "./accessors/ReferenceNode.js"; export * from "./accessors/ReflectVector.js"; -export { default as RendererReferenceNode, rendererReference } from "./accessors/RendererReferenceNode.js"; -export { - backgroundBlurriness, - backgroundIntensity, - default as SceneNode, - SceneNodeScope, -} from "./accessors/SceneNode.js"; -export { default as SkinningNode, skinning, skinningReference } from "./accessors/SkinningNode.js"; -export { default as StorageBufferNode, storage, storageObject } from "./accessors/StorageBufferNode.js"; -export { default as StorageTextureNode, storageTexture, textureStore } from "./accessors/StorageTextureNode.js"; +export * from "./accessors/RendererReferenceNode.js"; +export * from "./accessors/SceneNode.js"; +export * from "./accessors/SkinningNode.js"; +export * from "./accessors/StorageBufferNode.js"; +export * from "./accessors/StorageTextureNode.js"; export * from "./accessors/Tangent.js"; -export { default as Texture3DNode, texture3D } from "./accessors/Texture3DNode.js"; +export * from "./accessors/Texture3DNode.js"; export * from "./accessors/TextureBicubic.js"; -export { default as TextureNode, /*textureLevel,*/ sampler, texture, textureLoad } from "./accessors/TextureNode.js"; -export { default as TextureSizeNode, textureSize } from "./accessors/TextureSizeNode.js"; -export { default as UniformArrayNode, uniformArray } from "./accessors/UniformArrayNode.js"; -export { default as UserDataNode, NodeUserData, userData } from "./accessors/UserDataNode.js"; +export * from "./accessors/TextureNode.js"; +export * from "./accessors/TextureSizeNode.js"; +export * from "./accessors/UniformArrayNode.js"; +export * from "./accessors/UserDataNode.js"; export * from "./accessors/UV.js"; export * from "./accessors/VelocityNode.js"; -export { default as VertexColorNode, vertexColor } from "./accessors/VertexColorNode.js"; +export * from "./accessors/VertexColorNode.js"; // display -export { afterImage, default as AfterImageNode } from "./display/AfterImageNode.js"; -export { anaglyphPass, default as AnaglyphPassNode } from "./display/AnaglyphPassNode.js"; -export { anamorphic, default as AnamorphicNode } from "./display/AnamorphicNode.js"; -export { bleach } from "./display/BleachBypass.js"; +export * from "./display/AfterImageNode.js"; +export * from "./display/AnaglyphPassNode.js"; +export * from "./display/AnamorphicNode.js"; +export * from "./display/BleachBypass.js"; export * from "./display/BlendMode.js"; -export { bloom, default as BloomNode } from "./display/BloomNode.js"; -export { bumpMap, default as BumpMapNode } from "./display/BumpMapNode.js"; +export * from "./display/BloomNode.js"; +export * from "./display/BumpMapNode.js"; export * from "./display/ColorAdjustment.js"; -export { default as ColorSpaceNode, toOutputColorSpace, toWorkingColorSpace } from "./display/ColorSpaceNode.js"; -export { default as DenoiseNode, denoise } from "./display/DenoiseNode.js"; -export { default as DepthOfFieldNode, dof } from "./display/DepthOfFieldNode.js"; -export { default as DotScreenNode, dotScreen } from "./display/DotScreenNode.js"; -export { default as FilmNode, film } from "./display/FilmNode.js"; -export { default as FrontFacingNode, faceDirection, frontFacing } from "./display/FrontFacingNode.js"; -export { default as FXAANode, fxaa } from "./display/FXAANode.js"; -export { default as GaussianBlurNode, gaussianBlur } from "./display/GaussianBlurNode.js"; -export { ao, default as GTAONode } from "./display/GTAONode.js"; -export { default as Lut3DNode, lut3D } from "./display/Lut3DNode.js"; +export * from "./display/ColorSpaceNode.js"; +export * from "./display/DenoiseNode.js"; +export * from "./display/DepthOfFieldNode.js"; +export * from "./display/DotScreenNode.js"; +export * from "./display/FilmNode.js"; +export * from "./display/FrontFacingNode.js"; +export * from "./display/FXAANode.js"; +export * from "./display/GaussianBlurNode.js"; +export * from "./display/GTAONode.js"; +export * from "./display/Lut3DNode.js"; export * from "./display/MotionBlur.js"; -export { default as NormalMapNode, normalMap } from "./display/NormalMapNode.js"; -export { default as ParallaxBarrierPassNode, parallaxBarrierPass } from "./display/ParallaxBarrierPassNode.js"; -export { default as PixelationPassNode, pixelationPass } from "./display/PixelationPassNode.js"; -export { default as PosterizeNode, posterize } from "./display/PosterizeNode.js"; -export { default as RenderOutputNode, renderOutput } from "./display/RenderOutputNode.js"; -export { default as RGBShiftNode, rgbShift } from "./display/RGBShiftNode.js"; -export { sepia } from "./display/Sepia.js"; -export { default as SobelOperatorNode, sobel } from "./display/SobelOperatorNode.js"; -export { default as SSAAPassNode, ssaaPass } from "./display/SSAAPassNode.js"; -export { default as StereoPassNode, stereoPass } from "./display/StereoPassNode.js"; -export { default as ToneMappingNode, toneMapping } from "./display/ToneMappingNode.js"; -export { default as TransitionNode, transition } from "./display/TransitionNode.js"; -export { - default as ViewportDepthNode, - depth, - linearDepth, - orthographicDepthToViewZ, - perspectiveDepthToViewZ, - viewportLinearDepth, - viewZToOrthographicDepth, - viewZToPerspectiveDepth, -} from "./display/ViewportDepthNode.js"; -export { default as ViewportDepthTextureNode, viewportDepthTexture } from "./display/ViewportDepthTextureNode.js"; -export { - default as ViewportNode, - viewport, - viewportBottomLeft, - viewportCoordinate, - ViewportNodeScope, - viewportResolution, - viewportTopLeft, - viewportUV, -} from "./display/ViewportNode.js"; -export { default as ViewportSharedTextureNode, viewportSharedTexture } from "./display/ViewportSharedTextureNode.js"; -export { default as ViewportTextureNode, viewportMipTexture, viewportTexture } from "./display/ViewportTextureNode.js"; - -export { default as PassNode, depthPass, pass, PassNodeScope, passTexture } from "./display/PassNode.js"; - -import * as ColorSpaceFunctions from "./display/ColorSpaceFunctions.js"; -export { ColorSpaceFunctions }; - -import * as ToneMappingFunctions from "./display/ToneMappingFunctions.js"; -export { ToneMappingFunctions }; +export * from "./display/NormalMapNode.js"; +export * from "./display/ParallaxBarrierPassNode.js"; +export * from "./display/PixelationPassNode.js"; +export * from "./display/PosterizeNode.js"; +export * from "./display/RenderOutputNode.js"; +export * from "./display/RGBShiftNode.js"; +export * from "./display/Sepia.js"; +export * from "./display/SobelOperatorNode.js"; +export * from "./display/SSAAPassNode.js"; +export * from "./display/StereoPassNode.js"; +export * from "./display/ToneMappingNode.js"; +export * from "./display/TransitionNode.js"; +export * from "./display/ViewportDepthNode.js"; +export * from "./display/ViewportDepthTextureNode.js"; +export * from "./display/ViewportNode.js"; +export * from "./display/ViewportSharedTextureNode.js"; +export * from "./display/ViewportTextureNode.js"; + +export * from "./display/PassNode.js"; + +export * from "./display/ColorSpaceFunctions.js"; +export * from "./display/ToneMappingFunctions.js"; // code -export { code, CodeNodeInclude, default as CodeNode, glsl, js, wgsl } from "./code/CodeNode.js"; -export { default as ExpressionNode, expression } from "./code/ExpressionNode.js"; -export { call, default as FunctionCallNode } from "./code/FunctionCallNode.js"; -export { default as FunctionNode, glslFn, wgslFn } from "./code/FunctionNode.js"; -export { default as ScriptableNode, global, scriptable } from "./code/ScriptableNode.js"; -export { default as ScriptableValueNode, scriptableValue } from "./code/ScriptableValueNode.js"; +export * from "./code/CodeNode.js"; +export * from "./code/ExpressionNode.js"; +export * from "./code/FunctionCallNode.js"; +export * from "./code/FunctionNode.js"; +export * from "./code/ScriptableNode.js"; +export * from "./code/ScriptableValueNode.js"; // fog -export { default as FogExp2Node, densityFog } from "./fog/FogExp2Node.js"; -export { default as FogNode, fog } from "./fog/FogNode.js"; -export { default as FogRangeNode, rangeFog } from "./fog/FogRangeNode.js"; +export * from "./fog/FogExp2Node.js"; +export * from "./fog/FogNode.js"; +export * from "./fog/FogRangeNode.js"; // geometry -export { default as RangeNode, range, RangeModeBound } from "./geometry/RangeNode.js"; +export * from "./geometry/RangeNode.js"; // gpgpu -export { compute, default as ComputeNode } from "./gpgpu/ComputeNode.js"; +export * from "./gpgpu/ComputeNode.js"; // lighting -export { default as LightingContextNode, lightingContext } from "./lighting/LightingContextNode.js"; -export { default as LightNode, LightNodeScope, lightTargetDirection } from "./lighting/LightNode.js"; -export { default as LightsNode, lights } from "./lighting/LightsNode.js"; +export * from "./lighting/LightingContextNode.js"; +export * from "./lighting/LightNode.js"; +export * from "./lighting/LightsNode.js"; // pmrem -export { default as PMREMNode, pmremTexture } from "./pmrem/PMREMNode.js"; +export * from "./pmrem/PMREMNode.js"; export * from "./pmrem/PMREMUtils.js"; // procedural diff --git a/types/three/src/nodes/accessors/MaterialNode.d.ts b/types/three/src/nodes/accessors/MaterialNode.d.ts index fa3ca6753..a29160b0e 100644 --- a/types/three/src/nodes/accessors/MaterialNode.d.ts +++ b/types/three/src/nodes/accessors/MaterialNode.d.ts @@ -126,5 +126,4 @@ export const materialPointWidth: ShaderNodeObject; export const materialDispersion: ShaderNodeObject; export const materialLightMap: ShaderNodeObject; export const materialAOMap: ShaderNodeObject; -export const materialRefractionRatio: ShaderNodeObject; export const materialAnisotropyVector: ShaderNodeObject>; diff --git a/types/three/src/nodes/display/ColorSpaceFunctions.d.ts b/types/three/src/nodes/display/ColorSpaceFunctions.d.ts index f9cd6f7af..b828686f5 100644 --- a/types/three/src/nodes/display/ColorSpaceFunctions.d.ts +++ b/types/three/src/nodes/display/ColorSpaceFunctions.d.ts @@ -1,6 +1,6 @@ import Node from "../core/Node.js"; import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js"; -export const sRGBToLinear: (color: NodeRepresentation) => ShaderNodeObject; +export const sRGBToLinearSRGB: (color: NodeRepresentation) => ShaderNodeObject; -export const LinearTosRGB: (color: NodeRepresentation) => ShaderNodeObject; +export const linearSRGBTosRGB: (color: NodeRepresentation) => ShaderNodeObject; diff --git a/types/three/src/nodes/display/ToneMappingFunctions.d.ts b/types/three/src/nodes/display/ToneMappingFunctions.d.ts index 57d80c4aa..b972d6b6f 100644 --- a/types/three/src/nodes/display/ToneMappingFunctions.d.ts +++ b/types/three/src/nodes/display/ToneMappingFunctions.d.ts @@ -1,14 +1,14 @@ import Node from "../core/Node.js"; import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js"; -export const LinearToneMapping: (color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject; +export const linearToneMapping: (color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject; -export const ReinhardToneMapping: (color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject; +export const reinhardToneMapping: (color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject; -export const CineonToneMapping: (color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject; +export const cineonToneMapping: (color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject; -export const ACESFilmicToneMapping: (color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject; +export const acesFilmicToneMapping: (color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject; -export const AgXToneMapping: (color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject; +export const agxToneMapping: (color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject; -export const NeutralToneMapping: (color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject; +export const neutralToneMapping: (color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject;