/** * TextColorNode - TSL Node for Text SDF color and opacity rendering. * * Follows the same pattern as InstanceNode and BatchNode from three.js. * This node handles SDF-based rendering of text, computing fill and outline * colors and opacity based on signed distance fields. * * @module TextColorNode */ import { Node } from 'three/webgpu'; import type { NodeBuilder } from 'three/webgpu'; import type { TSLNodeFactory, TSLTextureNode, TSLVec4Node } from '../types/tsl.cjs'; import type { TextNodeSource } from './TextNode.cjs'; export interface TextColorNodeSource extends TextNodeSource { sdfMap: TSLTextureNode | undefined; } export interface TextColorNodeFactory extends TSLNodeFactory<[ text: TextColorNodeSource, baseDiffuse?: TSLVec4Node | null ], TSLVec4Node> { setParameterLength(length: number): this; } /** * TextColorNode handles SDF-based color and opacity for Text rendering. * It computes fill color, outline color, and proper alpha based on * signed distance field values. * * @augments Node */ declare class TextColorNode extends Node<'vec4'> { static get type(): string; /** * Constructs a new TextColorNode. * * @param {Text} text - Reference to the Text instance. */ text: TextColorNodeSource; baseDiffuse: TSLVec4Node | null; constructor(text: TextColorNodeSource, baseDiffuse?: TSLVec4Node | null); /** * Sets up the SDF color and opacity computation. * Modifies diffuseColor with the computed SDF-based color and alpha. * * @param {NodeBuilder} builder - The current node builder. */ setup(_builder: NodeBuilder): TSLVec4Node; } export default TextColorNode; /** * TSL function for creating a TextColorNode. * * This node handles SDF-based rendering of text, computing fill and outline * colors and opacity based on signed distance fields. It should be used in * `material.setupDiffuseColor` to override the diffuse color with SDF rendering. * * This implementation-level API is intentionally internal and has no public package import. */ export declare const textColor: TextColorNodeFactory;