mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-10 14:53:43 +00:00
refactor(ugc): Embree is required; the hand-written ray hierarchies are gone
Embree 4 (always built) replaces the UGC server's own bounding volume hierarchies (the nearest-hit one and the occlusion rays' any-hit one), with no fallback to them. ray_backend is embree (default) or hiprt (optional build; Embree when it can't be used). Settings, stored options and stats that say builtin still read: it is embree (UgcRays::Parse, UgcProcessOptions::Parse). The dashboard's picker, /reprocessproperty and --make-model offer embree and hiprt. Tests: the backends are compared with Embree (hiprt when built), Embree against rays whose hits are known, and the clutter's occlusion against what the old hierarchy worked out (296 vertices summing to 114.5, 26 open, 183 dark); the pinned model hashes are unchanged with Embree. Check: ray_backend=builtin in an ini still starts and uses embree; the settings page offers Embree and HIPRT. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -79,7 +79,7 @@ namespace UgcDebounce {
|
||||
* 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 RAYS[] = { "embree", "hiprt" };
|
||||
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" };
|
||||
@@ -97,7 +97,7 @@ namespace UgcProcessOptions {
|
||||
}
|
||||
|
||||
// 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.
|
||||
// skipped and builtin is embree. 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;
|
||||
@@ -105,9 +105,11 @@ namespace UgcProcessOptions {
|
||||
while (start < text.size() && (text[start] == ' ' || text[start] == ',')) start++;
|
||||
size_t end = start;
|
||||
while (end < text.size() && text[end] != ' ' && text[end] != ',') end++;
|
||||
const auto word = text.substr(start, end - start);
|
||||
auto word = text.substr(start, end - start);
|
||||
start = end;
|
||||
if (word.empty() || word == "default" || word == "-" || Contains(RETIRED, word)) continue;
|
||||
// builtin, the ray backend Embree replaced, is embree
|
||||
if (word == "builtin") word = "embree";
|
||||
std::string* slot = Contains(RAYS, word) ? &choice.rays : Contains(DENOISE, word) ? &choice.denoise : nullptr;
|
||||
if (!slot || !slot->empty()) return false;
|
||||
*slot = std::string(word);
|
||||
|
||||
Reference in New Issue
Block a user