No materials loaded from glb export from blender

Hey there

Another noob question,

I used the GLTF export addon for blender , I also set all the materials to use the metallic roughness group in the nodes exactly as shown in the docs :

But when I load this model, via the loader class in my own experiments or even via drag and drop in the sandbox, no materials are loaded … everything is just the same grey color. As can be seen in the screenshot my one material should be red. I double checked the export options and “export materials” is checked.

Any clues why no materials load? ( im exporting glb )

I think more than a screen shot might be needed, perhaps a .glb. When I recently got a grey material when I was expecting a PBR texture, this was due to an error in the .babylon exporter alpha for Blender 2.80. I forgot to switch to generation of a diffuseTexture to an albedoTexture.

One would think that this released exporter would not be setting diffuseColor instead of albedoColor, but that certainly looks like the effect.

I really cannot answer this directly. Since your material is very simple, you might just replace the node with a Principled one with the same settings, hit the ‘UsePBR’ check box, and see what the .babylon file version gives. The .babylon exporter might be using the glTF’s nodes in the future, but not in the current test. It also only runs in 2.79 today. If you have issues, please post the .log file.

Does ThreeJS have a sandbox, or some other easy resource out there, so it can be isolated whether the problem is on the exporter, or BJS side? Since you are using the sandbox & not using any textures, it would not seem like it was your error, for now.

thanks for the reply , I actually did just test it in the 3js sandbox and it also has all grey materials so something in the blender export must be failing, would you like me to send you the blend file? ( ps im using 2.79 ) I can send both the glb and the blend file if that will help you more. I grabbed the addon from official babylon page instructions as well.

In the babylon sandbox , it does list the material as a pbr material , so that seems good , just that it doesnt grab the diffuse color , well at least this is only as far as ive checked it so far.

As for the material actually required, this is just a learning experiment so the aim is to get all PBR materials as this is 90% of what I would use , hence why I set all the materials to that node group provided.

let me upload the files and send you a link , one mo

@JCPalmer here you go :slight_smile:

https://www.shaderbytes.co.za/babylonjs/files_samples_1/debug_samples.zip

I included the .glb , the .blend ( i stripped some dev stuff out of it fo file size ) and even the addon I grabbed. I hope this is enough info for you to get to the bottom of what im doing wrong or whever edge case bug is in the code.

ps I tried gltf and got the same results.

pps as a noob I also only discovered in metallic roughness, diffuse is named “base color” not “albedo” its a bit strand why it has another alias compared to the other pbr classes…

ppps , im avoiding using a .babylon file for now as I want to get a grips of handling all lose aspects of my 3d scene setup via code diectly first , once I have a good understanding of that I will look to make use of .babylon files. So for now its always only model export.

chat soon

This is not a log file from an exporter I wrote. I do not work on other people’s projects, though someone else who cruises this forum might. Blendstack is another place you might try.

Life is hard, and then you die.

Is your exporter addon public? send me a link if it is , thanks!

I just went with this addon as this sites tutorials pointed me towards it , thus I assumed it is the recommended best working version I would never expect you to work on some other guys tooling :wink:

cheers

(FYI you have linked the gltf node group from the Khronos blend, and so it’s not loaded into the blend you sent us)

You just have to put the albedoColor on BaseColorFactor, and not BaseColor which is reserved for textures

(here the gltf doc about, with a screenshot provided)

Thanks @Vinc3r , this solves the mystery at least but im not too sure if i fully agree with the logic though :slight_smile:

color should be color , whether it is flat color or a texture - the source is irrelevant

Factor is factor , it should be a scalar of the color value: 0-1 ( so should have a numeric slider - just like “metallicFactor” and “roughnessFactor” just below it a bit in the group.

There is a inconsistency of logic in this group both color and emission have factor controls that are color inputs.

So some factors are percentage scalars while others are colors ( a scalar as color input would only make sense if it was a monochrome selection )

Anyway not that any of this is your fault , just saying :wink: Thanks a million for your help/

cheers

Logic will be better once Blender 2.8 will be usable: gltf importer/exporter will be in Blender by default, and will using the Principled Node.
Actually you could already play with it but doc’ is lacking for now, you have to search insides issues, pull request, and commit to figure out how to use it, so not very convenient for now.

nice , I believe somebody told me 2.8 will be official in 2 or 3 months so not too long to wait. I have so much new things to learn now in regards to everything around babylon i will just wait for the official build , thanks for letting me know. Glad it will be part of the master build :wink:

While i dont beta test 2.8 i have watched videos on it so im geared up for some of the UI and shortcut changes. It makes sense to use the Principled node.

cheers