Overview and Introduction to 3D Graphics Programming CSc 8820: Advanced Graphics Algorithms Overview and Introduction to 3D Graphics Programming Lecture 1 and 2 CSC8820: Advanced Graphics Algorithms
Contact information Office 34 Peachtree Street, Suite 1441 Office hour Fridays 2:30 to 4:30pm or by appointment Email: yzhu@cs.gsu.edu When sending email to me, please include “csc8820” in the subject line. CSC8820: Advanced Graphics Algorithms
What this course is about Study selected topics in computer graphics Focus on essential techniques for real-time graphics application Real-time rendering Animation 3D Modeling Game design and development This is not an introductory computer graphics course. We will not cover a little about everything. Instead we’ll cover a lot about a few things. We will focus on real-time graphics techniques. What is real-time? 30 frame per second or 60 frame per second Along the way you’ll learn how to do research in computer graphics. For example, how to search literatures, how to read research papers, how to write papers, how to identify important research topics, how to identify open problems and select a subject. All of this is not limited to computer graphics and also can be applied to research in general. CSC8820: Advanced Graphics Algorithms
What you are expected to get from this course Obtain a general understanding of state of the art in rendering, animation, and modeling. Obtain a general understanding of various advanced algorithms essential to real-time graphics applications such as 3D games. Develop research, writing, and presentation skills. Will also touch on advanced visualization techniques Study one subject of 3D computer graphics research in depth. Hands-on experience with 3D graphics tools or API. You’ll have an idea what are the major research topics in the computer graphics research. What is the cutting edge technology? What is advanced algorithms? More complex, make use of basic graphics algorithms, better quality visual effects. CSC8820: Advanced Graphics Algorithms
Textbook No textbook Lecture notes are the primary source of information I’ll also provide relevant web links
Recommended references Real-time Rendering, 3rd Edition, by Tomas Akenine-Moller, Eric Haines, and Naty Hoffman, A K Peters, Ltd., 2008 http://www.realtimerendering.com
Grading plan No Exam Grade Percentage The grading scale is as follows: Homework and presentations: 50% Team project: 50% The grading scale is as follows: A: 90+ B: 80 - 89 C: 70 - 79 D: 60 – 69 F: < 60
Project Team project Develop a 3D game or interactive training program The purpose of the program is for education or training purposes Use a game engine (e.g. OGRE) or integrated game development tool (e.g. Unity) Keep detailed documents for the development process
Research Project You may also choose to do a research project Write a survey paper Develop a new algorithm Discuss your idea with me
Homework Three homework assignments May involve presentations OpenGL programming GPU and shader Modeling and animation May involve presentations
Tentative topics See http://www.cs.gsu.edu/yzhu/csc8820/home.htm
What is Computer Graphics? The word “Computer Graphics” means different things to different people. 3D computer graphics is about generating a 2D image from the definition and interaction of 3D geometry objects. We will focus on real-time 3D interactive computer graphics I.e. Techniques for 3D games & visual simulation Images courtesy Discreet Lord of the Rings CSC8820: Advanced Graphics Algorithms
Major research areas Modeling Animation Rendering How to create and store geometry objects Animation How to manipulate geometry objects Rendering How to generate and display images of geometry objects
Major conferences ACM SIGGRAPH (www.siggraph.org) ACM SIGGRAPH-Asia The single most important conference. ACM SIGGRAPH-Asia EUROGRAPH (www.eg.org) Graphics Interface Computer Animation & Virtual World Game Developer Conference
Journals and magazines ACM Transaction on Graphics SIGGRAPH papers will be published here. IEEE Transactions on Visualization and Computer Graphics IEEE Computer Graphics & Applications Computer Graphics Forum
Journals and magazines ACM Journal of Graphics Tools Computer & Graphics The Journal of Visualization and Computer Animation The Visual Computer Game Developer Magazine
How to search and find papers? http://www.siggraph.org/publications/bibliography/ A comprehensive database of CG publications Also see http://www.siggraph.org/publications Most of the recent journal papers are online Find them through GSU library web page: E-journal Locator www.library.gsu.edu/ejournals/ SIGGRAPH papers since 1974 are also online Go to http://www.library.gsu.edu/ejournals/ and search for “computer graphics” and then click on “computer graphics proceedings …” IEEE Xplore, ACM digital library, SpringerLink
How to search and find papers? Recent graphics papers: http://kesen.huang.googlepages.com/ Search by paper title on Google. Find one of the authors’ homepage. They often have links to their papers.
Influential research groups UNC Chapel Hill (rendering & animation) http://www.cs.unc.edu Stanford University (modeling & rendering) http://graphics.stanford.edu Microsoft Research (everything) http://www.research.microsoft.com/research/graphics/ CalTech (modeling) http://www.gg.caltech.edu/
Influential research groups MIRALab – U of Geneva (animation) http://miralabwww.unige.ch/ U of Toronto (animation) http://www.dgp.toronto.edu/ SUNY Stony Brook (visualization) http://www.cs.sunysb.edu/~vislab/ UC Davis (visualization) http://graphics.cs.ucdavis.edu/ INRIA - France (everything) http://www.inria.fr/index.en.html
Major companies Hardware Software NVIDIA (GeForce card, Cg) AMD (Radeon card) Intel Software Microsoft (DirectX) AutoDesk (3D Studio Max, AutoCAD, Maya) SoftImage (SoftImage) Renderman (Pixar)
Major companies Movie Game Other Pixar Industrial Light & Magic Weta Electronic Arts Sony Microsoft Other Adobe (2D graphics) SUN (Java3D)
Computer Graphics: A Brief History William Fetter of Boeing coins the term “Computer Graphics” (1960) Basic computer graphics algorithms/concepts are introduced: hidden line detection, homogeneous coordinates, line drawing, back-face culling, parametric curves & surfaces, etc. Spacewars, first video game, is developed at MIT (1961) SketchPad: first interactive computer graphics software (1962) First Head Mounted Display is developed at MIT (1968) Bell Labs builds first frame buffer (3 bits) First use of CGI for commercials – MAGI for IBM (1969) SIGGRAPH is formed (1969) Spacewars Image courtesy MIT Media Lab
Computer Graphics: A Brief History Many fundamental computer graphics algorithms/technologies are introduced: visible surface detection, Gouraud shading, Phone shading, Z-buffer, curved surface rendering, texture mapping, reflectance and environment mapping, anti-aliasing, curved shadow, bump mapping, ray tracing, keyframe based animation, etc. First SIGGRAPH conference (1973) Microsoft is founded (1974); Special effects powerhouse, Industrial Light & Magic, is founded (1975) The first flight simulator for Apple II is released (1978) (later purchased by Microsoft) First flight simulator Image courtesy simflight.com
Computer Graphics: A Brief History Many major companies in the graphics field are founded: Silicon Graphics Inc., ATI, SUN, Pixar, Adobe, AutoDesk, Alias, Softimage, Side Effects, etc. More graphics algorithms are introduced: radiosity, motion capture, motion blur, morphing, etc. The birth of RenderMan (1988) Wavefront – the first commercially available 3D software package (1984) AutoCAD 1.0 (1982) Tron (1982): 1st film to make extensive use of computer graphics Tron
Computer Graphics: A Brief History The release of major 3D graphics libraries: OpenGL, DirectX, Java3D Image based rendering attracts attention The release of major 3D modeling & animation packages: 3D Studio, 3D Studio Max, Maya, etc. The rise and fall of SGI NVIDIA releases first Graphics Processing Unit (1999) Increasing use of 3D special effects in feature films: Terminator 2, Titanic, etc. First 3D computer animated feature film: Toy Story by Pixar The release of Doom and Quake CAVE: immersive virtual environment Titanic
Computer Graphics: A Brief History 2000 – present Powerful Graphics Processing Units on PC graphics card: NVIDIA Geforce3/4/FX/6800/7800/8800, ATI Radeon 9700/9800/X800/X850/X1950 High level shading languages: Cg, HLSL, GLSL, Sh, etc. New generation game console: Xbox/360, Playstation2/3 Widespread use of CGI special effects in feature films: War of the Worlds, Lord of the Rings, Spiderman, Matrix, Finding Nemo, Shrek, The Cars, Avatar, etc.
Creating 3D Graphics Content Different ways to create graphics content If you want to create non-interactive 3D animations Use graphics modeling/animation tools: 3DS Max, Maya, Blender, etc. If you want to create interactive 3D applications (game, training & simulation program) A combination of both modeling/animation tools and programming C/CPP + scene graph + OpenGL/D3D + Shader
Graphics Libraries (APIs) 3D graphics applications are built on top of graphics libraries A collection of graphics routines that an application program can call The APIs hide the underlying complexity of graphics hardware and/or lower level APIs Large scale graphics applications are usually built on top of high level graphics APIs
Graphics Libraries (APIs) High level APIs are implemented on top of low level graphics APIs Low level APIs control graphics hardware through graphics drivers Between low level graphics APIs and graphics drivers there are shader libraries
High Level Graphics APIs Also known as Scene Graph APIs Non-real-time oriented APIs Java3D VRML & X3D Open Inventor Renderman
High Level Graphics APIs Real-time oriented APIs 3D graphics and game engines Torque Game Engine OGRE OpenGL Performer Open Scene Graph OpenSG Many proprietary high level APIs
Game Engines Game engine Graphics API designed specifically for game development Contains all non-content related functions/elements
Game Engine Game Architecture Gameplay Game engine Tools & Editor Graphics Hardware
Modern Game Engine Features Scene management Culling, Rendering Bump mapping Shadow Collision Decals AI Particle systems, etc. Shader management
Game Engines There are hundreds of game engines Most popular game engines Torque Game Engine (commercial) OGRE (open source) For a comprehensive list, check out http://www.devmaster.net/engines/
Torque Game Engine A very popular game engine with multi-player network code, indoor/outdoor rendering engines, skeletal animation, drag and drop GUI creation, a built in world editor, and a C-like scripting language. http://www.garagegames.com/
OGRE Object-oriented Graphics Rendering Engine A scene-oriented, flexible 3D engine written in C++ designed to make it easier and more intuitive for developers to produce games and demos using 3D hardware. http://www.ogre3d.org/
OGRE example
OGRE example
Integrated Game Development Environment Examples Unity 3DVIA Virtools Blender game engine Torque Game Builder (for 2D games) Adobe Director (for 2D graphics and games) Easier for developers to learn Little programming is required You can still do scripting
Java3D High level object-oriented scene graph API https://java3d.dev.java.net/ http://www.j3d.org/ Platform independent, implemented on top of Direct3D or OpenGL Try to meet a wide variety of application requirements Real-time performance Object modeling Input devices support Stereoscopic vision
JOGL Java OpenGL (JOGL) https://jogl.dev.java.net/ A wrapper library that allows OpenGL to be used in the Java programming language
VRML & X3D VRML = Virtual Reality Modeling Language X3D HTML like language for describing 3D shapes and interaction X3D Next generation open standard for 3D on the web Officially replaced VRML in July 2004 X3D supports XML for tight integration with Web technologies and tools http://www.web3d.org/
OpenGL Performer http://www.sgi.com/products/software/performer/ A graphics API developed by SGI for real-time visual simulation and other performance oriented applications Implemented on top of OpenGL, with performance as the first priority http://www.sgi.com/products/software/performer/ Performer has great influence on other real-time graphics APIs E.g. Open Scene Graph (http://www.openscenegraph.org/projects/osg)
Why so many scene graph APIs & game engines? Different target applications Real-time vs. non-real-time applications Application specific optimizations Application specific entities E.g. different game genres require different game engines
Why so many scene graph APIs & game engines? Language and platform considerations Platform specific optimizations Open source vs. proprietary APIs Integration of new technologies Not necessarily a good thing Lack of documents & sample code
Low Level Graphics APIs Directly handles 3D rendering Very efficient implementation Only two major low level 3D graphics APIs OpenGL Direct3D (part of DirectX) Comparison of Direct3D and OpenGL http://en.wikipedia.org/wiki/Comparison_of_Direct3D_and_OpenGL
Direct3D Part of Microsoft’s DirectX libraries Including Direct3D, DirectInput, DirectSound, etc. Designed for real-time graphics applications Computer game Home entertainment Primary choice for game development Latest version is DirectX 10 http://www.microsoft.com/windows/directx/default.aspx Only supported on MS Windows platform
Using Direct3D Benefits Drawbacks Supported by most of the graphics hardware Better game support Better integration with other MS stuff (e.g. .Net) Maintained by one single company Quick to add new features to Direct3D Drawbacks Somewhat more difficult to learn than OpenGL Windows only
OpenGL Platform independent graphics API Window system independent MS Windows, Linux, IRIX, Solaris, Mac, etc. Window system independent MS Windows, X Window Maintained by KHRONOS group (an industry consortium) Members include 3Dlabs, AMD, NVIDIA, Intel, Google, etc. Current specification: OpenGL 3.0 http://www.khronos.org/opengl/
Using OpenGL Benefits Drawbacks http://www.opengl.org/ Open standard Supported by all the graphics cards Supported by all the platforms Lots of books, tutorials, and samples available Most of the mainstream 3D graphics textbooks use OpenGL Drawbacks Historically, OpenGL is often slow to add new features Users are often forced to use OpenGL extensions http://www.opengl.org/
OpenGL Extension OpenGL extensions provide new rendering features above and beyond the features specified in the official OpenGL standard To keep the OpenGL API current with the latest innovations in graphics hardware and rendering algorithms Different kind of extensions: Extensions ratified by the ARB: GL_ARB_multitexture(); Extensions agreed on by multiple vendors: GL_EXT_abgr(); Vendor specific extensions: GL_NV_register_combiners();
OpenGL Extension To find out what OpenGL extensions your graphics card supports, download and install Glview utility (OpenGL extension viewer) http://www.realtech-vr.com/glview/
OpenGL Related APIs GLU (OpenGL Utility Library) Mostly modeling related functions: NURBS, tessellators, etc. Part of OpenGL GLX: connecting OpenGL with X Window WGL: connecting OpenGL with MS Windows
OpenGL Related APIs GLUT (OpenGL Utility Toolkit) implements a simple windowing application programming interface (API) for OpenGL makes it easier to learn OpenGL programming designed for constructing small to medium sized OpenGL programs Binary files: http://www.xmission.com/~nate/glut.html Reference manual: http://www.opengl.org/resources/libraries/glut/spec3/spec3.html
GPU and Shader Graphics Processing Units are the microprocessors on the newer graphics cards Nvidia, AMD, and Intel are the main GPU vendors You can write programs that runs on GPU using a special programming language These programs are called shaders The programming languages are called shading languages
Shader Programming Why use shaders? Faster and more flexible To implement features that are not available on OpenGL or Direct3D Take advantage of GPU, which is is optimized for graphics applications Faster and more flexible High level shading languages Cg, HLSL, OpenGL SL, Sh Load, compile, and run shader programs from OpenGL or DirectX programs