KEMBAR78
Fundamentals of Algorithms in computer G | PPT
Computer Graphics Algorithms
Overview of 3D Computer Graphics
Outline
●
A brief history of computer graphics
●
Computer graphics applications
●
Difficulties of developing computer graphics
●
Major conferences, journals
Computer Graphics: A Brief History
●
1960s:
– 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
• 1970s
– 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
• 1980s:
– 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
• 1990s
– 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,
etc.
Major applications
●
Entertainment
●
Training and simulation
●
Computer Aided Design (CAD), Computer
Aided Engineering (CAE), and Computer
Aided Manufacturing (CAM)
●
Medical applications
●
Scientific visualization
●
CG art
Medical Visualization
• Human body modeling
• 3D medical image
visualization
– Volume rendering
• Virtual surgery simulation
• Computer Assisted surgery
• Virtual Reality for patient care
– E.g. Immersive Virtual Reality
for pain control
Volume Rendering
Images courtesy GE
Modeling human head
Images courtesy Stanford University
Scientific Visualization
• Visualizing and analyzing
engineering & scientific data
– Bioinformatic visualization
• Molecular Modeling
– Fluid Dynamics simulation
and analysis
– 3D structure electromagnetic
field simulator
– E.g. visualization for Data Mining
• Collaborative visualization
• CAVE: immersive virtual
environment
Collaborative Visualization
Images courtesy SGI
2003 Hurricane Season Forecast
Images courtesy NASA
Computer Aided Engineering (CAE)
• Computer assisted
engineering analysis
Finite Element Analysis
Images courtesy SGI
Computer Aided Design (CAD) &
Manufacture (CAM)
• Widespread use of CAD
and CAM in manufacture
industry
– E.g. Automobile design and
manufacture
• Geometric Modeling
• Product design and
analysis
Computer Aided Manufacturing
Images courtesy SGI
Computer Aided Design
Images courtesy SGI
Visual Simulation
• Simulate real world
experience using graphics
software and hardware
• Used for civil or military
training, mission
planning, etc.
– E.g. flight, ground, space,
maritime simulation
Flight Simulation
Images courtesy Link Simulation & Training
Marine Simulation
Images courtesy SGI
Architectural Visualization &
Simulation
• Urban simulation for
city planning
• Real estate preview
Urban Simulation
Images courtesy MultiGen-Paradigm
Real Estate Preview
Images courtesy SGI
Art
• Computer Graphics
Art
• Art preservation
– Digital Michelangelo
Project
Michelangelo’s David
Images courtesy Stanford University
Computer Graphics Art
Images courtesy Dan Raabe, Toolbox Films
Entertainment
●
www.spore.com
●
http://www.killerbeanforever.com/
– http://www.metacafe.com/watch/907849/killer_bean
_forever_official_trailer/
Why is 3D computer graphics popular?
●
Graphics related industry is huge and growing
●
Graphics hardware is advancing rapidly
– Creating CG content no longer requires expensive
hardware
– Most of the development is done on PC now
●
CG software packages (Maya, 3DS Max, DirectX,
OpenGL) has matured
– Open source tools like Blender have also matured
●
Both graphics hardware and software are
relatively cheap now
Web sites for CG information
●
Major companies’ web sites (nVidia, AMD,
Alias, Discreet, etc.)
●
www.siggraph.org
●
News:
– www.extremetech.com
– www.cgw.com
– www.gdmag.com
– www.gamasutra.com
Notable companies
●
Hardware
– NVIDIA (GeForce card, Cg)
– ATI (Radeon card), acquired by AMD
– 3Dlabs (OpenGL, OpenGL Shading Language)
– Intel (integrated graphics chipset)
●
Software
– Microsoft (DirectX, games)
– AutoDesk (3D Studio Max, AutoCAD, Maya)
– SoftImage (SoftImage)
Notable companies
●
Animation film studio
– Pixar, DreamWorks, etc.
●
Visual special effects
– Industrial Light & Magic, Rhythm and Hues, etc.
– http://en.wikipedia.org/wiki/Visual_effects#Notabl
e_visual_effects_companies
Notable companies
●
Game
– Electronic Arts
– Sony
– Microsoft
●
Other
– Adobe
– Apple
●
For a more comprehensive list, visit SIGGRAPH
2008 exhibitor directory at
http://www.siggraph.org/s2008/attendees/exhibition
/
How to develop 3D graphics
applications
●
Write programs
●
Use modeling and animation tools
●
Use either one or both
Graphics APIs
●
OpenGL
●
DirectX
●
Tools
– http://www.gremedy.com/ (gDebugger, a
OpenGL debugging tool)
Shading languages and tools
●
Shading language
– OpenGL Shading Language
– High Level Shading Language in DirectX
– Cg
●
Tools
– RenderMonkey
– CgFX viewer
Modeling and animation tools
●
Maya and 3DS Max
– Maya Personal Learning Edition (PLE)
– http://usa.autodesk.com/adsk/servlet/index
?siteID=123112&id=7639525
●
Softimage
●
Lightwave3D
●
and many many more …
Blender
●
Blender (www.blender3d.com)
– A free 3D modeling, animation, and rendering tool
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
– VRML & X3D
– Open Inventor
– Renderman
– Java3D
High Level Graphics APIs
●
Real-time oriented APIs
●
3D graphics and game engines
– Unity3D
– Unreal Development Kit
– 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
– Unreal Development Kit
– Unity3D
– Torque Game Engine
– OGRE (open source)
●
For a comprehensive list, check out
http://www.devmaster.net/engines/
Unity3D
●
A multiplatform game development tool
●
A GUI for game development
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
JOGL
●
Java OpenGL (JOGL)
– https://jogl.dev.java.net/
– A wrapper library that allows OpenGL to be used
in the Java programming language
OpenGL 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/perfor
mer/
●
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_Direc
t3D_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
– 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
– 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
– 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
●
We will use GLUT in this class
– Binary files: http://www.xmission.com/~nate/glut.html
– Reference manual:
http://www.opengl.org/resources/libraries/glut/spec3/spec
3.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?
– 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
OpenGL Files
●
OpenGL files comes with MS Windows and/or
Visual Studio installation
●
Header files
– gl.h, glu.h
– Glut.h (needs to be downloaded)
●
Static libraries
– Opengl32.lib, glu32.lib
– glut32.lib (needs to be downloaded)
●
DLLs
– C:windowssystem32
– Opengl32.dll, glu32.dll
– glut32.dll (needs to be downloaded)
How to compile OpenGL/GLUT
programs?
●
http://www.cs.uiowa.edu/~cwyman/classes/
fall04-22C151/howto/winGLUT.html
●
http://www.cs.unm.edu/~angel/BOOK/
INTERACTIVE_COMPUTER_GRAPHICS/
FOURTH_EDITION/vc
Sample OpenGL programs
●
Examples from “OpenGL Programming
Guide”
– http://www.opengl.org/resources/code/samples/
redbook/
●
OpenGL code samples:
http://www.opengl.org/code/
– Simple code samples:
http://www.opengl.org/resources/code/samples/s
imple/
A Simple OpenGL Program (1)
#include <GL/glut.h>
void display(void)
{
/* clear all pixels */
glClear (GL_COLOR_BUFFER_BIT);
/* draw white polygon (rectangle) with corners at
* (0.25, 0.25, 0.0) and (0.75, 0.75, 0.0)
*/
glColor3f (1.0, 1.0, 1.0);
glBegin(GL_POLYGON);
glVertex3f (0.25, 0.25, 0.0);
glVertex3f (0.75, 0.25, 0.0);
glVertex3f (0.75, 0.75, 0.0);
glVertex3f (0.25, 0.75, 0.0);
glEnd();
A Simple OpenGL Program (2)
/* start processing buffered OpenGL routines */
glFlush ();
}
void init (void) {
/* select clearing color */
glClearColor (0.0, 0.0, 0.0, 0.0);
/* initialize viewing values */
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0);
}
A Simple OpenGL Program (3)
/* Declare initial window size, position, and display mode (single
buffer and RGBA). Open window with "hello" in its title bar. Call
initialization routines. Register callback function to display graphics.
Enter main loop and process events. */
int main(int argc, char** argv)
{
glutInit(&argc, argv);
glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
glutInitWindowSize (250, 250);
glutInitWindowPosition (100, 100);
glutCreateWindow ("hello");
init ();
glutDisplayFunc(display);
glutMainLoop();
return 0; /* ANSI C requires main to return int. */
}
How to learn OpenGL?
●
Read OpenGL Programming Guide
●
Read sample programs!
– There are tons of OpenGL programs online:
http://www.opengl.org/code
●
Read tutorials
●
Write programs
How to learn OpenGL?
●
Bookmark the OpenGL manual pages
– http://www.opengl.org/sdk/docs/man/
– You need this more than anything else
●
Bookmark the GLUT manual page
– http://www.opengl.org/resources/libraries/glut/
spec3/spec3.html
●
If you are really serious about learning
OpenGL, read OpenGL specification
– http://www.khronos.org/opengl/
Other OpenGL Resources
●
OpenGL tutor
– http://www.xmission.com/~nate/tutors.html
– Tutorial programs that demonstrate basic
OpenGL functionality by allowing the user to
modify the parameters of a function and see the
effect on the scene
●
OpenGL FAQ & Troubleshooting Guide
– http://www.opengl.org/resources/faq/technical/
●
A good OpenGL tutorial
– http://nehe.gamedev.net/

Fundamentals of Algorithms in computer G

  • 1.
  • 2.
    Outline ● A brief historyof computer graphics ● Computer graphics applications ● Difficulties of developing computer graphics ● Major conferences, journals
  • 3.
    Computer Graphics: ABrief History ● 1960s: – 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
  • 4.
    Computer Graphics: ABrief History • 1970s – 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
  • 5.
    Computer Graphics: ABrief History • 1980s: – 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
  • 6.
    Computer Graphics: ABrief History • 1990s – 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
  • 7.
    Computer Graphics: ABrief 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, etc.
  • 8.
    Major applications ● Entertainment ● Training andsimulation ● Computer Aided Design (CAD), Computer Aided Engineering (CAE), and Computer Aided Manufacturing (CAM) ● Medical applications ● Scientific visualization ● CG art
  • 9.
    Medical Visualization • Humanbody modeling • 3D medical image visualization – Volume rendering • Virtual surgery simulation • Computer Assisted surgery • Virtual Reality for patient care – E.g. Immersive Virtual Reality for pain control Volume Rendering Images courtesy GE Modeling human head Images courtesy Stanford University
  • 10.
    Scientific Visualization • Visualizingand analyzing engineering & scientific data – Bioinformatic visualization • Molecular Modeling – Fluid Dynamics simulation and analysis – 3D structure electromagnetic field simulator – E.g. visualization for Data Mining • Collaborative visualization • CAVE: immersive virtual environment Collaborative Visualization Images courtesy SGI 2003 Hurricane Season Forecast Images courtesy NASA
  • 11.
    Computer Aided Engineering(CAE) • Computer assisted engineering analysis Finite Element Analysis Images courtesy SGI
  • 12.
    Computer Aided Design(CAD) & Manufacture (CAM) • Widespread use of CAD and CAM in manufacture industry – E.g. Automobile design and manufacture • Geometric Modeling • Product design and analysis Computer Aided Manufacturing Images courtesy SGI Computer Aided Design Images courtesy SGI
  • 13.
    Visual Simulation • Simulatereal world experience using graphics software and hardware • Used for civil or military training, mission planning, etc. – E.g. flight, ground, space, maritime simulation Flight Simulation Images courtesy Link Simulation & Training Marine Simulation Images courtesy SGI
  • 14.
    Architectural Visualization & Simulation •Urban simulation for city planning • Real estate preview Urban Simulation Images courtesy MultiGen-Paradigm Real Estate Preview Images courtesy SGI
  • 15.
    Art • Computer Graphics Art •Art preservation – Digital Michelangelo Project Michelangelo’s David Images courtesy Stanford University Computer Graphics Art Images courtesy Dan Raabe, Toolbox Films
  • 16.
  • 17.
    Why is 3Dcomputer graphics popular? ● Graphics related industry is huge and growing ● Graphics hardware is advancing rapidly – Creating CG content no longer requires expensive hardware – Most of the development is done on PC now ● CG software packages (Maya, 3DS Max, DirectX, OpenGL) has matured – Open source tools like Blender have also matured ● Both graphics hardware and software are relatively cheap now
  • 18.
    Web sites forCG information ● Major companies’ web sites (nVidia, AMD, Alias, Discreet, etc.) ● www.siggraph.org ● News: – www.extremetech.com – www.cgw.com – www.gdmag.com – www.gamasutra.com
  • 19.
    Notable companies ● Hardware – NVIDIA(GeForce card, Cg) – ATI (Radeon card), acquired by AMD – 3Dlabs (OpenGL, OpenGL Shading Language) – Intel (integrated graphics chipset) ● Software – Microsoft (DirectX, games) – AutoDesk (3D Studio Max, AutoCAD, Maya) – SoftImage (SoftImage)
  • 20.
    Notable companies ● Animation filmstudio – Pixar, DreamWorks, etc. ● Visual special effects – Industrial Light & Magic, Rhythm and Hues, etc. – http://en.wikipedia.org/wiki/Visual_effects#Notabl e_visual_effects_companies
  • 21.
    Notable companies ● Game – ElectronicArts – Sony – Microsoft ● Other – Adobe – Apple ● For a more comprehensive list, visit SIGGRAPH 2008 exhibitor directory at http://www.siggraph.org/s2008/attendees/exhibition /
  • 22.
    How to develop3D graphics applications ● Write programs ● Use modeling and animation tools ● Use either one or both
  • 23.
  • 24.
    Shading languages andtools ● Shading language – OpenGL Shading Language – High Level Shading Language in DirectX – Cg ● Tools – RenderMonkey – CgFX viewer
  • 25.
    Modeling and animationtools ● Maya and 3DS Max – Maya Personal Learning Edition (PLE) – http://usa.autodesk.com/adsk/servlet/index ?siteID=123112&id=7639525 ● Softimage ● Lightwave3D ● and many many more …
  • 26.
    Blender ● Blender (www.blender3d.com) – Afree 3D modeling, animation, and rendering tool
  • 27.
    Creating 3D GraphicsContent ● 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
  • 28.
    Graphics Libraries (APIs) ● 3Dgraphics 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
  • 29.
    Graphics Libraries (APIs) ● Highlevel 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
  • 30.
    High Level GraphicsAPIs ● Also known as Scene Graph APIs ● Non-real-time oriented APIs – VRML & X3D – Open Inventor – Renderman – Java3D
  • 31.
    High Level GraphicsAPIs ● Real-time oriented APIs ● 3D graphics and game engines – Unity3D – Unreal Development Kit – Torque Game Engine – OGRE – OpenGL Performer – Open Scene Graph – OpenSG ● Many proprietary high level APIs
  • 32.
    Game Engines ● Game engine –Graphics API designed specifically for game development – Contains all non-content related functions/elements
  • 33.
    Game Engine ● Game Architecture Gameplay Gameengine Tools & Editor Graphics Hardware
  • 34.
    Modern Game EngineFeatures ● Scene management – Culling, – Rendering ● Bump mapping ● Shadow – Collision – Decals – AI ● Particle systems, etc. ● Shader management
  • 35.
    Game Engines ● There arehundreds of game engines ● Most popular game engines – Unreal Development Kit – Unity3D – Torque Game Engine – OGRE (open source) ● For a comprehensive list, check out http://www.devmaster.net/engines/
  • 36.
    Unity3D ● A multiplatform gamedevelopment tool ● A GUI for game development
  • 37.
    Torque Game Engine ● Avery 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/
  • 38.
    OGRE ● Object-oriented Graphics RenderingEngine ● 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/
  • 39.
  • 40.
  • 41.
    JOGL ● Java OpenGL (JOGL) –https://jogl.dev.java.net/ – A wrapper library that allows OpenGL to be used in the Java programming language
  • 42.
    OpenGL Performer ● A graphicsAPI 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/perfor mer/ ● Performer has great influence on other real-time graphics APIs – E.g. Open Scene Graph ( http://www.openscenegraph.org/projects/osg)
  • 43.
    Why so manyscene 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
  • 44.
    Why so manyscene 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
  • 45.
    Low Level GraphicsAPIs ● 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_Direc t3D_and_OpenGL
  • 46.
    Direct3D ● Part of Microsoft’sDirectX 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
  • 47.
    Using Direct3D ● Benefits – Supportedby 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
  • 48.
    OpenGL ● Platform independent graphicsAPI – 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/
  • 49.
    Using OpenGL ● Benefits – Openstandard – 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/
  • 50.
    OpenGL Extension ● OpenGL extensionsprovide 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();
  • 51.
    OpenGL Extension ● To findout what OpenGL extensions your graphics card supports, download and install Glview utility (OpenGL extension viewer) – http://www.realtech-vr.com/glview/
  • 52.
    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
  • 53.
    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 ● We will use GLUT in this class – Binary files: http://www.xmission.com/~nate/glut.html – Reference manual: http://www.opengl.org/resources/libraries/glut/spec3/spec 3.html
  • 54.
    GPU and Shader ● GraphicsProcessing 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
  • 55.
    Shader Programming ● Why useshaders? – 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
  • 56.
    OpenGL Files ● OpenGL filescomes with MS Windows and/or Visual Studio installation ● Header files – gl.h, glu.h – Glut.h (needs to be downloaded) ● Static libraries – Opengl32.lib, glu32.lib – glut32.lib (needs to be downloaded) ● DLLs – C:windowssystem32 – Opengl32.dll, glu32.dll – glut32.dll (needs to be downloaded)
  • 57.
    How to compileOpenGL/GLUT programs? ● http://www.cs.uiowa.edu/~cwyman/classes/ fall04-22C151/howto/winGLUT.html ● http://www.cs.unm.edu/~angel/BOOK/ INTERACTIVE_COMPUTER_GRAPHICS/ FOURTH_EDITION/vc
  • 58.
    Sample OpenGL programs ● Examplesfrom “OpenGL Programming Guide” – http://www.opengl.org/resources/code/samples/ redbook/ ● OpenGL code samples: http://www.opengl.org/code/ – Simple code samples: http://www.opengl.org/resources/code/samples/s imple/
  • 59.
    A Simple OpenGLProgram (1) #include <GL/glut.h> void display(void) { /* clear all pixels */ glClear (GL_COLOR_BUFFER_BIT); /* draw white polygon (rectangle) with corners at * (0.25, 0.25, 0.0) and (0.75, 0.75, 0.0) */ glColor3f (1.0, 1.0, 1.0); glBegin(GL_POLYGON); glVertex3f (0.25, 0.25, 0.0); glVertex3f (0.75, 0.25, 0.0); glVertex3f (0.75, 0.75, 0.0); glVertex3f (0.25, 0.75, 0.0); glEnd();
  • 60.
    A Simple OpenGLProgram (2) /* start processing buffered OpenGL routines */ glFlush (); } void init (void) { /* select clearing color */ glClearColor (0.0, 0.0, 0.0, 0.0); /* initialize viewing values */ glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0.0, 1.0, 0.0, 1.0, -1.0, 1.0); }
  • 61.
    A Simple OpenGLProgram (3) /* Declare initial window size, position, and display mode (single buffer and RGBA). Open window with "hello" in its title bar. Call initialization routines. Register callback function to display graphics. Enter main loop and process events. */ int main(int argc, char** argv) { glutInit(&argc, argv); glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB); glutInitWindowSize (250, 250); glutInitWindowPosition (100, 100); glutCreateWindow ("hello"); init (); glutDisplayFunc(display); glutMainLoop(); return 0; /* ANSI C requires main to return int. */ }
  • 62.
    How to learnOpenGL? ● Read OpenGL Programming Guide ● Read sample programs! – There are tons of OpenGL programs online: http://www.opengl.org/code ● Read tutorials ● Write programs
  • 63.
    How to learnOpenGL? ● Bookmark the OpenGL manual pages – http://www.opengl.org/sdk/docs/man/ – You need this more than anything else ● Bookmark the GLUT manual page – http://www.opengl.org/resources/libraries/glut/ spec3/spec3.html ● If you are really serious about learning OpenGL, read OpenGL specification – http://www.khronos.org/opengl/
  • 64.
    Other OpenGL Resources ● OpenGLtutor – http://www.xmission.com/~nate/tutors.html – Tutorial programs that demonstrate basic OpenGL functionality by allowing the user to modify the parameters of a function and see the effect on the scene ● OpenGL FAQ & Troubleshooting Guide – http://www.opengl.org/resources/faq/technical/ ● A good OpenGL tutorial – http://nehe.gamedev.net/