Hardware (gpu) morphs

I want to share a quite simple set of scripts and a sample that shows how one can make morphs using shaders.

In the zip file there are a few scripts:
-gen_index.py [input egg model] [output egg model]
This script adds a vertex attribute named “index”. This index is later used in the vertex shader to determine what vertex to move.

-gen_morph.py [base model ] [target model] [output morph name]
This script takes two identical (in vertex order, not shape) models and writes out a morph (as a json file)

This one just displays the morph, it loads 3 morphs and adds sliders that adjust the weight of each morph. You need to zoom out a bit to see something.

The models in the zip are all made with MakeHuman (it’s C0), the code is public domain.

To run this you will need a recent dev build like this one:
buildbot.panda3d.org/downloads/4 … 1cceb4df8/

Here’s a video:

Here’s the code:

Special thanks to rdb.

If you have questions ask here.