Home Technical Talk

Morph Target (Blendshape) UV switching

polycounter lvl 14
Offline / Send Message
pixeldamage polycounter lvl 14
My Issue

For convenience I've built a skinned character mesh using a base mesh head (with several morph targets for all head types).

Each morph target has it's own UV set and baked normals/ao etc.

Our target engine is Unity3D. I have the blenshapes working but I'd hoped that the UV data would get offset along with the vertex positions (I figured pos,color,uv etc is all in the vertex shader).

Without UV offsets per morph target, I get obvious stretching.

Research

I did some research and it souds like the blendshape data is stored in the UV channels.

- At first I thought I could transfer the unique UVs per target (but Unity only supports UV1/UV2(lightmapping). Not sure how their Blendshapes work unless all target data is held in one channel? Channel Info didn't help me find/see a culprit.

- Maybe it's possible to load in the head UV data via a texture fed into the shader or uv text file?

- It appears that Epic have a maxscript Morph Target exporter which exports normals. Wont solve my UV issue but makes me realise that Morph targets lose the normal data too

Has anyone got any tips for this workflow?

Replies

  • Eric Chadwick
    Options
    Offline / Send Message
    Most morphing systems only support the vertex position deltas, and everything else comes from the root mesh. It's just way more efficient that way, which puts you at a disadvantage.

    You might have a look into custom a vertex shader to make this work. How comfortable are you with Unity shaders?

    I used a custom engine awhile ago that supported all that. They had to specifically design it to support UV morphing, as well as material and animation morphing. Really cool stuff, but very memory hungry, with all that extra data.

    It's a cool problem. Good luck!
  • pixeldamage
    Options
    Offline / Send Message
    pixeldamage polycounter lvl 14
    Thanks Eric; I'm ok with Unity shaders but it'd definitely be a new challenge for me. I came across a similar issue with the UV1/2 limitation when I was wrote a decal shader which displays numbers on the back of a sports kit. Unfortunately that meant losing lightmap ability though the dynamic objects are currently lit with directional+ambient instead. I started looking into getting UV data into vertex color but deadlines got in the way - but it's a fun (and useful) project to pursue :)

    From what you said about performance, I'm now thinking MTs may be a bad idea. This is for a mobile game targeting iphone 4S and up. We've got decent performance at the moment but it may be better to swallow up the extra memory and having individual FBX files.

    I liked this method originally because of the simplicity of having one character fbx for all players. I originally thought it may be cheaper to use MTs to morph the same vert data than loading a new mesh per head. Any thoughts?
  • Eric Chadwick
    Options
    Offline / Send Message
    Jesse shared a boatload of info about modular characters. Might give you some ideas.
    http://wiki.polycount.com/SkankerzeroModularCharacterSystem
Sign In or Register to comment.