Distance falloff calculation in code

Greetings.
I am new to blender code, and I am trying to find the place in EEVEE code where lights distance attenuation is calculated/applied ? I’ve found light_influence_attenuation() in a eevee_light_lib.glsl but that’s just window function. The documentation mentions that inverse square law is used but I can’t find exactly where is it applied on a GPU side. Thx!

1 Like

I’m not familiar with this particular code. But note that the inverse square law is a consequence of geometry and part of the solid angle. In general it’s not something I would expect to find or change in a single place. Rather techniques like (LTC) Linearly Transformed Cosines assume it and the resulting equations might not always have a clear squared distance in them.

1 Like