summaryrefslogtreecommitdiff
path: root/shaders/prebuilt/image.frag.glsl
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-08-17 16:12:56 -0300
committerGabriel Schneider <[email protected]>2026-08-18 23:45:04 -0300
commit31fece62f56aa2311e2325de83659edbc9e641db (patch)
tree13eee1e542d9670ad3fb7badad353265121d668f /shaders/prebuilt/image.frag.glsl
parent1551e409c31992437cb2fa864f576d45c8433801 (diff)
downloadpardes-31fece62f56aa2311e2325de83659edbc9e641db.tar.gz
pardes-31fece62f56aa2311e2325de83659edbc9e641db.zip
animation: core publishes transition records; gui evaluates via shaders, tty over grid cells
Diffstat (limited to 'shaders/prebuilt/image.frag.glsl')
-rw-r--r--shaders/prebuilt/image.frag.glsl60
1 files changed, 0 insertions, 60 deletions
diff --git a/shaders/prebuilt/image.frag.glsl b/shaders/prebuilt/image.frag.glsl
index 747ceef7..2a3c2038 100644
--- a/shaders/prebuilt/image.frag.glsl
+++ b/shaders/prebuilt/image.frag.glsl
@@ -17,35 +17,6 @@ float cellNoise(uint serial, uint col, uint row) {
return float(x & 0xffffu) / 65535.0;
}
-// The same seven procedural ASCII marks as ui.frag.glsl and the macOS Metal
-// panel kernel. Native attachments are content in the panel, so they should
-// not switch to a smaller two-symbol animation when the glyph grid over them
-// is using `. : + * # % @`.
-float asciiGlyph(vec2 uv, int glyph) {
- vec2 p = uv * 2.0 - 1.0;
- float thin = 0.12;
- float dotShape = 1.0 - smoothstep(0.10, 0.20, length(p - vec2(0.0, 0.45)));
- float barH = 1.0 - smoothstep(thin, thin + 0.08, abs(p.y));
- float barV = 1.0 - smoothstep(thin, thin + 0.08, abs(p.x));
- if (glyph == 0) return dotShape;
- if (glyph == 1) return max(dotShape, 1.0 - smoothstep(0.10, 0.20, length(p + vec2(0.0, 0.45))));
- if (glyph == 2) return max(barH, barV);
- if (glyph == 3) {
- float d0 = 1.0 - smoothstep(thin, thin + 0.08, abs(p.x - p.y));
- float d1 = 1.0 - smoothstep(thin, thin + 0.08, abs(p.x + p.y));
- return max(max(d0, d1), max(barH, barV));
- }
- if (glyph == 4) {
- float rails = max(
- 1.0 - smoothstep(thin, thin + 0.08, abs(abs(p.x) - 0.34)),
- 1.0 - smoothstep(thin, thin + 0.08, abs(abs(p.y) - 0.34))
- );
- return rails;
- }
- float ring = 1.0 - smoothstep(thin, thin + 0.08, abs(length(p * vec2(0.8, 1.0)) - 0.48));
- return max(ring, glyph == 6 ? dotShape : 0.0);
-}
-
void main() {
vec4 source = texture(u_image, v_uv);
uint effect = v_effect.x & 0x7fffffffu;
@@ -64,36 +35,5 @@ void main() {
o_col = source;
return;
}
- if (effect == 4u) {
- float diagonal = float((cellCoord.x + cellCoord.y * 2u) % 17u) / 17.0;
- float threshold = noise * 0.72 + diagonal * 0.28;
- bool reveal = progress >= 1.0 || (progress > 0.0 && progress >= threshold);
- bool wave = !reveal && progress > 0.0 && progress + 0.22 >= threshold;
- if (oldLayer) {
- if (wave || reveal) discard;
- o_col = source;
- return;
- }
- if (reveal) {
- o_col = source;
- return;
- }
- if (!wave) discard;
- vec2 cellUV = fract(v_panel_uv * vec2(dimensions));
- int glyph = min(int(floor(noise * 7.0)), 6);
- float mark = asciiGlyph(cellUV, glyph);
- float luma = dot(source.rgb, vec3(0.2126, 0.7152, 0.0722));
- vec3 paper = source.rgb * 0.10;
- // Preserve source colour when it already separates from the dimmed
- // paper. Solid black pixels have no such separation, so derive a
- // readable mark from their own luminance instead of letting the ASCII
- // phase disappear on dark images/PDF regions.
- vec3 contrastInk = luma > 0.5 ? vec3(0.0) : vec3(1.0);
- float sourceContrast = smoothstep(0.025, 0.14, length(source.rgb - paper));
- vec3 ink = mix(contrastInk, source.rgb, sourceContrast);
- vec3 dimInk = mix(paper, ink, 0.62);
- o_col = vec4(mix(paper, dimInk, mark), source.a);
- return;
- }
o_col = source;
}