diff options
| author | Gabriel Schneider <[email protected]> | 2026-07-02 20:06:25 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-08-01 15:02:07 -0300 |
| commit | bead9f0b78380d1428f40fdab339c1c8f88fa626 (patch) | |
| tree | 960255de5a2cef661ec5d0ad3220a4b2b1738842 /shaders/ui.frag.glsl | |
| parent | 62ef1882ab7878210f05f06504796849e412c318 (diff) | |
| download | pardes-bead9f0b78380d1428f40fdab339c1c8f88fa626.tar.gz pardes-bead9f0b78380d1428f40fdab339c1c8f88fa626.zip | |
sdl ui backend
Diffstat (limited to 'shaders/ui.frag.glsl')
| -rw-r--r-- | shaders/ui.frag.glsl | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/shaders/ui.frag.glsl b/shaders/ui.frag.glsl new file mode 100644 index 00000000..2284fa0b --- /dev/null +++ b/shaders/ui.frag.glsl @@ -0,0 +1,18 @@ +#version 450 + +// Sample the glyph atlas (R = coverage 0..1) and mix the cell's bg up to its fg +// by that coverage. Fully opaque: the swapchain is SDR, no blending needed. + +layout(set = 2, binding = 0) uniform sampler2D u_atlas; + +layout(location = 0) in vec2 v_uv; +layout(location = 1) in vec3 v_fg; +layout(location = 2) in vec3 v_bg; + +layout(location = 0) out vec4 o_col; + +void main() { + float a = texture(u_atlas, v_uv).r; + vec3 col = mix(v_bg, v_fg, a); + o_col = vec4(col, 1.0); +} |
