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

diffuseMap seems to have problem handling depth test at certain angles

    XMLWordPrintable

Details

    • Windows

    Description

      Reproducer attached. It features 2 rectangle models parallel to XZ plane (eulerRotation.x: -90). The blue one is slightly above the red one (y: 10) and is 2 times longer (scale.y: 2). Also, both rectangles are rotated around (0, -50, 0).

      The problem is that somehow depth test is messed up, and in the area where 2 rectangles overlap, the red one is actually rendered on top:

      Only when one rotates camera sideways then one can actually see that the blue one is on top, like:

      So far, the only workaround I see is to use diffuseColor instead of diffuseMap for materials. For example:

                      diffuseColor: "red"
      

      instead of

                      diffuseMap: Texture {
                          sourceItem: Rectangle {
                              width: 64
                              height: 64
                              color: "red"
                          }
                      }
      

      for red rectangle. Similar for the blue one. Then one can see the expected result:

      But this is not the solution. One may practically need custom texture instead of single color.

      Update:
      I think it may not be that closely related to transformation. I've uploaded an even simpler reproducer in which scaling and pivot points are removed from 2 Model's. And the problem still happens at certain angle:

      And still, diffuseColor is not affected (and still not a practical solution).

      Attachments

        1. image-2025-03-18-19-11-48-068.png
          image-2025-03-18-19-11-48-068.png
          14 kB
        2. image-2025-03-18-19-13-17-345.png
          image-2025-03-18-19-13-17-345.png
          15 kB
        3. QTBUG-134812_revised.7z
          2 kB
        4. QTBUG-134812.7z
          2 kB
        5. screenshot-1.png
          screenshot-1.png
          14 kB
        6. screenshot-2.png
          screenshot-2.png
          14 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.graphics.and.multimedia Qt Graphics Team
            luqiaochen Luqiao Chen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes