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.
C++ 3d3d-sculptingcppdear-imguidigital-sculptingfbxgame-developmentgaussian-splattinggltfimage-to-3dmcpopenglopenusdsculptingtext-to-3dunreal-engine
Export Maps writes up to four maps at once; CHANGELOG [Unreleased]; measured memory and export times in the guide
islandmedee744345987e
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 067543ea..cdc7cd7e 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -6,6 +6,31 @@ All notable changes to SculptForge are listed here. The format follows## [Unreleased]+### Added+- Material painting (PBR): a painted texture can carry Roughness, Metallic, Normal, Height (16-bit), Ambient+ Occlusion, Emissive and Opacity besides its colour, all painted in the same strokes. Turn channels on in+ **Tool > Texture Map > Material Channels** (`texture_channels`); a channel costs no memory until it is painted+ (64x64 copy-on-write tiles; untouched tiles aren't stored). **Color > Material** sets what the brush lays on+ each channel (material swatches, per-channel value swatches and sliders; `paint_material`), and **C** picks the+ whole material under the cursor. Paint layers hold every channel: channel chips on each layer row turn a+ channel on or off for that layer, and give it its own blend mode and opacity, including **Normal Combine** for+ normals (`texture_layer_channel`). Height also yields a normal combined onto the Normal channel. One undo step+ per stroke, kept per layer and channel. Auto UV, Voxel Remesh, QRemesh and merging SubTools carry every channel.+ See the guide's Material painting page.+- Solo channel view: **Tool > Texture Map** shows one channel on the model (roughness and the other scalars in+ grey, the normal as colours, emission in colour), live while painting (`channel_view`).+- Export Maps with presets (`export_maps`): Unreal (`T_*_BC`, `T_*_N` in DirectX, `T_*_ORM`), Unity URP and HDRP+ (mask map), glTF, Godot, Blender (one file per channel) and USD, plus your own JSON presets (the guide's Export+ presets page). Height maps are 16-bit PNG.+- Model exports wire the channels into their materials: glTF metal-rough slots (packed occlusion / roughness /+ metallic, normal, emissive, alpha from opacity), UsdPreviewSurface inputs, the MTL PBR keys and FBX material+ maps. Send to Unreal imports `T_<Name>_BC / _N / _ORM` and builds an `M_<Name>` material from them.+- Preferences > Performance and `perf_info` show the memory of textures and their material channels.++### Changed+- Project format 7 stores material channels. It is written only when a texture has them: other projects are+ still saved as format 6, and every older project opens as before.+## [0.9.7] - 2026-10-31Speed first: big brushes on dense meshes take a third less time per frame, trail the pen by half as far and nodiff --git a/docs/guide/pbr-painting.md b/docs/guide/pbr-painting.mdindex a0f765a6..dd5ff561 100644--- a/docs/guide/pbr-painting.md+++ b/docs/guide/pbr-painting.md@@ -109,5 +109,8 @@ material channels is still saved as format 6, so older versions keep opening it.- Fill layers, generators (edge wear, dirt), mesh-map bakes as layer inputs, filters and material recipes areplanned; today the stack is paint layers.- One texture per SubTool (no UDIM tiles yet).-- Memory: a fully painted 8K channel set is large (see Performance); paint at 4K and export at 4K unless you need- 8K.+- Memory: colour, roughness, metallic, height and AO on Base plus three layers, each with a few big strokes,+ take about 370 MB at 4K and 1.5 GB at 8K (most of it the colour layers); a layer painted everywhere adds about+ 200 MB of channels at 4K and 800 MB at 8K. Preferences > Performance shows the numbers for your scene. Paint at+ 4K unless you need 8K.+- Export Maps takes a few seconds at 4K and about ten at 8K (PNG compression).diff --git a/src/app/PanelPbr.cpp b/src/app/PanelPbr.cppindex 0a52728f..54f62bc9 100644--- a/src/app/PanelPbr.cpp+++ b/src/app/PanelPbr.cpp@@ -25,6 +25,7 @@#include <cmath>#include <cstdio>#include <filesystem>+#include <iterator>#include <limits>#include <mutex>#include <string>diff --git a/src/core/MapExport.cpp b/src/core/MapExport.cppindex 76380cab..fe0e11bd 100644--- a/src/core/MapExport.cpp+++ b/src/core/MapExport.cpp@@ -14,9 +14,11 @@#include <cctype>#include <cmath>#include <cstdio>+#include <cstdlib>#include <filesystem>#include <fstream>#include <sstream>+#include <thread>namespace sf {@@ -377,23 +379,37 @@ bool exportMaps(const PaintTexture& t, const ExportPreset& preset, const std::sterror = "Cannot create the folder " + folder;return false;}- for (const MapSpec& map : preset.maps) {- if (!mapWanted(t, map)) continue;- const std::string path = utf8(fsPath(folder) / fsPath(mapFileName(preset, map, name)));+ // PNG compression is single-threaded and dominates at 4K / 8K: maps are written on up to four threads at once.+ std::vector<const MapSpec*> maps;+ for (const MapSpec& map : preset.maps)+ if (mapWanted(t, map)) maps.push_back(&map);+ std::vector<std::string> paths(maps.size()), errors(maps.size());+ std::vector<char> ok(maps.size(), 0);+ auto writeOne = [&](size_t i) {+ const MapSpec& map = *maps[i];+ paths[i] = utf8(fsPath(folder) / fsPath(mapFileName(preset, map, name)));int channels = 0;- bool ok = false;if (map.bits == 16) {std::vector<uint16_t> px;- ok = renderMap16(t, map, preset.normalDirectX, px, channels) && savePng16(path, t.width, t.height, channels, px, error);+ ok[i] = renderMap16(t, map, preset.normalDirectX, px, channels) && savePng16(paths[i], t.width, t.height, channels, px, errors[i]);} else {Image img;- ok = renderMap(t, map, preset.normalDirectX, img, channels) && img.savePng(path, error);+ ok[i] = renderMap(t, map, preset.normalDirectX, img, channels) && img.savePng(paths[i], errors[i]);}- if (!ok) {- if (error.empty()) error = "Cannot write " + path;+ };+ constexpr size_t kAtOnce = 4;+ for (size_t first = 0; first < maps.size(); first += kAtOnce) {+ std::vector<std::thread> threads;+ for (size_t i = first + 1; i < std::min(maps.size(), first + kAtOnce); ++i) threads.emplace_back(writeOne, i);+ writeOne(first);+ for (auto& th : threads) th.join();+ }+ for (size_t i = 0; i < maps.size(); ++i) {+ if (!ok[i]) {+ error = errors[i].empty() ? "Cannot write " + paths[i] : errors[i];return false;}- written.push_back({map.map, path});+ written.push_back({maps[i]->map, paths[i]});}return true;}