3 ms·
Generally speaking, SVG is more integrated to the DOM than canvas or WebGL. Every shape you draw is a DOM node, which means you can easily interact with it (mou
by Wilya 14y ago
Generally speaking, SVG is more integrated to the DOM than canvas or WebGL. Every shape you draw is a DOM node, which means you can easily interact with it (mouseover events, ...), but also that it's rather "heavy". It doesn't scale for effects as well as canvas and WebGL, you can't really display more than a couple thousand nodes without risking major slowdown.
It's nice for very interactive demos and lightweight visualizations, not for rendering-heavy things like games.
- pmelendez 14y agoYour point is very valid but only on the realm of web games using browser's native support of svg. For instance, you would not have DOM-related problems if you use svg files in a native mobile game. The downside of using SVG in a game is that the render is slower in comparison with a rasterized image. However, all graphics formats have pros and consts, so it always depends on how are you going to use them.