Unreal Engine glTF Exporter Material Conversion

Unreal Engine’s glTF Exporter plugin translates custom, node-based material graphs into standard glTF 2.0 PBR materials primarily through an automated material baking process. Because glTF relies on fixed-function physical parameters rather than arbitrary shader logic, the exporter samples the outputs of complex Unreal material networks, bakes them into static 2D texture maps, channel-packs the results to match the glTF specification, and maps advanced features to official Khronos glTF material extensions whenever supported.

The Conversion Challenge

Unreal Engine’s Material Graph allows for dynamic mathematical calculations, procedural noise, vertex interpolators, and custom HLSL code. Conversely, glTF 2.0 utilizes a standardized Metallic-Roughness PBR model with strict inputs: Base Color, Metallic, Roughness, Normal, Ambient Occlusion, and Emissive. To bridge this architectural gap, the exporter cannot simply transfer the graph logic; it must evaluate and rasterize the visual results into static textures.

The Material Baking Pipeline

When the glTF Exporter encounters a material with mathematical nodes, blend operations, or procedural components, it triggers Unreal Engine's internal Material Baking utility.

  1. Graph Evaluation: The exporter evaluates the material's inputs per UV coordinate across a designated texture resolution defined in the export settings (such as 1024x1024 or 2048x2048).
  2. Rasterization: Complex node chains feeding into core pins—such as Base Color, Roughness, Metallic, and Normal—are rendered directly into temporary flat render targets.
  3. Texture Generation: These render targets are encoded into standard image formats (typically PNG or JPEG) to serve as the texture inputs for the resulting glTF asset.

If an input uses only simple scalar or vector constants without node logic, the plugin bypasses baking for that property and writes the raw numeric values directly into the glTF JSON parameters, reducing export time and file size.

Channel Packing for glTF PBR

The glTF standard requires specific data packing to optimize memory bandwidth on the GPU. The plugin automatically converts Unreal's separate property workflows into standard glTF channel layouts:

  • ORM Texture Packing: Unreal often separates Ambient Occlusion, Roughness, and Metallic. The glTF exporter composites these three baked grayscale values into a single texture: Red contains Ambient Occlusion, Green contains Roughness, and Blue contains Metallic.
  • Normal Maps: Unreal Engine's tangent-space normal maps are matched to glTF’s coordinate conventions. Any node-based normal blending (such as BlendAngleCorrectedNormals) is flattened into a single tangent-space normal map.

Handling Advanced Nodes via Extensions

Unreal Engine supports advanced shading models that exceed baseline glTF 2.0 capabilities. The exporter inspects the material graph for these models and maps them to corresponding Khronos (KHR) extensions where feasible:

  • Clear Coat: Shading models using Clear Coat are translated into the KHR_materials_clearcoat extension, baking clear coat roughness and intensity maps.
  • Transmission and Glass: Thin translucency and refractive nodes are baked and exported using KHR_materials_transmission and KHR_materials_ior.
  • Unlit Shading: Materials set to the Unlit shading model are mapped to the KHR_materials_unlit extension, disabling standard PBR lighting calculations in destination engines.
  • Emissive: Emissive inputs are exported with support for KHR_materials_emissive_strength to preserve high-dynamic-range (HDR) bloom and glow intensity values beyond the default 0–1 range.

Unsupported Features and Limitations

Certain dynamic properties cannot translate to static formats:

  • Time and Animation: Nodes that depend on the Time parameter or runtime scalar parameters are evaluated strictly at \(t=0\), turning animated procedural shaders into static images.
  • World Position Offset (WPO): Vertex displacement logic within the material graph is ignored by the texture baker, as glTF requires geometry-level morph targets or skinning for mesh deformation.
  • View-Dependent Logic: Nodes like Fresnel or CameraPosition are evaluated relative to a fixed orthogonal angle during the baking step, which can cause view-dependent reflections or rim-lighting effects to appear frozen or visually incorrect when viewed from other angles in the exported model.