Download

Dynamic light culling and "freezerendering". How it all works?

Hi guys :slight_smile:

During some performance test of scene with a lot of dynamic light w/wo shadows casting i wonder: does light will cull if i dont see them?
And it looks like answer is - “No” or “not exactly”.
Even really small light (light which affect really small portion of geometry) still exist behind the camera when i use freezerendering command.

I was guided by that article: http://timhobsonue4.snappages.com/culling-visibilityculling.htm
This is the screen radius at which lights are culled. Larger values can improve performance but causes lights to pop off when they affect a small area of the screen.

Im trying to increase **Min Screen Radius for Lights **to 1-5, but nothing changes. Engine culled all except light. Geometry are dissapear, but light and shadows are still exist.
Test was performed in scene with big single mesh floor, where all light affect that floor.

In secont test i cut floor to separate meshes.
Result of the test:
Engine still cull all geometry as expected and also cull light which are fall on to geometry (which are also culled) which are no longer visible through camera.

All of this leads to few questions: what exactly **Min Screen Radius for Lights **are do?

You can use Max Distance for your lights as well. This is a feature used quite a bit in Fortnite where we can have a lot of lights. Set the Max Distance that they are visible from the camera. They will pop off outside of this distance. Use the Max Fade Distance to have them fade out so it’s not as noticeable too.

**Min Screen Radius for Lights ** sets a minimum radius that lights must affect on the screen to still be visible before they are culled. If the light gets small enough they are culled. lower values make lights stay visible longer even if they only affect a couple of pixels on screen but you still pay the cost for them. Increasing the minimum size they will cull sooner.

But it looks like they cull only if geometry which light are affecting are also culled. Is that right?
In new test project i create single mesh floor, put movable point light and change attenuation radius to 50.
In project setting i change **Min Screen Radius for Lights **to 500.
When i **freezerendering **light are still exist. Even if they are behind my character.