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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 5.15.9, 6.0
    • 5.15
    • Quick: 3D
    • None
    • Linux/Wayland
    • 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

        Issue Links

          Activity

            People

              qt.team.graphics.and.multimedia Qt Graphics Team
              jirauser52013 user-c858f (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: