ACMX Vulkan Shader Library
GLSL 4.50 shader effects for ACMX's Vulkan renderer
Loading...
Searching...
No Matches
game_codex_lava_damage.frag
Go to the documentation of this file.
1#version 450
2
3/**
4 * @file game_codex_lava_damage.frag
5 * @brief Vulkan fragment shader: game codex lava damage.
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// Lava damage: molten heat shimmer and orange overexposure.
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 Executes the fragment shader entry point.
29 */
30void main(void) {
31 vec2 p = tc - 0.5;
32 float heat = sin(tc.y * 80.0 + time_f * 9.0) * 0.006;
33 heat += sin(tc.x * 35.0 - time_f * 4.0) * 0.004;
34 vec3 c = texture(samp, clamp(tc + vec2(heat, heat * 0.4), 0.0, 1.0)).rgb;
35 float edge = smoothstep(0.08, 0.35, dot(p, p));
36 float pulse = 0.55 + 0.45 * sin(time_f * 3.0);
37 vec3 lava = vec3(1.0, 0.32, 0.02);
38 c = mix(c, lava + c * 0.35, edge * pulse * 0.55);
39 color = vec4(c, 1.0);
40}
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 lava(float t)
Evaluates lava for this shader effect.