Jump to content

Morph targets with texture


Recommended Posts

4 minutes ago, aFalcon said:

Hey Oz,

   Great work... maybe the MorphTarget feature would do this, but I've not seen examples... (like an eye or a mouth) [yet] maybe you would be the first.


Ok, I'll use the MorphTarget class and see if the morph will also incorporate the materials for the meshes

Link to comment
Share on other sites

2 hours ago, NasimiAsl said:

why not we can try it

you wanna do it in your object?

i can make it by customMaterial  but need a morph object in PG


yeh cool.  I'll get back to you once I've finished cleaning up the textures

Link to comment
Share on other sites

  • 2 weeks later...

Ok @NasimiAsl I have a playground here https://playground.babylonjs.com/#BDG7ME#9

You can see the code in there where I'm loading the "pout" texture.  I'm wondering if its possible to fade into the pout texture as the morph target influence is increasing.

For some reason the morph target object (the head) moves out of place which is weird 'cos it looks completely fine in Blender.  Its another issue which I'm gonna have to fix.

Link to comment
Share on other sites

2 hours ago, NasimiAsl said:

Neat!  That's pretty cool.  Will be perfect once I figure out why the head moves away from the body.

I had other materials set up but they disappeared.  The original one was a multi-material with these materials in them ["maddie.skin","maddie.tongue","maddie.teeth","maddie.eyes","maddie.lashes","maddie.ponytail","maddie.eyes_outside"] but I think the custom material removed them.

Do you know how to preserve the multi-material?

Link to comment
Share on other sites

On 18/01/2018 at 1:02 PM, ozRocker said:

@NasimiAsl do you know how I can get this working with the multi-materials that were initially assigned to the mesh?



ok, I figured out how to use the custom material with multi-materials.  I've got it working in this playground https://playground.babylonjs.com/#BDG7ME#21

Is it possible to have more than one texture target?  In this example I have one for pouting.  What if I want another one for smiling and blinking?

Link to comment
Share on other sites

I did it! Shaders intimidate me, but when I remind myself that its just C code I'm ok :lol:

There is pouting and blinking in this one.  I added a "blink" text so its more obvious that its working.

I know this exercise might not seem worthwhile in this case, but I might do things like only morph textures if there's a close-up of the face.  Anyhow, this is a good experiment


I need to optimise now by separating head into its own UV map and using texture atlas if I have a texture for each morph target.  Anyway, the main problem I had is solved.  Thank you @NasimiAsl !

Link to comment
Share on other sites

  • ozRocker changed the title to [SOLVED] Morph targets with texture
  • RaananW changed the title to Morph targets with texture

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...