CG Lecture 1, Mon 2016-08-29

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