gltf gs extension + character controller fix - #429
Conversation
📋 perf — Test ReportBuild 20260720.5 · merge @ 345a2d5 |
📋 parity — Test ReportBuild 20260720.5 · merge @ 345a2d5 |
📋 perf — Test ReportBuild 20260720.6 · merge @ 3683f3d |
📋 parity — Test ReportBuild 20260720.6 · merge @ 3683f3d |
There was a problem hiding this comment.
Pull request overview
Adds parity coverage and loader support for the KHR_gaussian_splatting glTF extension (new Scene 266), and extends the physics character controller to allow rebuilding its capsule shape after construction. This fits into Babylon-Lite’s incremental parity-driven feature growth by adding a new glTF loader feature module and a new reference scene/test.
Changes:
- Add
KHR_gaussian_splattingas a dynamically-loaded glTF feature and implement conversion from GS attributes to Lite’s splat row-buffer format. - Introduce Scene 266 (Lite + Babylon.js reference) and a new parity spec + scene-config entry + per-scene bundle manifest.
- Add
setShapeOptions()/shapeOptionstoPhysicsCharacterControllerto rebuild the Havok capsule without recreating the controller.
Reviewed changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/lite/parity/scenes/scene266-gs-gltf.spec.ts | New parity spec for Scene 266, captures/compares against BJS reference. |
| scene-config.json | Adds scene 266 metadata and thresholds. |
| packages/babylon-lite/src/physics/character-controller.ts | Allows rebuilding the capsule shape via new options setter/getter. |
| packages/babylon-lite/src/loader-gltf/gltf-feature-registry.ts | Registers KHR_gaussian_splatting as a per-asset loader feature. |
| packages/babylon-lite/src/loader-gltf/gltf-feature-gaussian-splatting.ts | Implements GS attribute extraction + packing into Lite’s splat pipeline format. |
| packages/babylon-lite/src/asset-container.ts | Exposes internal _gaussianSplats promises contributed by the GS feature. |
| lab/public/bundle/manifest/scene266.json | Adds per-scene bundle manifest entry for the new scene. |
| lab/package.json | Pins Babylon.js packages to 9.16.0 for reference support. |
| lab/lite/src/lite/scene266.ts | New Lite scene that loads the GS glTF and waits for first sort before ready. |
| lab/lite/src/bjs/scene266.ts | New Babylon.js reference scene for GS glTF parity. |
| lab/lite/scene266.html | Adds dev HTML entrypoint for Scene 266. |
| lab/lite/bundle-scene266.html | Adds bundle HTML entrypoint for Scene 266. |
| lab/lite/babylon-ref-scene266.html | Adds Babylon.js reference HTML entrypoint for Scene 266. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@RaananW is working on making sure lite works with the latest bjs |
Perfect! I'll wait for his change |
Resolve scene-config.json: keep both scene226 (GS glTF) and master's scene266 (negative-scale-doublesided). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5eb0861b-0990-4481-8a6c-5821044709eb
📋 perf — Test ReportBuild 20260720.7 · merge @ ca939c2 |
📋 parity — Test ReportBuild 20260720.7 · merge @ ca939c2 |
# Conflicts: # lab/package.json # pnpm-lock.yaml
API ChangesAPI Extractor detected public API changes for No removed public API lines were detected; this appears to be additive. API Extractor diffdiff --git a/home/vsts/work/1/s/test-results/api-report/target/temp/babylon-lite.api.md b/home/vsts/work/1/s/test-results/api-report/current/temp/babylon-lite.api.md
index 25b23f0c..d5839cda 100644
--- a/home/vsts/work/1/s/test-results/api-report/target/temp/babylon-lite.api.md
+++ b/home/vsts/work/1/s/test-results/api-report/current/temp/babylon-lite.api.md
@@ -3842,7 +3842,9 @@ export class PhysicsCharacterController {
readonly onTriggerCollisionObservable: CharacterCollisionObservable;
penetrationRecoverySpeed: number;
setPosition(position: Vec3): void;
+ setShapeOptions(options: PhysicsCharacterControllerOptions, preserveFootPosition?: boolean): void;
setVelocity(velocity: Vec3): void;
+ get shapeOptions(): PhysicsCharacterControllerOptions;
staticFriction: number;
up: Vec3;
} |
Lite Playground - Static SiteBuild 20260731.25 - merge @ 2bbeeca |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 13 changed files in this pull request and generated no new comments.
Suppressed comments (2)
packages/babylon-lite/src/loader-gltf/gltf-feature-gaussian-splatting.ts:136
- readFloats(): CT_UNSIGNED_INT ignores the accessor's
normalizedflag (unlike other glTF strided readers in this repo), and thedefaultswitch case silently falls back to getFloat32 for unknown component types, which can mask bad input and corrupt splat data.
case CT_UNSIGNED_INT:
value = dv.getUint32(off, true);
break;
default:
value = dv.getFloat32(off, true);
tests/lite/parity/scenes/scene226-gs-gltf.spec.ts:20
- REFERENCE_DIR hardcodes the slug (
scene226-gs-gltf) even thoughcaptureGolden()resolves the golden directory fromsceneConfig.slug. Deriving the reference directory fromsceneConfig.slugavoids a silent mismatch if the slug ever changes.
const REFERENCE_DIR = path.resolve(__dirname, "../../../../reference/lite/scene226-gs-gltf");
const GOLDEN_REF = path.join(REFERENCE_DIR, "babylon-ref-golden.png");
Bundle Size ChangesIncreases
Sizes rounded to nearest KB. Run |
API ChangesAPI Extractor detected public API changes for No removed public API lines were detected; this appears to be additive. API Extractor diffdiff --git a/home/vsts/work/1/s/test-results/api-report/target/temp/babylon-lite.api.md b/home/vsts/work/1/s/test-results/api-report/current/temp/babylon-lite.api.md
index 25b23f0c..d5839cda 100644
--- a/home/vsts/work/1/s/test-results/api-report/target/temp/babylon-lite.api.md
+++ b/home/vsts/work/1/s/test-results/api-report/current/temp/babylon-lite.api.md
@@ -3842,7 +3842,9 @@ export class PhysicsCharacterController {
readonly onTriggerCollisionObservable: CharacterCollisionObservable;
penetrationRecoverySpeed: number;
setPosition(position: Vec3): void;
+ setShapeOptions(options: PhysicsCharacterControllerOptions, preserveFootPosition?: boolean): void;
setVelocity(velocity: Vec3): void;
+ get shapeOptions(): PhysicsCharacterControllerOptions;
staticFriction: number;
up: Vec3;
} |
Lite Playground - Static SiteBuild 20260731.26 - merge @ 2bbeeca |
Bundle Size ChangesIncreases
Sizes rounded to nearest KB. Run |
|
reviewing now. a question unrelated to code review - have you investigated why so many scenes increase in 50-200 bytes? is it related to the version update? |
Bundle Size ChangesIncreases
Sizes rounded to nearest KB. Run |
API ChangesAPI Extractor detected public API changes for No removed public API lines were detected; this appears to be additive. API Extractor diffdiff --git a/home/vsts/work/1/s/test-results/api-report/target/temp/babylon-lite.api.md b/home/vsts/work/1/s/test-results/api-report/current/temp/babylon-lite.api.md
index 25b23f0c..d5839cda 100644
--- a/home/vsts/work/1/s/test-results/api-report/target/temp/babylon-lite.api.md
+++ b/home/vsts/work/1/s/test-results/api-report/current/temp/babylon-lite.api.md
@@ -3842,7 +3842,9 @@ export class PhysicsCharacterController {
readonly onTriggerCollisionObservable: CharacterCollisionObservable;
penetrationRecoverySpeed: number;
setPosition(position: Vec3): void;
+ setShapeOptions(options: PhysicsCharacterControllerOptions, preserveFootPosition?: boolean): void;
setVelocity(velocity: Vec3): void;
+ get shapeOptions(): PhysicsCharacterControllerOptions;
staticFriction: number;
up: Vec3;
} |
Lite Playground - Static SiteBuild 20260731.31 - merge @ ec9d978 |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 93 out of 94 changed files in this pull request and generated no new comments.
Suppressed comments (2)
scene-config.json:52
- This PR raises multiple
maxRawKBvalues. Those are bundle-size ceilings enforced bytests/lite/parity/bundle-size.spec.ts, and GUIDANCE.md explicitly calls out that ceilings must not be changed without explicit user approval. If these increases are intentional, please link the approval/context; otherwise, the preferred fix is to keep ceilings unchanged and reduce the runtime bytes.
tests/lite/unit/character-controller-shape-options.test.ts:70 - These assertions rely on exact IEEE-754 representations (e.g. 0.19999999999999996) and can be flaky across JS engines or small implementation changes. Prefer asymmetric matchers (expect.closeTo) for the computed Y position and capsule endpoints.
Bundle Size ChangesIncreases
Sizes rounded to nearest KB. Run |
API ChangesAPI Extractor detected public API changes for No removed public API lines were detected; this appears to be additive. API Extractor diffdiff --git a/home/vsts/work/1/s/test-results/api-report/target/temp/babylon-lite.api.md b/home/vsts/work/1/s/test-results/api-report/current/temp/babylon-lite.api.md
index 25b23f0c..d5839cda 100644
--- a/home/vsts/work/1/s/test-results/api-report/target/temp/babylon-lite.api.md
+++ b/home/vsts/work/1/s/test-results/api-report/current/temp/babylon-lite.api.md
@@ -3842,7 +3842,9 @@ export class PhysicsCharacterController {
readonly onTriggerCollisionObservable: CharacterCollisionObservable;
penetrationRecoverySpeed: number;
setPosition(position: Vec3): void;
+ setShapeOptions(options: PhysicsCharacterControllerOptions, preserveFootPosition?: boolean): void;
setVelocity(velocity: Vec3): void;
+ get shapeOptions(): PhysicsCharacterControllerOptions;
staticFriction: number;
up: Vec3;
} |
Lite Playground - Static SiteBuild 20260731.33 - merge @ 8b24c6f |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 93 out of 94 changed files in this pull request and generated no new comments.
Suppressed comments (2)
scene-config.json:52
- This PR increases multiple
maxRawKBceilings. Per GUIDANCE.md:222, bundle-size ceilings must not be changed without explicit user approval; please revert these increases (or request approval with the before/after measured sizes and justification).
packages/babylon-lite/src/loader-gltf/gltf-feature-gaussian-splatting.ts:136 readFloatsdoesn't honoraccessor.normalizedforUNSIGNED_INT(5125), and thedefaultbranch silently reads float32. This is inconsistent with other strided-accessor readers (e.g. gltf-ext-basisu.ts) and can produce incorrect splat attributes or hide unsupported component types.
Bundle Size ChangesIncreases
Sizes rounded to nearest KB. Run |
Resolves conflicts in the generated per-scene bundle manifests by taking master's values; manifests are regenerated afterwards so they reflect the merged code. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Rebuilt all scene bundles so the committed manifests reflect the merged code (KHR_gaussian_splatting loader-feature registry entry + master's PBR diffuse-IBL fix). No scene exceeds its configured maxRawKB ceiling. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 82 out of 83 changed files in this pull request and generated 1 comment.
Suppressed comments (2)
scene-config.json:51
- This PR raises existing per-scene bundle-size ceilings (
maxRawKB) in scene-config.json. GUIDANCE.md forbids changing bundle-size ceilings without explicit user approval (GUIDANCE.md:222). Please revert the ceiling changes (or get explicit approval and document the measured overage numbers in the PR).
packages/babylon-lite/src/loader-gltf/gltf-feature-gaussian-splatting.ts:149 buildSplatBufferassumes every GS primitive has a POSITION accessor (attrs["POSITION"]!). If an asset is malformed (orisGsPrimitivematches via attributes but POSITION is missing), this will crash with a non-obvious error. Please validate required attributes and throw a clear error before reading accessors.
API ChangesAPI Extractor detected public API changes for No removed public API lines were detected; this appears to be additive. API Extractor diffdiff --git a/home/vsts/work/1/s/test-results/api-report/target/temp/babylon-lite.api.md b/home/vsts/work/1/s/test-results/api-report/current/temp/babylon-lite.api.md
index d63f27c7..b0f75fc1 100644
--- a/home/vsts/work/1/s/test-results/api-report/target/temp/babylon-lite.api.md
+++ b/home/vsts/work/1/s/test-results/api-report/current/temp/babylon-lite.api.md
@@ -3843,7 +3843,9 @@ export class PhysicsCharacterController {
readonly onTriggerCollisionObservable: CharacterCollisionObservable;
penetrationRecoverySpeed: number;
setPosition(position: Vec3): void;
+ setShapeOptions(options: PhysicsCharacterControllerOptions, preserveFootPosition?: boolean): void;
setVelocity(velocity: Vec3): void;
+ get shapeOptions(): PhysicsCharacterControllerOptions;
staticFriction: number;
up: Vec3;
} |
Bundle Size ChangesIncreases
Sizes rounded to nearest KB. Run |
Resolves conflicts in the generated per-scene bundle manifests by taking master's values; manifests are regenerated afterwards. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Adds the missing committed Babylon.js golden at reference/lite/scene226-gs-gltf/babylon-ref-golden.png (force-added past the reference/**/babylon-ref-*.png ignore rule, matching how every recent scene commits its golden) so scene226 parity diffs against a stable baseline instead of recapturing at runtime. Also rebuilds all scene bundles so the committed manifests reflect the merged code (KHR_gaussian_splatting registry entry + master's gsplat counting-sort and readonly dirty-tracking changes). No scene exceeds its configured maxRawKB. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
API ChangesAPI Extractor detected public API changes for No removed public API lines were detected; this appears to be additive. API Extractor diffdiff --git a/home/vsts/work/1/s/test-results/api-report/target/temp/babylon-lite.api.md b/home/vsts/work/1/s/test-results/api-report/current/temp/babylon-lite.api.md
index e2f917a7..70461da6 100644
--- a/home/vsts/work/1/s/test-results/api-report/target/temp/babylon-lite.api.md
+++ b/home/vsts/work/1/s/test-results/api-report/current/temp/babylon-lite.api.md
@@ -3843,7 +3843,9 @@ export class PhysicsCharacterController {
readonly onTriggerCollisionObservable: CharacterCollisionObservable;
penetrationRecoverySpeed: number;
setPosition(position: Vec3): void;
+ setShapeOptions(options: PhysicsCharacterControllerOptions, preserveFootPosition?: boolean): void;
setVelocity(velocity: Vec3): void;
+ get shapeOptions(): PhysicsCharacterControllerOptions;
staticFriction: number;
up: Vec3;
} |
Lite Playground - Static SiteBuild 20260803.20 - merge @ 0916db3 |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 82 out of 84 changed files in this pull request and generated no new comments.
Suppressed comments (3)
packages/babylon-lite/src/loader-gltf/gltf-feature-gaussian-splatting.ts:133
readFloats()normalizes BYTE/SHORT/USHORT/UBYTE whenaccessor.normalizedis set, butCT_UNSIGNED_INT(5125) currently ignoresnormalized. For strided GS attributes authored as normalized UNSIGNED_INT, this will produce incorrect values and diverge from the loader’s ownreadComponent()logic used elsewhere (e.g. BasisU path).
scene-config.json:52- This PR raises multiple
maxRawKBbundle-size ceilings. Per GUIDANCE.md, bundle-size ceilings must not be changed without explicit user approval (if exceeded, report the measured numbers and ask before raising). Please either (1) keep existing ceilings and reduce the added runtime bytes, or (2) get explicit approval for these ceiling bumps and document the measured overage that necessitates them.
tests/lite/parity/scenes/scene226-gs-gltf.spec.ts:8 - The header comment says the Babylon.js reference is captured “on-the-fly”, but
captureGolden()actually reuses the committed golden when it exists (only recaptures when the golden is missing,force=true, orRECAPTURE_GOLDENis set). Updating this avoids confusion about whether the parity baseline is stable/committed.
Bundle Size ChangesIncreases
Sizes rounded to nearest KB. Run |
No description provided.