import { d } from '../index'; /** * A raw shape SDF `tgpu.fn`: `(p, rp0, rp1, rp2, t) => f32` — called DIRECTLY inside the trace body * (a `'use gpu'` body invokes tgpu.fns directly, never the builder-level `call`). Give each shape's * fn a distinct `$name`: the trace calls it through a closure alias, so typegpu can't derive a name * from the const and would emit a generic `fn sdf` that collides across two differently-shaped nodes * in one composition. */ export type ParamThreadedSdf = (p: unknown, rp0: unknown, rp1: unknown, rp2: unknown, t: unknown) => unknown; /** The march budget. `maxDistance` defaults to 20 (the ray gives up past it). */ export interface MarchOptions { steps: number; stepCap: number; hitEps: number; maxDistance?: number; } /** The march result: shape-local hit position, surface normal, view ray direction, hit flag (0/1). */ export declare const Distortion3DTrace: d.WgslStruct<{ hitPos: d.Vec3f; normal: d.Vec3f; rd: d.Vec3f; hit: d.F32; }>; /** * UV boundary mode — returns `vec3(finalU, finalV, visible)`. `visible = 0` marks an out-of-bounds * sample in TRANSPARENT mode (1). stretch(0) clamps; transparent(1) passes the raw UV (flagged * invisible outside 0–1); mirror(2) ping-pongs; wrap(3) repeats. The four out-of-bounds tests are * a nested-select AND of the in-bounds tests. Runtime `uvMode` select (see note #1). Resolve-only * (structure verified by snapshot). */ export declare const applyUVMode3d: import('typegpu').TgpuFn<(uv: d.Vec2f, uvMode: d.F32) => d.Vec3f>; /** * Blinn-Phong + Fresnel lighting on the marched surface. `surfaceColor` = STRAIGHT child sample; * `normal` the tetrahedron normal; `rd` the view ray (viewDir = −rd). `glossAmt`/`lightAmt` are the * pre-scaled glossiness/lighting (`·0.005`). Returns STRAIGHT rgba: `rgb = clamp(color·clamp(lit,0,3),0,1)`, * `alpha = hit·color.a·uvVisible`. Pure — CPU-golden-testable. */ export declare const distortion3dLighting: import('typegpu').TgpuFn<(surfaceColor: d.Vec4f, normal: d.Vec3f, rd: d.Vec3f, hit: d.F32, uvVisible: d.F32, glossAmt: d.F32, lightAmt: d.F32) => d.Vec4f>; /** * Build the orthographic sphere-march + tetrahedron normal into a resolvable * `tgpu.fn([d.vec2f, d.f32, d.vec2f, d.f32, d.vec4f, d.vec4f, d.vec4f, d.f32], Distortion3DTrace)` — * `(uv, aspect, center, zoom, rp0, rp1, rp2, t)`. The shape's `sdf` is closed over and receives the * packed params (`rp0`/`rp1`/`rp2`/`t`) at every march step and every tetrahedron-normal tap; the * march budget (`steps`/`stepCap`/`hitEps`/`maxDistance`) is baked build-time. The march loop uses * `for`/`if`/`break`/`let`. Left unnamed — the consumer's `call(trace, 'name', …)` pins a WGSL name * distinct per shape. */ export declare function buildParamThreadedTrace(sdf: ParamThreadedSdf, opts: MarchOptions): import('typegpu').TgpuFn<(uv: d.Vec2f, aspect: d.F32, center: d.Vec2f, zoom: d.F32, rp0: d.Vec4f, rp1: d.Vec4f, rp2: d.Vec4f, t: d.F32) => d.WgslStruct<{ hitPos: d.Vec3f; normal: d.Vec3f; rd: d.Vec3f; hit: d.F32; }>>; //# sourceMappingURL=raymarch3d.d.ts.map