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. Qt3d - how to render lots of lights?
Forum Updated to NodeBB v4.3 + New Features

Qt3d - how to render lots of lights?

Scheduled Pinned Locked Moved Unsolved Game Development
6 Posts 4 Posters 882 Views 3 Watching
  • 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.
  • J Offline
    J Offline
    Juliusz_K
    wrote on last edited by
    #1

    Hi,
    I am working on a game level editor using PySide6 and Qt3d framework. Currently I'm getting into writing custom shaders etc..

    One task that is ahead of me is calculating lighting for all the objects. The game itself is an old game - the terrain uses BSP and portal system and lighting is baked in lightmaps, so that does not require any real-time lighting calculations. But a typical level can have thousands of objects (let's say up to 18K) and up to circa 1500 lights (typically 300-500 hundreds). Most of the objects are affected by either 2-3 lights, but some may be affected by a dozen or so. So, here's my questions:

    1. I know that natively Qt3d supports 8 lights only, which sucks. Do we have any control over the lights that are sent to shaders for each draw command? Could I let's say group my objects by the lights they're affected?
    2. How does Qt3d determines what to render with each draw call? Does it go one mesh each time? I know it can send only meshes with one material per draw call. So, if I was to group objects affected by lights, would I have to group them by material too? I'd imagine there'd be not many lights for each Mesh-Material combination...
    3. I know that I can use (and probably will) deferred rendering. But does that mean I still will have to send all 1500 lights' info to the shader and loop over all of them?
    4. I know I can do volume test (or distance test) for each light and geometry, but how do I determine in shader that an object may be shadowed by a wall, even if light is close to it? Do I calculate the terrain occlusion part in CPU and send that as a some sort of object-lights connection table to the shaders?

    If anyone could "shed some light" on these problems, I would appreciate it. I'm sure I'm not the first one to solve these problems, but couldn't find solid info on this topic. Plus I have a feeling that Qt3d framework may be doing some things with the lights behind the scenes, which I have no access to...

    1 Reply Last reply
    0
    • H Offline
      H Offline
      HenryBrown41
      wrote on last edited by
      #2
      This post is deleted!
      1 Reply Last reply
      0
      • J Offline
        J Offline
        Juliusz_K
        wrote on last edited by
        #3

        Is this an AI generated response?

        Pl45m4P 1 Reply Last reply
        0
        • J Juliusz_K

          Is this an AI generated response?

          Pl45m4P Offline
          Pl45m4P Offline
          Pl45m4
          wrote on last edited by Pl45m4
          #4

          @Juliusz_K said in Qt3d - how to render lots of lights?:

          Is this an AI generated response?

          Not 100% sure, but seems like a bot.

          Edit:

          aaand-its-gone-d608a9694d.jpg

          At least they are getting "better" in terms of nailing the topic... and not writing something completely irrelevant as seen quite often...


          If debugging is the process of removing software bugs, then programming must be the process of putting them in.

          ~E. W. Dijkstra

          SGaistS 1 Reply Last reply
          0
          • Pl45m4P Pl45m4

            @Juliusz_K said in Qt3d - how to render lots of lights?:

            Is this an AI generated response?

            Not 100% sure, but seems like a bot.

            Edit:

            aaand-its-gone-d608a9694d.jpg

            At least they are getting "better" in terms of nailing the topic... and not writing something completely irrelevant as seen quite often...

            SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @Pl45m4 said in Qt3d - how to render lots of lights?:

            @Juliusz_K said in Qt3d - how to render lots of lights?:

            Is this an AI generated response?

            Not 100% sure, but seems like a bot.

            Either or both with spammy link insertion.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0
            • J Offline
              J Offline
              Juliusz_K
              wrote on last edited by
              #6

              Thanks for the cleanup!

              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