Search code examples
webglpyopengl

WebGL vs PyOpenGL


I'm now assigned to try to integrate some 3d rendering that was done in WebGl to PyOpenGL. I have some samples of both but right from the start I've run into somewhat of a dilemma. For one of the objects that has a huge number of vertexes the WebGL version runs much better than the PyOpenGL one.I'm mostly curious if this is normal or is it some implementation issue.

regards, Bogdan


Solution

  • Is your PyOpenGL implementation using VBOs for rendering the geometry?

    The main performance issues we ran into when implementing WebGL were JS->C++ call overhead, type conversions and GC runs. Which is why WebGL is using Typed Arrays for data and VBOs for rendering: Typed Arrays reduce the need for type conversions and are potentially faster to GC than JS arrays, whereas VBOs minimize the amount of API calls and CPU->GPU-traffic.

    On PyOpenGL I'd imagine the main issue to be type conversions. But you shouldn't run into that with VBOs, hence the question.