/** * VAV TSL nodes — vertex-stage sampling of the mono plane stacks uploaded by {@link VAVMesh}. * The GPU twin of `decodeVAVFramePlanes`: position dequantization (16-bit hi/lo vs the clip * bounds) and octahedral normal decode, all via `textureLoad` on R8 data textures so the whole * reconstruction costs a handful of texel fetches per vertex — no CPU skinning, no compute. * * In the R8 atlas layout, vertex `i` of plane `p` lives at texel * `(i % width, p * rowsPerPlane + floor(i / width))`. * * These nodes index by `vertexIndex`, so they are meaningful in the VERTEX stage only: in the * fragment stage `vertexIndex` becomes a flat (per-triangle) varying and the result reads as * flat shading. Fragment-stage consumers (normalNode, aoNode, …) must be fed through * `.toVarying()` — see {@link VAVMesh#registerMaterial}. * * @module VAVNodes */ import type { TSLFloatNode, TSLFunction, TSLIntInput, TSLTextureInput, TSLVec3Node } from '../types/tsl.cjs'; /** Arguments accepted by the normalized VAV plane sampler. */ export type VAVPlaneArguments = [ map: TSLTextureInput, width: TSLIntInput, rowsPerPlane: TSLIntInput, planeIndex: TSLIntInput, idIndex?: TSLIntInput ]; /** Arguments accepted by the position dequantization sampler. */ export type VAVPositionArguments = [ map: TSLTextureInput, width: TSLIntInput, rowsPerPlane: TSLIntInput, boundsMin: TSLVec3Node, boundsSize: TSLVec3Node, idIndex?: TSLIntInput ]; /** Arguments accepted by the octahedral normal sampler. */ export type VAVOctNormalArguments = [ map: TSLTextureInput, width: TSLIntInput, rowsPerPlane: TSLIntInput, planeU: TSLIntInput, planeV: TSLIntInput, idIndex?: TSLIntInput ]; /** * Sample one plane byte as a normalized float (r8unorm → 0..1). * * @function vavPlane * @category TSL * @tsl * @tags WebGPU * @param {THREE.Texture} map R8 plane-stack texture. * @param {number|Node.} width Atlas width in texels. * @param {number|Node.} rowsPerPlane Rows per plane in the stack. * @param {number|Node.} planeIndex Plane index within the stack. * @param {Node.} [idIndex=vertexIndex] Vertex id. * @returns {Node.} The byte as 0..1. */ export declare const vavPlane: TSLFunction; /** * Reconstruct the local-space position of a vertex from one geometry plane stack: three * 16-bit hi/lo pairs dequantized against the clip bounds (6 texel loads). * * @function vavPosition * @category TSL * @tsl * @tags WebGPU * @param {THREE.Texture} map R8 geometry-track texture (6 stacked planes). * @param {number|Node.} width Atlas width in texels. * @param {number|Node.} rowsPerPlane Rows per plane in the stack. * @param {Node.} boundsMin Clip bounds minimum. * @param {Node.} boundsSize Clip bounds extent (max - min). * @param {Node.} [idIndex=vertexIndex] Vertex id. * @returns {Node.} Local-space position. */ export declare const vavPosition: TSLFunction; /** * Decode an octahedral-mapped unit normal from the two normal planes of the geometry track * (2 texel loads). GPU twin of `octDecodeNormal` in {@link module:VAVFrames}. * * @function vavOctNormal * @category TSL * @tsl * @tags WebGPU * @param {THREE.Texture} map R8 geometry-track texture. * @param {number|Node.} width Atlas width in texels. * @param {number|Node.} rowsPerPlane Rows per plane in the stack. * @param {number|Node.} planeU `normalOctU` plane index. * @param {number|Node.} planeV `normalOctV` plane index. * @param {Node.} [idIndex=vertexIndex] Vertex id. * @returns {Node.} Local-space unit normal. */ export declare const vavOctNormal: TSLFunction;