diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-03-08 00:59:23 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2025-03-11 01:13:59 +0000 |
commit | 12d7acf095f885a97166ca16c6d274817ab342f7 (patch) | |
tree | adec614225b08ec1cceb55ea8a61ea0fb9370d47 /test/perf-terrain.cpp | |
parent | Construct terrain tile AxisAlignedBoundingBox during mesh generation (diff) | |
download | ilt-12d7acf095f885a97166ca16c6d274817ab342f7.tar.bz2 ilt-12d7acf095f885a97166ca16c6d274817ab342f7.tar.xz ilt-12d7acf095f885a97166ca16c6d274817ab342f7.zip |
Current tile in frustum as we loop
Chunk by surface only, render if visible in frustum
Diffstat (limited to 'test/perf-terrain.cpp')
-rw-r--r-- | test/perf-terrain.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/perf-terrain.cpp b/test/perf-terrain.cpp index 81cb16c..e75f80b 100644 --- a/test/perf-terrain.cpp +++ b/test/perf-terrain.cpp @@ -1,4 +1,7 @@ #include "game/terrain.h" +#include "gfx/camera.h" +#include "gfx/frustum.h" +#include "gfx/gl/sceneShader.h" #include "testMainWindow.h" #include <benchmark/benchmark.h> @@ -14,8 +17,22 @@ namespace { terrain.generateMeshes(); } } + + void + terrainRender(benchmark::State & state) + { + Terrain terrain {GeoData::loadFromAsciiGrid(FIXTURESDIR "height/SD19.asc")}; + SceneShader shader; + Camera cam {terrain.getExtents().min + GlobalPosition3D {0, 0, 10000}, 45.F, 1.F, 1, 10000}; + cam.setForward(::north + ::east); + + for (auto _ : state) { + terrain.render(shader, cam); + } + } } BENCHMARK(terrainMeshgen); +BENCHMARK(terrainRender); BENCHMARK_MAIN(); |