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

Compositor "scripts" for the batch renderer #1969

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

mosra
Copy link
Collaborator

@mosra mosra commented Dec 16, 2022

Motivation and Context

For creating the ReplicaCAD, YCB and Fetch composite files I posted on Slack. Pushing as a PR so the code is available but with no intention to ever merge this.

How to use

All three executables create a glTF file as an output, with the meshes joined together and referenced via a placeholder MAGNUMX_mesh_views extension, a material for every such mesh view and an uncompressed 2D array KTX texture, because that's the fastest. You can also use *.glb instead of *.gltf for the output file, which makes it self-contained, but that makes any introspection / debugging or further texture operations from below rather painful to perform.

The KTX texture, if you don't want to use it directly, can then be further processed either with Basis (which will likely be annoyingly slow, memory-hungry and time-consuming):

# Pass -c <options> to tune the compression quality
magnum-imageconverter -D3 --in-place -C BasisKtxImageConverter <file>.0.ktx2

Or, for a faster turnaround times, a cheap & quick block-compressed DXT texture:

magnum-imageconverter -D3 --in-place -C StbDxtImageConverter -c highQuality <file>.0.ktx2

Eventually I'll add more compression alternatives, such as BC7 and ASTC.

Easiest is to take the magnum-imageconverter executable either from Homebrew on macOS or from the prebuilt Linux binaries: https://github.com/mosra/magnum-ci/actions/workflows/magnum-tools.yml

ReplicaCAD compositor

Expects a folder named ReplicaCAD_dataset_v1.5 in the path/to/datasets directory. I.e., it does not use the directory structure used by the dataset_download.py script to avoid accidental version mismatches.

./compositor-replicacad path/to/datasets path/to/composite-replica.gltf

YCB compositor

Expects a folder named hab_ycb_v1.2 in the path/to/datasets directory.

./compositor-ycb path/to/datasets path/to/composite-ycb.gltf

Fetch compositor

Expects a folder named hab_fetch_v1.0 in the path/to/datasets directory.

./compositor-fetch path/to/datasets path/to/composite-fetch.gltf

How Has This Been Tested

Works On My Machine™

@mosra mosra added the do not merge Not ready to merge. This label should block merging. label Dec 16, 2022
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Dec 16, 2022
@mosra mosra changed the base branch from main to update-magnum19 December 16, 2022 21:36
@mosra mosra force-pushed the batch-renderer-compositors branch 3 times, most recently from 0240098 to 8754cf2 Compare December 18, 2022 12:24
Base automatically changed from update-magnum19 to main December 19, 2022 18:47
@mosra mosra mentioned this pull request Dec 20, 2022
11 tasks
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. do not merge Not ready to merge. This label should block merging.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants