The practical work for com3503/com4503/com6503 will involve creating an interactive 3D Computer Graphics program using Java and JOGL and learning how to use shader programs. The material given below will teach you how to install and use JOGL. Installation instructions are given for both Windows and Mac.
Learning OpenGL gives you insights into the interplay between the CPU and the GPU when developing graphics software. Other graphics APIs are available (e.g. Vulkan, WebGPU, Metal, DirectX), however, OpenGL remains relevant because of its broad support and extensive resources. It also provides a relatively easier development path for creating graphical software which means quick results can be obtained. In addition, there is still a lot of software that utilises OpenGL, e.g. Blender (UI and Eevee), Maya, Houdini, SketchUp, VTK.
Java is used because the majority of students on the module will already have existing expertise with this language. A lot of examples on the Web will use C and OpenGL, but it is relatively easy to convert these to Java and OpenGL. However, a lot of examples on the Web use early versions of OpenGL that use a fixed function pipeline. These should be avoided. Our focus is the programmable pipeline and the use of shaders.
- Chapter 1. Introduction
- Chapter 2. Rendering triangles
- Chapter 3. Shaders
- Chapter 4. Textures
- Chapter 5. Transformations, coordinate systems and a camera
- Chapter 6. Lighting
- Chapter 7. A set of classes
- Chapter 8. Scene graphs
- Chapter 9. Refinements / Extras
- Chapter 10. Summary
- Appendix A. Installing JOGL
Parts of this guide, particularly the early chapters, draw inspiration from Joey de Vries' excellent learnopengl tutorial. His personal X handle is https://x.com/JoeyDeVriez. The GitHub repository for the code in his tutorial: repo
Notwithstanding the acknowledgement above, and unless otherwise noted, the copyright of the material in this guide to Java and JOGL, including all the program code, is held by Dr Steve Maddock, University of Sheffield, 2025.
Not all of the program code has a comment listing me as the author. I will add some author notes to the code files as the semester progresses.