1 Computer Graphics Chapter 9 Rendering. [9]-2RM Rendering Three dimensional object rendering is the set of collective processes which make the object.

Slides:



Advertisements
Similar presentations
Computer Graphics - Shading -
Advertisements

Virtual Realism TEXTURE MAPPING. The Quest for Visual Realism.
1 Graphics CSCI 343, Fall 2013 Lecture 18 Lighting and Shading.
3D Graphics Rendering and Terrain Modeling
Virtual Realism LIGHTING AND SHADING. Lighting & Shading Approximate physical reality Ray tracing: Follow light rays through a scene Accurate, but expensive.
CHAPTER 12 Height Maps, Hidden Surface Removal, Clipping and Level of Detail Algorithms © 2008 Cengage Learning EMEA.
1 Computer Graphics By : Mohammed abu Lamdy ITGD3107 University of Palestine Supervision: Assistant Professor Dr. Sana’a Wafa Al-Sayegh.
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.
University of New Mexico
Computer Graphics - Class 10
CS 4731: Computer Graphics Lecture 18: Hidden Surface Removal Emmanuel Agu.
IMGD 1001: Illumination by Mark Claypool
IN4151 Introduction 3D graphics 1 Introduction 3D Computer Graphics part 1 Projective display Viewing pipeline Graphics hardware Image-based rendering.
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.
6.1 Vis_04 Data Visualization Lecture 6 - A Rough Guide to Rendering.
Vertices and Fragments III Mohan Sridharan Based on slides created by Edward Angel 1 CS4395: Computer Graphics.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Shading Week 5, Wed 1 Oct 2003 recap: lighting shading.
Part I: Basics of Computer Graphics Rendering Polygonal Objects (Read Chapter 1 of Advanced Animation and Rendering Techniques) Chapter
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Shading I Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Lighting & Shading.
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.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Shading (introduction to rendering). Rendering  We know how to specify the geometry but how is the color calculated.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 10: Computer Graphics Computer Science: An Overview Tenth Edition.
COMPUTER GRAPHICS CS 482 – FALL 2014 AUGUST 27, 2014 FIXED-FUNCTION 3D GRAPHICS MESH SPECIFICATION LIGHTING SPECIFICATION REFLECTION SHADING HIERARCHICAL.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Chapter 10: Computer Graphics
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 10: Computer Graphics Computer Science: An Overview Tenth Edition.
Shading & Texture. Shading Flat Shading The process of assigning colors to pixels. Smooth Shading Gouraud ShadingPhong Shading Shading.
CS447/ Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.
Taku KomuraComputer Graphics Local Illumination and Shading Computer Graphics – Lecture 10 Taku Komura Institute for Perception, Action.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Basic Rendering Pipeline and Shading Spring 2012.
Illumination and Shading How to shade surfaces based on the position,orientation,characteristics of the surfaces and the light sources illuminating them.
1Computer Graphics Implementation II Lecture 16 John Shearer Culture Lab – space 2
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
Implementation II.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Illumination and Shading
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
RENDERING Introduction to Shading models – Flat and Smooth shading – Adding texture to faces – Adding shadows of objects – Building a camera in a program.
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.
Local Illumination and Shading
Computer Graphics I, Fall 2010 Implementation II.
Where We Stand So far we know how to: –Transform between spaces –Rasterize –Decide what’s in front Next –Deciding its intensity and color.
CDS 301 Fall, 2008 From Graphics to Visualization Chap. 2 Sep. 3, 2009 Jie Zhang Copyright ©
OpenGL Shading. 2 Objectives Learn to shade objects so their images appear three-dimensional Introduce the types of light-material interactions Build.
Lighting and Reflection Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
Visible-Surface Detection Methods. To identify those parts of a scene that are visible from a chosen viewing position. Surfaces which are obscured by.
Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
Computer Graphics: Illumination
Chapter 10: Computer Graphics
Computer Graphics Chapter 9 Rendering.
3D Graphics Rendering PPT By Ricardo Veguilla.
Chapter 10: Computer Graphics
Chapter 14 Shading Models.
Isaac Gang University of Mary Hardin-Baylor
CS5500 Computer Graphics May 29, 2006
Illumination and Shading
Texture Mapping 고려대학교 컴퓨터 그래픽스 연구실.
Chapter 14 Shading Models.
Illumination Model 고려대학교 컴퓨터 그래픽스 연구실.
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Presentation transcript:

1 Computer Graphics Chapter 9 Rendering

[9]-2RM Rendering Three dimensional object rendering is the set of collective processes which make the object model appear more realistic on the display screen. These processes include  The elimination of surfaces (polygonal segments) on the object that are not visible with respect to the user’s view direction.  Incorporating shading and shadowing effects.

[9]-3RM Computing Surface Normal V 1 = P 2  P 1 = (x 2  x 1, y 2  y 1, z 2  z 1 ). V 2 = P 3  P 1 = (x 3  x 1, y 3  y 1, z 3  z 1 ). N = V 1  V 2. Surface Normal:

[9]-4RM Components of Surface Normal N x = (y 2  y 1 ) (z 3  z 1 )  (y 3  y 1 ) (z 2  z 1 ) N y = (z 2  z 1 ) (x 3  x 1 )  (z 3  z 1 ) (x 2  x 1 ) N z = (x 2  x 1 ) (y 3  y 1 )  (x 3  x 1 ) (y 2  y 1 ) N x = y 1 (z 2 -z 3 )+ y 2 (z 3 -z 1 )+ y 3 (z 1 -z 2 ) N y = z 1 (x 2 -x 3 )+ z 2 (x 3 -x 1 )+ z 3 (x 1 -x 2 ) N z = x 1 (y 2 -y 3 )+ x 2 (y 3 -y 1 )+ x 3 (y 1 -y 2 ) OR

[9]-5RM Back-Face Culling N z < 0  The polygon is hidden

[9]-6RM Back-Face Culling - Limitations Requires specific ordering of the vertices in the polygon table to determine the outward normal direction. The algorithm will work only with convex objects. A polygon is either completely displayed, or totally eliminated from the display.

[9]-7RM Back-Face Culling (General Case) V.N > 0  The polygon is hidden

[9]-8RM Back-Face Culling (Example)

[9]-9RM Back-Face Culling (OpenGL)

[9]-10RM Painter’s Algorithm

[9]-11RM Painters Algorithm Basic Steps:  Sort polygons in the ascending order of z-coordinates  Fill polygons in the sorted order.

[9]-12RM Painters Algorithm - Limitations Requires sorting of polygons. All polygons must be necessarily filled. May lead to erroneous images if a failure condition (see below) occurs.

[9]-13RM Polygons with depth and region overlap. Z (1) (2) Polygons having both depth-overlap and region overlap may require re-sequencing of the polygons in the sorted list. Painters Algorithm Failure Conditions (1)

[9]-14RM Polygons with cyclic overlap. Painters Algorithm Failure Conditions (2)

[9]-15RM Painter’s Algorithm Illustration of failure conditions Wrong Correct

[9]-16RM Z Depth-Buffer Algorithm Frame BufferDepth Buffer Color Value Minimum Depth Value

[9]-17RM Depth-Buffer Algorithm For each pixel (i, j), a line passing through the pixel and the viewer is considered, and the depths of the polygons on this line are computed. The value d(i, j) in the depth buffer contains the pseudo-depth of the closest polygon encountered at pixel (i, j). The value p(i, j) in the frame buffer (the color of the pixel) is the color of the closest polygon.

[9]-18RM Depth-Buffer Algorithm Limitations:  The algorithm requires a large amount of additional memory to store the pseudo depth at each pixel value.  Since the analysis is based on a point by point test, the algorithm is time consuming.

[9]-19RM Shading Models A shading model dictates how light is scattered or reflected from a surface. A surface is shaded by adjusting the color intensity value of each polygon according to the shading algorithm. Main components:  Light source vector, surface normal vector, viewer direction.  Material characteristics of the surface  The illumination model.

[9]-20RM Shading Models Vectors

[9]-21RM Shading Models Surface Properties (1)  abs (Coeff. of absorption): Specifies how much of the incident light is absorbed. If all of the incident light is absorbed, the object appears black.  spec (Coeff. of specular reflection) Specifies how much of the incident light is specularly reflected in one direction. For a highly reflective surface such as a mirror, the value is close to 1.0

[9]-22RM Shading Models Surface Properties (2)  diff (Coeff. of diffuse reflection): Diffuse scattering occurs when the incident light is re-radiated uniformly in all directions. For a rough non-reflective surface, the value is close to 1.0.  amb (Coeff. of ambient reflection): Specifies how much of the ambient light is reflected by the surface. Often this is same as the diffuse reflection coefficient  diff.  abs +  spec +  diff = 1.0

[9]-23RM I If I is the incident light intensity, then I  abs is absorbed by the surface. I  spec is specularly reflected. I  diff is diffusely reflected. Surface Properties

[9]-24RM Surface Element Ambient Light Ambient Light Point Source Illumination Models

[9]-25RM Illumination Models Ambient Light Produces uniform illumination (also known as background light). Has no spatial or directional characteristics. Assumed to be incident from all directions with constant intensity I a. Ambient light reflection from a surface is constant along all visible directions, and does not depend on the surface orientation.

[9]-26RM Illumination Models Point Light Source Defined in terms of both the position of the source, and the intensity of the source I s. The reflection from a point light source depends on the surface orientation, and varies with respect to the view direction. Light source reflection consists of both specular reflection and diffuse reflection.

[9]-27RM Light Perceived by the Viewer Diffuse Reflection Point Source  I d = I s  diff cos  Since diffuse scattering is uniform in all directions, the orientation of the polygon relative to the viewer is not significant.

[9]-28RM Light Perceived by the Viewer Specular Reflection The vector h = s + v is known as the half-way vector. f is an experimentally determined constant I sp = (I s  spec cos f  )

[9]-29RM Light Perceived by the Viewer Specular Reflection is specular reflection parameter determine type of surface. (in OpenGL the value range 0 to 128). A very shiny surface is modeled with a large value, and smaller value (down to 0) are used for dull object. f is specular reflection parameter determine type of surface. (in OpenGL the value range 0 to 128). A very shiny surface is modeled with a large value, and smaller value (down to 0) are used for dull object.

[9]-30RM Light Perceived by the Viewer Ambient Reflection Ambient reflection is independent of surface orientation. Ambient reflection is independent of viewers position. The ambient light I a is uniformly reflected with intensity I a  amb. This is denoted as the ambient reflection I amb. I amb = I a  amb

[9]-31RM Computation of Total Reflected Light Total light intensity perceived by the user = I amb + I sp + I d = (I a  amb ) + (I s  spec cos f  ) + I s  diff cos 

[9]-32RM Shading (OpenGL)

[9]-33RM Flat and Smooth Shading The entire polygon is drawn with the same shade or color. The shades at the vertices are interpolated to determine the shade at an interior point Flat Shading Gouraud Shading

[9]-34RM Gouraud Shading The color at P 1 is obtained by linearly interpolating the colors C 1 and C 2. Similarly, the color at P 2 is found by linearly interpolating the colors C 3 and C 4. Having found P 1 and P 2, the algorithm then fills along the scan line by linearly interpolating between P 1 and P 2 to determine the color at an intermediate pixel Q.

[9]-35RM Flat and Smooth Shading (OpenGL)

[9]-36RM Flat and Smooth Shading Gouraud shading provides a much smoother appearance of surfaces. Flat Shading Gouraud Shading

[9]-37RM Texture Mapping (Examples)

[9]-38RM Texture Mapping The basic techniques begin with some texture functions, texture(s,t),in texture space which is traditionally marked off by parameters named s and t. The function texture(s,t) produces a color or intensity value for each value of s and t between 0 and 1. Texture mapping is the process of mapping a region in the 2D texture space to a region in the 3D space defined by the boundary points.

[9]-39RM Texture Mapping Texture Space

[9]-40RM Texture Mapping (OpenGL)

[9]-41RM Texture types Bitmap Textures: Often formed from bitmap representations of images. Defined by a mathematical function or procedure.