CesiumGS / obj2gltf

Convert OBJ assets to glTF
Apache License 2.0
1.68k stars 303 forks source link

Always decode specular texture #217

Closed lilleyse closed 4 years ago

lilleyse commented 4 years ago

Ran into an obj where diffuse, ambient, and specular referenced the same image file. Specular images need to be decoded to create the metallic roughness texture but this wasn't happening because the diffuse texture was being processed first, and diffuse textures don't require a decode. This PR adds more robust handling of shared textures.

OmarShehata commented 4 years ago

This works on the OBJ file exhibiting these properties (had to test it in a branch merged with https://github.com/AnalyticalGraphicsInc/obj2gltf/pull/218). I'm happy to merge, just asked a few clarifying questions.

lilleyse commented 4 years ago

@OmarShehata thanks for the quick review - ready now.

OmarShehata commented 4 years ago

All looks good with me @lilleyse ! I don't have write access, so please go ahead and merge.