ozRocker Posted January 3, 2018 Share Posted January 3, 2018 Is it possible to morph textures along with the mesh. In my video I'm using blend shapes from one shape to another but also morphing between textures. Just wondering if this is possible with Babylon.js JackFalcon 1 Quote Link to comment Share on other sites More sharing options...
JackFalcon Posted January 3, 2018 Share Posted January 3, 2018 maybe the MorphTarget: https://doc.babylonjs.com/how_to/how_to_use_morphtargets Quote Link to comment Share on other sites More sharing options...
ozRocker Posted January 3, 2018 Author Share Posted January 3, 2018 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. https://doc.babylonjs.com/how_to/how_to_use_morphtargets Ok, I'll use the MorphTarget class and see if the morph will also incorporate the materials for the meshes JackFalcon 1 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted January 3, 2018 Share Posted January 3, 2018 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 Quote Link to comment Share on other sites More sharing options...
ozRocker Posted January 3, 2018 Author Share Posted January 3, 2018 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 Quote Link to comment Share on other sites More sharing options...
ozRocker Posted January 17, 2018 Author Share Posted January 17, 2018 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. Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted January 17, 2018 Share Posted January 17, 2018 i am on it Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted January 17, 2018 Share Posted January 17, 2018 https://playground.babylonjs.com/#BDG7ME#10 i don't have old face textture @ozRocker https://playground.babylonjs.com/#BDG7ME#11 fixed Quote Link to comment Share on other sites More sharing options...
ozRocker Posted January 17, 2018 Author Share Posted January 17, 2018 2 hours ago, NasimiAsl said: https://playground.babylonjs.com/#BDG7ME#11 fixed 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? Quote Link to comment Share on other sites More sharing options...
ozRocker Posted January 18, 2018 Author Share Posted January 18, 2018 @NasimiAsl do you know how I can get this working with the multi-materials that were initially assigned to the mesh? https://playground.babylonjs.com/#BDG7ME#11 Quote Link to comment Share on other sites More sharing options...
ozRocker Posted January 21, 2018 Author Share Posted January 21, 2018 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? https://playground.babylonjs.com/#BDG7ME#11 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? Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted January 21, 2018 Share Posted January 21, 2018 i think that can possible by atlas texture let me try it by sample for you Quote Link to comment Share on other sites More sharing options...
ozRocker Posted January 22, 2018 Author Share Posted January 22, 2018 I did it! Shaders intimidate me, but when I remind myself that its just C code I'm ok 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 https://playground.babylonjs.com/#BDG7ME#23 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 ! NasimiAsl 1 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted January 22, 2018 Share Posted January 22, 2018 thanks my friend Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.