Add FBX loader visual test model suite - #149
Merged
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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.
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
approved these changes
Jun 10, 2026
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>
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.
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
meshes/fbx/loaderTests/README.mdhas a per-model feature/expectation table plus winding/axis/camera conventions.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