Posted by
Demoscene Passivist on
Jul 22, 2010; 1:55pm
URL: https://forum.jogamp.org/JOGL-limitations-tp986701p987130.html
>Firstly, performance. I am thinking that the performance of the rendering
>would be no slower using Java than C/C++ because it will be governed
>more by the capabilities of the GPU in use. Is that correct?
Yep that is correct. As rendering is performed 100% by the native driver and on the GPU there is no overhead using JOGL in that respect. But there are some areas on the Java side where overhead is implied:
1. Native OpenGL-API calls using JNI (JOGL uses JNI to foreward native calls) have an overhead. But this overhead is very small and doesn't really matter in a real application coz too many API calls kill your OpenGL performance anyway (even in C/C++) and if you stay under a couple of hundred calls per frame u won't notice the difference.
2. Datatransfer to the GPU has some overhead (see 1.) but by programming carefully and using NIO u can limit the peformance impact. Also it does only matter when tranferring large chunks of data every frame.
3. There is some overhead implied with the window toolkit u choose to display ur OpenGL output. For further information see here:
http://jogamp.org/wiki/index.php/Jogl_FAQ#Why_using_AWT_for_high_performance_is_not_a_good_idea_.3F This is ofcourse also an issue when using C/C++ so u can't really compare JOGL/Native C++ there.
Anyway the way u program OpenGL today is more or less "upload data->init shaders->let the GPU render the stuff->control/modify output with shaders" so the JOGL/API call or any other Java overhead doesn't really matter for rendering performance anymore.
>Secondly, the ability to utilise the full capabilities of OpenGL. Are there any
>limitations with the JOGL approach in this area? That is, are there things I
>could do with OpenGL using C/C++ that I cannot do using JOGL? Some
>aspects of shading, GLSL etc. perhaps? Maybe JOGL is limited in its ability
>to access all OpenGL extensions? I am just guessing here.
To my knowledge currently the only limitation is that u can't use GL4 feature like geometry shaders/hardware tesselation (wich is in the works right now as far as I'm informed). Other than that there's really no limit to what u can do with JOGL. Vertex/Fragment shaders and extensions are ofcourse fully supported.
For a small overview of stuff u can do with JOGL from the simplest fixed function pipeline flat shaded torus using OpenGL 1.0 up to completely GPU based particle systems and Parallax-Occlusion-Mapping using OpenGL 3.1 features take a look here:
http://www.youtube.com/user/DemoscenePassivist#g/c/9725BF2AF5A18CD9