Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Allows to read and convert a
.gltf
file with it's.bin
file and images to an OSG scene. You will need to install or reference JPG and PNG libraries to OSG when building in order to get the textures paths included in output file.(Note: it also supports
.osgb
files but embedded textures are not supported at the moment)Convert from glTF to OSG
The
osgconv
binary can be used for convert from glTF to OSG.Example:
osgconv file.gltf output.osgt
Features supported
Supports all common glTF features including PBR materials (metallic/specular), animation, skin and morph. Spare accessors and more specific features are not supported.
PBR Materials
PBR materials are not supported in OSG, so their parameters are added as metadata in the corresponding osg::StateSet.
Example of generated metadata:
Texture metadata
Factor metadata VEC3 glTF factors are split into two different metadata
Color
andFactor
. For diffuseFactor, it's split intoDiffuseFactor
which is the R of diffuseColor,DiffuseColor
which is RGB andOpacityFactor
Other values correspond to the remaining values defined in glTF materials (
alphaMode
,doubleSided
etc)