Verge3D for Blender: glTF PBR Materials — Soft8Soft
Description: How to setup glTF-compliant PBR materials in Blender to be used with Verge3D.

# glTF PBR Materials / Blender

If your content needs to be fully-compatible with glTF 2.0 standard for some reason, you'll need to use the simplistic material setup. This setup is based on a limited set of Blender nodes which should be connected with each other as specified below.

Example of a scene made with glTF-compatible materials.

For usage example, check out the GLTF Compat demo (source files available in the Asset Store).

- Texture Packing
- Setting Up
- Exporting Textures from Substance Painter
- Exporting to glTF in Runtime

#

## Texture Packing

The glTF 2.0 standard implies that you pack the PBR components of materials into a single image (aka ORM texture):

- Occlusion factor is packed in the R channel. It's also possible to use separate texture for occlusion, but packing allows you to use less textures and thus makes your scene more size-efficient.
- Roughness factor is packed in the G channel.
- Metalness (metallic) factor is packed in the B channel.

#

## Setting Up

Add the Princlipled BSDF shader node to your material then connect texture nodes as follows. Note that all textures are optional and any of them can be safely omitted.

- Connect an Image Texture node to the Base Color input of the Principled BSDF node. Color Space of the texture must be set to sRGB.
- Connect Image Texture and Separate RGB nodes to the Metallic and Roughness inputs of the Principled BSDF node. For optimal loading and rendering of the PBR shader you should pack your occlusion, roughness and metallic textures into R, G and B channels of a single texture respectively. To enable occlusion rendering, the R channel of the occlusion texture should be connected as a mix factor of the black Diffuse shader. The Color Space setting of this texture must be set to Non-Color.
- Connect a Normal Map texture to the Normal input of the Principled BSDF node and an Image Texture node to that Normal Map node. The Color Space parameter of the texture must be set to Non-Color. You can also tune the normal map strength by using the Strength option.
- Connect an Image Texture node to the Emission input of the Principled BSDF node. Color Space of the texture must be set to sRGB.

If you need to tune your Base Color texture, e.g make it darker or mix with some other color, use Multiply node as shown on the picture below:

You can also use the Alpha input to tune your material transparency.

To see the preview of the Principled BSDF shader in the Blender viewport, you can set the display method of the 3D View to Rendering or just preview your scene in Verge3D with the Sneak Peak button on the same panel.

#

## Exporting Textures from Substance Painter

The models and the baked normal and occlusion maps (if any) can be loaded in Substance Painter via OBJ format.

Overall 3 maps are produced in this software in the end: base color/transparency, occlusion/roughness/metallic and normal.

To facilitate exporting textures from Substance Painter and to ensure maximum capabilities within the Verge3D engine we recommend using Verge3D export preset. Place this preset file to the export-presets folder usually located in the My Documents\Allegorithmic\Substance Painter\shelf\ directory (create it if does not exist).

When exporting textures from Substance Painter, choose Verge3d for Blender the export dialog window so that all generated textures are compatible with the glTF 2.0 standard Verge3D is based on.

#

## Exporting to glTF in Runtime

With export to gltf puzzle you can export your models or the entire scene in realtime. Then you can download the exported model or upload to the server for permanent storage. See more in the puzzle's reference.

## Got Questions?

Feel free to ask on the forums!