mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 10:53:44 +00:00
feat(ugc): make models like LU Toolbox does, within CPU and memory budgets
Parity with LU Toolbox's Process Model, Bake Lighting and icon renderer, with its defaults as the settings' defaults: - Colors from its LU palette (UgcPalette: LU colors, LDD colors mapped to the nearest LU one, unknown ones black), transparent bricks at 58.82% opacity, a brick transparent only when all of its materials are. - Color variation: each brick's material gets its HSV value shifted in a 2.224 gamma by up to 5% (times the color's own amount), from a random number of the model, brick and material, so reprocessing gives the same colors in every LOD. Icons get none, and the icon renderer's color corrections. - LODs 0 and 2 with its distance logic, written as NiLODNode/NiRangeLODData like its exports and the game's own brick models, shapes divided at 65535 vertices along the longest side like divide_mesh. - Ambient occlusion like its AO-only bake: 64 rays per vertex, distance 5, after hidden surface removal, transparent bricks neither baked nor occluding, glow colors added. - Icons from its icon scene: 50 mm lens at 53.4/19.5 degrees, sun of 2.5 at 21/50.3 degrees with soft shadows, grey world light with occlusion; LOD 0's hidden surface removal and occlusion are reused for them. - Optional ground plane for hidden surface removal; stats.json per model and the previous version's previews kept for comparing. Budgets, applied live on config reload: max_cpu_percent (workers account their thread CPU time and sleep to stay under it, long renders included), worker_nice, max_memory_mb (jobs are estimated from their brick count and wait until they fit), max_model_bricks and pause_hours. /status and the traffic report show CPU, memory and throttling. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -22,27 +22,76 @@ ugc_max_storage_mb=2048
|
||||
# Worker threads making files (0: half the CPU cores)
|
||||
worker_threads=0
|
||||
|
||||
# How much of the machine making files may use (changes apply while running):
|
||||
# max_cpu_percent: the workers together average at most this share of all CPU cores (0: no limit); they pause
|
||||
# between bits of work to stay under it, long renders included.
|
||||
# worker_nice: the workers' scheduling priority on Linux, 0 (normal) to 19 (only when nothing else wants the CPU).
|
||||
# max_memory_mb: jobs whose estimated memory would go past this together wait for running ones to finish; a job
|
||||
# bigger than it alone runs when nothing else does (0: no limit).
|
||||
# max_model_bricks: models with more bricks fail with that reason instead of being made (0: no limit).
|
||||
# pause_hours: local hours in which no new jobs start, e.g. 18-23 or 22-6 (empty: never).
|
||||
max_cpu_percent=0
|
||||
worker_nice=0
|
||||
max_memory_mb=0
|
||||
max_model_bricks=0
|
||||
pause_hours=
|
||||
|
||||
# How often to look for models to make (milliseconds), how many to take at once, and how often a model may fail
|
||||
# before it's given up on (the dashboard can try again)
|
||||
poll_interval_ms=2000
|
||||
poll_batch=32
|
||||
max_attempts=3
|
||||
|
||||
# Brick detail used for meshes and icons: 0 (most detailed) to 2
|
||||
brick_lod=0
|
||||
# Models are made like LU Toolbox's Process Model and Bake Lighting make them; these default to its settings.
|
||||
# color_palette: lu_toolbox (its LU palette, unknown colors black) or brickdb (the client's Materials.xml).
|
||||
# color_variation: each brick's brightness is shifted by up to this percent (the same every time; 0: none).
|
||||
# transparent_opacity: transparent bricks' opacity in percent.
|
||||
color_palette=lu_toolbox
|
||||
color_variation=5
|
||||
transparent_opacity=58.82
|
||||
|
||||
# Remove faces that can't be seen from anywhere, and darken hidden corners (ambient occlusion baked into the vertex
|
||||
# colors): 0 or 1. ao_strength: 0 (none) to 1. optimize_resolution: detail of the renders that decide both.
|
||||
# Levels of detail made, from the client's brickprimitives (0 most detailed, 2 least), and the distances they're
|
||||
# drawn at (LU Toolbox picks each level's range from these by which levels are made; lod_cull: drawn up to).
|
||||
lods=0,2
|
||||
lod_distance_0=0
|
||||
lod_distance_1=50
|
||||
lod_distance_2=100
|
||||
lod_distance_3=280
|
||||
lod_cull=10000
|
||||
|
||||
# The shapes' shader number: S<shader>_Opaque_Model (transparent shapes are S01_Alpha_Model)
|
||||
shader_opaque=01
|
||||
|
||||
# Remove faces that can't be seen from anywhere (optimize_resolution: detail of the renders that decide it;
|
||||
# hsr_ground_plane: 1 also removes what can only be seen from below the model)
|
||||
remove_hidden_faces=1
|
||||
bake_ao=1
|
||||
ao_strength=0.6
|
||||
hsr_ground_plane=0
|
||||
optimize_resolution=1024
|
||||
|
||||
# Icons: size in pixels, the camera's angle around (yaw, from the model's front) and above (pitch) the model in degrees,
|
||||
# and the empty border (1 fills the icon). Modular builds (cars, rockets) have their own angles.
|
||||
# Bake ambient occlusion into the vertex colors: rays per vertex, how far they look, strength 0 (none) to 1, and how
|
||||
# much glowing colors add
|
||||
bake_ao=1
|
||||
ao_samples=64
|
||||
ao_distance=5
|
||||
ao_strength=1
|
||||
glow_strength=6
|
||||
|
||||
# Icons, set up like LU Toolbox's icon renderer: size in pixels, the camera's angle around (yaw, from the model's
|
||||
# front) and above (pitch) in degrees, its field of view, the empty border (1 fills the icon), the sun's angles and
|
||||
# strength, the world light, shadows and ambient occlusion, its color corrections and color variation (percent).
|
||||
# Modular builds (cars, rockets) have their own camera angles.
|
||||
icon_size=128
|
||||
icon_yaw=35
|
||||
icon_pitch=25
|
||||
icon_yaw=53.36
|
||||
icon_pitch=19.54
|
||||
icon_fov=39.6
|
||||
icon_margin=1.03
|
||||
modular_icon_yaw=35
|
||||
modular_icon_pitch=20
|
||||
icon_sun_yaw=21
|
||||
icon_sun_pitch=50.3
|
||||
icon_sun_strength=2.5
|
||||
icon_ambient=0.192
|
||||
icon_shadows=1
|
||||
icon_ao=1
|
||||
icon_correct_colors=1
|
||||
icon_color_variation=0
|
||||
modular_icon_yaw=53.36
|
||||
modular_icon_pitch=19.54
|
||||
|
||||
Reference in New Issue
Block a user