18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-20 22:04:59 +01:00

Optimise raytracing and buffer building

This commit is contained in:
2026-11-16 22:19:17 +01:00
parent 053e4cacee
commit b8815a2455
7 changed files with 69 additions and 48 deletions

View File

@@ -63,6 +63,7 @@ class grass_field
glm::vec4 share{0.f};
std::size_t first{0}; // tiles drawn, in tile_draws()
std::size_t count{0};
float nearest{0.f}; // distance to the nearest of its tiles; the chunks are drawn from the nearest one
};
// a tile drawn: Count instances of a strip of 2 * Segments + 1 vertices
struct tile_draw
@@ -71,6 +72,7 @@ class grass_field
glm::vec4 part{0.f}; // grass_part
int count{0};
int segments{0};
float distance{0.f}; // to the box of the tile; the tiles of a chunk are drawn from the nearest one
};
// the draws of the grass seen from Camera: false when there is nothing to draw (grass off, no chunks or kinds), the draws of
// the last call are left then. Visible: whether the bounds of a tile are seen