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.

Perf news: one-time big-mesh tip, What's New clips (frame sheet in the app, video on the site), 0.11.1 perf card

islandmed8847dd848738
diff --git a/changes/feat-perf-news.md b/changes/feat-perf-news.md
new file mode 100644
index 00000000..ccb540a3
--- /dev/null
+++ b/changes/feat-perf-news.md
@@ -0,0 +1,16 @@
+---
+whats_new: **Big meshes are faster: a one-time tip**: the first time you open a scene over about 20 million
+ triangles, a note along the bottom of the view says what got faster and names the two settings that help most
+ on big meshes (**Preferences > Performance > Background Preview** and **View resolution**), with a button that
+ opens them. It shows once and never again.
+added: **Big-mesh tip**: shown once, the first time a scene holds more than about 20 million triangles (micro levels
+ counted): what got faster on dense meshes and the settings that matter (Background Preview, View resolution),
+ with **Performance settings** and **Got it**. Never during a stroke, a benchmark, the welcome, What's New or the
+ quick tour; stored in project.json as soon as it shows, so it never comes back.
+added: **What's New clips**: a feature card can play a short clip (the website's video, the app's frame sheet).
+testers:
+ - Any OS: open a 20M+ triangle project (or Lucy 112M): the note "Big meshes are faster now" shows at the bottom;
+ **Performance settings** opens Preferences > Performance. Restart and open it again: no note.
+ - Any OS: Help > What's New after updating to 0.11.1: the first card plays the side-by-side Lucy clip in a loop.
+---
+Numbers in the card, the site and Discord come only from the 3060 rows in perf-scoreboard REPORT.md (core200m).
diff --git a/docs/guide/whats-new.md b/docs/guide/whats-new.md
index ce6b1142..ee12bb64 100644
--- a/docs/guide/whats-new.md
+++ b/docs/guide/whats-new.md
@@ -5,6 +5,20 @@ shows its main features, each with a **Try it** button; **Help > What's New** op
three versions in full, then the older ones in groups. Every detail is in the
[changelog](https://github.com/islandmed/SculptForge/blob/main/CHANGELOG.md).
+## Version 0.11.1
+
+```features
+date: unreleased
+tagline: Dense scans with micro levels keep up with the pen, and one-click updates on Windows and Linux.
+highlight: Dense scans keep up: orbit after a big stroke on a 112M scan, under 1 to 47 fps
+title: Dense scans, fast
+line: Lucy 112M on an RTX 3060: orbit right after a big stroke, under 1 to 47 frames a second.
+image: images/wn-0111-lucy.jpg
+clip: images/wn-0111-lucy.mp4
+frames: images/wn-0111-lucy-frames.jpg 6x10 6
+action: guide:performance.md#working-with-big-meshes
+```
+
## Version 0.11.0
```features
diff --git a/src/app/App.h b/src/app/App.h
index d65088b4..35a1298a 100644
--- a/src/app/App.h
+++ b/src/app/App.h
@@ -455,6 +455,12 @@ private:
double sculptSeconds_ = 0.0; // cumulative time in strokes (project.json)
bool supportReminderDone_ = false; // the reminder was shown (or turned off) once: never again (project.json)
bool supportReminderOpen_ = false;
+ // The one big-mesh tip (BigMeshTip.h): the first scene over ~20M triangles; shown once, never again (project.json).
+ bool bigMeshTipDone_ = false;
+ bool bigMeshTipOpen_ = false;
+ size_t sceneTrianglesWithMicro() const; // visible base triangles, micro levels counted in full
+ void openPerformancePrefs(); // Preferences > Performance, opened and flashed
+ void tickBigMeshTip(); // every frame (drawSupportUi): shows the tip when due
int discordRequests_ = 0; // UI tests: how often the Discord invite was asked for
int supportPageRequests_ = 0; // UI tests: how often the page was asked for (only opened when interactive)
// The support card at launch (PanelSupportCard.cpp): decided once while starting, never mid-session.
diff --git a/src/app/BigMeshTip.h b/src/app/BigMeshTip.h
new file mode 100644
index 00000000..4e781543
--- /dev/null
+++ b/src/app/BigMeshTip.h
@@ -0,0 +1,31 @@
+// SculptForge - open source digital sculpting
+// SPDX-License-Identifier: GPL-3.0-or-later
+//
+// The one big-mesh tip (PanelSupport.cpp draws it, PanelProject.cpp decides): the first time the scene holds more
+// than about 20 million triangles (base meshes plus micro levels), a quiet note along the bottom of the view says
+// dense meshes got faster and names the settings that matter for them. Shown once per install, never again after
+// (project.json "big_mesh_tip_done", written the moment it shows).
+#pragma once
+
+#include <cstddef>
+#include <cstdlib>
+
+namespace sf {
+
+inline constexpr size_t kBigMeshTipTriangles = 20'000'000;
+
+// The threshold: kBigMeshTipTriangles, or SF_BIG_MESH_TIP_TRIANGLES (UI tests use a small sphere).
+inline size_t bigMeshTipTriangles() {
+ const char* env = std::getenv("SF_BIG_MESH_TIP_TRIANGLES");
+ if (!env || !*env) return kBigMeshTipTriangles;
+ const long long v = std::atoll(env);
+ return v > 0 ? size_t(v) : kBigMeshTipTriangles;
+}
+
+// Whether the tip shows now: a scene over the threshold, never shown before, and nothing else on screen or in hand
+// (a stroke, the welcome, What's New, the membership card, the quick tour, a benchmark): it waits for those.
+inline bool bigMeshTipDue(size_t sceneTriangles, size_t threshold, bool alreadyShown, bool busy) {
+ return !alreadyShown && !busy && threshold > 0 && sceneTriangles >= threshold;
+}
+
+} // namespace sf
diff --git a/src/app/PanelPerformance.cpp b/src/app/PanelPerformance.cpp
index 8da40152..d97e04c5 100644
--- a/src/app/PanelPerformance.cpp
+++ b/src/app/PanelPerformance.cpp
@@ -9,9 +9,13 @@
#include "app/I18n.h"
#include "core/Benchmark.h"
+#include "core/Micro.h"
#include "core/HardwareProfile.h"
#include "core/ThreadPool.h"
+#include <imgui.h>
+
+#include <algorithm>
#include <chrono>
#include <cstdio>
#include <cstdlib>
@@ -152,6 +156,28 @@ void App::registerPerformanceUiActions() {
registerPerformanceProfileUiActions(); // Re-calibrate, the frame governor (PanelPerformanceProfile.cpp)
}
+size_t App::sceneTrianglesWithMicro() const {
+ size_t triangles = 0;
+ for (int i = 0; i < doc_.partCount(); ++i)
+ if (doc_.parts[size_t(i)].visible) {
+ const Mesh& m = doc_.partMesh(i);
+ const size_t micro = microTriangleCount(m);
+ triangles += micro ? micro : m.triangleCount();
+ }
+ return triangles;
+}
+
+void App::openPerformancePrefs() {
+ auto& open = layout_.openSubpalettes;
+ if (uiPrefs_.oneSubpalette) // as a click on its header would: the other Preferences sections close
+ open.erase(std::remove_if(open.begin(), open.end(), [](const std::string& o) { return o.rfind("preferences.", 0) == 0; }),
+ open.end());
+ if (std::find(open.begin(), open.end(), "preferences.performance") == open.end()) open.push_back("preferences.performance");
+ flashSubpalette_ = "preferences.performance";
+ flashSubpaletteStart_ = ImGui::GetTime();
+ if (const Action* a = actions_.find("ui.palette.preferences"); a && a->run) a->run();
+}
+
void App::applyPerformancePrefs() { ThreadPool::shared().setSerial(!uiPrefs_.multithreading); }
int App::viewSamples() {
diff --git a/src/app/PanelProject.cpp b/src/app/PanelProject.cpp
index 62a55c33..92e72431 100644
--- a/src/app/PanelProject.cpp
+++ b/src/app/PanelProject.cpp
@@ -7,6 +7,7 @@
// sessions; --render, --record and demos run straight through.
#include "app/App.h"
#include "app/Support.h"
+#include "app/BigMeshTip.h"
#include "app/LookSchemes.h"
#include "app/CrashLog.h"
#include "core/LegacyNames.h"
@@ -114,6 +115,7 @@ void App::initProject() {
updateChannel_ = prefs["update_channel"].asString() == "preview" ? UpdateChannel::Preview : UpdateChannel::Stable;
sculptSeconds_ = addSculptTime(prefs["sculpt_seconds"].asNumber(0.0), 0.0);
supportReminderDone_ = prefs["support_reminder_done"].asBool(false);
+ bigMeshTipDone_ = prefs["big_mesh_tip_done"].asBool(false);
supportCardPrefs_.enabled = prefs["support_card"].asBool(true);
supportCardPrefs_.supporter = prefs["supporter"].asBool(false);
supportCardPrefs_.shownAt = int64_t(prefs["support_card_shown_at"].asNumber(0));
@@ -197,6 +199,7 @@ void App::saveProjectPrefs() {
if (memberBuilds_ && !memberSessionOnly_ && !memberLogin_.empty()) prefs.set("member_login", memberLogin_);
prefs.set("sculpt_seconds", std::floor(sculptSeconds_)); // for the one support reminder (Support.h); stays here
prefs.set("support_reminder_done", supportReminderDone_);
+ prefs.set("big_mesh_tip_done", bigMeshTipDone_); // the one big-mesh tip (BigMeshTip.h)
prefs.set("support_card", supportCardPrefs_.enabled); // the support card at launch (Support.h)
prefs.set("supporter", supportCardPrefs_.supporter);
prefs.set("support_card_shown_at", double(supportCardPrefs_.shownAt));
@@ -226,6 +229,25 @@ void App::rememberRecent(const std::string& path) {
saveProjectPrefs();
}
+void App::tickBigMeshTip() {
+ // Not in renders, recordings, demos or benchmarks; UI tests (a demo script) only when they set the threshold
+ // (tests/ui/big_mesh_tip.sfui), so it never sits over another test's clicks.
+ const char* testThreshold = std::getenv("SF_BIG_MESH_TIP_TRIANGLES");
+ const bool uiTest = !options_.uiTest.empty();
+ if (!options_.renderPath.empty() || !options_.recordPath.empty() || (demo_ && !uiTest) ||
+ (uiTest && !(testThreshold && *testThreshold)) || options_.benchmark || proof_)
+ return;
+ // It waits for a quiet moment (no stroke, no card, tour or reminder), then shows once.
+ const bool busy = doc_.sculptor.strokeActive() || showWelcome_ || showWhatsNew_ || whatsNewOpen() || supportCardOpen() ||
+ quickTourOpen_ || supportReminderOpen_;
+ if (bigMeshTipDue(sceneTrianglesWithMicro(), bigMeshTipTriangles(), bigMeshTipDone_, busy)) {
+ bigMeshTipDone_ = true; // once only, written now: a crash or a forced quit doesn't bring it back
+ bigMeshTipOpen_ = true;
+ saveProjectPrefs();
+ redrawAt_ = double(SDL_GetTicksNS()) * 1e-9; // (a frame to show it, asleep or not)
+ }
+}
+
void App::tickProject(float dt) {
updateTitle();
if (!interactive() || prefDir_.empty()) return;
diff --git a/src/app/PanelSupport.cpp b/src/app/PanelSupport.cpp
index 3d1f7bcf..0438aeff 100644
--- a/src/app/PanelSupport.cpp
+++ b/src/app/PanelSupport.cpp
@@ -144,6 +144,7 @@ void App::drawLookPicker() {
}
void App::drawSupportUi() {
+ tickBigMeshTip(); // (here, not in tickProject: this runs every frame, UI tests included)
const float s = uiScale_;
const CanvasRect c = canvasRect();
if (showWelcome_) {
@@ -281,6 +282,34 @@ void App::drawSupportUi() {
ImGui::End();
if (!open) chooseNewLook(false);
}
+ if (bigMeshTipOpen_ && !showWelcome_ && !supportCardOpen() && !whatsNew_ && !quickTourOpen_) {
+ // The one big-mesh tip (BigMeshTip.h): a note along the bottom of the canvas, no focus taken, shown once.
+ ImGui::SetNextWindowPos(ImVec2(c.x + c.w * 0.5f, c.y + c.h - 12.0f * s), ImGuiCond_Always, ImVec2(0.5f, 1.0f));
+ ImGui::SetNextWindowSize(ImVec2(std::min(500.0f * s, c.w - 32.0f * s), 0.0f), ImGuiCond_Always);
+ ImGui::SetNextWindowBgAlpha(0.96f);
+ const ImGuiWindowFlags flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoResize |
+ ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav;
+ bool open = true;
+ if (ImGui::Begin("Big meshes are faster now##bigmesh", &open, flags)) {
+ ImGui::TextWrapped("On a dense scan with micro levels, big brushes now keep up with the pen and the view turns "
+ "smoothly right after a stroke.");
+ ImGui::Spacing();
+ ImGui::TextWrapped("Two settings in Preferences > Performance help most on big meshes:");
+ ImGui::Bullet();
+ ImGui::TextWrapped("Background Preview (experimental): a big brush shows under the pen while it's still being worked out.");
+ ImGui::Bullet();
+ ImGui::TextWrapped("View resolution 75%%: draws about half the pixels, for integrated graphics and big screens.");
+ ImGui::Spacing();
+ if (ImGui::Button("Performance settings##bigmesh")) {
+ openPerformancePrefs();
+ open = false;
+ }
+ ImGui::SameLine();
+ if (ImGui::Button("Got it##bigmesh")) open = false;
+ }
+ ImGui::End();
+ if (!open) bigMeshTipOpen_ = false;
+ }
if (supportReminderOpen_) {
// The one reminder: a small note along the bottom of the canvas, no focus taken, closed for good by any button.
ImGui::SetNextWindowPos(ImVec2(c.x + c.w * 0.5f, c.y + c.h - 12.0f * s), ImGuiCond_Always, ImVec2(0.5f, 1.0f));
diff --git a/src/app/UiTest.cpp b/src/app/UiTest.cpp
index 9febcd45..a8d65995 100644
--- a/src/app/UiTest.cpp
+++ b/src/app/UiTest.cpp
@@ -746,6 +746,13 @@ double Demo::query(const std::string& name, bool& known) const {
if (name == "dropdown_open") return app_.dropdown_.empty() ? 0.0 : 1.0;
if (name == "new_look_card_open") return app_.newLookCard_ ? 1.0 : 0.0; // "SculptForge has a new look" (0.10.7)
if (name == "support_card_open") return app_.supportCardOpen() ? 1.0 : 0.0; // the support card at launch
+ // The one big-mesh tip (BigMeshTip.h): open now, shown once (project.json), Preferences > Performance open.
+ if (name == "big_mesh_tip_open") return app_.bigMeshTipOpen_ ? 1.0 : 0.0;
+ if (name == "big_mesh_tip_done") return app_.bigMeshTipDone_ ? 1.0 : 0.0;
+ if (name == "performance_prefs_open") {
+ const auto& open = app_.layout_.openSubpalettes;
+ return std::find(open.begin(), open.end(), "preferences.performance") != open.end() ? 1.0 : 0.0;
+ }
// What's New (WhatsNewPopup.cpp): open (1 while shown), its cards, Try it clicks; the guide chapter's contents
// entries (versions in full, then groups) and its open sections.
if (name == "whats_new_open") return app_.whatsNewOpen() ? 1.0 : 0.0;
diff --git a/src/app/WhatsNewPopup.cpp b/src/app/WhatsNewPopup.cpp
index dc58f9d9..8b8b9f3a 100644
--- a/src/app/WhatsNewPopup.cpp
+++ b/src/app/WhatsNewPopup.cpp
@@ -307,7 +307,22 @@ void App::drawWhatsNew() {
};
auto picture = [&](const whatsnew::Card& c, ImVec2 p0, ImVec2 p1, ImDrawFlags corners, float appear) {
ImVec2 texSize;
- const ImTextureID tex = c.image.empty() ? ImTextureID(0) : guide_.image(c.image, &texSize);
+ // A clip (frames:): one picture of COLS x ROWS frames, played in a loop while the window is open.
+ ImTextureID tex = c.frames.empty() ? ImTextureID(0) : guide_.image(c.frames, &texSize);
+ if (tex) {
+ const int count = c.frameCols * c.frameRows;
+ const int frame = int((nowSeconds() - pop.openedAt) * c.frameFps) % count;
+ const ImVec2 cell(1.0f / float(c.frameCols), 1.0f / float(c.frameRows));
+ const ImVec2 f0(float(frame % c.frameCols) * cell.x, float(frame / c.frameCols) * cell.y);
+ ImVec2 uv0, uv1;
+ coverUv(texSize.x * cell.x / std::max(1.0f, texSize.y * cell.y), (p1.x - p0.x) / std::max(1.0f, p1.y - p0.y), uv0, uv1);
+ uv0 = ImVec2(f0.x + uv0.x * cell.x, f0.y + uv0.y * cell.y);
+ uv1 = ImVec2(f0.x + uv1.x * cell.x, f0.y + uv1.y * cell.y);
+ dl->AddImageRounded(tex, p0, p1, uv0, uv1, col(0xffffff, appear), 12.0f * k, corners);
+ redrawIn(1.0 / double(c.frameFps));
+ return;
+ }
+ tex = c.image.empty() ? ImTextureID(0) : guide_.image(c.image, &texSize);
if (!tex) { // no picture: a quiet tile with the cube mark
dl->AddRectFilled(p0, p1, tc(raised, appear), 12.0f * k, corners);
const float m = std::min(p1.x - p0.x, p1.y - p0.y) * 0.3f;
diff --git a/src/core/WhatsNew.cpp b/src/core/WhatsNew.cpp
index 90309135..382dbd0c 100644
--- a/src/core/WhatsNew.cpp
+++ b/src/core/WhatsNew.cpp
@@ -4,6 +4,7 @@
#include <algorithm>
#include <cstdlib>
+#include <sstream>
namespace sf::whatsnew {
@@ -49,6 +50,24 @@ std::pair<std::string, std::string> splitHighlight(std::string_view h) {
return {std::string(trim(h.substr(0, colon))), std::string(trim(h.substr(colon + 1)))};
}
+bool parseFrames(std::string_view value, Card& c) {
+ std::istringstream in{std::string(value)};
+ std::string path, grid;
+ int fps = 0;
+ if (!(in >> path >> grid >> fps) || fps < 1 || fps > 30) return false;
+ std::string rest;
+ if (in >> rest) return false;
+ const size_t x = grid.find('x');
+ if (x == std::string::npos) return false;
+ const int cols = std::atoi(grid.substr(0, x).c_str()), rows = std::atoi(grid.substr(x + 1).c_str());
+ if (cols < 1 || rows < 1 || cols * rows < 2 || cols > 32 || rows > 32) return false;
+ c.frames = path;
+ c.frameCols = cols;
+ c.frameRows = rows;
+ c.frameFps = fps;
+ return true;
+}
+
bool parseFeatures(std::string_view text, Version& v, std::string& error) {
size_t lineNo = 0;
while (!text.empty()) {
@@ -68,6 +87,20 @@ bool parseFeatures(std::string_view text, Version& v, std::string& error) {
v.cards.push_back({value, "", "", "", ""});
continue;
}
+ if (key == "clip" || key == "frames") {
+ if (v.cards.empty()) {
+ error = "line " + std::to_string(lineNo) + ": '" + std::string(key) + "' before the card's 'title'";
+ return false;
+ }
+ Card& c = v.cards.back();
+ if (key == "clip") {
+ c.clip = value;
+ } else if (!parseFrames(value, c)) {
+ error = "line " + std::to_string(lineNo) + ": frames wants 'path COLSxROWS FPS'";
+ return false;
+ }
+ continue;
+ }
if (key == "line" || key == "image" || key == "action" || key == "link") {
if (v.cards.empty()) {
error = "line " + std::to_string(lineNo) + ": '" + std::string(key) + "' before the card's 'title'";
diff --git a/src/core/WhatsNew.h b/src/core/WhatsNew.h
index 955e5055..63d0aeef 100644
--- a/src/core/WhatsNew.h
+++ b/src/core/WhatsNew.h
@@ -12,6 +12,9 @@
// image: images/wn-0107-look.jpg (600x340)
// action: look:new (what Try it does; see App::runWhatsNewAction)
// link: interface.md#looks-and-layouts (optional: where the website's card links; guide: actions link there anyway)
+// clip: images/wn-0111-lucy.mp4 (optional: the website plays it in the card, the image as its poster)
+// frames: images/wn-0111-lucy-frames.jpg 8x6 5 (optional: the app plays the same clip from one picture of
+// 8 x 6 frames, left to right then down, at 5 frames a second)
// ```
//
// and the prose notes below it are the details. The popup (app/WhatsNewPopup.cpp), the guide chapter
@@ -34,8 +37,14 @@ inline constexpr int kMaxHighlights = 6; // one-line highlights per group
struct Card {
std::string title, line, image, action, link;
+ std::string clip; // the website's video
+ std::string frames; // the app's frame sheet (empty: the still image)
+ int frameCols = 0, frameRows = 0, frameFps = 0;
};
+// "images/x.jpg 8x6 5" into C's frames, frameCols, frameRows, frameFps; false on anything else.
+bool parseFrames(std::string_view value, Card& c);
+
struct Version {
std::string version; // "0.10.7"
std::string anchor; // the heading's anchor, "version-0107"
diff --git a/tests/test_big_mesh_tip.cpp b/tests/test_big_mesh_tip.cpp
new file mode 100644
index 00000000..76cecefd
--- /dev/null
+++ b/tests/test_big_mesh_tip.cpp
@@ -0,0 +1,19 @@
+// SculptForge - open source digital sculpting
+// SPDX-License-Identifier: GPL-3.0-or-later
+//
+// The one big-mesh tip (app/BigMeshTip.h): when it shows, and that it shows once.
+#include "TestHarness.h"
+
+#include "app/BigMeshTip.h"
+
+using namespace sf;
+
+TEST(big_mesh_tip_due_once_over_the_threshold_when_quiet) {
+ const size_t t = kBigMeshTipTriangles;
+ CHECK(!bigMeshTipDue(t - 1, t, false, false)); // under ~20M: never
+ CHECK(bigMeshTipDue(t, t, false, false)); // the first scene over it
+ CHECK(bigMeshTipDue(450'000'000, t, false, false));
+ CHECK(!bigMeshTipDue(t, t, true, false)); // once only (shown or dismissed)
+ CHECK(!bigMeshTipDue(t, t, false, true)); // waits while a stroke, a card, the tour or a benchmark is on
+ CHECK(!bigMeshTipDue(t, 0, false, false)); // (a zero threshold never fires)
+}
diff --git a/tests/test_guide.cpp b/tests/test_guide.cpp
index e47e23f1..ce43c0b2 100644
--- a/tests/test_guide.cpp
+++ b/tests/test_guide.cpp
@@ -207,6 +207,19 @@ TEST(guide_whats_new_features) {
CHECK(!whatsnew::parseFeatures("line: before any title\n", bad, err) && err.find("title") != std::string::npos);
CHECK(!whatsnew::parseFeatures("colour: red\n", bad, err) && err.find("unknown key") != std::string::npos);
CHECK(!whatsnew::parseFeatures("title: No action\nline: x\n", bad, err));
+ // A clip: the website's video and the app's frame sheet (COLSxROWS frames at FPS).
+ whatsnew::Version clip;
+ CHECK(whatsnew::parseFeatures("title: Faster\nline: x\nimage: images/a.jpg\naction: help.benchmark\n"
+ "clip: images/a.mp4\nframes: images/a-frames.jpg 8x6 5\n",
+ clip, err));
+ CHECK(clip.cards.size() == 1 && clip.cards[0].clip == "images/a.mp4" && clip.cards[0].frames == "images/a-frames.jpg");
+ CHECK(clip.cards.size() == 1 && clip.cards[0].frameCols == 8 && clip.cards[0].frameRows == 6 && clip.cards[0].frameFps == 5);
+ for (const char* f : {"frames: a.jpg\n", "frames: a.jpg 8x6\n", "frames: a.jpg 1x1 5\n", "frames: a.jpg 8x6 0\n",
+ "frames: a.jpg 8by6 5\n", "frames: a.jpg 8x6 5 extra\n"}) {
+ whatsnew::Version w;
+ CHECK(!whatsnew::parseFeatures(std::string("title: T\nline: x\naction: a\n") + f, w, err));
+ }
+ CHECK(!whatsnew::parseFeatures("clip: before.mp4\n", bad, err) && err.find("title") != std::string::npos);
CHECK(whatsnew::splitHighlight("Micro levels: a billion triangles") == std::make_pair(std::string("Micro levels"), std::string("a billion triangles")));
CHECK(whatsnew::compareVersions("0.9.7", "0.10.0") < 0 && whatsnew::compareVersions("0.8", "0.8.0") == 0);
}
diff --git a/tests/ui/big_mesh_tip.sfui b/tests/ui/big_mesh_tip.sfui
new file mode 100644
index 00000000..e102d955
--- /dev/null
+++ b/tests/ui/big_mesh_tip.sfui
@@ -0,0 +1,32 @@
+# The one big-mesh tip (app/BigMeshTip.h): the first scene over ~20M triangles shows a note that dense meshes got
+# faster, with the settings that matter; dismissed, it never comes back. A small threshold stands in for 20M here.
+env SF_BIG_MESH_TIP_TRIANGLES 10000
+run ui_look look=classic layout=classic
+run new_sphere subdivisions=2
+wait 0.3
+expect_value triangles < 10000
+expect_value big_mesh_tip_open == 0
+expect_value big_mesh_tip_done == 0
+
+# Over the threshold: the tip shows (once, written to project.json at once).
+run new_sphere subdivisions=5
+wait 0.3
+expect_value triangles >= 10000
+expect_value big_mesh_tip_open == 1
+expect_value big_mesh_tip_done == 1
+expect_text "Big meshes are faster now"
+expect_text "Background Preview"
+shot big_mesh_tip
+
+# Performance settings opens Preferences > Performance and closes the tip.
+click "Performance settings##bigmesh"
+wait 0.3
+expect_value big_mesh_tip_open == 0
+expect_value performance_prefs_open == 1
+shot big_mesh_tip_prefs
+
+# Never again: another big mesh, no tip.
+run new_sphere subdivisions=2
+run new_sphere subdivisions=5
+wait 0.3
+expect_value big_mesh_tip_open == 0
diff --git a/tools/guide/build_site.py b/tools/guide/build_site.py
index 94386ae3..4e6da001 100644
--- a/tools/guide/build_site.py
+++ b/tools/guide/build_site.py
@@ -415,7 +415,7 @@ def image_size(path: pathlib.Path):
WHATS_NEW = "whats-new.md"
WN_DETAILED, WN_SERIES_GROUPS, WN_MAX_HIGHLIGHTS = 3, 2, 6
-WN_KEYS = {"date", "tagline", "highlight", "title", "line", "image", "action", "link"}
+WN_KEYS = {"date", "tagline", "highlight", "title", "line", "image", "action", "link", "clip", "frames"}
def version_parts(v: str) -> list:
@@ -457,10 +457,12 @@ def parse_features(text: str) -> dict:
if not sep or key not in WN_KEYS:
raise ValueError(f"line {k}: " + (f"unknown key '{key}'" if sep else "expected 'key: value'"))
if key == "title":
- v["cards"].append({"title": value, "line": "", "image": "", "action": "", "link": ""})
- elif key in ("line", "image", "action", "link"):
+ v["cards"].append({"title": value, "line": "", "image": "", "action": "", "link": "", "clip": "", "frames": ""})
+ elif key in ("line", "image", "action", "link", "clip", "frames"):
if not v["cards"]:
raise ValueError(f"line {k}: '{key}' before the card's 'title'")
+ if key == "frames" and not re.fullmatch(r"\S+ \d{1,2}x\d{1,2} \d{1,2}", value):
+ raise ValueError(f"line {k}: frames wants 'path COLSxROWS FPS'")
v["cards"][-1][key] = value
elif key == "highlight":
v["highlights"].append(value)
@@ -560,7 +562,9 @@ class WhatsNewPage(Page):
super().__init__(name, plain)
self.chars = text
# Every card picture, also those of a version not released yet (it ships with the next one).
+ # Clips too: the video the website plays, and the frame sheet the app plays (shipped with the guide).
self.images += [src for src in re.findall(r"^image:\s*(\S+)\s*$", text, re.M) if src not in self.images]
+ self.images += [src for src in re.findall(r"^(?:clip|frames):\s*(\S+)", text, re.M) if src not in self.images]
for v in self.versions:
for c in v["cards"]:
if c.get("link"):
@@ -584,6 +588,9 @@ class WhatsNewPage(Page):
size = image_size(SRC / c["image"])
dims = f' width="{size[0]}" height="{size[1]}"' if size else ""
img = (f'<img src="{html.escape(c["image"])}" alt=""{dims} loading="lazy" decoding="async">')
+ if c.get("clip"): # the clip plays in place of the picture, which stays as its poster
+ img = (f'<video src="{html.escape(c["clip"])}" poster="{html.escape(c["image"])}"{dims} muted '
+ f'loop playsinline autoplay preload="none"></video>')
href = card_link(c)
more = (f'<a class="wn-more" href="{html.escape(href)}">'
f'{"Read more" if c["action"].startswith("guide:") else "How it works"}'
@@ -649,10 +656,14 @@ def home_whats_new(page: "WhatsNewPage") -> str:
out.append(' <div class="wn-home">')
for v in vs:
titles = [split_highlight(h)[0] for h in v["highlights"] if split_highlight(h)[0]] or [c["title"] for c in v["cards"]]
- pic = next((c["image"] for c in v["cards"] if c["image"]), "")
+ first = next((c for c in v["cards"] if c["image"]), None)
+ pic, clip = (first["image"], first.get("clip", "")) if first else ("", "")
img = (f'<div class="wn-pic"><img src="guide/{html.escape(pic)}" alt="" width="600" height="340" loading="lazy" '
f'decoding="async"></div>') if pic else \
'<div class="wn-pic wn-pic-mark"><img src="img/logo.svg?v=2" alt="" width="64" height="64"></div>'
+ if clip: # the first card's clip plays on the home page too, its picture as the poster
+ img = (f'<div class="wn-pic"><video src="guide/{html.escape(clip)}" poster="guide/{html.escape(pic)}" width="600" '
+ f'height="340" muted loop playsinline autoplay></video></div>')
items = "".join(f"<li>{inline(c['title'], [])}</li>" for c in v["cards"]) or \
"".join(f"<li>{inline(r[:1].upper() + r[1:], [])}</li>" for _, r in map(split_highlight, v["highlights"]))
out.append(f' <article class="wn-home-card"><a href="guide/whats-new.html#{v["anchor"]}">{img}'
diff --git a/website/style.css b/website/style.css
index 05c4005b..e086ec7f 100644
--- a/website/style.css
+++ b/website/style.css
@@ -551,7 +551,7 @@ kbd { display: inline-block; min-width: 1.5em; padding: 0.05em 0.45em; border: 1
background: linear-gradient(180deg, #202027, var(--panel)); transition: border-color 0.2s, transform 0.2s; }
.wn-card:hover { border-color: rgba(242, 140, 60, 0.55); transform: translateY(-2px); }
.wn-pic { aspect-ratio: 600 / 340; background: #24242b; overflow: hidden; }
-.wn-pic img { width: 100%; height: 100%; object-fit: cover; }
+.wn-pic img, .wn-pic video { display: block; width: 100%; height: 100%; object-fit: cover; }
.wn-card-body { display: flex; flex-direction: column; flex: 1; padding: 14px 16px 16px; }
.guide-article .wn-card h3 { margin: 0 0 0.3em; font-size: 1.02rem; color: #fff; }
.guide-article .wn-card p { margin: 0 0 0.8em; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }