import * as THREE from 'three/webgpu'; import type { LightingModelDirectInput, MeshNormalNodeMaterialParameters, MeshStandardNodeMaterialParameters, MeshToonNodeMaterialParameters, NodeBuilder } from 'three/webgpu'; import type { TSLFloatInput, TSLVec3Node } from '../types/tsl.cjs'; /** Standard node-material parameters plus sphere-impostor placement controls. */ export interface SphereImpostorNodeMaterialParameters extends Omit { /** Particle center in object-local space, or null for the object origin. */ positionNode?: TSLVec3Node | null | undefined; /** Particle radius in object-local units. */ radiusNode?: TSLFloatInput | undefined; /** Whether to write analytic sphere depth and use the matching surface normal. */ sphereDepth?: boolean | undefined; } /** * MeshNormalNodeMaterial adapter that restores NodeMaterial's regular opacity, * alpha-test, and alpha-to-coverage setup before packing the view-space normal. * Three r185's built-in MeshNormalNodeMaterial overrides setupDiffuseColor() * without running that shared cutout path. */ export declare class SphereImpostorNormalNodeMaterial extends THREE.MeshNormalNodeMaterial { /** Stable material type name. */ static get type(): string; /** Runtime type guard that is always `true` for this material. */ isSphereImpostorNormalNodeMaterial: boolean; /** Create a normal-debug material that preserves sphere-impostor cutouts. */ constructor(parameters?: MeshNormalNodeMaterialParameters); setupDiffuseColor(builder?: NodeBuilder): void; } /** * Toon lighting model that evaluates the reconstructed per-fragment sphere * normal. Three r185's built-in ToonLightingModel reads normalGeometry directly, * which makes a one-triangle impostor shade as a flat triangle even when the * material has a normalNode. */ export declare class SphereImpostorToonLightingModel extends THREE.LightingModel { direct(lightData: LightingModelDirectInput): void; indirect(builder: NodeBuilder): void; } /** * MeshToonNodeMaterial adapter whose lighting ramp consumes sphereImpostorNormal(). * Wire the usual sphere-impostor position, opacity, normal, and shadow nodes to * this material exactly as for the other preset materials. */ export declare class SphereImpostorToonNodeMaterial extends THREE.MeshToonNodeMaterial { /** Stable material type name. */ static get type(): string; /** Runtime type guard that is always `true` for this material. */ isSphereImpostorToonNodeMaterial: boolean; /** Create a toon material whose lighting uses reconstructed sphere normals. */ constructor(parameters?: MeshToonNodeMaterialParameters); setupLightingModel(): SphereImpostorToonLightingModel; } /** * Standard-lit sphere impostors with SpriteNodeMaterial-style position semantics. * * `positionNode` is the particle center rather than an assembled vertex position; * `radiusNode` supplies its radius. Render a non-indexed three-vertex geometry and * set `mesh.count` for a one-triangle-per-particle instanced draw. * * @class SphereImpostorNodeMaterial * @extends THREE.MeshStandardNodeMaterial * @tags WebGPU, WebGL, TSL, Particles * @short Standard-lit one-triangle sphere impostors driven by node positions and radii. * @category Materials */ export declare class SphereImpostorNodeMaterial extends THREE.MeshStandardNodeMaterial { /** Stable material type name used by Three.js serialization and diagnostics. */ static get type(): string; /** Runtime type guard for sphere-impostor materials. */ readonly isSphereImpostorNodeMaterial: boolean; /** Particle center in object-local space, or null for the object origin. */ positionNode: TSLVec3Node | null; /** Particle radius in object-local units. */ radiusNode: TSLFloatInput; private readonly _spherePositionNode; private readonly _sphereDepthNode; private _sphereDepth; private readonly _sphereNormalNode; private readonly _sphereSurfaceNormalNode; private readonly _sphereNormalMRTNode; private readonly _sphereSurfaceNormalMRTNode; /** * Creates a standard-lit sphere-impostor material. The material owns its assembled shader * nodes and follows the normal Three.js material lifecycle; call `dispose()` when finished. * * @param {Object} [parameters={}] MeshStandardNodeMaterial parameters plus impostor inputs. * @param {import('../types/tsl.js').TSLVec3Node|null} [parameters.positionNode=null] Particle center in object-local space. * @param {import('../types/tsl.js').TSLFloatNode|number} [parameters.radiusNode=1] Particle radius in object-local units. * @param {boolean} [parameters.sphereDepth=false] Write projection-correct sphere depth and use the matching analytic normal for lighting and the normal MRT. */ constructor(parameters?: SphereImpostorNodeMaterialParameters); /** * Whether to write projection-correct sphere depth. The default normal and * normal MRT switch to the same ray/sphere surface while this is enabled. * * @type {boolean} */ get sphereDepth(): boolean; set sphereDepth(value: boolean); /** * Replace positionLocal with the assembled camera-facing triangle. * * @param {import('three/webgpu').NodeBuilder} builder Current node builder. * @return {import('../types/tsl.js').TSLVec3Node} Sphere-impostor position in object-local space. */ setupPosition(): TSLVec3Node; /** * Keep the shadow position wired to this instance's assembled position node. * Reapplying the same node makes rebuilds and clone/copy flows idempotent. * * @param {NodeBuilder} builder Current node builder. */ setup(builder: NodeBuilder): void; /** * Copy sphere-impostor inputs without retaining a position closure owned by source. * * @param {SphereImpostorNodeMaterial} source Source material. * @return {SphereImpostorNodeMaterial} This material. */ copy(source: SphereImpostorNodeMaterial): this; } export default SphereImpostorNodeMaterial;