Lecture 10--- Cameras and lights 1Elias Holmlid.  First part  Cameras  Lights ▪ Light types ▪ Light models ▪ How light is computed  Second part 

Slides:



Advertisements
Similar presentations
Illumination Lighting and Shading CSE 470/598 Introduction to Computer Graphics Arizona State University Dianne Hansford.
Advertisements

1 Graphics CSCI 343, Fall 2013 Lecture 18 Lighting and Shading.
Lecture 14 Illumination II – Global Models
3D Graphics Rendering and Terrain Modeling
Lighting and Illumination Lighting is the major problem in computer graphics, for either realism or real-time compositions- harder than modeling Consider.
Light Issues in Computer Graphics Presented by Saleema Amershi.
1. What is Lighting? 2 Example 1. Find the cubic polynomial or that passes through the four points and satisfies 1.As a photon Metal Insulator.
Based on slides created by Edward Angel
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Shading I.
Computer Graphics - Class 10
IMGD 1001: Illumination by Mark Claypool
(conventional Cartesian reference system)
1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.
7M836 Animation & Rendering
Objectives Learn to shade objects so their images appear three- dimensional Learn to shade objects so their images appear three- dimensional Introduce.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Shading Week 5, Wed 1 Oct 2003 recap: lighting shading.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Shading I Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Lighting & Shading.
LIGHTING Part One - Theory based on Chapter 6. Lights in the real world Lights bounce off surfaces and reflect colors, scattering light in many directions.
Shading Surface can either (both) 1.Emit light. E.g. light bult 2.Reflect light. E.g. Mirror.
CS 480/680 Computer Graphics Shading I Dr. Frederick C Harris, Jr.
Fundamentals of Computer Graphics Part 6 Shading prof.ing.Václav Skala, CSc. University of West Bohemia Plzeň, Czech Republic ©2002 Prepared with Angel,E.:
Lecture 5: 3D Rendering Pipeline (II) Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering Georgia Institute of Technology.
Shading (introduction to rendering). Rendering  We know how to specify the geometry but how is the color calculated.
University of Illinois at Chicago Electronic Visualization Laboratory (EVL) CS 426 Intro to 3D Computer Graphics © 2003, 2004, 2005 Jason Leigh Electronic.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
19/17/ :25 UML Graphics: Conceptual Model Real Object Human Eye Display Device Graphics System Synthetic Model Synthetic Camera Real Light Synthetic.
Shading & Texture. Shading Flat Shading The process of assigning colors to pixels. Smooth Shading Gouraud ShadingPhong Shading Shading.
-Global Illumination Techniques
CSC418 Computer Graphics n Illumination n Lights n Lightinging models.
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
CS 445 / 645: Introductory Computer Graphics Light.
CSE 381 – Advanced Game Programming GLSL Lighting.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Shading in OpenGL Ed Angel Professor Emeritus of Computer Science University of New Mexico 1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E.
CS 445 / 645 Introduction to Computer Graphics Lecture 15 Shading Shading.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Lecture Fall 2001 Illumination and Shading in OpenGL Light Sources Empirical Illumination Shading Transforming Normals Tong-Yee Lee.
Specular Reflection Lecture 27 Mon, Nov 10, 2003.
Local Illumination and Shading
Where We Stand So far we know how to: –Transform between spaces –Rasterize –Decide what’s in front Next –Deciding its intensity and color.
Current Student – University of Wisconsin – Stout Applied Mathematics and Computer Science: Software Development Associate Degree in Computer Programming.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Illumination Model How to compute color to represent a scene As in taking a photo in real life: – Camera – Lighting – Object Geometry Material Illumination.
Render methods. Contents Levels of rendering Wireframe Plain shadow Gouraud Phong Comparison Gouraud-Phong.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Graphics Review Geometry, Color & Shading Brad Tennis Leslie Wu
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
Lecture Rendering pipeline, shaders and effects 1Elias Holmlid.
Computer Graphics (fall,2010) School of Computer Science University of Seoul Minho Kim.
3D Graphics Rendering PPT By Ricardo Veguilla.
Unit-7 Lighting and Shading
School of Computer Science
Chapter 14 Shading Models.
Lighting.
CSE 470 Introduction to Computer Graphics Arizona State University
Fundamentals of Computer Graphics Part 6 Shading
ICG 2018 Fall Homework1 Guidance
Chapter IX Lighting.
Illumination and Shading
Game Programming Algorithms and Techniques
Computer Graphics Material Colours and Lighting
Computer Graphics (Fall 2003)
Chapter 14 Shading Models.
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
Computer Graphics Shading in OpenGL
Lighting Calculations
Presentation transcript:

Lecture Cameras and lights 1Elias Holmlid

 First part  Cameras  Lights ▪ Light types ▪ Light models ▪ How light is computed  Second part  We’ll implement an effect for phong shading & cel shading Elias Holmlid2

 Fixed perspective  First person  Third person Elias Holmlid3

 Example: Alone in the Dark (1992) Elias Holmlid4

 Example: Bioshock (2007) Elias Holmlid5

 Example: Tomb Raider something Elias Holmlid6

 Problems with geometry hiding the players  Might be solved with transparency Elias Holmlid7

 Dizziness... Elias Holmlid8

 Different follow behavior + giving the player some camera control Elias Holmlid9

10

 A game might use several different cameras  Use a manager for handling all the cameras Elias Holmlid11

 Directional  Sunlight (on Earth)  Spotlight  Point light (ominidirectional)  Emitting light from one point in all directions  Sunlight (on a deadly distance) Elias Holmlid12

Elias Holmlid13

 Global illumination model Elias Holmlid14

 Local illumination model Elias Holmlid15

 Light may be precomputed and stored  Global illumination models might be used (!) Elias Holmlid16

Elias Holmlid17 Gouraud: Per vertex Phong: Per pixel Color interpolated during rasterization Normal interpolated during rasterization

 Can be accomplished in different ways; one technique is called hard shading Elias Holmlid18

Elias Holmlid19 LightMaterial (object) (Ambient) Diffuse: i d Diffuse: m d Specular: i s Specular: m s SpecularPower: s (Emissive)

 In the real world, light bounces around:  Therefore, all points are hit by light in some way  Ambient light makes up for our non-global illumination model  Ambient component might be just a global color (and not part of each light/object) Elias Holmlid20

 Simulates how light bounces off a rough surface (it scatters in all directions) Elias Holmlid21

Elias Holmlid22  We want to find a scaling factor depending on how a point is hit by the light...

Elias Holmlid23 ...the dot product is ideal for this if clamped to the interval [0..1]. HLSL has a dot() function and [0..1] clamping can be done with s aturate()

 Takes the viewpoint into consideration  Light bounces off in a specific direction and might hit the eye (camera) Elias Holmlid24

 If objects are only rotated and translated, normals can be transformed with the same matix  If the above applies, but the object is also uniformely scaled, normals will have to be renormalized  However, if non-uniform scaling or shearing is applied, normals will no longer be normal to the surface  Then, the inverse-transpose of the transformation matrix does the job:  B = (A 1 ) t  In XNA: B = Matrix.Invert(A); B = Matrix.Transpose(B);  This is done automatically for you if you use BasicEffect! Elias Holmlid25

 BasicEffect supports a maximum of three directional lights  If you want point/spot-lights, more lights, or do stuff like toon-shading you have to implement your own effects Elias Holmlid26

 Stores all the lights  Might contain methods for finding the closest light to a point etc Elias Holmlid27