Closed alexGuntha closed 4 months ago
Yes, this is intentional. The question whether occlusion should affect IBL and punctual lights was discussed in these threads:
https://github.com/KhronosGroup/glTF/issues/1427 https://github.com/KhronosGroup/glTF/issues/915
It was concluded that occlusion is not affected by direct light sources.
All right, thank you, I should have been more careful about this one line in the glTF 2.0 spec
Hi, I'm using glTF-Sample-Viewer for a viewer I'm currently implementing, and models that feature an occlusion map do not behave as I expect when enabling only Punctual Lighting. Two screenshots showcasing the difference between IBL and Punctual, which is very visible in the Corset model:
For reference, here is something closer to what I expect (unless I misunderstood something about lighting) This viewer actually uses a directional light casting from the camera, which I believe in this case should look pretty similar to a point light at the same position.
I believe the issue is in source/Renderer/shaders/pbr.frag: the occlusion is computed only on the ..._ibl values, which are not updated when only USE_PUNCTUAL is defined. The comment suggests it's intentional, but I don't understand why?