Libgltf
glTF 2.0 parser/loader for C++17, supports many extensions likes `KHR_draco_mesh_compression`, `KHR_lights_punctual`, `KHR_materials_clearcoat`, and more.
Install / Use
/learn @code4game/LibgltfREADME
libgltf
The project includes a generator that can generate codes by glTF 2.0 JSON schema.
It is used in glTFForUE4.
Features
- glTF 2.0
- Load the gltf/embedded/glb file
- This is a static library
- Cross platform
- C++17
- Supports the Unicode and UTF8
- Supports some extensions
KHR_draco_mesh_compression- Google's DracoKHR_lights_punctualKHR_materials_clearcoatKHR_materials_emissive_strengthKHR_materials_iorKHR_materials_iridescenceKHR_materials_sheenKHR_materials_specularKHR_materials_transmissionKHR_materials_unlitKHR_materials_variantsKHR_materials_volumeKHR_texture_transformADOBE_materials_thin_transparencyAGI_articulationsAGI_stk_metadataCESIUM_primitive_outlineEXT_lights_iesEXT_mesh_gpu_instancingEXT_texture_webpFB_geometry_metadataMSFT_lodMSFT_texture_dds
- Platforms
- Windows
- Win32 (win32)
- x64 (win64)
- Linux (linux)
- macOS (macos)
- Android
- armeabi-v7a
- armeabi-v7a-with-neon
- arm64-v8a
- x86
- x86_64
- iOS
- iOS (iphoneos)
- watchOS (watchos)
- simulator
- Windows
Getting Started
- Update the submodule
Run
git submodule update --init - Generate the project by CMake
Run
cmake -G "[GENERATOR BY YOUR SYSTEM]" [LIBGLTF FOLDER] - Build the project and generate the static library
libgltf.liborlibgltf.a - Include
libgltf/libgltf.hin your project. - Link the static library
libgltf.liborlibgltf.ain your project.You have to link the static library
draco.libordraco.awith your project, if you want to support the Google's Draco. And you can find the draco in the external folder.
Code example:
std::shared_ptr<libgltf::IglTFLoader> gltf_loader = libgltf::IglTFLoader::Create(/*a function to load the file by std::istream*/);
std::shared_ptr<libgltf::SGlTF> loaded_gltf = gltf_loader->glTF().lock();
if (!loaded_gltf)
{
printf("failed to load your gltf file");
}
License
This software is released under the MIT license.
Related Skills
openhue
338.7kControl Philips Hue lights and scenes via the OpenHue CLI.
sag
338.7kElevenLabs text-to-speech with mac-style say UX.
weather
338.7kGet current weather and forecasts via wttr.in or Open-Meteo
tweakcc
1.5kCustomize Claude Code's system prompts, create custom toolsets, input pattern highlighters, themes/thinking verbs/spinners, customize input box & user message styling, support AGENTS.md, unlock private/unreleased features, and much more. Supports both native/npm installs on all platforms.
