UniVRM
UniVRM copied to clipboard
Importer uses invalid image when glTF texture's `source` is empty.
glTF の texture の source プロパティが空のとき、0 番目の image を参照してしまう。
これは UniGLTF における glTF の型定義が null 許容型でないことに起因するバグなので、そこからの根本完結が必要。
空のときのふるまい
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) のデフォルトテクスチャーを返してやる必要がありそう。