Jogl Tutorial: Difference between revisions

From JogampWiki
Jump to navigation Jump to search
(Fixed link to Rami's blog)
No edit summary
(41 intermediate revisions by 5 users not shown)
Line 1: Line 1:
* JOGL with IDEs
= JogAmp's Static =
** Eclipse
* [{{SERVER}}/jogl/doc/Overview-OpenGL-Evolution-And-JOGL.html OpenGL Evolution & JOGL]
*** [http://ramisantina.com/blog/?p=8 Rami's Guide how to setup a JOGL Eclipse project]
*API Doc [ [{{SERVER}}/deployment/jogamp-next/javadoc/jogl/javadoc/ Public], Specs [ [{{SERVER}}/deployment/jogamp-next/javadoc/jogl/javadoc_nativewindow_spec/ Nativewindow], [{{SERVER}}/deployment/jogamp-next/javadoc/jogl/javadoc_jogl_spec/ JOGL] ] ]
*** [http://wadeawalker.wordpress.com/2010/10/09/tutorial-a-cross-platform-workbench-program-using-java-opengl-and-eclipse/ Wade's Cross-platform workbench program using Eclipse and JOGL]
* [{{SERVER}}/jogl/doc/HowToBuild.html How to Build JOGL]
*** [http://wadeawalker.wordpress.com/2010/10/24/tutorial-creating-native-binary-executables-for-multi-platform-java-apps-with-opengl-and-eclipse-rcp/ Wade's Creating native binary executables for multi-platform Java apps with OpenGL and Eclipse RCP]
* [{{SERVER}}/jogl/doc/userguide/ Userguide]
*** [http://wadeawalker.wordpress.com/2010/12/06/tutorial-displaying-java-opengl-in-an-eclipse-editor-with-a-menu-bar-and-a-runpause-button/ Wade's Displaying Java OpenGL in an Eclipse RCP editor with a menu bar and a run/pause button]
* [{{SERVER}}/jogl/doc/deployment/JOGL-DEPLOYMENT.html Deployment]
** Netbeans
* [{{SERVER}}/deployment/jogamp-current/jogl-test-applets.html JOGL Test Applets]
*** Netbeans project configurations are included in the source, hence you just can load them in NB ..
** [{{SERVER}}/deployment/jogamp-current/jogl-applet-runner-newt-gears-normal.html using Object/Embed tags]
** [{{SERVER}}/deployment/jogamp-current/jogl-demos/applet-gears.html using the Applet Tag]
* [{{SERVER}}/jogl/doc/NEWT-Overview.html NEWT - High Performance Native Windowing Toolkit]
* [{{SERVER}}/git/?p=jogl-demos.git;a=blob;f=src/demos/es2/RawGL2ES2demo.java;hb=HEAD OpenGL GL2ES2 GLSL Standalone Example by Xerxes Rånby]
* [https://gist.github.com/gouessej/3420e2b6f632efdddf98 Rudimentary standalone example using the fixed pipeline by Julien Gouesse]
* [https://gist.github.com/xranby/ccbcfcaef341f5bd1ba8 Rudimentary standalone example using the fixed pipeline with OpenGL ES 1 by Xerxes Rånby]


* [https://sites.google.com/site/justinscsstuff/jogl-tutorials Justin's Getting Started with JOGL 2 Tutorials]
= JogAmp's Wiki =
** [https://sites.google.com/site/justinscsstuff/jogl-tutorial-1 JOGL Tutorial 1 - Environment Setup]
* [[Downloading and installing JOGL|Downloading and installing JOGL]]
** [https://sites.google.com/site/justinscsstuff/jogl-tutorial-2 JOGL Tutorial 2 - Creating a Window]
** [[Jogamp_Versioning_and_Releases|Versioning And Release Information]]
** [https://sites.google.com/site/justinscsstuff/jogl-tutorial-3 JOGL Tutorial 3 - Creating a Render Loop]
* [[Setting up a JogAmp project in your favorite IDE|Setting up a JogAmp project in your favorite IDE]]
* Deployment
** [[JogAmp JAR File Handling|JAR File Handling]]
** [[Using JOGL in a Java applet|Using JOGL in a Java Applet]]
** [[Using JOGL in Java Web Start|Using JOGL in Java Web Start]]
** [[Foreign Packaging|Foreign Packaging]]
* JOGL
** [[How to write cross GLProfile compatible shader using JOGL]]
** [[How to use the Debug and Trace GL Pipeline and Debug GL Context]]
** [[Using JOGL in AWT SWT and Swing|Using JOGL in AWT, SWT, and Swing]]
** [[How to use X11 displays]]
* [[Jogl_FAQ|FAQ]]


* [http://wadeawalker.wordpress.com/2010/10/17/tutorial-faster-rendering-with-vertex-buffer-objects/ Wade's Faster rendering with vertex buffer objects]
= Hello Triangle =
[https://github.com/elect86/helloTriangle Simple sample] that features GL4, pure newt, glWindow options, animator, indexed drawing, dinamic attribute and frag data binding, interleaved data, vao, vbo (with normalization on one attribute), ibo (with shorts), uniform, glsl program (with specific suffix) and matrix jogl util, gl error check, key listener and right way to dispose.


* [http://leolol.com/tutorials/graphics_tutorials.html LeoLoL.com Tutorials]
= Common Mistakes =
** [http://leolol.com/tutorials/graphics/lesson01.html Lesson 1 - Setting up a JOGL Template]
I suggest you to take a read to these two pages for a quick overview over the most common problems, it is a very useful reading, legacy sections are carefully signaled.
** [http://leolol.com/tutorials/graphics/lesson02.html Lesson 2 - Drawing basic 2D shapes]
** [http://leolol.com/tutorials/graphics/lesson03.html Lesson 3 - Adding colour]
** [http://leolol.com/tutorials/graphics/lesson04.html Lesson 4 - 3D Shapes and Rotation]


* Courses
[https://www.opengl.org/wiki/Common_Mistakes OpenGL]
** [http://www.informatik.uni-oldenburg.de/~trigger/opengl_course.html Johannes's Courses at University of Oldenburg (German)]
[https://www.opengl.org/wiki/GLSL_:_common_mistakes GLSL]


* Older .. jogl v1 related
Another common mistake that may happen if you port code from C/C++ to Java is this one:
** [http://www.felixgers.de/teaching/jogl/ Felix's OpenGL and JOGL]


<code>
Caused by: com.jogamp.opengl.GLException: unpack pixel_buffer_object must be bound to call this method
at jogamp.opengl.gl4.GL4bcImpl.checkBufferObject(GL4bcImpl.java:40621)
at jogamp.opengl.gl4.GL4bcImpl.checkUnpackPBOBound(GL4bcImpl.java:40707)
at jogamp.opengl.gl4.GL4bcImpl.glTexImage2D(GL4bcImpl.java:5535)
at tests.gl320.Gl_320_fbo_blit.initTexture(Gl_320_fbo_blit.java:199)
</code>


(The old (not quite up2date) JOGL Userguide is currently available [http://jogamp.org/jogl/doc/userguide/ here])
This happens because in C/C++, when you just want to allocate the space for a texture using, for example, ''glTexImage2D'', you should not pass 0 as the last argument, but ''null''.
 
 
N.B: The use of color picking is '''NOT''' recommended on any hardware whose palette is partially emulated.
 
= Java OpenGL Samples Pack =
 
The [https://github.com/elect86/jogl-samples Java OpenGL Samples Pack] (called unsurprisingly jogl-samples) is a port of the [http://www.g-truc.net/project-0026.html OpenGL Samples Pack], a collection of OpenGL samples based on the OpenGL "core profile" specifications.
 
The project aims to promote the new OpenGL features making easier version transitions for OpenGL programmers with a complementary documentation for the OpenGL specification. Despite the fact that the OpenGL Samples Pack provides as simple (and dumb) as possible samples, it's not a tutorial for beginner but a project for programmers already familiar with OpenGL. The OpenGL Samples Pack is also a good OpenGL drivers feature test.
 
These samples illustrate mostly of the OpenGL features from ES 2.0 up to the last GL extenstions, same of them usually also called AZDO (Almost Zero Driver Overhead).
 
= Wade's JOGL tutorials =
* [http://wadeawalker.wordpress.com/2010/10/09/tutorial-a-cross-platform-workbench-program-using-java-opengl-and-eclipse/ Cross-platform workbench program using Eclipse and JOGL]
* [http://wadeawalker.wordpress.com/2010/10/17/tutorial-faster-rendering-with-vertex-buffer-objects/ Faster rendering with vertex buffer objects]
* [http://wadeawalker.wordpress.com/2010/10/24/tutorial-creating-native-binary-executables-for-multi-platform-java-apps-with-opengl-and-eclipse-rcp/ Creating native binary executables for multi-platform Java apps with OpenGL and Eclipse RCP]
* [http://wadeawalker.wordpress.com/2010/12/06/tutorial-displaying-java-opengl-in-an-eclipse-editor-with-a-menu-bar-and-a-runpause-button/ Displaying Java OpenGL in an Eclipse RCP editor with a menu bar and a run/pause button]
 
= Rami's JOGL tutorials =
* [http://ramisantina.com/blog/?p=8 Rami's Guide how to setup a JOGL Eclipse project]
 
= [https://sites.google.com/site/justinscsstuff/jogl-tutorials Justin's Getting Started with JOGL 2 Tutorials] =
* [https://sites.google.com/site/justinscsstuff/jogl-tutorial-1 JOGL Tutorial 1 - Environment Setup]
* [https://sites.google.com/site/justinscsstuff/jogl-tutorial-2 JOGL Tutorial 2 - Creating a Window]
* [https://sites.google.com/site/justinscsstuff/jogl-tutorial-3 JOGL Tutorial 3 - Creating a Render Loop]
 
= Elect86's modern OpenGL examples =
 
* [https://github.com/elect86/modern-jogl-examples Source code on Github]
 
= Nils Hoffmann's Netbeans Platform examples =
* [https://github.com/nilshoffmann/netbeans-jogl2 Source code on Github]
 
= Courses =
* [http://www3.ntu.edu.sg/home/ehchua/programming/opengl/JOGL2.0.html Yet Another Tutorial on JOGL 2.0 - Including Nehe JOGL Port (Chua Hock-Chuan's notes at Nanyang Tech. University)]
* [http://www.informatik.uni-oldenburg.de/~trigger/opengl_course.html Johannes's Courses at University of Oldenburg (German)]
* [http://www.manuel-carcenac.com/courses/index.html Manuel's Courses at European University of Lefke]
** [http://www.manuel-carcenac.com/courses/Graphics_in_Java/index.htm Graphics in Java incl. 3D/JOGL]
** [http://www.manuel-carcenac.com/courses/Advanced_Graphics_in_Java_and_JOGL/index.htm Advanced 3D Graphics in Java and Java OpenGL (JOGL 2)]
 
= [http://leolol.com/tutorials/graphics_tutorials.html LeoLoL.com Tutorials] (Currently unreachable) =
* [http://leolol.com/tutorials/graphics/lesson01.html Lesson 1 - Setting up a JOGL Template]
* [http://leolol.com/tutorials/graphics/lesson02.html Lesson 2 - Drawing basic 2D shapes]
* [http://leolol.com/tutorials/graphics/lesson03.html Lesson 3 - Adding colour]
* [http://leolol.com/tutorials/graphics/lesson04.html Lesson 4 - 3D Shapes and Rotation]
 
= JOGL 1 tutorials =
* [http://www.felixgers.de/teaching/jogl/ Felix's OpenGL and JOGL]
 
== [http://www.sjonesart.com/gl.php Ste3e's JOGL tutorials] ==
* [https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0B9hhZie2D-fENGE3ZmZkOGItZGYzZC00ZDgzLTg0NTAtMTk1MTAwMzYxYzNk&hl=en Keys and Mouse]
* [https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0B9hhZie2D-fEYTFiMmFiYzQtMDA0MC00ZWI0LWI1NjItODE3ZjM2OGUxOWEw&hl=en First-Person Shooter]
* [https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0B9hhZie2D-fEZGI2NTZhZTMtYWYwNS00NTljLWFiNGQtM2UyNTYyNjAzNDYy&hl=en Vertex Buffer Objects]
* [https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0B9hhZie2D-fENWFhODk0M2UtZDY0Ni00YWM5LWIxZGUtMzM0YzMxMmRlODgx&hl=en Shader Setup]
* [https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0B9hhZie2D-fEMzNjNDBmMjUtNGQzNS00ODY0LWJkYmUtNDM5Y2I5ODc0Y2Nj&hl=en Texture Using Shaders]
 
(The old (not quite up-to-date) JOGL Userguide is currently available [http://jogamp.org/jogl/doc/userguide/ here])

Revision as of 15:21, 1 February 2016

JogAmp's Static

JogAmp's Wiki

Hello Triangle

Simple sample that features GL4, pure newt, glWindow options, animator, indexed drawing, dinamic attribute and frag data binding, interleaved data, vao, vbo (with normalization on one attribute), ibo (with shorts), uniform, glsl program (with specific suffix) and matrix jogl util, gl error check, key listener and right way to dispose.

Common Mistakes

I suggest you to take a read to these two pages for a quick overview over the most common problems, it is a very useful reading, legacy sections are carefully signaled.

OpenGL GLSL

Another common mistake that may happen if you port code from C/C++ to Java is this one:

Caused by: com.jogamp.opengl.GLException: unpack pixel_buffer_object must be bound to call this method at jogamp.opengl.gl4.GL4bcImpl.checkBufferObject(GL4bcImpl.java:40621) at jogamp.opengl.gl4.GL4bcImpl.checkUnpackPBOBound(GL4bcImpl.java:40707) at jogamp.opengl.gl4.GL4bcImpl.glTexImage2D(GL4bcImpl.java:5535) at tests.gl320.Gl_320_fbo_blit.initTexture(Gl_320_fbo_blit.java:199)

This happens because in C/C++, when you just want to allocate the space for a texture using, for example, glTexImage2D, you should not pass 0 as the last argument, but null.


N.B: The use of color picking is NOT recommended on any hardware whose palette is partially emulated.

Java OpenGL Samples Pack

The Java OpenGL Samples Pack (called unsurprisingly jogl-samples) is a port of the OpenGL Samples Pack, a collection of OpenGL samples based on the OpenGL "core profile" specifications.

The project aims to promote the new OpenGL features making easier version transitions for OpenGL programmers with a complementary documentation for the OpenGL specification. Despite the fact that the OpenGL Samples Pack provides as simple (and dumb) as possible samples, it's not a tutorial for beginner but a project for programmers already familiar with OpenGL. The OpenGL Samples Pack is also a good OpenGL drivers feature test.

These samples illustrate mostly of the OpenGL features from ES 2.0 up to the last GL extenstions, same of them usually also called AZDO (Almost Zero Driver Overhead).

Wade's JOGL tutorials

Rami's JOGL tutorials

Justin's Getting Started with JOGL 2 Tutorials

Elect86's modern OpenGL examples

Nils Hoffmann's Netbeans Platform examples

Courses

LeoLoL.com Tutorials (Currently unreachable)

JOGL 1 tutorials

Ste3e's JOGL tutorials

(The old (not quite up-to-date) JOGL Userguide is currently available here)