Lots of glTF work, new X3D extensions and conversion improvements

Blender desining example_level for glTF export to fps_game example

More work on perfect glTF support in Castle Game Engine follows 🙂

Things done lately related to glTF:

  1. 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.

  2. Placeholders (detected for levels defined in level.xml) now account for Blender-> glTF behavior.

  3. 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.

  4. 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.

  5. New X3D extensions: ValueTrigger (compatible with InstantReality) andShape.collision field (set to "BOX" to collide as a box easily).

  6. 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).

  7. Fixed rendering animations defined by resource.xml with one scene for all animations.

  8. Fixes to glTF skinned animation transformation in some cases.

  9. Fixed normal vectors during glTF animations (normals need to be interpolated too).

  10. Optimized animations: Store and use X3D Shape node bboxCenter, 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).

1 Like