Skip to content

Integrate Marble world pano/splat + GLB collider and extend splat/world discovery#123

Open
alexwelcing wants to merge 2 commits intomainfrom
codex/combine-splats-and-360-pano-for-exploration
Open

Integrate Marble world pano/splat + GLB collider and extend splat/world discovery#123
alexwelcing wants to merge 2 commits intomainfrom
codex/combine-splats-and-360-pano-for-exploration

Conversation

@alexwelcing
Copy link
Copy Markdown
Owner

Motivation

  • Provide a default remote 3D world (Marble) with an associated panoramic image and Gaussian splat so the 360 experience has a rich remote entry point.
  • Add physical collision geometry so the 3D world can be used with the physics environment and interactions.
  • Support additional Gaussian splat formats and wire remote assets into existing discovery flows for a smoother authoring and loading experience.
  • Improve background rendering control and axis handling to allow layered pano+splat rendering without visual or physics mismatches.

Description

  • Added lib/worlds/marbleWorld.ts and wired the Marble pano/splat defaults into ThreeSixty so the scene loads the remote world by default via onChangeImage and selects appropriate splat variants.
  • Implemented components/3d/scene/WorldCollider.tsx which loads a GLB, merges mesh geometries, and creates a trimesh collider via useTrimesh for physics.
  • Updated Gaussian splat and sphere background components to accept axis-aware scaling and new render flags by changing GaussianSplatBackground to normalize array scales and BackgroundSphere to accept radius, renderOrder, and depthWrite.
  • Extended discovery and API surfaces to include the Marble world and .spz files by updating /pages/api/backgrounds.ts to inject the world entry and /pages/api/getSplats.ts to detect .spz, and propagated the world type across UI components (tablet, gallery, terminal, scene gallery, world tracker).

Testing

  • Started the dev server with pnpm dev --hostname 0.0.0.0 --port 3000 and the application compiled and served pages successfully.
  • Exercised APIs and observed 200 responses for background and article endpoints including /api/backgroundImages, /api/backgrounds, and /api/articles-enhanced.
  • Executed an automated Playwright script to load / and capture a screenshot (artifacts/marble-world.png) showing the Marble world landing view.
  • No unit test files were added in this change set; manual/automated runtime checks above succeeded.

Codex Task

@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
next-docs-search Error Error Jan 11, 2026 7:50pm

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9a42b5b221

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 60 to +64
viewerRef.current.dispose()
viewerRef.current = null
loadedRef.current = false
}
}
}, [splatUrl, scene, camera, gl, position, rotation, scale])
}, [splatUrl, scene, camera, gl, position, rotation, normalizedScale])
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid reinitializing the splat viewer on every render

Because the useEffect depends on position/rotation arrays (which are recreated each render when passed as inline literals or defaults), and the previous loadedRef guard was removed, any parent re-render now disposes and rebuilds the Gaussian Splat viewer. This will repeatedly reload the splat when state updates occur (e.g., game timer changes), causing flicker and heavy CPU/network churn. Consider memoizing position/rotation or restoring a guard so the viewer only recreates when the splat URL or scale actually changes.

Useful? React with 👍 / 👎.

Comment on lines +349 to +353
if (scenery.splatUrl && performanceFlags.allowSplats) {
setUseGaussianSplat(true);
setSelectedSplat(scenery.splatUrl);
} else {
setUseGaussianSplat(false);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve 3D world assets when selecting a world

When a world is selected from the gallery, the scenery object often only includes path/type (because /api/backgrounds injects the Marble world without splatUrl/colliderUrl). In that case this branch explicitly disables splats and clears the collider, so re-selecting the Marble world from the terminal gallery downgrades it to a flat pano and drops physics. Either include the splat/collider URLs in the world entry or avoid clearing them when the world selection is missing those fields.

Useful? React with 👍 / 👎.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant