CG for Vision Research - PowerPoint PPT Presentation

1 / 29
About This Presentation
Title:

CG for Vision Research

Description:

CG for Vision Research. Lecture 2. Winter Term '05-'06. Quoc Vuong, Franck Caniard, MPI ... The Cornell Box: Which is real and which is synthesized? ... – PowerPoint PPT presentation

Number of Views:55
Avg rating:3.0/5.0
Slides: 30
Provided by: quocv
Category:
Tags: deray | research | vision

less

Transcript and Presenter's Notes

Title: CG for Vision Research


1
CG for Vision Research
  • Lecture 2
  • Winter Term 05-06
  • Quoc Vuong, Franck Caniard, MPI

2
OpenGL Projections Transformations Graphics
Primitives Textures Lighting Material Properties
Vision Research Viewpoint Effect Structure from X
(Motion, Shading, Stereo) Active
Exploration Navigation
GLUT Window Management Input Devices Event
Loop Timing
Fun/Advanced Modeling Animations Mapping (bumps,
terrains) Physics Simulation Sound (OpenAL)
3
Lighting Materials Properties
4
Lighting ? Realism
www.cs.kuleuven.be/cwis/research/graphics/RENDERPA
RK/
5
more render time
www.winosi.onlinehome.de/Gallery_t14_01.htm
6
The Cornell Box Which is real and which is
synthesized?
Left is real!
www.graphics.cornell.edu/online/box/compare.html
7
Lighting
Illumination/Lighting Model
Shading Model
Global
Local
Flat
Gouraud
Phong
Reflected
Ambient
Directed
Scattered
www.ntsc-uk.com/features/BeautyPixelDeep/GouraudPh
ong.jpg
Directional
Positional
8
Illumination Model
surface normal
Diffuse Reflection
Specular Reflection
Specifies interaction between light ray and
material
9
  • Material properties defined by illumination model
  • Materials have a separate ambient, diffuse and
    specular component

Mathworks 3-D Visualization
10
en.wikipedia.org/wiki/Phong_shading
11
Shading Model
  • Specifies how illumination is applied locally to
    vertices and ultimately pixels
  • Flat Compute the colour for a polygon, and use
    this colour for the entire polygon
  • Gouraud Compute colour at vertices and
    interpolate these colours across the polygon
  • Phong Compute colour by normal interpolation
    during rasterization (Not implement in OpenGL lt
    2.0)

12
Flat
Gouraud
13
Shape-from-Shading
  • Three important components of shading models
  • Position of light source
  • Position of eye
  • Surface normal

14
Demos!
  • Material properties (Lesson26_ball.exe)
  • Shadows (Lesson27_shadows.exe)

15
Culling
  • For rendering efficiency, dont draw polygons
    that are not visible
  • Culling or back-face elimination simple
    operation that compares surface normals of
    polygons to viewpoint and removes polygons that
    cannot be seen

viewing volume
16
Lighting Mat. Prop. in OpenGL
  • Redbook, Chap 4

17
Lighting in 5 Easy Steps
  • Initialize OpenGL for lighting
  • Define Normal vectors at each vertex
  • From model, analytically or by polygon
    approximation
  • Create, select and position one or more light
    sources
  • Create and select a lighting model
  • Global ambient level
  • Location of viewpoint
  • Define material properties of each object
  • Colour (ambient, diffuse and emission)
  • Specularity and shininess

18
Initialization
19
Create Light Source
20
Types of Light Sources
21
Material Properties
22
Template Code 2
23
Basic Structure
24
The Event Loop (GLUT)
25
Event-driven Model
  • Standard approach in graphical-user interfaces
  • Every action of program is response to user
    events
  • Nothing (idle)
  • Press key button
  • Press mouse button or move mouse (or both)
  • Interactivity with user

26
The glutMainLoop
  • void glutMainLoop(void)
  • // pseudo-code
  • loop forever
  • check event queue
  • if (event)
  • // user performed some action (e.g., pressed
    key)
  • invoke appropriate callback function (e.g.,
    keyboard)
  • else
  • // user idle
  • if (idle function exists)
  • invoke idle function (e.g., display scene)
  • else
  • sleep for 1 time unit

27
The Loop Thickens
GLUT Event Loop
28
  • Make stationary light source
  • Make light source move with viewpoint
  • Add at least another light source
  • Combine movelight.c with material.c

29
This slide left intentionally blank
Write a Comment
User Comments (0)
About PowerShow.com