Game Object Appearance. The Three Faces of Designing GO Appearance The Artistic Face: ◦ aesthetic – beautiful and ugly ◦ done by artists The Communication.

Slides:



Advertisements
Similar presentations
Computer Graphics - Shading -
Advertisements

Polygon Rendering Flat Rendering Goraud Rendering Uses Phong Reflectance Phong Rendering.
Computer Graphics I, Fall 2010 Shading II.
1 Graphics CSCI 343, Fall 2013 Lecture 18 Lighting and Shading.
CS 480/680 Computer Graphics Shading 2 Dr. Frederick C Harris, Jr.
CSPC 352: Computer Graphics
Virtual Realism LIGHTING AND SHADING. Lighting & Shading Approximate physical reality Ray tracing: Follow light rays through a scene Accurate, but expensive.
1 Computer Graphics Chapter 9 Rendering. [9]-2RM Rendering Three dimensional object rendering is the set of collective processes which make the object.
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
Shading Shading: determining light reflection from objects at each pixel. Basic Reflection Model: Phong Reflection Model (most commonly used) I= k a I.
Rendering (彩現 渲染).
Shading II CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
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
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.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2006 Shading II Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
CS 376 Introduction to Computer Graphics 03 / 30 / 2007 Instructor: Michael Eckmann.
6.1 Vis_04 Data Visualization Lecture 6 - A Rough Guide to Rendering.
CS5500 Computer Graphics March 26, Shading Reference: Ed Angel’s book.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Shading I Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Lighting & Shading.
CS 480/680 Computer Graphics Shading I Dr. Frederick C Harris, Jr.
Lecture 5: 3D Rendering Pipeline (II) Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering Georgia Institute of Technology.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 Shading I Shandong University Software College Instructor: Zhou Yuanfeng
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.
Chi-Cheng Lin, Winona State University CS430 Computer Graphics Lighting and Shading.
Human Eye and Color Rays of light enter the pupil and strike the back of the eye (retina) – signals go to the optic nerve and eventually to the brain Retina.
I-1 Steps of Image Generation –Create a model of the objects –Create a model for the illumination of the objects –Create an image (render) the result I.
Shading & Texture. Shading Flat Shading The process of assigning colors to pixels. Smooth Shading Gouraud ShadingPhong Shading Shading.
Advanced Computer Graphics Advanced Shaders CO2409 Computer Graphics Week 16.
CSE 381 – Advanced Game Programming GLSL Lighting.
Game Programming 06 The Rendering Engine
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.
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.
Introduction to Computer Graphics with WebGL
Visual Appearance Chapter 4 Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology.
Specular Reflection Lecture 27 Mon, Nov 10, 2003.
Local Illumination and Shading
Illumination and Shading Prof. Lizhuang Ma Shanghai Jiao Tong University.
Render methods. Contents Levels of rendering Wireframe Plain shadow Gouraud Phong Comparison Gouraud-Phong.
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
Computer Graphics Lecture 25 Fasih ur Rehman. Last Class Shading.
Illumination Models. Introduction 1 Illumination model: Given a point on a surface, what is the perceived color and intensity? Known as Lighting Model,
Yingcai Xiao Yingcai Xiao Chapter 3 Computer Graphics Primer.
Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
Computer Graphics: Illumination
Computer Graphics (Fall 2006) COMS 4160, Lecture 16: Illumination and Shading 1
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.
- Introduction - Graphics Pipeline
Computer Graphics Chapter 9 Rendering.
Visual Appearance Chapter 4
CSE 470 Introduction to Computer Graphics Arizona State University
Illumination and Shading
Computer Graphics (Fall 2003)
Presentation transcript:

Game Object Appearance

The Three Faces of Designing GO Appearance The Artistic Face: ◦ aesthetic – beautiful and ugly ◦ done by artists The Communication Face: ◦ show and tell (convey a message) ◦ done by communication experts The Technical Face ◦ the enabler (can or can’t), game engine design and development. ◦ done by computer scientists

GO: the Gang of Four 1. Geometry (Shape) 2. Attributes (Appearance) 3. Animation (Changes in Geometry and Attributes) 4. Interaction (User Controlled Changes)

Attributes (Appearance) 1. Color 2. Shades 3. Texture 4. Transparency

Color 1. Gamma Correction 2. Dynamic Range 3. Color Models

Gamma Correction Fact 1: Our eyes are sensitive to ratios of intensity rather than to absolute values of intensity. ◦ Lightbulb: 10  20; 100  110; 100  200 ◦ Exponential increase in intensity results in linear increase of the sensation of intensity. Fact 2: Most software computes intensity linearly, e.g. smooth shading linearly interpolates vertex reflection intensity into pixel intensity values.

Gamma Correction Such images will appear very dark. Need to convert the intensity value using an exponential factor: I = K V  Where  is a hardware dependent constant. This way of increasing the intensity by the gamma exponent is called Gamma Correction.Gamma Correction

UA’s medallion is too dark due to the lack of gamma correction. Microsoft photo editor supports gamma correction (Image->Ballence->Gamma).

Dynamic Range (DR) Color digitization Intensity levels: discrete Flexible distribution of the the discrete levels. g.com/news/rambus_binary _pixel_technology_improv es_dynamic_range/

Color Models 1. RGB 2. CMY 3. CMYK 4. HSV

Color Models: RGB 1. For Color Monitors 2. Additive Colors (Black: 000, White: 111)

Color Models: CMY 1. For Printers 2. Subtractive Colors (White: 000, Black: 111)

Color Models: CMYK 1. For Printers 2. Subtractive Colors (White: 000, Black: 111) 3. K=min(C, M, Y); 4. C=C-K; M=M-K; Y=Y-K;

Color Models: HSV 1. For user interaction 2. Hue, saturation, value (tint, color, brightness)

Shading

Shading 1. Realism 2. Speed 3. Theory 4. Implementation

Shading 1. Realism : Speed 2. HW tools: Frame Buffer, Z Buffer, ID Buffer, GPU 3. SW tools: LOD (Level of Details), 4. Shading Modes: Flat, Smooth, Phong

Shading Modes

Shading Shading: determining light reflection from objects at each pixel. Basic Reflection Model: Phong Reflection Model (most commonly used) I= k a I a + k d I d (l · n) + k s I s (v · r ) α I : reflected-light intensity

Ambient Reflection: Direction independent k a I a I a : incident ambient-light intensity k a : object ambient-reflection coefficient part of the object material properties

Lambertian / Diffusive Reflection: Lighting-direction dependent I d k d (l  n) = I d k d cos(  ) I d : incident diffussive-light intensity k d : object diffusive-reflection coefficient  : angle between light direction (l) and surface normal (n). Both l and n are unit vectors.

Specular Reflection: Viewing-direction dependent I s k s (v  r) α = I s k s cos α (Ф). I s : incident specular-light intensity k s : object specular-reflection coefficient Ф : angle between reflection direction (r) and viewing direction (v).  : specular-reflection exponent, shaniness coefficient. 1/  : roughness.

The effects of ambient, diffusive and specular reflection.

The effects of ambient, diffusive and specular reflection. ( Teapots shaded with different parameters.

Attenuation: Distance dependent, no impact on ambient light f att = 1/(a + bd + cd 2 ) d : distance from the light to the surface point. a,b,c: constant, linear, quadratic attenuation coefficients. I = k a I a + f att k d I d (l · n) + f att k s I s (v · r ) α I = k a I a + I d k d cos(  ) / (a + bd + cd 2 ) + I s k s cos α (Ф) / (a + bd + cd 2 )

Summary: I = k a I a + f att k d I d (l · n) + f att k s I s (v · r ) α I = k a I a + I d k d cos(  ) / (a + bd + cd 2 ) + I s k s cos α (Ф) / (a + bd + cd 2 )

Colored Lights and Surfaces : I = (I r, I g, I b ) = { I, = r, g, b} : color channel ->Colored lights: I a, I d, I s, ->Colored objects: k a, k d, k s, I = I a k a + f att I d k d (l  n) + f att I s k s (v  r) α with = r, g, b. I r = I ar k ar + f att I dr k dr (l  n) + f att I sr k sr (v  r) α I g = I ag k ag + f att I dg k dg (l  n) + f att I sg k sg (v  r) α I b = I ab k ab + f att I db k db (l  n) + f att I sb k sb (v  r) α

Multiple Lights: I = I a k a + f atti [I d i k d (l i  n) + I s i k s (v  r i ) α ] with = r, g, b. m: number of lights. OpenGL support ambient component for individual light. I = [ I a i k a + f atti [I d i k d (l i  n) + I s i k s (v  r i ) α ]]

Many more things consider: Shadow, Reflection, Transparency, Refraction, … Figure 2. Shading effects: a) Ambient, b) Diffuse, c) Highlights, d) Shadows and e) Reflection (notice the reflection on the floor also)

How to get to each pixel? Two approaches: object order and image order Frame Buffer: a buffer of memory to store the colors of the screen, one memory cell per pixel

Object Order Shading: Geometrically approximate objects as patched (triangle) surfaces. Appearance-wise use three shading methods to approximate: Flat, Smooth / Gouraud, Phong

Z Buffer (depth buffer): a buffer of memory to store the z values of the screen, one memory cell per pixel. To support Hidden Surface Removal and Level of Details. line of sight Frame buff Z buff

Flat/Constant Shading: for (each object) for(each triangle of the object) compute its reflection using color and normal of the triangle for(each pixel in the triangle) if(closer to the viewer than the current z buffer value) { update z buffer with the new z update pixel color with the triangle reflection }

Gouraud/Smooth Shading for (each object) for(each triangle of the object) {for(each vertex of in the triangle) compute the vertex reflection using the color and the normal of the vertex for(each pixel in the triangle) if(closer to the viewer than the current z buffer value) { update z buffer with the new z interpolate the pixel color from the vertex reflections. }

Phong Shading: for (each object) for(each triangle of the object) for(each pixel in the triangle) if(closer to the viewer than the current z buffer value) {update z buffer with the new z interpolate the pixel normal from the vertex normals compute the pixel color/relection using Phong reflection model using pixel normals and the properties of the object. }

Comparaison of Shading Methods (Realism):

Comparaison of Shading Methods:

Comparaison of Shading Methods: Gouraud Shading

Comparaison of Shading Methods: Gouraus vs. Phong GOURAUD SHADING

Comparaison of Shading Methods: High Resolution Gouraud Phong.cpp in the example. Phong.cpp in the example Phong.cpp in the example

Comparisons (Speed, how many time the I formula are used): ◦ Flat:1 ◦ Smooth: 3 + Interpolation ◦ Phong: 5000 for a benchmark triangle THE GAMER'S BENCHMARK ◦ 3D Mark 3D Mark ◦

Rendering Engine using Object-Order Shading: Rendering APIs: OpenGL ActiveX Renderman Pixie - Open Source RenderMan Web 3D Graphics API: WebGL VRML/X3D SVG: Scalable Vector Graphics Google SketchUp SecondLifeSecondLife UA’s IslandIUA’s IslandI Other Web Graphics API: HTML5.0 Flash Microsoft Silverlight

Level of Detail (LOD) Rendering GOs closer to the viewer with more precision and GOs far away from the viewer with reduced acuracy to save time. Geometry: use simpler geometry (a fewer triangles) Appearance: use faster shading methods (Phong->smooth->Flat) Level of Detail for 3D Graphics by David Luebke Luebke line of sight Frame buff Z buff