GPU-accelerated UI toolkit (Vulkan)
git clone https://git.lucas.co/cce-ui.git
plates: quieter tint wash, quadratic falloff — no sharp inner contour
Amplitude down to 0.20, and the wash is quadratic in roll coverage: it
hugs the silhouette and dies out with zero slope. The linear fade
terminated on the SDF's inner iso-contour, whose corners sharpen as the
roll consumes the corner radius — the band read as a sharp-cornered
inner frame instead of following the relief's arcs.
Co-Authored-By: Claude Fable 5 <[email protected]>
src/vk/shader2d.wgsl | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/src/vk/shader2d.wgsl b/src/vk/shader2d.wgsl
index 8a3907a..daa0905 100644
--- a/src/vk/shader2d.wgsl
+++ b/src/vk/shader2d.wgsl
@@ -514,15 +514,17 @@ fn plate_shade(frag: vec2f, vcol: vec4f) -> vec4f {
let shade = 1.0 + (diff / flat_shade - 1.0 + extra) * strength;
let spec = roll_spec(sv);
// p_spec_tint.w = 1 marks an accent-tinted plate (the focused-pane
- // treatment): the ENTIRE rolled edge takes a WASH of the accent — the
- // roll's material mixes toward the tint across its coverage (f = 1 at
- // the silhouette, 0 on the face), capped well below full so the edge
- // reads as the plate's roll with a hue cast, not a painted border
- // (full-strength was tried and read as a thick glowing frame). The
- // specular glint keeps its own tint term on top, as before. Neutral
- // plates (w = 0) shade exactly as before.
+ // treatment): the ENTIRE rolled edge takes a quiet WASH of the accent
+ // (f = 1 at the silhouette, 0 on the face; capped low — full-strength
+ // read as a painted frame). QUADRATIC in f: the wash hugs the
+ // silhouette and dies out with zero slope, so it has no crisp inner
+ // boundary — a linear fade terminated on the SDF's inner iso-contour,
+ // whose corners sharpen as the roll consumes the corner radius, and
+ // the band read as a sharp-cornered inner frame. The specular glint
+ // keeps its own tint term on top. Neutral plates (w = 0) shade
+ // exactly as before.
let tw = rrect_clip.p_spec_tint.w;
- let rgb = mix(base.rgb, rrect_clip.p_spec_tint.rgb, tw * f * 0.35);
+ let rgb = mix(base.rgb, rrect_clip.p_spec_tint.rgb, tw * f * f * 0.20);
return vec4f(rgb * shade + rrect_clip.p_spec_tint.rgb * (spec * strength), abs(base.a) * aa);
}