Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. Removing Qt3D's default point light
Qt 6.11 is out! See what's new in the release blog

Removing Qt3D's default point light

Scheduled Pinned Locked Moved Unsolved Game Development
4 Posts 3 Posters 2.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • njbrownN Offline
    njbrownN Offline
    njbrown
    wrote on last edited by
    #1

    By default, qt3d adds a point light to your scene.

    When i add at least one light in a scene, it renders fine:
    scenewithlight.png

    However, when i remove all lights, qt3d adds one in the middle of the scene.
    defaultlight.png

    Is there any way that i can remove this light?

    Thanks in advance.

    1 Reply Last reply
    0
    • NeoswN Offline
      NeoswN Offline
      Neosw
      wrote on last edited by
      #2

      Qt3D add a light is the list of ligth is empty:

                      if (activeLightSources.isEmpty()) {
                          setUniformValue(command->m_parameterPack, LIGHT_POSITION_NAMES[0], QVector3D(10.0f, 10.0f, 0.0f));
                          setUniformValue(command->m_parameterPack, LIGHT_TYPE_NAMES[0], int(QAbstractLight::PointLight));
                          setUniformValue(command->m_parameterPack, LIGHT_COLOR_NAMES[0], QVector3D(1.0f, 1.0f, 1.0f));
                          setUniformValue(command->m_parameterPack, LIGHT_INTENSITY_NAMES[0], 0.5f);
                      }
      

      http://code.qt.io/cgit/qt/qt3d.git/tree/src/render/backend/renderview.cpp (line ~900).

      But, you can add a light with an intensity of zero to override the default light.

      1 Reply Last reply
      1
      • njbrownN Offline
        njbrownN Offline
        njbrown
        wrote on last edited by
        #3

        I was trying to avoid doing that, but if it's the only way then i guess i'll just have to.

        Thanks.

        1 Reply Last reply
        1
        • L Offline
          L Offline
          lemire_p
          wrote on last edited by
          #4

          We can discuss removing the default point light. I think the reason it was added was that you would still have some light effect even if you forget to set a light. Obviously that may not be what everyone wants.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved