/** * BatchedTextNode - TSL node for BatchedText vertex transforms. * * This node follows the BatchNode pattern from three.js: * 1. First applies shared glyph transformation via textGlyphTransform * 2. Then applies per-member matrix transforms and billboarding * * The separation of concerns allows code reuse with TextNode while adding * batching-specific functionality (per-member matrices, billboarding). * * @module BatchedTextNode */ import type { BufferAttribute, InstancedInterleavedBuffer, StorageBufferAttribute, StorageInstancedBufferAttribute } from 'three/webgpu'; import type { TextNodeSource } from './TextNode.js'; import type { TSLFloatNode, TSLFunction, TSLUniformNode, TSLVec3Node } from '../types/tsl.js'; export interface BatchedTextNodeSource extends TextNodeSource { _usePackedGlyphs: boolean; _glyphPackedBoundsSIBA: StorageInstancedBufferAttribute | null; _glyphPackedMetaSSBO: StorageBufferAttribute | null; instanceMatrix: BufferAttribute | null; _paramsABuffer: InstancedInterleavedBuffer; _paramsBBuffer: InstancedInterleavedBuffer; _visFallbackSSBO: StorageBufferAttribute; } /** * Creates a TSL Fn that computes BatchedText vertex transforms. * * This function: * 1. Reads per-member parameters from storage buffers * 2. Uses shared textGlyphTransform for glyph geometry (code reuse with TextNode) * 3. Applies per-member matrix transformation * 4. Handles billboarding and curvature * * This node should be used in `material.setupVertex` to handle batched text geometry transformation. * * This implementation-level API is intentionally internal and has no public package import. */ export declare function batchedText(batchedText: BatchedTextNodeSource, uBillboard: TSLFloatNode | TSLUniformNode<'float', number>): TSLFunction<[], TSLVec3Node>;