Blender glTF/GLB Materials and Known Issues/Fixes

by | Oct 12, 2023

When exporting to the GLB format, you’ll need to follow some key practices to export a functional model with the right material settings. The points listed below are required to achieve the specific material function you want to export to GLB.

Key Points:

  • – The “Base Color” hex value, without a texture attached, must be set to white (#FFFFFF) if the material is to be adjusted later on by any app or platform in real-time. You may still have your textures attached, but make sure the Base Color socket value is 100% white.
  • – To add baked Ambient Occlusion to your exported model, a custom node group “glTF Settings”. with an “Occlusion” input must be connected to your AO texture.
  • – For Unlit materials (no lighting), a background shader must be used, unless with a texture (see below)
  • – Vertex Colors must be checked and adjusted (If Necessary) before export

Base Color

Spiff, like similar platforms, uses a canvas system and applies it to the 3D model’s base color channel in order to visualize the customization process and show it on the model. A quirk of the glTF/Babylon.js platform is that the base color hex value/socket value will tint whatever texture is connected to this channel. Make sure to set it to white (#FFFFFF) if it will be later updated by any editor. See below.

Screenshot 2023 10 12 at 10.14.42 am
Using Babylon.js Sandbox to demonstrate the tinting issue.
Screenshot 2023 10 12 at 10.15.44 am

Baked Ambient Occlusion

With no node input on the Principled BSDF node, we need to make our own for the GLB format to recognize on export. To do this, we will create a node group called glTF Settings with one input called “Occlusion

Screenshot 2023 10 12 at 11.53.43 am 1
Screenshot 2023 10 12 at 11.53.20 am

Unlit

To create an unlit material for your GLB, simply use a background shader node and connect it straight to the material output. Access the world shader node tree and copy it from there, paste it into your material node tree.

t6n6j

Vertex Colors

Exported GLB models will use the vertex colours you add directly, if you experience issues with your exported models being 100% black or another colour, try checking whether it has vertex colors in Blender.

Home » Documents » Content » Assets » 3D Models » Blender glTF/GLB Materials and Known Issues/Fixes