perf:greedy meshing (#23)

* feat(gameplay): implement greedy meshing for chunk generation

Replace the per-face vertex generation with a greedy meshing algorithm that merges adjacent faces of the same block type into larger quads. Introduce `FaceKey` struct and helper functions (`axis_dir_to_face`, `get_block_safe`, `is_face_culled`, `choose_buf`) to support the new algorithm. Comment out the old `gen_vertices` implementation.

In texture management, rename `m_pbr_texture_array` to `m_normal_texture_array` to reflect its actual usage, and set texture wrap mode to `GL_REPEAT` for both the block and normal texture arrays.

* fix(primitive_data): correct back face texture coordinates and tangents

* fix(texture-manager): correct texture deletion and refactor reload

Make hot_reload private and add public need_reload method. Update UI to call need_reload instead of hot_reload. Fix incorrect use of glDeleteBuffers for normal texture array by using glDeleteTextures.
This commit is contained in:
zhenyan121
2026-06-22 19:48:25 +08:00
committed by GitHub
parent 7ecdab08fc
commit 97993b72fe
6 changed files with 331 additions and 24 deletions

View File

@@ -430,7 +430,7 @@ void DevPanel::show_settings_tab_item() {
}
if (ImGui::Button("ReloadTexture")) {
Config::get().set("texture.aniso", m_config.aniso);
m_app.texture_manager().hot_reload();
m_app.texture_manager().need_reload();
m_config.is_reload = true;
}
if (!m_config.is_reload) {