Toxiclibs + GPU (openGL) processing 3

If you look at the rendering code in ToxicLibs what you see is that each time you render the mesh it sends all the vertices and normals one by one to the GPU, which is slow.

So you could try the approach you suggest. Here’s an example of exporting a ToxicLibs mesh to obj.
Then you could load the shapes with https://processing.org/reference/loadShape_.html and render them.

If you want even better frameRate, add one extra middle step: simplify the meshes with http://www.meshlab.net/ (or even Blender if you know how to use it). You might be able to reduce the vertex counts greatly (to 10% ~ 50%) without much noticeable effects and make it easier to achieve higher frame rates.

2 Likes