import { d } from '../index'; import { Expr, GpuFragmentParams, KitTexture } from '../../contract'; /** Uniform keys the emboss builder reads via `params.uniforms.`. */ export interface EmbossEffectUniforms { center: unknown; scale: unknown; rotation: unknown; depth: unknown; lightAngle: unknown; lightIntensity: unknown; shadowIntensity: unknown; } export interface EmbossEffectOptions { /** Treat the field as a 3D thickness map — the relief follows the actual surface height. */ volumetric?: boolean; /** Cheap bilinear sampler for the neighbour + shadow-trace taps (compute path). Falls back to sdfSampler. */ gradSampler?: (uv: Expr) => Expr; } /** * Height field from an SDF value. 2D: a binary plateau with a tight transition of half-width * `transitionW` (edge-only lighting). Volumetric: −field used directly as a continuous height * (saturating at 0.18 field units). Feeding the wider shadow transition as `transitionW` gives the * cast-shadow trace its smooth falloff. `depth` is signed (raised/sunken). Pure — golden-testable. */ export declare const embossHeight: import('typegpu').TgpuFn<(s: d.F32, depth: d.F32, transitionW: d.F32, volumetric: d.F32) => d.F32>; /** A shadow-trace sample UV: `sdfUV + (cos,sin)(lightAngle) * spread * frac`, spread = |depth|*0.06. Pure. */ export declare const embossTraceUV: import('typegpu').TgpuFn<(sdfUV: d.Vec2f, lightAngle: d.F32, depth: d.F32, frac: d.F32) => d.Vec2f>; /** Parallax UV displacement — scale the child around the shape centre inside the boundary. Pure. */ export declare const embossWarpUV: import('typegpu').TgpuFn<(uv: d.Vec2f, center: d.Vec2f, sdfC: d.F32, depth: d.F32) => d.Vec2f>; /** * Surface normal from the height gradient (central differences over the 4 cardinal SDF taps) + * directional edge lighting. Returns `vec2(highlight, edgeShadow)` — both ≥ 0. Pure — * CPU-golden-testable. */ export declare const embossEdgeLighting: import('typegpu').TgpuFn<(sdfR: d.F32, sdfL: d.F32, sdfU: d.F32, sdfD: d.F32, depth: d.F32, lightAngle: d.F32, lightIntensity: d.F32, volumetric: d.F32) => d.Vec2f>; /** * The full emboss composite. `childColor` = STRAIGHT child sample at the warped UV; the 5 SDF taps * (centre + R/L/U/D) drive edge lighting; the 2 trace taps (`h1raw`/`h2raw`) drive the cast shadow. * Returns STRAIGHT rgba. Resolve-goldenable. */ export declare const embossComposite: import('typegpu').TgpuFn<(childColor: d.Vec4f, sdfC: d.F32, sdfR: d.F32, sdfL: d.F32, sdfU: d.F32, sdfD: d.F32, h1raw: d.F32, h2raw: d.F32, depth: d.F32, lightAngle: d.F32, lightIntensity: d.F32, shadowIntensity: d.F32, volumetric: d.F32) => d.Vec4f>; /** * Apply the emboss / deboss relief effect over child content. Composition-time Expr builder — see * the file header for deviations. * * @param params the fragment builder params (reads `uniforms`/`ctx`) * @param sdfSampler `(uvExpr) → vec4 Expr`: `.r` = signed distance / −chord * @param childTexture the child RTT (from the shader's `convertToTexture(childNode)`) * @param options `volumetric` + an optional cheap `gradSampler` for the neighbour/trace taps */ export declare function applyEmbossEffect(params: GpuFragmentParams, sdfSampler: (uv: Expr) => Expr, childTexture: KitTexture, options?: EmbossEffectOptions): Expr; //# sourceMappingURL=emboss.d.ts.map