Developing a Lighting System for Mobile Games
Real-time lighting on mobile devices is constant negotiation. A single dynamic Point Light in URP with shadows on Adreno 640 costs roughly 1.5–2.5 ms per frame. At 60 FPS target, the entire frame budget is 16.6 ms—two such lights already consume a third of it, all on lighting alone.
Lighting Strategy for Mobile GPU
The fundamental choice: ratio of baked (static) to dynamic (real-time) lighting. For most mobile games the rule is simple: bake all static lighting, minimize dynamic.
In Unity URP this is: Mixed Lighting with Subtractive or Shadowmask mode. Subtractive is faster—shadows from static geometry are baked into the lightmap, dynamic objects cast shadows on static geometry via mixed light. Shadowmask is more accurate but requires an extra texture on GPU.
Lightmap resolution—a common mistake is overshooting. Texels per unit = 20 for detailed geometry, 4–8 for background. One giant 2048×2048 lightmap for the entire location—good. Twenty small 256×256 lightmaps—bad, that's twenty texture binds.
Dynamic Lights: When They're Justified
Dynamic light is needed for game events: explosions, gunfire, interactive torches. Implementation via short-lived Light with Range interpolation:
IEnumerator FlashLight(Light light, float intensity, float duration) {
float elapsed = 0f;
while (elapsed < duration) {
light.intensity = Mathf.Lerp(intensity, 0f, elapsed / duration);
elapsed += Time.deltaTime;
yield return null;
}
light.enabled = false;
}
Such flash lights don't need to cast shadows—visual difference is minimal, performance much better.
Limit Per-Object lights. In URP, Additional Lights > Per Object Limit set to 1–2 for mobile presets. Default is 8—a desktop value.
Light Probes and Dynamic Objects
Characters and enemies moving through baked zones need proper ambient lighting. Place Light Probe Group at shadow boundaries: cave entrance, torch zone, dark corridor. LightProbeProxyVolume for large dynamic objects—replaces interpolation between probes with volumetric sampling.
Without Light Probes, characters in dark corners glow as if standing in sunlight—Skybox ambient applied without position consideration.
Ambient Occlusion and Mobile Alternatives
Screen Space AO (SSAO) on mobile—no. Too expensive and unnecessary with proper lightmaps. Alternatives:
-
Baked AO in lightmap—free at runtime, configured in
Generate Lightingsettings - Vertex AO—baked into vertex color, sampled in shader, completely free
-
GTAO in URP 15+—experimental, acceptable on flagship mobiles with low
radius
Godot 4: Lighting in 2D
In 2D games on Godot: CanvasItemMaterial with Light Mode = Normal Map Only enables normal maps on sprites and gives pseudo-3D lighting without actual 3D. PointLight2D with Shadow Enabled = false is cheap. DirectionalLight2D simulates the sun in top-down games.
Normal-mapping in 2D is powerful: game looks volumetric while rendering as flat sprites. Much cheaper on mobile than moving to 3D for visual depth.
Profiling
Unity Frame Debugger shows all lighting draw calls. Xcode GPU Frame Capture on iOS gives exact breakdown by shader invocations. Goal: Shadow Map passes—no more than 1–2 per frame, Additional Lights—no more than 2 real-time sources simultaneously.
Lighting system development: 3–7 days for typical mobile project. Cost calculated individually after scene assessment and target device evaluation.







