Skip to main content

Module material

Module material 

Source
Expand description

The Liquid Glass material: Gaussian backdrop frost followed by wcKSRD refraction applied to a composable’s own bounds through LiquidModifierExt::glass_effect — the analogue of SwiftUI’s .glassEffect(_:in:).

Structs§

Glass
Builder describing a glass material. Resolved against the theme at the composition site, then evaluated per frame for density and dynamics.
GlassContourHighlight
Reflection of opposing lights across a narrow band around the surface contour. The reflected environment is brightest along the light axis and darkest between the lights. Nonfinite fields or nonpositive height or spread disable this treatment.
GlassDeformation
A normalized motion axis and reciprocal scales for incompressible glass. Construction derives the cross-axis scale, so callers cannot describe a deformation that changes the bubble’s area.
GlassDynamics
Per-frame motion inputs for an interactive glass element, read lazily at scene-build time (no recomposition per frame).
GlassFaceResponse
Face attenuation before edge lighting, followed by additive illumination. Edge lenses attenuate the inner refraction image before chromatic sampling. Invalid or nonfinite parameters disable the response.
GlassFaceTone
A fixed luminance transfer with an independent chroma gain. Luminance y becomes black + (white - black) * y - (1 - max_luminance) * y²; chroma is scaled by saturation and the combined RGB is clamped to zero–one.
GlassKeyFill
Opposing edge lights whose color responds to the backdrop. Nonfinite fields or nonpositive height or curvature disable this treatment.
GlassMorph
A liquid shapeshift frame: the primary shape plus any number of nearby glass shapes, ALL smooth-unioned into one field — liquid glass glues to whatever glass it passes near (a growing menu necks with a neighboring button, the drag lens merges with the search circle). Up to GlassMorph::MAX_SHAPES extra shapes; an angular wobble makes the mid-flight field bubble like a droplet. All geometry is node-local dp: (center_x, center_y, width, height, corner_radius); radius sentinel -1 means capsule; -2 means SUBTRACT capsule — the shape carves a smooth hole in the field (the growing menu leaves its anchor button crisp on top until it swallows it).
GlassShadow
Shadow owned by a glass surface. Morphing glass evaluates the same live SDF for this shadow; clipped static glass forwards the values to the layer shadow primitive.
GlassSpectrum
Seven-tap RGB spectrum for an edge lens. Distances follow the surface transform. Nonfinite values, negative extents, or opacities outside zero to one are ignored.
GlassSpecularHighlight
Backdrop-dependent reflections from opposing lights, with a sharp rim and a softer inward lobe. Invalid dimensions or nonfinite fields disable the reflection.

Enums§

GlassRefraction
The projection used to transmit the captured backdrop through glass.
GlassVariant
Material variant, mirroring SwiftUI’s .regular / .clear glass, plus the interactive lens.
LiquidShape
The shape of a glass element (also its clip and shadow shape).

Traits§

LiquidModifierExt
Modifier extension installing the Liquid Glass material.

Functions§

glass_light_direction
The current ambient glass light return direction.
set_glass_light_direction
Sets the ambient glass light return direction (screen space, need not be normalized — the shader normalizes). Feed device attitude here.