mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-13 16:23:44 +00:00
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:
@@ -155,15 +155,9 @@ namespace {
|
||||
settings.build.satinWhiten = std::clamp(Setting<float>("satin_whiten", 20.0f), 0.0f, 100.0f);
|
||||
settings.hsr.enabled = Setting<int32_t>("remove_hidden_faces", 1) != 0;
|
||||
settings.hsr.groundPlane = Setting<int32_t>("hsr_ground_plane", 0) != 0;
|
||||
settings.hsr.samples = std::clamp(Setting<int32_t>("hsr_samples", 8), 1, 256);
|
||||
settings.hsr.bounces = std::clamp(Setting<int32_t>("hsr_bounces", 8), 0, 64);
|
||||
settings.hsr.spacing = std::clamp(Setting<float>("hsr_sample_spacing", 0.1143f), 0.01f, 10.0f);
|
||||
settings.hsr.minPoints = std::clamp(Setting<int32_t>("hsr_min_points", 28), 1, 4096);
|
||||
settings.hsr.method = UgcHsr::Parse(Game::config->GetValue("hsr_method")).value_or(UgcHsr::eMethod::TOOLBOX);
|
||||
settings.hsr.fastResolution = std::clamp(Setting<int32_t>("hsr_fast_resolution", 1024), 64, 4096);
|
||||
// What traces the rays of the hidden faces' paths and of the occlusion (the icon's too)
|
||||
settings.hsr.rays = UgcRays::Parse(Game::config->GetValue("ray_backend")).value_or(UgcRays::eBackend::BUILTIN);
|
||||
settings.ao.rays = settings.hsr.rays;
|
||||
settings.hsr.resolution = std::clamp(Setting<int32_t>("hsr_resolution", 1024), 64, 4096);
|
||||
// What traces the occlusion rays (the icon's too)
|
||||
settings.ao.rays = UgcRays::Parse(Game::config->GetValue("ray_backend")).value_or(UgcRays::eBackend::BUILTIN);
|
||||
// The GPU hiprt uses (read before it is first used; changing it takes a restart)
|
||||
UgcRays::SetGpuDevice(std::max(Setting<int32_t>("hiprt_device", 0), 0));
|
||||
settings.ao.enabled = Setting<int32_t>("bake_ao", 1) != 0;
|
||||
@@ -180,7 +174,7 @@ namespace {
|
||||
settings.icon.glowEmissive = settings.shaders.glowEmissive;
|
||||
settings.icon.glitter = settings.shaders.glitterParams;
|
||||
settings.icon.ao.distance = settings.ao.distance;
|
||||
settings.icon.ao.rays = settings.hsr.rays;
|
||||
settings.icon.ao.rays = settings.ao.rays;
|
||||
settings.icon.denoise = UgcRender::ParseDenoise(Game::config->GetValue("denoise")).value_or(UgcRender::eDenoise::OFF);
|
||||
settings.icon.denoiseSamples = std::clamp(Setting<int32_t>("denoise_samples", 4), 1, 256);
|
||||
settings.icon.bakedAo = settings.ao.enabled ? std::clamp(settings.ao.strength, 0.0f, 1.0f) : 0.0f;
|
||||
@@ -193,8 +187,8 @@ namespace {
|
||||
void LogProcessingOptions(const UgcJobs::Settings& settings) {
|
||||
const auto made = UgcJobs::MadeWith(settings);
|
||||
LOG("Processing options: %s", UgcProcessOptions::ToString(made).c_str());
|
||||
if (UgcRays::Resolve(settings.hsr.rays) != settings.hsr.rays) {
|
||||
LOG("ray_backend=%s can't be used (%s): embree instead", std::string(UgcRays::Name(settings.hsr.rays)).c_str(), UgcRays::Problem(settings.hsr.rays).c_str());
|
||||
if (UgcRays::Resolve(settings.ao.rays) != settings.ao.rays) {
|
||||
LOG("ray_backend=%s can't be used (%s): embree instead", std::string(UgcRays::Name(settings.ao.rays)).c_str(), UgcRays::Problem(settings.ao.rays).c_str());
|
||||
}
|
||||
if (!UgcRender::Available(settings.icon.denoise)) LOG("denoise=%s can't be used (the server was built without DLU_OIDN): off instead", std::string(UgcRender::Name(settings.icon.denoise)).c_str());
|
||||
}
|
||||
@@ -579,7 +573,7 @@ namespace {
|
||||
auto settings = ReadSettings();
|
||||
UgcProcessOptions::Choice choice;
|
||||
if (!UgcProcessOptions::Parse(options, choice)) {
|
||||
std::cerr << "Unknown processing options \"" << options << "\" (ray backend builtin, embree or hiprt; hidden faces toolbox or fast; denoise off or oidn)\n";
|
||||
std::cerr << "Unknown processing options \"" << options << "\" (ray backend builtin, embree or hiprt; denoise off or oidn)\n";
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
UgcJobs::ApplyOptions(settings, choice);
|
||||
|
||||
Reference in New Issue
Block a user