light_world.lua icon indicating copy to clipboard operation
light_world.lua copied to clipboard

Shadow calculation falloff - options or intended behavior?

Open Sarcose opened this issue 3 years ago • 0 comments

When using a camera that pans shadow-casting bodies off-screen, the shadows stop calculating for those bodies eventually. At first I thought it was an issue with my scaling engine and so I was puzzling over it for a while. This came about from an effort to create a 'sun' with a near-infinite radius across many bodies, hence the desire to create large sweeping sunbeams and shadows across a larger landscape. The ambient light was turned way down for this example to highlight the contrast:

https://user-images.githubusercontent.com/6192665/204336755-19340138-6b53-4ac0-a916-e8043fb04273.mp4

But then going in and testing this behavior in the example library under 'gamera' created the exact same issue. Watch the yellow light when i pan the object offscreen:

https://user-images.githubusercontent.com/6192665/204336869-4a50693a-67bf-4809-a74f-6d6a221fc217.mp4

Presumably there's some memory-management happening here that is causing bodies to be ignored when off screen.

As seen in the first example, the impact of this can grow rather large with a larger light radius and many shadow bodies.

Sarcose avatar Nov 28 '22 17:11 Sarcose