google / google/filament

SheenCloth sample model crashes gltf_viewer with assertion

Open
#6,549 4 comments 0 reactions 1 assignee Claimed by @bejado View on GitHub
gltf
Dominant language
C++
Stars
20.5k
Forks
2.3k
Avg merge
2d 16h
Merged PRs (30d)
74

Description

**Describe the bug**
Debug builds of gltf_viewer crash when loading the SheenCloth.gltf sample model.

```
in void utils::panic(const char *, const char *, int, const char *):32
in file ../../libs/utils/src/debug.cpp
reason: ../../libs/gltfio/src/FilamentAsset.cpp:130: failed assertion `info.bindings.size() == 0 || info.flags == flags'
```

**To Reproduce**
Steps to reproduce the behavior:
1. Build gltf_viewer for debug
2. Download the [SheenCloth glTF 2.0 sample model](https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/SheenCloth).
3. Load the SheenCloth.gltf model into gltf_viewer

**Investigation**

A comment above the assertion reads:

```
// All bindings for a particular glTF texture must have the same transform function.
```

However, as seen with SheenCloth.gltf, this isn't always the case.

In the SheenCloth model, sheenColorMap (which wants a sRGB texture), and sheenRoughnessMap (which wants a linear texture) could both map to the same glTF texture.

In that case, one solution is to create two copies of the texture: one sRGB, and one linear. This, however, doubles the required texture memory.

**Desktop (please complete the following information):**
- OS: macOS
- Backend: All backends

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.