Skip to content

Add FBX loader visual test model suite - #149

Merged
sebavan merged 3 commits into
BabylonJS:masterfrom
PatrickRyanMS:fbx-loader-test-models
Jun 10, 2026
Merged

Add FBX loader visual test model suite#149
sebavan merged 3 commits into
BabylonJS:masterfrom
PatrickRyanMS:fbx-loader-test-models

Conversation

@PatrickRyanMS

Copy link
Copy Markdown
Member

Summary

Adds a deterministic suite of 18 small FBX files under meshes/fbx/loaderTests/ that exercise the Babylon.js FBX loader's feature surface, for use as visual-test assets.

These back the FBX loader PR (BabylonJS/Babylon.js#18483).

Coverage

geometry / n-gon triangulation, smooth vs flat normals, material properties, texture slots (embedded + external sidecar), per-texture UV transforms, multi-material submeshes, transform chains (TRS / pre-post / pivots / geometric), skinning, morph targets + in-betweens, node / skeletal / morph animation, multiple animation clips, cameras + lights, and axis / unit GlobalSettings.

Notes

  • Authored programmatically (binary FBX, v7500) and validated against the Autodesk FBX SDK, so they open correctly in Maya and the loader.
  • meshes/fbx/loaderTests/README.md has a per-model feature/expectation table plus winding/axis/camera conventions.
  • M05 ships an external sidecar texture (m05_external_diffuse.png) co-located with the FBX.
  • *.fbm/ SDK texture-extraction folders are gitignored.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

A deterministic 18-file FBX suite (binary, v7500) exercising the Babylon.js
FBX loader feature surface: geometry/n-gons, smooth/flat normals, material
properties, texture slots (embedded + external sidecar), UV transforms,
multi-material submeshes, transform chains, skinning, morph targets,
node/skeletal/morph animation, multi-clip, cameras + lights, and axis/unit
GlobalSettings. Each file is authored programmatically and validated against
the Autodesk FBX SDK so it opens correctly in Maya and the loader. Includes a
README with a per-model feature/expectation table.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 10, 2026 05:24
@PatrickRyanMS
PatrickRyanMS requested a review from deltakosh June 10, 2026 05:25

Copilot AI left a comment

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.

Pull request overview

Adds a deterministic set of FBX visual-test assets under meshes/fbx/loaderTests/ to exercise a broad surface area of the Babylon.js FBX loader, along with documentation and local ignore rules for SDK-extracted texture folders.

Changes:

  • Add 18 small FBX loader test models (plus one sidecar PNG) covering geometry, materials/textures, transforms, skinning, morphs, animation, cameras/lights, and axis/unit settings.
  • Document per-model expectations and viewing conventions in README.md.
  • Ignore SDK-generated *.fbm/ extraction folders within the test-asset directory.

Reviewed changes

Copilot reviewed 2 out of 21 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
meshes/fbx/loaderTests/README.md Documents conventions and expected visual results per model.
meshes/fbx/loaderTests/.gitignore Ignores SDK-created *.fbm/ extraction directories.
meshes/fbx/loaderTests/m01_cube_phong.fbx FBX visual-test asset: basic mesh + Phong material + normals/UVs.
meshes/fbx/loaderTests/m02_geo_ngons.fbx FBX visual-test asset: n-gon triangulation + vertex colors.
meshes/fbx/loaderTests/m03_normals.fbx FBX visual-test asset: smooth vs flat normals comparison.
meshes/fbx/loaderTests/m04_material_properties.fbx FBX visual-test asset: Lambert/Phong material property coverage.
meshes/fbx/loaderTests/m05_textures.fbx FBX visual-test asset: texture slots (incl. embedded + external).
meshes/fbx/loaderTests/m05_external_diffuse.png Sidecar texture used by m05_textures.
meshes/fbx/loaderTests/m06_uv_transform.fbx FBX visual-test asset: per-texture UV translate/scale.
meshes/fbx/loaderTests/m07_multimaterial.fbx FBX visual-test asset: per-polygon material indices → submeshes.
meshes/fbx/loaderTests/m08_transforms.fbx FBX visual-test asset: transform chains (TRS/pre-post/pivots/geometric).
meshes/fbx/loaderTests/m09_skinning.fbx FBX visual-test asset: skeleton/clusters/weights/bind pose.
meshes/fbx/loaderTests/m10_morph.fbx FBX visual-test asset: morph targets + in-betweens (static).
meshes/fbx/loaderTests/m11_node_anim.fbx FBX visual-test asset: node animation interpolation coverage.
meshes/fbx/loaderTests/m12_skeletal_anim.fbx FBX visual-test asset: skeletal animation clip.
meshes/fbx/loaderTests/m13_morph_anim.fbx FBX visual-test asset: morph animation (DeformPercent).
meshes/fbx/loaderTests/m14_multiclip.fbx FBX visual-test asset: multiple animation stacks/clips.
meshes/fbx/loaderTests/m15_camera_lights.fbx FBX visual-test asset: cameras + lights aimed at subject.
meshes/fbx/loaderTests/m16_axis_yup.fbx FBX visual-test asset: GlobalSettings axis conversion (Y-up).
meshes/fbx/loaderTests/m16_axis_zup.fbx FBX visual-test asset: GlobalSettings axis conversion (Z-up).
meshes/fbx/loaderTests/m16_units_254.fbx FBX visual-test asset: GlobalSettings unit scale (2.54).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread meshes/fbx/loaderTests/README.md Outdated
PatrickRyanMS and others added 2 commits June 9, 2026 22:54
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
fbxVisualTests.js creates one framed, single-sided scene per model for the
Babylon.js visual-regression suite (referenced from the loader PR's
visualization config via scriptToRun + functionToCall). Camera/seek presets
mirror the generator's validated render config. README updated.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sebavan
sebavan merged commit 262ca81 into BabylonJS:master Jun 10, 2026
1 check passed
deltakosh added a commit to BabylonJS/Babylon.js that referenced this pull request Jun 11, 2026
> 🤖 *This PR was created by the create-pr skill.*

## Summary
- Add a built-in SDK-free FBX loader with binary/ASCII parsing, scene
interpretation, meshes, materials, textures, skeletons, animation
groups, cameras, and lights.
- Register and export the FBX loader through the loaders package,
including dynamic loader registration and SceneLoader plugin options.
- Add focused unit coverage for FBX parsing/interpreter behavior, loader
registration, material texture handling, normal-map coordinate options,
embedded texture loading, asset-container ownership, camera/light
orientation, axis/unit GlobalSettings handling, morph-target unit
scaling, and multi-clip animation.
- Add a visual regression suite (18 scenes) covering the loader feature
surface as Playground snippets, backed by a dedicated FBX model set in
the Assets repo, with committed WebGL2/WebGPU reference images.

## Notes
- FBX normal-map slots default to Y-up tangent-space convention, with an
opt-in Y-down loader option.
- FBX `Bump` and `BumpFactor` slots are treated as normal-map-like
inputs for compatibility until true grayscale height-to-normal
conversion is implemented.
- Embedded FBX textures use Babylon's delayed texture buffer path;
sidecar textures remain supported when no embedded bytes are present.
- FBX cameras look down local +X and lights down local -Z; the loader
derives each camera/light world position and aim from its node world
matrix (point transforms) so orientation is correct after the
left-handed conversion.
- `UnitScaleFactor` is treated as metadata only (it is not applied to
base geometry or morph-target deltas), so morphs stay consistent with
the unscaled base.

## Visual tests
- Entries live in `packages/tools/tests/test/visualization/config.json`
(the `FBX loader - ...` titles), one per model in
`meshes/fbx/loaderTests/`.
- Each test is a Playground snippet (`playgroundId`
`#DZBTQU#0`–`#DZBTQU#17`) with an async `createScene` that loads its
model from the Assets CDN via `BABYLON.AppendSceneAsync`, renders
single-sided to match Maya, frames it with a fixed orbit (or the
FBX-authored camera for the cameras/lights scene), and pins any
animation to a deterministic frame. Each entry carries per-feature
`dependsOn` tags (`Bones`, `Morph`, `Animations`, `Cameras`, `Lights`,
`Materials`, `Textures`, `Meshes`).
- The models, sidecar texture, and scene assets are in
BabylonJS/Assets#149 (merged, live on the CDN).
- Reference images for all 18 tests are committed under
`packages/tools/tests/test/visualization/ReferenceImages/` and the tests
are active (no longer `excludeFromAutomaticTesting`). All 18 pass
locally on both WebGL2 and WebGPU against a fresh build.

## Validation
- `npm run compile -w @dev/loaders`
- `npm run test -- packages/dev/loaders/test/unit` (FBX: 79 unit tests
passing)
- `npm run format:check`
- `npx playwright test --config playwright.config.ts --project=webgl2 -g
"FBX loader"` and `--project=webgpu` (18/18 FBX visual tests passing)

`npm run lint:check` currently fails on pre-existing core tree-shaking
manifest/side-effect-stub drift outside the FBX changes.

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: David Catuhe <david.catuhe@live.fr>
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.

3 participants