Blender PBR materials

This thread is a continuation from the Materialize thread and intended to further the discussion of the PBR asset pipeline with respects to blender.

It carries on from these two comments by @Ali_RS,

and from @oualid,

Firstly, to carry on, the comments both were in reference to using the Principled BSDF node for rendering textures. The node hierarchy shown by ali,

The node hierarchy shown by oualid,
https://i.imgur.com/lwcZ5ls.png

For @Ali_RS and @oualid or anyone else, I assume you create your own node group for this?

I am having trouble getting the images to export using glTF2 and your node setup. How are you exporting the file?

If I use the glTF2 exporter blend and append or link the NodeTree file to my blend file, then the images are exported just fine.

I found that appending the Material (Material_MR or Material_SG) rather than the NodeTree (glTF Metallic Roughness or glTF Specular Glossiness) from the blend file creates a node group like this:

with everything ready to go.

Create an empty material.
Append the preferred MG file from the glTF2 .blend files Material folder.
Select it for the newly created material with the Browse Material to be linked button.
Rename it and your good to go.

After the first append, its always right there when you hit append again so its fast.

Why use the Principled BSDF route?

That’s because when we import a gltf model to blender (for example downloaded from Sketchfab) the gltf importer will automatically generate the Principled BSDF node for it. Now converting it to glTF Metallic Roughness node tree for each material manually to prepare it for export could be a time consuming task, the new add on will do the conversion task for you automatically.

Note that, the new add on has some issues (especially after they switched legacy exporter with experimental exporter ) and may not be ready to use at the moment.

PS: If you run to any issue with import/export using new addon please report it on addon page it will help them to quickly find and fix issues.

Yes but I build all my textures myself and same for the models so I guess that the way I am doing it by appending is the only way to do it without having to add each node manually. I see no other settings to just add the nodes all in one shot.

I have not looked into what is causing this but I notice all the PBR textures are very heavily shadowed on the dark side when in the engine. To the extreme as in black and this is without using shadow filters or renderer. Since the model is large and oval you can see where it fades into the darkness to the extreme.

Would be a pkers dream if they wore black equipment.

I figure its some parameter setting and I will get around to figuring it out eventually.

You probably already have a light probe or whatever… but that’s what I remember the effect being when I didn’t have one. Only lit surfaces showed, everything else was black like no ambient.

1 Like

Blender glTF I/O no longer requires the use of custom Cycles nodes when exporting PBR materials. Properties of the Principled BSDF node will be used automatically, as supported by the glTF 2.0 format. Only simple node inputs like Image Textures are currently supported, and complex node graphs are ignored.

Thank you, that fixed it.

I think we have a misunderstanding. The node group you use and the node group glTF2 blender file uses are both bsdf. The difference is the gltf ones are all nicely named and will export the images along with the file.

Using your and ali node setup requires manually setting up the nodes or creating a node group, if you want to create a material, rather than import a model with materials. Which means you still have to append or link if your not importing models.

I couldn’t get the images for the textures to export using that setup.

have you tried to export and import your node with blender it’s will switch automatically to blender’s Principled BSDF.
I think we are using different versions of the exporter, Ali uses the new exporter as well.

you might have a better experience with Blender’s Principled BSDF using the new exporter/importer.

Export for bsdf node setup like yours doesn’t export the material or images.

When I import the same file, it automatically sets up a new node group using the glTF2 nodes I show above, minus the Base Color Texture node and the Normal Texture node(ie. only the glTF Metallic Roughness node and Material Output node is there), which is to be expected since it did not export them in the first place.

Using the node setup I posted above, which is appended, works flawlessly, export and import.

This is why I don’t see how you guys are able to use the Principled BSDF node like you are doing. They even say on the website all other nodes except the image texture nodes will not be exported. Which is exactly the behavior I am seeing.

Edit: Basically, the Principled BSDF node is axed, thereby the image texture nodes are no longer linked so they and the other nodes do not export.

Edit: These are the latest exporter and importer.

are you sure you have this checked
https://i.imgur.com/TVwujai.png
cause this is how it looks when I import the same file:
https://i.imgur.com/P7Yvn2w.png

it should be the latest “exporter and importer” they are fused now :confused:

I installed the wrong script. Had to download the entire repo into a zip and extract it into addons. Linking to it from scripts in the user preferences wouldn’t work.

Why do you separate G B instead of using a metal and roughness’ map?

To save space?

this is how it looks when you export to gltf and import again

I see what you guys are doing,

I am left wondering though, is the node group in the file glTF2_Principled just creating a custom BSDF node for the user, which does the same thing as the nodes you use, just presented differently?

I ask because if you open up that node group and look at what’s inside it, it looks like you are missing a lot of things by doing it this way.

I think that that node was used before blender 2.7, there was no BSDF in Blender. now they will just use the default one since everyone is using it.
you can use the custom principled GLTF now but you will be forced to use blender’s Principled GLTF very soon (the release of blender 2.8).
to be clear the new I/O is still unfinished it might be better to use the “old” one.

I see. Several projects are all overlapping and it all starts at the io page. What a mess.

Thanks, I think I got it now.

Are you using a node group for this or just piecing this together for each material?

just piecing this together for each material

I see why now after learning about groups. You aren’t to use input or output nodes so not worth it.

You can create the nodes in a material and save the empty project and append from it, which is significantly easier.

I found out why the original problem of images not exporting was happening. If Blender throws an exception, at anytime, it will not export any images linked to the BSDF node. None. After a restart, it will export them.

I have tested the crap out of these scripts. All of them. The only setup I can get to work properly is the two old scripts of separate import and export. Which means having to redo them once the new scripts are officially released unless they make a converter or something.

Using the BSDF node with this setup with the new io scripts,
https://i.imgur.com/lwcZ5ls.png

will not export the roughness node, no matter what socket you connect to. All that can be done at that point is create a new material, manually transfer the image to your asset folder and build the material yourself , setting the MettallicRoughnessMap in the material.

If I try to add another node to the Metallic or Specular socket, Blender throws an exception that says more than one shader node texture used for a texture, can’t append image: channels full.

Basically, it will not export anything other than the Diffuse and Normal texture.

Edit: I just remembered reading about using the RGB channels of the roughness image to store all 3 images, forgot to do that. Will get back to this post afterwards.

Edit: no affect. Script just doesn’t work for me.

What os are you guys using?