aboutsummaryrefslogtreecommitdiffstats
path: root/doc/Overview-OpenGL-Evolution-And-JOGL.html
blob: 4dc8cd355af849671027dccb0b25cf32c294ac0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
        <link href="../../style.css" rel="stylesheet" type="text/css"/>
        <link href="../../style-alt1.css" rel="alternate stylesheet" title="default sans-serif font" type="text/css"/>
        <title>OpenGL Evolution &amp; JOGL</title>
    </head>
    <body>
        <div id="container">
            <div id="header">
                <div id="slogan">OpenGL &amp; JOGL</div>
                <div id="logo"><a href="http://jogamp.org/jogl/">OpenGL &amp; JOGL</a></div>
            </div>
            <div id="menu">
                <ul>
                    <li><a href="http://jogamp.org/">Home</a></li>
                    <li><a href="../../gluegen/www/">Gluegen</a></li>
                    <li><a href="../../joal/www/">JOAL</a></li>
                    <li><a href="../../jocl/www/">JOCL</a></li>
                    <li><a href="../../jogl/www/">JOGL</a></li>
                    <li><a href="../../demos/www/">Demos</a></li>
                    <li><a href="../../wiki/">Wiki</a></li>
                    <li><a href="../../deployment/jogl-next/javadoc_public/">JavaDoc</a></li>
                    <li><a href="../../blog/">Blogs</a></li>
                    <li><a href="../../forum.html">Forums</a></li>
                </ul>
            </div>
            <div id="main">
                <div id="text" class="fill">
                    <h2>OpenGL Evolution &amp; JOGL</h2>

                    <h3>OpenGL Evolution</h3>
                    <hr/>

<p>
<a href="http://www.opengl.org/">OpenGL</a> is an application programming interface (API) giving application developers
access to hardware accelerated 3D rendering (incl. 2D).</p>

<p>
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 <a href="http://www.khronos.org/">Khronos Group</a>.</p>

<p>
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.</p>

<p>
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.</p>

<p>
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.</p>

<p>
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.</p>

GLSL allows users to 
<ul>
 <li> write ANSI-C like shader programs</li>
 <li> compile shader programs</li>
 <li> upload shader programs to the GPU </li>
</ul>

<p>
The shader, executed on the GPU, transform the
triangle position and determine the pixel color.</p>

<p>
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.</p>

<p>
In September 2004, GLSL subsumed into the core OpenGL 2.0 API,
hence OpenGL 2.0 supported both, FFP and PSP.</p>

<p>
The desire to utilize OpenGL on embedded devices increased
the more 3D capabilities appeared.</p>

<p>
Around 2005 a subset of the FFP of OpenGL 1.3 
for embedded systems was released, OpenGL ES 1.0.</p>

<p>
In March 2007 a programmable shader (PSP) only subset of OpenGL 2.0 
for embedded systems was released.</p>

<p>
In July 2010 OpenGL 4.1 was released and it's core profile
is fully compatible to OpenGL ES 2.0.</p>

<p>
In July 2012 OpenGL 4.3 and OpenGL ES 3.0 were released.
OpenGL's 4.3 core profile is fully compatible to OpenGL ES 3.0.<br/> 
Some OpenGL 3.x implementations implementing <i>GL_ARB_ES3_compatibility</i>
are OpenGL ES 3.0 compatible as well, e.g. Mesa 9.1.</p>

<p>
Today, desktop and embedded GPU's implement the programmatic shader (PSP)
based rendering.</p>

<p>
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.</p>

<p>
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.</p>
 
<h3>JOGL &amp; The OpenGL Evolution</h3>
<hr/>
<p>
Like <a href="http://jausoft.com/gl4java/">GL4Java</a>, 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.</p>

<p>
The continously developed <a href="/jogl/www/">JOGL project</a> reflects the aforementioned OpenGL evolution
by <a href="/deployment/jogamp-next/javadoc/jogl/javadoc/overview-summary.html#overview_description">mapping the OpenGL profiles to interfaces</a>.
This is essential since creating an OpenGL context for each class of OpenGL profiles
requires it's <a href="/deployment/jogamp-next/javadoc/jogl/javadoc/overview-summary.html#GLAPIInclusionCriteria">specific initialisation</a>.<br/>
Some OpenGL profiles like 
    <a href="/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/opengl/GLES2.html">GLES2</a>
for embedded may not be available on desktop machines.</p>

Fixed Function (FFP) Only Profiles:
<ul>
    <li><a href="/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/opengl/GLES1.html">GLES1</a></li>
</ul><br/>

Programmable Shader (PSP) Only Profiles:
<ul>
    <li><a href="/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/opengl/GLES2.html">GLES2</a></li>
    <li><a href="/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/opengl/GLES3.html">GLES3</a></li>
    <li><a href="/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/opengl/GL3.html">GL3</a></li>
    <li><a href="/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/opengl/GL4.html">GL4</a></li>
</ul><br/>

FFP &amp; PSP Profiles:
<ul>
    <li><a href="/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/opengl/GL2.html">GL2</a></li>
    <li><a href="/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/opengl/GL3bc.html">GL3bc</a></li>
    <li><a href="/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/opengl/GL4bc.html">GL4bc</a></li>
</ul><br/>

<p>
The following UML diagram show that JOGL also adds common subsets of OpenGL profiles
to allow easy development of multiple target profiles.</p>

Common OpenGL Profile Subsets:
<ul>
    <li><a href="/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/opengl/GL.html">GL</a></li>
    <li>Fixed Function (FFP) Only:
    <ul>
        <li><a href="/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/opengl/GL2ES1.html">GL2ES1</a></li>
        <li><a href="/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/opengl/GL2GL3.html">GL2GL3</a></li>
    </ul></li>
    <li>Programmable Shader (PSP) Only:
    <ul>
        <li><a href="/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/opengl/GL2ES2.html">GL2ES2</a></li>
        <li><a href="/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/opengl/GL3ES3.html">GL3ES3</a></li>
        <li><a href="/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/opengl/GL4ES3.html">GL4ES3</a></li>
    </ul></li>
</ul><br/>

<br/>
For example using the common interface 
<a href="/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/opengl/GL2ES2.html">GL2ES2</a>
of <a href="/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/opengl/GL2.html">GL2</a>
and <a href="/deployment/jogamp-next/javadoc/jogl/javadoc/com/jogamp/opengl/GLES2.html">GLES2</a>,
ensures the code complies with the GL2 and GLES2 profile and an implementation may use both:<br/>
<pre>
    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);
        ...

    }
</pre>

<h4>OpenGL Profile Models (UML)</h4>
<a href="uml/html/index-withframe.html">Complete UML with frames</a>.
<h5><a href="uml/html/fig128069.png">Compatibility (Fixed Function and Programmable)</a></h5>
<embed src="uml/html/fig128069.png" width="1024" height="1000" />
<h5><a href="uml/html/fig134786.png">Core Only (Programmable)</a></h5>
<embed src="uml/html/fig134786.png" width="1024" height="1000" />

<h3>References</h3>
<ul>
    <li><a href="http://en.wikipedia.org/wiki/OpenGL">OpenGL on Wikipedia</a></li>
    <li><a href="http://en.wikipedia.org/wiki/OpenGL_ES">OpenGL ES on Wikipedia</a></li>
    <li><a href="http://en.wikipedia.org/wiki/GLSL">GLSL on Wikipedia</a></li>
    <li><a href="http://www.opengl.org/">OpenGL Web Site</a></li>
    <li><a href="http://www.khronos.org/">Khronos Web Site</a></li>
    <li><a href="/deployment/jogamp-next/javadoc/jogl/javadoc/overview-summary.html#overview_description">JOGL API Overview</a></li>
</ul>
                </div>
            </div>
            <div id="footer">
                <div id="footer_left">
                    <span>JogAmp.org</span>
                    by <a href="http://jogamp.org">http://jogamp.org</a>
                    is licensed under a <br/>
                    <a href="http://creativecommons.org/licenses/by/3.0/us/">Creative Commons Attribution 3.0 License</a>.
                </div>
            </div>
        </div>
    </body>
</html>