import type { TSLFloatInput, TSLFloatNode, TSLFunction, TSLVec2Node, TSLVec3Node, TSLVec4Node } from '../types/tsl.js'; /** Placement and display-size controls accepted by {@link sphereImpostorPosition}. */ export interface SphereImpostorPositionConfig { /** Particle center in object-local space. */ position?: TSLVec3Node | undefined; /** Sphere radius in object-local units. */ radius?: TSLFloatInput | undefined; /** Optional lower bound for the projected radius in display pixels. */ minPixelRadius?: TSLFloatInput | null | undefined; /** Optional upper bound for the projected radius in display pixels. */ maxPixelRadius?: TSLFloatInput | null | undefined; /** Display resolution used by pixel-radius clamps, or the active target when null. */ screenSizeNode?: TSLVec2Node | null | undefined; /** Optional normalized view-plane direction for elliptical stretching. */ stretchDirection?: TSLVec2Node | null | undefined; /** Multiplier applied along the stretch direction. */ stretch?: TSLFloatInput | undefined; } /** * Assemble an equilateral, camera-facing triangle around a particle center. * * The returned position is in object-local space so the standard NodeMaterial * position pipeline continues to derive coherent view/world positions, fog, * clipping, and shadow coordinates. The source geometry contributes only the * three-vertex draw count; its position values are replaced. * * @tsl * @function * @param {Object} config - Sphere impostor inputs. * @param {Node} config.position - Particle center in object-local space. * @param {Node|number} [config.radius=1] - Sphere radius in object-local units. * @param {?Node|number} [config.minPixelRadius=null] - Optional lower screen-radius clamp. * @param {?Node|number} [config.maxPixelRadius=null] - Optional upper screen-radius clamp. * @param {?Node} [config.screenSizeNode=null] - Resolution used for pixel clamps. Defaults * to the active render target; pass the final display resolution when drawing into a reduced target. * @param {?Node} [config.stretchDirection=null] - View-plane direction for an elliptical billboard. * @param {Node|number} [config.stretch=1] - Major-axis multiplier; canonical sphere UVs stay circular. * @return {Node} Billboard vertex position in object-local space. */ export declare const sphereImpostorPosition: TSLFunction<[config: SphereImpostorPositionConfig], TSLVec3Node>; /** * Read the canonical sphere coordinates written by sphereImpostorPosition(). * The circle silhouette is `dot( sphereImpostorUV(), sphereImpostorUV() ) <= 1`. * * @tsl * @function * @return {Node} Interpolated sphere coordinates in the range [-1, 1] on the disc. */ export declare const sphereImpostorUV: TSLFunction<[], TSLVec2Node>; /** * Return the squared canonical distance from the center of the impostor. * * @tsl * @function * @return {Node} Squared sphere-impostor radius. */ export declare const sphereImpostorR2: TSLFunction<[], TSLFloatNode>; /** * Reconstruct the cheap camera-facing hemisphere normal in view space. * This is exact for orthographic projection and the particle-scale approximation * for perspective views. Pair true depth or screen-space AO with * sphereImpostorSurfaceNormalView() instead. * * @tsl * @function * @return {Node} Unit sphere normal in view space. */ export declare const sphereImpostorNormalView: TSLFunction<[], TSLVec3Node>; /** * Alias for sphereImpostorNormalView(), intended for NodeMaterial.normalNode. * * @tsl * @function * @return {Node} Unit sphere normal in view space. */ export declare const sphereImpostorNormal: TSLFunction<[], TSLVec3Node>; /** * Reconstruct the projection-correct sphere normal from the camera-ray/sphere * intersection used by sphereImpostorDepth(). This is more expensive than the * particle-scale hemisphere normal, so use it when true depth or a depth-based * screen-space effect such as GTAO is active. * * @tsl * @function * @return {Node} Projection-consistent unit sphere normal in view space. */ export declare const sphereImpostorSurfaceNormalView: TSLFunction<[], TSLVec3Node>; /** * Alias for sphereImpostorSurfaceNormalView(), intended for NodeMaterial.normalNode. * * @tsl * @function * @return {Node} Projection-consistent unit sphere normal in view space. */ export declare const sphereImpostorSurfaceNormal: TSLFunction<[], TSLVec3Node>; /** * Reconstruct the sphere normal and hard-discard fragments outside the disc. * * This is a compatibility adapter for three r185's MeshNormalNodeMaterial, * whose setupDiffuseColor() override does not execute NodeMaterial's mask or * alpha-test path. Other presets should use sphereImpostorNormal() so cutout * and antialiasing remain in the stock opacity/alphaToCoverage pipeline. * * @tsl * @function * @return {Node} Unit sphere normal in view space with a hard disc cutout. */ export declare const sphereImpostorNormalCutout: TSLFunction<[], TSLVec3Node>; /** * Produce cutout alpha whose 0.5 crossing is the unit-circle silhouette. * Assign this to opacityNode and set material.alphaTest to 0.5. * * @tsl * @function * @return {Node} Sphere cutout alpha. */ export declare const sphereImpostorAlpha: TSLFunction<[], TSLFloatNode>; /** * Reconstruct projection-correct sphere depth from a view-space ray intersection. * The result is converted to the renderer's [0,1] depth convention for * perspective/orthographic and normal/reversed-depth configurations. * Assigning this node to material.depthNode is optional because fragment-depth * writes disable early depth rejection for the draw. * * @tsl * @function * @return {Node} Projected sphere-surface depth. */ export declare const sphereImpostorDepth: TSLFunction<[], TSLFloatNode>; /** * Produce a shadow color carrying the same circular alpha cutout as the beauty pass. * Assign this to material.castShadowNode while keeping alphaTest at 0.5. * * @tsl * @function * @return {Node} Black shadow color with sphere-impostor coverage in alpha. */ export declare const sphereImpostorShadow: TSLFunction<[], TSLVec4Node>; /** * View-space Z of the ray/sphere intersection used by sphereImpostorDepth(). * Negative in front of the camera (three's view-space convention). Screen-space * fluid depth splats store `sphereImpostorSurfaceViewZ().negate()` so empty * pixels can clear to zero. * * @tsl * @function * @return {Node} Sphere-surface view-space Z. */ export declare const sphereImpostorSurfaceViewZ: TSLFunction<[], TSLFloatNode>;