refactor(ugc): remove the path traced hidden-face method; the renders are the only one

The path tracer that imitated LU Toolbox's Remove Hidden Faces took 17 to 100
times as long as the renders from 42 directions around the model, too heavy to
use. It goes with its settings (hsr_method, hsr_samples, hsr_bounces,
hsr_sample_spacing, hsr_min_points), its side by side tracing for GPUs and its
tests. The renders (UgcRender::VisibleFromAround) remove hidden faces as before
that method existed; their size is hsr_resolution (1024), and the memory
estimate counts their buffers again.

The hidden-face method is no longer a processing option: the dashboard's picker,
/reprocessproperty and --make-model take only the ray backend (the occlusion's)
and denoising. Options stored before (made_options, process_options,
ugc_process_runs, --make-model arguments) that name toolbox or fast still
parse; the word is skipped.

Check: the settings page has no hsr_method or path settings and has
hsr_resolution; /reprocessproperty embree toolbox still works (toolbox
ignored); models made with the defaults keep their hashes (UGC tests).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Aaron Kimbrell
2026-09-29 12:12:25 -05:00
parent b897681f67
commit 07154c58d2
19 changed files with 104 additions and 896 deletions

View File

@@ -74,22 +74,21 @@ namespace UgcDebounce {
/**
* How a model is made, where there is more than one way to try (docs/UgcServer.md, "Processing options"): what traces
* the rays (ray_backend), how hidden faces are found (hsr_method) and whether icons are denoised
* (denoise). The UGC settings give the defaults; staff may pick others for one make (the dashboard, /reprocessproperty),
* and each made model records what made it. Written as the chosen names in this order, separated by spaces
* ("embree fast oidn"); a choice left out is the setting's.
* the rays (ray_backend) and whether icons are denoised (denoise). The UGC settings give the defaults; staff may pick
* others for one make (the dashboard, /reprocessproperty), and each made model records what made it. Written as the
* chosen names in this order, separated by spaces ("embree oidn"); a choice left out is the setting's.
*/
namespace UgcProcessOptions {
inline constexpr std::string_view RAYS[] = { "builtin", "embree", "hiprt" };
inline constexpr std::string_view HSR[] = { "toolbox", "fast" };
inline constexpr std::string_view DENOISE[] = { "off", "oidn" };
// Hidden-face methods earlier versions' options named (stored options still have them): read and ignored
inline constexpr std::string_view RETIRED[] = { "toolbox", "fast" };
struct Choice {
std::string rays; // one of RAYS, or empty for the setting
std::string hsr; // one of HSR, or empty
std::string denoise; // one of DENOISE, or empty
bool Empty() const { return rays.empty() && hsr.empty() && denoise.empty(); }
bool Empty() const { return rays.empty() && denoise.empty(); }
};
template<size_t N>
@@ -97,8 +96,8 @@ namespace UgcProcessOptions {
return std::find(std::begin(names), std::end(names), word) != std::end(names);
}
// The words, in any order ("fast embree"); "default" or "-" leave a choice to the setting. False on an unknown
// word or two words for one choice.
// The words, in any order ("oidn embree"); "default" or "-" leave a choice to the setting, retired words are
// skipped. False on an unknown word or two words for one choice.
inline bool Parse(std::string_view text, Choice& choice) {
choice = {};
size_t start = 0;
@@ -108,8 +107,8 @@ namespace UgcProcessOptions {
while (end < text.size() && text[end] != ' ' && text[end] != ',') end++;
const auto word = text.substr(start, end - start);
start = end;
if (word.empty() || word == "default" || word == "-") continue;
std::string* slot = Contains(RAYS, word) ? &choice.rays : Contains(HSR, word) ? &choice.hsr : Contains(DENOISE, word) ? &choice.denoise : nullptr;
if (word.empty() || word == "default" || word == "-" || Contains(RETIRED, word)) continue;
std::string* slot = Contains(RAYS, word) ? &choice.rays : Contains(DENOISE, word) ? &choice.denoise : nullptr;
if (!slot || !slot->empty()) return false;
*slot = std::string(word);
}
@@ -119,7 +118,7 @@ namespace UgcProcessOptions {
// The choices made, in order ("embree oidn"); empty when all are the settings'
inline std::string ToString(const Choice& choice) {
std::string text;
for (const auto* part : { &choice.rays, &choice.hsr, &choice.denoise }) {
for (const auto* part : { &choice.rays, &choice.denoise }) {
if (part->empty()) continue;
if (!text.empty()) text += ' ';
text += *part;