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
.castle-anim-framesfile, after exporting if from Blender.
- You can specify normalMap in the material_properties.xml file.