OpenGL - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

OpenGL

Description:

OpenGL. Matt Anderson. Chris Becker. George Gensure. Justin ... COM ( Windows OOP ) vs. C API. Black Box vs. White Box. Portability. Code size and complexity ... – PowerPoint PPT presentation

Number of Views:132
Avg rating:3.0/5.0
Slides: 17
Provided by: S183
Category:

less

Transcript and Presenter's Notes

Title: OpenGL


1
OpenGL
  • Matt Anderson
  • Chris Becker
  • George Gensure
  • Justin Glaser
  • Brian Jenkins

2
The Basics
  • Brief history
  • Foundation
  • Versions Current 1.4, Next 2.0
  • Company ownership
  • SGI
  • Governance
  • OpenGL ARB
  • OpenGL PCC
  • DirectX vs. OpenGL
  • COM ( Windows OOP ) vs. C API
  • Black Box vs. White Box
  • Portability
  • Code size and complexity

3
Versions
  • 1.1
  • Texture bindings
  • 1.2
  • 3D texturing
  • 1.3
  • Compressed textures
  • Environment mapping
  • Multitexturing
  • 1.4
  • ARB Vertex extension
  • Depth and Shadow texturing
  • 2.0
  • More direct application control of such things as
    texture memory.
  • Inclusion of vertex and pixel shading engines

4
Features
  • Hardware libraries ( card dependent )
  • Software libraries ( card independent )
  • Mesa, Windows OpenGL
  • Extensions
  • wgl, glx, agl, glut, glaux
  • GLU

5
API
  • Matrices
  • The matrix stack
  • glPush, glPop, glRotate, glTranslate, glScale
  • Defining Vertices
  • glBegin, glVertex, glEnd
  • Making Color
  • glColor

6
Coding example
  • glClearColor( 0.0f, 0.0f, 0.0f, 0.0f )
  • glClear( GL_COLOR_BUFFER_BIT )
  • glShadeModel( GL_SMOOTH )
  • glBegin (GL_TRIANGLES)
  • glColor3f (1.0, 0.0, 0.0)
  • glVertex2f (5.0, 5.0)
  • glColor3f (0.0, 1.0, 0.0)
  • glVertex2f (25.0, 5.0)
  • glColor3f (0.0, 0.0, 1.0)
  • glVertex2f (5.0, 25.0)
  • glEnd()
  • glFlush()

7
Coding example 2
  • glClearColor( 0.0f, 0.0f, 0.0f, 0.0f )
  • glClear(GL_COLOR_BUFFER_BIT)
  • glColor3f(1.0, 1.0, 1.0)
  • glLoadIdentity()
  • gluLookAt( 0.0, 0.0, 5.0, // camera position
  • 0.0, 0.0, 0.0, // look at position
  • 0.0, 1.0, 0.0) // up vector
  • glScalef(1.0, 2.0, 1.0)
  • glutWireCube(1.0)
  • glFlush()

8
Textures
  • Loading and storing
  • RGB, RGBA, BGR
  • Mipmapping
  • Texture binding
  • UV coordinates
  • 1D, 2D, 3D
  • Linear vs. Nearest

9
Blending
  • Alpha channel
  • Translucency
  • Anti-aliasing
  • Gateway to multitexturing

10
Lighting
  • Lights
  • Ambient, Diffuse, Specular, Shininess
  • Materials
  • Ambient, Diffuse, Specular, Emissions
  • Light Models
  • Spotlights
  • Local or Infinite
  • Attenuation

11
Fog
  • Depth queuing
  • Linear, Exponential, Exponential2
  • Starting and Ending distance
  • Density
  • Color

12
Face Culling
  • Closed surface rendering
  • Removes polygons that do not face the camera
  • Speeds up rendering
  • glEnable( GL_CULL_FACE )
  • glCullFace with GL_FRONT, GL_BACK or
    GL_FRONT_AND_BACK

13
Stencil Buffer
  • Restricts drawing to certain portions of the
    screen
  • Useful for planar reflections and UI

14
NURBS and Evaluator Meshes
  • Non-Uniform Rational B-Splines
  • Used for modeling smooth and perturbed surfaces

15
Tessellators and Quadrics
  • Tessellators are used for breaking up concave
    polygons into convex primitives through winding
    rules
  • Quadrics are used for creating geometric objects,
    such as spheres, cylinders and disks
  • Both are defined in the GLU

16
Examples
Write a Comment
User Comments (0)
About PowerShow.com