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.

Kelvinlet vertex budget from the hardware tier (a third of currentTierConfig().activeTriangleBudget) instead of 600k

islandmed0d8eff8f5403
diff --git a/src/core/Kelvinlet.cpp b/src/core/Kelvinlet.cpp
index 52dc5931..17629cfe 100644
--- a/src/core/Kelvinlet.cpp
+++ b/src/core/Kelvinlet.cpp
@@ -7,6 +7,7 @@
#include "core/Commands.h"
#include "core/Sculpt.h"
#include "core/ThreadPool.h"
+#include "core/TierConfig.h"
#include "core/Vdm.h"
#include <algorithm>
@@ -20,6 +21,10 @@
namespace sf {
+size_t KelvinletSettings::budget() const {
+ return vertexBudget ? vertexBudget : std::max<size_t>(size_t(currentTierConfig().activeTriangleBudget / 3), 100000);
+}
+
float KelvinletSettings::poisson() const { return 0.49f * std::clamp(squash, 0.0f, 1.0f); }
// ---------------------------------------------------------------------------
@@ -441,7 +446,7 @@ void Sculptor::kelvinletSingle(Mesh& mesh, BVH& bvh, const KelvinletKernel& k, c
const float maxDist = 3.0f * s.radius;
float fraction = 0.04f;
float cut = k.cutoff(amount, std::max(fraction * amount * peak, 1e-7f * s.radius), maxDist);
- const size_t budget = std::max<size_t>(kelvinlet.vertexBudget, 1000);
+ const size_t budget = kelvinlet.budget();
if (kelvinLastVerts_ > 0 && kelvinLastCut_ > 0.0f) {
const float reach = cut + 0.5f * glm::length(travel0), lastReach = kelvinLastCut_;
const double predicted = double(kelvinLastVerts_) * double(reach * reach) / double(lastReach * lastReach);
diff --git a/src/core/Kelvinlet.h b/src/core/Kelvinlet.h
index b9e82948..78eb8b0a 100644
--- a/src/core/Kelvinlet.h
+++ b/src/core/Kelvinlet.h
@@ -42,8 +42,10 @@ struct KelvinletSettings {
float cloneSpacing = 1.0f; // Detail Clone: stamp spacing along the stroke, in stamp widths (0.25..3)
bool cloneFollowStroke = true; // Detail Clone: the stamp's top turns with the stroke (else it keeps screen up)
// Dense meshes: a move whose region holds more vertices than this tightens its cutoff (4% -> up to 10% of the
- // peak) and the app gives it a smaller part of the move per frame. (A constant until the hardware profile sets it.)
- size_t vertexBudget = 600000;
+ // peak) and the app gives it a smaller part of the move per frame. 0 (the default): a third of the hardware
+ // tier's active triangle budget (core/TierConfig.h: about 670k on a laptop, 2.7M+ on a workstation).
+ size_t vertexBudget = 0;
+ size_t budget() const;
// Regions above this many vertices evaluate the far field on a coarse lattice and interpolate it.
size_t proxyMinVertices = 150000;
// Regions above this many vertices move only their near field (within the radius) at once and gather the far