fix(gsplat): address review issues from #259 — transforms, progress bar, themeable colors - #261
Closed
lucianfialho wants to merge 8 commits into
Closed
fix(gsplat): address review issues from #259 — transforms, progress bar, themeable colors#261lucianfialho wants to merge 8 commits into
lucianfialho wants to merge 8 commits into
Conversation
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>
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. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
| <th>Component</th> | ||
| <th>Description</th> | ||
| <th>Key Props</th> | ||
| </tr> |
Contributor
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, |
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.LoadAsyncreturns aSplatobject — the d.ts declared it asPromise<void>, so transforms were impossible to apply. Fixed the type declaration and now apply position/rotation/scale after each load. AddedeulerToQuaternionhelper to convert Vec3 degree angles to Quaternion.2.
visibleprop forwarded end-to-endAdded
visibletoSplatEntry,GaussianSplatHandle, and the load loop. TheGaussianSplatComponentnow tracks and exposes it viauseImperativeHandle.3.
quality,alphaHash,toneMappedremoved from standalone catalogThese have no equivalent in the gsplat.js API. They remain in
@json-render/react-three-fiberwhere drei'sSplatsupports 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.
ProgressIndicatorcolors are now themeableAdded
progressBarColor,progressTrackColor,progressTextColor,progressBackgroundColorprops toGaussianSplatViewer.Bonus: Pre-existing TS2769/TS2322 type error fixed
props.position ?? DEFAULT_POSinferred as[number, number, number, ...unknown[]]instead ofVec3— added explicitas Vec3casts.