Master's Thesis - Studierstube Augmented Reality Project - Graz ...
Master's Thesis - Studierstube Augmented Reality Project - Graz ...
Master's Thesis - Studierstube Augmented Reality Project - Graz ...
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
2.2 Advanced Graphics Processing<br />
2.2.2 GPGPU - General-Purpose Computation on the GPU<br />
Programming the GPU for general purposes has several constraints. The techniques to<br />
handle them are presented in this section and much more in detail in [Thompson2002;<br />
Pharr2005; Nvidia2005].<br />
2.2.2.1 Graphics Card/GPU Memory<br />
The access to memory on GPUs is restricted to various kinds of indexed texture memory<br />
lookups into one, two or three-dimensional banks of fast accessible texture memory.<br />
The amount of memory has to be defined in advance through a texture of a certain<br />
size. Each of its ”memory” element (texel) gets processed during one iteration. First<br />
and foremost this means that the programmer has no opportunity to allocate memory<br />
during the shader program’s execution or to use pointers. Nevertheless, these concepts<br />
are generally not necessary since the complete data is represented by a stream and<br />
interpreted by a stream-processor. Consequently, using memory on graphics hardware<br />
in both, vertex and fragment shader will mostly look like the following algorithm:<br />
1. define a texture of a certain size with the main application,<br />
2. pass the texture-ID to the desired shader program,<br />
3. define in the shader program what to do with each texture’s element,<br />
4. tell the hardware when to use the shader in each rendered frame.<br />
Using memory is always accompanied by two basic concepts:<br />
• Gathering describes an operation which takes values from different memory<br />
addresses to obtain one result.<br />
• Scattering is the opposite an operation which stores several results in different<br />
memory addresses at once.<br />
On a GPU only the first concept is available because of the fixed defined output<br />
address of the process data stream. However, it is possible to store a result in multiple<br />
render targets at this predefined position. This implies that graphics hardware is able<br />
to render calculated pixel values not only on screen but also in a dedicated buffer in the<br />
32