I think it is in some kind of working state now

This commit is contained in:
2025-08-01 22:46:57 +03:00
parent e2f1c8c13a
commit 15639ff098
4 changed files with 59 additions and 36 deletions

View File

@@ -20,9 +20,11 @@ float get_dissipation_from(ivec2 uv) {
return v * params.dissipation_factor;
}
void store_value(ivec2 uv, vec4 v) {
imageStore(output_image, uv, v);
}
// ivec2 loop_position(vec2 pos) {
// int width = params.texture_size.x;
// int height = params.texture_size.y;
// return ivec2(mod(pos + params.texture_size, params.texture_size));
// }
// The code we want to execute in each invocation
void main() {
@@ -31,7 +33,6 @@ void main() {
ivec2 uv = ivec2(gl_GlobalInvocationID.xy);
ivec2 tl = ivec2(0, 0);
ivec2 up_uv = clamp(uv - ivec2(0, 1), tl, size);
ivec2 down_uv = clamp(uv + ivec2(0, 1), tl, size);
ivec2 left_uv = clamp(uv - ivec2(1, 0), tl, size);
@@ -51,7 +52,7 @@ void main() {
new_v += get_dissipation_from(left_uv);
new_v = clamp(new_v, 0, 1);
// new_v = clamp(new_v, 0, 1);
vec4 result = vec4(new_v, new_v, new_v, 1.0);
imageStore(output_image, uv, result);