Skip to content

feat(gltf): reference-grade asset lifecycle, shared resources, and complete API docs - #2992

Draft
ibgreen-openai wants to merge 4 commits into
masterfrom
codex/gltf-reference-runtime
Draft

feat(gltf): reference-grade asset lifecycle, shared resources, and complete API docs#2992
ibgreen-openai wants to merge 4 commits into
masterfrom
codex/gltf-reference-runtime

Conversation

@ibgreen-openai

Copy link
Copy Markdown
Collaborator

Goals

Make @luma.gl/gltf a reference-quality, explicitly owned asset runtime instead of repeatedly uploading source images and leaving scenegraph GPU resources alive after assets are replaced.

Keep loading in loaders.gl, glTF interpretation in @luma.gl/gltf, generic scenegraph primitives in @luma.gl/engine, shading in @luma.gl/shadertools, and ANARI as a thin retained facade.

Changes

Deterministic asset lifetime and shared GPU resources

  • Add public GLTFAssetResourceCache, scoped to its creating device and keyed by source image identity, canonical sampler state, source color space, and color/data interpretation.
  • Reuse compatible feature-specialized parsed materials across source materials, primitive layouts, variant mappings, and independently created scenegraphs.
  • Add public GLTFScenegraphs.destroy() / dispose() to release unique models, materials, hidden scenegraph nodes, detached source-mesh templates, generated textures, and all four GPU-instance attribute buffers exactly once.
  • Add explicit ParseGLTFOptions.resourceCache sharing with deferred destruction and textureCount, materialCount, and referenceCount diagnostics.
  • Preserve caller ownership of the luma device, source images, explicit shared caches, and supplied image-based-lighting textures.
  • Export the previously inaccessible public ParseGLTFOptions type.

Accurate reference documentation

  • Document every returned scenegraph property, source-native material variants, camera/light/visibility pointers, automatic skin palettes, strict extension validation, shared-cache ownership, and descriptor-based interchange.
  • Correct obsolete glTF and ANARI claims about source GPU instancing, recursive visibility, automatic retained skeletal animation, morph/camera pointers, and animated glTF export.
  • Clarify that standalone glTF scenegraphs retain their established transmission fallback while experimental/ANARI scene rendering owns captured-scene refraction.
  • Replace unqualified “lossless” positioning with source-faithful descriptor-based interchange in package metadata and the module overview.

Verification

  • node_modules/.bin/tspc -b modules/anari/tsconfig.json --force --pretty falsepassed, including strict glTF, engine, effects, experimental, and shader project references.
  • Focused glTF, ANARI, exporter, showcase-identity, and capability suites — 26 suites / 134 node tests passed.
  • Dedicated lifecycle coverage proves image deduplication, distinct sampler/color interpretations, variant reuse, deferred shared-cache destruction, borrowed IBL preservation, hidden-node disposal, and exact texture/buffer count restoration.
  • Real Chromium native-Metal WebGL + WebGPU regression matrix — 6 suites / 28 GPU tests passed.
  • The same dedicated lifecycle matrix on CI-style Chromium SwiftShader — passed on WebGL and WebGPU.
  • Full Docusaurus production build — passed; llms normalization and validation passed for 474 raw documentation pages.
  • All changed MDX pages compile; equivalent scoped Biome formatting/lint and git diff --check pass.
  • Three-way merge audits against the simultaneous independent-animation and next-PBR branches report zero conflicts.
  • Standard yarn lint fix / yarn build wrappers cannot run against this workstation’s pre-existing outdated @vis.gl/dev-tools installation (ocular-lint / ocular-clean missing); equivalent direct Biome and complete referenced TypeScript build both passed. Existing PushPatrol pre-push protection was preserved.

Architecture / Ownership

This PR targets master directly and does not depend on another unmerged branch. The cache and lifecycle remain format-owned; no loader, BRDF, animation mixer, high-level renderer, or independent ANARI material implementation is introduced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants