Why is there a limit of 8 lightgroups?

Use this forum for general user support and related questions.
Forum rules
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
Post Reply
juangea
Donor
Donor
Posts: 332
Joined: Thu Jan 02, 2020 6:23 pm

Why is there a limit of 8 lightgroups?

Post by juangea »

That's it, simple question :)

Why is there a limit of 8 lightgroups?

Thanks!
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Why is there a limit of 8 lightgroups?

Post by Dade »

juangea wrote: Fri May 08, 2020 2:02 pm That's it, simple question :)

Why is there a limit of 8 lightgroups?
Mostly because of GPUs/OpenCL, I must have a finite number there.
Support LuxCoreRender project with salts and bounties
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Why is there a limit of 8 lightgroups?

Post by B.Y.O.B. »

Technically there's only a limit if you use an OpenCL engine, the CPU engines have no limit.
But in the Blender addon I'm always using the limit of 8 to make my life easier.
juangea
Donor
Donor
Posts: 332
Joined: Thu Jan 02, 2020 6:23 pm

Re: Why is there a limit of 8 lightgroups?

Post by juangea »

Ok, so it's a GPU limitation, understood :)

(I don't think it's a big problem, and I'm with you regarding making your life easier hahaha)
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Why is there a limit of 8 lightgroups?

Post by B.Y.O.B. »

We could use a higher number if requested.
@Dade, I guess this would not raise memory consumption when the max. number of light groups is not actually used, right?
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Why is there a limit of 8 lightgroups?

Post by Dade »

B.Y.O.B. wrote: Sat May 09, 2020 10:54 am @Dade, I guess this would not raise memory consumption when the max. number of light groups is not actually used, right?
Yup, it would increase the size of the SampleResult structure, there is a SampleResult structure for each thread and there are hundred of thousands of GPU threads.
Support LuxCoreRender project with salts and bounties
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Why is there a limit of 8 lightgroups?

Post by B.Y.O.B. »

Oh, so my statement was wrong, it would have an impact even if no lightgroups are used at all.
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Why is there a limit of 8 lightgroups?

Post by Dade »

B.Y.O.B. wrote: Sat May 09, 2020 11:34 am Oh, so my statement was wrong, it would have an impact even if no lightgroups are used at all.
Yes, GPU structures must have a fixed size or it would require conditional compilation (i.e. kernel re-compilation). There are other options (i.e. store the values in a dedicated buffer, not inside the SampleResult structure) but are complex.
Support LuxCoreRender project with salts and bounties
Post Reply