[quote=“h.pernpeintner,post:11,topic:59104”]
I have converted the demo to a before-after benchmarking tool. It looks like this:
http://www.java-gaming.org/user-generated-content/members/4730/lwjgl-tootle-demo.jpg
You set up the geometry to test and optimization parameters, then toggle between unoptimized and optimized mesh (with ‘O’) and see the performance difference. The elapsed time on the upper-right is the GPU time for the 3D mesh only (uses GL_TIME_ELAPSED queries), the HUD rendering does not affect it. Some notes:
- The meshes 1-8 are procedurally generated using par_shapes. They already have a low ACMR and cannot be optimized significantly, so are not good for testing. The demo supports loading a custom mesh with Assimp (press <CTRL+O>). Artist-created meshes from a DCC app usually suffer from high ACMR.
- If you don’t have a good test mesh, press to shuffle the unoptimized mesh. The geometry is exactly the same, but the triangle order is randomized, resulting in a horrible ACMR close to the worst case (3.0). This should give you a good idea of how bad it can get when the vertex caches are not utilized.
- When doing ACMR comparisons, it’s best to turn off rasterization (press to toggle). This will isolate measurement to the GPU vertex processing pipeline.
- Overdraw optimization is harder to test. It depends on the mesh having clusters covering other clusters and you also need to be doing significant work in the fragment shader. You may want to edit the shader to do something expensive (e.g. a sin/cos loop). There’s also a trade-off involved, optimizing a mesh for less overdraw usually leads to a higher ACMR. This can be tuned with the alpha parameter of TootleFastOptimize. If you want to test for ACMR only, press F1, it usually produces the best ACMR results.
As an example, with the 512 bunnies in the screenshot above and rasterization disabled:
- Unoptimized mesh with an ACMR of 2.075 -> 12ms
- Optimized mesh with an ACMR of 0.689 -> 5.7ms
It’s a fairly dramatic difference, but YMMV. It really depends on the mesh used, but it’s always beneficial and, well, it’s free (can be done offline).
Finally, if you’re on Windows, make sure to download the latest 3.1.6 snapshot. It adds support for Direct3D rasterization when doing overdraw optimization/measurement, which makes Tootle at least 100x faster (hundred x, not a typo).