facebookincubator/FBX2glTF

Stingray PBS Material Support

zellski opened this issue · 1 comments

One of the biggest issues with FBX->glTF conversion is that the former has no canonical support for representing PBR materials, whereas glTF natively targets PBR exclusively.

The closest thing we have to a standard for representing PBR within a FBX is Stingray PBS. It encodes a metal/roughness workflow as follows:

  • A 'Maya' compound property, containing
    • TEX_global_diffuse_cube
    • TEX_global_specular_cube
    • TEX_brdf_lut
    • use_color_map: boolean
    • TEX_color_map: Vector3f Texture
    • base_color: Vector3f
    • use_normal_map: boolean
    • TEX_normal_map: Vector3f Texture
    • use_metallic_map: boolean
    • TEX_metallic_map: Vector3f (?) Texture
    • metallic: float
    • use_roughness_map: boolean
    • TEX_roughness_map: Vector3f (?) Texture (?)
    • roughness: float
    • use_emissive_map
    • TEX_emissive_map: Vector3f Texture
    • emissive: Vector3f
    • emissive_intensity: float
    • use_ao_map: boolean
    • TEX_ao_map: Vector3f (?) Texture

Furthermore, such a material's ShadingModel is unset, as opposed to the regular 'Lambert' and 'Phong' strings we see.

All in all, it should not be conceptually hard to detect this type of material, represent it internally as distinct from a Phong or Lambert material, all the way up to the glTF generating layer, where it can be output appropriately. In practice, it does require a non-trivial amount of internal refactoring.