Shift chunks where they are supposed to be

This commit is contained in:
2022-10-22 21:19:58 +02:00
parent 655978efc2
commit e36ce58f75
3 changed files with 52 additions and 27 deletions
+11 -1
View File
@@ -73,9 +73,12 @@ fn main() {
in uint index;
in float altitude;
in uvec2 chunk;
out vec2 v_tex_coords;
const uint TILE_SIZE = 4u;
void main() {
uint index_mod = index % 6u;
uint index_div = index / 6u;
@@ -99,7 +102,14 @@ fn main() {
x++;
z++;
}
gl_Position = persp_matrix * view_matrix * vec4(vec3(x, altitude, z) * 0.005, 1.0);
x *= TILE_SIZE;
z *= TILE_SIZE;
x += chunk.x;
z += chunk.y;
gl_Position = persp_matrix * view_matrix * vec4(vec3(x, altitude, z), 1.0);
}
",