Animated creature in Castle Game Engine with normalmaps baked from Blender Sculpt

Posted on

You can use Blender “Bake” feature to bake normalmaps from a high-poly model to be applied on a low-poly model. You can create the high-poly model e.g. using the “Sculpt Mode” in Blender.

Such normalmaps can be immediately used as the “normalMap” texture for Castle Game Engine.

The resulting model reacts nicely to lighting. It has a detailed shading, just like the high-poly version. But the geometry comes from the low-poly version, so it’s still very fast to render. This technique is 100% dynamic: both the creature, and the light, may be animated in any way, and the shading changes correctly.

The sample model is available in https://github.com/castle-engine/demo-models/tree/master/bump_mapping/lizardman . You can open it in view3dscene, and use the “Edit -> Lights Editor” to move the light’s location, and use the “Animation -> Named Animation -> …” to run a particular animation. For now, use the view3dscene version from snapshots or GitHub sources.

To use this technique in your own models, you need to use the “normalMap” field of the Appearance.

  • You can add it by manually editing an .x3d or .castle-anim-frames file, after exporting if from Blender.
  • You can specify normalMap in the material_properties.xml file.

See the “normalMap” documentation and the material_properties.xml documentation. And see the examples in demo-models/bump_mapping/ from demo models.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.