A World Rendered Beautifully: The Making of the BFCM 3D Data Visualization

Mikko Haapoja
12 min readintermediate
--
View Original

Overview

The article discusses the development of the 2020 Black Friday Cyber Monday (BFCM) 3D Data Visualization, focusing on the architectural design, rendering techniques, and performance optimizations used to create a realistic and interactive globe representing orders from over one million merchants. It highlights the use of three.js for building the visualization and the challenges faced during its implementation.

What You'll Learn

1

How to implement a layer architecture for 3D visualizations

2

Why physically based rendering enhances realism in 3D applications

3

How to optimize WebGL applications for performance on low-end devices

4

When to use particles for visualizing large datasets in real-time

Prerequisites & Requirements

  • Understanding of 3D graphics concepts and rendering techniques
  • Familiarity with three.js library(optional)

Key Questions Answered

How does the BFCM globe visualize orders in real-time?
The BFCM globe visualizes orders in real-time using a particle system that represents each order as a particle traveling from the buyer's location to the merchant's location. This approach allows for the display of thousands of orders simultaneously without significant performance degradation.
What techniques were used to achieve realistic lighting in the globe?
Realistic lighting in the globe was achieved using a 32bit EXR Environment Map for image-based lighting, which allows for smooth gradients and avoids banding issues that would occur with lower color depths. This enhances the overall realism of the 3D visualization.
What are the performance optimization strategies implemented in the globe?
The performance optimization strategies included dynamically adjusting the canvas size based on frame rate to reduce rendering workload, and using BufferAttribute's updateRange to selectively update particle attributes, allowing for efficient rendering of up to 150,000 particles.
Why is physically based rendering important for the BFCM globe?
Physically based rendering is important for the BFCM globe as it enhances the realism of the visualizations by accurately simulating how light interacts with surfaces. This technique utilizes materials like MeshPhysicalMaterial and MeshStandardMaterial to achieve lifelike appearances.

Key Statistics & Figures

Number of particles rendered
150,000
The globe can animate up to 150,000 particles simultaneously without noticeable performance degradation.
Frame rate improvement on iPhone 7+
40 fps to 60 fps
The auto optimizer improved rendering performance on older devices, allowing for a smoother experience.

Technologies & Tools

Frontend
Three.js
Used for building the 3D visualizations and rendering the globe.
Frontend
Webgl
Utilized for rendering graphics in the browser, enabling real-time visualizations.

Key Actionable Insights

1
Implementing a layer architecture can greatly enhance the modularity and reusability of your 3D applications.
By structuring your application into layers, similar to React components, you can encapsulate functionality and manage state more effectively, making it easier to maintain and extend your application.
2
Using particles to represent large datasets can improve both performance and visual clarity.
When dealing with high volumes of data, such as orders in real-time, particles can provide a lightweight way to visualize information without overwhelming the viewer or degrading performance.
3
Adopting physically based rendering techniques can significantly improve the visual quality of your 3D models.
This approach not only enhances realism but also allows for more dynamic lighting effects, making your visualizations more engaging and lifelike.
4
Dynamic performance optimization based on frame rate can enhance user experience across various devices.
By monitoring the frame rate and adjusting rendering quality accordingly, you can ensure that users on lower-end devices still receive a smooth experience without sacrificing visual fidelity.

Common Pitfalls

1
Failing to optimize rendering for low-end devices can lead to poor user experiences.
If applications are not designed to adjust rendering quality based on device capabilities, users on older or less powerful devices may experience lag and reduced frame rates, which can deter engagement.

Related Concepts

3d Graphics Rendering Techniques
Performance Optimization Strategies In Webgl
Particle Systems For Data Visualization