Forum Discussion
Lucas-S
Jan 18, 2020Brass Contributor
WebGL optimization in navigation.
Hello! After the end of support for unity apis, one feature that has been adopted by many is WebGL for both games and websites, but it performs very poorly in most browsers, a way I think could solve such a problem, would be putting WebGL as a separate process in the Microsoft Edge process tree and giving high priority to the process, making it run more powerfully.
1 Reply
Sort By
- ThraetaonaIron Contributor
Unity no longer depends on a plugin, but is still used on the web.
some internal parts of the browser are already on their separate process (like the compositor thread)
the host system or the graphics API ANGLE is using also affects WebGL's performance.
There is a overhead of communicating between JavaScript and WebGL, too; with the lack of SIMD or other low-level features. (Unless you use something like WebAssembly.)
While the performance varies greatly due to code quality or optimizations, considering that the Shaders are already running on the GPU it should be fast enough for a Web app.
And WebGL Aims to be safe as well (sandboxes, sanity checks, etc) so theres a bit of speed trade-off.
With everything mentioned above, WebGL should still be very fast especially for 3D Workloads, you can expect 30fps even on a low end mobile device at worst.
If it really performs that poor there might be another problem, maybe GPU acceleration is disabled?
[ you can find more debug info in edge://gpu ]
As a side note WebGL (1 or 2) doesn't support compute Shaders, WebGL 2.0 Compute API which is based on OpenGL ES 3.1 solves this and allows you to perform GPGPU tasks, such as direct read/writes operations on the GPU that scales very well with heavier workloads. Although I'd say waiting for WebGPU to stabilize is better.