Skip to content

feat(splats): add @sparkjsdev/radix 3DGS support on WebGPURenderer - #804

Draft
nsalminen wants to merge 6 commits into
mainfrom
integrate_radix_xrblocks
Draft

nsalminen wants to merge 6 commits into
mainfrom
integrate_radix_xrblocks

Conversation

@nsalminen

Copy link
Copy Markdown
Collaborator

Description

Integrates @sparkjsdev/radix as an optional, dynamically imported peer dependency for 3D Gaussian Splatting on THREE.WebGPURenderer. Radix uses WebGPU compute sorting when available and automatically falls back to WebGPURenderer's WebGL2 + worker-sort backend on XR devices where Chrome's experimental WebXR+WebGPU flags are off. @sparkjsdev/spark is retained for classic THREE.WebGLRenderer (which cannot compile TSL NodeMaterial) and .splat/.ksplat files.

  • Radix splat subsystem (src/splats/, Options.enableSplats()): Adds SplatsOptions, RadixSplatObject (THREE.Object3D wrapper with covariance bounds and uniform opacity fades), and RadixSplatManager (shared scene-wide SplatRenderer), with mobile XR defaults (antialias: false, framebufferScaleFactor: 0.8, sortBits: 16, maxStdDev: 2, minAlpha: 5/255).
  • ModelLoader & ModelViewer: Dispatches .ply, .spz, .rad, and .rdx to Radix on WebGPURenderer while keeping Spark on THREE.WebGLRenderer (auto-creating a shared SparkRenderer when needed).
  • WebGPU + WebXR support: Checks XRGPUBinding + xrCompatible adapter availability alongside clamped device limits in a single requestAdapter() call, forwards scaleFactor and fixedFoveation to XRGPUBinding.createProjectionLayer(), and sets depthWrite: false on the XRTransition skybox sphere so WebGPU depth passes don't cull geometry beyond 1m.
  • Samples & docs: Switches samples/xr_realism/3dgs_walkthrough/ to enableSplats() by default (~14 FPS -> 72 FPS on Android XR), keeps samples/spatial_ui/modelviewer/ on WebGL by default while configuring close-range Radix budgets for ?rendererBackend=webgpu, and updates docs/docs/manual/WebGPU.mdx and docs/docs/manual/ModelViewer.md.

Type of Change

  • Bug fix
  • New feature / enhancement
  • New demo or sample
  • Documentation update

Media / Screen Recordings & Screenshots (If Applicable)

  • Simulator Recording:
  • Device Recording:

Checklist

  • Tested in simulator & device: Verified functionality in desktop simulator and/or physical hardware (where applicable).
  • Large Assets ($\ge$ 1MB): Submitted separately to xrblocks/proprietary-assets via jsdelivr CDN.
  • SDK Dynamic Dependencies: All new SDK dependencies are dynamically loaded at runtime.
  • Security: Confirmed no hardcoded API keys or secrets are committed.

Add @sparkjsdev/radix as an optional peer dependency and devDependency, externalize @sparkjsdev/radix(/*)? in rolldown.config.js, and alias @sparkjsdev/radix's unused macOS fsevents dependency to @preact/signals-core so Linux installs and consumer type checks succeed without duplicating three.
XRTransition renders a 1m skybox sphere at renderOrder -Infinity with depthTest: false. WebGL implicitly suppresses depth writes when GL_DEPTH_TEST is disabled, whereas WebGPU maps depthTest: false to depthCompare: 'always' while keeping depthWriteEnabled: true, writing 1.0m across the depth buffer and culling scene geometry/splats beyond 1m.
…config

Resolve WebXR+WebGPU availability and adapter-clamped baseline device limits in a single requestAdapter() query, forward scaleFactor and fixedFoveation into XRGPUBinding.createProjectionLayer(), support XRGPUBinding.getNativeFramebufferScaleFactor(), forward logarithmicDepthBuffer to WebGPURenderer, and add URL overrides (?antialias, ?framebufferScaleFactor, ?forceWebGL).
Add SplatsOptions, RadixSplatObject, RadixSplatManager, and options.enableSplats() to coalesce visible 3DGS nodes into a shared @sparkjsdev/radix SplatRenderer on WebGPURenderer across both native WebGPU and its WebGL2 + worker-sort fallback, with mobile XR defaults, O(1) uniform fades, stereo view-key sharing, raycast no-op safety, and deferred GPU resource release.
Dispatch .ply, .spz, .rad, and .rdx assets to @sparkjsdev/radix on THREE.WebGPURenderer (covering both native WebGPU and its WebGL2 TSL fallback) while retaining @sparkjsdev/spark (.ply, .spz, .splat, .ksplat) on classic THREE.WebGLRenderer, auto-ensuring SparkRenderer on WebGL scenes.
Enable Radix 3DGS by default in 3dgs_walkthrough, keep spatial_ui/modelviewer on WebGL (@sparkjsdev/spark) by default while configuring single-vsync close-range Radix splat budgets when ?rendererBackend=webgpu is selected, externalize @sparkjsdev/radix in template 13_typescript_vite, and document Radix vs Spark backend support in WebGPU.mdx and ModelViewer.md.
@nsalminen
nsalminen force-pushed the integrate_radix_xrblocks branch from d83cd76 to 1965d46 Compare November 16, 2026 19:06
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.

1 participant