Using GPU Shaders for Visualization Mike Bailey, Oregon State University Introduction Most of the uses of GPU shaders seem to be for gaming and other forms of entertainment and simulation. And, why not? The effects that can be created are stunning, and definitely enhance the gaming experience. But, there are visualization uses for GPU shaders as well – for the same reasons: appearance and performance. In the drive to understand large, complex data sets, no method should be overlooked. This column looks at the use of GPU shaders and the GLSL shading language in two very common visualization applications: point clouds and contour cutting planes. Previous Work Using shaders for visualization started with experiments using RenderMan, e.g., [Corrie1993]. Interactive (i.e., graphics hardware-based) GPU Shaders appeared in the early 2000’s [Mark2003]. Since then, researchers have pushed them into a variety of applications. Many of these have involved scientific and data visualization involving volume rendering [Stegmaier2005], level of detail management [Petrovic2007], volume segmentation [Sherbondy2003], and level sets [Lefohn2003]. Other work has used GPU programming to combine and filter visualization data to show particular features of interest [McCormick2004]. Reading 3D scalar data into a shader Shaders were designed to accept relatively small sets of scene-describing graphics attributes such as colors, coordinates, vectors, and matrices, as input data. Passing general-purpose large amounts of data into them, such as through uniform variables, is inefficient. It is better to find some way that looks more consistent with the graphics intent of shaders. In this case, an excellent approach is to hide the data in a 3D texture. Textures, were designed to store RGBA color values. The most common format for textures, still, is probably the unsigned byte format, specifically created to hold 8- bit color components. However, today’s graphics cards can also use 16- and 32-bit floating point formats to store texture components. Thus, textures can hold any scale of numbers , within the limits of those floating-point formats, that we want. This makes them ideal as a way to hold 3D data for visualization. Point Clouds However, a 3D texture is just data and data, by itself, cannot be displayed. It needs some sort of geometry to hang itself on, or more accurately, it needs a geometry to map itself to. A good start is to map it to a 3D point cloud, a uniform mesh of 3D points. When you map the temperature distribution dataset above to a point cloud, you get the image in Figure 1: