Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-96624

Lightprobe/skybox exposure and tonemapping issues

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.3
    • 6.x
    • Quick: 3D
    • None
    • Qt Quick 3D: Week 1 - 2, Qt Quick 3D: Week 5 - 6, Qt Quick 3D: Week 7 - 8

    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.

      1. 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.
      2. 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.
      3. 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.
      4. 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

          For Gerrit Dashboard: QTBUG-96624
          # Subject Branch Project Status CR V

          Activity

            People

              janichol Andy Nichols
              vgt Eirik Aavitsland
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes