JglTF - Java libraries for glTF
Note: These libraries are still subject to change.
The following image gives an overview of glTF:
A larger version of this image, as well as PDF versions, can be found on the glTF overview releases page.
The jgltf-model
project allows reading and writing glTF models, and accessing the elements
of that glTF model, while hiding most of the implementation details.
Adding the jgltf-model-extensions
project as a dependency in the Maven POM will automatically integrate the
support for all glTF extensions that are currently supported by JglTF.
(See the 'Extensions' section below for details)
The jgltf-model-builder project is built on
top of the jgltf-model project, and offers convenience functions
for building glTF models programmatically.
The jgltf-model-transform project is an
experimental project that aims at supporting structural
modifications of existing glTF models. For example, it contains functions for
pruning unused elements from glTF models, and for revalidating glTF models
after elements have been added or removed.
The implementations of core glTF and its extensions always come in two flavors:
- The
implproject contains classes for the low-level representation of glTF and its extensions. These classes are auto-generated from the JSON schema, and generally not visible to users. - The
modelprojects offer a convenience layer on top of theimplprojects, and offer structures that can be read and manipulated more easily.
For example, the jgltf-impl-v1 and jgltf-impl-v2
projects contain the classes that represent glTF 1.0 and 2.0 data, and are
auto-generated from the glTF JSON schema. The jgltf-model project offers
the convenience layer on top of these projects.
Users only have to add the jgltf-model-extensions
project as one of their Maven dependencies. This project does not contain any
functionality for itself. It only declares dependencies to all extensions that
are currently supported by JglTF. The implementations will then automatically
discover the classes that are required for the extension support, using a
Service Loader.
The extensions that are currently supported by JglTF are listed here:
EXT_mesh_gpu_instancingviajgltf-model-ext-mesh-gpu-instancingEXT_texture_webpviajgltf-model-ext-texture-webpKHR_draco_mesh_compressionviajgltf-model-khr-draco-mesh-compressionKHR_lights_punctualviajgltf-model-khr-lights-punctualKHR_materials_anisotropyviajgltf-model-khr-materials-anisotropyKHR_materials_clearcoatviajgltf-model-khr-materials-clearcoatKHR_materials_dispersionviajgltf-model-khr-materials-dispersionKHR_materials_emissive_strengthviajgltf-model-khr-materials-emissive-strengthKHR_materials_iorviajgltf-model-khr-materials-iorKHR_materials_iridescenceviajgltf-model-khr-materials-iridescenceKHR_materials_sheenviajgltf-model-khr-materials-sheenKHR_materials_specularviajgltf-model-khr-materials-specularKHR_materials_transmissionviajgltf-model-khr-materials-transmissionKHR_materials_unlitviajgltf-model-khr-materials-unlitKHR_materials_variantsviajgltf-model-khr-materials-variantsKHR_materials_volumeviajgltf-model-khr-materials-volumeKHR_mesh_quantizationviajgltf-model-khr-mesh-quantizationKHR_node_visibilityviajgltf-model-khr-node-visibilityKHR_texture_basisuviajgltf-model-khr-texture-basisuKHR_texture_transformviajgltf-model-khr-texture-transform
For each of of these ...model... projects, there is the corresponding
...impl-v2... project that contains the low-level classes.
The jgltf-obj is a library/application for loading OBJ files and
converting them into glTF 1.0 or 2.0 assets.
Note: This viewer was originally implemented for glTF 1.0. It does not fully support glTF 2.0 and PBR (physically based rendering).
The jgltf-viewer is a base library for glTF viewers.
The jgltf-viewer-jogl and
jgltf-viewer-lwjgl projects contain implementations
of this viewer based on JOGL and LWJGL.
The jgltf-browser is a simple standalone application that
combines functionalities of the JglTF libraries: It allows loading glTF
1.0 or 2.0 from files or URLs via drag-and-drop, offers a basic functionality
for browsing through the glTF structure, showing the images, shader code and
accessor data in a structured form, importing OBJ files as glTF, and saving
glTF as standard, embedded or binary glTF files.
