mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 02:43:44 +00:00
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>
30 lines
1.1 KiB
C++
30 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <cstddef>
|
|
#include <vector>
|
|
|
|
#include "UgcModel.h"
|
|
|
|
/**
|
|
* Hidden surface removal: the opaque mesh rendered from 42 directions around the model (UgcRender::VisibleFromAround),
|
|
* and the triangles that show in none of them removed. Transparent bricks hide nothing and aren't touched, as in LU
|
|
* Toolbox. Faces seen only by bounced light (insides seen through openings, recesses) don't show in the renders and
|
|
* are removed too. docs/UgcServer.md ("Hidden faces") has the details.
|
|
*/
|
|
namespace UgcHsr {
|
|
struct Options {
|
|
bool enabled{ true }; // remove_hidden_faces
|
|
bool groundPlane{ false }; // hsr_ground_plane: nothing is seen from below the model (LU Toolbox's Use Ground Plane)
|
|
int resolution{ 1024 }; // hsr_resolution: pixels square of each render
|
|
};
|
|
|
|
struct Result {
|
|
size_t trianglesBefore{}; // opaque and transparent
|
|
size_t trianglesRemoved{};
|
|
std::vector<bool> kept; // per opaque triangle before: whether it stayed
|
|
};
|
|
|
|
// Removes the opaque triangles that show in none of the renders (nothing when options.enabled is off)
|
|
Result RemoveHiddenFaces(UgcModel::Model& model, const Options& options);
|
|
}
|