Skip to content

Free, open-source 3D sculpting for Linux, macOS and Windows: dense meshes, remeshing, painting, built-in AI (image/text to 3D), Send to Unreal, game-ready LODs, Gaussian splats and OpenUSD.

Benchmark take HUD at the canvas's bottom left (clear of the timeline strip and the axes)

islandmed01131a5ff7bc
diff --git a/docs/benchmark.md b/docs/benchmark.md
index 7837db7c..36978e1b 100644
--- a/docs/benchmark.md
+++ b/docs/benchmark.md
@@ -143,7 +143,7 @@ sculptforge --benchmark-script take.sfui [project.sfproj] --benchmark-video take
in the clip as it is for a person. `stroke` sends its pointer samples at 240 a second (each frame, the samples
since the last one), like proof mode; `pen_stroke` sends 4 a frame. A step's own end is checked once a frame, so
waits are at least as long as written.
-- The proof mode HUD (version, commit, frame times over the last second, stroke lag, GPU) and the script's pointer
+- The proof mode HUD (bottom left: version, commit, frame times over the last second, stroke lag, GPU) and the script's pointer
are drawn on top, and the frames go to the MP4 the same way as proof mode's: read back through pixel buffers,
encoded by ffmpeg on its own thread at a constant 30 fps (a frame repeats while the app is slower), so the video
is as long as the take. `--benchmark-no-video` records none; `--benchmark-vsync` keeps vertical sync on.
diff --git a/src/app/BenchTake.cpp b/src/app/BenchTake.cpp
index 5bd43619..891cd675 100644
--- a/src/app/BenchTake.cpp
+++ b/src/app/BenchTake.cpp
@@ -257,13 +257,12 @@ void App::takeBeforeSwap(int fbW, int fbH) {
void App::drawTakeHud() {
TakeState& t = *take_;
if (t.stage == TakeState::Stage::Done) return;
- // Top left of the canvas, as proof mode's (burned into the video: it is part of the frame).
+ // As proof mode's (burned into the video: it is part of the frame).
const float sc = uiScale_;
const CanvasRect c = canvasRect();
ImDrawList* dl = ImGui::GetForegroundDrawList();
ImFont* font = ImGui::GetFont();
const float bigSize = ImGui::GetFontSize() * 1.35f, smallSize = ImGui::GetFontSize() * 1.05f;
- const ImVec2 at(c.x + 14 * sc, c.y + 14 * sc);
const std::string brand = std::string("SculptForge ") + SCULPTFORGE_VERSION + " (" + SF_GIT_COMMIT + ") - benchmark take";
const char* lines[] = {brand.c_str(), t.hud[0].c_str(), t.hud[1].c_str(), t.hud[2].c_str()};
float w = 0, h = 0;
@@ -272,6 +271,10 @@ void App::drawTakeHud() {
w = std::max(w, s.x);
h += s.y + 3 * sc;
}
+ // Bottom left of the canvas: the top has the timeline strip and the axes, and a take's strokes are mostly in the
+ // middle (above the timeline strip when that is at the bottom).
+ const float bottom = timelineStripY_ > c.y && timelineTopInset_ <= 0.0f ? timelineStripY_ : c.y + c.h;
+ const ImVec2 at(c.x + 14 * sc, bottom - h - 14 * sc);
dl->AddRectFilled(ImVec2(at.x - 10 * sc, at.y - 8 * sc), ImVec2(at.x + w + 10 * sc, at.y + h + 6 * sc), IM_COL32(12, 12, 14, 215), 6 * sc);
float y = at.y;
for (int i = 0; i < 4; ++i) {