Login  Register

Multithreading

Posted by Haroogan on Jan 09, 2011; 12:41pm
URL: https://forum.jogamp.org/Multithreading-tp2221001.html

Hey, everyone, I would like to know about multithreading ability in JOGL. In brief, I need to stream my terrain blocks from HD, therefore I consider 2 possible solutions:

1. I can stream  terrain blocks in a secondary thread and then in a primary thread (the JOGL one) upload vertex and index buffers' data to graphics card (I mean glBindBuffer, glBufferData and other functions, which we need to throw data to graphics card). In this case I won't have to carry about multithreading with JOGL, since I don't make any OpenGL calls in the secondary thread. However, I'm sure that these preparation calls (glBindBuffer, glBufferData and etc.) will cost me too much in the primary thread and will drop FPS hard, therefore I want to deal with solution n. 2.

2. Streaming and uploading (glBindBuffer, glBufferData and etc.) of terrain blocks is done in secondary thread. Obviously here I need to know how to deal with multithreaded OpenGL API calling.

So tell me, if I'm right about these considerations, and if I am, then let me know how to deal with solution n. 2.