Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Magnum with new scene tools, bindings and plugin additions #2114

Merged
merged 5 commits into from
May 24, 2023

Conversation

mosra
Copy link
Collaborator

@mosra mosra commented May 19, 2023

Motivation and Context

Continuation of #2100, with another ~10 days and >10 thousand lines of changes on the Magnum side. A large batch of features got finished and merged to master this time, and some breaking changes were needed to keep the API organized -- see below.

What's new:

  • Fixed some minor build issues with GCC 13
  • New expanded() and collapsed() APIs on multidimensional strided (bit) array views, similar to what Numpy's reshape() does
  • New pixelFormat() helper API for conveniently changing component count or sRGB encoding of an arbitrary PixelFormat
  • (Contributed by a 3rd party) The UfbxImporter plugin now has complete support for FBX skins and animations, allowing @0mdc to replace Assimp's broken FBX loading
  • New simplifyFailEmpty option in MeshOptimizerSceneConverter that'll make it fail in case simplification produces an empty mesh. By default it produces an empty MeshData, which can't be used to produce a valid glTF file. Related is also a minor fix to a bug that caused the plugin to trigger an assertion in presence of an empty mesh.
  • New forceBitDepth option for StbImageImporter and PngImporter that allows opening 16-bit images as 8-bit and vice versa. Added to work around a limitation of the Basis library which can only deal with 8-bit-per-pixel images.

New tools, especially of interest to @jturner65:

Additions to the magnum-sceneconverter utility, which you however usually use via the prebuilt tools instead of through Habitat:

  • New --passthrough-on-mesh-converter-failure and --passthrough-on-image-converter-failure options, making it possible to fall back to the original data for a particular failed -M or -P conversion
  • New --prefer option, adding an ability to choose an alternative plugin implementation, such as SpngImporter instead of the default PngImporter that may be as much as 2x faster
  • New --set option, allowing to set global plugin options like overriding bit depth of imported images, quality of exported JPEGs or Basis compression options. This used to be only partially possible before, done in a hacky way with [imageConverter] options in GltfSceneConverter, and --set is now the preferred way.
  • New --object-hierarchy option for --info-objects that'll visualize the object hierarchy by indenting the output. Useful for discovering object groupings or redundant nodes in a scene.

⚠️ Breaking changes: ⚠️

The old C++ APIs are still present but marked as deprecated and thus causing compiler warnings. For the Python bindings however it's a hard change with no fallback. I updated the affected code here, some changes are needed in habitat-lab as well, but there I unfortunately have no easy way to verify the changes. @aclegg3 can you handle the updates on the habitat-lab side? Thank you.

How Has This Been Tested

🍏

mosra added 3 commits May 19, 2023 16:28
The magnitude of normals changed due to a fix in
Matrix4::normalMatrix() done some time ago. Doesn't affect rendering in
any way as the normals get always normalized per-pixel.
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label May 19, 2023
Copy link
Contributor

@jturner65 jturner65 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Farewell T R I M E S H!!!

@mosra
Copy link
Collaborator Author

mosra commented May 20, 2023

This now includes also a GLFW application EGL fix for @eundersander and #2116.

@aclegg3
Copy link
Contributor

aclegg3 commented May 22, 2023

Assuming the tests pass on facebookresearch/habitat-lab#1356 against this branch I think we can merge both.

@mosra mosra merged commit bde806a into main May 24, 2023
@mosra mosra deleted the update-magnum26 branch May 24, 2023 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants