ACMX Vulkan Shader Library
GLSL 4.50 shader effects for ACMX's Vulkan renderer
Loading...
Searching...
No Matches
game_arcade_marquee.frag
Go to the documentation of this file.
1#version 450
2
3/**
4 * @file game_arcade_marquee.frag
5 * @brief Vulkan fragment shader: game arcade marquee.
6 */
7layout(set = 0, binding = 1, std140) uniform SpriteExtended {
8 vec4 mouse;
9 vec4 u0;
10 vec4 u1;
11 vec4 u2;
12 vec4 u3;
13 vec4 custom_uniforms[16];
14 vec4 audio_bands;
15 vec4 audio_history;
17#define iResolution ext.u0.zw
18#define time_f ext.u2.y
19
20// Arcade marquee: scrolling rainbow light bars on top and bottom edges.
21layout(location = 0) out vec4 color;
22layout(location = 0) in vec2 tc;
23layout(set = 0, binding = 0) uniform sampler2D samp;
24
25
26
27/**
28 * @brief Evaluates hue for this shader effect.
29 * @param h Input value for the calculation.
30 * @return Computed vec3 value.
31 */
32vec3 hue(float h) {
33 return clamp(abs(mod(h * 6.0 + vec3(0.0, 4.0, 2.0), 6.0) - 3.0) - 1.0, 0.0, 1.0);
34}
35
36/**
37 * @brief Executes the fragment shader entry point.
38 */
39void main(void) {
40 vec3 c = texture(samp, tc).rgb;
41 float bar = 0.06;
42 float topD = smoothstep(bar, 0.0, tc.y);
43 float botD = smoothstep(1.0 - bar, 1.0, tc.y);
44 float mask = max(topD, botD);
45 float bulb = step(0.5, fract(tc.x * 28.0 + time_f * 0.6));
46 vec3 marquee = hue(tc.x * 0.7 + time_f * 0.25) * (0.6 + 0.4 * bulb);
47 c = mix(c, marquee, mask * 0.85);
48 color = vec4(c, 1.0);
49}
layout(set=0, binding=1, std140) uniform SpriteExtended
Definition 3high.frag:7
ext
Definition 3high.frag:16
void main(void)
Executes the fragment shader entry point.
Definition 3high.frag:47
#define time_f
Definition 3high.frag:19
vec3 hue(float t)
Evaluates hue for this shader effect.
Definition auraXi1.frag:65
float h(vec2 p)
Evaluates h for this shader effect.