Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/decisions.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ A mechanic or site is migrated only when:
- exact or epsilon numerical and event checkpoints pass;
- save/load and pause/resume preserve the state;
- keyboard and touch intents produce equivalent authoritative actions;
- the PixiJS scene has camera culling, bounded allocations, quality tiers, and
no whole-screen effect at an unmeasured resolution;
- the PixiJS scene has camera culling, bounded allocations, and no
whole-screen effect at an unmeasured resolution;
- interactive controls and critical status have accessible, localizable,
non-canvas representations;
- every warning has visual equivalence, semantic audio priority, and
Expand Down
31 changes: 15 additions & 16 deletions src/render/pixi-renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,20 @@ const SITE_ID = "wreck";
// RESYNC_DISTANCE_M, so the margin has to exceed that or content can enter the
// frame during the gap between syncs.
const CULL_MARGIN_M = 10;

// Issue #128: adaptive quality is not planned, so this never varies.
//
// The tier machinery underneath is real — every asset declares a
// `minimumQualityTier` and `buildSceneLayers` filters on it — but nothing ever
// chose a tier. `setQualityTier()` and `placementCount` were removed rather
// than left in place, because an API that advertises adaptive quality while
// the value is pinned is worse than no API: it reads as a working feature.
//
// Wiring it later means adding something that decides the tier (a frame
// budget, a device-capability probe, or a user setting), putting the setter on
// SceneRenderer, and replacing this constant. The filtering is already there
// and tested.
const QUALITY_TIER: QualityTier = "high";
const RESYNC_DISTANCE_M = 4;

export class PixiWreckRenderer implements SceneRenderer {
Expand All @@ -41,7 +55,6 @@ export class PixiWreckRenderer implements SceneRenderer {
#markerPool: Graphics[] = [];
#activeMarkers: Graphics[] = [];
#lastSyncFocus: { x: number; y: number } | null = null;
#qualityTier: QualityTier = "high";

async mount(host: HTMLElement): Promise<void> {
if (this.#app) {
Expand Down Expand Up @@ -153,20 +166,6 @@ export class PixiWreckRenderer implements SceneRenderer {
this.#lastSyncFocus = null;
}

/** Quality tier drops decoration before anything a diver navigates by. */
setQualityTier(tier: QualityTier): void {
if (tier === this.#qualityTier) {
return;
}
this.#qualityTier = tier;
this.#lastSyncFocus = null;
}

/** Visible placement count, for tests and the diagnostics overlay. */
get placementCount(): number {
return this.#activeMarkers.length;
}

#syncSceneLayers(camera: CameraTransform, force: boolean): void {
const focus = camera.focus;
if (
Expand All @@ -190,7 +189,7 @@ export class PixiWreckRenderer implements SceneRenderer {
const { halfWidthM, halfHeightM } = visibleHalfExtentM(camera);

const layers = buildSceneLayers(SITE_ID, {
qualityTier: this.#qualityTier,
qualityTier: QUALITY_TIER,
cullMarginM: CULL_MARGIN_M,
camera: {
leftM: focus.x - halfWidthM,
Expand Down