Skip to content

fix(gsplat): address review issues from #259 — transforms, progress bar, themeable colors - #261

Closed
lucianfialho wants to merge 8 commits into
vercel-labs:mainfrom
lucianfialho:fix/gsplat-review-issues
Closed

fix(gsplat): address review issues from #259 — transforms, progress bar, themeable colors#261
lucianfialho wants to merge 8 commits into
vercel-labs:mainfrom
lucianfialho:fix/gsplat-review-issues

Conversation

@lucianfialho

Copy link
Copy Markdown
Contributor

Built on top of @ManzoliW's excellent work in #259. This PR addresses the 5 issues raised in the maintainer review.

Changes

1. Splat transforms now applied (position, rotation, scale)

Loader.LoadAsync returns a Splat object — the d.ts declared it as Promise<void>, so transforms were impossible to apply. Fixed the type declaration and now apply position/rotation/scale after each load. Added eulerToQuaternion helper to convert Vec3 degree angles to Quaternion.

2. visible prop forwarded end-to-end

Added visible to SplatEntry, GaussianSplatHandle, and the load loop. The GaussianSplatComponent now tracks and exposes it via useImperativeHandle.

3. quality, alphaHash, toneMapped removed from standalone catalog

These have no equivalent in the gsplat.js API. They remain in @json-render/react-three-fiber where drei's Splat supports them. Keeping them in the standalone catalog was misleading — silently ignored.

4. Progress bar can no longer jump backwards

setProgress(overallProgress)setProgress(prev => Math.max(prev, overallProgress)).

5. ProgressIndicator colors are now themeable

Added progressBarColor, progressTrackColor, progressTextColor, progressBackgroundColor props to GaussianSplatViewer.

Bonus: Pre-existing TS2769/TS2322 type error fixed

props.position ?? DEFAULT_POS inferred as [number, number, number, ...unknown[]] instead of Vec3 — added explicit as Vec3 casts.

ManzoliW and others added 8 commits April 3, 2026 22:04
Standalone Gaussian Splatting renderer using Hugging Face's gsplat.js.
Provides GaussianSplat and GaussianSplatViewer components with progress
indicator, orbit controls, and Zod-based catalog definitions — no
Three.js dependency required.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds GaussianSplat to the R3F renderer using drei's Splat loader,
bringing the component count to 20. Splats are composable with all
existing R3F components (lights, controls, post-processing, etc.).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Demo app showcasing @json-render/gsplat with 5 scenes (bonsai, garden,
bicycle, kitchen, stump) loaded from Hugging Face datasets. Includes
scene selector, live JSON spec viewer, and progress indicator.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Demo app showcasing GaussianSplat in R3F with 5 scenes: splat showroom,
splat with primitives, multi-splat, post-processing effects (bloom +
vignette), and animated floating splat with sparkles.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds API documentation for @json-render/gsplat, updates the R3F docs
to reflect 20 components, and registers both example apps in the
docs navigation, examples list, and page titles.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds @json-render/gsplat to the fixed version group and creates a
changeset for the minor release of gsplat and react-three-fiber.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The catalog declared controls, autoRotate, autoRotateSpeed,
cameraPosition, cameraTarget, and fov props but the component
silently ignored them. Now:
- cameraPosition sets camera.position via SPLAT.Vector3
- cameraTarget calls controls.setCameraTarget()
- fov converts to focal length via camera.data.fx/fy
- controls=false skips OrbitControls creation
- autoRotate rotates the camera around Y in the render loop
- Updated gsplat.d.ts with full Camera/OrbitControls type surface

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ble colors

- Apply per-splat position/rotation/scale after LoadAsync (splats were
  rendering at origin regardless of config)
- Add eulerToQuaternion helper to convert Vec3 degrees to Quaternion
- Expose Splat class and correct LoadAsync return type (Promise<Splat>)
  in gsplat.d.ts so transforms can be applied imperatively
- Forward visible prop through GaussianSplatHandle and SplatEntry
- Fix progress bar regression: use Math.max so bar never jumps backwards
- Make ProgressIndicator colors themeable via progressBarColor,
  progressTrackColor, progressTextColor, progressBackgroundColor props
  on GaussianSplatViewer
- Remove quality/alphaHash/toneMapped from standalone gsplat catalog —
  these gsplat.js renderer has no equivalent API for them (they remain
  in @json-render/react-three-fiber where drei's Splat supports them)
- Fix pre-existing TS2769/TS2322 Vec3 type errors in GaussianSplat.tsx

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

@lucianfialho is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedgsplat@​1.2.98110010083100

View full report

<th>Component</th>
<th>Description</th>
<th>Key Props</th>
</tr>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The standalone gsplat API docs incorrectly list quality, alphaHash, and toneMapped as GaussianSplat props, but these don't exist in the standalone gsplat schema.

Fix on Vercel

Comment on lines +283 to +292
// Rotate the camera around the Y axis
const speed = autoRotateSpeed * 0.5;
const angle = speed * dt;
const pos = camera.position;
const cos = Math.cos(angle);
const sin = Math.sin(angle);
camera.position = new SPLAT.Vector3(
pos.x * cos - pos.z * sin,
pos.y,
pos.x * sin + pos.z * cos,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Rotate the camera around the Y axis
const speed = autoRotateSpeed * 0.5;
const angle = speed * dt;
const pos = camera.position;
const cos = Math.cos(angle);
const sin = Math.sin(angle);
camera.position = new SPLAT.Vector3(
pos.x * cos - pos.z * sin,
pos.y,
pos.x * sin + pos.z * cos,
// Rotate the camera around the Y axis, centered on the camera target
const speed = autoRotateSpeed * 0.5;
const angle = speed * dt;
const pos = camera.position;
const cos = Math.cos(angle);
const sin = Math.sin(angle);
const tx = cameraTarget ? cameraTarget[0] : 0;
const tz = cameraTarget ? cameraTarget[2] : 0;
const dx = pos.x - tx;
const dz = pos.z - tz;
camera.position = new SPLAT.Vector3(
tx + dx * cos - dz * sin,
pos.y,
tz + dx * sin + dz * cos,

Auto-rotation rotates the camera around the world origin (0,0,0) instead of around the configured cameraTarget, causing visible wobble/drift when the target is not at origin.

Fix on Vercel

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