import * as THREE from 'three/webgpu'; import type { TSLTextureNode, TSLUniformNode } from '../types/tsl.cjs'; /** Instanced attribute names consumed by {@link BatchedMSDFTextNodeMaterial}. */ export declare const BATCHED_MSDF_TEXT_ATTRIBUTES: { /** vec4 — glyph quad (x, y, width, height) in the member's local layout units. */ readonly rect: "msdfRect"; /** vec2 — glyph pen origin (baseline-left) in the member's local layout units. */ readonly origin: "msdfOrigin"; /** vec4 — atlas UV rect (u0, v0, u1, v1); v0 at the glyph's TOP edge. */ readonly uvRect: "msdfUvRect"; /** float — member (slot) index; indexes the per-member matrix/color storage buffers. */ readonly member: "msdfMember"; /** float — normalized glyph index within its member (0‥1), for per-letter effects. */ readonly letter: "msdfLetter"; }; export interface BatchedMSDFTextNodeMaterialOptions { map?: THREE.Texture | null; screenSpace?: boolean; pixelSnap?: boolean; opacity?: number; distanceRange?: number; matrixBuffer: THREE.BufferAttribute; colorBuffer: THREE.BufferAttribute; } /** * Batched sibling of {@link MSDFTextNodeMaterial}: one instanced quad per glyph, but every * glyph also carries a `member` index so many independent text blocks share a single draw * call and a single atlas bind. Per-member transform and color live in storage buffers that * the vertex stage reads by member index — the whole "batch" is just that indirection, which * is why it stays as cheap and simple as the single-block path. * * Fragment decoding is identical to {@link MSDFTextNodeMaterial} (shared {@link msdfAlpha}), * so batched and single-block text render pixel-for-pixel the same. Color is per-member * (carried through a varying) rather than a single material uniform. * * @class BatchedMSDFTextNodeMaterial * @augments THREE.MeshBasicNodeMaterial * @short TSL node material for batched MSDF glyph quads with per-member matrices and color. * @category Text * @tags WebGPU, WebGL */ export declare class BatchedMSDFTextNodeMaterial extends THREE.MeshBasicNodeMaterial { static get type(): string; /** * @param {Object} [options] * @param {THREE.Texture|null} [options.map=null] - MSDF atlas texture (KTX2/DataTexture). * @param {boolean} [options.screenSpace=false] - Project member matrices from CSS pixels instead of the camera. * @param {boolean} [options.pixelSnap=true] - screenSpace only: snap glyph origins to * physical pixels for uniformly crisp stems at any DPR. Disable for smoothly animated text. * @param {number} [options.opacity=1] - Global opacity multiplied on top of per-member alpha. * @param {number} [options.distanceRange=4] - Atlas distance range in px (from the font JSON). * @param {THREE.BufferAttribute} options.matrixBuffer - Per-member matrices packed as four vec4 rows. * @param {THREE.BufferAttribute} options.colorBuffer - Per-member vec4 buffer (rgb + opacity). */ isScreenSpace: boolean; isPixelSnap: boolean; opacityUniform: TSLUniformNode<'float', number>; distanceRangeUniform: TSLUniformNode<'float', number>; weightBiasUniform: TSLUniformNode<'float', number>; offsetUniform: TSLUniformNode<'vec2', THREE.Vector2>; viewportUniform: TSLUniformNode<'vec2', THREE.Vector2>; depthUniform: TSLUniformNode<'float', number>; _atlasNode: TSLTextureNode; constructor({ map, screenSpace, pixelSnap, opacity, distanceRange, matrixBuffer, colorBuffer }: BatchedMSDFTextNodeMaterialOptions); /** * Binds an atlas texture, normalizing its sampling state for MSDF (linear, no mips, raw). * @param {THREE.Texture|null} map */ setMap(map: THREE.Texture | null): void; }