Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use libgltfio_resources_lite.a library to crash in hello-gltf #4143

Closed
wangruibobobo opened this issue Jun 16, 2021 · 9 comments · Fixed by #4156
Closed

Use libgltfio_resources_lite.a library to crash in hello-gltf #4143

wangruibobobo opened this issue Jun 16, 2021 · 9 comments · Fixed by #4156
Assignees
Labels
gltf Specific to glTF support

Comments

@wangruibobobo
Copy link

Describe the bug

To Reproduce

Because libgltfio_resources.a took up too much space,
-DGLTFIO_LITE=1 was used at compile time, and libgltfio_resources_lite.a was chosen instead

Expected behavior
A crash occurs while hello-gltf is running

**in const SamplerInterfaceBlock::SamplerInfo filament::SamplerInterfaceBlock::getSamplerInfo(const char ) const:110
reason: sampler named "clearCoatMap" not found

Screenshots
企业微信截图_5e079b48-69f8-4353-92a5-a267a31debbd

Desktop (please complete the following information):

  • OS: iOS14
  • Backend: Matal

Smartphone (please complete the following information):

  • Device: iphoneX
  • OS: iOS14
@romainguy
Copy link
Collaborator

How exactly did you use -DGLTFIO_LITE? Did you compile the gltfio library yourself? That flag is not meant to be used to compile your app.

@wangruibobobo
Copy link
Author

In fact, I modified the libs/gltfio/CMakeList.text file.

CMakeLists.txt

And UbershaderLoader.cpp file.

企业微信截图_588a388a-ccc3-4da5-9cb2-fd06efe40888

Or how can I use it correctly libgltfio_resources_lite.a

Thanks.

@romainguy
Copy link
Collaborator

This define is needed in more places than just UbershaderLoader.cpp. You should pass it as a flag to the compiler.

@wangruibobobo
Copy link
Author

With these two lines of code currently compiled, how do I add flags

sudo ./build.sh -p desktop -i release
sudo ./build.sh -p ios -i release

@romainguy
Copy link
Collaborator

You need to modify build.sh to add -DGLTFIO_LITE=1 to the invocation of CMake in the function build_ios_target.

@wangruibobobo
Copy link
Author

I removed all the previous changes and added -DGLTFIO_LITE=1,
Run

sudo ./build.sh -p desktop -i release
sudo ./build.sh -p ios -i release

and change Other Linker Flags
Did I add it in the wrong place

企业微信截图_b6d8e30c-301e-40db-ba21-df3f1e07ca65
企业微信截图_5f4c7a3c-a6d4-4890-95f2-7aa691b05313

企业微信截图_cef02845-7182-4935-aff8-ab6bc10fefbe

@prideout prideout self-assigned this Jun 17, 2021
@prideout prideout added the gltf Specific to glTF support label Jun 17, 2021
@romainguy
Copy link
Collaborator

@wangruibobobo The problem you are running into is that gltfio-lite does not support clear coat. gltfio-lite only supports a subset of glTF extensions. If you want to support clear coat you will need to use the full version of gltfio. As for your linker error, you probably need to do a clean build for the flag to take effect (but like I just mentioned this won't fix your original issue with clear coat).

@wangruibobobo
Copy link
Author

Thank you for your quick reply. I would like to know if there is a material that is not supported by the Lite Library, will crash be caused? Will this material be ignored

@prideout
Copy link
Contributor

In debug builds, we assert if a sampler is set that does not exist, which can occur when attempting to load a model that uses an extension that is not supported by the ubershader. The intention is to not crash in release builds.

prideout added a commit that referenced this issue Jun 17, 2021
We will document this much more thoroughly in a subsequent PR.

Fixes #4143.
prideout added a commit that referenced this issue Jun 17, 2021
We will document this much more thoroughly in a subsequent PR.

Fixes #4143.
prideout added a commit that referenced this issue Jun 17, 2021
This avoids an assertion in debug builds. We will document this behavior
much more thoroughly in a subsequent PR.

Fixes #4143.
prideout added a commit that referenced this issue Jun 17, 2021
This avoids an assertion in debug builds. We will document this behavior
much more thoroughly in a subsequent PR.

Fixes #4143.
prideout added a commit that referenced this issue Jun 17, 2021
This avoids an assertion in debug builds. We will document this behavior
much more thoroughly in a subsequent PR.

Fixes #4143.
prideout added a commit that referenced this issue Jun 17, 2021
This avoids an assertion in debug builds. We will document this behavior
much more thoroughly in a subsequent PR.

Fixes #4143.
prideout added a commit that referenced this issue Jun 17, 2021
This avoids an assertion in debug builds. We will document this behavior
much more thoroughly in a subsequent PR.

Fixes #4143.
elisemorysc pushed a commit to elisemorysc/filament that referenced this issue Jun 23, 2021
This avoids an assertion in debug builds. We will document this behavior
much more thoroughly in a subsequent PR.

Fixes google#4143.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gltf Specific to glTF support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants