Pgl.bufferData(PGL.ARRAY_BUFFER, nvert * 7 * SIZEOF_FLOAT, vertData, PGL. VertData = allocateDirectFloatBuffer(nvert * 7) If (frameCount % 60 = 0) println("fps: " + frameRate) Pgl.vertexAttribPointer(colorLoc, 4, PGL.FLOAT, false, 7 * SIZEOF_FLOAT, 3 * SIZEOF_FLOAT) Pgl.vertexAttribPointer(vertLoc, 3, PGL.FLOAT, false, 7 * SIZEOF_FLOAT, 0) VertLoc = pgl.getAttribLocation(sh.glProgram, "vertex") ĬolorLoc = pgl.getAttribLocation(sh.glProgram, "color") Rotate(frameCount * 0.01, width, height, 0) Sh = loadShader("frag.glsl", "vert.glsl") If you are ok with using shaders, you could do: import java.nio.* Then change the code to GLES2 adding the required shaders. Make sure you can draw something on screen. Those examples use the old shader-less OpenGL ES. You could avoid the PShape overhead altogether by implementing your own VBO handling code using low-level opengl. 1 Answer Sorted by: 2 OpenGL ES 2.0 requires you to provide a set of shaders (vertex and fragment). this method takes almost 10GB of RAM for the process, so its not usable - I'm aiming at around 12million (lighter scans) to 60mil (heavy scans).Īny ideas where to save ram and gain fps? I checked that example, changed PShape to POINTS and managed to squeeze 1.000.000 particles rotating at 18fps.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |