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

1bpp PNG image can't be loaded as Quick3D 5.x Texture

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Done
    • Affects Version/s: 5.15
    • Fix Version/s: 6.0
    • Component/s: Quick: 3D
    • Labels:
      None
    • Platform/s:
      Linux/Wayland
    • Commits:
      e4152112a0bec462271472ab975052dfec35c1d0 (qt/tqtc-qtquick3d/5.15)

      Description

      This should've been fixed in Qt 6.x.

      Since QSSGLoadedTexture::loadQImage() doesn't covert QImage::Format_Mono to 8bit/32bit color space, loading 1bpp PNG would crash or upload garbage data.

      https://code.qt.io/cgit/qt/qtquick3d.git/tree/src/runtimerender/resourcemanager/qssgrenderloadedtexture.cpp?h=5.15.2#n57

      As a workaround, we can make QQuickImage process 1bpp png:

                      diffuseMap: Texture {
                          sourceItem: Image { source: "assets/quick-fox-1bpp.png" }
                      }
      

      but unfortunately, this doesn't work for TextureInput of CustomMaterial as of Qt 5:

              property TextureInput myTexture: TextureInput {
                  texture: Texture {
                      sourceItem: Image { source: "assets/quick-fox-1bpp.png" }
                  }
              }
      

      Project to reproduce the problem is attached.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            qt.team.graphics.and.multimedia Qt Graphics Team
            Reporter:
            yunishih Yuya Nishihara
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes