f3d-app / f3d

Fast and minimalist 3D viewer.
https://f3d.app
BSD 3-Clause "New" or "Revised" License
2.76k stars 199 forks source link

White face on `DamagedHelmet.glb` #1535

Open snoyer opened 2 months ago

snoyer commented 2 months ago

When viewing DamagedHelmet.glb in F3D there strange white part on the underside that isn't white in other viewers; see below image comparing (left to right) Meshlab, gltf-viewer.donmccurdy.com, and F3D:

white-face

It looks like it could be an unfortunate reflection in the screenshot but it stays white when moving the camera around:

https://github.com/user-attachments/assets/7074a829-218f-4777-97fc-d7b0e76bbb6f

Could still be lighting-related as it interacts with bug #1506 in the wasm version: the part is correctly displayed in the "first render is incorrectly lit" state and becomes white when the "correct" lighting kicks in:

https://github.com/user-attachments/assets/571de106-a709-4bb3-ac4c-2a8c07291372

@mwestphal reports "it is present with the vanilla GLTFImporter of VTK"

Meakk commented 2 months ago

No exactly sure why yet, but there's an issue in the tangent computation.
Could be the tangent length close to zero, or the tangent being colinear with the normal.