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.82k stars 1.89k forks source link

IsoSphere tangents may not be calculated correctly #2687

Closed wojciechczerniak closed 4 years ago

wojciechczerniak commented 4 years ago

Describe the bug I'm not sure about this one. Looks like IsoSphere tangents are not calculated correctly?

I've tried to calculate tangents for an STL file with a code fragment from IsoSphere as suggested here https://github.com/google/filament/issues/959#issuecomment-472189487 but got some weird results with a simple plastic.filamat material. So I've checked more carefully the provided redball.html demo. Looks like the material is not applied correctly to IsoSphere if it has a different geometry than the default demo value?

To Reproduce Steps to reproduce the behavior:

  1. Copy redball.html demo
  2. Set IsoSphere nsubdivs to 0 (zero)

Expected behavior I would expect that IsoSphere with low res to be correctly covered with the set material.

Screenshots Redball demo plastic.filamat with IsoSphere nsubdivs set to 0: Screenshot 2020-06-14 at 23 37 53

IsoSphere with default nsubdivs set to 5 for reference: Screenshot 2020-06-15 at 00 02 13

Same plastic.filamat applied to susanne.html demo looks ok: Screenshot 2020-06-14 at 22 04 10

Desktop (please complete the following information):

romainguy commented 4 years ago

Hard to tell whether the lighting is correct or not. What do you expect that you are not getting?

wojciechczerniak commented 4 years ago

The material texture looked stretched and the geometry lost its edges. But you're right, it's the lighting. Pretty obvious now... it's set to make the sphere look good 🤦 Sorry.

And thank you.