Skip to content

examples: First-person and third-person gsplat examples on Sunnyvale#8736

Open
mvaligursky wants to merge 2 commits into
mainfrom
mv-gsplat-fps-tps-examples
Open

examples: First-person and third-person gsplat examples on Sunnyvale#8736
mvaligursky wants to merge 2 commits into
mainfrom
mv-gsplat-fps-tps-examples

Conversation

@mvaligursky
Copy link
Copy Markdown
Contributor

@mvaligursky mvaligursky commented May 16, 2026

Adds two new Gaussian Splatting examples that demonstrate walking through a gsplat scene with physics, plus a new reusable third-person camera/character controller and a small enhancement to ShadowCatcher.

Examples (new):

  • gaussian-splatting/first-person — First-person walkthrough of the Sunnyvale Heritage Park Museum gsplat with FPS-style movement, jump, mesh collision (driven by an invisible GLB collision proxy), and Ammo + Draco loaded up front.
  • gaussian-splatting/third-person — Same scene with a third-person animated character (bitmoji), driven via a new ThirdPersonController script. Adds:
    • Orbiting camera with scroll-wheel zoom (smoothed), pitch/yaw clamps, wall-collision avoidance smoothing, configurable initial pitch and minimum camera height.
    • Animation state machine (idle / walk / jog / jump / dance) driven by the controller's speed / jump events plus a Q key to trigger the dance.
    • Env-atlas based IBL ambient lighting with the visible Skybox layer disabled (so the gsplat is the visible background).
    • Shadow catcher plane that follows the character on the ground via a downward raycast, with drawBucket: 0 so it renders after the gsplat.
    • Inverted-look-Y example wiring.
  • Scene assets streamed from S3 (same pattern as lod-streaming), with CC BY 4.0 attribution to zeitgeistarchivescans (https://superspl.at/scene/d5d397aa) in the example headers.
  • Thumbnails added for both examples (gaussian-splatting_first-person_*.webp, gaussian-splatting_third-person_*.webp).

New reusable script: scripts/esm/third-person-controller.mjs

Modeled directly after first-person-controller.mjs (same input pipeline: KeyboardMouseSource + DualGestureSource + GamepadSource, same grounded-raycast pattern). Public @attribute API:

  • Entity refs: camera, characterModel
  • Movement: lookSens, invertLookY, speedGround, speedAir, sprintMult, velocityDampingGround, velocityDampingAir, jumpForce
  • Orbit camera: initialPitch, pitchMin, pitchMax, cameraDistance, cameraDistanceMin, cameraDistanceMax, cameraHeight, cameraMinHeightAboveCharacter, cameraMinDistance, cameraCollisionPadding, cameraPositionDamping, cameraLookAtDamping, cameraCollisionDamping, zoomSpeed, zoomDamping
  • Character model rotation: modelTurnSmoothing, modelYawOffset
  • Anim hook thresholds: walkSpeedThreshold, jogSpeedThreshold
  • Mobile/gamepad dead-zones and joystick UI event name (same as FPS controller)

Fires script events speed (0/1/2 idle/walk/jog when the bucket changes) and jump so consumers can drive an anim state graph without coupling.

ShadowCatcher enhancement: scripts/esm/shadow-catcher.mjs

  • New @attribute drawBucket (default 250 — preserves existing behaviour). Lets consumers control where the catcher sits in the transparent render order without poking mesh instances. Useful when the catcher needs to render after a transparent object like a gsplat ground (set to 0).
  • The mesh-instance assignment is now applied every frame in update() so runtime changes to drawBucket (and the existing scale) take effect.
third person first person

Adds two new Gaussian Splatting examples that demonstrate walking through
a gsplat scene with physics, plus a new reusable third-person camera /
character controller and a small enhancement to ShadowCatcher.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant