MoonWorksGraphicsTests/Common/Content/Shaders/Source/GradientTexture.comp

20 lines
462 B
Plaintext
Raw Normal View History

#version 450
2024-06-06 05:47:06 +00:00
layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in;
layout (set = 1, binding = 0, rgba8) uniform writeonly image2D outImage;
2024-06-06 05:47:06 +00:00
layout (set = 2, binding = 0) uniform UBO
{
2024-06-06 05:47:06 +00:00
float time;
} ubo;
void main()
{
2024-06-06 05:47:06 +00:00
vec2 size = imageSize(outImage);
vec2 coord = gl_GlobalInvocationID.xy;
2024-06-06 05:47:06 +00:00
vec2 uv = coord / size;
vec3 col = 0.5 + 0.5*cos(ubo.time + uv.xyx + vec3(0, 2, 4));
imageStore(outImage, ivec2(coord), vec4(col, 1.0));
}