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

OpenXR: OpenGL render wrong/dull colors

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 6.9.0, 6.10.0
    • Quick: 3D
    • Linux/Wayland

      The texture format that is used in qopenxrgraphics_opengl.cpp for OpenGL swapchain is GL_RGBA8, but Qt Quick 3D renders its contents with tone mapping by default, so we need to request GL_SRGB8_ALPHA8_EXT instead.

       

          // List of supported color swapchain formats.
          constexpr int64_t supportedColorSwapchainFormats[] = {
              GL_RGBA8,
              GL_RGBA8_SNORM
          };
      

      As a temporary solution to get correct colors tonemapping can be disabled:

      XrView {
          environment: SceneEnvironment {
              tonemapMode: SceneEnvironment.TonemapModeNone
          }
      }

       

      I think the truly correct fix would be to select a linear texture format (GL_RGBA8) if tonemapping is off and select SRGB format (GL_SRGB8_ALPHA8) if tonemapping is enabled.

       

      Interestingly, SRGB format is already used in qopenxrgraphics_opengles.cpp, but it seems desktop OpenGL didn't receive the same amount of love

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

            qt.team.graphics.and.multimedia Qt Graphics Team
            lightofmysoul Neko Neko
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There is 1 open Gerrit change