Skip to main content
Discuss Syllabus .
Intro to OpenGL.
It's a platform-neutral competitor to DirectX. See http://en.wikipedia.org/wiki/Comparison_of_OpenGL_and_Direct3D .
The competition improves both.
The designers made a decision to do ''only rendering'', no input, audio, or windowing.
The OpenGL standards committee gradually adds and subtracts features.
The goal is to exploit the latest GPUs while keeping the size manageable.
This makes the ''hello world'' program much longer, but makes complicated graphics more efficient.
OpenGL4 exploits latest GPU features. However many expensive business laptops, such as my Thinkpad x201 cannot run it.
OpenGL4 being lower level opens a niche for a replacement easy-to-use graphics API. I recommend Qt.
Tools like Blender are higher-level, very good for realistic scenes, but too fancy for simple graphics programming. I'll leave them to other classes.
See http://en.wikipedia.org/wiki/Opengl .
WebGL is an API for HTML5.
This course uses JavaScript because web-based graphics is easier with it.
Although JavaScript is less efficient than C++, the serious graphics computing is done on the graphics card.
The OpenGL API for C++ is quite similar to JavaScript's. Instead of the JavaScript framework, you need a C++ toolkit to provide the the higher level functions that OpenGL chose not to provide. This includes creating windows. GLUT is one such toolkit. It is widely used but old. There are other newer ones.
Why is this course different?
Shader-based
Most computer graphics use OpenGL but still use fixed-function pipeline, don't require shaders, do not make use of the full capabilities of the graphics processing unit (GPU)
Web: With HTML5, WebGL runs in the latest browsers. Makes use
of local hardware, No system dependencies.
Some web resources
http://www.cs.unm.edu/~angel/
http://www.cs.unm.edu/~angel/WebGL/7E
http://www.opengl.org
http://get.webgl.org
http://www.kronos.org/webgl
http://www.chromeexperiments.com/webgl
http://learningwebgl.com
Long history of attempts at a good API described in text.
OpenGL, 1992:
platform-independent API that was
Easy to use
Close enough to the hardware to get excellent performance
Focus on rendering
Omitted windowing and input to avoid window system dependencies
OpenGL evolution
Originally controlled by an Architectural Review Board (ARB)
Members included SGI, Microsoft, Nvidia, HP, 3DLabs, IBM,…….
Now Kronos Group
Was relatively stable (through version 2.5)
Backward compatible
Evolution reflected new hardware capabilities
3D texture mapping and texture objects
Vertex and fragment programs
Allows platform specific features through extensions
Modern OpenGL
Performance is achieved by using GPU rather than CPU
Control GPU through programs called shaders
Application’s job is to send data to GPU
GPU does all rendering
Immediate Mode Graphics
Geometry specified by vertices
Locations in space (2 or 3 dimensional)
Points, lines, circles, polygons, curves, surfaces
Immediate mode
Each time a vertex is specified in application, its location is sent to the GPU
Old style uses glVertex
Creates bottleneck between CPU and GPU
Removed from OpenGL 3.1 and OpenGL ES 2.0
Retained Mode Graphics
Put all vertex attribute data in array
Send array to GPU to be rendered immediately
Almost OK but problem is we would have to send array over each time we need another render of it
Better to send array over and store on GPU for multiple renderings
OpenGL 3.1
Totally shader-based
No default shaders
Each application must provide both a vertex and a fragment shader
No immediate mode
Few state variables
Most 2.5 functions deprecated
Backward compatibility not required
Exists a compatibility extension
Other Versions
OpenGL ES
Embedded systems
Version 1.0 simplified OpenGL 2.1
Version 2.0 simplified OpenGL 3.1
Shader based
WebGL
Javascript implementation of ES 2.0
Supported on newer browsers
OpenGL 4.1, 4.2, …..
Add geometry, tessellation, compute shaders
Source of much of this material: slides accompanying the text.
Reading assignment: Angel, chapter 1.
Homework 1 is online; due next Wed.
This Wed Aug 31 will be a lecture and SW session, held in the usual lab room.