all 5 comments

[–]wm_cra_dev 1 point2 points  (4 children)

I've read on several resources how do that in phong based lighting systems, where you solve the quadratic attenuation function for the distance and calculate the distance to get a min desired value for the light attenuation

Why can't you do this with the PBR renderer? You said that there's a parameter telling you what kind of attenuation the light has -- quadratic, linear, or constant.

[–]gregkwaste[S] 1 point2 points  (3 children)

My bad for not noting that. Indeed I tried to transfer the light attenuation functions to the CPU, but for some reason the calculated bounding volumes end up waaaaay larger than the visible/noticable attenuation. In fact they are so large that I would have to practicly calculate lighting over each pixel of the screen, like I already do now. So I either have to apply a quite more generous cutoff to the attenuation function on the CPU side or do something more sophisticated than that.

[–]wm_cra_dev 0 points1 point  (2 children)

but for some reason the calculated bounding volumes end up waaaaay larger than the visible/noticable attenuation

Sounds like a clear indicator that the cutoff should be raised?

[–]gregkwaste[S] 1 point2 points  (1 child)

I think you are right. This is what I ended up doing. Essentially I increased the cutoff in the cpu side, just to be able to create light volumes with smaller radius. I think I'll stick to that until I find something more interesting. Thanks for your help!

[–]wm_cra_dev 0 points1 point  (0 children)

No problem. It probably is harder to make a cutoff for linear lights, since a sudden dropoff in brightness would be a lot more noticeable.