1 Computer Graphics Week13 –Shading Models. Shading Models Flat Shading Model: In this technique, each surface is assumed to have one normal vector (usually.

Slides:



Advertisements
Similar presentations
Lecture 8 Transparency, Mirroring
Advertisements

Virtual Realism TEXTURE MAPPING. The Quest for Visual Realism.
Graphics Pipeline.
03/16/2009Dinesh Manocha, COMP770 Texturing Surface’s texture: its look & feel Graphics: a process that takes a surface and modifies its appearance using.
Texture Mapping. Texturing  process that modifies the appearance of each point on a surface using an image or function  any aspect of appearance can.
Week 10 - Monday.  What did we talk about last time?  Global illumination  Shadows  Projection shadows  Soft shadows.
3D Graphics Rendering and Terrain Modeling
Real-Time Rendering TEXTURING Lecture 02 Marina Gavrilova.
ATEC Procedural Animation Introduction to Procedural Methods in 3D Computer Animation Dr. Midori Kitagawa.
Week 7 - Wednesday.  What did we talk about last time?  Transparency  Gamma correction  Started texturing.
 Engineering Graphics & Introductory Design 3D Graphics and Rendering REU Modeling Course – June 13 th 2014.
COMPUTER GRAPHICS CS 482 – FALL 2014 OCTOBER 6, 2014 TEXTURE MAPPING TEXTURES BUMP MAPPING ENVIRONMENT MAPPING PROCEDURAL TEXTURING.
Week 9 - Wednesday.  What did we talk about last time?  Fresnel reflection  Snell's Law  Microgeometry effects  Implementing BRDFs  Image based.
Computer Graphics - Class 10
1GR2-00 GR2 Advanced Computer Graphics AGR Lecture 12 Solid Textures Bump Mapping Environment Mapping.
18.1 Si31_2001 SI31 Advanced Computer Graphics AGR Lecture 18 Image-based Rendering Light Maps What We Did Not Cover Learning More...
(conventional Cartesian reference system)
X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Shading Week 5, Wed 1 Oct 2003 recap: lighting shading.
Introduction to 3D Graphics John E. Laird. Basic Issues u Given a internal model of a 3D world, with textures and light sources how do you project it.
Computer Graphics Inf4/MSc Computer Graphics Lecture 11 Texture Mapping.
Guilford County Sci Vis V204.01
MULTIMEDIA TECHNOLOGY SMM 3001 MEDIA - GRAPHICS. In this chapter how the computer creates, stores, and displays graphic images how the computer creates,
Shadows Computer Graphics. Shadows Shadows Extended light sources produce penumbras In real-time, we only use point light sources –Extended light sources.
Erdem Alpay Ala Nawaiseh. Why Shadows? Real world has shadows More control of the game’s feel  dramatic effects  spooky effects Without shadows the.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 19 Other Graphics Considerations Review.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
3D Computer Graphics: Textures. Textures: texels Texture is a way of assigning a diffuse color to a pixel – can be with 1, 2 or 3D- can use maps, interpolation.
Computer Graphics Inf4/MSc Computer Graphics Lecture 7 Texture Mapping, Bump-mapping, Transparency.
CS 445 / 645 Introduction to Computer Graphics Lecture 18 Shading Shading.
COMP 175: Computer Graphics March 24, 2015
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Rendering: Shading and Lighting.  In the last lecture we saw how to model objects and represent them as wireframe models. Wire frame models depict the.
ECSE 4750: Computer Graphics Rensselaer Polytechnic Institute Nov 5, 2012 Texture and Texture Mapping.
Computer Graphics Texture Mapping
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Textures and shadows  Generation  Mipmap  Texture coordinates,
Texture Mapping. Scope Buffers Buffers Various of graphics image Various of graphics image Texture mapping 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.
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
Week 2 - Friday.  What did we talk about last time?  Graphics rendering pipeline  Geometry Stage.
CS447/ Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.
CSC 461: Lecture 3 1 CSC461 Lecture 3: Models and Architectures  Objectives –Learn the basic design of a graphics system –Introduce pipeline architecture.
Week 6 - Wednesday.  What did we talk about last time?  Light  Material  Sensors.
CS-378: Game Technology Lecture #4: Texture and Other Maps Prof. Okan Arikan University of Texas, Austin V Lecture #4: Texture and Other Maps.
1Computer Graphics Lecture 4 - Models and Architectures John Shearer Culture Lab – space 2
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
CHAPTER 8 Color and Texture Mapping © 2008 Cengage Learning EMEA.
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
Computer Graphics: Programming, Problem Solving, and Visual Communication Steve Cunningham California State University Stanislaus and Grinnell College.
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.
CS 325 Introduction to Computer Graphics 04 / 12 / 2010 Instructor: Michael Eckmann.
11/5/2002 (c) University of Wisconsin, CS 559 Last Time Local Shading –Diffuse term –Specular term –All together –OpenGL brief overview.
CSCI 440.  So far we have learned how to  build shapes  create movement  change views  add simple lights  But, our objects still look very cartoonish.
Module 06 –environment mapping Module 06 – environment mapping Module 06 Advanced mapping techniques: Environment mapping.
Real-Time Dynamic Shadow Algorithms Evan Closson CSE 528.
Computer Graphics One of the central components of three-dimensional graphics has been a basic system that renders objects represented by a set of polygons.
CS 376 Introduction to Computer Graphics 04 / 13 / 2007 Instructor: Michael Eckmann.
Mapping: Image Texturing CPSC 591/691. Texture Mapping Two-dimensional techniques place a two-dimensional (flat) image onto an object using methods similar.
Week 2 - Friday CS361.
POLYGON MESH Advance Computer Graphics
ATEC Procedural Animation
ATCM 3310 Procedural Animation
3D Graphics Rendering PPT By Ricardo Veguilla.
Chapter 14 Shading Models.
The Graphics Pipeline Lecture 5 Mon, Sep 3, 2007.
Chapter 14 Shading Models.
Advanced Computer Graphics: Texture
Presentation transcript:

1 Computer Graphics Week13 –Shading Models

Shading Models Flat Shading Model: In this technique, each surface is assumed to have one normal vector (usually the average of its vertex normals) as shown in Figure. This normal vector is used in the lighting calculations, and the resultant color is assigned to the entire surface. 2

Notice how flat shading causes a sudden transition in color from polygon to polygon. This is because every polygon is rendered using a normal vector that changes abruptly across neighboring polygons. Flat shading is fast to render, and is used to preview rendering effects or on objects that are very small. 3

4 Flat shading: one normal per polygon

Gourad Shading Gourad shading is used when smooth shading effects are needed. In this process, each vertex defines a normal vector. This normal value is used to calculate the color at every vertex of the surface. The resulting colors are averaged into the interior of the surface to achieve a smooth render. Since polygons share vertices (and hence the same normal value), the polygon edges blend together to produce a smooth look. 5

6 Gourad shading: one normal per vertex

Gourad shading produces smooth renders but takes longer to complete than flat shading. Even more complicated rendering techniques exist, such as ray tracing, radiosity and volume rendering. 7

Texture Mapping Texture mapping can dramatically alter the surface characteristics of an object. It adds vitality to models and can provide great visual cues for even simple models. For example, if we map a wood grain image to a model of a chair, the chair will look like it is made out of fine wood grain. Texture mapping an image of a brick wall onto a single polygon would give the impression that the polygon had been modeled with many individual bricks, as shown in Figure. 8

Texture mapping is a crucial element in today's games and graphic-oriented programs. Without texture mapping, the models that are rendered would be far from aesthetically pleasing. 9 Texture mapping a polygon

Because texture mapping is so useful, it is being provided as a standard rendering technique both in graphics software interfaces and in computer graphics hardware. 10

The Basics of 2D Texture Mapping When mapping an image onto an object, the color of the object at each pixel is modified by a corresponding color from the image. The image is called a texture map and its individual elements (pixels) are called texels. The texture map resides in its own texture coordinate space, often referred to as (s,t) space. Typically (s, t) range from 0 to 1, defining the lower and upper bounds of the image rectangle. 11

The simplest version of texture mapping can be accomplished as described. The corner points of the surface element (in world coordinates) is mapped onto the texture coordinate space using a predetermined mapping scheme. The four points in the (s,t) space defines a quadrilateral. 12

The color value for the surface element is calculated by the weighted average of the texels that lie within the quadrilateral. For polygonal surfaces, texture coordinates are calculated at the vertices of the defining polygons. The texture coordinate values within the polygon are linearly averaged across the vertices. 13

14 Texture mapping: from texels to pixels

The texture space is defined to be from 0 to 1. For texture coordinates outside the range [0,1] you can have the texture data either clamp or repeat over (s,t) as shown in Figure. 15

16 A texture image, repeated along t and clamped along s

After being mapped to a polygon or surface and transformed into screen coordinates, the individual texels of a texture rarely correspond to individual pixels of the final screen image. Depending on the transformations used and the texture mapping applied, a single pixel on the screen can correspond to anything from a tiny portion of a texel (magnification) to a large collection of texels (minification), as shown in Figure. 17

Filtering operations are used to determine which texel values should be used and how they should be averaged or interpolated. 18 Magnification and Minification of texels

There are a number of generalizations to this basic texture-mapping scheme. The texture image to be mapped need not be two-dimensional: the sampling and filtering techniques may also be applied for both one- and three- dimensional images. 19

In fact 1D texture mapping is a specialized version of 2D mapping. The texture may not be stored as an array but may be procedurally generated. Finally, the texture may not represent color at all but may instead describe transparency or other surface properties to be used in lighting or shading calculations. 20

Mapping Schemes The question in (2D) texture mapping is how to map the two dimensional texture image onto an object. In other words, for each polygonal vertex (or some other surface facet) in an object, we encounter the question, "Where do I have to look in the texture map to find its color?" 21

Basic Mapping Scheme Typically, basic shapes are used to define the mapping from world space to texture space. Depending on the mapping situation, we project the object‘s coordinates onto the geometry of a basic shape such as a plane, a cube, or a sphere. It's useful to transform the bounding geometry so that it's coordinates range from zero to one and use this value as the (s,t) coordinates into the texture coordinate space. 22

23 Planar Texture mapping: mapping an image to a vase.

For example, for a map shape that is planar, we take the (x,y,z) value from the object and throw away (project) one of the components, which leaves us with its two-dimensional (planar) coordinates. We normalize the coordinates by the maximum extents of the object to attain coordinate values between 0 and 1. This value is then used as the (s,t) value into the texture map. The last figure shows such a mapping. 24

Environment Mapping If you look around your room you may realize that many objects reflect their surroundings. A bottle of water, a mobile phone, a CD cover, a picture frame, etc. are only a few examples of reflecting objects that could be found in any 3D scene. To make the 3D world more realistic, objects should show reflections of their environment. This reflection is often achieved by a texture-mapping method called environment mapping. 25

The goal of environment mapping is to render an object as if it were reflective, so that the colors on its surface are those reflected from its surroundings. In other words, if you were to look at a perfectly polished, perfectly reflective silver object in a room, you would see the walls, floor, and other objects in the room reflected off the object. 26

(A classic example of using environment mapping is the evil, morphing Cyborg in the film Terminator 2.) The objects whose reflections you see depend on the position of your eye and on the position and surface angles of the silver object. Of course, objects are not usually completely reflective, so the color of the reflection is modulated with the object's actual color for a realistic look. 27

Ray tracing is a very expensive option and is usually not necessary for most cases. More often, certain tricks are used to achieve reflective effects. A method often employed is called cube environment mapping. The idea behind cube environment mapping is very simple. 28

From an object with a reflective surface you first generate six images of the environment in each direction (front, back, up, down, left, right). That is, imagine placing a camera at the center of the object and taking the size photographs of the world around it in the directions specified. Based on the normal vector of the vertex in consideration, the appropriate image is selected. 29

This image is then projected using planar mapping onto the object as shown in Figure. 30 Cube Mapping

The resultant object looks like it is reflecting its environment! Mathematically, the cube face is identified by using the normal vectors (nx, ny, nz) on the surface of the object. The greatest component is used to identify where the surface should be "looking"; and hence the cube face and the texture image to be used. The other two coordinates are used to select the texel from the texture by a simple 3D to 2D projection. 31

If, say, ny was the highest value component then we divide the other components by ny (nx/ny,nz/ny). These coordinates are normalized to give the (s,t) values into the texture map. 32