WASMAI:About

Lets talk about WASMAI

WASMAI stands for Web Assembly Animation Image. Essentially, it’s a technology based on HTML (specifically, canvas) for generating low-level graphics. That’s where the “Web” and “Assembly” parts come in. It enables us to render complex graphics and animations-sometimes over 200 frames per second-right in a web browser, depending on your graphics card and monitor capabilities. Just to give some context, most monitors with a refresh rate of 60Hz can display up to 60 frames per second.

Interviewer: Impressive! So, WASMAI is available for the web and also runs natively on Windows and Linux. But are there any limitations?

Expert: Yes, unfortunately, there are some limitations today when it comes to HTML5 and web browsers.

Interviewer: Like what?

Expert: For one, WebGL-particularly WebGL 2.0, which Godot 4 uses for rendering-doesn’t fully support advanced post-processing effects, such as Depth of Field (DOF). This means that some effects that work well on PC or consoles might be unavailable or work differently in an HTML5 application.

Interviewer: And WebGL has other restrictions, right?

Expert: Exactly. WebGL, as part of the HTML5 standard, is much less powerful than full-fledged graphics engines on PC or consoles. To create more advanced effects like DOF, it requires complex rendering operations, which can be too demanding for WebGL. As a result, many post-processing effects-like DOF Blur-might be disabled or scaled back to keep browser-based applications running smoothly.

Interviewer: And I imagine different browsers might support WebGL differently?

Expert: Yes, absolutely. Support for advanced WebGL features varies by browser and device. An effect might work in Chrome, for instance, but not in Firefox or Safari, because different WebGL implementations have varying support for these high-demand features, like DOF Blur.

Interviewer: How does Godot handle these limitations for web applications?

Expert: Godot 4 is still under development, and its WebGL support, especially for post-processing effects, is somewhat limited or not fully refined compared to the engine’s full version. Some performance issues may come from this limited optimization for WebGL in Godot 4.

Interviewer: So, Depth of Field doesn’t work in browsers, then?

Expert: That’s right-DOF currently doesn’t function in web environments.

Interviewer: And how does Godot optimize for the web?

Expert: For web applications, Godot uses various optimization techniques to boost performance, which often involves turning off certain resource-intensive effects like DOF Blur. This helps maintain speed and smoothness.

Interviewer: Interesting. I’ve also heard the Spot Light Projector doesn’t work in browsers.

Expert: That’s correct. The Spot Light Projector relies on projecting a texture as light, regardless of whether it’s global, spot, or omni light. It can’t project an image onto the canvas in a browser environment. That feature only works natively on Windows and Linux, and even then, it depends on the GPU you’re using.

Interviewer: So, those are some key differences between HTML5 (canvas) and native environments like Linux and Windows.

Expert: Exactly.

Interviewer: Got it. But what exactly does WASMAI simulate?

Expert: Shaders. A lot more on that in just a moment!

Interviewer: Alright, so… WASMAI, WASMAI, WASMAI!