Real-time merchant sales rendered on our globe, Easter eggs galore, and a pinball machine because... why not?
Overview
Shopify's 2025 Black Friday Cyber Monday (BFCM) live globe was reimagined as an interactive pinball machine running at 120fps in a browser. Built with Three.js and React Three Fiber, the project features real-time order visualization via server-sent events, 2D physics simulation using Rapier2D, custom shader-based lighting for 85+ lights, AR/VR support, and was displayed on the Las Vegas Exosphere for the third consecutive year.
What You'll Learn
How to optimize a 3D browser game by using 2D physics with raycasting for elevation simulation
How to implement dynamic lighting for dozens of lights using texture masks and shader-based light indexing
Why switching from 3D to 2D physics engines can dramatically improve performance on mobile devices
How to stream real-time data to browser visualizations using Server-Sent Events
How to design modular game systems that handle complex edge cases like multi-ball scenarios
Prerequisites & Requirements
- Understanding of 3D rendering concepts and WebGL basics
- Familiarity with Three.js and React Three Fiber (R3F)
- Basic understanding of physics engines and collision detection
- Understanding of GLSL shaders and GPU rendering pipelines(optional)
- Experience with Blender for light baking and 3D asset creation(optional)
Key Questions Answered
How can you simulate 3D pinball ramps using a 2D physics engine?
Why did Shopify switch from Rapier 3D to Rapier 2D for their pinball physics?
How do you render dozens of dynamic lights efficiently in a WebGL pinball game?
How does the Shopify BFCM globe show real-time order data?
How do you build a dot matrix display shader for a browser-based pinball game?
How do you add AR and VR support to a Three.js pinball game?
What are the key design challenges when building a virtual pinball table?
How do you handle edge cases in a pinball minigame swap system?
Key Statistics & Figures
Technologies & Tools
Some links below are affiliate links. We may earn a commission if you make a purchase.
Key Actionable Insights
1Consider using 2D physics with raycasting for 3D-looking games instead of full 3D physics simulation. Shopify achieved a 10x performance improvement (2ms to 0.2ms per physics step) by switching from Rapier 3D to Rapier 2D, using sensor-based collider activation/deactivation to simulate ramps and elevation changes.This is especially important when targeting mobile devices or when multiball/multi-object scenarios demand high-frequency collision detection with CCD enabled.
2Use texture-based light indexing instead of forward-rendered point lights when you need dozens of dynamic lights. By encoding light IDs in a mask texture's R channel and driving visibility through a uniform float array in a shader, you can control 85+ lights without the performance cost of individual point lights.This approach works particularly well when combined with baked lighting in Blender using MeshBasicMaterials, keeping the base rendering cost low while dynamic elements are handled efficiently by shaders.
3Bake your scene lighting in Blender and use MeshBasicMaterials in Three.js for static elements. This eliminates the need for real-time light calculations on most surfaces, dramatically improving rendering performance and leaving GPU headroom for dynamic effects.This technique is well-suited for scenes where most lighting is fixed and only specific elements (like pinball table lights) need dynamic control.
4Build modular, swappable game systems rather than committing to permanent elements early in development. Shopify's modular minigame system, where elements rise through the floor, allowed easy iteration without requiring changes to the 3D model, light baking, materials, or game logic for every swap.Modularity also enabled flexible game flow where milestones could interrupt any minigame and resume in any order, decoupling content from physical board position.
5When designing interactive experiences, prioritize flow and rhythm over novelty. The Shopify team cut several creative ideas (underground boards, sideways gravity, WarioWare-style minigames) because they disrupted the gameplay feel. Opening up claustrophobic areas into flowing paths fundamentally improved the experience.This aligns with the pinball design philosophy of 'precision in the face of chaos' โ the best additions were ones that maintained the core gameplay loop rather than disrupting it with gimmicks.
6Use Server-Sent Events (SSE) for streaming real-time data to browser visualizations rather than WebSockets when the data flow is primarily server-to-client. Shopify streams live order data, sales metrics, and infrastructure stats through SSE, which is simpler to implement and debug (visible in the browser network tab).Paired with Apache FlinkSQL for stream processing, this architecture handles planetary-scale event volumes during peak traffic like BFCM weekend.