Visualisatie BMT. Rendering. Arjan Kok

Similar documents
CS5620 Intro to Computer Graphics

Illumination and Shading

Illumination Models & Shading

Rendering. Illumination Model. Wireframe rendering simple, ambiguous Color filling flat without any 3D information

Lecture 15: Shading-I. CITS3003 Graphics & Animation

Topic 9: Lighting & Reflection models 9/10/2016. Spot the differences. Terminology. Two Components of Illumination. Ambient Light Source

Topic 9: Lighting & Reflection models. Lighting & reflection The Phong reflection model diffuse component ambient component specular component

Computer Graphics. Illumination and Shading

CPSC / Illumination and Shading

Computer Graphics (CS 4731) Lecture 16: Lighting, Shading and Materials (Part 1)

CS770/870 Spring 2017 Color and Shading

Computer Graphics (CS 543) Lecture 7b: Intro to lighting, Shading and Materials + Phong Lighting Model

Introduction to Computer Graphics. Farhana Bandukwala, PhD Lecture 14: Light Interacting with Surfaces

Computer Graphics MTAT Raimond Tunnel

Illumination & Shading

CS130 : Computer Graphics Lecture 8: Lighting and Shading. Tamar Shinar Computer Science & Engineering UC Riverside

Shading. Shading = find color values at pixels of screen (when rendering a virtual 3D scene).

Reflection and Shading

Computer Graphics. Shading. Based on slides by Dianna Xu, Bryn Mawr College

Color and Light CSCI 4229/5229 Computer Graphics Fall 2016

ECS 175 COMPUTER GRAPHICS. Ken Joy.! Winter 2014

CS Illumination and Shading. Slide 1

9. Illumination and Shading

w Foley, Section16.1 Reading

Today. Global illumination. Shading. Interactive applications. Rendering pipeline. Computergrafik. Shading Introduction Local shading models

Shading I Computer Graphics I, Fall 2008

CEng 477 Introduction to Computer Graphics Fall

Illumination. Michael Kazhdan ( /657) HB Ch. 14.1, 14.2 FvDFH 16.1, 16.2

Today. Global illumination. Shading. Interactive applications. Rendering pipeline. Computergrafik. Shading Introduction Local shading models

CPSC 314 LIGHTING AND SHADING

INFOGR Computer Graphics. J. Bikker - April-July Lecture 10: Shading Models. Welcome!

Lecture 17: Shading in OpenGL. CITS3003 Graphics & Animation

Computer Vision Systems. Viewing Systems Projections Illuminations Rendering Culling and Clipping Implementations

Computer Graphics. Illumination and Shading

Today s class. Simple shadows Shading Lighting in OpenGL. Informationsteknologi. Wednesday, November 21, 2007 Computer Graphics - Class 10 1

Color and Light. CSCI 4229/5229 Computer Graphics Summer 2008

Illumination in Computer Graphics

Lighting. Figure 10.1

S U N G - E U I YO O N, K A I S T R E N D E R I N G F R E E LY A VA I L A B L E O N T H E I N T E R N E T

Lighting and Shading. Slides: Tamar Shinar, Victor Zordon

Lighting and Shading Computer Graphics I Lecture 7. Light Sources Phong Illumination Model Normal Vectors [Angel, Ch

Illumination and Shading

Local Illumination. CMPT 361 Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller

CSE 681 Illumination and Phong Shading

University of Victoria CSC 305 Shading. Brian Wyvill 2016

Illumination & Shading: Part 1

Comp 410/510 Computer Graphics. Spring Shading

Illumination and Shading

CSE 167: Introduction to Computer Graphics Lecture #6: Lights. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016

Orthogonal Projection Matrices. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

Pipeline Operations. CS 4620 Lecture 10

TSBK 07! Computer Graphics! Ingemar Ragnemalm, ISY

Simple Lighting/Illumination Models

surface: reflectance transparency, opacity, translucency orientation illumination: location intensity wavelength point-source, diffuse source

The Viewing Pipeline Coordinate Systems

CMSC427 Shading Intro. Credit: slides from Dr. Zwicker

Objectives Shading in OpenGL. Front and Back Faces. OpenGL shading. Introduce the OpenGL shading methods. Discuss polygonal shading

Models and Architectures

From Graphics to Visualization

The Rasterization Pipeline

Lighting and Materials

Shading. Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller/Fuhrmann

Recollection. Models Pixels. Model transformation Viewport transformation Clipping Rasterization Texturing + Lights & shadows

Ray-Tracing. Misha Kazhdan

Light Transport Baoquan Chen 2017

How do we draw a picture?

Sung-Eui Yoon ( 윤성의 )

Virtual Reality for Human Computer Interaction

CS 325 Computer Graphics

Lighting Models. CS116B Chris Pollett Mar 21, 2004.

Color and Shading. Color. Shapiro and Stockman, Chapter 6. Color and Machine Vision. Color and Perception

2001, Denis Zorin. Subdivision Surfaces

Introduction Rasterization Z-buffering Shading. Graphics 2012/2013, 4th quarter. Lecture 09: graphics pipeline (rasterization and shading)

Computer Graphics: 3-Local Illumination Models

Illumination. The slides combine material from Andy van Dam, Spike Hughes, Travis Webb and Lyn Fong

CSE 167: Introduction to Computer Graphics Lecture #6: Colors. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013

Shading. Why we need shading. Scattering. Shading. Objectives

Ambient reflection. Jacobs University Visualization and Computer Graphics Lab : Graphics and Visualization 407

Turn on the Lights: Reflectance

Reading. Shading. An abundance of photons. Introduction. Required: Angel , 6.5, Optional: Angel 6.4 OpenGL red book, chapter 5.

6. Illumination, Lighting

Level of Details in Computer Rendering

Introduction to Visualization and Computer Graphics

Lighting and Shading

Topic 12: Texture Mapping. Motivation Sources of texture Texture coordinates Bump mapping, mip-mapping & env mapping

Objectives. Introduce Phong model Introduce modified Phong model Consider computation of required vectors Discuss polygonal shading.

CS452/552; EE465/505. Intro to Lighting

Graphics for VEs. Ruth Aylett

CHAPTER5. We have learned to build three-dimensional graphical models and to LIGHTING AND SHADING

Interactive Real-Time Raycasting

Chapter 10. Surface-Rendering Methods. Somsak Walairacht, Computer Engineering, KMITL

CS230 : Computer Graphics Lighting and Shading. Tamar Shinar Computer Science & Engineering UC Riverside

Rendering Light Reflection Models

Models and Architectures. Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico

Illumination Model. The governing principles for computing the. Apply the lighting model at a set of points across the entire surface.

Computer Graphics. Illumination Models and Surface-Rendering Methods. Somsak Walairacht, Computer Engineering, KMITL

CSE 167: Lecture #7: Color and Shading. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

Graphics for VEs. Ruth Aylett

Illumination & Shading I

Introduction to Computer Graphics 7. Shading

Transcription:

Visualisatie BMT Rendering Arjan Kok a.j.f.kok@tue.nl 1

Lecture overview Color Rendering Illumination 2

Visualization pipeline Raw Data Data Enrichment/Enhancement Derived Data Visualization Mapping Abstract Visualization Object Rendering Displayable Image 3

Color The electromagnetic spectrum visible to humans contains wavelengths ranging from about 400 to 700 nm Light we see consists of different intensities of these wavelengths 4

Color The human eye contains three receptors (cones): for red, green and blue Color we see is a combination of these Response curves 5

Color systems Color system A way to represent color on a computer Most used: RGB HSV 6

RGB-model 3 primary colors: Red, Green and Blue Color cube: Color = point in cube Additive: C = rr + gg + bb R B G 7

HSV-model More user oriented: based on intuitive perception Hue (0-1 or 0-360 ) Saturation (0-1) Value (0-1) Color is point in cone 8

Rendering How do I generate an image of a scene? Problems: World is complex (shape, light) World is 3 dimensional, screen is 2 dimensional 9

Subdivide problem Geometric modeling How do we define shape of objects? Projection and hidden surface removal How do we determine what is visible on screen and what is not. Shading How do we model color, texture and contribution of light? Rasterization Determine pixel values for visible objects 10

Graphics pipeline Geometric model Viewing Camera parameters Visible surface determination Light sources, materials Shading Rasterize Raster display 11

Raster graphics Currently standard for computer graphics Screen is subdivided in grid of squares : picture elements or pixels Per pixel: n bits information Resolution: size of grid and number of bits per pixel 12

Raster graphics hardware system bus display processor CPU system memory 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 1 1 0 1 0 1 0 1 1 1 0 0 1 0 0 1 1 1 0 0 1 0 0 0 0 0 0 0 1 0 frame buffer video controller monitor 13

Visualization pipeline Raw Data Data Enrichment/Enhancement Derived Data Visualization Mapping Abstract Visualization Object Rendering Displayable Image 14

Graphics pipeline Geometric model Viewing Camera parameters Visible surface determination Light sources, materials Shading Rasterize Raster display 15

Viewing Given a 3D model, how do we project this model on screen? Camera model Eye/view point: From which point do we look to the scene? Target point or viewing direction: Where do we look at? Viewing angles: What lens do we use? 16

The camera 17

Graphics pipeline Geometric model Viewing Camera parameters Visible surface determination Light sources, materials Shading Rasterize Raster display 18

Why illumination 19

Illumination Illumination model Illumination (and therefore color) of point on surface is determined by simulation of light in scene Illumination model is approximation of real light transport Shading method determines for which points illumination is computed determines how illumination for other points is computed 20

Illumination models Model(s) needed for Emission of light Scattering light at surfaces Reception on camera Desired model requirement Accurate Efficient to compute 21

Point light source Emits light equally in all directions Parameters Intensity I L Position P (p x,p y,p z ) Approximation for small light sources P 22

Direction light source Emits light in one direction Can be regarded as point light source at infinity E.g. sun Parameters Intensity I L Direction D (d x,d y,d z ) D 23

Surface illumination When light arrives at surface, it can be Absorbed Reflected Transmitted absorption reflection transmission 24

Reflection model Total intensity on point reflected in certain direction is determined by: Diffusely reflected light Specularly reflected light Reflection of ambient light 25

Diffuse reflection Incoming light is reflected equally in all directions Amount of reflected light depends only on angle of incident light viewer surface 26

Diffuse reflection Lambert law: Reflected energy from a surface is proportional to the cosine of the angle of direction of incoming light and normal of surface I d = k d I L cos(θ) = k d I L (N L) k d is diffuse reflection coefficient viewer N θ V L surface 27

Specular reflection Models reflections of shiny surfaces θ θ 28

Specular reflection Shininess depends on roughness surface Incident light is reflected unequally in all directions Reflection strongest near mirror angle very shiny less shiny 29

Specular reflection / Phong Light intensity observed by viewer depends on angle of incident light and angle to viewer Phong model: I s = k s I L cos n (α) = k s I L (V R) n k s is specular reflection coefficient n is specular reflection exponent θ N θ R L V α 30

Specular reflection / Phong increasing k s increasing n 31

Ambient light Even though parts of scene are not directly lit by light sources, they can still be visible Because of indirect illumination 32

Ambient light Ambient light I A is an approach to this indirect illumination Ambient light is independent of light sources and viewer position Contribution of ambient light I = k a I a k a is ambient reflection coefficient I a is ambient light intensity (constant over scene) 33

Total illumination model Total intensity I total at point P seen by viewer is n ( k cos( θ ) + k cos ( α ) I total = k ai a + I i d i s i ) i n ( k (N L ) + k (V R ) I total = k ai a + I i d i s i ) i θ 1 θ 0 α 0 α 1 34

Total illumination model In previous formula k a, k d dependent on wavelength (different values for R, G and B) Often division into color and reflection coefficient of surface I totaal = I e + k a C a I a + I where: 0 k a, k s, k s 1 (relative amounts) ( n k C cos( θ ) + k C cos ( α ) ) C a is ambient reflected color of surface C d is diffuse reflected color of surface C s is specular reflected color of surface i i d d i s s i 35

Only emission and ambient 36

Including diffuse reflection 37

Including specular reflection 38

Illumination model Given model: Simple Effective Not real world More advanced models possible 39

Shading Illumination model computes illumination for a point on surface But how do we compute the illumination for all points on all (visible) surfaces? Shading methods: Flat shading Gouraud shading Phong shading 40

Normal vectors For illumination model we need normal vectors for the cell center the cell nodes every pixel in the image 41

Normal vectors Cell normals Use the cross product of two cell edges n = v1 v2 v1 v2 Node normals Compute cell normals for neighbor cells Average cell normals n n1 + n2 + n3 + n4 = 4 42

Flat shading Determine illumination for one point on cell (e.g. center) Use this illumination for all points on cell Disadvantages: Does not account for changing direction to light source over polygon Does not account for changing direction to eye over polygon Discontinuity at polygon boundaries (when curved surface approximated by polygon mesh 43

Flat shading 44

Gouraud shading Based on interpolation of illumination values Compute illumination for nodes of cell Algorithm for all nodes of cell get node normal compute node illumination using this normal for all pixels in projection of polygon compute pixel illumination by interpolation of node illuminations 45

Gouraud shading I 2 I 1 y s I A I B I P I I A B = = ( 1 α) I1 + αi 2 y α = y 1 1 y y 2 ( 1 β) I1 + βi2 y β = y 1 1 y y s s 3 I 3 I P = (1 γ)i x γ = x A A A + γi x x P B B 46

Gouraud shading 47

Gouraud shading Advantages Interpolation is simple, hardware implementation Continuous shading Better results for curved surfaces Disadvantages Subtle illumination effects (e.g. highlights) require high subdivision of surface in very small polygons Mach banding 48

Phong shading Based on normal interpolation Compute illumination for each visible point of cell Algorithm for each node of cell get node normal for each pixel in projection of cell compute point normal by interpolation of node normals compute pixel illumination using interpolated normal 49

Phong shading 50

Phong shading Advantages Much better results for curved surfaces Nice highlights No Mach banding Disadvantages Computational expensive Normal interpolation and application of illumination model for each pixel 51

Shading summarized 52

Shading Flat shading 1x application of illumination model per cell 1 color per polygon Gouraud shading 1x application of illumination model per node Interpolated colors Phong shading 1x application of illumination model per pixel Nice highlights Increase computation time Increase quality 53

Graphics pipeline Geometric model Viewing Camera parameters Visible surface determination Light sources, materials Shading Rasterize Raster display 54