fixed movement not wrapping around the world.. again
This commit is contained in:
@@ -21,14 +21,7 @@ float get_dissipation_from(ivec2 uv) {
|
||||
}
|
||||
|
||||
ivec2 loop_position(ivec2 pos) {
|
||||
int width = params.texture_size.x;
|
||||
int height = params.texture_size.y;
|
||||
vec2 looped = pos;
|
||||
if (pos.x > width) looped.x = mod(pos.x, width);
|
||||
if (pos.y > height) looped.y = mod(pos.y, height);
|
||||
if (pos.x < 0) looped.x = width - pos.x;
|
||||
if (pos.y < 0) looped.y = height - pos.y;
|
||||
return ivec2(looped);
|
||||
return pos % params.texture_size;
|
||||
}
|
||||
|
||||
// The code we want to execute in each invocation
|
||||
|
||||
Reference in New Issue
Block a user