I’m building (in my head for the moment) a player character customizing system, and I need some advice… and to brainstorm with myself (writing things down helps).
I wanted to work with morphs -have one base mesh and many morphs (targets) with things like face presets, hair length, fat, muscle, etc. But there are some problems with it:
-few exporters support it
-slow with many morphs
-morphs in the model file.
Some time ago I made a shader that will do the morph on the gpu, but still:
-few exporters support it (and my own tool works only on models with identical vert order)
-morphs in the model file
-new shader needed for every number of morphs
-wastefull (if a morph moves 10% of verts it still needs a (0,0,0) value for the 90%)
The next thing I was thinking about are displacement maps - I never seen such a map to move the vertex in x, y and z, but why not? Just like a object space normal map I could use the rgb chanells to store offsets for every vertex. Each vert would need to have a unique UV but for me it’s not a problem - the size of this map could be. It would have to be so big that each vertex would have a pixel of its own and most of the pixels in the map would be blank… fail. Or is it…?
What if I could make new UV, such that each vertex of the model has a pixel for itself? I could just loop all the verts and put them side by side, like tiles every 1.0/texture_size unites. With a 256x256 I could store 65k verts.
If I had the morphs as images I could manipulate any number of them(add, multiply, etc) on the cpu just once (or use some buffer-shader-fu) and pass just one final image to the shader. The model would just need to have the extra uv set.
I would have to write my own tools for this to work and all morph-target models would still have to use the same vertex order (or have the same funky uv) as the base mesh.
Tangens and binormals would go wrong, but the model is animated, so I think they are only ‘corectish’ anyway.
The big question is: Am I making any sense at all? What would fail? Is there a better way?