---
name: asset-performance-budget
description: "Integrate detailed downloaded models without loading an entire gallery into GPU memory. Use for performance, lazy, WebGL, модели."
---

# Бюджет тяжёлых 3D-сцен

Integrate detailed downloaded models without loading an entire gallery into GPU memory.

## Implementation decisions

1. Use provider posters in the gallery. Create a WebGL renderer only after a user opens an asset scene.
2. Show available geometry and download-size metadata. Start with 1K maps; allow the original high-resolution files separately.
3. Cap DPR and pause frame work when hidden or outside the viewport. Keep long-lived textures in an owned set with explicit disposal.
4. Never claim a scan is web-optimized just because it loads. Inspect topology and texture cost; simplify, compress and validate only when the target project requires it.

## Working source

Read [components/asset-viewer.tsx](../webcraft-shared/source/components/asset-viewer.tsx) when implementing this capability. The example belongs to the WEBCRAFT React/Three.js playground except the Python commerce starter, which runs without third-party dependencies. Use [shared catalog](../webcraft-shared/source/lib/catalog.ts) only to resolve related examples. Adapt the source to the target framework and preserve existing project conventions.

The original workshop uses Three.js 0.180 and procedural builders. The external asset viewer separately loads licensed glTF, scanned PBR maps and HDRIs. Preserve the provenance of each corpus. See [objects.ts](../webcraft-shared/source/lib/objects.ts) for material and geometry ownership and [scene.tsx](../webcraft-shared/source/components/scene.tsx) for renderer lifecycle.

## Verify observable behavior

- Opening the catalog does not download all model binaries.
- Navigating away releases the renderer and GPU resources.
- Loading failures offer a retry and the original provider link.

## Scope

Use only the parts relevant to the requested task. This skill does not grant permission to publish, spend money, change account access or expose secrets. The original brief and environment rules remain authoritative.

Version 2.0.0 · Original WEBCRAFT content · MIT
