google / filament

Filament is a real-time physically based rendering engine for Android, iOS, Windows, Linux, macOS, and WebGL2
https://google.github.io/filament/
Apache License 2.0
17.7k stars 1.87k forks source link

Rendering exceptions with GLB file #7733

Closed ShenYj closed 4 months ago

ShenYj commented 6 months ago

⚠️ 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):

Smartphone (please complete the following information):

Additional context

It's OK by Reality Converter Application on macOS

ShenYj commented 5 months ago

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

romainguy commented 5 months ago

Did you match the lighting?

ShenYj commented 5 months ago

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

ShenYj commented 5 months ago

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

pixelflinger commented 4 months ago

I don't understand what the bug is. Please open a discussion instead if you need help with glTF or filament. There is nothing actionable for us here.