From 246c753e4ed27a742580970cb56fd4e3db971a45 Mon Sep 17 00:00:00 2001 From: "fizzy-linux[bot]" <346940526+fizzy-linux[bot]@users.noreply.github.com> Date: Tue, 27 Oct 2026 08:38:46 -0500 Subject: [PATCH 1/2] core: one glass Look per role, with identity brightness curves Look gains wash_top/wash_bottom, sweep, ceiling, edge_dark and the lit-edge fields; Looks holds one per role (drop, text, card, bar, lens) and is published once a frame by core.material.publishLook. The glass program reads four more header vec4s; all four compiled forms regenerated. fizzy's defaults leave its pixels unchanged. Agent-Team: linux Worker: claude Co-Authored-By: Claude Sonnet 5.5 --- backend/src/SDLBackend.zig | 2 +- backend/src/glass/LiquidField.zig | 69 +- .../compiled/dxil/liquid_glass.fragment.dxil | Bin 10184 -> 10896 bytes .../compiled/glsl/liquid_glass.fragment.glsl | 889 ++++++++++-------- .../compiled/msl/liquid_glass.fragment.msl | 867 +++++++++-------- .../compiled/spv/liquid_glass.fragment.spv | Bin 19544 -> 21380 bytes .../glass/shaders/liquid_glass.fragment.hlsl | 32 +- backend/src/glass_look.zig | 134 ++- core/material.zig | 15 +- src/editor/Editor.zig | 4 +- tests/integration.zig | 76 +- 11 files changed, 1235 insertions(+), 853 deletions(-) diff --git a/backend/src/SDLBackend.zig b/backend/src/SDLBackend.zig index 9df175e70..e92dfb993 100644 --- a/backend/src/SDLBackend.zig +++ b/backend/src/SDLBackend.zig @@ -1365,7 +1365,7 @@ pub fn floatingWindowBackground(self: *SDLBackend, id: dvui.Id, rect: dvui.Rect. glass.programs.publishHost(); glass.LiquidField.publishEnabled(liquid); const lens = builtin.target.os.tag == .macos and liquid and glass.LiquidField.ready(); - glass.LiquidField.publishLook(if (lens) glass_look.inApp(opacity) else null); + glass.LiquidField.publishLook(if (lens) glass_look.Looks.fromOpacity(opacity) else null); const s = dvui.windowNaturalScale(); glass.BlurBackdrop.frostPane(id, rect, corners.scale(1 / s, dvui.CornerRect), s, .{ .radius = if (lens) glass_look.text_blur else if (m.kind == .blur) pane.blur / 2 else pane.blur, diff --git a/backend/src/glass/LiquidField.zig b/backend/src/glass/LiquidField.zig index 42b0790b4..5ba19447f 100644 --- a/backend/src/glass/LiquidField.zig +++ b/backend/src/glass/LiquidField.zig @@ -37,7 +37,7 @@ const LiquidField = @This(); pub const max_shapes = 16; /// Uniform vec4s before the shapes (`Uniforms`), and per shape. -const header_vec4s = 7; +const header_vec4s = 11; const shape_vec4s = 3; /// A piece of glass. Physical pixels, window coordinates. @@ -93,7 +93,7 @@ window: bool = false, /// even where the window is see-through behind it, as a place's corner button over the explorer, /// which is the window's own material. Off, it is as see-through there as the window is. solid: bool = false, -/// Its tint and mix are its own, kept over the look the app publishes (`publishLook`): glass that +/// Its tint and mix are its own, kept over the look the app publishes (`core.material.publishLook`): glass that /// must read as part of a surface, as a place's corner at rest does its card's fill. surface: bool = false, /// It is a lens over a picture of the caller's own (`drawPicture`): its middle the picture as it @@ -105,6 +105,8 @@ lens: bool = false, /// that show face that way, as a piece in a place's top-right corner does — its arc down and to /// the left, its cut up and to the right — where the usual light would leave both in shade. light_across: bool = false, +/// The look it is drawn with (`glass_look.Looks`), where it is not what its `lens` and `text` say. +role: ?glass_look.Role = null, /// A place's outline (`edge`), physical: its rect and its corner radii, top-left, top-right, /// bottom-right, bottom-left. @@ -218,6 +220,17 @@ pub const Uniforms = extern struct { /// `draw` sets it, in the frame; `pack` leaves it 0. Then Apple's lens: its colour fringe, /// a drop's diagonal light (0: a window's hairline), the band's widest (physical pixels). backdrop: [4]f32 = @splat(0), + /// The look's brightness curves (`applyLook`): the wash at the shape's top and at its bottom, + /// the sweep, the luminance ceiling. Identity: no wash, no sweep, a ceiling of 1. + curves: [4]f32 = .{ 0, 0, 0, 1 }, + /// The lit edge's light: its direction (`glass_look.lightDir`), how high it stands, the catch on + /// the far side. + light: [4]f32 = .{ -0.70710678, -0.70710678, 0, 0 }, + /// The lit edge's line, glow, shade and floor. + edge: [4]f32 = @splat(0), + /// How dark the window's hairline edge is, then the lit edge's line and glow widths in physical + /// pixels. + widths: [4]f32 = .{ 0.85, 0, 0, 0 }, shapes: [max_shapes][shape_vec4s][4]f32, pub fn vec4s(self: *const Uniforms) [*]const [4]f32 { @@ -318,7 +331,7 @@ fn enabled() bool { return dvui.dataGet(null, enabled_id, "_liquid_field", bool) orelse true; } -const enabled_id: dvui.Id = @fromBackingInt(@intCast(0x6c69_7166)); +const enabled_id: dvui.Id = @fromBackingInt(@intCast(glass_look.data_id_backing)); /// Whether the window is opaque behind its content — no desktop material shows through it (Linux, /// the web) — published each frame by the app. The glass is as see-through as what it covers @@ -335,26 +348,31 @@ fn opaqueWindow() bool { return dvui.dataGet(null, enabled_id, "_liquid_opaque_window", bool) orelse false; } -/// The app's glass at the window's opacity this frame (`glass_look.inApp`), published -/// by the app before anything draws where there is OS glass beside it to match (macOS): every -/// field — dialogs, menus, drops — is drawn as it says, Apple's lens at that opacity. Null -/// (nothing published: the web, a plugin's own window): the earlier glass, as each field's own -/// tint, lift and blur say. Every form of the program draws the lens — the GLSL, the Metal, and the -/// SPIR-V and DXIL compiled from the HLSL — as long as the last two are compiled again whenever the -/// HLSL changes (the commands are at its top). -pub fn publishLook(slider_look: ?glass_look.InApp) void { +/// The app's looks this frame (`glass_look.Looks`: one per role, fizzy's from the window's opacity +/// where there is OS glass beside it to match, macOS), published once a frame before anything +/// draws: every field — dialogs, menus, drops — is drawn as its role's look says. Null (nothing +/// published: the web, a plugin's own window): the earlier glass, as each field's own tint, lift +/// and blur say. Every form of the program draws the lens — the GLSL, the Metal, and the SPIR-V and +/// DXIL compiled from the HLSL — as long as the last two are compiled again whenever the HLSL +/// changes (the commands are at its top). Apps call it as `core.material.publishLook`. +pub fn publishLook(looks: ?glass_look.Looks) void { if (dvui.current_window == null) return; - if (slider_look) |l| dvui.dataSet(null, enabled_id, "_liquid_look", l) else dvui.dataRemove(null, enabled_id, "_liquid_look"); + if (looks) |l| dvui.dataSet(null, enabled_id, glass_look.data_key, l) else dvui.dataRemove(null, enabled_id, glass_look.data_key); } -fn publishedLook() ?glass_look.InApp { - return dvui.dataGet(null, enabled_id, "_liquid_look", glass_look.InApp); +fn publishedLooks() ?glass_look.Looks { + return dvui.dataGet(null, enabled_id, glass_look.data_key, glass_look.Looks); } -/// `look` into what the program reads: the lens's own uniforms, and the tint, lift, clarity, rim -/// light and frost the sliders set in place of the field's own. The bend follows the field's -/// `refraction` (2, the whole of it, where the look is published). -fn applyLook(self: *const LiquidField, u: *Uniforms, l: glass_look.InApp) void { +/// The role a field is drawn as: its own (`role`), else what its `lens` and `text` flags say. +fn roleOf(self: *const LiquidField) glass_look.Role { + return self.role orelse if (self.lens) .lens else if (self.text) .text else .drop; +} + +/// `l` into what the program reads: the lens's own uniforms, and the tint, wash, clarity, rim +/// light and frost the look sets in place of the field's own. The bend follows the field's +/// `refraction` (2, the whole of it, where the look is published). Pure on the uniforms. +pub fn applyLook(self: *const LiquidField, u: *Uniforms, l: glass_look.Look) void { const bend_scale = std.math.clamp(self.refraction / 2, 0, 1); u.dither[1] = @max(l.bevel, 0.0001); u.dither[2] = l.bend * bend_scale; @@ -364,10 +382,19 @@ fn applyLook(self: *const LiquidField, u: *Uniforms, l: glass_look.InApp) void { u.backdrop[3] = l.bevel_cap * self.scale; u.rim[1] = l.clarity * bend_scale; u.rim[3] = l.rim; + // A surface's or a window's colour is its own: it keeps its mix and lift, and no wash. if (!self.surface and !self.window) { u.face[0] = std.math.clamp(l.mix, 0, 1); - u.face[1] = std.math.clamp(l.lift, 0, 1); + u.face[1] = 0; + u.curves[0] = std.math.clamp(l.wash_top, 0, 1); + u.curves[1] = std.math.clamp(l.wash_bottom, 0, 1); } + u.curves[2] = std.math.clamp(l.sweep, 0, 1); + u.curves[3] = std.math.clamp(l.ceiling, 0, 1); + const dir = glass_look.lightDir(l); + u.light = .{ dir[0], dir[1], l.light_height, l.rim_back }; + u.edge = .{ l.rim_line, l.rim_glow, l.rim_shade, l.rim_floor }; + u.widths = .{ l.edge_dark, l.rim_width * self.scale, l.glow_width * self.scale, 0 }; for (u.shapes[0..self.len]) |*sh| sh[2][0] *= l.frost; if (self.edge != null) u.shapes[max_shapes - 1][2][0] *= l.frost; } @@ -407,8 +434,8 @@ pub fn draw(self: *const LiquidField, frost: dvui.Texture, covered: dvui.Rect.Ph // And the light turned (`light_across`): +2 on the same lane, so it holds on every look, // published or not. u.backdrop[0] = (if (opaqueWindow() or self.solid) @as(f32, 1) else 0) + (if (self.light_across) @as(f32, 2) else 0); - // And the glass the sliders make of it this frame (`publishLook`). - if (publishedLook()) |l| self.applyLook(&u, if (self.lens) glass_look.forLens(l) else if (self.text) glass_look.forText(l) else glass_look.forDrops(l)); + // And the glass the app's look makes of it this frame (`core.material.publishLook`). + if (publishedLooks()) |looks| self.applyLook(&u, looks.get(self.roleOf())); const textures = [_]?*anyopaque{programs.handle(sharp)}; if (!h.begin(id, &textures, textures.len, u.vec4s(), uniform_vec4s)) return false; defer h.end(); diff --git a/backend/src/glass/shaders/compiled/dxil/liquid_glass.fragment.dxil b/backend/src/glass/shaders/compiled/dxil/liquid_glass.fragment.dxil index 081c06c551bbb995922f762b45f22458e45c3650..2d4ed471f0bd676699fb62f9718e0ad034c4279d 100644 GIT binary patch delta 7624 zcmd5>Yg|*;mOputkOUJRF%U2(ASp=1@DM~X<^+t^fPz&EVl@y2+6tmluhnRBl0c&d zfd*~FYlW+|cw1W#R8X`Dpiqq(lzQ79O=-+Y_lL-ymp_u6Z( zy`G1zMHNc}k~8EMr_2(RmQ<0HLPXvWJo!ma`9LJE+-k9F2?+3JdkJSbixCv}V=P!uNC6Z7A62Lnc~5;jTDOxYRwWgs zvYk51JnHnIDwO9ux7%2Q=f)yo&2)Kp0nJ30_ouRVT7IG?YKcq{E%^je_gd91A3*{~?SWnPG!J9o zYkMi=8^_$r_Oz7}S@&eVQk}`V!g`yx{N^1pTAy!iI9t+vIhAeNHMjb9;9W3hn}4`v ze8zlX#jTqY`8Ua^GvD#Wfo+$&Ikge(zi$BCs?$GvsECh8;FBzNc$GfH8;bX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I$0@1BL1lZN7N-3I~V{#ne6e`OoLSJ?<$ut)8e2F&->WL&kC? z>n;<(;bXMxl>DI5w;*6ewr}~BM9I0)+(zM=$F0i&@>YqDx{zzy*JS34)OhL|NqI46 z>gMwLZm@Z)bp7StwGxmUWS9AOwz8Rm*g2D#8{HJHEYh6=9`>>pf{h5caG`a4_Nmuf zzF~~ylIHgHlE3@Fg5pO3?09vTb|Cf_Etmj z3r_AU7l2Fn1214hiVHP$WNF>Lnol(QBUPD>*ZrEwxLgtWD}vD9<`*{LBD}I)By|yn zqx`uVVw2|&y7v+wGH_8vD~}^e!HZz?jj{(Fwx2C&#ZCzL@uHtwO=@q0%Z?4tauq7K za4LZ?tz!4y?>F@VKx(3by9c;3K 0.0; - highp float _119; - highp vec2 _122; - highp vec4 _124; - highp vec2 _126; - highp float _128; - highp float _130; - highp vec4 _132; + int _104 = int((vColor.y * 255.0) + 0.5); + int _109 = int((vColor.z * 255.0) + 0.5); + bool _129 = uData[5].y > 0.0; + highp vec2 _131; highp float _134; - highp float _136; - highp float _138; - _119 = 1000000000.0; - _122 = vec2(0.0); - _124 = vec4(0.0); - _126 = vec2(0.0); - _128 = 1000000000.0; - _130 = 1000000000.0; - _132 = vec4(0.0); + highp vec2 _136; + highp vec4 _138; + highp vec2 _140; + highp float _142; + highp float _144; + highp vec2 _146; + highp vec4 _148; + highp float _150; + highp float _152; + highp float _154; + _131 = vec2(0.0, 1.0); _134 = 1000000000.0; - _136 = 1000000000.0; - _138 = 1000000000.0; - highp vec2 _127; - highp float _131; - highp vec4 _133; - highp float _137; - highp float _139; - highp float _120; - highp vec2 _123; - highp vec4 _125; - highp float _129; + _136 = vec2(0.0); + _138 = vec4(0.0); + _140 = vec2(0.0); + _142 = 1000000000.0; + _144 = 1000000000.0; + _146 = vec2(0.0, 1.0); + _148 = vec4(0.0); + _150 = 1000000000.0; + _152 = 1000000000.0; + _154 = 1000000000.0; + highp vec2 _141; + highp float _145; + highp vec4 _149; + highp float _153; + highp float _155; + highp vec2 _132; highp float _135; - int _140 = _96; + highp vec2 _137; + highp vec4 _139; + highp float _143; + highp vec2 _147; + highp float _151; + int _156 = _104; for (;;) { - bool _149; - if (_140 < (_96 + _101)) + bool _165; + if (_156 < (_104 + _109)) { - _149 = _140 < 16; + _165 = _156 < 16; } else { - _149 = false; + _165 = false; } - if (_149) + if (_165) { - int _151 = 3 * _140; - int _152 = 7 + _151; - int _158 = _151 + 9; - highp vec2 _162 = vTextureCoord - uData[_152 * 1 + 0].xy; - highp float _166 = min(uData[_152 * 1 + 0].z, uData[_152 * 1 + 0].w); - highp vec4 _168 = min(uData[(_151 + 8) * 1 + 0], vec4(_166)); - highp float _169 = _162.x; - highp float _190; - if (_169 > 0.0) + int _167 = 3 * _156; + int _168 = 11 + _167; + int _174 = _167 + 13; + highp vec2 _178 = vTextureCoord - uData[_168 * 1 + 0].xy; + highp float _182 = min(uData[_168 * 1 + 0].z, uData[_168 * 1 + 0].w); + highp vec4 _184 = min(uData[(_167 + 12) * 1 + 0], vec4(_182)); + highp float _185 = _178.x; + highp float _206; + if (_185 > 0.0) { - highp float _181; - if (_162.y > 0.0) + highp float _197; + if (_178.y > 0.0) { - _181 = _168.z; + _197 = _184.z; } else { - _181 = _168.y; + _197 = _184.y; } - _190 = _181; + _206 = _197; } else { - highp float _189; - if (_162.y > 0.0) + highp float _205; + if (_178.y > 0.0) { - _189 = _168.w; + _205 = _184.w; } else { - _189 = _168.x; + _205 = _184.x; } - _190 = _189; + _206 = _205; } - highp vec2 _194 = (abs(_162) - uData[_152 * 1 + 0].zw) + vec2(_190); - highp float _196 = (_169 < 0.0) ? (-1.0) : 1.0; - highp float _199 = (_162.y < 0.0) ? (-1.0) : 1.0; - highp float _201 = _194.x; - bool _207; - if (_201 > 0.0) + highp vec2 _210 = (abs(_178) - uData[_168 * 1 + 0].zw) + vec2(_206); + highp float _212 = (_185 < 0.0) ? (-1.0) : 1.0; + highp float _215 = (_178.y < 0.0) ? (-1.0) : 1.0; + highp float _217 = _210.x; + bool _223; + if (_217 > 0.0) { - _207 = _194.y > 0.0; + _223 = _210.y > 0.0; } else { - _207 = false; + _223 = false; } - highp vec2 _221; - if (_207) + highp vec2 _237; + if (_223) { - _221 = normalize(_194) * vec2(_196, _199); + _237 = normalize(_210) * vec2(_212, _215); } else { - highp vec2 _220; - if (_201 > _194.y) + highp vec2 _236; + if (_217 > _210.y) { - _220 = vec2(_196, 0.0); + _236 = vec2(_212, 0.0); } else { - _220 = vec2(0.0, _199); + _236 = vec2(0.0, _215); } - _221 = _220; + _237 = _236; } - highp float _228 = (min(max(_201, _194.y), 0.0) + length(max(_194, vec2(0.0)))) - _190; - bool _229 = _228 < _136; - if (_229) + highp float _244 = (min(max(_217, _210.y), 0.0) + length(max(_210, vec2(0.0)))) - _206; + bool _245 = _244 < _152; + if (_245) { - _120 = _138; - _125 = _132; - _135 = _136; + _132 = _146; + _135 = _154; + _139 = _148; + _147 = uData[_168 * 1 + 0].yw; + _151 = _152; } else { - bool _233 = _228 < _134; - bvec4 _235 = bvec4(_233); - _120 = _233 ? _166 : _119; - _125 = vec4(_235.x ? uData[_158 * 1 + 0].x : _124.x, _235.y ? uData[_158 * 1 + 0].y : _124.y, _235.z ? uData[_158 * 1 + 0].z : _124.z, _235.w ? uData[_158 * 1 + 0].w : _124.w); - _135 = _233 ? _228 : _134; + bool _250 = _244 < _150; + highp vec2 _254; + if (_250) + { + _254 = uData[_168 * 1 + 0].yw; + } + else + { + _254 = _131; + } + bvec4 _256 = bvec4(_250); + _132 = _254; + _135 = _250 ? _182 : _134; + _139 = vec4(_256.x ? uData[_174 * 1 + 0].x : _138.x, _256.y ? uData[_174 * 1 + 0].y : _138.y, _256.z ? uData[_174 * 1 + 0].z : _138.z, _256.w ? uData[_174 * 1 + 0].w : _138.w); + _147 = _146; + _151 = _250 ? _244 : _150; } - bvec4 _238 = bvec4(_229); - _133 = vec4(_238.x ? uData[_158 * 1 + 0].x : _132.x, _238.y ? uData[_158 * 1 + 0].y : _132.y, _238.z ? uData[_158 * 1 + 0].z : _132.z, _238.w ? uData[_158 * 1 + 0].w : _132.w); - _137 = _229 ? _228 : _136; - _139 = _229 ? _166 : _138; - highp vec2 _283; - highp float _284; - if (uData[_158 * 1 + 0].w < 0.5) + bvec4 _259 = bvec4(_245); + _149 = vec4(_259.x ? uData[_174 * 1 + 0].x : _148.x, _259.y ? uData[_174 * 1 + 0].y : _148.y, _259.z ? uData[_174 * 1 + 0].z : _148.z, _259.w ? uData[_174 * 1 + 0].w : _148.w); + _153 = _245 ? _244 : _152; + _155 = _245 ? _182 : _154; + highp vec2 _304; + highp float _305; + if (uData[_174 * 1 + 0].w < 0.5) { - highp float _249 = (vTextureCoord.x - uData[_152 * 1 + 0].x) + uData[_152 * 1 + 0].z; - highp float _251 = (uData[_152 * 1 + 0].x + uData[_152 * 1 + 0].z) - vTextureCoord.x; - highp float _256 = (vTextureCoord.y - uData[_152 * 1 + 0].y) + uData[_152 * 1 + 0].w; - highp float _258 = (uData[_152 * 1 + 0].y + uData[_152 * 1 + 0].w) - vTextureCoord.y; - highp float _262 = min(min(_249, _251), min(_256, _258)); - highp vec4 _267 = exp((vec4(_262) - vec4(_249, _251, _256, _258)) / vec4(uData[1].y)); - highp float _268 = _267.x; - highp float _269 = _267.y; - highp float _271 = _267.z; - highp float _273 = _267.w; - highp float _274 = ((_268 + _269) + _271) + _273; - _283 = vec2(_269 - _268, _273 - _271) / vec2(_274); - _284 = (uData[1].y * log(_274)) - _262; + highp float _270 = (vTextureCoord.x - uData[_168 * 1 + 0].x) + uData[_168 * 1 + 0].z; + highp float _272 = (uData[_168 * 1 + 0].x + uData[_168 * 1 + 0].z) - vTextureCoord.x; + highp float _277 = (vTextureCoord.y - uData[_168 * 1 + 0].y) + uData[_168 * 1 + 0].w; + highp float _279 = (uData[_168 * 1 + 0].y + uData[_168 * 1 + 0].w) - vTextureCoord.y; + highp float _283 = min(min(_270, _272), min(_277, _279)); + highp vec4 _288 = exp((vec4(_283) - vec4(_270, _272, _277, _279)) / vec4(uData[1].y)); + highp float _289 = _288.x; + highp float _290 = _288.y; + highp float _292 = _288.z; + highp float _294 = _288.w; + highp float _295 = ((_289 + _290) + _292) + _294; + _304 = vec2(_290 - _289, _294 - _292) / vec2(_295); + _305 = (uData[1].y * log(_295)) - _283; } else { - _283 = _221; - _284 = _228; + _304 = _237; + _305 = _244; } - bool _285 = _284 < _130; - if (_285) + bool _306 = _305 < _144; + if (_306) { - _123 = _126; - _129 = _130; + _137 = _140; + _143 = _144; } else { - bool _289 = _284 < _128; - bvec2 _290 = bvec2(_289); - _123 = vec2(_290.x ? _283.x : _122.x, _290.y ? _283.y : _122.y); - _129 = _289 ? _284 : _128; + bool _310 = _305 < _142; + bvec2 _311 = bvec2(_310); + _137 = vec2(_311.x ? _304.x : _136.x, _311.y ? _304.y : _136.y); + _143 = _310 ? _305 : _142; } - bvec2 _293 = bvec2(_285); - _127 = vec2(_293.x ? _283.x : _126.x, _293.y ? _283.y : _126.y); - _131 = _285 ? _284 : _130; - _119 = _120; - _122 = _123; - _124 = _125; - _126 = _127; - _128 = _129; - _130 = _131; - _132 = _133; + bvec2 _314 = bvec2(_306); + _141 = vec2(_314.x ? _304.x : _140.x, _314.y ? _304.y : _140.y); + _145 = _306 ? _305 : _144; + _131 = _132; _134 = _135; _136 = _137; _138 = _139; - _140++; + _140 = _141; + _142 = _143; + _144 = _145; + _146 = _147; + _148 = _149; + _150 = _151; + _152 = _153; + _154 = _155; + _156++; continue; } else @@ -204,477 +225,525 @@ void main() break; } } - bool _297 = uData[54].w > 2.5; - bool _298 = uData[54].w > 1.5; - highp float _373; - highp vec2 _374; - if (_298) - { - highp vec2 _306 = vTextureCoord - uData[52].xy; - highp vec4 _312 = min(uData[53], vec4(min(uData[52].z, uData[52].w))); - highp float _313 = _306.x; - highp float _334; - if (_313 > 0.0) + bool _320 = uData[58].w > 2.5; + bool _321 = uData[58].w > 1.5; + highp float _394; + highp vec2 _395; + if (_321) + { + highp vec2 _327 = vTextureCoord - uData[56].xy; + highp vec4 _333 = min(uData[57], vec4(min(uData[56].z, uData[56].w))); + highp float _334 = _327.x; + highp float _355; + if (_334 > 0.0) { - highp float _325; - if (_306.y > 0.0) + highp float _346; + if (_327.y > 0.0) { - _325 = _312.z; + _346 = _333.z; } else { - _325 = _312.y; + _346 = _333.y; } - _334 = _325; + _355 = _346; } else { - highp float _333; - if (_306.y > 0.0) + highp float _354; + if (_327.y > 0.0) { - _333 = _312.w; + _354 = _333.w; } else { - _333 = _312.x; + _354 = _333.x; } - _334 = _333; + _355 = _354; } - highp vec2 _338 = (abs(_306) - uData[52].zw) + vec2(_334); - highp float _340 = (_313 < 0.0) ? (-1.0) : 1.0; - highp float _343 = (_306.y < 0.0) ? (-1.0) : 1.0; - highp float _345 = _338.x; - bool _351; - if (_345 > 0.0) + highp vec2 _359 = (abs(_327) - uData[56].zw) + vec2(_355); + highp float _361 = (_334 < 0.0) ? (-1.0) : 1.0; + highp float _364 = (_327.y < 0.0) ? (-1.0) : 1.0; + highp float _366 = _359.x; + bool _372; + if (_366 > 0.0) { - _351 = _338.y > 0.0; + _372 = _359.y > 0.0; } else { - _351 = false; + _372 = false; } - highp vec2 _365; - if (_351) + highp vec2 _386; + if (_372) { - _365 = normalize(_338) * vec2(_340, _343); + _386 = normalize(_359) * vec2(_361, _364); } else { - highp vec2 _364; - if (_345 > _338.y) + highp vec2 _385; + if (_366 > _359.y) { - _364 = vec2(_340, 0.0); + _385 = vec2(_361, 0.0); } else { - _364 = vec2(0.0, _343); + _385 = vec2(0.0, _364); } - _365 = _364; + _386 = _385; } - _373 = (min(max(_345, _338.y), 0.0) + length(max(_338, vec2(0.0)))) - _334; - _374 = _365; + _394 = (min(max(_366, _359.y), 0.0) + length(max(_359, vec2(0.0)))) - _355; + _395 = _386; } else { - _373 = -1000000000.0; - _374 = vec2(0.0); + _394 = -1000000000.0; + _395 = vec2(0.0); } - bool _378; - if (_298) + bool _399; + if (_321) { - _378 = !_297; + _399 = !_320; } else { - _378 = false; - } - highp float _411; - highp vec2 _412; - highp vec2 _413; - highp vec4 _414; - highp vec4 _415; - highp float _416; - highp float _417; - highp float _418; - highp float _419; - if (_378) - { - highp float _381 = 1.0 - _373; - bool _382 = _381 < _136; - highp float _391; - highp vec4 _392; - highp float _393; - if (_382) + _399 = false; + } + highp vec2 _439; + highp vec2 _440; + highp float _441; + highp vec2 _442; + highp vec2 _443; + highp vec4 _444; + highp vec4 _445; + highp float _446; + highp float _447; + highp float _448; + highp float _449; + if (_399) + { + highp float _402 = 1.0 - _394; + bool _403 = _402 < _152; + highp vec2 _417; + highp vec2 _418; + highp float _419; + highp vec4 _420; + highp float _421; + if (_403) { - _391 = _138; - _392 = _132; - _393 = _136; + _417 = _146; + _418 = uData[56].yw; + _419 = _154; + _420 = _148; + _421 = _152; } else { - bool _386 = _381 < _134; - bvec4 _388 = bvec4(_386); - _391 = _386 ? _138 : _119; - _392 = vec4(_388.x ? uData[54].x : _124.x, _388.y ? uData[54].y : _124.y, _388.z ? uData[54].z : _124.z, _388.w ? uData[54].w : _124.w); - _393 = _386 ? _381 : _134; + bool _408 = _402 < _150; + highp vec2 _412; + if (_408) + { + _412 = uData[56].yw; + } + else + { + _412 = _131; + } + bvec4 _414 = bvec4(_408); + _417 = _412; + _418 = _146; + _419 = _408 ? _154 : _134; + _420 = vec4(_414.x ? uData[58].x : _138.x, _414.y ? uData[58].y : _138.y, _414.z ? uData[58].z : _138.z, _414.w ? uData[58].w : _138.w); + _421 = _408 ? _402 : _150; } - bvec4 _394 = bvec4(_382); - highp vec2 _397 = -_374; - bool _398 = _381 < _130; - highp vec2 _406; - highp float _407; - if (_398) + bvec4 _422 = bvec4(_403); + highp vec2 _425 = -_395; + bool _426 = _402 < _144; + highp vec2 _434; + highp float _435; + if (_426) { - _406 = _126; - _407 = _130; + _434 = _140; + _435 = _144; } else { - bool _402 = _381 < _128; - bvec2 _403 = bvec2(_402); - _406 = vec2(_403.x ? _397.x : _122.x, _403.y ? _397.y : _122.y); - _407 = _402 ? _381 : _128; + bool _430 = _402 < _142; + bvec2 _431 = bvec2(_430); + _434 = vec2(_431.x ? _425.x : _136.x, _431.y ? _425.y : _136.y); + _435 = _430 ? _402 : _142; } - bvec2 _408 = bvec2(_398); - _411 = _391; - _412 = _406; - _413 = vec2(_408.x ? _397.x : _126.x, _408.y ? _397.y : _126.y); - _414 = _392; - _415 = vec4(_394.x ? uData[54].x : _132.x, _394.y ? uData[54].y : _132.y, _394.z ? uData[54].z : _132.z, _394.w ? uData[54].w : _132.w); - _416 = _407; - _417 = _398 ? _381 : _130; - _418 = _393; - _419 = _382 ? _381 : _136; + bvec2 _436 = bvec2(_426); + _439 = _417; + _440 = _418; + _441 = _419; + _442 = _434; + _443 = vec2(_436.x ? _425.x : _140.x, _436.y ? _425.y : _140.y); + _444 = _420; + _445 = vec4(_422.x ? uData[58].x : _148.x, _422.y ? uData[58].y : _148.y, _422.z ? uData[58].z : _148.z, _422.w ? uData[58].w : _148.w); + _446 = _435; + _447 = _426 ? _402 : _144; + _448 = _421; + _449 = _403 ? _402 : _152; } else { - _411 = _119; - _412 = _122; - _413 = _126; - _414 = _124; - _415 = _132; - _416 = _128; - _417 = _130; - _418 = _134; - _419 = _136; - } - highp float _421 = max(uData[1].x, 9.9999997473787516355514526367188e-05); - highp float _426 = max(_421 - abs(_419 - _418), 0.0) / _421; - highp float _427 = _426 * _426; - highp float _428 = _427 * 0.5; - highp float _433; - if (_418 < _419) - { - _433 = 1.0 - _428; + _439 = _131; + _440 = _146; + _441 = _134; + _442 = _136; + _443 = _140; + _444 = _138; + _445 = _148; + _446 = _142; + _447 = _144; + _448 = _150; + _449 = _152; + } + highp float _451 = max(uData[1].x, 9.9999997473787516355514526367188e-05); + highp float _456 = max(_451 - abs(_449 - _448), 0.0) / _451; + highp float _457 = _456 * _456; + highp float _458 = _457 * 0.5; + highp float _463; + if (_448 < _449) + { + _463 = 1.0 - _458; } else { - _433 = _428; + _463 = _458; } - highp float _437 = min(_419, _418) - ((_427 * _421) * 0.25); - highp float _442 = max(_421 - abs(_417 - _416), 0.0) / _421; - highp float _443 = _442 * _442; - highp float _444 = _443 * 0.5; - highp float _449; - if (_416 < _417) + highp float _467 = min(_449, _448) - ((_457 * _451) * 0.25); + highp float _472 = max(_451 - abs(_447 - _446), 0.0) / _451; + highp float _473 = _472 * _472; + highp float _474 = _473 * 0.5; + highp float _479; + if (_446 < _447) { - _449 = 1.0 - _444; + _479 = 1.0 - _474; } else { - _449 = _444; + _479 = _474; } - highp float _453 = min(_417, _416) - ((_443 * _421) * 0.25); - highp float _457; - if (_297) + highp float _483 = min(_447, _446) - ((_473 * _451) * 0.25); + highp float _487; + if (_320) { - _457 = max(_437, _373); + _487 = max(_467, _394); } else { - _457 = _437; + _487 = _467; } - highp float _460 = clamp(0.5 - max(_457, _373), 0.0, 1.0); - if (_460 <= 0.0) + highp float _490 = clamp(0.5 - max(_487, _394), 0.0, 1.0); + if (_490 <= 0.0) { discard; } if (vColor.x < 0.5) { - _853 = vec4(0.0, 0.0, 0.0, _460); + _933 = vec4(0.0, 0.0, 0.0, _490); break; } - highp vec4 _471 = mix(_415, _414, vec4(_433)); - highp vec2 _473 = mix(_413, _412, vec2(_449)); - bool _477; - if (_297) + highp vec4 _501 = mix(_445, _444, vec4(_463)); + highp vec2 _503 = mix(_443, _442, vec2(_479)); + bool _507; + if (_320) { - _477 = _373 > _453; + _507 = _394 > _483; } else { - _477 = false; - } - bvec2 _478 = bvec2(_477); - highp vec2 _479 = vec2(_478.x ? _374.x : _473.x, _478.y ? _374.y : _473.y); - highp float _482 = max(0.0, -(_477 ? _373 : _453)); - highp float _483 = -_482; - highp float _486 = exp(_483 / uData[1].z); - highp float _492 = _471.y; - highp float _526; - highp float _527; - highp vec2 _528; - if (_117) - { - highp float _500 = max(min(uData[5].y * mix(_138, _411, _433), uData[6].w), 1.0); - highp float _503 = clamp(1.0 - (_482 / _500), 0.0, 1.0); - highp float _508 = (((uData[5].z * _500) * _492) * _503) * _503; - _526 = _503; - _527 = _508; - _528 = clamp(((vTextureCoord - (_479 * _508)) - uData[0].xy) * uData[0].zw, vec2(0.0), vec2(1.0)); + _507 = false; + } + bvec2 _508 = bvec2(_507); + highp vec2 _509 = vec2(_508.x ? _395.x : _503.x, _508.y ? _395.y : _503.y); + highp float _512 = max(0.0, -(_507 ? _394 : _483)); + highp float _513 = -_512; + highp float _516 = exp(_513 / uData[1].z); + highp float _522 = _501.y; + highp float _556; + highp float _557; + highp vec2 _558; + if (_129) + { + highp float _530 = max(min(uData[5].y * mix(_154, _441, _463), uData[6].w), 1.0); + highp float _533 = clamp(1.0 - (_512 / _530), 0.0, 1.0); + highp float _538 = (((uData[5].z * _530) * _522) * _533) * _533; + _556 = _533; + _557 = _538; + _558 = clamp(((vTextureCoord - (_509 * _538)) - uData[0].xy) * uData[0].zw, vec2(0.0), vec2(1.0)); } else { - _526 = 0.0; - _527 = 0.0; - _528 = clamp(((vTextureCoord + (_479 * ((uData[2].x * _492) * _486))) - uData[0].xy) * uData[0].zw, vec2(0.0), vec2(1.0)); + _556 = 0.0; + _557 = 0.0; + _558 = clamp(((vTextureCoord + (_509 * ((uData[2].x * _522) * _516))) - uData[0].xy) * uData[0].zw, vec2(0.0), vec2(1.0)); } - highp vec4 _532 = textureLod(uSampler, _528, 0.0); - bool _534 = uData[4].w > 0.5; - highp vec4 _542; - if (_534) + highp vec4 _562 = textureLod(uSampler, _558, 0.0); + bool _564 = uData[4].w > 0.5; + highp vec4 _572; + if (_564) { - _542 = textureLod(uTex1, _528, 0.0); + _572 = textureLod(uTex1, _558, 0.0); } else { - _542 = _532; + _572 = _562; } - bool _547; - if (_117) + bool _577; + if (_129) { - _547 = uData[6].y > 0.0; + _577 = uData[6].y > 0.0; } else { - _547 = false; + _577 = false; } - bool _551; - if (_547) + bool _581; + if (_577) { - _551 = _527 > 0.5; + _581 = _557 > 0.5; } else { - _551 = false; - } - highp vec4 _612; - highp vec4 _613; - if (_551) - { - highp vec2 _559 = (_479 * ((_527 * 0.039999999105930328369140625) * uData[6].y)) * uData[0].zw; - highp vec2 _561 = clamp(_528 + _559, vec2(0.0), vec2(1.0)); - highp vec2 _563 = clamp(_528 - _559, vec2(0.0), vec2(1.0)); - highp vec4 _567 = textureLod(uSampler, _561, 0.0); - highp float _572 = _532.w; - highp float _573 = (_567.x / max(_567.w, 9.9999997473787516355514526367188e-05)) * _572; - highp vec4 _574 = _532; - _574.x = _573; - highp vec4 _578 = textureLod(uSampler, _563, 0.0); - highp float _583 = (_578.z / max(_578.w, 9.9999997473787516355514526367188e-05)) * _572; - _574.z = _583; - highp vec4 _611; - if (_534) + _581 = false; + } + highp vec4 _642; + highp vec4 _643; + if (_581) + { + highp vec2 _589 = (_509 * ((_557 * 0.039999999105930328369140625) * uData[6].y)) * uData[0].zw; + highp vec2 _591 = clamp(_558 + _589, vec2(0.0), vec2(1.0)); + highp vec2 _593 = clamp(_558 - _589, vec2(0.0), vec2(1.0)); + highp vec4 _597 = textureLod(uSampler, _591, 0.0); + highp float _602 = _562.w; + highp float _603 = (_597.x / max(_597.w, 9.9999997473787516355514526367188e-05)) * _602; + highp vec4 _604 = _562; + _604.x = _603; + highp vec4 _608 = textureLod(uSampler, _593, 0.0); + highp float _613 = (_608.z / max(_608.w, 9.9999997473787516355514526367188e-05)) * _602; + _604.z = _613; + highp vec4 _641; + if (_564) { - highp vec4 _591 = textureLod(uTex1, _561, 0.0); - highp vec4 _598 = _542; - _598.x = (_591.x / max(_591.w, 9.9999997473787516355514526367188e-05)) * _542.w; - highp vec4 _602 = textureLod(uTex1, _563, 0.0); - _598.z = (_602.z / max(_602.w, 9.9999997473787516355514526367188e-05)) * _542.w; - _611 = _598; + highp vec4 _621 = textureLod(uTex1, _591, 0.0); + highp vec4 _628 = _572; + _628.x = (_621.x / max(_621.w, 9.9999997473787516355514526367188e-05)) * _572.w; + highp vec4 _632 = textureLod(uTex1, _593, 0.0); + _628.z = (_632.z / max(_632.w, 9.9999997473787516355514526367188e-05)) * _572.w; + _641 = _628; } else { - highp vec4 _609 = _542; - _609.x = _573; - _609.z = _583; - _611 = _609; + highp vec4 _639 = _572; + _639.x = _603; + _639.z = _613; + _641 = _639; } - _612 = _611; - _613 = _574; + _642 = _641; + _643 = _604; } else { - _612 = _542; - _613 = _532; + _642 = _572; + _643 = _562; } - bool _615 = uData[4].x > 1.5; - highp float _629; - if (_615) + bool _645 = uData[4].x > 1.5; + highp float _659; + if (_645) { - _629 = uData[3].w; + _659 = uData[3].w; } else { - highp float _628; + highp float _658; if ((uData[6].x - 2.0 * trunc(uData[6].x / 2.0)) > 0.5) { - _628 = 1.0; + _658 = 1.0; } else { - _628 = _613.w; + _658 = _643.w; } - _629 = _628; + _659 = _658; } - highp vec4 _638 = vec4(_613.xyz / vec3(max(_613.w, 9.9999997473787516355514526367188e-05)), 1.0); - highp vec4 _647 = vec4(_612.xyz / vec3(max(_612.w, 9.9999997473787516355514526367188e-05)), 1.0); - highp float _654; - if (_615) + highp vec4 _668 = vec4(_643.xyz / vec3(max(_643.w, 9.9999997473787516355514526367188e-05)), 1.0); + highp vec4 _677 = vec4(_642.xyz / vec3(max(_642.w, 9.9999997473787516355514526367188e-05)), 1.0); + highp float _684; + if (_645) { - _654 = 1.0; + _684 = 1.0; } else { - _654 = (uData[4].z > 0.5) ? uData[4].x : 0.0; + _684 = (uData[4].z > 0.5) ? uData[4].x : 0.0; } - bool _658; - if (_117) + bool _688; + if (_129) { - _658 = !_615; + _688 = !_645; } else { - _658 = false; + _688 = false; } - highp float _667; - if (_658) + highp float _697; + if (_688) { - _667 = _654 * (1.0 - ((_526 * _526) * (1.0 - smoothstep(0.800000011920928955078125, 1.0, _654)))); + _697 = _684 * (1.0 - ((_556 * _556) * (1.0 - smoothstep(0.800000011920928955078125, 1.0, _684)))); } else { - _667 = _654; + _697 = _684; } - highp float _670 = 1.0 - _667; - highp float _678; - if (_117) + highp float _700 = 1.0 - _697; + highp float _708; + if (_129) { - _678 = _526; + _708 = _556; } else { - _678 = _486 * _486; + _708 = _516 * _516; } - highp float _681 = clamp(((uData[2].y * _492) * _678) * _670, 0.0, 1.0); - highp vec4 _687 = ((_647 * _681) + ((mix(_647, _638, vec4(clamp(_471.x, 0.0, 1.0))) * _670) * (1.0 - _681))) + (uData[3] * _667); - highp vec4 _704; - if (_615) + highp float _711 = clamp(((uData[2].y * _522) * _708) * _700, 0.0, 1.0); + highp vec4 _717 = ((_677 * _711) + ((mix(_677, _668, vec4(clamp(_501.x, 0.0, 1.0))) * _700) * (1.0 - _711))) + (uData[3] * _697); + highp vec4 _760; + if (_645) { - _704 = vec4(uData[3].xyz / vec3(max(uData[3].w, 9.9999997473787516355514526367188e-05)), 1.0); + _760 = vec4(uData[3].xyz / vec3(max(uData[3].w, 9.9999997473787516355514526367188e-05)), 1.0); } else { - _704 = _687 + (_638 * (1.0 - _687.w)); + highp vec4 _733 = _717 + (_668 * (1.0 - _717.w)); + highp vec4 _759; + if (uData[7].w < 1.0) + { + highp vec3 _738 = _733.xyz; + highp float _739 = dot(_738, vec3(0.2125999927520751953125, 0.715200006961822509765625, 0.072200000286102294921875)); + highp float _740 = 0.60000002384185791015625 * uData[7].w; + highp float _742 = max(uData[7].w - _740, 9.9999997473787516355514526367188e-05); + highp float _754; + if (_739 <= _740) + { + _754 = _739; + } + else + { + _754 = _740 + (_742 * (1.0 - exp((-(_739 - _740)) / _742))); + } + highp vec3 _757 = _738 * (_754 / max(_739, 9.9999997473787516355514526367188e-05)); + _759 = vec4(_757.x, _757.y, _757.z, _733.w); + } + else + { + _759 = _733; + } + _760 = _759; } - bvec2 _707 = bvec2(uData[6].x > 1.5); - highp float _710 = dot(_479, vec2(_707.x ? vec2(0.707106769084930419921875, -0.707106769084930419921875).x : vec2(-0.707106769084930419921875).x, _707.y ? vec2(0.707106769084930419921875, -0.707106769084930419921875).y : vec2(-0.707106769084930419921875).y)); - highp float _711 = max(_710, 0.0); - highp float _713 = max(-_710, 0.0); - highp float _716 = abs(_710); - bool _720; - if (_117) + bvec2 _763 = bvec2(uData[6].x > 1.5); + highp float _766 = dot(_509, vec2(_763.x ? vec2(0.707106769084930419921875, -0.707106769084930419921875).x : vec2(-0.707106769084930419921875).x, _763.y ? vec2(0.707106769084930419921875, -0.707106769084930419921875).y : vec2(-0.707106769084930419921875).y)); + highp float _767 = max(_766, 0.0); + highp float _769 = max(-_766, 0.0); + highp float _772 = abs(_766); + bool _776; + if (_129) { - _720 = uData[6].z > 0.0; + _776 = uData[6].z > 0.0; } else { - _720 = false; + _776 = false; } - highp float _739; - if (_720) + highp float _796; + if (_776) { - _739 = (uData[6].z * (1.0 - smoothstep(0.20000000298023223876953125, 0.699999988079071044921875, _716))) * exp((-max(0.0, -_457)) / (uData[2].z * 2.5)); + _796 = (uData[6].z * (1.0 - smoothstep(0.20000000298023223876953125, 0.699999988079071044921875, _772))) * exp((-max(0.0, -_487)) / (uData[2].z * 2.5)); } else { - _739 = 0.85000002384185791015625 * (1.0 - smoothstep(0.0, uData[2].z * 0.625, -_457)); + _796 = uData[10].x * (1.0 - smoothstep(0.0, uData[2].z * 0.625, -_487)); } - highp float _749; - if (_117) + highp float _806; + if (_129) { - _749 = max((uData[5].w * _526) * _526, _739) * min(_492, 1.0); + _806 = max((uData[5].w * _556) * _556, _796) * min(_522, 1.0); } else { - _749 = 0.0; + _806 = 0.0; } - highp float _752 = _629 * (1.0 - _749); - highp vec4 _758 = vec4(_704.xyz * _752, _752 + _749); - highp float _776; - if (_117) + highp float _809 = _659 * (1.0 - _806); + highp vec4 _815 = vec4(_760.xyz * _809, _809 + _806); + highp float _833; + if (_129) { - highp float _767; - if (_720) + highp float _824; + if (_776) { - _767 = uData[6].z * smoothstep(0.75, 1.0, _716); + _824 = uData[6].z * smoothstep(0.75, 1.0, _772); } else { - _767 = 0.25; + _824 = 0.25; } - _776 = _767; + _833 = _824; } else { - _776 = (0.449999988079071044921875 * ((_711 * sqrt(_711)) + ((0.75 * _713) * sqrt(_713)))) + 0.0599999986588954925537109375; + _833 = (0.449999988079071044921875 * ((_767 * sqrt(_767)) + ((0.75 * _769) * sqrt(_769)))) + 0.0599999986588954925537109375; } - highp float _803; - if (_720) + highp float _860; + if (_776) { - _803 = exp((-max(0.0, -_457)) / (uData[2].z * 1.25)); + _860 = exp((-max(0.0, -_487)) / (uData[2].z * 1.25)); } else { - highp float _802; - if (_117) + highp float _859; + if (_129) { - highp float _790 = -_457; - _802 = smoothstep(uData[2].z * 0.3125, uData[2].z * 0.625, _790) * (1.0 - smoothstep(uData[2].z * 1.5, uData[2].z * 2.0, _790)); + highp float _847 = -_487; + _859 = smoothstep(uData[2].z * 0.3125, uData[2].z * 0.625, _847) * (1.0 - smoothstep(uData[2].z * 1.5, uData[2].z * 2.0, _847)); } else { - _802 = exp((-max(0.0, -_457)) / uData[2].z); + _859 = exp((-max(0.0, -_487)) / uData[2].z); } - _803 = _802; + _860 = _859; } - highp float _810; - if (_117) + highp float _867; + if (_129) { - _810 = 0.0; + _867 = 0.0; } else { - _810 = (0.039999999105930328369140625 * exp(_483 / uData[1].w)) * _711; + _867 = (0.039999999105930328369140625 * exp(_513 / uData[1].w)) * _767; } - highp float _818; + highp vec2 _870 = mix(_440, _439, vec2(_463)); + highp float _874 = _870.y; + highp float _880 = clamp((vTextureCoord.y - (_870.x - _874)) / max(2.0 * _874, 9.9999997473787516355514526367188e-05), 0.0, 1.0); + highp float _898; if (uData[4].z > 0.5) { - _818 = uData[4].y; + _898 = uData[4].y + ((uData[7].x + ((uData[7].y - uData[7].x) * _880)) + (uData[7].z * (1.0 - smoothstep(0.0, 0.37999999523162841796875, _880)))); } else { - _818 = 0.0; + _898 = 0.0; } - highp vec3 _828 = _758.xyz + vec3(clamp((_818 + _471.z) + ((_492 * uData[2].w) * ((_803 * _776) + _810)), 0.0, 1.0)); - highp vec4 _830 = clamp(vec4(_828.x, _828.y, _828.z, _758.w), vec4(0.0), vec4(1.0)); - highp float _837 = max(_830.w, max(_830.x, max(_830.y, _830.z))); - highp vec4 _838 = _830; - _838.w = _837; - highp vec3 _849 = _838.xyz + vec3(((fract(52.98291778564453125 * fract(dot(vTextureCoord, vec2(0.067110560834407806396484375, 0.005837149918079376220703125)))) - 0.5) * uData[5].x) * _837); - _853 = clamp(vec4(_849.x, _849.y, _849.z, _838.w), vec4(0.0), vec4(1.0)) * _460; + highp vec3 _908 = _815.xyz + vec3(clamp((_898 + _501.z) + ((_522 * uData[2].w) * ((_860 * _833) + _867)), 0.0, 1.0)); + highp vec4 _910 = clamp(vec4(_908.x, _908.y, _908.z, _815.w), vec4(0.0), vec4(1.0)); + highp float _917 = max(_910.w, max(_910.x, max(_910.y, _910.z))); + highp vec4 _918 = _910; + _918.w = _917; + highp vec3 _929 = _918.xyz + vec3(((fract(52.98291778564453125 * fract(dot(vTextureCoord, vec2(0.067110560834407806396484375, 0.005837149918079376220703125)))) - 0.5) * uData[5].x) * _917); + _933 = clamp(vec4(_929.x, _929.y, _929.z, _918.w), vec4(0.0), vec4(1.0)) * _490; break; } while(false); - out_var_SV_Target0 = _853; + out_var_SV_Target0 = _933; } diff --git a/backend/src/glass/shaders/compiled/msl/liquid_glass.fragment.msl b/backend/src/glass/shaders/compiled/msl/liquid_glass.fragment.msl index d3d722a4e..b391cfe08 100644 --- a/backend/src/glass/shaders/compiled/msl/liquid_glass.fragment.msl +++ b/backend/src/glass/shaders/compiled/msl/liquid_glass.fragment.msl @@ -5,7 +5,7 @@ using namespace metal; struct type_Uniforms { - float4 uData[55]; + float4 uData[59]; }; struct main0_out @@ -22,187 +22,208 @@ struct main0_in fragment main0_out main0(main0_in in [[stage_in]], constant type_Uniforms& Uniforms [[buffer(0)]], texture2d Frost [[texture(0)]], texture2d Sharp [[texture(1)]], sampler FrostSampler [[sampler(0)]], sampler SharpSampler [[sampler(1)]]) { main0_out out = {}; - float4 _853; + float4 _933; do { - int _96 = int((in.in_var_COLOR.y * 255.0) + 0.5); - int _101 = int((in.in_var_COLOR.z * 255.0) + 0.5); - bool _117 = Uniforms.uData[5].y > 0.0; - float _119; - float2 _122; - float4 _124; - float2 _126; - float _128; - float _130; - float4 _132; + int _104 = int((in.in_var_COLOR.y * 255.0) + 0.5); + int _109 = int((in.in_var_COLOR.z * 255.0) + 0.5); + bool _129 = Uniforms.uData[5].y > 0.0; + float2 _131; float _134; - float _136; - float _138; - _119 = 1000000000.0; - _122 = float2(0.0); - _124 = float4(0.0); - _126 = float2(0.0); - _128 = 1000000000.0; - _130 = 1000000000.0; - _132 = float4(0.0); + float2 _136; + float4 _138; + float2 _140; + float _142; + float _144; + float2 _146; + float4 _148; + float _150; + float _152; + float _154; + _131 = float2(0.0, 1.0); _134 = 1000000000.0; - _136 = 1000000000.0; - _138 = 1000000000.0; - float2 _127; - float _131; - float4 _133; - float _137; - float _139; - float _120; - float2 _123; - float4 _125; - float _129; + _136 = float2(0.0); + _138 = float4(0.0); + _140 = float2(0.0); + _142 = 1000000000.0; + _144 = 1000000000.0; + _146 = float2(0.0, 1.0); + _148 = float4(0.0); + _150 = 1000000000.0; + _152 = 1000000000.0; + _154 = 1000000000.0; + float2 _141; + float _145; + float4 _149; + float _153; + float _155; + float2 _132; float _135; - int _140 = _96; + float2 _137; + float4 _139; + float _143; + float2 _147; + float _151; + int _156 = _104; for (;;) { - bool _149; - if (_140 < (_96 + _101)) + bool _165; + if (_156 < (_104 + _109)) { - _149 = _140 < 16; + _165 = _156 < 16; } else { - _149 = false; + _165 = false; } - if (_149) + if (_165) { - int _151 = 3 * _140; - int _152 = 7 + _151; - int _158 = _151 + 9; - float2 _162 = in.in_var_TEXCOORD0 - Uniforms.uData[_152].xy; - float _166 = precise::min(Uniforms.uData[_152].z, Uniforms.uData[_152].w); - float4 _168 = precise::min(Uniforms.uData[_151 + 8], float4(_166)); - float _169 = _162.x; - float _190; - if (_169 > 0.0) + int _167 = 3 * _156; + int _168 = 11 + _167; + int _174 = _167 + 13; + float2 _178 = in.in_var_TEXCOORD0 - Uniforms.uData[_168].xy; + float _182 = precise::min(Uniforms.uData[_168].z, Uniforms.uData[_168].w); + float4 _184 = precise::min(Uniforms.uData[_167 + 12], float4(_182)); + float _185 = _178.x; + float _206; + if (_185 > 0.0) { - float _181; - if (_162.y > 0.0) + float _197; + if (_178.y > 0.0) { - _181 = _168.z; + _197 = _184.z; } else { - _181 = _168.y; + _197 = _184.y; } - _190 = _181; + _206 = _197; } else { - float _189; - if (_162.y > 0.0) + float _205; + if (_178.y > 0.0) { - _189 = _168.w; + _205 = _184.w; } else { - _189 = _168.x; + _205 = _184.x; } - _190 = _189; + _206 = _205; } - float2 _194 = (abs(_162) - Uniforms.uData[_152].zw) + float2(_190); - float _196 = (_169 < 0.0) ? (-1.0) : 1.0; - float _199 = (_162.y < 0.0) ? (-1.0) : 1.0; - float _201 = _194.x; - bool _207; - if (_201 > 0.0) + float2 _210 = (abs(_178) - Uniforms.uData[_168].zw) + float2(_206); + float _212 = (_185 < 0.0) ? (-1.0) : 1.0; + float _215 = (_178.y < 0.0) ? (-1.0) : 1.0; + float _217 = _210.x; + bool _223; + if (_217 > 0.0) { - _207 = _194.y > 0.0; + _223 = _210.y > 0.0; } else { - _207 = false; + _223 = false; } - float2 _221; - if (_207) + float2 _237; + if (_223) { - _221 = fast::normalize(_194) * float2(_196, _199); + _237 = fast::normalize(_210) * float2(_212, _215); } else { - float2 _220; - if (_201 > _194.y) + float2 _236; + if (_217 > _210.y) { - _220 = float2(_196, 0.0); + _236 = float2(_212, 0.0); } else { - _220 = float2(0.0, _199); + _236 = float2(0.0, _215); } - _221 = _220; + _237 = _236; } - float _228 = (precise::min(precise::max(_201, _194.y), 0.0) + length(precise::max(_194, float2(0.0)))) - _190; - bool _229 = _228 < _136; - if (_229) + float _244 = (precise::min(precise::max(_217, _210.y), 0.0) + length(precise::max(_210, float2(0.0)))) - _206; + bool _245 = _244 < _152; + if (_245) { - _120 = _138; - _125 = _132; - _135 = _136; + _132 = _146; + _135 = _154; + _139 = _148; + _147 = Uniforms.uData[_168].yw; + _151 = _152; } else { - bool _233 = _228 < _134; - _120 = _233 ? _166 : _119; - _125 = select(_124, Uniforms.uData[_158], bool4(_233)); - _135 = _233 ? _228 : _134; + bool _250 = _244 < _150; + float2 _254; + if (_250) + { + _254 = Uniforms.uData[_168].yw; + } + else + { + _254 = _131; + } + _132 = _254; + _135 = _250 ? _182 : _134; + _139 = select(_138, Uniforms.uData[_174], bool4(_250)); + _147 = _146; + _151 = _250 ? _244 : _150; } - _133 = select(_132, Uniforms.uData[_158], bool4(_229)); - _137 = _229 ? _228 : _136; - _139 = _229 ? _166 : _138; - float2 _283; - float _284; - if (Uniforms.uData[_158].w < 0.5) + _149 = select(_148, Uniforms.uData[_174], bool4(_245)); + _153 = _245 ? _244 : _152; + _155 = _245 ? _182 : _154; + float2 _304; + float _305; + if (Uniforms.uData[_174].w < 0.5) { - float _249 = (in.in_var_TEXCOORD0.x - Uniforms.uData[_152].x) + Uniforms.uData[_152].z; - float _251 = (Uniforms.uData[_152].x + Uniforms.uData[_152].z) - in.in_var_TEXCOORD0.x; - float _256 = (in.in_var_TEXCOORD0.y - Uniforms.uData[_152].y) + Uniforms.uData[_152].w; - float _258 = (Uniforms.uData[_152].y + Uniforms.uData[_152].w) - in.in_var_TEXCOORD0.y; - float _262 = precise::min(precise::min(_249, _251), precise::min(_256, _258)); - float4 _267 = exp((float4(_262) - float4(_249, _251, _256, _258)) / float4(Uniforms.uData[1].y)); - float _268 = _267.x; - float _269 = _267.y; - float _271 = _267.z; - float _273 = _267.w; - float _274 = ((_268 + _269) + _271) + _273; - _283 = float2(_269 - _268, _273 - _271) / float2(_274); - _284 = (Uniforms.uData[1].y * log(_274)) - _262; + float _270 = (in.in_var_TEXCOORD0.x - Uniforms.uData[_168].x) + Uniforms.uData[_168].z; + float _272 = (Uniforms.uData[_168].x + Uniforms.uData[_168].z) - in.in_var_TEXCOORD0.x; + float _277 = (in.in_var_TEXCOORD0.y - Uniforms.uData[_168].y) + Uniforms.uData[_168].w; + float _279 = (Uniforms.uData[_168].y + Uniforms.uData[_168].w) - in.in_var_TEXCOORD0.y; + float _283 = precise::min(precise::min(_270, _272), precise::min(_277, _279)); + float4 _288 = exp((float4(_283) - float4(_270, _272, _277, _279)) / float4(Uniforms.uData[1].y)); + float _289 = _288.x; + float _290 = _288.y; + float _292 = _288.z; + float _294 = _288.w; + float _295 = ((_289 + _290) + _292) + _294; + _304 = float2(_290 - _289, _294 - _292) / float2(_295); + _305 = (Uniforms.uData[1].y * log(_295)) - _283; } else { - _283 = _221; - _284 = _228; + _304 = _237; + _305 = _244; } - bool _285 = _284 < _130; - if (_285) + bool _306 = _305 < _144; + if (_306) { - _123 = _126; - _129 = _130; + _137 = _140; + _143 = _144; } else { - bool _289 = _284 < _128; - _123 = select(_122, _283, bool2(_289)); - _129 = _289 ? _284 : _128; + bool _310 = _305 < _142; + _137 = select(_136, _304, bool2(_310)); + _143 = _310 ? _305 : _142; } - _127 = select(_126, _283, bool2(_285)); - _131 = _285 ? _284 : _130; - _119 = _120; - _122 = _123; - _124 = _125; - _126 = _127; - _128 = _129; - _130 = _131; - _132 = _133; + _141 = select(_140, _304, bool2(_306)); + _145 = _306 ? _305 : _144; + _131 = _132; _134 = _135; _136 = _137; _138 = _139; - _140++; + _140 = _141; + _142 = _143; + _144 = _145; + _146 = _147; + _148 = _149; + _150 = _151; + _152 = _153; + _154 = _155; + _156++; continue; } else @@ -210,471 +231,519 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Uniforms& Unifo break; } } - bool _297 = Uniforms.uData[54].w > 2.5; - bool _298 = Uniforms.uData[54].w > 1.5; - float _373; - float2 _374; - if (_298) - { - float2 _306 = in.in_var_TEXCOORD0 - Uniforms.uData[52].xy; - float4 _312 = precise::min(Uniforms.uData[53], float4(precise::min(Uniforms.uData[52].z, Uniforms.uData[52].w))); - float _313 = _306.x; - float _334; - if (_313 > 0.0) + bool _320 = Uniforms.uData[58].w > 2.5; + bool _321 = Uniforms.uData[58].w > 1.5; + float _394; + float2 _395; + if (_321) + { + float2 _327 = in.in_var_TEXCOORD0 - Uniforms.uData[56].xy; + float4 _333 = precise::min(Uniforms.uData[57], float4(precise::min(Uniforms.uData[56].z, Uniforms.uData[56].w))); + float _334 = _327.x; + float _355; + if (_334 > 0.0) { - float _325; - if (_306.y > 0.0) + float _346; + if (_327.y > 0.0) { - _325 = _312.z; + _346 = _333.z; } else { - _325 = _312.y; + _346 = _333.y; } - _334 = _325; + _355 = _346; } else { - float _333; - if (_306.y > 0.0) + float _354; + if (_327.y > 0.0) { - _333 = _312.w; + _354 = _333.w; } else { - _333 = _312.x; + _354 = _333.x; } - _334 = _333; + _355 = _354; } - float2 _338 = (abs(_306) - Uniforms.uData[52].zw) + float2(_334); - float _340 = (_313 < 0.0) ? (-1.0) : 1.0; - float _343 = (_306.y < 0.0) ? (-1.0) : 1.0; - float _345 = _338.x; - bool _351; - if (_345 > 0.0) + float2 _359 = (abs(_327) - Uniforms.uData[56].zw) + float2(_355); + float _361 = (_334 < 0.0) ? (-1.0) : 1.0; + float _364 = (_327.y < 0.0) ? (-1.0) : 1.0; + float _366 = _359.x; + bool _372; + if (_366 > 0.0) { - _351 = _338.y > 0.0; + _372 = _359.y > 0.0; } else { - _351 = false; + _372 = false; } - float2 _365; - if (_351) + float2 _386; + if (_372) { - _365 = fast::normalize(_338) * float2(_340, _343); + _386 = fast::normalize(_359) * float2(_361, _364); } else { - float2 _364; - if (_345 > _338.y) + float2 _385; + if (_366 > _359.y) { - _364 = float2(_340, 0.0); + _385 = float2(_361, 0.0); } else { - _364 = float2(0.0, _343); + _385 = float2(0.0, _364); } - _365 = _364; + _386 = _385; } - _373 = (precise::min(precise::max(_345, _338.y), 0.0) + length(precise::max(_338, float2(0.0)))) - _334; - _374 = _365; + _394 = (precise::min(precise::max(_366, _359.y), 0.0) + length(precise::max(_359, float2(0.0)))) - _355; + _395 = _386; } else { - _373 = -1000000000.0; - _374 = float2(0.0); + _394 = -1000000000.0; + _395 = float2(0.0); } - bool _378; - if (_298) + bool _399; + if (_321) { - _378 = !_297; + _399 = !_320; } else { - _378 = false; - } - float _411; - float2 _412; - float2 _413; - float4 _414; - float4 _415; - float _416; - float _417; - float _418; - float _419; - if (_378) - { - float _381 = 1.0 - _373; - bool _382 = _381 < _136; - float _391; - float4 _392; - float _393; - if (_382) + _399 = false; + } + float2 _439; + float2 _440; + float _441; + float2 _442; + float2 _443; + float4 _444; + float4 _445; + float _446; + float _447; + float _448; + float _449; + if (_399) + { + float _402 = 1.0 - _394; + bool _403 = _402 < _152; + float2 _417; + float2 _418; + float _419; + float4 _420; + float _421; + if (_403) { - _391 = _138; - _392 = _132; - _393 = _136; + _417 = _146; + _418 = Uniforms.uData[56].yw; + _419 = _154; + _420 = _148; + _421 = _152; } else { - bool _386 = _381 < _134; - _391 = _386 ? _138 : _119; - _392 = select(_124, Uniforms.uData[54], bool4(_386)); - _393 = _386 ? _381 : _134; + bool _408 = _402 < _150; + float2 _412; + if (_408) + { + _412 = Uniforms.uData[56].yw; + } + else + { + _412 = _131; + } + _417 = _412; + _418 = _146; + _419 = _408 ? _154 : _134; + _420 = select(_138, Uniforms.uData[58], bool4(_408)); + _421 = _408 ? _402 : _150; } - float2 _397 = -_374; - bool _398 = _381 < _130; - float2 _406; - float _407; - if (_398) + float2 _425 = -_395; + bool _426 = _402 < _144; + float2 _434; + float _435; + if (_426) { - _406 = _126; - _407 = _130; + _434 = _140; + _435 = _144; } else { - bool _402 = _381 < _128; - _406 = select(_122, _397, bool2(_402)); - _407 = _402 ? _381 : _128; + bool _430 = _402 < _142; + _434 = select(_136, _425, bool2(_430)); + _435 = _430 ? _402 : _142; } - _411 = _391; - _412 = _406; - _413 = select(_126, _397, bool2(_398)); - _414 = _392; - _415 = select(_132, Uniforms.uData[54], bool4(_382)); - _416 = _407; - _417 = _398 ? _381 : _130; - _418 = _393; - _419 = _382 ? _381 : _136; + _439 = _417; + _440 = _418; + _441 = _419; + _442 = _434; + _443 = select(_140, _425, bool2(_426)); + _444 = _420; + _445 = select(_148, Uniforms.uData[58], bool4(_403)); + _446 = _435; + _447 = _426 ? _402 : _144; + _448 = _421; + _449 = _403 ? _402 : _152; } else { - _411 = _119; - _412 = _122; - _413 = _126; - _414 = _124; - _415 = _132; - _416 = _128; - _417 = _130; - _418 = _134; - _419 = _136; - } - float _421 = precise::max(Uniforms.uData[1].x, 9.9999997473787516355514526367188e-05); - float _426 = precise::max(_421 - abs(_419 - _418), 0.0) / _421; - float _427 = _426 * _426; - float _428 = _427 * 0.5; - float _433; - if (_418 < _419) - { - _433 = 1.0 - _428; + _439 = _131; + _440 = _146; + _441 = _134; + _442 = _136; + _443 = _140; + _444 = _138; + _445 = _148; + _446 = _142; + _447 = _144; + _448 = _150; + _449 = _152; + } + float _451 = precise::max(Uniforms.uData[1].x, 9.9999997473787516355514526367188e-05); + float _456 = precise::max(_451 - abs(_449 - _448), 0.0) / _451; + float _457 = _456 * _456; + float _458 = _457 * 0.5; + float _463; + if (_448 < _449) + { + _463 = 1.0 - _458; } else { - _433 = _428; + _463 = _458; } - float _437 = precise::min(_419, _418) - ((_427 * _421) * 0.25); - float _442 = precise::max(_421 - abs(_417 - _416), 0.0) / _421; - float _443 = _442 * _442; - float _444 = _443 * 0.5; - float _449; - if (_416 < _417) + float _467 = precise::min(_449, _448) - ((_457 * _451) * 0.25); + float _472 = precise::max(_451 - abs(_447 - _446), 0.0) / _451; + float _473 = _472 * _472; + float _474 = _473 * 0.5; + float _479; + if (_446 < _447) { - _449 = 1.0 - _444; + _479 = 1.0 - _474; } else { - _449 = _444; + _479 = _474; } - float _453 = precise::min(_417, _416) - ((_443 * _421) * 0.25); - float _457; - if (_297) + float _483 = precise::min(_447, _446) - ((_473 * _451) * 0.25); + float _487; + if (_320) { - _457 = precise::max(_437, _373); + _487 = precise::max(_467, _394); } else { - _457 = _437; + _487 = _467; } - float _460 = fast::clamp(0.5 - precise::max(_457, _373), 0.0, 1.0); - if (_460 <= 0.0) + float _490 = fast::clamp(0.5 - precise::max(_487, _394), 0.0, 1.0); + if (_490 <= 0.0) { discard_fragment(); } if (in.in_var_COLOR.x < 0.5) { - _853 = float4(0.0, 0.0, 0.0, _460); + _933 = float4(0.0, 0.0, 0.0, _490); break; } - float4 _471 = mix(_415, _414, float4(_433)); - bool _477; - if (_297) + float4 _501 = mix(_445, _444, float4(_463)); + bool _507; + if (_320) { - _477 = _373 > _453; + _507 = _394 > _483; } else { - _477 = false; - } - float2 _479 = select(mix(_413, _412, float2(_449)), _374, bool2(_477)); - float _482 = precise::max(0.0, -(_477 ? _373 : _453)); - float _483 = -_482; - float _486 = exp(_483 / Uniforms.uData[1].z); - float _492 = _471.y; - float _526; - float _527; - float2 _528; - if (_117) - { - float _500 = precise::max(precise::min(Uniforms.uData[5].y * mix(_138, _411, _433), Uniforms.uData[6].w), 1.0); - float _503 = fast::clamp(1.0 - (_482 / _500), 0.0, 1.0); - float _508 = (((Uniforms.uData[5].z * _500) * _492) * _503) * _503; - _526 = _503; - _527 = _508; - _528 = fast::clamp(((in.in_var_TEXCOORD0 - (_479 * _508)) - Uniforms.uData[0].xy) * Uniforms.uData[0].zw, float2(0.0), float2(1.0)); + _507 = false; + } + float2 _509 = select(mix(_443, _442, float2(_479)), _395, bool2(_507)); + float _512 = precise::max(0.0, -(_507 ? _394 : _483)); + float _513 = -_512; + float _516 = exp(_513 / Uniforms.uData[1].z); + float _522 = _501.y; + float _556; + float _557; + float2 _558; + if (_129) + { + float _530 = precise::max(precise::min(Uniforms.uData[5].y * mix(_154, _441, _463), Uniforms.uData[6].w), 1.0); + float _533 = fast::clamp(1.0 - (_512 / _530), 0.0, 1.0); + float _538 = (((Uniforms.uData[5].z * _530) * _522) * _533) * _533; + _556 = _533; + _557 = _538; + _558 = fast::clamp(((in.in_var_TEXCOORD0 - (_509 * _538)) - Uniforms.uData[0].xy) * Uniforms.uData[0].zw, float2(0.0), float2(1.0)); } else { - _526 = 0.0; - _527 = 0.0; - _528 = fast::clamp(((in.in_var_TEXCOORD0 + (_479 * ((Uniforms.uData[2].x * _492) * _486))) - Uniforms.uData[0].xy) * Uniforms.uData[0].zw, float2(0.0), float2(1.0)); + _556 = 0.0; + _557 = 0.0; + _558 = fast::clamp(((in.in_var_TEXCOORD0 + (_509 * ((Uniforms.uData[2].x * _522) * _516))) - Uniforms.uData[0].xy) * Uniforms.uData[0].zw, float2(0.0), float2(1.0)); } - float4 _532 = Frost.sample(FrostSampler, _528, level(0.0)); - bool _534 = Uniforms.uData[4].w > 0.5; - float4 _542; - if (_534) + float4 _562 = Frost.sample(FrostSampler, _558, level(0.0)); + bool _564 = Uniforms.uData[4].w > 0.5; + float4 _572; + if (_564) { - _542 = Sharp.sample(SharpSampler, _528, level(0.0)); + _572 = Sharp.sample(SharpSampler, _558, level(0.0)); } else { - _542 = _532; + _572 = _562; } - bool _547; - if (_117) + bool _577; + if (_129) { - _547 = Uniforms.uData[6].y > 0.0; + _577 = Uniforms.uData[6].y > 0.0; } else { - _547 = false; + _577 = false; } - bool _551; - if (_547) + bool _581; + if (_577) { - _551 = _527 > 0.5; + _581 = _557 > 0.5; } else { - _551 = false; - } - float4 _612; - float4 _613; - if (_551) - { - float2 _559 = (_479 * ((_527 * 0.039999999105930328369140625) * Uniforms.uData[6].y)) * Uniforms.uData[0].zw; - float2 _561 = fast::clamp(_528 + _559, float2(0.0), float2(1.0)); - float2 _563 = fast::clamp(_528 - _559, float2(0.0), float2(1.0)); - float4 _567 = Frost.sample(FrostSampler, _561, level(0.0)); - float _572 = _532.w; - float _573 = (_567.x / precise::max(_567.w, 9.9999997473787516355514526367188e-05)) * _572; - float4 _574 = _532; - _574.x = _573; - float4 _578 = Frost.sample(FrostSampler, _563, level(0.0)); - float _583 = (_578.z / precise::max(_578.w, 9.9999997473787516355514526367188e-05)) * _572; - _574.z = _583; - float4 _611; - if (_534) + _581 = false; + } + float4 _642; + float4 _643; + if (_581) + { + float2 _589 = (_509 * ((_557 * 0.039999999105930328369140625) * Uniforms.uData[6].y)) * Uniforms.uData[0].zw; + float2 _591 = fast::clamp(_558 + _589, float2(0.0), float2(1.0)); + float2 _593 = fast::clamp(_558 - _589, float2(0.0), float2(1.0)); + float4 _597 = Frost.sample(FrostSampler, _591, level(0.0)); + float _602 = _562.w; + float _603 = (_597.x / precise::max(_597.w, 9.9999997473787516355514526367188e-05)) * _602; + float4 _604 = _562; + _604.x = _603; + float4 _608 = Frost.sample(FrostSampler, _593, level(0.0)); + float _613 = (_608.z / precise::max(_608.w, 9.9999997473787516355514526367188e-05)) * _602; + _604.z = _613; + float4 _641; + if (_564) { - float4 _591 = Sharp.sample(SharpSampler, _561, level(0.0)); - float4 _598 = _542; - _598.x = (_591.x / precise::max(_591.w, 9.9999997473787516355514526367188e-05)) * _542.w; - float4 _602 = Sharp.sample(SharpSampler, _563, level(0.0)); - _598.z = (_602.z / precise::max(_602.w, 9.9999997473787516355514526367188e-05)) * _542.w; - _611 = _598; + float4 _621 = Sharp.sample(SharpSampler, _591, level(0.0)); + float4 _628 = _572; + _628.x = (_621.x / precise::max(_621.w, 9.9999997473787516355514526367188e-05)) * _572.w; + float4 _632 = Sharp.sample(SharpSampler, _593, level(0.0)); + _628.z = (_632.z / precise::max(_632.w, 9.9999997473787516355514526367188e-05)) * _572.w; + _641 = _628; } else { - float4 _609 = _542; - _609.x = _573; - _609.z = _583; - _611 = _609; + float4 _639 = _572; + _639.x = _603; + _639.z = _613; + _641 = _639; } - _612 = _611; - _613 = _574; + _642 = _641; + _643 = _604; } else { - _612 = _542; - _613 = _532; + _642 = _572; + _643 = _562; } - bool _615 = Uniforms.uData[4].x > 1.5; - float _629; - if (_615) + bool _645 = Uniforms.uData[4].x > 1.5; + float _659; + if (_645) { - _629 = Uniforms.uData[3].w; + _659 = Uniforms.uData[3].w; } else { - float _628; + float _658; if (fmod(Uniforms.uData[6].x, 2.0) > 0.5) { - _628 = 1.0; + _658 = 1.0; } else { - _628 = _613.w; + _658 = _643.w; } - _629 = _628; + _659 = _658; } - float4 _638 = float4(_613.xyz / float3(precise::max(_613.w, 9.9999997473787516355514526367188e-05)), 1.0); - float4 _647 = float4(_612.xyz / float3(precise::max(_612.w, 9.9999997473787516355514526367188e-05)), 1.0); - float _654; - if (_615) + float4 _668 = float4(_643.xyz / float3(precise::max(_643.w, 9.9999997473787516355514526367188e-05)), 1.0); + float4 _677 = float4(_642.xyz / float3(precise::max(_642.w, 9.9999997473787516355514526367188e-05)), 1.0); + float _684; + if (_645) { - _654 = 1.0; + _684 = 1.0; } else { - _654 = (Uniforms.uData[4].z > 0.5) ? Uniforms.uData[4].x : 0.0; + _684 = (Uniforms.uData[4].z > 0.5) ? Uniforms.uData[4].x : 0.0; } - bool _658; - if (_117) + bool _688; + if (_129) { - _658 = !_615; + _688 = !_645; } else { - _658 = false; + _688 = false; } - float _667; - if (_658) + float _697; + if (_688) { - _667 = _654 * (1.0 - ((_526 * _526) * (1.0 - smoothstep(0.800000011920928955078125, 1.0, _654)))); + _697 = _684 * (1.0 - ((_556 * _556) * (1.0 - smoothstep(0.800000011920928955078125, 1.0, _684)))); } else { - _667 = _654; + _697 = _684; } - float _670 = 1.0 - _667; - float _678; - if (_117) + float _700 = 1.0 - _697; + float _708; + if (_129) { - _678 = _526; + _708 = _556; } else { - _678 = _486 * _486; + _708 = _516 * _516; } - float _681 = fast::clamp(((Uniforms.uData[2].y * _492) * _678) * _670, 0.0, 1.0); - float4 _687 = ((_647 * _681) + ((mix(_647, _638, float4(fast::clamp(_471.x, 0.0, 1.0))) * _670) * (1.0 - _681))) + (Uniforms.uData[3] * _667); - float4 _704; - if (_615) + float _711 = fast::clamp(((Uniforms.uData[2].y * _522) * _708) * _700, 0.0, 1.0); + float4 _717 = ((_677 * _711) + ((mix(_677, _668, float4(fast::clamp(_501.x, 0.0, 1.0))) * _700) * (1.0 - _711))) + (Uniforms.uData[3] * _697); + float4 _760; + if (_645) { - _704 = float4(Uniforms.uData[3].xyz / float3(precise::max(Uniforms.uData[3].w, 9.9999997473787516355514526367188e-05)), 1.0); + _760 = float4(Uniforms.uData[3].xyz / float3(precise::max(Uniforms.uData[3].w, 9.9999997473787516355514526367188e-05)), 1.0); } else { - _704 = _687 + (_638 * (1.0 - _687.w)); + float4 _733 = _717 + (_668 * (1.0 - _717.w)); + float4 _759; + if (Uniforms.uData[7].w < 1.0) + { + float3 _738 = _733.xyz; + float _739 = dot(_738, float3(0.2125999927520751953125, 0.715200006961822509765625, 0.072200000286102294921875)); + float _740 = 0.60000002384185791015625 * Uniforms.uData[7].w; + float _742 = precise::max(Uniforms.uData[7].w - _740, 9.9999997473787516355514526367188e-05); + float _754; + if (_739 <= _740) + { + _754 = _739; + } + else + { + _754 = _740 + (_742 * (1.0 - exp((-(_739 - _740)) / _742))); + } + float3 _757 = _738 * (_754 / precise::max(_739, 9.9999997473787516355514526367188e-05)); + _759 = float4(_757.x, _757.y, _757.z, _733.w); + } + else + { + _759 = _733; + } + _760 = _759; } - float _710 = dot(_479, select(float2(-0.707106769084930419921875), float2(0.707106769084930419921875, -0.707106769084930419921875), bool2(Uniforms.uData[6].x > 1.5))); - float _711 = precise::max(_710, 0.0); - float _713 = precise::max(-_710, 0.0); - float _716 = abs(_710); - bool _720; - if (_117) + float _766 = dot(_509, select(float2(-0.707106769084930419921875), float2(0.707106769084930419921875, -0.707106769084930419921875), bool2(Uniforms.uData[6].x > 1.5))); + float _767 = precise::max(_766, 0.0); + float _769 = precise::max(-_766, 0.0); + float _772 = abs(_766); + bool _776; + if (_129) { - _720 = Uniforms.uData[6].z > 0.0; + _776 = Uniforms.uData[6].z > 0.0; } else { - _720 = false; + _776 = false; } - float _739; - if (_720) + float _796; + if (_776) { - _739 = (Uniforms.uData[6].z * (1.0 - smoothstep(0.20000000298023223876953125, 0.699999988079071044921875, _716))) * exp((-precise::max(0.0, -_457)) / (Uniforms.uData[2].z * 2.5)); + _796 = (Uniforms.uData[6].z * (1.0 - smoothstep(0.20000000298023223876953125, 0.699999988079071044921875, _772))) * exp((-precise::max(0.0, -_487)) / (Uniforms.uData[2].z * 2.5)); } else { - _739 = 0.85000002384185791015625 * (1.0 - smoothstep(0.0, Uniforms.uData[2].z * 0.625, -_457)); + _796 = Uniforms.uData[10].x * (1.0 - smoothstep(0.0, Uniforms.uData[2].z * 0.625, -_487)); } - float _749; - if (_117) + float _806; + if (_129) { - _749 = precise::max((Uniforms.uData[5].w * _526) * _526, _739) * precise::min(_492, 1.0); + _806 = precise::max((Uniforms.uData[5].w * _556) * _556, _796) * precise::min(_522, 1.0); } else { - _749 = 0.0; + _806 = 0.0; } - float _752 = _629 * (1.0 - _749); - float4 _758 = float4(_704.xyz * _752, _752 + _749); - float _776; - if (_117) + float _809 = _659 * (1.0 - _806); + float4 _815 = float4(_760.xyz * _809, _809 + _806); + float _833; + if (_129) { - float _767; - if (_720) + float _824; + if (_776) { - _767 = Uniforms.uData[6].z * smoothstep(0.75, 1.0, _716); + _824 = Uniforms.uData[6].z * smoothstep(0.75, 1.0, _772); } else { - _767 = 0.25; + _824 = 0.25; } - _776 = _767; + _833 = _824; } else { - _776 = (0.449999988079071044921875 * ((_711 * sqrt(_711)) + ((0.75 * _713) * sqrt(_713)))) + 0.0599999986588954925537109375; + _833 = (0.449999988079071044921875 * ((_767 * sqrt(_767)) + ((0.75 * _769) * sqrt(_769)))) + 0.0599999986588954925537109375; } - float _803; - if (_720) + float _860; + if (_776) { - _803 = exp((-precise::max(0.0, -_457)) / (Uniforms.uData[2].z * 1.25)); + _860 = exp((-precise::max(0.0, -_487)) / (Uniforms.uData[2].z * 1.25)); } else { - float _802; - if (_117) + float _859; + if (_129) { - float _790 = -_457; - _802 = smoothstep(Uniforms.uData[2].z * 0.3125, Uniforms.uData[2].z * 0.625, _790) * (1.0 - smoothstep(Uniforms.uData[2].z * 1.5, Uniforms.uData[2].z * 2.0, _790)); + float _847 = -_487; + _859 = smoothstep(Uniforms.uData[2].z * 0.3125, Uniforms.uData[2].z * 0.625, _847) * (1.0 - smoothstep(Uniforms.uData[2].z * 1.5, Uniforms.uData[2].z * 2.0, _847)); } else { - _802 = exp((-precise::max(0.0, -_457)) / Uniforms.uData[2].z); + _859 = exp((-precise::max(0.0, -_487)) / Uniforms.uData[2].z); } - _803 = _802; + _860 = _859; } - float _810; - if (_117) + float _867; + if (_129) { - _810 = 0.0; + _867 = 0.0; } else { - _810 = (0.039999999105930328369140625 * exp(_483 / Uniforms.uData[1].w)) * _711; + _867 = (0.039999999105930328369140625 * exp(_513 / Uniforms.uData[1].w)) * _767; } - float _818; + float2 _870 = mix(_440, _439, float2(_463)); + float _874 = _870.y; + float _880 = fast::clamp((in.in_var_TEXCOORD0.y - (_870.x - _874)) / precise::max(2.0 * _874, 9.9999997473787516355514526367188e-05), 0.0, 1.0); + float _898; if (Uniforms.uData[4].z > 0.5) { - _818 = Uniforms.uData[4].y; + _898 = Uniforms.uData[4].y + ((Uniforms.uData[7].x + ((Uniforms.uData[7].y - Uniforms.uData[7].x) * _880)) + (Uniforms.uData[7].z * (1.0 - smoothstep(0.0, 0.37999999523162841796875, _880)))); } else { - _818 = 0.0; + _898 = 0.0; } - float3 _828 = _758.xyz + float3(fast::clamp((_818 + _471.z) + ((_492 * Uniforms.uData[2].w) * ((_803 * _776) + _810)), 0.0, 1.0)); - float4 _830 = fast::clamp(float4(_828.x, _828.y, _828.z, _758.w), float4(0.0), float4(1.0)); - float _837 = precise::max(_830.w, precise::max(_830.x, precise::max(_830.y, _830.z))); - float4 _838 = _830; - _838.w = _837; - float3 _849 = _838.xyz + float3(((fract(52.98291778564453125 * fract(dot(in.in_var_TEXCOORD0, float2(0.067110560834407806396484375, 0.005837149918079376220703125)))) - 0.5) * Uniforms.uData[5].x) * _837); - _853 = fast::clamp(float4(_849.x, _849.y, _849.z, _838.w), float4(0.0), float4(1.0)) * _460; + float3 _908 = _815.xyz + float3(fast::clamp((_898 + _501.z) + ((_522 * Uniforms.uData[2].w) * ((_860 * _833) + _867)), 0.0, 1.0)); + float4 _910 = fast::clamp(float4(_908.x, _908.y, _908.z, _815.w), float4(0.0), float4(1.0)); + float _917 = precise::max(_910.w, precise::max(_910.x, precise::max(_910.y, _910.z))); + float4 _918 = _910; + _918.w = _917; + float3 _929 = _918.xyz + float3(((fract(52.98291778564453125 * fract(dot(in.in_var_TEXCOORD0, float2(0.067110560834407806396484375, 0.005837149918079376220703125)))) - 0.5) * Uniforms.uData[5].x) * _917); + _933 = fast::clamp(float4(_929.x, _929.y, _929.z, _918.w), float4(0.0), float4(1.0)) * _490; break; } while(false); - out.out_var_SV_Target0 = _853; + out.out_var_SV_Target0 = _933; return out; } diff --git a/backend/src/glass/shaders/compiled/spv/liquid_glass.fragment.spv b/backend/src/glass/shaders/compiled/spv/liquid_glass.fragment.spv index 8221ca3b82bacd73c9bdbc7c122730f0616b2c14..61ab5064db3db8ac90db9e017b780cadf16b6e07 100644 GIT binary patch literal 21380 zcmZ{q2b7i7)rPNBMMSY7))|Tg5epU+DMJwp3JN0FM*&5pNU^?9H1?8c zOi$EknrSAcnQn@)Yw|zOo$tNtILrTV_d4&cXYYN^cWz-icIex+R$HT1tM#be+mVUU zv(}+5S-aMyK93teY5brC3#Sj-b+?_=_o%fQ>a}id%~~hs4$$n@S#y}`T4kM~_2AU8 z2&iLSHWfiq z6l{;fZw9t!;Wr0cue|we0Xf3EciWyk=b&Ebw*qV9dIO0n-vsGXQhb|{*J?{f=xfjQ zwU&WoC~r^o(=M`pl}!1DSodchK*i2mL&9p=982yTKL>g9QS>Ld0$x3P^icY%NLh4GCw z2gASo@U-Ev-xYpZuRR+2-QaI{ZRIfgw>#K8-TQ&;nEW1)G4#_mafX0zy0Ld7&YtjZ zb=s}L@72aXn_7p$Yok1}y(?Z>;tm7XYO5P@hQm=$BmWWbg9i_8=tsiWY9kwbOPycR zupb3KbLJZjel+}w=NApjdSl>^T=D$yoVBs=*^|t%-3Q(IZ%!H&ejNPhQ!j1A+86$+ zvCj@oefz;{qr5k_j?aMoT?6urX2?65*n|DsVBL08tb9LEen2IccYV*oc*wqP4)2}f zv!ZNEcF_AnnZ5@yyPh)ngP7NV+McaWwFwpP^P+wtvu8m426!IK+>FFaU#!g}W@Boz z89MK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)jRh z!>`X3bBnLPp>wP@=4GtLWqc*CJbC^d>^Nh$e%j_v{Q!JdO{l7vV4Jo52aNOUBQg9F zJQq^uedKr2e}VO-&ilyk)gRWpV^gz_z}ng(`?!`_kH|i$Wt!$5{S?OW+N;;U>-8DE zE$j6;{1=dQ5o_~hVdJ^`3i=w-Mx1l^4LEyk7(UJ2bC=xz4fc#_XT9~S4}F!q^3?x7 zV8=O+fBTEAaXZ#nbC%pp&hPJ~-ievF6LNX=k#z*vF!;~pF3$WurlxY)M0UW$GhLv8@I7Iuk#yQFM3<{%@XiS);8kQWGS$B)C6oJ z>s`yrduwTA<-N5GeD;z)9HUKqEDP4J&(_G6t7U#y&7NEyS^PLg8~x<|TLJ7o)h>Qk z1UtVvb2nFWH^0s}VD+ha3s{-)r{=Bjsk!=cUgytV=>s-CYwQ?f zD%Zz#ifv!8Yw2EboPLtys$li*J=b$JdRx|Wb@+aed5fJx8+qmN(;w{j;r9tXvH{4H zd*;e6onL%LV(OUm4lPQ1agtnKpcyvXQk6QByXmmgy^FN7pjr%(H$B zGHtx)9HUKin-x0e&^EfUh0d6?&F_wzgViU_eDB@@nSWax3FXXgiOl)^jaGfuZ!7Q! zWa?wPbz!SM_s=$9b?)KhIu73NMz;9e7MZr{BHIqE+<3F*ZD8f0toe9k<|f&UyIk|_ zk!$1ltoa16_Uit>HJ^x1U+zKev*vl%nuJW7M==O5wx^I|a81!E|b;u 2.5; if (e2.w > 1.5) { - float4 e0 = uData[G + 3 * (MAX_SHAPES - 1)]; float4 e1 = uData[G + 3 * (MAX_SHAPES - 1) + 1]; float2 ge; inPlace = sdRoundBox(p - e0.xy, e0.zw, min(e1, (float4)min(e0.z, e0.w)), ge); @@ -142,7 +147,7 @@ float4 main(PSInput input) : SV_Target0 float2 ge = placeOut; float d = EDGE_GAP - inPlace; float hs = h1; - if (d < d1) { d2 = d1; m2 = m1; h2 = h1; d1 = d; m1 = e2; h1 = hs; } else if (d < d2) { d2 = d; m2 = e2; h2 = hs; } + if (d < d1) { d2 = d1; m2 = m1; h2 = h1; y2 = y1; d1 = d; m1 = e2; h1 = hs; y1 = e0.yw; } else if (d < d2) { d2 = d; m2 = e2; h2 = hs; y2 = e0.yw; } float2 o = -ge; if (d < f1) { f2 = f1; o2 = o1; f1 = d; o1 = o; } else if (d < f2) { f2 = d; o2 = o; } } @@ -241,6 +246,16 @@ float4 main(PSInput input) : SV_Target0 c = float4(g3.rgb / max(g3.a, 1e-4), 1.0); } else { c += frost * (1.0 - c.a); + // The ceiling (`Look.ceiling`, 1: off): what is brighter than it is soft-clipped, from 0.6 of + // it, before any wash, so text over a bright backdrop keeps its contrast and the dark keeps + // its depth. + if (g7.w < 1.0) { + float lum = dot(c.rgb, float3(0.2126, 0.7152, 0.0722)); + float knee = 0.6 * g7.w; + float room = max(g7.w - knee, 1e-4); + float capped = lum <= knee ? lum : knee + room * (1.0 - exp(-(lum - knee) / room)); + c.rgb *= capped / max(lum, 1e-4); + } } // The way the edge faces, against a light from the top left. // From the top left, or turned a quarter to the top right (`LiquidField.light_across`, +2 on the @@ -263,7 +278,7 @@ float4 main(PSInput input) : SV_Target0 float af = abs(facing); bool diagonal = inward && dg > 0.0; float edge_dark = diagonal ? dg * (1.0 - smoothstep(0.2, 0.7, af)) * exp(-max(0.0, -D) / (2.0 * px)) - : 0.85 * (1.0 - smoothstep(0.0, 0.5 * px, -D)); + : g10.x * (1.0 - smoothstep(0.0, 0.5 * px, -D)); // As much as the edge has formed (`lens`), as its bend, clearing and light are: glass that is // barely a lens yet — a drop sunk into its place's edge — draws no dark line round itself. float shade = inward ? max(g5.w * t * t, edge_dark) * min(lens, 1.0) : 0.0; @@ -275,7 +290,12 @@ float4 main(PSInput input) : SV_Target0 : inward ? smoothstep(0.25 * px, 0.5 * px, -D) * (1.0 - smoothstep(1.2 * px, 1.6 * px, -D)) : exp(-max(0.0, -D) / g2.z); float lit = line_ * spec + (inward ? 0.0 : 0.04 * steepL * toward); - float lift = (g4.z > 0.5 ? g4.y : 0.0) + mat.z; + // Down the shape (`v`, 0 at its top): the wash falls from `wash_top` to `wash_bottom`, and the + // sweep, a specular band over the top ~38%, is strongest at the top edge. + float2 ys = lerp(y1, y2, wm); + float v = clamp((p.y - (ys.x - ys.y)) / max(2.0 * ys.y, 1e-4), 0.0, 1.0); + float wash = g7.x + (g7.y - g7.x) * v + g7.z * (1.0 - smoothstep(0.0, 0.38, v)); + float lift = (g4.z > 0.5 ? g4.y + wash : 0.0) + mat.z; // The glass's own light, added whole. Scaled with the picture, it went wherever the picture // was see-through — over the explorer, which is the window's OS glass — and the glass all but // vanished there, rim and all, where Liquid Glass keeps its bright rim over anything. diff --git a/backend/src/glass_look.zig b/backend/src/glass_look.zig index 577e017a0..acd25f3db 100644 --- a/backend/src/glass_look.zig +++ b/backend/src/glass_look.zig @@ -22,7 +22,7 @@ //! small glass. //! //! std-only: the mapping is pure, and tested here. The app publishes the in-app look each frame -//! (`LiquidField.publishLook`, macOS); fizzy's pop-out overlay reads the native one. +//! (`core.material.publishLook`, macOS); fizzy's pop-out overlay reads the native one. const std = @import("std"); /// The one frost every glass has above 0, as a share of the way from a clear lens (0) to wholly @@ -112,7 +112,7 @@ pub const frost_material: Material = .{ .variant = 2, .style = 1 }; /// it frost at `over_share` and the window's colour `fill` opaque over that — both fading out /// across each piece's clearing bevel (`band`), so the rim stays the lens; the glass `glass` there, /// and the colour flat over everything `top_fill` opaque at the top. A drop takes the window's -/// colour only at the top, as the app's glass does (`InApp.mix`): coming in sooner it was a disc of +/// colour only at the top, as the app's glass does (`Look.mix`): coming in sooner it was a disc of /// colour over the surface being dragged across, not rougher glass (the user). pub const Native = struct { under: Material, @@ -221,7 +221,7 @@ pub fn window(opacity: f32) Window { /// near the rim — `bevel` of the shape's shorter half, at most `bevel_cap` points — by up to `bend` /// times that band, which magnifies it and, past 1, folds it into a mirrored, darker band just /// inside the edge; the middle sharp and unblurred; a thin bright rim with a little colour fringe. -pub const InApp = struct { +pub const Look = struct { /// Frost over the sharp picture, 0…1: each shape's own blur is multiplied by it. frost: f32, /// The window's colour over it, 0…1 (the program's tint mix, whatever the blur): only at the @@ -230,8 +230,32 @@ pub const InApp = struct { mix: f32, /// The colour a surface carrying text takes — a dialog, a menu: the window's opacity as it is. text_mix: f32, - /// White over it, 0…1. - lift: f32, + /// White added over the face, 0…1, a vertical ramp: `wash_top` at the shape's top edge, falling + /// to `wash_bottom` at its bottom (light falls from above). Equal, a flat lift. + wash_top: f32, + wash_bottom: f32, + /// A specular band over the top ~38% of the shape, strongest at its top edge: white added, 0…1. + sweep: f32, + /// A luminance cap, 0…1, on what the glass shows before the wash: brighter than this is soft-clipped + /// so text over a bright backdrop stays readable. 1 is off. + ceiling: f32, + /// How dark the window's hairline edge is, 0…1 (`diagonal` 0). + edge_dark: f32, + /// The lit edge, computed in the shader from the edge's normal (`rim_line` 0 is off, and the + /// edge is the one above). The light's direction in degrees from the left, turning toward the + /// top (`lightDir`), and how high it stands off the surface… + light_angle: f32, + light_height: f32, + /// …the line along the lit side, its width in points, and the least of it on the unlit side… + rim_line: f32, + rim_width: f32, + rim_floor: f32, + /// …the glow inside it and how far in it reaches, in points, the shade on the sides square to + /// the light, and the catch on the far side. + rim_glow: f32, + glow_width: f32, + rim_shade: f32, + rim_back: f32, /// The bending band's width: a share of the shape's shorter half… bevel: f32, /// …and at most this many points. @@ -253,13 +277,28 @@ pub const InApp = struct { dispersion: f32, }; -pub fn inApp(opacity: f32) InApp { +pub fn inApp(opacity: f32) Look { const w = way(opacity); return .{ .frost = w.frost, .mix = w.top, .text_mix = w.tint, - .lift = 0.03 * w.shine, + .wash_top = 0.03 * w.shine, + .wash_bottom = 0.03 * w.shine, + // The identity of every curve fizzy does not use: no sweep, no cap, and the window's hairline + // as dark as it always was; the lit edge off. + .sweep = 0, + .ceiling = 1, + .edge_dark = 0.85, + .light_angle = 45, + .light_height = 0, + .rim_line = 0, + .rim_width = 0, + .rim_floor = 0, + .rim_glow = 0, + .glow_width = 0, + .rim_shade = 0, + .rim_back = 0, .bevel = bevel, .bevel_cap = bevel_cap, // The lens whole at its edge whatever the frost, as Liquid Glass's is (and the OS's drops, @@ -282,7 +321,7 @@ pub fn inApp(opacity: f32) InApp { /// `look` for a drop — a drop zone's bubble, the carried view: frosted at least as much as the OS's /// glass keeps with no frost of the window's (`native`, `drop_frost_min`), on the same way up. -pub fn forDrops(look: InApp) InApp { +pub fn forDrops(look: Look) Look { var l = look; l.frost = std.math.lerp(drop_frost_min / drop_frost, 1, l.frost); return l; @@ -292,7 +331,7 @@ pub fn forDrops(look: InApp) InApp { /// (`text_mix`), over the whole frost, as a window of the OS's glass has (`window`: its glass frost /// whole, its blur nearly so). At the frost level the sharp picture kept a tenth of the body, and /// the code behind a dialog read through it, where the OS's window beside it showed none. -pub fn forText(look: InApp) InApp { +pub fn forText(look: Look) Look { var l = look; l.mix = l.text_mix; if (l.frost > 0) l.frost = 1; @@ -320,15 +359,57 @@ pub const text_blur: f32 = 24; /// — a colour picked through it is the colour under it. Only the band along its edge is glass, /// bending the picture toward its rim and lit there, and that follows the opacity as every glass /// does, its shine going at the top. -pub fn forLens(look: InApp) InApp { +pub fn forLens(look: Look) Look { var l = look; l.frost = 0; l.mix = 0; l.text_mix = 0; - l.lift = 0; + l.wash_top = 0; + l.wash_bottom = 0; return l; } +/// The light's direction on screen (y down) for `l.light_angle`: degrees from the left turning +/// toward the top, so 45 is the top left every glass has always been lit from. +pub fn lightDir(l: Look) [2]f32 { + const a = std.math.degreesToRadians(l.light_angle); + return .{ -@cos(a), -@sin(a) }; +} + +/// What a glass is for, which picks its look (`Looks`): a drop's bubble or the carried view, a +/// surface carrying text, a card, a bar, a lens over a picture of the caller's own. +pub const Role = enum { drop, text, card, bar, lens }; + +/// One `Look` per role, published once a frame before anything draws (`core.material.publishLook`) +/// and read by every glass program (`LiquidField`). An app sets its own numbers per role; fizzy's +/// are today's (`fromOpacity`). +pub const Looks = struct { + drop: Look, + text: Look, + card: Look, + bar: Look, + lens: Look, + + /// fizzy's: `forDrops`, `forText` and `forLens` of the app's glass at the window's opacity; + /// cards and bars are a drop's until an app says otherwise. + pub fn fromOpacity(opacity: f32) Looks { + const base_look = inApp(opacity); + const drop = forDrops(base_look); + return .{ .drop = drop, .text = forText(base_look), .card = drop, .bar = drop, .lens = forLens(base_look) }; + } + + pub fn get(self: *const Looks, role: Role) Look { + return switch (role) { + inline else => |r| @field(self, @tagName(r)), + }; + } +}; + +/// Where the published `Looks` live in dvui's data (`core.material.publishLook`, read by +/// `LiquidField`), the one id both name. +pub const data_id_backing: u64 = 0x6c69_7166; +pub const data_key = "_liquid_look"; + // ── The app's frosted pane ────────────────────────────────────────────────────────────────────── /// The app's own glass where there is no OS glass to match (the web, Linux, Windows): what is behind @@ -472,7 +553,7 @@ test "a lens over a picture leaves its middle as it is, at every opacity" { const l = forLens(inApp(t)); try std.testing.expectEqual(@as(f32, 0), l.frost); try std.testing.expectEqual(@as(f32, 0), l.mix); - try std.testing.expectEqual(@as(f32, 0), l.lift); + try std.testing.expectEqual(@as(f32, 0), l.wash_top); // Its edge is the glass all the same. try std.testing.expectEqual(inApp(t).bend, l.bend); try std.testing.expectEqual(inApp(t).rim, l.rim); @@ -522,3 +603,32 @@ test "both forms share the way" { try std.testing.expectEqual(native(o).fill, inApp(o).mix); } } + +test "the light's angle packs to a direction toward the top left" { + var l = inApp(1); + l.light_angle = 51.7; + const d = lightDir(l); + try std.testing.expectApproxEqAbs(@as(f32, -0.62), d[0], 0.005); + try std.testing.expectApproxEqAbs(@as(f32, -0.78), d[1], 0.005); + l.light_angle = 45; + try std.testing.expectApproxEqAbs(@as(f32, -0.70710678), lightDir(l)[0], 1e-6); + try std.testing.expectApproxEqAbs(@as(f32, -0.70710678), lightDir(l)[1], 1e-6); +} + +test "fizzy's looks keep every new curve at its identity" { + var i: usize = 0; + while (i <= 20) : (i += 1) { + const looks = Looks.fromOpacity(at(i, 20)); + inline for (comptime std.enums.values(Role)) |r| { + const l = looks.get(r); + try std.testing.expectEqual(@as(f32, 0), l.sweep); + try std.testing.expectEqual(@as(f32, 1), l.ceiling); + try std.testing.expectEqual(@as(f32, 0.85), l.edge_dark); + try std.testing.expectEqual(@as(f32, 0), l.rim_line); + try std.testing.expectEqual(l.wash_top, l.wash_bottom); + } + // Cards and bars are a drop's until an app says otherwise. + try std.testing.expectEqual(looks.drop, looks.card); + try std.testing.expectEqual(looks.drop, looks.bar); + } +} diff --git a/core/material.zig b/core/material.zig index def41fe3f..6de85105d 100644 --- a/core/material.zig +++ b/core/material.zig @@ -14,7 +14,11 @@ //! opaque window, never to a clear one (`Material.effective`). What was asked stays as it was //! saved. //! -//! All but the four publish and read functions is std-only (a unit-test root in `build/app.zig`). +//! The third thing published is the glass's look: one `Look` per `Role` (`Looks`), the numbers every +//! glass the app draws is drawn with (`publishLook`), set once in `Editor.tick` before plugins' +//! `beginFrame` and read by `LiquidField`. +//! +//! All but the publish and read functions is std-only (a unit-test root in `build/app.zig`). const std = @import("std"); pub const Material = struct { @@ -74,6 +78,15 @@ pub fn inAppKinds(glass_program: bool) Kinds { return kinds; } +/// The numbers a glass is drawn with, one set per role (`glass_look.Look`)… +pub const Look = @import("glass_look").Look; +pub const Role = @import("glass_look").Role; +/// …the five sets (`Looks.fromOpacity` is fizzy's)… +pub const Looks = @import("glass_look").Looks; + +/// …published for this frame: null for the earlier glass, as each field's own numbers say. +pub const publishLook = @import("glass").LiquidField.publishLook; + const key = "core.material"; /// The window material this frame, as the backend can show it, set by the app before anything diff --git a/src/editor/Editor.zig b/src/editor/Editor.zig index 5e1e0e63e..c674ceafa 100644 --- a/src/editor/Editor.zig +++ b/src/editor/Editor.zig @@ -4429,9 +4429,9 @@ pub fn tick(editor: *Editor) !dvui.App.Result { .chrome = .{ chrome.r, chrome.g, chrome.b, chrome.a }, .has_chrome = true, }); - // The lens's bend fades with its own frost (`InApp.bend`): the whole of it here. + // The lens's bend fades with its own frost (`Look.bend`): the whole of it here. fizzy.core.dialogs.publishRefraction(if (lens) 1 else if (liquid) pane.refraction else 0); - fizzy.core.LiquidField.publishLook(if (lens) glass_look.inApp(opacity) else null); + fizzy.core.material.publishLook(if (lens) glass_look.Looks.fromOpacity(opacity) else null); fizzy.core.corners.publish(editor.app.settings.corner_roundness); } // How things move this frame, for every animation here and in every plugin (`core.motion`). diff --git a/tests/integration.zig b/tests/integration.zig index 736ce01c8..f52dd4744 100644 --- a/tests/integration.zig +++ b/tests/integration.zig @@ -6089,11 +6089,85 @@ test "liquid field: groups are the shapes that touch, each drawn as its own quad try std.testing.expectEqual(@as(u8, 2), g.size[0]); try std.testing.expectEqual(@as(u8, 1), g.size[1]); // The uniforms are the shader's `uData`: its header, then three vec4s a shape. - try std.testing.expectEqual(@as(usize, (7 + 3 * LF.max_shapes) * 16), @sizeOf(LF.Uniforms)); + try std.testing.expectEqual(@as(usize, (11 + 3 * LF.max_shapes) * 16), @sizeOf(LF.Uniforms)); const u = f.pack(.{ .x = 0, .y = 0, .w = 400, .h = 100 }, false, g.order[0..f.len]); try std.testing.expectEqual(@as(f32, 22), u.shapes[1][0][0]); } +test "liquid field: fizzy's default look packs to today's uniforms for every role" { + const LF = fizzy.core.LiquidField; + const gl = fizzy.core.glass_look; + var i: usize = 0; + while (i <= 10) : (i += 1) { + const opacity: f32 = @as(f32, @floatFromInt(i)) / 10; + const looks = fizzy.core.material.Looks.fromOpacity(opacity); + // Today's looks, as `forDrops`, `forText` and `forLens` made them of `inApp`. + const base = gl.inApp(opacity); + const today = [_]struct { role: gl.Role, look: gl.Look }{ + .{ .role = .drop, .look = gl.forDrops(base) }, + .{ .role = .card, .look = gl.forDrops(base) }, + .{ .role = .bar, .look = gl.forDrops(base) }, + .{ .role = .text, .look = gl.forText(base) }, + .{ .role = .lens, .look = gl.forLens(base) }, + }; + for (today) |t| { + var f: LF = .{ .tint = .{ .r = 10, .g = 20, .b = 30, .a = 200 }, .mix = 0.5, .lift = 0.2, .role = t.role }; + f.add(LF.Shape.circle(.{ .x = 50, .y = 50 }, 40)); + const order = [_]u8{0}; + var u = f.pack(.{ .x = 0, .y = 0, .w = 100, .h = 100 }, false, &order); + f.applyLook(&u, looks.get(t.role)); + const l = t.look; + try std.testing.expectEqual(std.math.clamp(l.mix, 0, 1), u.face[0]); + // The flat lift of before is the wash, equal top and bottom, and nothing else. + try std.testing.expectEqual(std.math.clamp(l.wash_top, 0, 1), u.face[1] + u.curves[0]); + try std.testing.expectEqual(u.curves[0], u.curves[1]); + // The new curves are the identity: no sweep, no cap, the hairline as dark as it was. + try std.testing.expectEqual(@as(f32, 0), u.curves[2]); + try std.testing.expectEqual(@as(f32, 1), u.curves[3]); + try std.testing.expectEqual(@as(f32, 0.85), u.widths[0]); + try std.testing.expectEqual(@as(f32, 0), u.edge[0]); + try std.testing.expectEqual(@as(f32, 0.70710678), -u.light[0]); + try std.testing.expectEqual(@max(l.bevel, 0.0001), u.dither[1]); + try std.testing.expectEqual(l.bend * 0.5, u.dither[2]); + try std.testing.expectEqual(l.shade, u.dither[3]); + try std.testing.expectEqual(l.dispersion, u.backdrop[1]); + try std.testing.expectEqual(l.diagonal, u.backdrop[2]); + try std.testing.expectEqual(l.rim, u.rim[3]); + try std.testing.expectEqual(l.frost * f.shapes[0].blur, u.shapes[0][2][0]); + } + } +} + +test "liquid field: an app look's curves reach the uniforms, a surface keeps its own lift" { + const LF = fizzy.core.LiquidField; + var look = fizzy.core.material.Looks.fromOpacity(0.6).card; + look.sweep = 0.11; + look.ceiling = 0.6; + look.wash_top = 0.107; + look.wash_bottom = 0.04; + look.edge_dark = 0.3; + look.light_angle = 51.7; + look.rim_line = 0.5; + var f: LF = .{ .tint = .{ .r = 0, .g = 0, .b = 0, .a = 255 }, .lift = 0.2, .role = .card }; + f.add(LF.Shape.circle(.{ .x = 50, .y = 50 }, 40)); + const order = [_]u8{0}; + var u = f.pack(.{ .x = 0, .y = 0, .w = 100, .h = 100 }, false, &order); + f.applyLook(&u, look); + try std.testing.expectEqual([4]f32{ 0.107, 0.04, 0.11, 0.6 }, u.curves); + try std.testing.expectEqual(@as(f32, 0.3), u.widths[0]); + try std.testing.expectEqual(@as(f32, 0.5), u.edge[0]); + try std.testing.expectApproxEqAbs(@as(f32, -0.62), u.light[0], 0.005); + try std.testing.expectApproxEqAbs(@as(f32, -0.78), u.light[1], 0.005); + // A surface's colour is its own: its lift stays, and the look's wash does not reach it. + var surface = f; + surface.surface = true; + var us = surface.pack(.{ .x = 0, .y = 0, .w = 100, .h = 100 }, false, &order); + surface.applyLook(&us, look); + try std.testing.expectEqual(@as(f32, 0.2), us.face[1]); + try std.testing.expectEqual(@as(f32, 0), us.curves[0]); + try std.testing.expectEqual(@as(f32, 0.11), us.curves[2]); +} + test "liquid field: a lens's picture reaches as far past its shapes as the earlier glass's rim pulls from" { const LF = fizzy.core.LiquidField; var f: LF = .{ .scale = 2, .refraction = 1 }; From 7d0b7efddb1af3b65dd4436ebadc886da9928adc Mon Sep 17 00:00:00 2001 From: "fizzy-linux[bot]" <346940526+fizzy-linux[bot]@users.noreply.github.com> Date: Tue, 27 Oct 2026 14:51:38 -0500 Subject: [PATCH 2/2] core: glass-look (codex) Agent-Team: linux Worker: codex --- backend/src/SDLBackend.zig | 2 +- backend/src/glass/LiquidField.zig | 17 ++---- .../compiled/dxil/liquid_glass.fragment.dxil | Bin 10896 -> 10892 bytes .../compiled/glsl/liquid_glass.fragment.glsl | 28 ++++----- .../compiled/msl/liquid_glass.fragment.msl | 28 ++++----- .../compiled/spv/liquid_glass.fragment.spv | Bin 21380 -> 21380 bytes .../glass/shaders/liquid_glass.fragment.hlsl | 7 +-- backend/src/glass_look.zig | 53 ++---------------- tests/integration.zig | 18 +++--- 9 files changed, 50 insertions(+), 103 deletions(-) diff --git a/backend/src/SDLBackend.zig b/backend/src/SDLBackend.zig index e92dfb993..8429cf5d3 100644 --- a/backend/src/SDLBackend.zig +++ b/backend/src/SDLBackend.zig @@ -1365,7 +1365,7 @@ pub fn floatingWindowBackground(self: *SDLBackend, id: dvui.Id, rect: dvui.Rect. glass.programs.publishHost(); glass.LiquidField.publishEnabled(liquid); const lens = builtin.target.os.tag == .macos and liquid and glass.LiquidField.ready(); - glass.LiquidField.publishLook(if (lens) glass_look.Looks.fromOpacity(opacity) else null); + if (lens) glass.LiquidField.publishLook(glass_look.Looks.fromOpacity(opacity)); const s = dvui.windowNaturalScale(); glass.BlurBackdrop.frostPane(id, rect, corners.scale(1 / s, dvui.CornerRect), s, .{ .radius = if (lens) glass_look.text_blur else if (m.kind == .blur) pane.blur / 2 else pane.blur, diff --git a/backend/src/glass/LiquidField.zig b/backend/src/glass/LiquidField.zig index 5ba19447f..b6c4c13a3 100644 --- a/backend/src/glass/LiquidField.zig +++ b/backend/src/glass/LiquidField.zig @@ -37,7 +37,7 @@ const LiquidField = @This(); pub const max_shapes = 16; /// Uniform vec4s before the shapes (`Uniforms`), and per shape. -const header_vec4s = 11; +const header_vec4s = 9; const shape_vec4s = 3; /// A piece of glass. Physical pixels, window coordinates. @@ -223,13 +223,7 @@ pub const Uniforms = extern struct { /// The look's brightness curves (`applyLook`): the wash at the shape's top and at its bottom, /// the sweep, the luminance ceiling. Identity: no wash, no sweep, a ceiling of 1. curves: [4]f32 = .{ 0, 0, 0, 1 }, - /// The lit edge's light: its direction (`glass_look.lightDir`), how high it stands, the catch on - /// the far side. - light: [4]f32 = .{ -0.70710678, -0.70710678, 0, 0 }, - /// The lit edge's line, glow, shade and floor. - edge: [4]f32 = @splat(0), - /// How dark the window's hairline edge is, then the lit edge's line and glow widths in physical - /// pixels. + /// How dark the window's hairline edge is; remaining lanes reserved. widths: [4]f32 = .{ 0.85, 0, 0, 0 }, shapes: [max_shapes][shape_vec4s][4]f32, @@ -388,13 +382,10 @@ pub fn applyLook(self: *const LiquidField, u: *Uniforms, l: glass_look.Look) voi u.face[1] = 0; u.curves[0] = std.math.clamp(l.wash_top, 0, 1); u.curves[1] = std.math.clamp(l.wash_bottom, 0, 1); + u.curves[2] = std.math.clamp(l.sweep, 0, 1); } - u.curves[2] = std.math.clamp(l.sweep, 0, 1); u.curves[3] = std.math.clamp(l.ceiling, 0, 1); - const dir = glass_look.lightDir(l); - u.light = .{ dir[0], dir[1], l.light_height, l.rim_back }; - u.edge = .{ l.rim_line, l.rim_glow, l.rim_shade, l.rim_floor }; - u.widths = .{ l.edge_dark, l.rim_width * self.scale, l.glow_width * self.scale, 0 }; + u.widths = .{ l.edge_dark, 0, 0, 0 }; for (u.shapes[0..self.len]) |*sh| sh[2][0] *= l.frost; if (self.edge != null) u.shapes[max_shapes - 1][2][0] *= l.frost; } diff --git a/backend/src/glass/shaders/compiled/dxil/liquid_glass.fragment.dxil b/backend/src/glass/shaders/compiled/dxil/liquid_glass.fragment.dxil index 2d4ed471f0bd676699fb62f9718e0ad034c4279d..75994a65a2aac4e88316b735f73c39c9f787ccaf 100644 GIT binary patch delta 2992 zcmY*bYgAKL7QQzLNgx3d!y^GgUL=4#ghC^zg(P5XK^{SiDAryC1uHTLR2_{2iIjmg zM1n^~#23EnvRY^mMbUC&6m@tiI#96%MP?kaQnd;$t8-&cR+ss4bMF1l+54Pte|zs^ z{Ji>eUVMfs?rW!aMU_idcpf+quzxJWw;M$eq`H~sKtab%0!lWDDoooP9#Q5z%{kCd zP8`;_bPfL0@``*qKI5~6bRmLZ#C#GRL9Fixv6w}?PYMu371!~zh>0N6G>|}QFew;w zP;?v!D1N2`%s8vn2hKP-A&QD19LhNsgMuI_#L6QB9dyK9no5m#i?5}+EpKz1zjSBj zb+=EO-4&z`?GVOj zRX9Nd56%1*bI7nN&}Kjv?y|wiI5+831PxH5hjpQ2`oJ#SW`O&!jCQ_}5!0-o*(_l7 zalRAg&_)#>T3GM0xr5OzWNg69QUSwfYPrJ5ZqNo-jufLx36)0dx@k9P=5S~|IJ3fg z$LHW*oTHqrESLN@Z3$}LJKa?dxeKt zKlle10zday*2;g>erlxfY#%#A(m}DiT=tA4{dNsBaxt|E@qvzp7_d+DjD08pgPvm2;vDeC za}85Y(vMakp?%mnWgl42JtT_?XWwnA?Jvi;+vx*wQx%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ixh^e0Iw1WwL8F0XU}H;?{Q zx)B1CGxOz*F2D|$i?wl`X&vqFz1S+#v%Clrk+Cmp-utrsK}WhXlPaIXUs||-f$w%W J?)T4s{|C~AU;_XE diff --git a/backend/src/glass/shaders/compiled/glsl/liquid_glass.fragment.glsl b/backend/src/glass/shaders/compiled/glsl/liquid_glass.fragment.glsl index ce7902666..c5ac8fa84 100644 --- a/backend/src/glass/shaders/compiled/glsl/liquid_glass.fragment.glsl +++ b/backend/src/glass/shaders/compiled/glsl/liquid_glass.fragment.glsl @@ -2,7 +2,7 @@ precision highp float; precision highp int; -uniform highp vec4 uData[59]; +uniform highp vec4 uData[57]; uniform highp sampler2D uSampler; uniform highp sampler2D uTex1; @@ -69,11 +69,11 @@ void main() if (_165) { int _167 = 3 * _156; - int _168 = 11 + _167; - int _174 = _167 + 13; + int _168 = 9 + _167; + int _174 = _167 + 11; highp vec2 _178 = vTextureCoord - uData[_168 * 1 + 0].xy; highp float _182 = min(uData[_168 * 1 + 0].z, uData[_168 * 1 + 0].w); - highp vec4 _184 = min(uData[(_167 + 12) * 1 + 0], vec4(_182)); + highp vec4 _184 = min(uData[(_167 + 10) * 1 + 0], vec4(_182)); highp float _185 = _178.x; highp float _206; if (_185 > 0.0) @@ -225,14 +225,14 @@ void main() break; } } - bool _320 = uData[58].w > 2.5; - bool _321 = uData[58].w > 1.5; + bool _320 = uData[56].w > 2.5; + bool _321 = uData[56].w > 1.5; highp float _394; highp vec2 _395; if (_321) { - highp vec2 _327 = vTextureCoord - uData[56].xy; - highp vec4 _333 = min(uData[57], vec4(min(uData[56].z, uData[56].w))); + highp vec2 _327 = vTextureCoord - uData[54].xy; + highp vec4 _333 = min(uData[55], vec4(min(uData[54].z, uData[54].w))); highp float _334 = _327.x; highp float _355; if (_334 > 0.0) @@ -261,7 +261,7 @@ void main() } _355 = _354; } - highp vec2 _359 = (abs(_327) - uData[56].zw) + vec2(_355); + highp vec2 _359 = (abs(_327) - uData[54].zw) + vec2(_355); highp float _361 = (_334 < 0.0) ? (-1.0) : 1.0; highp float _364 = (_327.y < 0.0) ? (-1.0) : 1.0; highp float _366 = _359.x; @@ -332,7 +332,7 @@ void main() if (_403) { _417 = _146; - _418 = uData[56].yw; + _418 = uData[54].yw; _419 = _154; _420 = _148; _421 = _152; @@ -343,7 +343,7 @@ void main() highp vec2 _412; if (_408) { - _412 = uData[56].yw; + _412 = uData[54].yw; } else { @@ -353,7 +353,7 @@ void main() _417 = _412; _418 = _146; _419 = _408 ? _154 : _134; - _420 = vec4(_414.x ? uData[58].x : _138.x, _414.y ? uData[58].y : _138.y, _414.z ? uData[58].z : _138.z, _414.w ? uData[58].w : _138.w); + _420 = vec4(_414.x ? uData[56].x : _138.x, _414.y ? uData[56].y : _138.y, _414.z ? uData[56].z : _138.z, _414.w ? uData[56].w : _138.w); _421 = _408 ? _402 : _150; } bvec4 _422 = bvec4(_403); @@ -380,7 +380,7 @@ void main() _442 = _434; _443 = vec2(_436.x ? _425.x : _140.x, _436.y ? _425.y : _140.y); _444 = _420; - _445 = vec4(_422.x ? uData[58].x : _148.x, _422.y ? uData[58].y : _148.y, _422.z ? uData[58].z : _148.z, _422.w ? uData[58].w : _148.w); + _445 = vec4(_422.x ? uData[56].x : _148.x, _422.y ? uData[56].y : _148.y, _422.z ? uData[56].z : _148.z, _422.w ? uData[56].w : _148.w); _446 = _435; _447 = _426 ? _402 : _144; _448 = _421; @@ -664,7 +664,7 @@ void main() } else { - _796 = uData[10].x * (1.0 - smoothstep(0.0, uData[2].z * 0.625, -_487)); + _796 = uData[8].x * (1.0 - smoothstep(0.0, uData[2].z * 0.625, -_487)); } highp float _806; if (_129) diff --git a/backend/src/glass/shaders/compiled/msl/liquid_glass.fragment.msl b/backend/src/glass/shaders/compiled/msl/liquid_glass.fragment.msl index b391cfe08..2b74e2346 100644 --- a/backend/src/glass/shaders/compiled/msl/liquid_glass.fragment.msl +++ b/backend/src/glass/shaders/compiled/msl/liquid_glass.fragment.msl @@ -5,7 +5,7 @@ using namespace metal; struct type_Uniforms { - float4 uData[59]; + float4 uData[57]; }; struct main0_out @@ -79,11 +79,11 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Uniforms& Unifo if (_165) { int _167 = 3 * _156; - int _168 = 11 + _167; - int _174 = _167 + 13; + int _168 = 9 + _167; + int _174 = _167 + 11; float2 _178 = in.in_var_TEXCOORD0 - Uniforms.uData[_168].xy; float _182 = precise::min(Uniforms.uData[_168].z, Uniforms.uData[_168].w); - float4 _184 = precise::min(Uniforms.uData[_167 + 12], float4(_182)); + float4 _184 = precise::min(Uniforms.uData[_167 + 10], float4(_182)); float _185 = _178.x; float _206; if (_185 > 0.0) @@ -231,14 +231,14 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Uniforms& Unifo break; } } - bool _320 = Uniforms.uData[58].w > 2.5; - bool _321 = Uniforms.uData[58].w > 1.5; + bool _320 = Uniforms.uData[56].w > 2.5; + bool _321 = Uniforms.uData[56].w > 1.5; float _394; float2 _395; if (_321) { - float2 _327 = in.in_var_TEXCOORD0 - Uniforms.uData[56].xy; - float4 _333 = precise::min(Uniforms.uData[57], float4(precise::min(Uniforms.uData[56].z, Uniforms.uData[56].w))); + float2 _327 = in.in_var_TEXCOORD0 - Uniforms.uData[54].xy; + float4 _333 = precise::min(Uniforms.uData[55], float4(precise::min(Uniforms.uData[54].z, Uniforms.uData[54].w))); float _334 = _327.x; float _355; if (_334 > 0.0) @@ -267,7 +267,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Uniforms& Unifo } _355 = _354; } - float2 _359 = (abs(_327) - Uniforms.uData[56].zw) + float2(_355); + float2 _359 = (abs(_327) - Uniforms.uData[54].zw) + float2(_355); float _361 = (_334 < 0.0) ? (-1.0) : 1.0; float _364 = (_327.y < 0.0) ? (-1.0) : 1.0; float _366 = _359.x; @@ -338,7 +338,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Uniforms& Unifo if (_403) { _417 = _146; - _418 = Uniforms.uData[56].yw; + _418 = Uniforms.uData[54].yw; _419 = _154; _420 = _148; _421 = _152; @@ -349,7 +349,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Uniforms& Unifo float2 _412; if (_408) { - _412 = Uniforms.uData[56].yw; + _412 = Uniforms.uData[54].yw; } else { @@ -358,7 +358,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Uniforms& Unifo _417 = _412; _418 = _146; _419 = _408 ? _154 : _134; - _420 = select(_138, Uniforms.uData[58], bool4(_408)); + _420 = select(_138, Uniforms.uData[56], bool4(_408)); _421 = _408 ? _402 : _150; } float2 _425 = -_395; @@ -382,7 +382,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Uniforms& Unifo _442 = _434; _443 = select(_140, _425, bool2(_426)); _444 = _420; - _445 = select(_148, Uniforms.uData[58], bool4(_403)); + _445 = select(_148, Uniforms.uData[56], bool4(_403)); _446 = _435; _447 = _426 ? _402 : _144; _448 = _421; @@ -663,7 +663,7 @@ fragment main0_out main0(main0_in in [[stage_in]], constant type_Uniforms& Unifo } else { - _796 = Uniforms.uData[10].x * (1.0 - smoothstep(0.0, Uniforms.uData[2].z * 0.625, -_487)); + _796 = Uniforms.uData[8].x * (1.0 - smoothstep(0.0, Uniforms.uData[2].z * 0.625, -_487)); } float _806; if (_129) diff --git a/backend/src/glass/shaders/compiled/spv/liquid_glass.fragment.spv b/backend/src/glass/shaders/compiled/spv/liquid_glass.fragment.spv index 61ab5064db3db8ac90db9e017b780cadf16b6e07..fdbfbc3c4ca1a6f71aa6181eac25d0a47f6e77d0 100644 GIT binary patch delta 90 zcmZo!&e*b?aYGI>Bgf=i=Ie}{n_XG@nHViMUuDx~R5W8?V9;h@VGsb)VL)tw#199u W%_l2z*b8zYiN*lg+?xwIguMYULJl1O delta 90 zcmZo!&e*b?aYGI>BiH0y=Ie~yn_XG@nHa4%UuDx~RJ34VV9;h@VGsb)VL)t!#199u WEhj5-*bDL?iN*lgyqgO-guMYXJPs`Y diff --git a/backend/src/glass/shaders/liquid_glass.fragment.hlsl b/backend/src/glass/shaders/liquid_glass.fragment.hlsl index f0f0e4e36..6f800140e 100644 --- a/backend/src/glass/shaders/liquid_glass.fragment.hlsl +++ b/backend/src/glass/shaders/liquid_glass.fragment.hlsl @@ -15,7 +15,7 @@ // sharp picture at 1, the uniforms as one array. On the web the same, by the names // `core.gfx.programs` gives them (the generator renames them). -#define G 11 +#define G 9 #define MAX_SHAPES 16 // How far past its place's outline the outside of the place begins, in pixels: far enough that no // sliver of it shows inside, near enough that a shape at the outline still runs into it. @@ -96,8 +96,7 @@ float4 main(PSInput input) : SV_Target0 float4 g4 = uData[4]; float4 g5 = uData[5]; // dither; the lens: its band's share of the shape, its bend, its shade float4 g7 = uData[7]; // the look's curves (`glass_look.Look`): the wash at the shape's top and at its bottom, the sweep, the luminance ceiling (1: off) - // uData[8] and [9], the lit edge's light and line (`Look.light_angle`, `rim_line`), are the next step's - float4 g10 = uData[10]; // how dark the window's hairline edge is + float4 g8 = uData[8]; // how dark the window's hairline edge is float4 g6 = uData[6]; // opaque window (+1) and the light turned to the top right (+2); the lens: dispersion, a drop's diagonal light (0: a window's hairline), the band's cap // Apple's lens (`glass_look.inApp`): the picture pulled inward from a band near the rim, // magnified and, past a bend of 1, folded there. Off, the earlier glass: pulled from outside. @@ -278,7 +277,7 @@ float4 main(PSInput input) : SV_Target0 float af = abs(facing); bool diagonal = inward && dg > 0.0; float edge_dark = diagonal ? dg * (1.0 - smoothstep(0.2, 0.7, af)) * exp(-max(0.0, -D) / (2.0 * px)) - : g10.x * (1.0 - smoothstep(0.0, 0.5 * px, -D)); + : g8.x * (1.0 - smoothstep(0.0, 0.5 * px, -D)); // As much as the edge has formed (`lens`), as its bend, clearing and light are: glass that is // barely a lens yet — a drop sunk into its place's edge — draws no dark line round itself. float shade = inward ? max(g5.w * t * t, edge_dark) * min(lens, 1.0) : 0.0; diff --git a/backend/src/glass_look.zig b/backend/src/glass_look.zig index acd25f3db..3d5eb8cb8 100644 --- a/backend/src/glass_look.zig +++ b/backend/src/glass_look.zig @@ -235,27 +235,12 @@ pub const Look = struct { wash_top: f32, wash_bottom: f32, /// A specular band over the top ~38% of the shape, strongest at its top edge: white added, 0…1. - sweep: f32, + sweep: f32 = 0, /// A luminance cap, 0…1, on what the glass shows before the wash: brighter than this is soft-clipped /// so text over a bright backdrop stays readable. 1 is off. - ceiling: f32, + ceiling: f32 = 1, /// How dark the window's hairline edge is, 0…1 (`diagonal` 0). - edge_dark: f32, - /// The lit edge, computed in the shader from the edge's normal (`rim_line` 0 is off, and the - /// edge is the one above). The light's direction in degrees from the left, turning toward the - /// top (`lightDir`), and how high it stands off the surface… - light_angle: f32, - light_height: f32, - /// …the line along the lit side, its width in points, and the least of it on the unlit side… - rim_line: f32, - rim_width: f32, - rim_floor: f32, - /// …the glow inside it and how far in it reaches, in points, the shade on the sides square to - /// the light, and the catch on the far side. - rim_glow: f32, - glow_width: f32, - rim_shade: f32, - rim_back: f32, + edge_dark: f32 = 0.85, /// The bending band's width: a share of the shape's shorter half… bevel: f32, /// …and at most this many points. @@ -290,15 +275,6 @@ pub fn inApp(opacity: f32) Look { .sweep = 0, .ceiling = 1, .edge_dark = 0.85, - .light_angle = 45, - .light_height = 0, - .rim_line = 0, - .rim_width = 0, - .rim_floor = 0, - .rim_glow = 0, - .glow_width = 0, - .rim_shade = 0, - .rim_back = 0, .bevel = bevel, .bevel_cap = bevel_cap, // The lens whole at its edge whatever the frost, as Liquid Glass's is (and the OS's drops, @@ -369,13 +345,6 @@ pub fn forLens(look: Look) Look { return l; } -/// The light's direction on screen (y down) for `l.light_angle`: degrees from the left turning -/// toward the top, so 45 is the top left every glass has always been lit from. -pub fn lightDir(l: Look) [2]f32 { - const a = std.math.degreesToRadians(l.light_angle); - return .{ -@cos(a), -@sin(a) }; -} - /// What a glass is for, which picks its look (`Looks`): a drop's bubble or the carried view, a /// surface carrying text, a card, a bar, a lens over a picture of the caller's own. pub const Role = enum { drop, text, card, bar, lens }; @@ -405,8 +374,8 @@ pub const Looks = struct { } }; -/// Where the published `Looks` live in dvui's data (`core.material.publishLook`, read by -/// `LiquidField`), the one id both name. +/// Shared dvui data id for glass looks, renderer enablement and window opacity. +/// The keys distinguish these values within each window. pub const data_id_backing: u64 = 0x6c69_7166; pub const data_key = "_liquid_look"; @@ -604,17 +573,6 @@ test "both forms share the way" { } } -test "the light's angle packs to a direction toward the top left" { - var l = inApp(1); - l.light_angle = 51.7; - const d = lightDir(l); - try std.testing.expectApproxEqAbs(@as(f32, -0.62), d[0], 0.005); - try std.testing.expectApproxEqAbs(@as(f32, -0.78), d[1], 0.005); - l.light_angle = 45; - try std.testing.expectApproxEqAbs(@as(f32, -0.70710678), lightDir(l)[0], 1e-6); - try std.testing.expectApproxEqAbs(@as(f32, -0.70710678), lightDir(l)[1], 1e-6); -} - test "fizzy's looks keep every new curve at its identity" { var i: usize = 0; while (i <= 20) : (i += 1) { @@ -624,7 +582,6 @@ test "fizzy's looks keep every new curve at its identity" { try std.testing.expectEqual(@as(f32, 0), l.sweep); try std.testing.expectEqual(@as(f32, 1), l.ceiling); try std.testing.expectEqual(@as(f32, 0.85), l.edge_dark); - try std.testing.expectEqual(@as(f32, 0), l.rim_line); try std.testing.expectEqual(l.wash_top, l.wash_bottom); } // Cards and bars are a drop's until an app says otherwise. diff --git a/tests/integration.zig b/tests/integration.zig index f52dd4744..ec0c88d40 100644 --- a/tests/integration.zig +++ b/tests/integration.zig @@ -6089,7 +6089,7 @@ test "liquid field: groups are the shapes that touch, each drawn as its own quad try std.testing.expectEqual(@as(u8, 2), g.size[0]); try std.testing.expectEqual(@as(u8, 1), g.size[1]); // The uniforms are the shader's `uData`: its header, then three vec4s a shape. - try std.testing.expectEqual(@as(usize, (11 + 3 * LF.max_shapes) * 16), @sizeOf(LF.Uniforms)); + try std.testing.expectEqual(@as(usize, (9 + 3 * LF.max_shapes) * 16), @sizeOf(LF.Uniforms)); const u = f.pack(.{ .x = 0, .y = 0, .w = 400, .h = 100 }, false, g.order[0..f.len]); try std.testing.expectEqual(@as(f32, 22), u.shapes[1][0][0]); } @@ -6125,8 +6125,8 @@ test "liquid field: fizzy's default look packs to today's uniforms for every rol try std.testing.expectEqual(@as(f32, 0), u.curves[2]); try std.testing.expectEqual(@as(f32, 1), u.curves[3]); try std.testing.expectEqual(@as(f32, 0.85), u.widths[0]); - try std.testing.expectEqual(@as(f32, 0), u.edge[0]); - try std.testing.expectEqual(@as(f32, 0.70710678), -u.light[0]); + const old_lift: f32 = if (t.role == .lens) 0 else 0.03 * gl.way(opacity).shine; + try std.testing.expectEqual(old_lift, u.curves[0]); try std.testing.expectEqual(@max(l.bevel, 0.0001), u.dither[1]); try std.testing.expectEqual(l.bend * 0.5, u.dither[2]); try std.testing.expectEqual(l.shade, u.dither[3]); @@ -6146,8 +6146,6 @@ test "liquid field: an app look's curves reach the uniforms, a surface keeps its look.wash_top = 0.107; look.wash_bottom = 0.04; look.edge_dark = 0.3; - look.light_angle = 51.7; - look.rim_line = 0.5; var f: LF = .{ .tint = .{ .r = 0, .g = 0, .b = 0, .a = 255 }, .lift = 0.2, .role = .card }; f.add(LF.Shape.circle(.{ .x = 50, .y = 50 }, 40)); const order = [_]u8{0}; @@ -6155,9 +6153,6 @@ test "liquid field: an app look's curves reach the uniforms, a surface keeps its f.applyLook(&u, look); try std.testing.expectEqual([4]f32{ 0.107, 0.04, 0.11, 0.6 }, u.curves); try std.testing.expectEqual(@as(f32, 0.3), u.widths[0]); - try std.testing.expectEqual(@as(f32, 0.5), u.edge[0]); - try std.testing.expectApproxEqAbs(@as(f32, -0.62), u.light[0], 0.005); - try std.testing.expectApproxEqAbs(@as(f32, -0.78), u.light[1], 0.005); // A surface's colour is its own: its lift stays, and the look's wash does not reach it. var surface = f; surface.surface = true; @@ -6165,7 +6160,12 @@ test "liquid field: an app look's curves reach the uniforms, a surface keeps its surface.applyLook(&us, look); try std.testing.expectEqual(@as(f32, 0.2), us.face[1]); try std.testing.expectEqual(@as(f32, 0), us.curves[0]); - try std.testing.expectEqual(@as(f32, 0.11), us.curves[2]); + try std.testing.expectEqual(@as(f32, 0), us.curves[2]); + surface.surface = false; + surface.window = true; + var uw = surface.pack(.{ .x = 0, .y = 0, .w = 100, .h = 100 }, false, &order); + surface.applyLook(&uw, look); + try std.testing.expectEqual(@as(f32, 0), uw.curves[2]); } test "liquid field: a lens's picture reaches as far past its shapes as the earlier glass's rim pulls from" {