Apply material to mesh


I am new in Babylon, and I am little confuse of the workflow. I saw a lot of video tutorials, but I didn’t find how to resolve this question.

I use 3d max to create the meshes, and at the moment, I use the 3d max material editor to create the materials and export the model to glb. Works fine. The problem is using the 3d max material editor, I have some limitations (for exemple I want to combine two normals maps in a one material), so I started to use the Babylon editor material. I don’t have any problems, I can create the materials as I want.

The problem is here, I have the mesh created in 3d max, and I have the material created in the babylon editor material, and I don’t know how to apply this material to the mesh and export to glb.

I explored playground and sandbox but I don’t find the solution, and I think it should be very easy to do…but not for me :smiley:

Anyone can tell me what is the workflow to do it?

Thank you very much

Hi and welcome!

After loading the model you can apply the material to it. but it depends on the structure of your model. Want to reproduce this on the playground so we can help you?

Hi RaananW,

First all thank you for your help.

I try to explain my workflow. I don’t use babylon playground, I use the sandbox because is very easy to load a glb (previously exported from 3d max). I explored the playground a few days ago, but I don’t see the way to import directly a glb as the babylon sandbox.

So if I understand, through sandbox is not possible to apply a material previously created in babylon editor material?

It will be good if I can do it with Sandbox, because I saw how to modify a lot features of the mesh or material and I can export in glb format.

1 Like

I saw this video but don’t explain how to load a glb from my computer to the playground, or I didn’t see it.

To access them on playground, upload .glb-files to i.e. GitHub (public accessible) and put link into rootUrl-parameter (+ filename) of ImportMesh.

To start off, you can use this playground:

This is the problem, I need to upload to git-hub I don’t want to do it. Isn’t there any other way?

You can use dropbox if you have this. You can get a free account dropbox.
Alternatively you can set-up a local environment but it takes a bit more effort and you will not be able to share your PG. Opening either a Github or dropbox account is ez and free. I would advise you to choose from one of these. Or one of the other secure sources listed in the doc, as per the link shared above by @JohnK . The problem here is that the browser is requesting for a ‘secure’ source (part of CORS policies). This is actually not a restriction from Babylon.js. We just have to do with it.
Meanwhile, have a great day :sunglasses: