Blog

Best web animation technologies: WebGL and WAAPI

There are two great technologies to use for web animation: WebGL and Web Animation API (WAAPI). Both can be used for the same purpose, but how do you decide which one fits your needs? Which one is easier and which one has better performance? We’ll compare them for you, so that you can make the right choice for your project.

A recap: what are WAAPI and WebGL again?

In order to make a good comparison, let’s first look at the basics. 

WAAPI stands for Web Animation API. The relevance of this method comes from the recent launch of WAAPI in all modern browsers. The main benefits of using WAAPI are off the main-thread run, high performance due to no inline styles and the low footprint when loading. 

WebGL could be described as a JavaScript API for 2D and 3D vector graphics. This method is based on the OpenGL library. More and more websites use WebGL, for example the Google Maps 3D function and Unity’s VR game engine. 

When to choose WAAPI and WebGL?

Again, let’s start with WAAPI. Down below, we summed up the most important case where we see the advantage of WAAPI:

  • Chaining and callbacks
  • Synchronize multiple animations
  • Define the playrate
  • Randomized values

For the full list, check out our blog post on WAAPI 

So when would you rather go for WebGL instead? Here is a what you can create with WebGL:

  • 3D design environments
  • 3D modeling of space or objects
  • Plotting mathematical functions
  • Creating physical simulations

Also check out our blog post on WebGL

When making your choice between WAAPI and WebGL you should take 3 things into account: ease of use, performance and the frequency of use.

Easy to use

Working with WebGL requires more math skills and more understanding of the rendering pipeline than WAAPI. Besides that, production is slower, due to the larger size and complexity of the code. This also means development costs more time. 

Performance

Despite the lower ease of use of WebGL, you could still opt for this method because of the performance. WebGL is faster and has more capabilities. Why is this? WebGL is a native API providing full access to the rendering pipeline. Using WebGL, codes and effects are executed faster and more tweakable to your needs. 

Used more frequently

Finally, we compare the frequency of use of the methods. As WebGL is harder and more expensive to set up, it is used less than WAAPI. Despite the higher performance. But in case you want your website to stand out and prepare for the future of web design, we do recommend you get started with WebGL. 

Pick your favorite

We hope we provided you with enough information to make a proper comparison between these two animation technologies. Get to know more about WAAPI and WebGL in our previous blog posts. 

Do you want an assessment on your own needs? Don’t hesitate to contact us via the details down below. 

← Alle blogposts

Heb je een vraag over onze aanpak?

Nena de Clercq

Head of Sales & Operations

post@voorhoede.nl
Heb je een vraag over onze aanpak?