import { d } from './index'; /** * The in-plane SDF gradient from the `.x` channel by forward difference: * `((surfX.x − surf0.x)/eps, (surfY.x − surf0.x)/eps)`. Points OUTWARD (distance grows outward), * with magnitude ≈ 1 for a true 2D distance field and ≫ 1 across a volumetric chord discontinuity — * callers that build a direction from it must normalize with a guarded length. Pure. */ export declare const fieldGradient: import('typegpu').TgpuFn<(surf0: d.Vec4f, surfX: d.Vec4f, surfY: d.Vec4f, eps: d.F32) => d.Vec2f>; /** * Surface normal of a VOLUMETRIC field: the marched depth in `.w` differentiated by forward * difference and clamped, with `z = −1` (the renderer's view direction) before normalizing. * * `gradClamp` is the per-shader slope bound and is load-bearing, not decorative. A chord field is * discontinuous where one lobe occludes another, so an unclamped slope spikes for a texel or two at * every overlap and the normal there points nearly sideways — which reads as a bright seam. Tighter * bounds give flatter, calmer surfaces; the fleet's current values are ±5 (LiquidMetal, Chrome, * Water, BrushedMetal, CarbonFiber), ±4 (Plastic, Frost, Crystal) and ±6 (Goo). Pure. */ export declare const volumetricNormal: import('typegpu').TgpuFn<(surf0: d.Vec4f, surfX: d.Vec4f, surfY: d.Vec4f, eps: d.F32, gradClamp: d.F32) => d.Vec3f>; /** * Flat-path normal for a bevelled 2D shape: tilt away from the face along the in-plane field * gradient by `sinTilt` (the sine of the tilt angle, from a bevel profile such as * `effects.bevel.bevelSin`), then complete the unit vector with `z = −cos`. * * `sinTilt` is CLAMPED to ≤ 0.9995 here — at exactly 1 the `z` term is 0 and the normal lies in the * plane, which makes the reflected ray graze to infinity. Pure. */ export declare const bevelledFlatNormal: import('typegpu').TgpuFn<(grad: d.Vec2f, sinTilt: d.F32) => d.Vec3f>; /** * Shape-local pattern coordinates: `sdfUV − 0.5` on the flat path, the sampler's surface-locked * `.g/.b` coords on the volumetric path. This is what makes a surface pattern (molten relief, * brush grain, weave, foil crinkle) STICK to a 3D shape instead of sliding across it in screen * space. `volumetric` is the runtime 0/1 flag. Pure. */ export declare const patternCoords: import('typegpu').TgpuFn<(sdfUV: d.Vec2f, surf0: d.Vec4f, volumetric: d.F32) => d.Vec2f>; /** * `true` when the fragment is outside the shape by more than two device pixels — the early-exit * test at the top of a shape-effect composite body (`if (outsideShape(sdf, pxH)) return vec4(0)`). * The two-pixel slack keeps the anti-aliased edge inside the shaded region. Pure. */ export declare const outsideShape: import('typegpu').TgpuFn<(sdf: d.F32, pxH: d.F32) => d.Bool>; /** * The inside coverage mask: `clamp(−sdf / w, 0, 1)` over a transition width `w` derived from the * shader's `sharpEdge` (`max(edgeSoftness · 0.5, 0.001)`) as `sharpEdge / 32`. * * The width is CLAMPED to at least `minPixels` device pixels. That clamp is the point of this fn: * without it, `edgeSoftness → 0` collapses the transition below a pixel and the silhouette resolves * as a raw aliased step. At the house value of 1.5 px the edge is anti-aliased and the extra half * pixel also hides sub-pixel contour noise from the field's texel lattice (`glassComposite` set the * precedent; D-7 propagated it to the metals). Pure. */ export declare const insideMask: import('typegpu').TgpuFn<(sdf: d.F32, sharpEdge: d.F32, pxH: d.F32, minPixels: d.F32) => d.F32>; /** * The perspective view ray through a screen UV, pointing INTO the scene (`+z`), aspect-corrected * and normalized. `fov` scales the off-axis spread: the fleet uses 0.6 (LiquidMetal, BrushedMetal, * CarbonFiber, Water) and 0.55 (Chrome). A perspective ray is what lets a flat face sweep the * environment across the canvas instead of reflecting one constant direction. Pure. */ export declare const perspectiveViewRay: import('typegpu').TgpuFn<(uv: d.Vec2f, aspect: d.F32, fov: d.F32) => d.Vec3f>; /** An orthonormal surface frame: `tangent` projected into the plane of `normal`, plus their cross * product. The basis anisotropic shading needs. */ export declare const TangentFrame: d.WgslStruct<{ tangent: d.Vec3f; bitangent: d.Vec3f; }>; /** * Gram–Schmidt an arbitrary direction into the surface plane and complete the frame: * `T = normalize(dir − n·(n·dir))`, `B = n × T`. `dir` supplies the anisotropy axis — the brush * direction, or the per-cell tow direction of a weave. Pure. */ export declare const orthonormalTangentFrame: import('typegpu').TgpuFn<(normal: d.Vec3f, dir: d.Vec3f) => d.WgslStruct<{ tangent: d.Vec3f; bitangent: d.Vec3f; }>>; /** Inputs to {@link wardAnisotropicSpecular} — a struct per C1 (six values). `view` points INTO * the scene (the `perspectiveViewRay` convention), `light` points at the light. */ export declare const WardSpecularInput: d.WgslStruct<{ normal: d.Vec3f; /** The anisotropy axis (brush / tow direction). Need not lie in the surface plane. */ tangent: d.Vec3f; light: d.Vec3f; view: d.Vec3f; /** Roughness along the tangent. Larger → the highlight smears further along the grain. */ alphaAlong: d.F32; /** Roughness across the tangent. Smaller → a tighter streak. */ alphaAcross: d.F32; }>; /** * Ward anisotropic specular lobe, unit gain: `exp(−((h·T/αT)² + (h·B/αB)²) / ((h·N + 1)/2))` for * the half-vector `h = normalize(L − V)`. Multiply by the material's specular gain at the call * site. This is the streak that runs ALONG a brushed grain or a carbon tow — an isotropic * Blinn–Phong lobe cannot produce it. Pure. */ export declare const wardAnisotropicSpecular: import('typegpu').TgpuFn<(p: d.WgslStruct<{ normal: d.Vec3f; /** The anisotropy axis (brush / tow direction). Need not lie in the surface plane. */ tangent: d.Vec3f; light: d.Vec3f; view: d.Vec3f; /** Roughness along the tangent. Larger → the highlight smears further along the grain. */ alphaAlong: d.F32; /** Roughness across the tangent. Smaller → a tighter streak. */ alphaAcross: d.F32; }>) => d.F32>; /** * IQ cosine palette: `cos((t + phase)·2π)·0.5 + 0.5` per channel. The smooth spectral cycle behind * every diffraction look in the library (holographic foil, thin-film iridescence). `t` wraps every * 1.0. * * The phases are ARGUMENTS rather than baked thirds because the fleet's copies disagree in the 4th * decimal (`1/3, 2/3` in Holographic vs `0.3333, 0.6667` in thinFilm). Unifying them would be a * pixel change; passing each caller's current values keeps adoption pixel-neutral. Pure. */ export declare const cosinePalette: import('typegpu').TgpuFn<(t: d.F32, phaseR: d.F32, phaseG: d.F32, phaseB: d.F32) => d.Vec3f>; //# sourceMappingURL=lighting.d.ts.map