Feat/adaptive lod threshold (#5249)

* feat: use a physical min font size as the LOD threshold instead of an abritrary zoom level that is different on different screens

* feat: min 1px font size, max 24ox font size

* refactor: settings text

* refactor: settings text

* refactor: version

* fix: default font size from 10 to 8

* feat: cache the threshold and move it's calculation out of the render loop

* refactor: comments

* refactor: removed package-lock

* refactor: improve how we manage deprecated settings, and removed any types

* refactor: how the migration settings formula works so we get prev settings closer to the new font size setting

* test: add in zoom and settings test for LOD

* refactor: tests to use best practices

* Update test expectations [skip ci]

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Simula_r
2025-09-03 12:38:44 -07:00
committed by snomiao
parent 8c32706708
commit 9bed2cc1e6
9 changed files with 321 additions and 15 deletions

View File

@@ -776,19 +776,36 @@ export const CORE_SETTINGS: SettingParams[] = [
type: 'boolean',
versionAdded: '1.8.8'
},
{
id: 'LiteGraph.Canvas.LowQualityRenderingZoomThreshold',
name: 'Low quality rendering zoom threshold',
type: 'hidden',
deprecated: true,
name: 'Low quality rendering zoom threshold (deprecated)',
tooltip:
'Zoom level threshold for performance mode. Lower values (0.1) = quality at all zoom levels. Higher values (1.0) = performance mode even when zoomed in. Performance mode simplifies rendering by hiding text labels, shadows, and details.',
type: 'slider',
attrs: {
min: 0.1,
max: 1,
step: 0.01
},
defaultValue: 0.6,
versionAdded: '1.9.1'
versionAdded: '1.9.1',
versionModified: '1.26.7'
},
{
id: 'LiteGraph.Canvas.MinFontSizeForLOD',
name: 'Zoom Node Level of Detail - font size threshold',
tooltip:
'Controls when the nodes switch to low quality LOD rendering. Uses font size in pixels to determine when to switch. Set to 0 to disable. Values 1-24 set the minimum font size threshold for LOD - higher values (24px) = switch nodes to simplified rendering sooner when zooming out, lower values (1px) = maintain full node quality longer.',
type: 'slider',
attrs: {
min: 0,
max: 24,
step: 1
},
defaultValue: 8,
versionAdded: '1.26.7'
},
{
id: 'Comfy.Canvas.NavigationMode',