How to increase mobile Max Moveable Spotlight / Point Lights?

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