A command line tool to convert core GLTF 2.0 for use in the Windows Mixed Reality home, following the published documentation.
Note that this tool does not enforce any limits specified in the documentation (polygon count, texture size, etc.), so you might still encounter issues placing models if you do not conform to those limits.
WindowsMRAssetConverter <path to GLTF/GLB>
-
-o <output file path>
- Specifies the output file name and directory for the output GLB
- If the file is a GLB and the output name is not specified, the tool defaults to the same name as input + "_converted.glb".
-
-lod <path to each lower LOD asset in descending order of quality>
- Specifies a list of assets that represent levels of detail, from higher to lower, that should be merged with the main asset and used as alternates when the asset is displayed from a distance (with limited screen coverage).
-
-screen-coverage <LOD screen coverage values>
- Specifies the maximum screen coverage values for each of the levels of detail, according to the MSFT_lod extension specification.
-
-temp-directory <temporary folder, default is the system temp folder for the user>
- Allows overriding the temporary folder where intermediate files (packed/compressed textures, converted GLBs) will be placed.
-
-max-texture-size <Max texture size in pixels, default is 512>
- Allows overriding the maximum texture dimension (width/height) when compressing textures. The recommended maximum dimension in the documentation is 512, and the allowed maximum is 4096.
WindowsMRAssetConverter FileToConvert.gltf -o ConvertedFile.glb -lod Lod1.gltf Lod2.gltf -screen-coverage 0.5 0.2 0.01
The above will convert FileToConvert.gltf into ConvertedFile.glb in the current directory.
Each asset goes through the following steps when converting for compatibility with the Windows Mixed Reality home:
- Conversion from GLB - any GLB files are converted to loose glTF + assets, to simplify the code for reading resources
- Texture packing - The textures that are relevant for the Windows MR home are packed according to the documentation using the MSFT_packing_occlusionRoughnessMetallic extension if necessary
- Texture compression - All textures that are used in the Windows MR home must be compressed as DDS BC5 or BC7 according to the documentation. This step also generates mip maps for the textures, and resizes them down if necessary
- LOD merging - All assets that represent levels of detail are merged into the main asset using the MSFT_lod extension
- GLB export - The resulting assets are exported as a GLB with all resources. As part of this step, accessors are modified to conform to the glTF implementation notes in the documentation: component types are converted to types supported by the Windows MR home, and the min and max values are calculated before serializing the accessors to the GLB
- Creating 3D models for use in the Windows Mixed Reality home
- Microsoft glTF LOD Extension Specification
- PC Mixed Reality Texture Packing Extensions Specification
- Microsoft DDS Textures glTF extensions specification
- Implementing 3D app launchers
- Implementing 3D deep links for your app in the Windows Mixed Reality home
- Navigating the Windows Mixed Reality home