CesiumGS / obj2gltf

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

Single-channel textures in 1.0 interpreted as alpha instead of luminance #143

Closed likangning93 closed 6 years ago

likangning93 commented 6 years ago

See https://github.com/AnalyticalGraphicsInc/obj2gltf/blob/1.0/lib/loadImage.js#L99.

When using single-channel grayscale textures this can lead to unintended results in Cesium:

Expected: right

Actual: wrong

likangning93 commented 6 years ago

Opening this as an issue instead of a PR because I don't know if there's a case where users would want single channel textures to be interpreted as alpha instead of luminance for gltf 1.0.

lilleyse commented 6 years ago

I can't think of a use case. It should be fine to always set the format to RGBA.

likangning93 commented 6 years ago

It should be fine to always set the format to RGBA.

We just need luminance for single-channel instead of alpha, I think the other cases should be fine. I'll open a PR soon.