| | 1 | = Visualization with OpenGL = |
| | 2 | Essential approaches to programming computer graphics with Open Graphics |
| | 3 | Language (OpenGL) graphics library are described. This document serves as |
| | 4 | the basis for exercises in PRACE Summer of HPC Visualization training. |
| | 5 | Rationale for giving introduction to OpenGL is that such knowledge is |
| | 6 | important when developing codes that require some specific visualization |
| | 7 | for which OpenGL can be handy. Programming Graphical Processing Unit |
| | 8 | (GPU) through ''shaders'' is an important technique to accelerate |
| | 9 | graphics and other embarrassing parallel problems. OpenGL evolved from |
| | 10 | immediate mode to GPU only processing with the advent of OpenGL Shading |
| | 11 | Language (GLSL). Introduction to the subject is given by recipes to |
| | 12 | follow, discussing important techniques for visualization that can also |
| | 13 | be extended to general GPU programming for parallel computing. Instead of |
| | 14 | jumping to the latest OpenGL specification we use minimum required OpenGL |
| | 15 | 2.1 with the extensions currently available on modest hardware and still |
| | 16 | be able to use modern OpenGL 3.1+ programming principles. |
| | 17 | |
| | 18 | |
| | 19 | == Introduction == |
| | 20 | For the visualization of specific phenomena is usually not possible to use |
| | 21 | a general purpose visualization tools. Such cases occur especially in the |
| | 22 | visualization of engineering and physics problems. The modeling results are |
| | 23 | usually not only simple function plots but complex objects such as graphs, |
| | 24 | hierarchical structure, animation, motion mechanism, control channels, |
| | 25 | volume models of specific forms, ... |
| | 26 | |
| | 27 | Through the time different standards were effective for computer graphics. |
| | 28 | This is mainly due to the complexity of implementation and closed code in |
| | 29 | the past. OpenGL remains the only widely accepted open standard, which was |
| | 30 | first introduced on Silicon Graphics workstations (SGI). There exist also a |
| | 31 | Microsoft Direct3D, which is limited to PCs with Windows and is not as easy |
| | 32 | to use as OpenGL, which is due to its openness and capacity provided on all |
| | 33 | operating systems and hardware platforms. OpenGL stagnated for some time |
| | 34 | with upgrades to the original SGI specification. Many extensions previously |
| | 35 | available from hardware vendors are now standardized with OpenGL 3+ where |
| | 36 | things dramatically changed. ''Immediate mode'' programming where |
| | 37 | communication from OS to GPU was regular practice and major obstacle to |
| | 38 | graphics performance. Programming knowledge of OpenGL 1.x is therefore not |
| | 39 | recommended for nowadays and can simply be forgotten and treated as legacy. |