Exporting a GLB file to share it on Facebook
UPDATE: For Blender 2.80, see the Blender Manual 2.80 glTF/GLB documentation.

These instructions are for Blender 2.79x with the Khronos Blender Exporter:

https://github.com/KhronosGroup/glTF-Blender-Exporter

In addition to installing this plugin, you will also need a copy of the glTF2_Principled.blend file that ships with the plugin, for a custom node group it contains.  Future versions of this plugin (glTF-Blender-IO for Blender 2.8) will not depend on these custom nodes, and use the Principled BSDF node instead, but it will target the same channels in the glTF output file.

First, select Cycles as the rendering engine.  Then click File -> Append -> glTF2_Principled.blend -> NodeTree -> glTF Metallic Roughness.  This imports a custom node group into your blend project, that the exporter will look for when exporting materials.

Create a new Cycles material, and turn on "Use Nodes".  Then, select the newly appended node group, the "glTF Metallic Roughness" node, like this:



The inputs on this node correspond almost exactly to the various channels available inside the glTF 2.0 format, and the glTF exporter will specifically look to see what's attached to this node when creating the glTF file.

Note that some are named "Factor" or "Strength".  For example there is a "BaseColor" and also a "BaseColorFactor".  In Blender, these are just node inputs and you can attach anything.  But in glTF, the "BaseColor" is specifically a texturemap, that can be present or absent, and "BaseColorFactor" is a solid color (including alpha) that can either multiply against the BaseColor Texture, or be used in lieu of a BaseColor texture for cases where the base color is solid.

So keep that in mind when hooking up node inputs:  Connect only texture images to the primary inputs, and set solid colors on the "factor" inputs.

glTF can also pack Occlusion (Red), Roughness (Green), and Metallic (Blue) values into a single image.  Thus, a single image node can be connected to both the "MetallicRoughness" and "Occlusion" inputs, to allow that image to drive all three channels.

A tangent-space normal map can also be connected, and optionally an emissive map.  If you connect an emissive map, be sure to change the EmissiveFactor to white, as that gets multiplied by the map.  The default EmissiveFactor is black so that models don't emit light when the emissive map is missing.

A typical PBR wireup may look like this:



With these textures wired up, you're ready to export a full PBR model to glTF format.  If your target is Facebook, they currently have a size limit of 3 MB including textures, so keep it small!  Using JPG images may help get under that limit.  glTF supports both PNG and JPG image formats, but not arbitrary formats.

Use File -> Export -> GLTF.  There are two choices, one will save a text-based glTF file with binary mesh and separate texture image files, the other will save a combined ".glb" with mesh and textures all rolled into a single binary file.  Facebook wants the latter, the .glb file.  You can save a tiny bit more space by un-checking "Export Tangents" from the export options.  Facebook uses ThreeJS as its renderer, and the tangent vectors are easily recomputed on the client, so no need to clutter the export with them.

I hope this helps!