Qt3d - how to render lots of lights?
-
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:
- 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?
- 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...
- 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?
- 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...
-
This post is deleted!
-
@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:
At least they are getting "better" in terms of nailing the topic... and not writing something completely irrelevant as seen quite often...
-
@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.