More work on perfect glTF support in Castle Game Engine follows 🙂
Things done lately related to glTF:
- Our engine demo examples/fps_game/ uses now glTF format for both level and creatures. So you can just export from Blender to glTF, using standard Blender exporter.
While X3D is still a great scene graph format our engine… But as a file format, glTF today wins, with much more capable Blender exporter, that already supports animations, PBR, textures, normalmaps and more. So we advise this approach.
Placeholders (detected for levels defined in level.xml) now account for Blender-> glTF behavior.
New orientation value otUpYDirectionZ, following Blender -> glTF behavior and both Blender and glTF conventions of “where is front”.
This will be default soon. Changing this default will break compatibility, but we really want to make glTF a first-class citizen for us.
CastleLoadGltf unit with public GltfForcePhongMaterials. This makes sense for people that want to easily upgrade their pipeline to glTF, but are not ready for PBR yet.
New X3D extensions: ValueTrigger (compatible with InstantReality) and
Shape.collisionfield (set to
"BOX"to collide as a box easily).
Saving X3D (in particular after glTF -> X3D conversion), now creates unique names for all X3D nodes if needed. This makes sure that model is saved preserving all DEF/USE references and routes (DEF/USE references cannot be always preserved in case names are not unique; in case names are empty, DEF/USE references cannot be preserved, and also ROUTEs cannot be recorded).
Fixed rendering animations defined by resource.xml with one scene for all animations.
Fixes to glTF skinned animation transformation in some cases.
Fixed normal vectors during glTF animations (normals need to be interpolated too).
Optimized animations: Store and use X3D
bboxSize, don’t recalculate useless octrees when not needed.
I’m working still on optimizing glTF skinned animation speed. It’s still a work in-progress (CGE now does various unnecessary things, causing a slowdown; and we don’t apply skin on GPU yet).