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.

Merge origin/perf/beta-boost 0951f706 (0.11.0-beta.1)

islandmed31ff1abc6ac1
diff --cc changes/beta-boost.md
index 00000000,0384ad4e..f6bf3361
mode 000000,100644..100644
--- a/changes/beta-boost.md
+++ b/changes/beta-boost.md
@@@ -1,0 -1,23 +1,23 @@@
+ ---
+ whats_new: **Fast Big Brushes**: big brushes on dense meshes keep up with the pen. A 240 px Clay stroke on a 15 million
+ triangle head trails the pen by a third to a quarter of what it did (most on modest hardware), and every dab is
+ placed. On by default: **Preferences > Performance > Fast Big Brushes**.
+ highlight: Big brushes keep up on dense meshes
+ added: **Fast Big Brushes** (Preferences > Performance, on by default): a dab that reaches more than 150,000 vertices
+ takes its plane from an even sample of them and turns the shading along with the move it makes (from the brush's
+ own slope, no neighbour walks), and the dabs waiting for a frame go through the vertices together in one pass, so
+ the normals, the picking structure and the GPU copy are updated once a frame instead of once a dab. Every vertex
+ still moves by the brush itself; the exact shading follows when the pen rests and when it lifts. Standard, Clay,
- Flatten, Crease, Pinch and Dam Standard; Trim takes the sampled plane and shading but not the fused pass. Small
++ Flatten, Crease, Pinch and Sharp Crease; Trim takes the sampled plane and shading but not the fused pass. Small
+ brushes, Smooth, Layer, Inflate, Nudge, Clay Block, alphas and masked areas are placed dab by dab as before.
+ The result matches the dab-by-dab stroke to within about 2% of how far it moved the surface
+ (tests/test_beta_boost.cpp).
+ testers:
+ - Windows: open a dense model (or Help > Benchmark, standard-15m) and sculpt with a 200-300 px Clay or Standard
+ brush across the face, fast: the surface should follow the pen closely, without the stroke falling behind.
+ - Any OS: same stroke with Preferences > Performance > Fast Big Brushes off, then on: the result should look the
+ same; the shading under the brush should be smooth while you drag and after you lift the pen.
+ - Any OS: X symmetry on, a big brush back and forth across the middle of the face: no seam or step at the mirror line.
+ - macOS / Linux: undo and redo a big stroke: the surface and its shading come back exactly.
+ ---
+ Numbers before/after (laptop, floor profile, Windows PC): REPORT.md on perf/beta-boost.
diff --cc src/app/App.h
index dbf5b928,0b89d7fd..83fb9c5b
--- a/src/app/App.h
+++ b/src/app/App.h
@@@ -334,7 -335,7 +335,8 @@@ private
bool asyncStroke_ = false; // this stroke's dabs go to the solver thread
bool strokeFinishing_ = false; // released: the solver places the last dabs, the UI carries on
bool predictiveStrokes() const; // the preference (and its environment override)
+ bool previewStrokes() const; // the stroke's dabs draw the predictive preview (predictive, or SF_BG_GHOST)
+ bool fastBigBrushes() const; // Preferences > Performance > Fast Big Brushes (SF_ADAPTIVE_DABS=0 / 1 overrides it)
bool draftStrokes() const; // Draft Strokes (SF_DRAFT_STROKE=0 / 1 overrides)
bool backgroundDabs() const; // a heavy mesh's dabs on the solver thread without the preview (SF_BACKGROUND_DABS)
bool asyncStrokeAllowed() const; // the stroke beginning now may use the solver thread
diff --cc src/app/Config.cpp
index 5f9bc255,9caa7057..0679dcd4
--- a/src/app/Config.cpp
+++ b/src/app/Config.cpp
@@@ -119,9 -114,7 +119,10 @@@ Json toJson(const UiPrefs& p)
j.set("multithreading", p.multithreading);
j.set("predictiveStrokes", p.predictiveStrokes);
j.set("draftStrokes", p.draftStrokes);
+ j.set("liveMove", p.liveMove);
+ j.set("backgroundPreview", p.backgroundPreview);
+ j.set("fastUpload", p.fastUpload);
+ j.set("fastBigBrushes", p.fastBigBrushes);
j.set("dyntopoConstantDetail", p.dyntopoConstantDetail);
j.set("flatShading", p.flatShading);
j.set("viewportCursor", double(p.viewportCursor));
@@@ -203,9 -193,7 +204,10 @@@ void fromJson(const Json& j, UiPrefs& p
p.multithreading = j["multithreading"].asBool(p.multithreading);
p.predictiveStrokes = j["predictiveStrokes"].asBool(p.predictiveStrokes);
p.draftStrokes = j["draftStrokes"].asBool(p.draftStrokes);
+ p.liveMove = j["liveMove"].asBool(p.liveMove);
+ p.backgroundPreview = j["backgroundPreview"].asBool(p.backgroundPreview);
+ p.fastUpload = j["fastUpload"].asBool(p.fastUpload);
+ p.fastBigBrushes = j["fastBigBrushes"].asBool(p.fastBigBrushes);
p.dyntopoConstantDetail = j["dyntopoConstantDetail"].asBool(p.dyntopoConstantDetail);
p.flatShading = j["flatShading"].asBool(p.flatShading);
p.viewportCursor = std::clamp(int(j["viewportCursor"].asNumber(p.viewportCursor)), 0, 1);
diff --cc src/app/Config.h
index ff0f185e,13ec5b1e..2349257b
--- a/src/app/Config.h
+++ b/src/app/Config.h
@@@ -102,13 -100,11 +102,18 @@@ struct UiPrefs
// bounds of what they touched are worked out once, when the pen lifts (Sculptor::draftStrokes). Off by
// default; meant for laptops and battery (a hardware tier will turn it on).
bool draftStrokes = false;
+ // Experimental (docs/design/perf-moonshots.md), off by default. Live Move: the GPU draws a Move drag and the
+ // move is applied once when the pen lifts (SF_LIVE_MOVE=0 / 1 overrides). Background Preview: heavy meshes'
+ // background dabs draw the predictive preview too (SF_BG_GHOST=0 / 1 overrides). Fast Upload: stroke uploads
+ // go through persistently mapped staging buffers and a GPU copy (SF_PERSISTENT_UPLOAD=0 / 1 overrides).
+ bool liveMove = false;
+ bool backgroundPreview = false;
+ bool fastUpload = false;
+ // Fast big brushes (Sculptor::adaptiveDabs, core/SculptBatch.cpp): a big brush's dabs take their plane from a
+ // sample of the region, carry the normals along with the move (the exact ones follow), and the dabs waiting
+ // for a frame go through the vertices together. The result matches the dab-by-dab stroke to within about 2% of
+ // how far it moved the surface (tests/test_beta_boost.cpp). On by default.
+ bool fastBigBrushes = true;
// Dynamic topology (Draw palette): false = the detail follows the brush size on screen (Sculptris Pro);
// true = one detail size for the whole mesh.
bool dyntopoConstantDetail = false;
diff --cc src/app/PanelPerformance.cpp
index 9de442a3,32a87442..f7cab45b
--- a/src/app/PanelPerformance.cpp
+++ b/src/app/PanelPerformance.cpp
@@@ -205,15 -188,9 +216,18 @@@ void App::drawPerformanceSection()
bool draft = uiPrefs_.draftStrokes;
if (ImGui::Checkbox(tr("Draft Strokes"), &draft)) actions_.find("perf.draft_strokes")->run();
ui::HelpAction(*this, "perf.draft_strokes");
+ bool fastBig = uiPrefs_.fastBigBrushes;
+ if (ImGui::Checkbox(tr("Fast Big Brushes"), &fastBig)) actions_.find("perf.fast_big_brushes")->run();
+ ui::HelpAction(*this, "perf.fast_big_brushes");
+ bool liveMove = uiPrefs_.liveMove;
+ if (ImGui::Checkbox(tr("Live Move (Experimental)"), &liveMove)) actions_.find("perf.live_move")->run();
+ ui::HelpAction(*this, "perf.live_move");
+ bool bgPreview = uiPrefs_.backgroundPreview;
+ if (ImGui::Checkbox(tr("Background Preview (Experimental)"), &bgPreview)) actions_.find("perf.background_preview")->run();
+ ui::HelpAction(*this, "perf.background_preview");
+ bool fastUpload = uiPrefs_.fastUpload;
+ if (ImGui::Checkbox(tr("Fast Upload (Experimental)"), &fastUpload)) actions_.find("perf.fast_upload")->run();
+ ui::HelpAction(*this, "perf.fast_upload");
// --- Threads ---
bool threads = !ThreadPool::shared().serial();
diff --cc src/render/Renderer.cpp
index 4f8df250,4ebb73bd..2b501123
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@@ -2719,7 -2707,27 +2719,27 @@@ void Renderer::endCapture(std::vector<u
void Renderer::draw(const Camera& camera, int targetWidth, int targetHeight, const RenderSettings& settings,
const Viewport& viewport) {
+ // SF_FRAME_LOG=ms (App.cpp): a draw slower than that says where its time went.
+ static const double drawLogMs = std::getenv("SF_FRAME_LOG") ? std::atof(std::getenv("SF_FRAME_LOG")) : -1.0;
+ const auto drawStart = std::chrono::steady_clock::now();
+ double drawMarks[4] = {};
+ const auto drawMark = [&](int i) {
+ if (drawLogMs >= 0.0) drawMarks[i] = std::chrono::duration<double, std::milli>(std::chrono::steady_clock::now() - drawStart).count();
+ };
+ struct DrawLog {
+ const double& limit;
+ const double* marks;
+ std::chrono::steady_clock::time_point start;
+ ~DrawLog() {
+ if (limit < 0.0) return;
+ const double total = std::chrono::duration<double, std::milli>(std::chrono::steady_clock::now() - start).count();
+ if (total > limit)
- SDL_Log("draw %.1f ms: matcaps %.1f, environment %.1f, Parts %.1f, the rest %.1f", total, marks[0],
++ SDL_Log("draw %.1f ms: lit spheres %.1f, environment %.1f, Parts %.1f, the rest %.1f", total, marks[0],
+ marks[1] - marks[0], marks[2] - marks[1], total - marks[2]);
+ }
+ } drawLog{drawLogMs, drawMarks, drawStart};
syncMatcaps();
+ drawMark(0);
forceBackfaces_ = settings.backfaceCulling && !thumbnailPass_; // (#68; thumbnails show the whole Part)
// Known state before the clears: a scissor box, colour mask or depth mask left over from another pass (UI,
// overlays, calibration) makes glClear partial. Some drivers (NVIDIA on Windows, #29) then show old frames