OpenGL Evolution & JOGL
OpenGL Evolution
OpenGL is an application programming interface (API) giving application developers access to hardware accelerated 3D rendering (incl. 2D).
SGI released the first OpenGL specification in January 1992. Since this point OpenGL 1.x constantly evolved, first under the ARB and later under the Khronos Group.
The OpenGL API was specified with the objective of maximal hardware acceleration, ie the API functions shall be implemented in hardware - as much as possible. Further more, OpenGL is considered a vendor neutral and platform agnostic API, ie should run anywhere, implemented by all 3D GPU manufacturer.
Up until OpenGL 1.5, released in July 2003, the core API reflected the so called fixed function pipeline (FFP). FFP allowed a user to pass triangles, textures and attributes to the GPU. The attributes had to be utilized to select predefined function of rendering, hence the name fixed function.
Around 2000 new types of GPU hardware evolved, allowing custom code running on the GPU hardware, instead of being restricted to the fixed function rendering code.
To allow processing of such user defined algorithms on the GPU, in 2002 the programmable shader pipeline (PSP) was introduced. The OpenGL Shading Language (GLSL) used to write such shader programs became an extension to OpenGL 1.4.
GLSL allows users to- write ANSI-C like shader programs
- compile shader programs
- upload shader programs to the GPU
The shader, executed on the GPU, transform the triangle position and determine the pixel color.
Within this process, the shader may use any form of data, arrays, textures and framebuffer. It reads it, computes and stores the result in the target framebuffer(s), hence the name programmable.
In September 2004, GLSL subsumed into the core OpenGL 2.0 API, hence OpenGL 2.0 supported both, FFP and PSP.
The desire to utilize OpenGL on embedded devices increased the more 3D capabilities appeared.
Around 2005 a subset of the FFP of OpenGL 1.3 for embedded systems was released, OpenGL ES 1.0.
In March 2007 a programmable shader (PSP) only subset of OpenGL 2.0 for embedded systems was released.
In July 2010 OpenGL 4.1 was released and it's core profile is fully compatible to OpenGL ES 2.0.
Today, desktop and embedded GPU's implement the programmatic shader (PSP) based rendering.
Still the fixed function subset is provided by most drivers. However, since the hardware itself does not implement such functionality anymore, it is completely implemented in software by the OpenGL driver.
This leads to the conclusion it is best advised for OpenGL applications to avoid the FFP, but using the PSP. This allows the implementor to utilize application level optimization which usually cannot be reached by the very generic implemented FFP in the OpenGL drivers.
JOGL & The OpenGL Evolution
Like GL4Java, the 1st JOGL release 1.x mapped OpenGL in one interface. This architecture was feasible and correct until the new OpenGL profiles surfaced. There was only one unique way to create an OpenGL context for all available OpenGL versions.
The continously developed JOGL 2.x reflects the aforementioned OpenGL evolution
by mapping the OpenGL profiles to interfaces.
This is essential since creating an OpenGL context for each class of OpenGL profiles
requires it's specific initialisation.
Some OpenGL profiles like
GLES2
for embedded may not be available on desktop machines.
Programmable Shader (PSP) Only Profiles:
FFP & PSP Profiles:
The following UML diagram show that JOGL also adds common subsets of OpenGL profiles to allow easy development of multiple target profiles.
Common OpenGL Profile Subsets:For example using the common interface GL2ES2 of GL2 and GLES2, ensures the code complies with the GL2 and GLES2 profile and an implementation may use both:
void renderSomethingForGL2(GL2 gl, int program) { renderSomethingForGL2AndGLES2(gl, program); } void renderSomethingForGLES2(GLES2 gl, int program) { renderSomethingForGL2AndGLES2(gl, program); } void renderSomethingForGL2AndGLES2(GL2ES2 gl, int program) { gl.glValidateProgram(program); ... }