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
: booleanTEX_color_map
: Vector3f Texturebase_color
: Vector3fuse_normal_map
: booleanTEX_normal_map
: Vector3f Textureuse_metallic_map
: booleanTEX_metallic_map
: Vector3f (?) Texturemetallic
: floatuse_roughness_map
: booleanTEX_roughness_map
: Vector3f (?) Texture (?)roughness
: floatuse_emissive_map
TEX_emissive_map
: Vector3f Textureemissive
: Vector3femissive_intensity
: floatuse_ao_map
: booleanTEX_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.
This is nearly done. Reminder to self to consult the math here: https://github.com/KhronosGroup/glTF/blob/master/extensions/Khronos/KHR_materials_pbrSpecularGlossiness/examples/convert-between-workflows/js/three.pbrUtilities.js