ComputePlayground/shaders/attractors/pixelCompute.compute
Dawid Pietrykowski 672758f7ec Initial commit
2022-11-09 23:54:43 +01:00

27 lines
743 B
Plaintext
Executable File

#version 430 core
layout(local_size_x = 8, local_size_y = 8) in;
layout(rgba32f) uniform image2D img_output;
uniform int _pass;
//vec4 base_color = vec4(1);
vec4 base_color = vec4(209, 227, 255, 255) / 255.0f;
void main(){
ivec2 id = ivec2(gl_GlobalInvocationID.xy);
vec4 pixel = imageLoad(img_output, id);
//imageStore(img_output, id, pixel * 0.998f);
//imageStore(img_output, id, vec4(1) * (_pass * 0.001f));
if(_pass != 0){
//imageStore(img_output, id, mix(pixel, base_color, 0.001f));
imageStore(img_output, id, mix(pixel, base_color, 0.005f));
}
else
imageStore(img_output, id, base_color);
//imageStore(img_output, id, clamp(pixel - vec4(.00001f), vec4(0), vec4(1)));
}