Initial Commit
This commit is contained in:
53
openspec/changes/enterprise-gaming-r3f-lod/proposal.md
Normal file
53
openspec/changes/enterprise-gaming-r3f-lod/proposal.md
Normal file
@@ -0,0 +1,53 @@
|
||||
# OpenSpec Change: enterprise-gaming-r3f-lod
|
||||
|
||||
- **Change ID**: enterprise-gaming-r3f-lod
|
||||
- **Package**: `@suaveplan/r3f-lod`
|
||||
- **Category**: gaming/effects
|
||||
- **Target path**: `gaming/effects/r3f-lod`
|
||||
- **Status**: PROPOSED
|
||||
- **Date**: 2026-04-24
|
||||
|
||||
---
|
||||
|
||||
## Summary
|
||||
|
||||
Deliver `@suaveplan/r3f-lod` on the genesis branch from scratch at enterprise quality. The package provides level-of-detail management for React Three Fiber. An `LodGroup` component accepts child meshes paired with distance thresholds; the `LodManager` evaluates camera distance each frame and swaps the active mesh; a `BillboardLod` fallback renders a sprite at maximum distance. Supports hysteresis bands to prevent LOD flickering. Genesis adds structured errors, OTel active-lod-level histogram, and 100% coverage.
|
||||
|
||||
---
|
||||
|
||||
## Available workspace deps
|
||||
|
||||
`@suaveplan/error`, react, `@react-three/fiber`, `@react-three/drei`, three.
|
||||
|
||||
---
|
||||
|
||||
## Public API surface
|
||||
|
||||
```ts
|
||||
function LodGroup(props: LodGroupProps): JSX.Element
|
||||
// levels: { distance: number; children: ReactNode }[]
|
||||
// hysteresis?: number
|
||||
|
||||
function BillboardLod(props: BillboardLodProps): JSX.Element
|
||||
// atlasTexture, frameIndex, sizeAttenuation
|
||||
|
||||
function useLod(ref: RefObject<Object3D>): number // current LOD level
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## File layout
|
||||
|
||||
```text
|
||||
gaming/effects/r3f-lod/
|
||||
package.json / tsconfig.json / vitest.config.ts
|
||||
src/
|
||||
index.ts / error-codes.ts
|
||||
types/common.ts + md
|
||||
core/lod-manager/ (ts + md + types + test + index)
|
||||
components/
|
||||
LodGroup/ (tsx + md + test + stories + index)
|
||||
BillboardLod/ (tsx + md + test + stories + index)
|
||||
hooks/use-lod.ts + md + test
|
||||
tests/integration.test.ts
|
||||
```
|
||||
26
openspec/changes/enterprise-gaming-r3f-lod/tasks.md
Normal file
26
openspec/changes/enterprise-gaming-r3f-lod/tasks.md
Normal file
@@ -0,0 +1,26 @@
|
||||
# Tasks: enterprise-gaming-r3f-lod
|
||||
|
||||
## 0. Pre-flight (non-negotiable)
|
||||
|
||||
- [ ] 0.1 Confirm clean working tree (`git status` reports nothing) and no in-flight worktrees with uncommitted work (`git worktree list` then `git status` in each)
|
||||
- [ ] 0.2 If any worktrees exist under `.claude/worktrees/`, account for each one: still-active agent, work-pending-merge, or stale-and-prune. Stale worktrees MUST be removed (`git worktree remove`) before opening a new one — code that has been lost twice on main is the failure mode this guards against.
|
||||
- [ ] 0.3 Confirm the package set in `MANIFEST.md` matches `find packages -maxdepth 3 -name package.json` count. Drift here means a prior change archived without regenerating the manifest.
|
||||
|
||||
## Phase 1 — Scaffold + types
|
||||
|
||||
## Phase 2 — LOD manager
|
||||
|
||||
- [ ] Distance evaluation, hysteresis band, level selection
|
||||
- [ ] Tests + docs
|
||||
|
||||
## Phase 3 — Components + stories
|
||||
|
||||
- [ ] `LodGroup`, `BillboardLod`
|
||||
|
||||
## Phase 4 — `useLod` hook
|
||||
|
||||
## Phase 5 — Pre-publish gate
|
||||
|
||||
- [ ] `bunx turbo lint typecheck test --filter=@suaveplan/r3f-lod` green
|
||||
- [ ] 100% coverage
|
||||
- [ ] Publish: `bun scripts/publish.ts --package @suaveplan/r3f-lod`
|
||||
Reference in New Issue
Block a user