import { Expr, GpuFragmentParams } from '../../gpu/contract'; import { voxels as voxelKit } from '../../gpu/kit/index'; import { PropRef } from '../values'; import { ShapedSurfaceEffect, SurfaceFrame, SurfaceField } from './materials'; export type VoxelStyle = voxelKit.VoxelStyle; export type VoxelGridSpace = voxelKit.VoxelGridSpace; export interface VoxelSurfaceSpec { /** Compile-time selects: `'cube' | 'sphere' | 'rounded'` and `'shape' | 'view'`. */ style: PropRef; gridSpace: PropRef; voxelSize: PropRef; fill: PropRef; voxelScale: PropRef; bevel: PropRef; /** Penumbra softness of the shadow-map lookup (fragment-side — drivable). */ shadowSoftness: PropRef; /** Optional camera tilt/turn (degrees) applied to the view ray before the shape rotation. */ pitch?: PropRef; yaw?: PropRef; /** Optional turntable: rides the node's `animatedTime` clock (declare `animatedTime: {speed: * spin}`); one unit of speed = one turn per ten seconds. */ spin?: PropRef; /** Key light azimuth / elevation (degrees). Mouse and auto drivers are honoured by the shadow * map too (`getCpuValue` resolves them); a texture MAP driver only reaches the fragment * lighting, the shadow direction then stays at the prop's static value. */ lightAngle: PropRef; lightElevation: PropRef; /** Slab thickness for flat shapes. */ depth: PropRef; /** THE MATERIAL over one candidate voxel: return `vec4(rgb, coverage)`; the spine resolves * visibility and coverage itself from the analytic hits, so only `.rgb` is consumed. */ surface: (vox: VoxelFrame, frame: SurfaceFrame, params: GpuFragmentParams) => Expr; } /** The decoded frame of ONE candidate voxel the `surface:` slot shades. */ export interface VoxelFrame { /** The spine's field basics (`sdf`, `pxH`, `aspect`). */ field: SurfaceField; /** 1 for a real candidate (its texel hit a voxel), 0 for an empty texel slot. */ coverage: Expr; /** Unit normal in the material convention (x right, y down, z negative toward the viewer). */ normal: Expr; /** Baked smooth ambient occlusion, 1 = open. */ ao: Expr; /** Cast-shadow amount from the shadow map (contact-hardening soft shadow), 1 = fully shadowed. * Shared across the pixel's candidates (evaluated at the nearest hit). */ shadow: Expr; /** Grid cell indices (vec3f, integer-valued). */ cell: Expr; /** Stable 0..1 hash per voxel. */ cellHash: Expr; /** Cell height across the grid (0 bottom → 1 top of the bounding volume). */ heightT: Expr; /** View depth across the bounding volume (0 nearest → 1 farthest). */ depthT: Expr; /** Distance from the face centre toward its edge, 0 → 1 (the seam band lives near 1). */ edge: Expr; /** The perspective view ray (material convention, into the scene). */ view: Expr; /** Build-time: the chosen sub-shape style. */ style: VoxelStyle; } /** The voxel spine noun. See the module header. */ export declare function voxelSurface(spec: VoxelSurfaceSpec): ShapedSurfaceEffect; //# sourceMappingURL=voxels.d.ts.map