JOGL GL3 sample

triangle

I had some difficulties to find some full sample of JOGL code for the version GL3. As I have managed to produce one, I decided to share it on my blog. This sample is highly inspired from the following link  : http://www.lighthouse3d.com/cg-topics/code-samples/opengl-3-3-glsl-1-5-sample/

The source is made of in three files : one for java and two for shaders.

I have to admit that it is a big step between GL1/GL2 and GL3/GL4 version. GL3 provides less graphical abstractions and more processing ones with shaders. For sure it is more powerful but the price of it is to write more line of code.

In order to avoid display flickering just add “-Dsun.awt.noerasebackground=true” parameter on the java options.

 

 

2 thoughts on “JOGL GL3 sample

  1. Just found this blog entry while looking desperately for a tutorial on how to implement the use of vertex and fragment shaders in a Java application with JOGL (we find lot of tutorials about using directly OpenGL functions but it’s very hard to find something about how to get attributes / uniforms locations inside shaders).

    My problem was about using JOGL GL2 until now, and I couldn’t find a way to make work properly my shaders. I’ll switch to GL3 then.

    Anyway, thanks a lot for your entry, that just unlocked me months of research.

Leave a Reply

Your email address will not be published. Required fields are marked *


*