Jump to content

Multi Material not working after baking a mesh


slippery
 Share

Recommended Posts

I have a box mesh that I am baking a scaling transform into because it has child meshes whose current sizes I do not want to change. I have applied a multi material to this mesh that has 6 submaterials (one for each face). The problem is when I bake the scaling transform, the material starts displaying the same texture for each face rather than a different texture for each face (it displays correctly before baking). Does anyone know why this is and/or how I could fix this?

 

I won't have screenshots or code examples until i get into work tomorrow but if anyone has any ideas It would be very helpful1

 

 

Thanks,

Link to comment
Share on other sites

Hi Slippery, welcome to the forum!

 

http://www.babylonjs-playground.com/#1V3CAT#49  (a playground demo by Jerome and followers - which I have modified to test parenting-to meshBuilder mesh)

 

Take a look at lines 43 - 57... if you please.  See how you can build an 'options object' and use it as an arg/param... to make a box of any size... WITHOUT using scaling?  Yay meshBuilder!

 

Ain't that cool?  In line 56, I parent box2 ... to box ... and look at that!  No inherited scaling.  Scaling is still inherited, but the parent hasn't been scaled.

 

I don't know if/how any of this info applies to your sub/multi-materials issue.  I don't work with multi-materials very often.  So yeah, here you see the meshBuilder, and the perFace box-texturing thing... both are core contributions... by Jerome.  (He's a God!)  And both "features" might help your project... maybe.  Let's hope it works out that way.  Welcome again, keep us posted.

Link to comment
Share on other sites

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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