/** Modifier-stack folding for the splat material graph. */ import * as THREE from 'three/webgpu'; import type { SplatModifier } from './splat-modifier'; import type { Vec3Uniform } from './splat-mesh-material'; /** * Builds the per-splat {@link SplatContext}, folds the modifier stack * over it in order, and returns the graph fragments the renderer applies. * `null` fragments mean "untouched": with an empty stack every fragment * is null and the caller emits exactly the unhooked graph. * * Modifiers are called here, at material build time - they are graph * builders, not per-frame callbacks, and may be called more than once. Derived context fields * (worldCenter, viewCenter, localToView, cameraWorld, normal, channels) are built lazily * so only the modifiers that read them add their nodes to the graph, and * once per TSL scope that reads them (see {@link ScopedFields}). * * Call it inside the `Fn` whose scope encloses every use of the results, * with `index`, `localCenter`, `sourceCenter`, `sourceToLocal` and `color` * already pinned with `.toVar()` there: anything shared between a modifier * branch and later code must be assigned ahead of the branch. The fold pins * the stack's color and, between modifiers, every running field a later * modifier can read. */ export declare function foldSplatModifierStack(modifierList: readonly SplatModifier[], localCameraPosition: Vec3Uniform, inputs: { index: THREE.Node<'int'>; localCenter: THREE.Node<'vec3'>; /** Pre-placement pool position; defaults to {@link localCenter}. */ sourceCenter?: THREE.Node<'vec3'>; /** Source-data-frame → mesh-local linear transform; defaults to identity. */ sourceToLocal?: THREE.Node<'mat3'>; color: THREE.Node<'vec4'>; /** Builders for the lazy fields; each call must return new nodes. */ makeNormal: () => THREE.Node<'vec3'>; makeChannel: (name: string) => THREE.Node<'float'>; /** Optional coordinate-space adapters for compute-time modifier folding. */ makeWorldCenter?: () => THREE.Node<'vec3'>; makeViewCenter?: () => THREE.Node<'vec3'>; makeLocalToView?: () => THREE.Node<'mat3'>; makeCameraWorld?: () => THREE.Node<'vec3'>; }): { color: THREE.Node<'vec4'>; offset: THREE.Node<'vec3'> | null; scaleSquared: THREE.Node<'float'> | null; rotation: THREE.Node<'mat3'> | null; visible: THREE.Node<'bool'> | null; isotropicCovarianceMix: THREE.Node<'float'> | null; isotropicVarianceScale: THREE.Node<'float'> | null; isotropicScreenRadiusPx: THREE.Node<'float'> | null; };