diff --git a/dDashboardServer/static/js/ugc.js b/dDashboardServer/static/js/ugc.js index 3aae92034..8a76f2a39 100644 --- a/dDashboardServer/static/js/ugc.js +++ b/dDashboardServer/static/js/ugc.js @@ -128,11 +128,47 @@ // When it was made and what that cost (the cost is only known for makes since it was recorded), and with what function madeText(i) { if (!i.processedAt) return ''; - return fmt.unix(i.processedAt) + (costText(i) ? ' \u00b7 ' + costText(i) : '') + (i.madeOptions ? ' \u00b7 with ' + i.madeOptions : ''); + return fmt.unix(i.processedAt) + (costText(i) ? ' \u00b7 ' + costText(i) : '') + (i.madeOptions ? ' \u00b7 with ' + optionsText(i.madeOptions) : ''); } - // The processing options picked for Make again (ray tracer, denoise, processor), as /api/ugc/reprocess takes them - function remakeOptions() { - return ['optRays', 'optDenoise', 'optProcessor'].map(function (x) { return $(x).value; }).filter(Boolean).join(' '); + + // ---- processing options (docs/UgcServer.md, "Processing options"): the settings pick what every make uses; "Make again with…" another for one make ---- + + var OPTION_LABELS = { embree: 'Embree (CPU)', hiprt: 'HIPRT (GPU)', 'embree-gpu': 'Embree (Intel GPU)', off: 'no denoise', oidn: 'Open Image Denoise', + native: 'UGC server', 'toolbox-blender': 'LU Toolbox (Blender)' }; + var OPTION_GROUPS = [['rays', 'Ray tracer'], ['denoise', 'Denoise icons'], ['processor', 'Made by']]; + var options = null; // /api/ugc/options: choices and the settings' defaults + // Stored options ("embree off", "hiprt oidn toolbox-blender") in words; no processor word: the UGC server's own + function optionsText(text) { + var words = String(text || '').split(/[ ,]+/).filter(function (w) { return w && w !== 'toolbox' && w !== 'fast'; }); + if (!words.length) return ''; + words = words.map(function (w) { return w === 'builtin' ? 'embree' : w; }); + if (words.indexOf('toolbox-blender') < 0 && words.indexOf('native') < 0) words.push('native'); + return words.map(function (w) { return OPTION_LABELS[w] || w; }).join(', '); + } + // A "Make again with…" dropdown: a form with each choice preset to the settings' default, for one make only + function withMenu(target, label) { + if (!options || !canManage) return ''; + var selects = OPTION_GROUPS.filter(function (g) { return options.choices[g[0]]; }).map(function (g) { + return ''; + }).join(''); + return '
'; + } + function withOptions(form) { + var chosen = [].map.call(form.querySelectorAll('[data-option]'), function (x) { return x.value; }); + var defaults = OPTION_GROUPS.map(function (g) { return options.defaults[g[0]]; }); + // The same as the settings: no options, so the make follows the settings + return chosen.join(' ') === defaults.join(' ') ? '' : chosen.join(' '); + } + function showOptions() { + var model = list.kind === 'model'; + $('madeWith').innerHTML = options && model ? 'New makes: ' + esc(OPTION_GROUPS.map(function (g) { return OPTION_LABELS[options.defaults[g[0]]] || options.defaults[g[0]]; }).join(', ')) + + (window.DASH && DASH.can('settings') ? ' (change)' : '') : ''; + $('remakeAllWith').innerHTML = model ? withMenu('all', 'Make everything again with…') : ''; } // A model's file as the player named it: its name with the upload's extension (".lxfml"), else the upload's name function fileName(i) { @@ -183,8 +219,8 @@ }) ].concat(madeColumns(), [ column('Options', function (i) { - return '' + esc(i.madeOptions || '') + '' + - (i.processOptions ? '| Made | With | Took | CPU | Hidden faces | Occlusion | Icon | Triangles |
|---|---|---|---|---|---|---|---|
| ' + esc(fmt.unix(r.madeAt)) + ' | ' + esc(optionsText(r.options)) + ' | ' + ms(r.ms) + ' | ' + ms(r.cpuMs) + + ' | ' + ms(r.hsrMs) + ' | ' + ms(r.aoMs) + ' | ' + ms(r.iconMs) + ' | ' + + esc(r.triangles.toLocaleString()) + ' |
' + esc(c.options) + 'The ways of making models to compare: the ray tracer of the occlusion (Embree on the CPU, HIPRT on AMD or
NVIDIA GPUs, Embree on Intel GPUs), denoising of icons, and what makes the models (the UGC server itself, or LU Toolbox in Blender:
- toolbox-blender, where its hidden faces are Process Model's and its occlusion Bake Lighting's). The settings pick the defaults; Make again can use others for a make (the options next
- to it, or /reprocessproperty embree oidn in game).
- Every make is counted under what made it: the averages per make below, each model's in the List view's Options column.
toolbox-blender, where its hidden faces are Process Model's and its occlusion Bake Lighting's). The settings (How models are made above) pick what every make uses; Make again with… uses others for that one make only
+ (or /reprocessproperty embree oidn in game).
+ Every make is recorded with what made it: the averages per make below, each model's in the List view's Options column, and every make of a
+ model in its window under Makes.
| Options | Makes | Models | Took | CPU | Hidden faces | Occlusion | Icon | Bricks | Triangles removed |
|---|---|---|---|---|---|---|---|---|---|
| Loading… | |||||||||