google/filament

Rendering exceptions with GLB file

ShenYj opened this issue · 5 comments

⚠️ Issues not using this template will be systematically closed.

Describe the bug

When using the .glb format 3D model, I accidentally found that some models could not display some parts normally, and further debugging found that whenever I cleaned up and scaled the model by pinching, this bug could be triggered, while the same model was normal under Android, because I was not good at working with 3D models and the principle of filament, I could only preliminarily locate the possibility of being related to _resourceLoader->addTextureProvider("image/ png", _stbDecoder); This line of code, my guess is that this 3D model has a problematic texture using png type images, which causes the rendering to be abnormal under iOS, but normal under Android?

To Reproduce
Steps to reproduce the behavior:

I've prepared a demo project for this purpose: here

  1. clone this project
  2. run pod install
  3. run the project on your phone and push to the second controller
  4. After zooming in and out of the screen with gestures, observe the doors of the building

Expected behavior

Without adjusting the model, it looks normal as Android

Screenshots

IMG_2113
IMG_2114

watch the door

Logs
FEngine (64 bits) created at 0x109818600 (threading is enabled)
FEngine resolved backend: Metal
Selected physical device 'Apple A16 GPU'
Backend feature level: 3
FEngine feature level: 1
glbFilePath: /private/var/containers/Bundle/Application/63F6A8B2-D522-417E-A92B-7C5297B1304C/OCDemo.app/c0ba1ab7e9104b288859389fe6d774ba_1057.glb

Desktop (please complete the following information):

  • OS: iOS
  • GPU: A16
  • Backend: OpenGL、Metal with the same result

Smartphone (please complete the following information):

  • Device: iPhone 14 Pro
  • OS: iOS 17.4.1

Additional context

It's OK by Reality Converter Application on macOS

Today I found a model with an abnormal rendering, or the demo I provided above, and uploaded a new glb model file, you can switch in the code to observe, here I compared and uploaded the rendering results of the Reality Converter under MacOS, I don't know if there is a problem with the rendering of Filament, the same model, Reality Converter behaves normally

Reality Converter :
截屏2024-04-12 14 54 25

Filament:
截屏2024-04-12 14 47 04

Did you match the lighting?

Did you match the lighting?

I've set up the lights and I'm using the IBL file provided in the filament demo with my own glb file, so I'm not sure I'm using it correctly, I've provided a demo with some changes based on the demo

demo

Why can't I update to your latest version every time, I've tried to clean the pod cache many times, 1.51.2 cleaned the cache a few times and it took a few hours to get it, but I can't get the subsequent version