Details
Description
Looking into QTBUG-94616, there seems to be several related issues, and not limited to the using SDR (non-HDR) image source as in that bug report.
- Exposure mapping is always done, and cannot be disabled, and makes a significant difference also with the default probeExposure value. For one thing, it does not make sense for SDR source, so if we want to support that, the mapping must be opt-outable. Another thing is that exposure mapping is really a form of tone mapping (it maps values down to the [0,1] range), so it is not even clear if it in general makes sense to do both.
- Actual exposure mapping is only done in the skybox shader (skybox.frag). The material shaders, when calculating the light froma lightprobe, only do a simple multiplication with the probeExposure value (sampleProbe.glsllib). This results in the issue that the lighting on objects from the skybox has a different profile than the rendering of the skybox itself. The screenshot in the bugreport above shows this: the mirror image of the sky on the sphere is much brighter than the sky itself.
- Although a lightprobe conceptually is a kind of Light, it does not have a straight brightness setting. It seems the probeExposure setting has ended up in a kind of double role, i.e. both as a tonemapping and brightness value, ref pt. 2 above.
- In addition, there is something fishy about how we use the qt_linearTosRgb() function as a tonemapping mode, even the default mode. The definition of tone mapping, afaik, is to map hdr values [0, inf) into the normalized [0,1) range - but the formula in qt_linearTosRgb() does not do that: it produces output > 1 for input > 1. This issue applies equally to the skybox shader as to the material shaders, they are using the same formula, only from different source files (skybox.frag vs. tonemapping.glsllib)
Attachments
Issue Links
- relates to
-
QTBUG-94616 Low saturation of sky texture
- Closed
For Gerrit Dashboard: QTBUG-96624 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
396252,6 | Correct probeExposure behavior | dev | qt/qtquick3d | Status: MERGED | +2 | 0 |
396847,3 | Correct probeExposure behavior | 6.3 | qt/qtquick3d | Status: MERGED | +2 | 0 |