mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 02:43:44 +00:00
Intel Open Image Denoise 2 (Apache-2.0) behind the CMake option DLU_OIDN (off): an installed OIDN is used when found, else Intel's release package (pinned by hash) is downloaded and its libraries copied next to the servers. A denoiser only removes noise that differs from pixel to pixel; the icons' occlusion comes from the bake, per vertex, which it leaves as it is (checked: white noise 0.17 -> 0.006 relative spread, per-vertex blocks unchanged). So with denoise=oidn a model's icon is drawn from model.noao.nif (its colors before the bake) with its occlusion traced per pixel of the supersampled image (denoise_samples rays, default 4, with the bake's distance and strength and the ray backend), box filtered and denoised at the icon's size, guided by the colors and normals. The model keeps its baked occlusion. Icons drawn again from stored files use the stored model.noao.nif the same way. OIDN works on a thread of its own; its time is charged to the job's thread (UgcThrottle::Charge), so the CPU budget and the recorded CPU time include it. Check: configure with -DDLU_OIDN=ON; UgcServer --make-model x.lxfml out oidn and compare its icon.png with one made with off; an OFF build leaves icons as they were. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
62 lines
2.7 KiB
CMake
62 lines
2.7 KiB
CMake
# The UGC server (docs/UgcServer.md), in folders by role:
|
|
# Bricks/ the client's brick data: primitives, Materials.xml, LU Toolbox's palette, the CDClient's module data
|
|
# Model/ player models built from LXFML, car and rocket module combinations, glitter
|
|
# Render/ the software rasterizer, ambient occlusion, hidden-face removal, rays, icon parameters and pose
|
|
# Formats/ the files written for the client and the dashboard (NIF, DDS, PNG, sd0)
|
|
# Processing/ the job queue and workers, the CPU budget, stored files
|
|
# UgcServer.cpp the server: settings, the master link, HTTP routes
|
|
|
|
# The pure part of the UGC server (brick data, meshes, rendering, file formats, storage), shared with the tests
|
|
set(DUGC_SOURCES
|
|
"Bricks/UgcBricks.cpp"
|
|
"Bricks/UgcPalette.cpp"
|
|
"Formats/UgcFormats.cpp"
|
|
"Model/UgcGlitter.cpp"
|
|
"Model/UgcModel.cpp"
|
|
"Model/UgcModular.cpp"
|
|
"Processing/UgcJobs.cpp"
|
|
"Processing/UgcStorage.cpp"
|
|
"Processing/UgcThrottle.cpp"
|
|
"Render/UgcHsr.cpp"
|
|
"Render/UgcIconParams.cpp"
|
|
"Render/UgcIconPose.cpp"
|
|
"Render/UgcRays.cpp"
|
|
"Render/UgcRender.cpp"
|
|
)
|
|
|
|
add_library(dUgc STATIC ${DUGC_SOURCES})
|
|
target_include_directories(dUgc PUBLIC "." "Bricks" "Formats" "Model" "Processing" "Render"
|
|
"${PROJECT_SOURCE_DIR}/thirdparty/MD5" "${PROJECT_SOURCE_DIR}/thirdparty/nlohmann")
|
|
target_link_libraries(dUgc PUBLIC dCommon glm::glm tinyxml2 MD5 PRIVATE embree)
|
|
# Intel Open Image Denoise, when built with DLU_OIDN (thirdparty/CMakeLists.txt): the denoise=oidn setting
|
|
if(DLU_OIDN)
|
|
target_link_libraries(dUgc PRIVATE OpenImageDenoise)
|
|
target_compile_definitions(dUgc PRIVATE DLU_OIDN)
|
|
endif()
|
|
|
|
add_executable(UgcServer "UgcServer.cpp" "Processing/UgcProcessor.cpp" "Bricks/UgcCdClient.cpp")
|
|
|
|
target_include_directories(UgcServer PRIVATE
|
|
"${PROJECT_SOURCE_DIR}/dCommon"
|
|
"${PROJECT_SOURCE_DIR}/dCommon/dClient"
|
|
"${PROJECT_SOURCE_DIR}/dCommon/dEnums"
|
|
"${PROJECT_SOURCE_DIR}/dDatabase"
|
|
"${PROJECT_SOURCE_DIR}/dDatabase/CDClientDatabase"
|
|
"${PROJECT_SOURCE_DIR}/dDatabase/CDClientDatabase/CDClientTables"
|
|
"${PROJECT_SOURCE_DIR}/dDatabase/GameDatabase"
|
|
"${PROJECT_SOURCE_DIR}/dDatabase/GameDatabase/ITables"
|
|
"${PROJECT_SOURCE_DIR}/dNet"
|
|
"${PROJECT_SOURCE_DIR}/dWeb"
|
|
"${PROJECT_SOURCE_DIR}/dServer"
|
|
"${PROJECT_SOURCE_DIR}/thirdparty"
|
|
"${PROJECT_SOURCE_DIR}/thirdparty/nlohmann"
|
|
)
|
|
|
|
target_compile_definitions(UgcServer PRIVATE PROJECT_VERSION="\"${PROJECT_VERSION}\"")
|
|
target_link_libraries(UgcServer ${COMMON_LIBRARIES} dWeb dServer dUgc)
|
|
|
|
# Rendering is far too slow unoptimized (minutes a model instead of seconds), so it is optimized in every build type
|
|
if(NOT MSVC)
|
|
set_source_files_properties("Render/UgcRender.cpp" "Render/UgcHsr.cpp" "Render/UgcRays.cpp" "Model/UgcModel.cpp" "Bricks/UgcPalette.cpp" "Model/UgcGlitter.cpp" PROPERTIES COMPILE_OPTIONS "-O2")
|
|
endif()
|