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

Light uniform is hardcoded to use PointLight only

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.3.2, 6.2
    • 6.2.3
    • Qt3D
    • None
    • All, Windows

    Description

      Hi,

      I noticed that in Qt6 it has no effect to change the light source intensity. Then I started digging in the Qt3D source code, and in 

      src/plugins/renderers/opengl/renderer/renderview.cpp line 1399 in the 

      RenderView::updateLightUniforms() function, the light type is hardcoded to PointLight, the color is hardcoded to white and intensity is 0.5. Only the light position is updated, and the direction is not set at all. This means that it is not possible to use QDirectionalLight or QSpotLight in user code.

       

       

      setUniformValue(command->m_parameterPack, GLLights::LIGHT_POSITION_NAMES[lightIdx], worldPos);
      setUniformValue(command->m_parameterPack, GLLights::LIGHT_TYPE_NAMES[lightIdx], int(QAbstractLight::PointLight));
      setUniformValue(command->m_parameterPack, GLLights::LIGHT_COLOR_NAMES[lightIdx], Vector3D(1.0f, 1.0f, 1.0f));
      setUniformValue(command->m_parameterPack, GLLights::LIGHT_INTENSITY_NAMES[lightIdx], 0.5f);
      
      

       

      Why is this?

       

      Attachments

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

        Activity

          People

            seanharmer Sean Harmer
            harald Harald Vistnes
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes