How to increase mobile Max Moveable Spotlight / Point Lights?

As the question suggests, I’m wondering if there is anyway to force an increase to the Maximum number of Moveable Spotlight / Point Lights on mobile beyond the default allowed in the project settings. In the project settings you don’t seem to be able to increase the number beyond 4. I plan to use these lights without shadows, so I would think it wouldn’t be a performance problem to have more than 4 in the scene. Any thoughts are greatly appreciated, thank you!

332269-screen-shot-2021-03-12-at-90158-am.png

1 Like

did you find an answer to this?

Sorry for bumping, but I was looking for the same thing and found the solution.

It requires you to modify engine source files. Il post the file name followed by modified code lines:

\Engine\Source\Runtime\Engine\Classes\Engine\RendererSettings.h

ConsoleVariable = “r.MobileNumDynamicPointLights”, DisplayName = “Max Movable Spotlights / Point Lights”, ClampMax = 100,


\Engine\Source\Runtime\Renderer\Private\MobileBasePassRendering.cpp

static_assert(MAX_BASEPASS_DYNAMIC_POINT_LIGHTS == 100, “If you change MAX_BASEPASS_DYNAMIC_POINT_LIGHTS, you need to add shader types below”);

here below you should an option for 100 like its said in the comment above, like its added below
IMPLEMENT_MOBILE_SHADING_BASEPASS_LIGHTMAPPED_PIXEL_SHADER_TYPE(LightMapPolicyType, LightMapPolicyName, 2)
IMPLEMENT_MOBILE_SHADING_BASEPASS_LIGHTMAPPED_PIXEL_SHADER_TYPE(LightMapPolicyType, LightMapPolicyName, 3)
IMPLEMENT_MOBILE_SHADING_BASEPASS_LIGHTMAPPED_PIXEL_SHADER_TYPE(LightMapPolicyType, LightMapPolicyName, 4)
IMPLEMENT_MOBILE_SHADING_BASEPASS_LIGHTMAPPED_PIXEL_SHADER_TYPE(LightMapPolicyType, LightMapPolicyName, 100)
IMPLEMENT_MOBILE_SHADING_BASEPASS_LIGHTMAPPED_PIXEL_SHADER_TYPE(LightMapPolicyType, LightMapPolicyName, INT32_MAX)


\Engine\Source\Runtime\Renderer\Private\MobileBasePassRendering.h

#define MAX_BASEPASS_DYNAMIC_POINT_LIGHTS 100


Also in your project set max movable spotlights to 100 - I have not tested what it would be if you set it to 5-99, may be a problem there.

So far I have tested with 8 point lights - all working fine, no fps drop.

1 Like