miro0o_miniWorldMap/src/quality/tiers.ts

54 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 质量档位M4三档静态预设。
* Platform.isMobile 是硬上限(移动永不自动升档);手动覆盖绝对优先;
* auto = high 起步 + FPS 看门狗单向降档(沉降后采样,会话内不回升)。
*/
export type TierId = 'high' | 'low' | 'mobile';
export interface QualityTier {
id: TierId;
pixelRatioCap: number;
bloomAllowed: boolean; // mobile 关 bloomshader 热核保住 80% 观感,省掉全部后期开销
starScale: number; // 星空点数缩放
nodeCap: number | null; // 按度数排序取 top N实测 top1500 保 94% 链接质量)
linkCap: number | null; // 按 min(端点度数) 取 top N
hubLabels: number;
neighborLabels: number;
hoverThrottleMs: number | null; // null = 仅 tap触屏无 hover
}
export const TIERS: Record<TierId, QualityTier> = {
high: {
id: 'high',
pixelRatioCap: 2,
bloomAllowed: true,
starScale: 1,
nodeCap: null,
linkCap: null,
hubLabels: 14,
neighborLabels: 20,
hoverThrottleMs: 30,
},
low: {
id: 'low',
pixelRatioCap: 1,
bloomAllowed: true,
starScale: 0.4,
nodeCap: null,
linkCap: null,
hubLabels: 8,
neighborLabels: 12,
hoverThrottleMs: 80,
},
mobile: {
id: 'mobile',
pixelRatioCap: 1.5,
bloomAllowed: false,
starScale: 0.32,
nodeCap: 1500,
linkCap: 12_000,
hubLabels: 6,
neighborLabels: 8,
hoverThrottleMs: null,
},
};