Sei sulla pagina 1di 3

Memorandum

To: From: Date: Subject: Jamaica Ritcher Ben Hoerber October 2, 2013 Assignment 2

The purpose of this memo is to share with you an extended denition of the term OpenGL. Before the extended denition I have included a hypothetical scenario that explains a plausible context for the denition; a scenario for the description is included as well. Scenario for the extended denition of OpenGL. My extended denition is for anyone with some familiarity of computer programming who is interested in learning about OpenGL. This can range from students to designers to professors to current industry professionals. The problem is that it is dicult to read through documentation to get basic ideas about OpenGL. My solution for this problem will be to introduce the topic and explain OpenGL at its most fundamental level. Extended denition of OpenGL. OpenGL is a graphics Application Programming Interface (API) that is open source and free to use and develop with. An API is a coding specication that programmers use to connect components of their software together with some library of other software components. OpenGL can be used to help program and develop computer applications that use advanced 3D and 2D graphics. The API is currently on Version 4.4 and runs on Windows, Mac OS, and Linux/Unix. Numerous libraries of code extend the functionality of OpenGL and are also well maintained and updated. Shaders are vital to OpenGL functionality and there are two types of shaders, Vertex Shaders and Fragment Shaders. Shaders are short programs written in the OpenGL Shading Language (GLSL) which look similar to C or C++ programs and run on your graphics card. Vertex Shaders are used to dene the positions of points that make up shapes that render as 3D objects. Fragment Shaders are used to mix textures for 3D surfaces with a variety of other lters and colors to create a mix. [2] When working with graphics applications, it is important to be able to transfer data from the Central Processing Unit (CPU/Processor) to the Graphics Processing Unit (GPU/Graphics Card) in order to utilize shaders. For this task we use Vertex Buer Objects (VBOs) and Vertex Array Objects (VAOs) to send data from the main application. VBOs contain a big chunk of memory containing any binary data necessary to complete your graphics task. VAOs help process this data by describing the type of data contained in the VBO and assigning that data to shader variables. [3] Scenario for process denition of OpenGL. My process description is for a software developer trying to incorporate OpenGL into their software project. This person needs to understand the fundamentals of OpenGL and some basic understanding of the concepts involved in computer graphics. By deciding to search on the internet, she/he will nd the process detailed in a computer graphics website. 1

Process description of the term OpenGL OpenGL is a graphics Application Programming Interface (API) that is currently on Version 4.4 and runs on Windows, Mac OS, and Linux/Unix. Versions 3.x and 4.x are designed to be forwards compatible with any new changes and the code should be backwards compatible to version 2.1. It uses two types of shaders, Vertex Shaders and Fragment Shaders. Vertex Shaders are used to dene the positions of points (vertices) that make up shapes that render as 3D objects. Fragment Shaders are used to mix textures for 3D surfaces with a variety of other lters and colors to create a mix. Getting started with OpenGL will require a thorough look at several important introductory concepts. Well look at how 3D objects are depicted on the screen and a brief look at some of the mathematical concepts behind the process. In the process we will gather several important terms and concepts useful for graphics programming. Finally it will be important to show where exactly OpenGL comes in and how to use it correctly. Since screens display only two-dimensional information, graphics programs take a similar approach to paintings in their attempt to depict another dimension. The best any of these programs can do is create an approximation of true 3D as it would be seen from two angles (each eye has one view of an object). Perspective is enough to create the appearance of three dimensions as can be shown in Figure 1. Rendering is the process of transforming mathematical/image data into a 3D perspective image.

Figure 1: OpenGL SuperBible Fifth Edition: Comprehensive Tutorial and Reference. 2011 Rendering and animating objects on the screen requires a lot of specialized programming techniques. A solid understanding of Linear Algebra techniques is highly recommended when working with graphics because algorithms rely on its concepts. A Transformation Matrix is used to move individual vertices around in space by multiplying matrices. The more mathematically complex Projection Matrix is used to give our 3D coordinates two dimensional screen coordinates. Finally we use a process called Rasterization to ll in the lines between the pixels in order to draw our basic wireframe outlines like the one in Figure 1. [1] Its important to keep in mind that OpenGL is a low-level interface to help display models, not a toolbox from which you can command to draw shapes. Drawing an item on the screen requires loading the model, applying transformations, adding textures, implementing shaders, and blending colors together. Its a long process but there are some helpful applications that can make your 2

job a lot easier. By using a modeling software like Blender, 3D Studio Max, Maya, or CAD you can generate models and apply some textures which can be imported into OpenGL. Doing this is standard procedure for many big companies that develop visual 3D solutions, but afterwards there is still plenty of work to do in order to implement functionality. Now with a basic understanding of the key introductory principles of graphics programming in OpenGL you can apply this information to further research, discussion, and implementation on your projects. Some of the mathematical prerequisites and its related terms should give you perspective on the complexity of programming computer graphics. There are a lot of ways to tackle working in 3D on computers and OpenGl is one of the most popular due to its features and basic functionality. Resources: [1] Wright, JR. Richard S. OpenGL SuperBible Fifth Edition: Comprehensive Tutorial and Reference. 2011 [2] Dalling, Tom. Modern OpenGL 01 - Getting Started in Xcode, Visual C++, and Linux. http://tomdalling.com/blog/modern-opengl/01-getting-started-in-xcode-and-visual-cpp/. 2012. [Online: accessed 29-September-2013] [3] Gro, Joe. An intro to modern OpenGL. Chapter 2.2: Shaders. http://duriansoftware.com/joe/Anintro-to-modern-OpenGL.-Chapter-2.2:-Shaders.html. 2010. [Online: accessed 29-September-2013]

Potrebbero piacerti anche