/** * TSL accessor nodes for Text and BatchedText components. * These nodes provide access to text-specific data in shader nodes. * * These nodes work in both vertex and fragment shaders, similar to * Three.js's instanceIndex and vertexIndex. In vertex shaders, they * read directly from attributes. In fragment shaders, they automatically * use varyings to pass the interpolated values. * * Raw text-node helpers are internal unless an explicit experimental entry point exports them. * * @module TextNodes */ import type { TSLFloatNode, TSLVec2Node, TSLVec3Node, TSLVec4Node } from '../types/tsl.js'; /** * Letter ID as a normalized float (0-1) representing the position * of the current glyph within the text. First letter is 0, last letter is 1. * * Works in both vertex shaders (positionNode) and fragment shaders (colorNode). * For BatchedText, this is the letter position within each individual text member. * * @example * import * as THREE from 'three'; * import { BatchedText, Text } from 'three-blocks/experimental/runtime-sdf-text'; * import { textDrawId } from 'three-blocks/experimental/runtime-sdf-text'; * import { uniformArray } from 'three/tsl'; * * const batch = new BatchedText(2, 20); * const first = new Text(); * first.text = 'FIRST'; * batch.addText(first); * const second = new Text(); * second.text = 'SECOND'; * batch.addText(second); * * const colors = uniformArray([ * new THREE.Vector3(0.1, 0.4, 1), * new THREE.Vector3(1, 0.2, 0.4), * ], 'vec3'); * batch.material.colorNode = colors.element(textDrawId); */ export declare const textLetterId: TSLFloatNode; /** * Draw/member ID as a float. For single Text instances, this is always 0. * For BatchedText, this is the index of the text member within the batch. * * Works in both vertex shaders (positionNode) and fragment shaders (colorNode). * * This implementation-level API is intentionally internal and has no public package import. */ export declare const textDrawId: TSLFloatNode; /** * Glyph UV coordinates as a vec2. These are the UV coordinates * within the current glyph's bounding box (0-1 range within the glyph). * * This implementation-level API is intentionally internal and has no public package import. */ export declare const textGlyphUV: TSLVec2Node; /** * Glyph dimensions as a vec2 (width, height) in local units. * * This implementation-level API is intentionally internal and has no public package import. */ export declare const textGlyphDimensions: TSLVec2Node; /** * UV coordinates across the entire text block (0-1 range). * This is useful for effects that span the whole text. * * This implementation-level API is intentionally internal and has no public package import. */ export declare const textUV: TSLVec2Node; /** * NDC (Normalized Device Coordinates) position. * Only available in screen-space text mode. * * This implementation-level API is intentionally internal and has no public package import. */ export declare const textNdc: TSLVec3Node; /** * Texture channel (0-3) used for the current glyph in the SDF atlas. * This is primarily for internal use by the SDF rendering. * * @type {Node} * @category Text * @private */ export declare const textTextureChannel: TSLFloatNode; /** * Texture UV bounds as a vec4 (startU, startV, endU, endV). * This is primarily for internal use by the SDF rendering. * * @type {Node} * @category Text * @private */ export declare const textTextureUVBounds: TSLVec4Node;