mirror of
https://github.com/slendidev/lunar.git
synced 2025-12-19 13:29:52 +02:00
21
shaders/gradient_fullscreen.frag
Normal file
21
shaders/gradient_fullscreen.frag
Normal file
@@ -0,0 +1,21 @@
|
||||
#version 450
|
||||
|
||||
layout(location = 0) out vec4 out_color;
|
||||
|
||||
layout(push_constant) uniform PushConstants {
|
||||
vec2 resolution;
|
||||
} pc;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec2 uv = (gl_FragCoord.xy + vec2(0.5)) / pc.resolution;
|
||||
|
||||
float v = sin(uv.x * 10.0) + cos(uv.y * 10.0);
|
||||
|
||||
float r = 0.5 + 0.5 * cos(6.2831 * (uv.x + v));
|
||||
float g = 0.5 + 0.5 * cos(6.2831 * (uv.y + v + 0.33));
|
||||
float b = 0.5 + 0.5 * cos(6.2831 * (uv.x - uv.y + 0.66));
|
||||
|
||||
out_color = vec4(r, g, b, 1.0);
|
||||
}
|
||||
|
||||
13
shaders/gradient_fullscreen.vert
Normal file
13
shaders/gradient_fullscreen.vert
Normal file
@@ -0,0 +1,13 @@
|
||||
#version 450
|
||||
|
||||
void main()
|
||||
{
|
||||
vec2 positions[3] = vec2[](
|
||||
vec2(-1.0, -1.0),
|
||||
vec2( 3.0, -1.0),
|
||||
vec2(-1.0, 3.0)
|
||||
);
|
||||
|
||||
gl_Position = vec4(positions[gl_VertexIndex], 0.0, 1.0);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ else
|
||||
endif
|
||||
|
||||
shader_sources = files(
|
||||
'gradient.comp',
|
||||
'triangle.frag',
|
||||
'triangle.vert',
|
||||
'triangle_mesh.frag',
|
||||
|
||||
Reference in New Issue
Block a user