S
S
Simasik2015-02-15 17:20:39
JavaScript
Simasik, 2015-02-15 17:20:39

Should I use WebGl for 2d graphics?

I want to make small mini toys on canvas 2d, I started looking for plugins for better development and now I got to webGL. Do you think it's worth using it if I'm only dealing with 2d? If not, then maybe there are more suitable analogues of the genus 2d?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Sergey, 2015-02-15
Protko @Fesor

if the deal i will only have with 2d

Believe it or not, WebGL is a 2D API, so it's a perfectly normal use. In fact, this is an OpenGL binding for JS. Shaders are available to you, GPU computing is available to you and all that. That is, on bare opengl you will not be able to draw 3D just like that. Either you will have to write shaders for all this stuff, or connect some kind of 3D engine that will render the whole thing using the 2D API and shaders.

V
vasIvas, 2015-02-15
@vasIvas

WebGL increases performance, this is its only plus.
And the actual disadvantages - at the moment there is no good api, no effects.
Not all browsers support it, and those that do do
so, as always, in different ways. One is 60fps and the other is 30fps. You need to have
knowledge of raster rendering, and this will take a lot of time.

K
Keyten, 2015-02-16
@Keyten

Context2d is definitely simpler and more convenient, the only advantage of WebGL is good rendering speed, i.e. on WebGL resources will eat less.
But a significant disadvantage of WebGL is complexity. WebGL is much more complex than regular context.
Look at
1. The webgl-2d library, it's a standard 2D context API on WebGL.
2. Libraries with WebGL rendering, at the moment I know Pixi.js, in easeljs there was something like that. May appear in Graphics2D.js.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question