CesiumGS / obj2gltf

Convert OBJ assets to glTF
Apache License 2.0
1.71k stars 307 forks source link

Does obj2gltf support multiple texture set? #121

Closed PsycoTodd closed 6 years ago

PsycoTodd commented 6 years ago

So if the obj contains multiple meshes and each one use a different material.

In this case, if mesh A and mesh B in this obj use different basecolor, metallic map, and roughness map, it can be achieved in the mtl file by setting map_Kd, map_Ks, and map_Ns in PBR case. However, this does not provide way to set normal map, emissive texture, and AO texture since these 3 seems to be given in the command line following --normalTexture, --emissiveTexture, -- occlusionTexture.

So how can be convert the obj like this with multiple texture set?

Thank you. Sincerely

lilleyse commented 6 years ago

The documentation could be improved, but this is the mapping that obj2gltf uses for understanding mtl values as pbr.

Name Slot
occlusion value Ka
emissive color Ke
base color Kd
metallic Ks
roughness Ns
alpha d (or Tr, but flipped)
occlusion texture map_Ka
emissive texture map_Ke
base color texture map_Kd
metallic texture map_Ks
roughness texture map_Ns
normal texture map_Bump