Home

Awesome

guc

USD v24.11 USD v24.08

guc is a glTF to Universal Scene Description (USD) converter.

Unlike...

guc furthermore supports near-lossless material translation via the MaterialX standard.

All glTF features except animation and skinning are implemented and get continuously tested in guc's test suite.

<p align="middle"> <img width=360 src="preview_hdStorm.png" /> <img width=360 src="preview_glTFSampleViewer.png" /> </p> <p align="middle"> Wayfair's <a href="https://github.com/KhronosGroup/glTF-Sample-Models/tree/16e803435fca5b07dde3dbdc5bd0e9b8374b2750/2.0/IridescentDishWithOlives">Iridescent Dish with Olives</a> (<a href="https://creativecommons.org/licenses/by/4.0/">CC BY</a>) converted to USD+MaterialX with guc and rendered in hdStorm (left). The same model in Khronos's <a href="https://github.khronos.org/glTF-Sample-Viewer-Release/">glTF Sample Viewer</a> (right). </p>

Build

You need USD v23.11+ (e.g. <a href="https://github.com/PixarAnimationStudios/OpenUSD/releases/tag/v24.11">v24.11</a>) with MaterialX support enabled.

Do a recursive clone of the repository and set up a build folder:

git clone https://github.com/pablode/guc --recursive
mkdir guc/build && cd guc/build

Pass following parameters in the CMake generation phase:

cmake .. -Wno-dev -DCMAKE_BUILD_TYPE=Release

Build the executable:

cmake --build . -j8 --config Release

Note: set BUILD_SHARED_LIBS for shared builds, and CMAKE_MSVC_RUNTIME_LIBRARY to USD's MSVC ABI.

Usage

guc 0.5 - glTF to USD converter

Usage: guc [options] [--] <gltf_path> <usd_path>

Options:
  -m, --emit-mtlx                            Emit MaterialX materials in addition to UsdPreviewSurfaces
  -u, --mtlx-as-usdshade                     Convert and inline MaterialX materials into the USD layer using UsdMtlx
  -v, --default-material-variant=<index>     Index of the material variant that is selected by default
  -l, --licenses                             Print the license of guc and third-party libraries
  -h, --help                                 Show the command help

Both glTF and GLB file types are valid input. USDA, USDC and USDZ formats can be written.

An example asset conversion is described in the Structure Mapping document.

Extension support

NameStatus                        
EXT_meshopt_compression✅ Complete
KHR_lights_punctual✅ Partial <sup>1</sup>
KHR_materials_clearcoat✅ Complete
KHR_materials_emissive_strength✅ Complete
KHR_materials_ior✅ Complete
KHR_materials_iridescence✅ Complete
KHR_materials_sheen✅ Complete
KHR_materials_specular✅ Complete
KHR_materials_transmission✅ Complete
KHR_materials_unlit✅ Complete
KHR_materials_variants✅ Complete
KHR_materials_volume✅ Partial <sup>2</sup>
KHR_mesh_quantization✅ Complete
KHR_texture_transform✅ Complete

<sup>[1]</sup> Spotlight cone falloff is ignored.
<sup>[2]</sup> Thickness is <a href="https://github.com/AcademySoftwareFoundation/MaterialX/pull/861">not supported</a> by the MaterialX glTF PBR implementation.

Sdf plugin

The usdGlTF library implements USD's Sdf file format interface. Enable the GUC_BUILD_USDGLTF CMake option before building and install it as follows:

cmake --install . --component usdGlTF --config Release --prefix <USD_INSTALL_DIR>/plugin/usd

glTF files can now be referenced as layers and opened with USD tooling. The emitMtlx dynamic Sdf file format argument controls MaterialX material emission.

License


   Copyright 2024 Pablo Delgado Krämer

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.