pub struct GlassDynamics {Show 16 fields
pub contact_lighting: bool,
pub refraction: Option<GlassRefraction>,
pub shadow: Option<GlassShadow>,
pub ring_shadow: Option<(GlassShadow, f32)>,
pub edge_return_depth_dp: Option<f32>,
pub optical_projection: Option<(f32, f32)>,
pub activity: Option<f32>,
pub resting_tint: Option<Color>,
pub highlight_boost: f32,
pub saturation_boost: f32,
pub tint_alpha_multiplier: Option<f32>,
pub tint_crossfade: Option<(Color, f32)>,
pub morph: Option<GlassMorph>,
pub touch: Option<(f32, f32, f32)>,
pub touch_radius_dp: Option<f32>,
pub press_depth: Option<f32>,
}Expand description
Per-frame motion inputs for an interactive glass element, read lazily at scene-build time (no recomposition per frame).
Fields§
§contact_lighting: boolUses a global color transfer and a white blurred contact light in place of touch glow.
refraction: Option<GlassRefraction>Per-frame source mapping. Layered surfaces use this to animate the backdrop and material independently of the opaque resting fill.
shadow: Option<GlassShadow>Per-frame shadow of the persistent surface, independent of optical activity.
ring_shadow: Option<(GlassShadow, f32)>A shadow cast by the surface contour instead of its filled silhouette. The second value is the contour stroke width in dp; the shadow radius is its Gaussian standard deviation. Nonfinite or nonpositive widths disable it.
edge_return_depth_dp: Option<f32>Independent inner return depth for an edge lens, in dp. Zero removes its depth. Nonfinite or negative values preserve the material’s default depth ratio.
optical_projection: Option<(f32, f32)>Horizontal and vertical projection of the complete glass field about its primary center. Refraction, lighting and all scene shapes share the projection. Missing, nonfinite or nonpositive scales resolve to identity. This does not magnify the underlying backdrop.
activity: Option<f32>Continuous optical presence. None preserves the resolved material;
Some(0) is an exact backdrop identity while retaining the same node,
SDF, and pointer ride path.
resting_tint: Option<Color>Base tint of the same persistent SDF surface at zero optical activity. Its alpha cross-fades out as the refractive material rises.
highlight_boost: f32Extra specular intensity (0 = spec default; e.g. press boost).
saturation_boost: f32Per-frame saturation added to the resolved material. Interactive surfaces use this to raise chroma without changing their base tint.
tint_alpha_multiplier: Option<f32>Optional per-frame multiplier for the material tint alpha. Values below one clear a resting wash; values above one densify a raised tint.
tint_crossfade: Option<(Color, f32)>Blends a plain translucent tint into this material’s tint, including its luminance-dependent transmission. The fraction is zero at the supplied tint and one at the material tint; refraction and lighting stay active.
morph: Option<GlassMorph>Shape morph: when set, the glass geometry is these node-local rects instead of the node cover — the shapeshift channel.
touch: Option<(f32, f32, f32)>Touch glow: (x_dp, y_dp, intensity) in node-local dp. A pressed
surface concentrates saturation and a soft light in a radial
gradient under the finger (never a flat recolor).
touch_radius_dp: Option<f32>Radius of the touch glow in dp; absent, nonpositive and nonfinite values use 58 dp.
press_depth: Option<f32>Dome press depth: how squashed the interactive dome is. At 1 the
pressed dome refracts deep and vivid (wide rim band, strong
chromatic split — the reference toggle’s gray-hold rainbow); toward
0 the released bead relaxes shallow and its split fades with it
(the reference’s thin settled ring). None = 1.
Implementations§
Source§impl GlassDynamics
impl GlassDynamics
Sourcepub fn touched_up(
self,
press: f32,
finger: Option<(f32, f32)>,
center: (f32, f32),
) -> Self
pub fn touched_up( self, press: f32, finger: Option<(f32, f32)>, center: (f32, f32), ) -> Self
The universal touched-up state (user-directed law): a pressed
liquid surface comes closer to the user while its OWN colors go
HDR-bright and saturated, with a radial glow following the finger.
Never a repaint with alternate colors — the boosts amplify whatever
the surface already is. press is 0..1; finger is node-local dp
(falls back to center, the surface’s own heart).