Page 1 of 1

Why is there a limit of 8 lightgroups?

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

Why is there a limit of 8 lightgroups?

Thanks!

Re: Why is there a limit of 8 lightgroups?

Posted: Fri May 08, 2020 4:30 pm
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.

Re: Why is there a limit of 8 lightgroups?

Posted: Fri May 08, 2020 4:43 pm
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.

Re: Why is there a limit of 8 lightgroups?

Posted: Sat May 09, 2020 10:04 am
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)

Re: Why is there a limit of 8 lightgroups?

Posted: Sat May 09, 2020 10:54 am
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?

Re: Why is there a limit of 8 lightgroups?

Posted: Sat May 09, 2020 11:11 am
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.

Re: Why is there a limit of 8 lightgroups?

Posted: Sat May 09, 2020 11:34 am
by B.Y.O.B.
Oh, so my statement was wrong, it would have an impact even if no lightgroups are used at all.

Re: Why is there a limit of 8 lightgroups?

Posted: Sat May 09, 2020 11:57 am
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.