UniVRM icon indicating copy to clipboard operation
UniVRM copied to clipboard

Importer uses invalid image when glTF texture's `source` is empty.

Open Santarh opened this issue 4 years ago • 1 comments

glTF の texture の source プロパティが空のとき、0 番目の image を参照してしまう。

これは UniGLTF における glTF の型定義が null 許容型でないことに起因するバグなので、そこからの根本完結が必要。

Santarh avatar Dec 09 '21 11:12 Santarh

空のときのふるまい

https://github.com/KhronosGroup/glTF/blob/main/specification/2.0/schema/texture.schema.json

When undefined, an extension or other mechanism SHOULD supply an alternate texture source, otherwise behavior is undefined

つまり、source が null の場合に (1, 1, 1, 1) や (0, 0, 0, 0) のデフォルトテクスチャーを返してやる必要がありそう。

ousttrue avatar Aug 05 '22 09:08 ousttrue