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

PhongAlphaMaterial not working within Scene3D

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • None
    • 5.7
    • Qt3D
    • None
    • Windows 7 x64 SP1, Nvidia GeForce GT 630
    • eaf359fbefcd9d62695e1666374b389edc12fb06

    Description

      Changing PhongMaterial to PhongAlphaMaterial in qt3d examples that use Scene3D item ("scene3d", "controls") leads to disappeared entities ("scene3d") or slightly visible contour ("controls" example):

      In examples without Scene3D (basicshapes-cpp, simple-cpp, simple-qml, materials-cpp) PhongAlphaMaterial instead PhongMaterial works as it should (ambient color, alpha parameter - all ok).

      I am writing my own application using qml Scene3D and everything inside it on cpp. In qt 5.6 PhongAlpha worked, but there was another problem (http://lists.qt-project.org/pipermail/interest/2016-May/022352.html) as I understand recently it's exactly due to PhongAlpha, with Phong everything was fine.
      Now I move my app to qt 5.7, it works with Phong, but PhongAlpha is look like white Phong - it ignores ambient and alpha.

      Update:
      I just understand that such behavior (with white Phong) obviously due to the fact that my Scene3D qml item is inside Loader.
      I can get same behavior from "scene3d-loader" example (for now it is in manual test): just change PhongMaterial to PhongAlphaMaterial in AnimatedEntity.qml and set clearColor to "light blue" for RenderSettings (to clearly see that entities become white without transparency):

      And the worst in all this situations is that PhongAlpha with alpha parameter 1.0 works in different way that Phong. I can't understand it at all, cause I see that phong.frag differ from phongalpha.frag only constant alpha = 1.0 parameter

      gl_FragColor = vec4( ka + kd * diffuseColor + ks * specularColor, 1.0 )
      vs
      gl_FragColor = vec4( ka + kd * diffuseColor + ks * specularColor, alpha)

      Attachments

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

        Activity

          People

            seanharmer Sean Harmer
            lukegluke Oleg
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes