diff --git a/engine/world_generation/src/mesh_generator.rs b/engine/world_generation/src/mesh_generator.rs index 8b7a2e1..6e331c8 100644 --- a/engine/world_generation/src/mesh_generator.rs +++ b/engine/world_generation/src/mesh_generator.rs @@ -76,6 +76,7 @@ pub fn generate_chunk_mesh( return mesh; } +const TEX_MULTI: Vec2 = Vec2::new(1000., 1.); fn create_tile( pos: Vec3, neighbors: &[Option; 6], @@ -90,13 +91,13 @@ fn create_tile( let side_tex_off = Vec2::new(side_texture_index as f32, 0.); let idx = verts.len() as u32; - uvs.push(uv_offset + tex_off); + uvs.push((uv_offset / TEX_MULTI) + tex_off); verts.push(pos); for i in 0..6 { let p = pos + HEX_CORNERS[i]; verts.push(p); let uv = (HEX_CORNERS[i].xz() / 2.) + uv_offset; - uvs.push(uv + tex_off); + uvs.push((uv / TEX_MULTI) + tex_off); indices.push(idx); indices.push(idx + 1 + i as u32); indices.push(idx + 1 + ((i as u32 + 1) % 6)); @@ -145,7 +146,7 @@ fn create_tile_wall( indices.push(idx + 3); uvs.push(Vec2::ZERO + tex_off); - uvs.push(Vec2::new(1., 0.) + tex_off); - uvs.push(Vec2::new(0., pos.y - height) + tex_off); - uvs.push(Vec2::new(1., pos.y - height) + tex_off); + uvs.push((Vec2::new(1., 0.) / TEX_MULTI) + tex_off); + uvs.push((Vec2::new(0., pos.y - height) / TEX_MULTI) + tex_off); + uvs.push((Vec2::new(1., pos.y - height) / TEX_MULTI) + tex_off); } diff --git a/game/main/assets b/game/main/assets index 60527f4..b5c3a16 160000 --- a/game/main/assets +++ b/game/main/assets @@ -1 +1 @@ -Subproject commit 60527f41d5552092a21713ce118c5d51160d431e +Subproject commit b5c3a166a086062525ed738f68e93c5207a43bac