mirror of
https://github.com/miro0o/miniWorldMap.git
synced 2026-07-22 07:46:00 +00:00
54 lines
1.4 KiB
TypeScript
54 lines
1.4 KiB
TypeScript
/**
|
||
* 质量档位(M4):三档静态预设。
|
||
* Platform.isMobile 是硬上限(移动永不自动升档);手动覆盖绝对优先;
|
||
* auto = high 起步 + FPS 看门狗单向降档(沉降后采样,会话内不回升)。
|
||
*/
|
||
export type TierId = 'high' | 'low' | 'mobile';
|
||
|
||
export interface QualityTier {
|
||
id: TierId;
|
||
pixelRatioCap: number;
|
||
bloomAllowed: boolean; // mobile 关 bloom:shader 热核保住 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,
|
||
},
|
||
};
|