import type { TSLFloatInput, TSLIntInput, TSLMat4Node, TSLTextureInput, TSLFunction, TSLVec3Node } from '../types/tsl.cjs'; /** Arguments accepted by the public baked-animation matrix sampler. */ export type AnimationTextureMatrixArguments = [ textureNode: TSLTextureInput, frameIndex: TSLIntInput, framesCount: TSLIntInput, timeInterpolation?: TSLFloatInput, textureOffset?: TSLIntInput, idIndex?: TSLIntInput ]; /** Arguments accepted by baked-animation position and normal samplers. */ export type AnimationTextureVectorArguments = AnimationTextureMatrixArguments; /** * Sample a 4×4 transformation matrix from a baked animation texture (VAT/OAT). * Supports optional frame interpolation for smooth playback. * * **Algorithm** * - Computes texel address from `idIndex * framesCount + frameIndex` * - Fetches 4 consecutive texels representing matrix columns * - When interpolation > 0, blends with next frame's matrix * - Returns composed 4×4 transformation matrix * * **Texture Layout** * - Each matrix occupies 4 consecutive texels (columns stored as RGBA) * - Matrices are stored sequentially: `idIndex * framesCount + frameIndex` * - Compatible with EXR textures exported by {@link AnimationBakeMixer} * * **Use Cases** * - Vertex Animation Textures (VAT) with `vertexIndex` * - Object Animation Textures (OAT) with `instanceIndex` * - Custom animation sampling with manual frame control * * This implementation-level API is intentionally internal and has no public package import. * * @function animationTextureMatrix * @short TSL function that samples a 4x4 transform from a baked VAT/OAT texture with optional frame interpolation. * @category TSL * @tags WebGPU, WebGL * @tsl * @param {Node} textureNode Baked animation texture (EXR with transformation data). * @param {Node.} frameIndex Current frame index to sample. * @param {Node.} framesCount Total number of frames in the animation. * @param {Node.} [timeInterpolation=0] Interpolation factor [0..1] between current and next frame. * @param {Node.} [textureOffset=0] Offset in the texture for packed animations. * @param {Node.} [idIndex=vertexIndex] Index used to identify the vertex or instance (VAT uses `vertexIndex`, OAT uses `instanceIndex`). * @returns {Node.} Transformation matrix for the specified frame and ID. * @see AnimationBakeMixer * @see AnimationBakeLoader * @see animationTexturePosition * @see animationTextureNormal */ export declare const animationTextureMatrix: TSLFunction; /** * Sample transformed position from a baked animation texture. * Convenience wrapper that applies the animation matrix to `positionLocal`. * * **Algorithm** * - Retrieves transformation matrix via {@link animationTextureMatrix} * - Multiplies matrix by `vec4(positionLocal, 1.0)` for proper translation * - Returns transformed XYZ position * * **Use Cases** * - Quick setup for vertex/object animation with {@link AnimationBakeMixer} * - Procedural mesh deformation with baked keyframes * - Instanced object animation with unique timelines per instance * * This implementation-level API is intentionally internal and has no public package import. * * @function animationTexturePosition * @category TSL * @tsl * @tags WebGPU, WebGL * @param {Node} textureNode Baked animation texture. * @param {Node.} frameIndex Current frame index. * @param {Node.} framesCount Total frame count. * @param {Node.} [timeInterpolation=0] Interpolation factor [0..1]. * @param {Node.} [textureOffset=0] Offset in the texture for packed animations. * @param {Node.} [idIndex=vertexIndex] Vertex or instance index. * @returns {Node.} Transformed position. * @see AnimationBakeMixer * @see AnimationBakeLoader * @see animationTextureMatrix * @see animationTextureNormal */ export declare const animationTexturePosition: TSLFunction; /** * Sample transformed normal from a baked animation texture. * Correctly handles non-uniform scaling by normalizing the basis vectors. * * **Algorithm** * - Retrieves transformation matrix via {@link animationTextureMatrix} * - Extracts 3×3 rotation/scale basis from mat4 * - Computes per-axis scale factors via dot products * - Divides normal by scale factors before matrix multiplication * - Returns properly transformed normal vector * * **Technical Details** * - Handles non-uniform scaling correctly (unlike naive normal transformation) * - Renormalization prevents lighting artifacts on scaled geometries * - Compatible with both VAT (vertex normals) and OAT (instance normals) * * This implementation-level API is intentionally internal and has no public package import. * * @function animationTextureNormal * @category TSL * @tsl * @tags WebGPU, WebGL * @param {Node} textureNode Baked animation texture. * @param {Node.} frameIndex Current frame index. * @param {Node.} framesCount Total frame count. * @param {Node.} [timeInterpolation=0] Interpolation factor [0..1]. * @param {Node.} [textureOffset=0] Offset in the texture for packed animations. * @param {Node.} [idIndex=vertexIndex] Vertex or instance index. * @returns {Node.} Transformed normal. * @see AnimationBakeMixer * @see AnimationBakeLoader * @see animationTextureMatrix * @see animationTexturePosition */ export declare const animationTextureNormal: TSLFunction;