Dynamic Shadow Creation Optimized for Mobile Graphics

Our video game development company runs independent projects, jointly creates games with the client and provides additional operational services. Expertise of our team allows us to cover all gaming platforms and develop an amazing product that matches the customer’s vision and players preferences.
Showing 1 of 1 servicesAll 242 services
Dynamic Shadow Creation Optimized for Mobile Graphics
Complex
~1-2 weeks
FAQ
Our competencies
What are the stages of Game Development?
Latest works
  • image_games_mortal_motors_495_0.webp
    Game development for Mortal Motors
    663
  • image_games_a_turnbased_strategy_game_set_in_a_fantasy_setting_with_fire_and_sword_603_0.webp
    A turn-based strategy game set in a fantasy setting, With Fire and Sword
    859
  • image_games_second_team_604_0.webp
    Game development for the company Second term
    490
  • image_games_phoenix_ii_606_0.webp
    3D animation - teaser for the game Phoenix 2.
    533

Creating Dynamic Shadows Optimized for Mobile Graphics

On mobile GPU, 2048×2048 Shadow Map without cascades—direct path to 18 ms on framebuffer only on shadow pass. On Adreno 640 this consumes thermal limit before main geometry renders. Shadows on mobile—not "set and forget" but constant balance between visual quality and thermals.

Why standard Unity Shadow Distance settings kill mobile performance

Most common mistake—leaving Shadow Distance at default (150 m) and Hard Shadows type in URP without cascading. Result: GPU draws shadow map for all visible geometry, including objects 80 meters away player never sees closely enough to judge shadow.

Second classic case—using Realtime GI with Enlighten on mobile alongside dynamic shadows. Enlighten recalculates lightmap on light movement, on Mali-G72 with 4 cores becomes constant fps drops to 24 FPS during lighting zone transitions. Solution—switch all static objects to Mixed Lighting with Subtractive Mode, leave Realtime only on characters.

Cascaded shadows (Cascade Shadow Maps) on mobile also need care. Two cascades on 8/40 m instead of 10/30/60/150 m distances give noticeable gain. Shadow Bias needs manual per-scene setup—automatic URP value often gives Peter Panning on flat surfaces due to 16-bit depth buffer specifics on some devices.

Technical stack and approaches

Work in Unity URP (Universal Render Pipeline) with Custom Renderer Feature for shadows. Main tools—Frame Debugger for shadow pass analysis, GPU Profiler in Unity Profiler with Rendering module, Snapdragon Profiler / Mali Graphics Debugger for real device data capture.

Process starts with baseline capture: FPS, GPU time, Shadow Caster Draw Call count. Typical project with 300+ scene objects—Shadow Caster Pass gives 180–220 draw calls, already half recommended mobile budget (400 total).

Further work:

  • Move small static objects (rocks, curbs, decor) to Shadow Static—land in static Shadow Atlas, don't redraw each frame
  • For characters and dynamic objects use Screen Space Shadows instead of Shadow Map where scene depth allows (works on Vulkan/Metal)
  • Configure Shadow Fade Distance with smooth transition to Blob Shadow (projected texture shadow) beyond 15 m—visually unnoticed, minimal cost
  • On tile-based GPUs (Adreno, Mali) enable Early-Z Culling via correct Render Queue sorting: opaque geometry first, transparent last

For VR projects on Quest 2/3—separate story with Multiview Rendering (single-pass stereo), Shadow Map renders once for both eyes. But with Shadow Casting objects with different Culling Mask for left/right eye, Shadow Pass breaks into two independent ones—instant +8–12 ms. Bug trap invisible in Editor.

Work process for project

Scene audit. Gather data from target device via ADB + Unity Profiler: Shadow Caster Count, GPU Shadow Pass Time, thermal throttling over 5 minutes load.

Technical specification. From audit results determine what can go to Baked, stay Mixed, realistic Shadow Distance for specific project gameplay.

Implementation. Configure URP Asset, Renderer Feature, Culling Groups for LOD shadows, write custom Shadow Caster Pass if standard doesn't cover needs (e.g., vegetation with Alpha Cutout).

Hardware testing. Run on minimum three devices from target matrix: low-end (Snapdragon 665), mid (Snapdragon 778G), high-end (Snapdragon 8 Gen 2). Thermal throttling test—15 minutes continuous session.

Profiling and iteration. Compare with baseline, add Blob Shadow fallback if needed.

Task scope Estimated timeline
Audit + basic URP setup (1 scene) 2–4 days
Complete shadow optimization (3–5 scenes) 1–2 weeks
VR project with Multiview + custom Renderer Feature 2–4 weeks

Cost is calculated individually after project audit and requirements analysis.

Typical mistakes we see:

  • Render Shadow Maps per-object not set—all objects render Shadow Map regardless of camera distance, when distant objects could be removed via ShadowCastingMode.Off on LOD2
  • Light.shadowCustomResolution = 4096 used in script without SystemInfo.graphicsMemorySize check—budget phones with 2 GB RAM guaranteed crash on low memory
  • MSAA x4 mixed with Dynamic Shadows on single Render Target on old Mali—driver falls back to software, FPS drops 2–3x. On these devices force MSAA x2 limit or disable via QualitySettings.antiAliasing