ZERO: The Engineering Behind a Defiant Interactive Narrative | Codrops

Developed over a rigorous four-month period by a specialized technical team, the ZERO project stands as a testament to the evolving capabilities of WebGL and the modern browser. Built using a robust stack featuring Three.js, GSAP, Howler, and Vite, the project achieves a feat of engineering that was once considered impossible: transforming over one gigabyte of high-fidelity source assets into a streamlined experience under 10MB. More impressively, the experience maintains a consistent 60 frames per second (fps) across a wide spectrum of hardware, ranging from high-end desktop workstations to budget-tier Android smartphones.
The Genesis of a Narrative: From Prototype to Production
The project began not with a traditional pitch deck or a series of static mockups, but with a functional proof of concept (PoC). The creative vision, led by Atul Khola’s team, aimed to create an immersive scrolling narrative that questioned the validity of the traditional university degree path in the 21st-century economy. To win the project, the development team built the "draw a zero" interaction in just 48 hours, delivering a working prototype that demonstrated the potential of the frost-spreading effect.
Artificial Intelligence (AI) played a pivotal role in this early phase. By leveraging AI to generate the foundational code for various interactions, the developers were able to bypass the initial "blank page" hurdle and move directly into the refinement stage. This shift allowed the team to focus on the nuances of the user experience—testing different timings for glass shattering, experimenting with the visual weight of burning currency, and fine-tuning the physics of falling paper shreds. The engineering process thus evolved from one of "writing code" to one of "curating and refining results."

A Narrative in Six Stages
The ZERO experience is structured as a linear journey through six scrolling stages, punctuated by five interactive "gates" that serve as narrative anchors. Each gate requires a specific user action—such as holding a mouse click or drawing a shape—to proceed, ensuring that the user remains an active participant rather than a passive observer.
The story begins with the familiar promise of the traditional education system: the "safe" path of studying, graduating, and securing a corporate role. However, at the first gate, this promise is literally shattered. The user breaks a glass pane to reveal the harsh reality of modern unemployment statistics scattered among the shards. As the user scrolls deeper, the narrative takes a defiant turn. Stage three depicts the devaluation of traditional credentials; money burns, and certificates are shredded into ribbons.
The climax of the experience involves a transition through a tunnel shaped like the ZERO logo, leading the user above the clouds. Here, a futuristic city emerges, constructed from the headquarters of leading global corporations. In the final stage, the linear scroll gives way to an interactive 3D map, granting the user the freedom to explore different career scenarios and tools, effectively handing the "controls" of the future back to the individual.
Technical Architecture: The "One Number" Philosophy
A critical architectural decision that separates ZERO from typical web projects is the abandonment of the browser’s native scroll mechanism. Traditional tools like ScrollTrigger often rely on an oversized Document Object Model (DOM) to track position, which can lead to performance bottlenecks in complex 3D environments.

Instead, the ZERO team implemented a "virtual scroll" system. A single numerical value represents the user’s progress through the entire experience. This value is updated by wheel and touch inputs and is smoothed via easing functions. Every element of the site—from the timing of shader transitions to the loading of 3D assets and the display of text overlays—is driven by this single number.
The project is modularized into nine distinct segments, each with its own lifecycle:
- Enter: Asynchronously builds the segment’s Three.js objects.
- Scrub: Maps the local progress (0 to 1) of the segment.
- Update: Handles idle motion and frame-by-frame calculations.
- Teardown: Disposes of assets to free up GPU memory before the next segment begins.
This "state machine" approach ensures that if a user jumps to a specific stage, the application replays the initialization of all preceding segments in the background, maintaining the integrity of the 3D scene without "teleporting" the camera into an uninitialized environment.
The 3D Pipeline and Asset Optimization
The primary challenge of the project was the massive disparity between the source assets and the performance requirements of the web. The original production files from Blender included 8K textures and uncompressed geometry totaling over a gigabyte. To bridge this gap, the team implemented an aggressive optimization pipeline focused on two key technologies: DRACO compression and KTX2 texture formats.

Geometry was compressed using DRACO, which significantly reduces file size while maintaining structural integrity. Crucially, the team opted to self-host the Draco and KTX2/Basis decoders. This decision followed a critical failure during development where a CDN slowdown on gstatic caused assets to fail to decode. By hosting the decoders locally, the developers ensured that the pipeline was independent of third-party server stability.
Texture management proved to be the most impactful factor for GPU performance. While a standard PNG might be small on a hard drive, it occupies a massive amount of Video RAM (VRAM) once decompressed by the browser. To solve this, the team utilized KTX2 with ETC1S compression. Unlike PNGs, KTX2 textures stay compressed even when loaded into GPU memory, drastically reducing the memory footprint and accelerating upload times.
To facilitate this, the team built a custom "Compression Previewer." This internal tool allowed developers to compare compressed and uncompressed versions of assets side-by-side. By fine-tuning compression settings for each individual asset—applying heavy compression to background elements and preserving high quality for "hero" objects—the team reduced the final build size to under 10MB.
Advanced Shader Engineering
The visual fidelity of ZERO is driven by a sophisticated post-processing chain. Each frame undergoes several passes, including procedural background generation, frost-spreading, depth-of-field lens blur, and tone mapping. To maintain performance, these passes are initialized lazily; they are "warmed up" during idle time so that the first frame of a new effect does not cause a shader-compilation stutter.

Several custom shaders highlight the technical depth of the project:
- The Frost Shader: This effect uses a "ping-pong" buffer to propagate pixels. By checking the brightness of neighboring pixels across four axes, the shader creates an octagonal growth pattern that mimics the crystalline spread of ice.
- Lighting Without Lights: To avoid the high computational cost of real-time lighting on skinned meshes (the hands seen throughout the experience), the team "baked" lighting into textures. By crossfading between different lighting textures stored in a single atlas, they achieved a dynamic lighting effect at a fraction of the cost.
- The Burning Money Effect: This uses a noise-driven distance field. As the "burn" sweeps across the digital currency, a Fractal Brownian Motion (FBM) noise function generates a glowing High Dynamic Range (HDR) ember rim before discarding the fragments to simulate ash.
- Vertex-Based Shredding: For the certificate shredding sequence, the team assigned a "strip index" to each vertex. As the animation progresses, each strip separates and tumbles independently, driven by a wave function that also analytically generates lighting normals, removing the need for a separate normal map.
Adaptive Quality and Performance Monitoring
Recognizing the diversity of user hardware, the developers implemented an "Adaptive Quality Manager." The system monitors frame times using a rolling buffer. If the average time per frame exceeds 22ms (indicating a drop below 45fps), the engine automatically downgrades the visual quality by reducing the pixel ratio or disabling expensive effects like blur and frost. Conversely, if the device proves capable, the system scales the quality back up.
Special attention was paid to the "stutter" caused by texture uploads. Even with compressed assets, uploading a large texture to the GPU can block the main thread for 50ms or more. The team solved this by using requestIdleCallback to "drain" a texture upload queue only during periods of low activity, ensuring that the user’s scrolling remains fluid.
Conclusion and Broader Impact
The ZERO interactive narrative demo is a landmark in web engineering that proves high-fidelity 3D storytelling can be accessible to a global audience regardless of their device’s power. By prioritizing asset preparation, GPU memory management, and custom shader logic over "out-of-the-box" solutions, the team successfully translated a complex narrative into a performant digital experience.

The project also offers a blueprint for the future of AI in development. It demonstrates that while AI is an unparalleled tool for rapid prototyping and generating initial logic, the final 10% of a project—the polish, the optimization, and the "feel"—still requires human engineering judgment. As the web moves toward more immersive, 3D-first experiences, the techniques pioneered in ZERO regarding asset compression and virtual scroll architecture will likely become standard practice for developers aiming to balance visual ambition with universal accessibility.







