Observe · Change · Recompute · Explain
先分离请求与生效,再讨论优化
Read-only · exact teaching model
质量档位不是开关列表,而是带有设备约束和可回退路径的策略。
这一课怎么学
- 观察
- 预测
- 改一个量
- 看证据
- 再读代码
Separate requested quality from effective quality
A fallback is explainable only when the original request is kept for comparison.
// Quality Tier & Fallback Lab — executable teaching model
const requested = { maps, ssr, reflections, fog, particles, resolution };
const effective = fallback(requested, { tier, memoryGb, bandwidthMb });
fallbackReasons.push("SSR disabled for low tier");
Visual quality spends three budgets
GPU time, memory and bandwidth can disagree; measure all three.
const gpuMs = pixels * (materialCost + screenSpaceCost) * samples;
const memoryMb = textureMb + frameMb + shadowMb + screenSpaceMb;
const bandwidthMb = pixels * (textureAndFrame + screenSpace) * sampleFactor;
risk = gpuMs > targetMs || memoryMb > deviceMemoryGb * 1024 ? "high" : "low";The fallback is part of the product
Risk and report identity make a quality decision testable.
risk = gpuMs > targetMs || memoryMb > deviceMemoryGb * 1024 ? "high" : "low";
reportId = stableHash({ effective, gpuMs, memoryMb, bandwidthMb });