ייצוג בעולם 3D ייצוג מצולעים (פוליגונים) צלע קודקוד צלעe0 : {v1,v2}

Slides:



Advertisements
Similar presentations
CSPC 352: Computer Graphics
Advertisements

Virtual Realism LIGHTING AND SHADING. Lighting & Shading Approximate physical reality Ray tracing: Follow light rays through a scene Accurate, but expensive.
Illumination and Shading
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Lighting/Shading III Week.
Computer Graphics - Class 10
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2008 Tamara Munzner Lighting/Shading III Week.
Shading in OpenGL CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
IMGD 1001: Illumination by Mark Claypool
CS 4731: Computer Graphics Lecture 16: Illumination Models Part 2 Emmanuel Agu.
Shading in OpenGL Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
1 CSC 830 Computer Graphics Lecture 5 Shading Course Note Credit: Some of slides are extracted from the course notes of prof. Mathieu Desburn (USC) and.
6.1 Vis_04 Data Visualization Lecture 6 - A Rough Guide to Rendering.
CS5500 Computer Graphics March 26, Shading Reference: Ed Angel’s book.
©Larry F. Hodges (modified by Amos Johnson) 1 Shading Models.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Shading Week 5, Wed 1 Oct 2003 recap: lighting shading.
Illumination and Shading
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Lighting and Shading Week.
Illumination and Shading. Illumination (Lighting) Model the interaction of light with surface points to determine their final color and brightness OpenGL.
1 Graphics CSCI 343, Fall 2013 Lecture 20 Lighting and Shading III.
CS 445 / 645 Introduction to Computer Graphics Lecture 18 Shading Shading.
Shading (introduction to rendering). Rendering  We know how to specify the geometry but how is the color calculated.
COMPUTER GRAPHICS CS 482 – FALL 2014 AUGUST 27, 2014 FIXED-FUNCTION 3D GRAPHICS MESH SPECIFICATION LIGHTING SPECIFICATION REFLECTION SHADING HIERARCHICAL.
Shading in OpenGL.
19/17/ :25 UML Graphics: Conceptual Model Real Object Human Eye Display Device Graphics System Synthetic Model Synthetic Camera Real Light Synthetic.
Shading 03/19/2003. Lighting Principles Lighting based on how objects reflect light –Surface characteristics –Light color and direction –Global lighting.
Shading and Illumination. OpenGL Shading Without ShadingWith Shading.
Computer Graphics I, Fall 2010 Shading in OpenGL.
Lecture 9: Lighting and Shading 1  Principles of Interactive Graphics  CMSCD2012  Dr David England, Room 718,  ex 2271
Lecture 14 Shading models 1.Shading Constant Shading (to be implemented) Gouraud Shading Phong Shading 2.Light and shading with OpenGL 1.
08 |Lighting and Shading Eriq Muhammad Adams J |
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2010 Tamara Munzner Lighting/Shading III Week.
Steve Sterley. Real World Lighting Physical objects tend to interact with light in three ways: Absorption (black body) Reflection (mirror) Transmission.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Basic Rendering Pipeline and Shading Spring 2012.
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 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
RENDERING Introduction to Shading models – Flat and Smooth shading – Adding texture to faces – Adding shadows of objects – Building a camera in a program.
Lecture Fall 2001 Illumination and Shading in OpenGL Light Sources Empirical Illumination Shading Transforming Normals Tong-Yee Lee.
11/5/2002 (c) University of Wisconsin, CS 559 Last Time Local Shading –Diffuse term –Specular term –All together –OpenGL brief overview.
Local Illumination and Shading
Illumination and Shading Prof. Lizhuang Ma Shanghai Jiao Tong University.
Where We Stand So far we know how to: –Transform between spaces –Rasterize –Decide what’s in front Next –Deciding its intensity and color.
Lighting and Shading Part 2. Global Ambient Light There are at least 8 OpenGL lights and 1 Global Ambient Setting the Global Ambient globalAmbient[] =
In the name of God Computer Graphics. Where We Stand So far we know how to: –Transform between spaces –Draw polygons Next –Deciding a pixel’s intensity.
Render methods. Contents Levels of rendering Wireframe Plain shadow Gouraud Phong Comparison Gouraud-Phong.
Illumination and Shading Sang Il Park Sejong University.
Illumination CSE 410. Basic steps of lighting Enable smooth shading Set global ambient light glShadeModel(GL_SMOOTH); glEnable(GL_NORMALIZE); GLfloat.
Illumination and Shading. Illumination (Lighting) Model the interaction of light with surface points to determine their final color and brightness OpenGL.
Illumination Models and Surface-Rendering Methods CEng 477 Introduction to Computer Graphics.
Illumination and Shading. Illumination (Lighting) Model the interaction of light with surface points to determine their final color and brightness OpenGL.
Illumination and Shading Prof. Lizhuang Ma Shanghai Jiao Tong University.
1 Dr. Scott Schaefer Lighting. 2/49 Lighting/Illumination Color is a function of how light reflects from surfaces to the eye Global illumination accounts.
Shading To determine the correct shades of color on the surface of graphical objects.
Illumination and Shading
Unit-7 Lighting and Shading
CSC461: Lecture 23 Shading Computation
Shading in OpenGL Ed Angel
Lighting/Shading III Week 7, Wed Mar 3
Lighting and Shading Lab 8:.
Lighting Phong's Lighting Model normals
Illumination and Shading
Fundamentals of Computer Graphics Part 6 Shading
Lighting – Light Sources
CS5500 Computer Graphics April 10, 2006.
Illumination and Shading
Lighting and Shading Lab 8:.
Last Time Liang-Barsky Details Weiler-Atherton clipping algorithm
Chapter 14 Shading Models.
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
Computer Graphics Shading in OpenGL
Presentation transcript:

ייצוג בעולם 3D ייצוג מצולעים (פוליגונים) צלע קודקוד צלעe0 : {v1,v2} משולש V1 קודקוד T1 e3 e0 T2 צלעe0 : {v1,v2} T0 V0 משולשT2 :{v0,v1,v2} T3 e1 e2

דוגמאות

כך זה נראה בגדול

נוסיף צבע לעולם

ועוד תאורה ...

נעדן את התאורה ..

עכשיו זה נראה בסדר

עם כל השיפורים

Illumination and Shading Reflection Specular Light in How to shade a surface Position (Light/Surface) Orientation (Light/Surface) Characteristics (Light/Surface) Local Illumination Models Individual point and The light source/s Illuminate it Global Illumination Models The light source and The interchange of light between all the surfaces Reflection (diffuse) Internal Reflection Transmitted Light emission

Ambient Light Non reflective Self-luminous Illumination equation I is the resulting intensity Ki is the object’s intrinsic intensity An ambient illumination variable is associated with each point Evaluating the ambient equation <==> Lighting the object. I = k i

Diffuse Reflection Point light source The brightness depends on the angle q between direction to the light L and the surface normal N If the light bean Has cross sectional deferential are dA It intercepts an area dA/cos(q) of the surface. q I = I k cos(q) p d N q N dA dA/cos(q ) S2 S1

Combining Shading Models Series of pictures of sphere illuminated by diffuse reflection model only using different Kd values (0.4, 0.55, 0.7, 0.85,1.0). Series of pictures of sphere illuminated by ambient and diffuse reflection model. Ia = Ib = 1.0, Kd = 0.4 and Ka = {0.0, 0.15, 0.30, 0.45, 0.60}

Light Source Attenuation

Specular Reflection Phone Illumination N L R V   I = Ia Ka + Developed by Phong Bui-Toung for nonperfect reflection. The model assumes that the maximum specular reflection occurs when  is zero and falls off sharply as  increases. The rapid falloff is approximated by cos () . V    n I = Ia Ka + fatt Id [KdOd cos() +W()cos ()] n Od :Object diffuse factor. W():Factor of specular reflection light

Specular Reflection

Shading Models for Polygons We can shade a surface by calculating the surface normal at each visible point and applying the desired model at that point. Constant Flat Shading Applies an illumination model one to determine a singles intensity value that is then used to shade the entire polygon. Interpolated Shading Shading information is linearly interpolated across triangle from illumination values determined at it vertices

Polygon Mesh Shading Gouraud Shading extends the concept of interpolated shading applied to individual polygons by interpolating polygon vertex illumination values that take into account the surface being approximated. A vertex intensity is computed by using the vertex normal with any desired shading model. Phong Shading interpolates the surface normal vector, rather than the intensity. Interpolation occurs across a polygon span on a scan line.

Interpolated Shading Problems Polygonal Silhouette Perspective distortion Orientation dependence Problem at shared vertices Inaccurate vertex normal

Light & Material in OpenGL GLfloat lit_mbient[] = {0.2, 0.2, 0.2, 1.0}; GLfloat lit_diffuse[] = {1.0, 1.0, 1.0, 1.0}; GLfloat lit_specular[] = {1.0, 1.0, 1.0, 1.0}; GLfloat lit_position[] = {-2.0, 1.0, 3.0, 1.0}; GLfloat lit_spot_dir[] = {-1.0, -1.0, -1.0}; GLfloat lit_shine[] = {50.0}; glShadeModel(GL_SMOOTH); glEnable(GL_LIGTING); glEnable(GL_LIGHT0); glLightfv(GL_LIGHT0, GL_POSITION, lit_ position); glLightfv(GL_LIGHT0, GL_AMBIENT, lit_ ambient); glLightfv(GL_LIGHT0, GL_DIFFUSE, lit_diffuse); glLightfv(GL_LIGHT0, GL_SPECULAR, lit_specular); glLightfv(GL_LIGHT0, GL_SHININESS, lit_shine);

Material