mirror of
https://github.com/boxpositron/absolute-dotfiles.git
synced 2026-02-28 03:30:37 +00:00
feat(shaders): add CRT-styled shader with public domain license and adjustments for Ghostty, including parameter definitions and tonal control functions. refactor(shader): optimize color conversion and output to SRGB for better visual quality feat(shaders): add flicker, glow, and starfield shader effects for terminal ambiance.
23 lines
635 B
GLSL
23 lines
635 B
GLSL
// https://github.com/12jihan/ghostty_shaders/blob/main/glow.glsl
|
|
|
|
void mainImage(out vec4 fragColor, in vec2 fragCoord) {
|
|
vec2 uv = fragCoord/iResolution.xy;
|
|
|
|
// Base color from terminal
|
|
vec3 color = texture(iChannel0, uv).rgb;
|
|
|
|
// Add bloom/glow
|
|
float bloom = 0.05;
|
|
vec3 glow = vec3(0.0);
|
|
for(float i = 0.0; i < 4.0; i++) {
|
|
vec2 offset = vec2(i) / iResolution.xy;
|
|
glow += texture(iChannel0, uv + offset).rgb;
|
|
glow += texture(iChannel0, uv - offset).rgb;
|
|
}
|
|
|
|
// Combine glow with original color
|
|
color += glow * bloom;
|
|
|
|
fragColor = vec4(color, 1.0);
|
|
}
|