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

Scene3D of OnDemand rendering not updated on ObjectPicker event followed by material change

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.14.2, 5.15.0
    • Qt3D
    • None
    • Linux/X11

    Description

      Tried to change material color by ObjectPicker.containsMouse, but Scene3D didn't detect it if the renderPolicy is OnDemand.

      The full QML code is attached.

                          // containsMouse changes, but the color never be updated if
                          // the renderPolicy is OnDemand.
                          DiffuseSpecularMaterial {
                              id: material
                              ambient: picker.containsMouse ? "red" : "blue"
                          },
                          ObjectPicker {
                              id: picker
                              hoverEnabled: true
                              onContainsMouseChanged: {
                                  console.log("containsMouse:", containsMouse);
                                  // If the change is not triggered within the current
                                  // event loop, it works. Uncomment this to test the
                                  // behavior.
                                  Qt.callLater(() => {
                                      //material.ambient = containsMouse ? "red" : "blue";
                                  });
                              }
                          }
      

      From my testing, Renderer::markDirty() is called after the change is detected and processed by Scene3DItem::onBeforeSync(). And I guess the dirty bits would be cleared by the next processFrame().

      I'll send a PoC-level patch to address this issue.

      Attachments

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

        Activity

          People

            seanharmer Sean Harmer
            jirauser52013 user-c858f (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There is 1 open Gerrit change