summaryrefslogtreecommitdiff
path: root/shaders/prebuilt/image.frag.glsl
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-29 22:05:58 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:17 -0300
commit813a0b2bf3c110f2287d7136f0dfc540c0978cd6 (patch)
tree8250da85fde87d8cc4ccbbceaa304b1bed82be4e /shaders/prebuilt/image.frag.glsl
parent714da820136ac89d6a79ed0141e7325829ab8204 (diff)
downloadpardes-813a0b2bf3c110f2287d7136f0dfc540c0978cd6.tar.gz
pardes-813a0b2bf3c110f2287d7136f0dfc540c0978cd6.zip
The GUI embeds its shaders' GLSL from shaders/ always: the 14 prebuilt copies, identical to their sources, go, and so does the label saying which was used
shaders/prebuilt/*.glsl were byte-identical to shaders/X.glsl or to prefix.glsl + post/X.glsl (checked with cmp, all 14), kept only so a -Dprebuilt-shaders build could name them; EffectCode and Config then labelled the GUI's shader source as live or prebuilt. The GUI embeds shaderSource (a concatenation, no glslc) either way now; the prebuilt SPIR-V stays, and zig build shaders refreshes only it. Config's report and EffectCode lose their GUI shader source line. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'shaders/prebuilt/image.frag.glsl')
-rw-r--r--shaders/prebuilt/image.frag.glsl45
1 files changed, 0 insertions, 45 deletions
diff --git a/shaders/prebuilt/image.frag.glsl b/shaders/prebuilt/image.frag.glsl
deleted file mode 100644
index 0cc1b2ee..00000000
--- a/shaders/prebuilt/image.frag.glsl
+++ /dev/null
@@ -1,45 +0,0 @@
-#version 450
-
-layout(set = 2, binding = 0) uniform sampler2D u_image;
-layout(std140, set = 3, binding = 0) uniform UiUniforms {
- float background_opacity;
-} u_ui;
-
-layout(location = 0) in vec2 v_uv;
-layout(location = 1) in vec2 v_panel_uv;
-layout(location = 2) flat in uvec4 v_effect;
-layout(location = 0) out vec4 o_col;
-
-float cellNoise(uint serial, uint col, uint row) {
- uint x = serial ^ (col * 0x9e3779b9u) ^ (row * 0x85ebca6bu);
- x ^= x >> 16;
- x *= 0x7feb352du;
- x ^= x >> 15;
- x *= 0x846ca68bu;
- x ^= x >> 16;
- return float(x & 0xffffu) / 65535.0;
-}
-
-void main() {
- vec4 source = texture(u_image, v_uv);
- // Keep source coverage for destination subtraction; the pipeline scales
- // source alpha by the same opacity through its alpha blend constant.
- source.rgb *= clamp(u_ui.background_opacity, 0.0, 1.0);
- uint effect = v_effect.x & 0x7fffffffu;
- bool oldLayer = (v_effect.x & 0x80000000u) != 0u;
- float progress = clamp(uintBitsToFloat(v_effect.y), 0.0, 1.0);
- uvec2 dimensions = max(
- uvec2(v_effect.w & 0xffffu, v_effect.w >> 16),
- uvec2(1u));
- uvec2 cellCoord = min(
- uvec2(floor(max(v_panel_uv, vec2(0.0)) * vec2(dimensions))),
- dimensions - 1u);
- float noise = cellNoise(v_effect.z, cellCoord.x, cellCoord.y);
- if (effect == 3u) {
- bool reveal = progress >= 1.0 || (progress > 0.0 && noise < progress);
- if (oldLayer == reveal) discard;
- o_col = source;
- return;
- }
- o_col = source;
-}