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

Custom material CG lighting is broken

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P2: Important
    • 6.0.0
    • 5.15, 6.0.0
    • Qt RHI, Quick: 3D
    • None
    • 5

    Description

      I could not find any example or Lancelot test code that would use custom materials with anything other than light probes. This is not ideal since a huge chunk of code and logic is not tested at all.

      Therefore, as part of QTBUG-82245 we added the ability to demonstrate custom material based objects in combination with (directional, point, area, spot) lights and shadow mapping to the 'lights' example. With https://codereview.qt-project.org/c/qt/qtquick3d/+/293018 there is now a checkbox that allows to hide the teapot and instead show a cylinder with the copper material.

      Problem is, the the object does not seem to interact with lighting properly. The specular highlights look ok, but notice how the cylinder does not change at all when toggling lights, and even when completely disabling all lights.

      Here's the teapot with no shadows, just a directional light:

      Then with all lights turned off:

      This is the custom material object with only the directional light.

      Then with all lights disabled. This is quite wrong. Notice how the appearance of the object did not change at all. This would mean the lighting calculation is completely wrong when custom materials are involved (apart from the specular term perhaps).

      Attachments

        Issue Links

          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
              lagocs Laszlo Agocs
              Pasi Keränen Pasi Keränen
              Andy Nichols Andy Nichols
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes