Dithering and Rendering. CS116B Chris Pollett Apr 18, 2004.

Similar documents
Graphics and Interaction Surface rendering and shading

Lecture outline Graphics and Interaction Surface rendering and shading. Shading techniques. Introduction. Surface rendering and shading

Illumination Models & Shading

CS5620 Intro to Computer Graphics

How do we draw a picture?

Homework #2. Shading, Ray Tracing, and Texture Mapping

Computer Graphics 1. Chapter 7 (June 17th, 2010, 2-4pm): Shading and rendering. LMU München Medieninformatik Andreas Butz Computergraphik 1 SS2010

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

Shading Techniques Denbigh Starkey

ECS 175 COMPUTER GRAPHICS. Ken Joy.! Winter 2014

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

Illumination and Shading

Pipeline Operations. CS 4620 Lecture 10

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

Lighting Models. CS116B Chris Pollett Mar 21, 2004.

CS Illumination and Shading. Slide 1

Module Contact: Dr Stephen Laycock, CMP Copyright of the University of East Anglia Version 1

9. Illumination and Shading

Mach band effect. The Mach band effect increases the visual unpleasant representation of curved surface using flat shading.

SRM INSTITUTE OF SCIENCE AND TECHNOLOGY

Graphics Hardware and Display Devices

From Graphics to Visualization

CEng 477 Introduction to Computer Graphics Fall

Illumination and Shading

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

Interpolation using scanline algorithm

CS 325 Computer Graphics

Fast Phong Shading by Gary Bishop

Rasterizing triangles

Graphics for VEs. Ruth Aylett

Ray Tracing. CS116B Chris Pollett Apr 20, 2004.

Homework #2. Shading, Projections, Texture Mapping, Ray Tracing, and Bezier Curves

Computer Graphics. Shadows

CS 130 Final. Fall 2015

Lecture 21: Shading. put your trust in my shadow. Judges 9:15

Shading Algorithms. Ron Goldman Department of Computer Science Rice University

TSBK 07! Computer Graphics! Ingemar Ragnemalm, ISY

3D Rasterization II COS 426

Spring 2012 Final. CS184 - Foundations of Computer Graphics. University of California at Berkeley

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

OXFORD ENGINEERING COLLEGE (NAAC Accredited with B Grade) DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING LIST OF QUESTIONS

Graphics for VEs. Ruth Aylett

University of Victoria CSC 305 Shading. Brian Wyvill 2016

Computer Graphics Coursework 1

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

Visualisatie BMT. Rendering. Arjan Kok

Computer Graphics and GPGPU Programming

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

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

Chapter 7 - Light, Materials, Appearance

General Hidden Surface Removal Algorithms. Binghamton University. EngiNet. Thomas J. Watson. School of Engineering and Applied Science CS 460/560

CSE 690: GPGPU. Lecture 2: Understanding the Fabric - Intro to Graphics. Klaus Mueller Stony Brook University Computer Science Department

CS 488. More Shading and Illumination. Luc RENAMBOT

Lecture 17: Shading in OpenGL. CITS3003 Graphics & Animation

Surface Rendering Methods

Illumination and Shading

Topics and things to know about them:

Computer Graphics: 3-Local Illumination Models

So far, we have considered only local models of illumination; they only account for incident light coming directly from the light sources.

CSE Intro to Computer Graphics. ANSWER KEY: Midterm Examination. November 18, Instructor: Sam Buss, UC San Diego

Lighting and Shading

Pipeline Operations. CS 4620 Lecture 14

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

CSE 167: Lecture #8: Lighting. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

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

Introduction to Visualization and Computer Graphics

CS 4620 Midterm, March 21, 2017

Computer Graphics 10 - Shadows

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

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

Surface Graphics. 200 polys 1,000 polys 15,000 polys. an empty foot. - a mesh of spline patches:

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

Methodology for Lecture. Importance of Lighting. Outline. Shading Models. Brief primer on Color. Foundations of Computer Graphics (Spring 2010)

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

Ray-tracing Cont. Ray-tracing

CS 4731: Computer Graphics Lecture 16: Phong Illumination and Shading. Emmanuel Agu

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

CPSC / Illumination and Shading

w Foley, Section16.1 Reading

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

Reflection and Shading

Computer Graphics. Illumination and Shading

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

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

Illumination Models and Shading

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

CS 464 Review. Review of Computer Graphics for Final Exam

Illumination and Shading

CS 130 Exam I. Fall 2015

Lets assume each object has a defined colour. Hence our illumination model is looks unrealistic.

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

Introduction to Computer Graphics 7. Shading

CS 381 Computer Graphics, Fall 2008 Midterm Exam Solutions. The Midterm Exam was given in class on Thursday, October 23, 2008.

CSE528 Computer Graphics: Theory, Algorithms, and Applications

Rendering. Basic Math Review. Rasterizing Lines and Polygons Hidden Surface Remove Multi-pass Rendering with Accumulation Buffers.

Example Examination 2IV

CS 418: Interactive Computer Graphics. Basic Shading in WebGL. Eric Shaffer

Introduction to Computer Graphics with WebGL

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

THE AUSTRALIAN NATIONAL UNIVERSITY Final Examinations(Semester 2) COMP4610/COMP6461 (Computer Graphics) Final Exam

Transcription:

Dithering and Rendering CS116B Chris Pollett Apr 18, 2004.

Outline Dithering Techniques Constant-Intensity Surface Rendering Gouraud Surface Rendering Phong Surface Rendering Fast Phong Surface Rendering

Dithering Techniques Last day, we talked about using dithered noise with intensity values to get halftones without reducing resolution. Another method to do dithering is called ordered dithering. In this method, a dither matrix D n is used. D 2 = 3 1 0 2 D 3 = 7 2 6 4 0 1 3 8 5 D n = 4D n/2 + D 2 (1,1)U n/2 4D n/2 + D 2 (1,2)U n/2 4D n/2 + D 2 (2,1)U n/2 4D n/2 + D 2 (2,2)U n/2 Here U n is the n x n all 1 s matrix. Given a pixel (x,y) and a intensity 0 <= I <= n 2. We calculate j = (x mod n) +1, k = (y mod n) +1 and check if I > D n (j,k). If yes, turn the pixel on, else off.

Still More Dithering Another dithering technique is called error diffusion. In this technique, the error between an input intensity and the selected intensity of a pixel position is spread out to the pixels to the right and below the current pixel position. Suppose I is intensity value in image at (i,j) and I is the intensity we can display at this location. Then we compute E=I-I and add to intensities of neighbors: (i+1,j), (i-1, j+1), (i, j+1), (i+1, j+1); the values a*e, b*e, c*e, d*e. Here we want a+b+c+d <=1. For example, could use a= 7/16, b= 3/16, c= 5/15, d= 1/16. One problem with this technique is that it can cause ghosts on parts of the image to show up.

Constant-Intensity Surface Rendering We want to use our lighting model to compute intensity values for points on our surfaces. Constant surface-rendering or flat surface rendering is probably the fastest way to do this: We assign the same color to all points in a projected surface. It is a reasonable approximation when: The polygon is one face of a polyhedron and is not a section of a curved-surface approximation mesh. All light sources are far enough away that N.L is approximately constant across the surface. The viewing position is far enough so that V.R is approximately constant across the surface. R being the reflected light vector; V being the viewing vector.

Gouraud Surface Rendering We process each polygon in the scene in the following way: 1. Determine the average unit normal vector at each vertex of the polygon (to do this we average the polygon normals of polygons containing this vertex). 2. Apply the lighting model to get an intensity of this vertex. 3. Linearly interpolate the vertex intensities over the projected area of the polygon.

Example of Step 3 3 1 4 P 5 2 I 4 = (y 4 -y 2 )/(y 1 -y 2 )I 1 + (y 1 -y 4 )/(y 1 -y 2 )I 2 Could calculate I 5 similarly. From this, I p =(x 5 -x p )/(x 5 -x 4 )I 4 + (x p -x 4 )/(x 5 -x 4 )I 5 These numbers can be computed incrementally along the scan-line. And similarly, could be incrementally updated between scan-lines.

Phong Surface Rendering A more accurate but slower way to do interpolation is to interpolate the normals across the surface. This is called Phong-surface rendering. In this procedure, we: determine the average unit normal vector at each vertex of the polygon. linearly interpolate the vertex normal over the projected area of the polygon. apply an illumination model to positions along scan lines so as to calculate pixel intensities using the interpolated normals.

Fast Phong Surface Rendering Recalculating intensities for each pixel in the Phong set-up is slow. So instead we try to approximate these calculations using a truncated Taylor-series expansion and by limiting the polygons to be triangles. Let N = Ax+By +C be the normal calculated for position (x,y). Where A,B,C is determined from the 3 vertex normals N k, k=1,2,3. I diff (x,y) = L.N/( L N ) = [(L.A)x+ (L. B)y + (L. C)]/( L Ax+By +C )

More Fast Phong This last expression can be written as: I diff (x,y) = [ax+by+c]/[dx 2 +exy + fy 2 + gx+hx+i] 1/2 for example a = L.A/ L Taylor expanding, this we can write this as: I diff (x,y) = T 5 x 2 + T 4 xy + T 3 y 2 + T 2 x +T 1 y +T 0 where the constant T i can be found in the book. Can do similar tricks to approximate the specular intensity.