Not sure if this a bug or too aggressive default option.
I had for long time been trying to figure out why PBR models often had a “washed out” look about them. Now I discovered that it appears to be the “enableSpecularAntiAliasing” option that is enabled by default by GLTF loader.
It looks to be too strong effect when using high brightness HDRI environments, which are pretty much required if you want HDRI based lighting to look realistic.
Compare these Playground scenes in different browser tabs:
Notice how there is a weird washed out halo around all the buttons and other details. And on top of that the antenna doesn’t anymore look metallic (but instead like white plastic) when viewed from front because the roughness value looks to be adjusted way too high by the antialiasing.
Maybe the specular AA needs some tweaking? Or maybe it shouldn’t be enabled by default in GLTF loader if it doesn’t work correctly in all cases?
could you try with a 256 sized env instead ? I remember setting it up for this size and guess it might impact ?
Hmm. Actually I’m not sure how to create specific resolution .env file.
That .env file is the 1k HDR format version of this HDRI: Hotel Room HDRI • Poly Haven
That was then scaled down to 512 in photoshop and then I just passed it through the IBL tool linked in the Babylon.js documentation. (Babylon.js Texture Tools)
But that tool doesn’t seem to have any options to specify the output resolution.
I found couple of years old smaller resolution .env file:
IIRC that is created with the “IBL Baker” tool, but it has massive “firefly” artifacting around the lights, so that is why I have used the online IBL tool lately because it seems to produce better quality results.
However, even with that lower resolution environment the issues seem to remain:
- Haloing around the buttons and creases, although not so easy to see behind the “fireflies”
- The antenna still looks like plastic. In fact even more so than the higher resolution .env file
Turning of specular AA fixes those issues also in the lower resolution env scene so I don’t think it is related to the resolution.
Hmm… It looks like the issue is also visible in https://sandbox.babylonjs.com/ environment when toggling specular AA in the inspector.
Even though it doesn’t have bright enough lights to cause the haloing issue, you can see that the antenna also turns into plastic looking and the reflection looks bit more faded out with specular AA enabled.
Yup it is a known side effect of AA as the normal variation is pretty large on this part. This should be improved in 6.0 with new IBL sampling strategy we are currently discussing.