Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Performance of WebGL and OpenGL

Tags:

c++

opengl

webgl

For the past month I've been messing with WebGL, and found that if I create and draw a large vertex buffer it causes low FPS. Does anyone know if it be the same if I used OpenGL with C++?

Is that a bottleneck with the language used (JavaScript in the case of WebGL) or the GPU?

WebGL examples like this show that you can draw 150,000 cubes using one buffer with good performance but anything more than this, I get FPS drops. Would that be the same with OpenGL, or would it be able to handle a larger buffer?

Basically, I've got to make a decision to continue using WebGL and try to optimise by code or - if you tell me OpenGL would perform better and it's a language speed bottleneck, switch to C++ and use OpenGL.

like image 835
Joey Morani Avatar asked Jul 07 '13 20:07

Joey Morani


People also ask

Why is WebGL slow?

WebGL is the software the latest version of PicMonkey uses to render your images. WebGL may strain the available memory of some users with older graphics processing units (GPUs), resulting in slow performance, freezing, and crashing. This is a result of your machine running out of usable memory.

How different is WebGL from OpenGL?

OpenGL is a desktopcomputer-centric API (like Direct3D). WebGL is derived from OpenGL ES 2.0 (intended for mobile devices) which has less capabilities and is simpler to use. WebGL is also designed to run in a browser, and has therefore a few limitations more then OpenGL ES 2.0.

Is WebGL good for games?

WebGl is a JavaScript API, based on the OpenGL 3D graphics standard. It provides some great 3D games on our websites through HTML5 using JavaScript without additional plugins.


1 Answers

If you only have a single drawArrays call, there should not be much of a difference between OpenGL and WebGL for the call itself. However, setting up the data in Javascript might be a lot slower, so it really depends on your problem. If the bulk of your data is static (landscape, rooms), WebGL might work well for you. Otherwise, setting up the data in JS might be too slow for your purpose. It really depends on your problem.

p.s. If you include more details of what you are trying to do, you'll probably get more detailed / specific answers.

like image 53
Stefan Haustein Avatar answered Oct 11 '22 14:10

Stefan Haustein