Understanding PBR material a little better

Hi, and sorry for this question but i’m new in 3D modeling.
I’ve read the doc but maybe there’s still something i miss.

I’ve made a mesh with Blender with some good result.
Here is the picture.

Then i exported the mesh in .glb format and then imported on my project.
This is my PG: https://playground.babylonjs.com/#HBRF92#29
I use a defaultEnvironment for the PBR lighting and a spot ligth for some effects.

As you can see the results are quite different.
The thing i didn’t understand the more is why in the PG the mesh imported didn’t react to the light like the sphere does. The texture seems “static”.

Where do i mistake?
Thank you in advance.

pinging @PirateJC

Hey @Mercurio! Welcome to the wonderfully exciting world of 3D Modeling!

So it looks like there’s something goofy happening with your export.

The texture for your normal map doesn’t seem right:

Normal maps are supposed to look like this:

It’s hard to know without seeing your Blender file, but it looks as though your base color texture is getting exported to both the base color property as well as the normal for your asset, which is not correct.

You’ll most likely need to bake your normal map in blender. Here’s a pretty good tutorial showing you how to do that:

Hope this helps guide you in the right direction.

1 Like

Thank you @PirateJC,
i had made a connection through base color texture and Bump heights. I suppose it’s wrong, so i connected to the normal map. This is my Blender shading nodes:


Now when i export it in .glb and open in sandbox i can see the normal map too.
However in my PG it still behaves quite differently:
First of all, it seems that bump is not applied and the spotLight has no effect.

Maybe am i supposed to set some environment lighting properties?
I attach also my .glb and Blender file, maybe i’ve made some mistake.
pallet.zip (1.5 MB)

Thank you so much for your support!

Sweet looks like we’re getting closer.

So you’ve got the base color set up correctly:

And you’ve now got the normal exporting correctly:

However I’m seeing the base color texture as the texture for Mettalic/Roughness AND Occlusion, which isn’t correct. Looking at your Blender shader setup confirms that you’re using the base color texture for your Metalic, Roughness, and occlusion channels. This is usually a very different texture that you’ll generate as a map for these different properties. In other words these values shouldn’t come from the base texture.

Let’s take @PatrickRyan’s awesome weapons demo as an example:

Here is the ORM texture that he’s using:

It’s a specific texture where each color channel has specific data for a specific property of the PBR material.

I hope this is helping!


Thank you @PirateJC,
telling the truth, i had tried to apply a reflection map that comes with my textures set: i can see some reflection on surface but the bump effect is not so clear like in blender. So in my tries i used the base color texture.
This is the texture i use

And this is my PG update with brand new .glb file

I got also a gloss texture, but i don’t think is the the right one for bump effect right? Anyway…here it is:

I’m thinking that maybe i’m struggling to get the same result of blender but simply…is not possibile :slight_smile:
Thank you

Don’t give up! It’s TOTALLY possible to get the same result, it just takes hooking everything up correctly.

Blender is VERY forgiving on what it’s rendered. Babylon.js, being a real time engine must be very specific for performance reasons, so it means that you have to keep each piece in mind.

Once you get it set up correctly in Blender, Babylon.js SHOULD match.

When using PBR, a couple more things to keep in mind:
IBL - Using image based lighting. Make sure that the HDR lighting in both Blender and Babylon.js are set up correctly.
Material - Make sure that your textures are assigned properly in both, as discussed above.

You’ll get there! It just takes a little time to master.

Keep going though, you’re not that far off!