(conventional Cartesian reference system)

Slides:



Advertisements
Similar presentations
Exploration of bump, parallax, relief and displacement mapping
Advertisements

Graphics Pipeline.
1 Graphics CSCI 343, Fall 2013 Lecture 18 Lighting and Shading.
03/16/2009Dinesh Manocha, COMP770 Texturing Surface’s texture: its look & feel Graphics: a process that takes a surface and modifies its appearance using.
3D Graphics Rendering and Terrain Modeling
Computer Graphics Bing-Yu Chen National Taiwan University.
Computer Graphics Inf4/MSc Computer Graphics Lecture 13 Illumination I – Local Models.
Virtual Realism LIGHTING AND SHADING. Lighting & Shading Approximate physical reality Ray tracing: Follow light rays through a scene Accurate, but expensive.
 Engineering Graphics & Introductory Design 3D Graphics and Rendering REU Modeling Course – June 13 th 2014.
Illumination and Shading
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
Computer Graphics (Fall 2005) COMS 4160, Lecture 16: Illumination and Shading 1
Lighting and Shading Wen-Chieh (Steve) Lin
1 CSCE 641: Computer Graphics Lighting Jinxiang Chai.
Global Illumination May 7, Global Effects translucent surface shadow multiple reflection.
7M836 Animation & Rendering
6.1 Vis_04 Data Visualization Lecture 6 - A Rough Guide to Rendering.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Models and Architectures Ed Angel Professor of Computer Science, Electrical and Computer.
Coordinate Systems X Y Z (conventional Cartesian reference system) X Y Z.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Shading Week 5, Wed 1 Oct 2003 recap: lighting shading.
Computer Graphics Inf4/MSc Computer Graphics Lecture 11 Texture Mapping.
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.:
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.
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.
Graphics Graphics Korea University cgvr.korea.ac.kr 1 Texture Mapping 고려대학교 컴퓨터 그래픽스 연구실.
COLLEGE OF ENGINEERING UNIVERSITY OF PORTO COMPUTER GRAPHICS AND INTERFACES / GRAPHICS SYSTEMS JGB / AAS 1 Shading (Shading) & Smooth Shading Graphics.
Computer Graphics An Introduction. What’s this course all about? 06/10/2015 Lecture 1 2 We will cover… Graphics programming and algorithms Graphics data.
Shading & Texture. Shading Flat Shading The process of assigning colors to pixels. Smooth Shading Gouraud ShadingPhong Shading Shading.
C O M P U T E R G R A P H I C S Guoying Zhao 1 / 14 C O M P U T E R G R A P H I C S Guoying Zhao 1 / 14 Going-through.
CSC 461: Lecture 3 1 CSC461 Lecture 3: Models and Architectures  Objectives –Learn the basic design of a graphics system –Introduce pipeline architecture.
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1Computer Graphics Lecture 4 - Models and Architectures John Shearer Culture Lab – space 2
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
Course Introduction to virtual engineering Óbuda University John von Neumann Faculty of Informatics Institute of Applied Mathematics Lecture and laboratory.
CS 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
RENDERING Introduction to Shading models – Flat and Smooth shading – Adding texture to faces – Adding shadows of objects – Building a camera in a program.
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
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.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Render methods. Contents Levels of rendering Wireframe Plain shadow Gouraud Phong Comparison Gouraud-Phong.
Lighting and Reflection Angel Angel: Interactive Computer Graphics5E © Addison-Wesley
CSE 681 Introduction to Ray Tracing. CSE 681 Ray Tracing Shoot a ray through each pixel; Find first object intersected by ray. Image plane Eye Compute.
1 CSCE 441: Computer Graphics Lighting Jinxiang Chai.
Greg Humphreys CS445: Intro Graphics University of Virginia, Fall 2003 Texture Mapping Greg Humphreys University of Virginia CS 445, Fall 2003.
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)
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.
Texture Mapping cgvr.korea.ac.kr.
3D Graphics Rendering PPT By Ricardo Veguilla.
The Graphics Rendering Pipeline
Chapter 10: Computer Graphics
Chapter 14 Shading Models.
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:

(conventional Cartesian reference system) Coordinate Systems Coordinate Systems (conventional Cartesian reference system) Y Z Y X Z X

Transformations Transformation occurs about the origin of the coordinate system’s axis Scale Translate Rotate

Order of Transformations Make a Difference Box centered at origin Rotate about Z 45; Translate along X 1 Translate along X 1; Rotate about Z 45

Hierarchy of Coordinate Systems Local coordinate system Also called: Scene graphs Tree structures

The Camera Near Clipping Plane Far Clipping Plane Projection Plane View Volume

Perspective Projection The Camera Parallel Projection Perspective Projection

Rendering Pipeline Hardware Modelling Transform Visibility Illumination + Shading Color Perception, Interaction Texture/ Realism

Polygons, Meshes & Scan Conversion - In scan line rendering (the most common): Each polygon is calculated along each scan line. From the top scan line to the bottom of a frame in the 2D projection plane. V1 Raster Scan line V3 V2

Approximating Curved Surfaces with Flat Polygons Flat Shading – each polygon face has a normal that is used to perform lighting calculations.

Gouraud Shading Compute vertex normals by averaging face normals. Compute intensity at each vertex. I1 Raster Scan line I1,2 I1,2,3,4 I1,3 I3 I2

Illumination / Shading Distinction between illumination and shading models illumination - calculate intensity at a point on surface shading - uses calculated intensities to shade polygons (uses illumination models) we’ll review the important models

Illumination / Shading global illumination: ray tracing + radiosity mapping and other techniques texture maps, bump maps, reflection maps, transparency, anti-aliasing, shadows ray tracing radiosity

Local Illumination Local vs. global illumination models local (typically) - how is one point of the scene illuminated directly by the light source is light source only source of illumination? Simple models lump the rest into a single ambient term do not account for reflections within the environment

Local Illumination Local vs. global illumination models global - illuminates the whole scene typically makes use of local illumination model incorporates inter-reflectance of objects

(light starts to drop off to zero here) Lighting Types Ambient – basic, even illumination of all objects in a scene Directional – all light rays are in parallel in 1 direction - like the sun Point – all light rays emanate from a central point in all directions – like a light bulb Spot – point light with a limited cone and a fall-off in intensity – like a flashlight Cone angle Penumbra angle (light starts to drop off to zero here)

Light Effects Usually only considering reflected part Light Light specular Light absorbed ambient diffuse transmitted Light=refl.+absorbed+trans. Light=ambient+diffuse+specular

Ambient Light is the light in the environment evenly reaching all surfaces from all directions light location doesn’t matter eye position doesn’t matter IA: ambient light ka: material’s ambient reflection coefficient

Ambient Light IA: ambient light ka: material’s ambient reflection coefficient Models general level of brightness in the scene Accounts for light effects that are difficult to compute (secondary diffuse reflections, etc)

Ambient Light Example

Lambert’s Law: (perfectly diffuse surface) Diffuse Light Light absorbed by the surface and then reflected equally to all directions Models dullness, roughness of a surface Light Lambert’s Law: (perfectly diffuse surface) N f L Id: intensity of light source kd: material’s diffuse reflection coefficient N: normal vector (normalized) L: light source vector (normalized)

Diffuse Light

Diffuse Lighting Example

Specular Light Light that is reflected from the surface unequally to all directions Models reflections on shiny surfaces Phong’s Law: Light N Eye R f f L a R R R n=small n=inf. n=large

Specular light example

Specular light calculation The effect of ‘n’ in the phong model n = 10 n = 90 n = 30 n = 270

Shading a Polygon Illumination Model: determine the color of a surface (data) point by simulating some light attributes. Local IM: deals only with isolated surface (data) point and direct light sources. Global IM: takes into account the relationships between all surfaces (points) in the environment. Shading Model: applies the illumination models at a set of points and colors the whole scene. Texture Mapping: remappes and avgs. any value above (diffuse) from a 2d picture or map

Shading a Polyhedra Flat (facet) shading: Works well for objects really made of flat faces. Appearance depends on number of polygons for curved surface objects. If polyhedral model is an approximation then need to smooth.

Flat and Smooth Shading Getting smooth Curvature : interpolation Flat Shading Gouraud Shading

Flat Shading Polygon meshes approximate smooth curved surfaces with planar facets. Using the previous methods does not generate an illusion of smooth curved surface. N1 N2 Reason: discontinuity of the normal vectors.

Gouraud Shading Assign vertex the normal of the smooth surface. Or Average the normal of all neighboring polygons N N1 N2 Interpolate colors along edges and scan-lines

Gouraud shading

Phong shading

Phong Shading Gouraud Shading does not properly handle specular highlights. Reason: Colors are interpolated Solution: Compute averaged normal at vertices (Gouraud) Interpolate normals along edges and scan lines! Apply illumination model at every pixel

Phong Shading Gouraud Shading Phong Shading

Specular Small n Large n

Textures Images (textures) applied to polygons (models) to enhance the visual effect of a scene Texture Surface Image Angel Figure 9.3

Surface Textures Add visual detail to surfaces of 3D objects With surface texture Polygonal model

Surface Textures Add visual detail to surfaces of 3D objects

+ = Parameterization geometry image texture map Q: How do we decide where on the geometry each color from the image should go?

Option: Varieties of projections

Texture Mapping Steps: Define texture Specify mapping from texture to surface Lookup texture values during scan conversion (0,1) t (1,0) y v u x s (0,0) Texture Coordinate System Modeling Coordinate System Image Coordinate System

Texture Mapping When scan convert, map from … image coordinate system (x,y) to modeling coordinate system (u,v) to texture image (t,s) (1,1) (0,1) t (1,0) y v u x s (0,0) Texture Coordinate System Modeling Coordinate System Image Coordinate System

Texture Mapping Interpolate texture coordinates down/across scan lines U,V mapping can be arbitrary and manipulated Distortion due to interpolation approximation

Texture Filtering Aliasing is a problem Area filtering Point sampling Angel Figure 9.5

Texture Filtering Size of filter depends on projective warp Can prefiltering images Magnification Minification Angel Figure 9.14

Mip Maps Keep textures prefiltered at multiple resolutions For each pixel, linearly interpolate between two closest levels (e.g., trilinear filtering) Fast, easy for hardware

What is a Texture? MAP surface detail from a predefined (easy table (“texture”) to a simple polygon Color Specular ‘color’ (environment map) Normal vector deviation (bumpmap) displacement mapping transparency ...

Bump Mapping Modifies the direction of the surface normal.

Texture and Bump Mapping Diffuse and normal remapping

Displacement Mapping Modifies the surface position in the direction of the surface normal. the actual geometric position of points over the textured surface are displaced along the surface normal according to the values stored into the texture.

Programmable Shaders Vertex Shader - Small Vertex program that can modify the vertex between submission to the pipeline and rendering

Programmable Shaders Vertex Shader - Small program that can modify every vertex before rendering 3 examples: Renderman (software-based, non real-time), Microsoft’s DirectX (GPU real time) Nvidia’s Cg (GPU real time) http://www.nzone.com/object/nzone_luna_videos.html