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.75k stars 1.88k forks source link

Gltf model's color looks very different in two viewers #2893

Closed vcxyk closed 4 years ago

vcxyk commented 4 years ago

I have a glass model exported from Substance Painter and I dragged into two different viewers:

  1. Filament's gltf-viewer
  2. https://gltf-viewer.donmccurdy.com/

It looks a bit weird in Filament's gltf_viewer. Here's the screen-shot: image

Here's the model: glass.glb.zip

So what cause such a difference between two viewers? (I tried srgb/linear options in the second viewer but it seems not the reason.) Thanks:)

romainguy commented 4 years ago

I'll take a look but the lighting setup is different. Our viewer for instance has a strong directional light turned on by default.

romainguy commented 4 years ago

Here is what it looks like with a different IBL:

Screen Shot 2020-07-30 at 9 00 02 AM
vcxyk commented 4 years ago

Here is what it looks like with a different IBL:

Screen Shot 2020-07-30 at 9 00 02 AM

I change the IBL texture to "Venice Sunset", which is the same to the gltf-web-viewer. And we can see the rendering in Filament's viewer has a higher contrast, which makes it less realistic in an AR scene.

image

It seems the color encoding of IBL makes such differences? (Filament uses R11G11B10 while the web viewer use RGB8?)

romainguy commented 4 years ago

There's also the exposure, the tone mapping etc. And yes our IBLs are stored in HDR float as R11G11B10F instead of an 8 bit based encoding like RGBM.

romainguy commented 4 years ago

You may want to check what tone mapper the online viewer uses. I know many viewers default to Reinhard which produces very flat results.