Accelerating the Hyperbolic Display of Complex 2D Scenes Using the GPU

Similar documents
Realtime Dome Imaging and Interaction: Towards Immersive Design Environments

Programmable GPUs. Real Time Graphics 11/13/2013. Nalu 2004 (NVIDIA Corporation) GeForce 6. Virtua Fighter 1995 (SEGA Corporation) NV1

X. GPU Programming. Jacobs University Visualization and Computer Graphics Lab : Advanced Graphics - Chapter X 1

Orthogonal Projection Matrices. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

GPU Programming EE Midterm Examination

The Transition from RenderMan to the OpenGL Shading Language (GLSL)

CS 354R: Computer Game Technology

CS559 Computer Graphics Fall 2015

CSE 167: Lecture #8: GLSL. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

Shaders. Slide credit to Prof. Zwicker

CSE 167: Lecture #17: Procedural Modeling. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

Introduction to Shaders for Visualization. The Basic Computer Graphics Pipeline

Exercise Max. Points Total 90

OPENGL RENDERING PIPELINE

Optimisation. CS7GV3 Real-time Rendering

Information Coding / Computer Graphics, ISY, LiTH GLSL. OpenGL Shading Language. Language with syntax similar to C

Introduction to Shaders.

CSE 167: Lecture #5: Rasterization. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

Introduction to the OpenGL Shading Language (GLSL)

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

GPU Programming EE Final Examination

Programmable Graphics Hardware

Lecture 17: Shading in OpenGL. CITS3003 Graphics & Animation

Shaders CSCI 4239/5239 Advanced Computer Graphics Spring 2014

Programmable Graphics Hardware

CSE 167: Introduction to Computer Graphics Lecture #19: Wrapping Up. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2017

GPU Memory Model. Adapted from:

Shadows. Prof. George Wolberg Dept. of Computer Science City College of New York

Review of Thursday. xa + yb xc + yd

C P S C 314 S H A D E R S, O P E N G L, & J S RENDERING PIPELINE. Mikhail Bessmeltsev

LSU EE Homework 5 Solution Due: 27 November 2017

GLSL Introduction. Fu-Chung Huang. Thanks for materials from many other people

Performance OpenGL Programming (for whatever reason)

Three Main Themes of Computer Graphics

Shaders CSCI 4229/5229 Computer Graphics Fall 2017

Today s Agenda. Basic design of a graphics system. Introduction to OpenGL

CS 130 Final. Fall 2015

Levy: Constraint Texture Mapping, SIGGRAPH, CS 148, Summer 2012 Introduction to Computer Graphics and Imaging Justin Solomon

Introduction to the OpenGL Shading Language

CS452/552; EE465/505. Intro to Lighting

CS451Real-time Rendering Pipeline

Programming with OpenGL Part 3: Shaders. Ed Angel Professor of Emeritus of Computer Science University of New Mexico

Copyright Khronos Group 2012 Page 1. Teaching GL. Dave Shreiner Director, Graphics and GPU Computing, ARM 1 December 2012

2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into

OpenGL shaders and programming models that provide object persistence

Objectives Shading in OpenGL. Front and Back Faces. OpenGL shading. Introduce the OpenGL shading methods. Discuss polygonal shading

Blis: Better Language for Image Stuff Project Proposal Programming Languages and Translators, Spring 2017

The Basic Computer Graphics Pipeline, OpenGL-style. Introduction to the OpenGL Shading Language (GLSL)

Lecture 5 Vertex and Fragment Shaders-1. CITS3003 Graphics & Animation

Spring 2011 Prof. Hyesoon Kim

Computer graphics 2: Graduate seminar in computational aesthetics

The Projection Matrix

2.11 Particle Systems

CHAPTER 1 Graphics Systems and Models 3

High-quality Shadows with Improved Paraboloid Mapping

The Graphics Pipeline

CS 381 Computer Graphics, Fall 2012 Midterm Exam Solutions. The Midterm Exam was given in class on Tuesday, October 16, 2012.

View-Dependent Selective Refinement for Fast Rendering

Why modern versions of OpenGL should be used Some useful API commands and extensions

API Background. Prof. George Wolberg Dept. of Computer Science City College of New York

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

Supplement to Lecture 22

Chapter 5. Projections and Rendering

3D Graphics for Game Programming (J. Han) Chapter II Vertex Processing

Computer Viewing. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science

Adaptive Point Cloud Rendering

Spring 2009 Prof. Hyesoon Kim

CS 130 Exam I. Fall 2015

12.2 Programmable Graphics Hardware

Programming shaders & GPUs Christian Miller CS Fall 2011

Lecture 13: OpenGL Shading Language (GLSL)

2D Object Definition (1/3)

Shader Programs. Lecture 30 Subsections 2.8.2, Robb T. Koether. Hampden-Sydney College. Wed, Nov 16, 2011

Homework #2 and #3 Due Friday, October 12 th and Friday, October 19 th

Real-Time Graphics Architecture

From system point of view, a graphics application handles the user input, changes the internal state, called the virtual world by modeling or

SHADER PROGRAMMING. Based on Jian Huang s lecture on Shader Programming

Screen Space Ambient Occlusion TSBK03: Advanced Game Programming

CSE 167: Introduction to Computer Graphics Lecture #5: Rasterization. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2015

Shader Programming. Daniel Wesslén, Stefan Seipel, Examples

GPU Programming EE Midterm Examination

GEOMETRIC OBJECTS AND TRANSFORMATIONS I

Bump Mapping. Mike Bailey. What is Bump-Mapping?

Technical Game Development II. Reference: Rost, OpenGL Shading Language, 2nd Ed., AW, 2006 The Orange Book Also take CS 4731 Computer Graphics

CS230 : Computer Graphics Lecture 4. Tamar Shinar Computer Science & Engineering UC Riverside

TSBK03 Screen-Space Ambient Occlusion

Advanced Real- Time Cel Shading Techniques in OpenGL Adam Hutchins Sean Kim

COMP 4801 Final Year Project. Ray Tracing for Computer Graphics. Final Project Report FYP Runjing Liu. Advised by. Dr. L.Y.

Project 1, 467. (Note: This is not a graphics class. It is ok if your rendering has some flaws, like those gaps in the teapot image above ;-)

CSE 167: Introduction to Computer Graphics Lecture #7: Lights. Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2015

UNIT 2 GRAPHIC PRIMITIVES

Today. Texture mapping in OpenGL. Texture mapping. Basic shaders for texturing. Today. Computergrafik

Zeyang Li Carnegie Mellon University

CS770/870 Spring 2017 Open GL Shader Language GLSL

CS770/870 Spring 2017 Open GL Shader Language GLSL

Unit 3 Transformations and Clipping

CMSC427 Advanced shading getting global illumination by local methods. Credit: slides Prof. Zwicker

The Graphics Pipeline

Lab 9 - Metal and Glass

CMSC427: Computer Graphics Lecture Notes Last update: November 21, 2014

Transcription:

Proceedings of IDETC/CIE 2006 ASME 2006 International Design Engineering Technical Conferences & Computers and Information in Engineering Conference September 10-13, 2006, Philadelphia, Pennsylvania, USA DETC2006-99477 Accelerating the Hyperbolic Display of Complex 2D Scenes Using the GPU Mike Bailey Oregon State University Nick Gebbie University of California San Diego Abstract Hyperbolic geometry is a useful visualization technique for displaying a large quantity of two dimensional data simultaneously. What distinguishes this technique is that one particular area can be displayed in full detail with all other areas displayed in lesser detail. In this way, the entire scene is still on the screen so that the entire set of relationships, as well as emergency indicators, can always be seen. But, because the hyperbolic transformation equation is non-linear, it cannot be placed in the standard graphics hardware 4x4 homogeneous matrix. Thus, using the hyperbolic transformation prevents full use of the graphics pipeline hardware, and drastically reduces interactive speed. This paper discusses a way to recoup this display performance by encoding the hyperbolic transform into an OpenGL vertex shader that resides on the graphics GPU hardware. In this way, the hyperbolic transform can still be used interactively, even for very complex 2D scenes. 1 Introduction There are many applications in which a user wants to display a complex 2D scene. Such applications include mechanical drawings, maps, network diagrams, etc. But, such display applications face a tradeoff in display interaction. It is nice to be able to view the whole scene at once. This allows all spatial relationships to be shown in context. But, at that scale, no detail can be seen. Zooming in is also nice. It provides the detail, but loses the overall context. It would be nice to find a way to do both. A good solution is to use hyperbolic display techniques [Munzner1995, Walter2003]. A hyperbola is bounded by asymptotes, that is, no matter how far out one goes, the hyperbola approaches the asymptotes but never reaches them. In hyperbolic display techniques, we look for a transformation that will always keep the scene bounded, regardless of how large it gets. But, the transformation that accomplishes this is nonlinear, and thus cannot by used with the standard fast computer graphics hardware display methods. This makes large, intricate hyperbolic scenes slow to display and sluggish to interact with. 2 Polar Hyperbolic Displays The fundamental principle of using hyperbolic geometry in 2D information visualization displays is to transform all scene geometry, regardless of actual size, into the range [-1.,+1.]. There are several ways to do this, but we have had the best visualization experience with doing it in polar coordinates as described here. The original 2D coordinates are translated so that the region of interest is at the origin. They are then converted to polar coordinates: R = sqrt(x 2 +Y 2 ) (1) Θ = atan2( Y, X ) (2) 1

This angle is left unchanged, but the radius is modified so that it never becomes larger than 1. R = R / ( R+K) (3) K is a constant that determines how focused one is on the center of the scene, at the expense of the rest of the scene. Clearly a small K value forces most of the scene to the circumference where R=1. Similarly, a large value of K forces most of the scene to the center where R=0. Having transformed R into R, the angle is re-incorporated: X = R cos Θ (4) Y = R sin Θ (5) This can be further simplified by noting that since: cos Θ = X / R (6) sin Θ = Y / R (7) then X and Y can be simplified to: X = X / ( R+K) (8) Y = Y / (R+K) (9) The following figures show how this appears visually. Figure 1 below shows a map of the major streets of San Diego, California. There are over 120,000 polylines in the scene, comprising over 320,000 individual line segments. This is a nice overall view, but it is difficult to see street detail in the dense portions of the map. In the following figures, we will zoom in on the downtown area of San Diego, centering on Balboa Park. Figure 2 shows a Euclidean geometry zoom. It reveals more detail, but at the expense of the overall context of the display. In the most-zoomed-in view (Figure 2c), the viewer has completely lost the sense of where they are in the overall map. Figure 3 shows a polar hyperbolic zoom. It progressively zooms into the region of interest by decreasing the value of the constant K. Note that there is a continual sense of where we are in the overall map. 2

Figure 1: 320,000 Line Segment Scene of San Diego Streets Figure 2a-c: Progressive Euclidean Zooming 3

Figure 3a-d: Progressive Hyperbolic Zooming, using K values of 20., 5., 2., and 1. 3 Why It Matters Where the Hyperbolic Transform is Implemented Application Host Computer Transform, Projection, and Lighting Fast Graphics Line and Polygon Rasterize Figure 4: Standard Graphics Care Usage with Linear Transformations To the Monitor 4

Today s under-$200 graphics cards are capable of producing dynamic displays that, 10 years ago, were the sole domain of million dollar flight simulators. This by itself creates many opportunities for engineering graphics because we can display large datasets in a very realistic and interactive way. These graphics cards, displaying to a standard monitor or projector, operate as shown in Figure 4. The application generates graphics commands and sends them to the card. The speed of the card comes from implementing the standard 3D graphics functions of transformation, projection, texturing, lighting, and rasterization in hardware. For nonlinear transformations, such as the hyperbolic transform, life is different. Because this transform is nonlinear, it cannot use the graphics pipeline s matrix hardware. Also, because it must come after the hardware transform, the hardware transform must be pushed back onto the CPU also, as shown in Figure 5: Application Transform Hyperbolic Transform Projection, and Lighting Line and Polygon Rasterize To the Monitor Host Computer Fast Graphics Figure 5: Standard Graphics Card Usage with Nonlinear Transformations This cripples the display speed. To solve this, we turned to OpenGL vertex and fragment shaders. These shaders allow developers to place their own code in the graphics hardware in place of the vertex processing and fragment processing. We have programmed the dome projection as an OpenGL vertex shader. As shown here, this allows the entire process to return to fast graphics hardware as shown in Figure 6: Application Host Computer Transform Hyperbolic Transform Projection, and Lighting Fast Graphics Line and Polygon Rasterize Figure 6: GPU programmable Graphics Card Usage with Nonlinear Transformations To the Monitor This allows us to have the best of all worlds: (1) large, information-rich datasets; (2) running at interactive speeds; on (3) inexpensive, common, easy-to-develop commodity graphics platforms. 4 Coding it in GLSL Here s how to code this in an OpenGL vertex shader using the OpenGL Shading Language (GLSL) [Rost2006]. The constant K is passed in as an OpenGL uniform variable. The first step is to apply the model-view matrix transformation to the original (x,y) point. This takes into account any translation, rotation, or scaling transformations that the viewer had wanted. After that, the polar hyperbolic transformation is performed. Finally, the projection matrix transformation is applied and the final point passed on to the rest of the pipeline. The code to do this is shown below: void main( void ) { vec4 pos = gl_modelviewmatrix * gl_vertex; float r = length( pos.xyz ); pos.xyz /= (r+k); gl_position = gl_projectionmatrix * pos; } 5

gl_modelviewmatrix and gl_projectionmatrix are pre-defined GLSL variables. gl_vertex is the original coordinate passed by the program, typically with a glvertex*() call. gl_position holds the transformed coordinates that are sent downstream to the rest of the hardware. length() is a built-in GLSL function that computes the square root of the sum of the squares of the coordinate components of a point. Note the use of the.xyz construct. Because graphics engines are constructed as SIMD machines, the shader languages are at their fastest when the code takes advantage of that kind of parallelism. 5 Cartesian Hyperbolic Displays The polar form of the hyperbolic transform is visually appealing. Because the polar angle, Θ, remains the same within the transformation, angular relationships are maintained. It is also possible, however, to create a hyperbolic display in Cartesian form, like this: X = X / sqrt(x 2 +K 2 ) (10) Y = Y / sqrt(y 2 +K 2 ) (11) The nature of these equations guarantee that X and Y will never leave the region [-1.,1.]. They give results shown here in Figure 7. Notice that, unlike the polar case, the X and Y dimensions can be translated independently, and angular relationships are not maintained. 6

Figure 7a-d: Cartesian Hyperbolic Display with K = 20., 5., 2., and 1. 6 Other Applications We have also used this technique in terrain-mapping applications. Figure 8 shows how the boot of Italy is centered in the window and then the value of K is reduced. The result is a zoom into the boot, but unlike a linear scaling operation, the rest of the scene does not leave the window, it is merely shoved to the outside: 7

Figure 8a-c: Hyperbolic Zoom into Mediterranean Image 7 Performance Even though this is a nonlinear transform, the interactive speed is remarkable. But, using the hyperbolic vertex shader does indeed incur a speed penalty over using the fixed-function pipeline to perform Euclidean panning and zooming. For applications that are vertex-bound, the bottleneck is in the vertex processor. In these cases (such as the San Diego map zoom), we have found the performance penalty to be around 10%. For applications that are pixel-bound, the bottleneck is elsewhere and the slight slowing of the vertex processing makes no overall difference in update speed. 8 Conclusions Hyperbolic geometry is a very useful visualization technique for panning and zooming large complex 2D scenes, while retaining the overall context. Its nonlinear transformation, however, has always forced it to be implemented in the CPU. Worse yet, it has forced the scene transformations to be removed from the GPU and placed in the CPU as well. With GPU programming, we can return both the scene transformation and the nonlinear hyperbolic transformation back to the GPU, resulting in little or no speed penalty. 9 References MUNZNER1995 Tamara Munzner and Paul Burchard, Visualizing the Structure of the World Wide Web in 3D Hyperbolic Space, Proceedings of VRML '95 (San Diego, California, December 14-15, 1995), special issue of Computer Graphics, pp 33-38, ACM SIGGRAPH. ROST2006 Randi Rost, The OpenGL Shading Language, Addison-Wesley, 2006. WALTER2003 Jörg Walter, Jörg Ontrup, Daniel Wessling, and Helge Ritter, Interactive visualization and navigation in large data collections using the hyperbolic space, IEEE International Conference on Data Mining, ICDM'03, pages 355-362, Melbourne, Florida, USA, November 2003. 8