Flood Surfers icon FLOODSURFERS
Home  /  Guides & Journal  /  Engineering Devlog
Engineering Devlog

Engineering Devlog: Building Dual 2.5D & 60 FPS Filament 3D PBR in Flutter for Everyday Android Phones

How we engineered Flood Surfers V2 to switch seamlessly between custom 2.5D canvas rendering and Google Filament 3D PBR—while staying smooth on budget 32-bit and 64-bit Android hardware.

By Flood Surfers Editorial Team Updated: November 24, 2026 7 min read

Why We Built a Dual 2.5D + Filament 3D Architecture

Most mobile endless runners lock players into a single heavy 3D engine that struggles on affordable phones across West Africa. For Flood Surfers V2, we took a different engineering path inside Flutter: a single deterministic game simulation (GameEngine) drives three switchable viewports—a custom perspective 2.5D Canvas (default for instant zero-wait boot), a classic 2D Side View, and a real-time Google Filament 3D PBR viewport powered by thermion_flutter.

Solving Non-IBL Mobile PBR Shading (No Black Metals, No HDR Whiteout)

One of the first lessons in mobile Filament engineering is that shipping huge HDRI skyboxes inflates APK size and memory bandwidth. Yet without an IBL environment map, standard metallic PBR materials (metallicFactor >= 0.8) reflect pure black because dielectrics rely on diffuse lighting while metals rely almost entirely on environment reflections.

Our asset pipeline solves this across all 56 embedded .glb models through three strict rules:

Keeping Frame Times Smooth on Budget ARM Devices

Testing directly on everyday Android hardware (such as 32-bit android-arm and 64-bit android-arm64 entry-level devices) surfaced three concrete bottlenecks we systematically eliminated:

  1. Two-Phase Instant-Boot Asset Streaming: Instead of blocking Frame 1 while uploading all 4 regional city corridors (222,000+ triangles) and 10 bus fleets, Phase 1 uploads only the active city, active landmark, active bus livery, and equipped surfboard. Phase 2 streams the remaining 21 assets silently one frame at a time in the background.
  2. Zero Redundant FFI Transform Calls: Tracking hidden singleton sets (_hideOnce) and pool high-water marks (_hideUnused) eliminated roughly 3,000 wasted Dart-to-C++ matrix marshaling calls every second when effects like rain, warp lines, or boss assets are inactive.
  3. Strict Water Elevation Layering: Separating the corridor floodbed (-0.260m), translucent scrolling caustic river mesh (-0.232m with strictly non-negative wave displacement), rolling wave crests (-0.195m), wakes (-0.165m), surfer contact shadow (-0.150m), and shockwave rings (-0.115m) removed all mobile depth-buffer Z-fighting.
Total 3D Asset Footprint: All 56 PNG-textured glTF 2.0 .glb models—surfer, 7 boards, 10 regional buses, 4 cities, 4 landmarks, animated caustic river, boss, and all 25 pickups/hazards—total just 4.54 MB combined.