import { d } from '../index'; import { Expr, GpuFragmentParams, KitTexture } from '../../contract'; export declare const BLUR_DISK: [number, number][]; /** * Uniform keys the glass builder reads via `params.uniforms.` (GPU accessor Exprs). * `blur`/`aberration` are ALSO read via `params.propValues` for compile-time branching. */ export interface GlassEffectUniforms { center: unknown; scale: unknown; rotation: unknown; edgeSoftness: unknown; refraction: unknown; innerZoom: unknown; aberration: unknown; blur: unknown; tintColor: unknown; tintIntensity: unknown; tintPreserveLuminosity: unknown; lightAngle: unknown; highlight: unknown; highlightColor: unknown; highlightSoftness: unknown; fresnel: unknown; fresnelColor: unknown; fresnelSoftness: unknown; cutout: unknown; thickness: unknown; } export interface GlassEffectOptions { /** 3D thickness field (−chord/2): fresnel + refraction from surface slope instead of rim distance. */ volumetric?: boolean; /** Sampler carries forward differences in .g/.b of the centre tap — skip the 2 extra taps. */ bakedGradients?: boolean; } /** * Aspect-correct + rotate + scale the screen UV into SDF sample space, shared by the * glass/neon/emboss preamble: aspect-correct the X delta, flip `center.y` back (transformPosition * stores `1 - y`), rotate the delta by `rotation` degrees (rigid; rotation=0 is identity), scale, * and offset by 0.5 into the 0–1 field. Pure — CPU-golden-testable. */ export declare const sdfSpaceUV: import('typegpu').TgpuFn<(center: d.Vec2f, scale: d.F32, rotation: d.F32, uv: d.Vec2f, aspect: d.F32) => d.Vec2f>; /** `uv + vec2(ox, oy)` — builds a neighbour/trace sample UV from a base UV + scalar offsets. */ export declare const offsetUV: import('typegpu').TgpuFn<(uv: d.Vec2f, ox: d.F32, oy: d.F32) => d.Vec2f>; /** Forward-difference gradient of the SDF (non-baked path): `((sdfX - sdf)/EPS, (sdfY - sdf)/EPS)` * with EPS = 0.01. Pure. */ export declare const glassGradient: import('typegpu').TgpuFn<(sdfRaw: d.F32, sdfX: d.F32, sdfY: d.F32) => d.Vec2f>; /** * Refraction strength from depth. 2D plates fade refraction with depth `(1-d)²`; 3D thickness * fields ramp it in with `smoothstep(0,1,d)`. `sdf` is already `sdfRaw/scale`. Pure. */ export declare const glassRefrStrength: import('typegpu').TgpuFn<(sdf: d.F32, thickness: d.F32, volumetric: d.F32) => d.F32>; /** The refracted lens sample UV + the ±chromatic-aberration r/b UVs. Pure. */ export declare const GlassLensUVs: d.WgslStruct<{ lensUV: d.Vec2f; rUV: d.Vec2f; bUV: d.Vec2f; }>; export declare const glassLensUVs: import('typegpu').TgpuFn<(uv: d.Vec2f, center: d.Vec2f, sdfRaw: d.F32, scale: d.F32, gradX: d.F32, gradY: d.F32, refraction: d.F32, innerZoom: d.F32, thickness: d.F32, aberration: d.F32, aspect: d.F32, volumetric: d.F32) => d.WgslStruct<{ lensUV: d.Vec2f; rUV: d.Vec2f; bUV: d.Vec2f; }>>; /** One Vogel-disk blur tap offset in UV space: `(1/viewport) * (ox,oy) * blur*2`. Pure. */ export declare const glassBlurOffset: import('typegpu').TgpuFn<(viewportSize: d.Vec2f, blur: d.F32, ox: d.F32, oy: d.F32) => d.Vec2f>; /** * Colour tint (mix-based, matches the Tint shader). Optional luminosity preservation rescales the * tinted colour back to the source luminance. `preserveLum` is 0/1. Pure — CPU-golden-testable * (the boolean choice is a `std.mix` with a 0/1 factor, not a vec `std.select`). */ export declare const glassTint: import('typegpu').TgpuFn<(rgb: d.Vec3f, tintColor: d.Vec3f, tintIntensity: d.F32, preserveLum: d.F32) => d.Vec3f>; /** Directional border highlight ring (rb2): a thin 1px ring modulated by `normal·light`. Pure. * The ring's transition width is clamped to ≥ 1 device pixel (an anti-aliased edge instead of a * raw step at low edgeSoftness), and `lightFacing` is clamped to [0,1] — a volumetric chord * field's rim slopes are ≫ 1, which otherwise blows the ring brightness out unboundedly. */ export declare const glassBorderHighlight: import('typegpu').TgpuFn<(sdf: d.F32, edgeSoftness: d.F32, pxH: d.F32, gradX: d.F32, gradY: d.F32, lightAngle: d.F32, highlight: d.F32) => d.F32>; /** Phong specular glint on the SDF normal (view dir = +z). Pure — CPU-golden-testable. */ export declare const glassSpecular: import('typegpu').TgpuFn<(gradX: d.F32, gradY: d.F32, lightAngle: d.F32, highlight: d.F32, highlightSoftness: d.F32, refrStrength: d.F32) => d.F32>; /** Fresnel rim glow. Volumetric: view-angle from the thickness-field slope; 2D: distance-to-rim. * `rb1` is the inside mask. Pure — CPU-golden-testable. */ export declare const glassFresnelRim: import('typegpu').TgpuFn<(sdf: d.F32, gradX: d.F32, gradY: d.F32, fresnel: d.F32, fresnelSoftness: d.F32, rb1: d.F32, volumetric: d.F32) => d.F32>; /** * The full glass composite. `baseColor` = STRAIGHT child sample at screen UV; `blurred` = STRAIGHT * refracted lens sample. Builds the inside mask, border ring, tint, specular, and fresnel, blends * lighting over the child by `transition`, and applies cutout alpha. Returns STRAIGHT rgba. Pure * (texture-derived only via the vec4 args) — resolve-goldenable. */ export declare const glassComposite: import('typegpu').TgpuFn<(baseColor: d.Vec4f, blurred: d.Vec4f, sdfRaw: d.F32, scale: d.F32, gradX: d.F32, gradY: d.F32, viewportSize: d.Vec2f, edgeSoftness: d.F32, lightAngle: d.F32, highlight: d.F32, highlightColor: d.Vec3f, highlightSoftness: d.F32, fresnel: d.F32, fresnelColor: d.Vec3f, fresnelSoftness: d.F32, thickness: d.F32, tintColor: d.Vec3f, tintIntensity: d.F32, tintPreserveLuminosity: d.F32, cutout: d.F32, volumetric: d.F32) => d.Vec4f>; /** * Apply the glass lens effect. Composition-time Expr builder — see the file header for the notes. * * @param params the fragment builder params (reads `uniforms`/`propValues`/`ctx`) * @param sdfSampler `(uvExpr) → vec4 Expr`: `.r` = signed distance/−chord, `.g`/`.b` = baked * gradients (when `options.bakedGradients`) * @param childTexture the child RTT (from the shader's `convertToTexture(childNode)`) * @param blurredTexture optional pre-blurred buffer (compute path); undefined → in-shader Vogel blur * @param options `volumetric` / `bakedGradients` build-time flags */ export declare function applyGlassEffect(params: GpuFragmentParams, sdfSampler: (uv: Expr) => Expr, childTexture: KitTexture, blurredTexture?: KitTexture, options?: GlassEffectOptions): Expr; //# sourceMappingURL=glass.d.ts.map