# The Rasterization Pipeline

Save this PDF as:

Size: px
Start display at page:

## Transcription

1 Lecture 5: The Rasterization Pipeline Computer Graphics and Imaging UC Berkeley

2 What We ve Covered So Far z x y z x y (0, 0) (w, h) Position objects and the camera in the world Compute position of objects relative to the camera Project objects onto the screen Sample triangle coverage Interpolate triangle attributes Sample texture maps

3 Rotating Cubes in Perspective

4 Rotating Cubes in Perspective

5 What Else Are We Missing? Credit: Bertrand Benoit. Sweet Feast, [Blender /VRay]

6 What Else Are We Missing? Credit: Giuseppe Albergo. Colibri [Blender]

7 What Else Are We Missing? Surface representations Objects in the real world exhibit highly complex geometric details Lighting and materials Appearance is a result of how light sources reflect off complex materials Camera models Real lenses create images with focusing and other optical effects

8 Course Roadmap Rasterization Pipeline Core Concepts Sampling Antialiasing Transforms Intro Rasterization Transforms & Projection Texture Mapping Today: Visibility, Shading, Overall Pipeline Geometric Modeling Lighting & Materials Cameras & Imaging

9 Visibility

10 Painter s Algorithm Inspired by how painters paint Paint from back to front, overwrite in the framebuffer [Wikipedia]

11 Painter s Algorithm Requires sorting in depth (O(n log n) for n triangles) Can have unresolvable depth order [Foley et al.]

12 Z-Buffer This is the hidden-surface-removal algorithm that eventually won. Idea: Store current min. z-value for each sample position Needs an additional buffer for depth values framebuffer stores RBG color values depth buffer (z-buffer) stores depth (16 to 32 bits)

13 Z-Buffer Example Image credit: Dominic Alves, flickr. Rendering Depth buffer

14 Z-Buffer Algorithm Initialize depth buffer to During rasterization: for (each triangle T) for (each sample (x,y,z) in T) if (z < zbuffer[x,y]) framebuffer[x,y] = rgb; // closest sample so far // update color else zbuffer[x,y] = z; // update z ; // do nothing, this simple is not closest

15 Z-Buffer Algorithm

16 Z-Buffer Complexity Complexity O(n) for n triangles How can we sort n triangles in linear time? Most important visibility algorithm Implemented in hardware for all GPUs Used by OpenGL

17 Simple Shading (Blinn-Phong Reflection Model)

18 Simple Shading vs Realistic Lighting & Materials What we will cover today A local shading model: simple, per-pixel, fast Based on perceptual observations, not physics What we will cover later in the course Physics-based lighting and material representations Global light transport simulation

19 Perceptual Observations Specular highlights Diffuse reflection Ambient lighting Photo credit: Jessica Andrews, flickr

20 Local Shading Compute light reflected toward camera Inputs: Viewer direction, v Surface normal, n Light direction, l (for each of many lights) l n v Surface parameters (color, shininess, )

21 Diffuse Reflection Light is scattered uniformly in all directions Surface color is the same for all viewing directions Lambert s cosine law l n Top face of cube receives a certain amount of light Top face of 60º rotated cube intercepts half the light In general, light per unit area is proportional to cos θ = l n

22 Light Falloff r intensity here: I/r 2 1 intensity here: I

23 Lambertian (Diffuse) Shading Shading independent of view direction illumination from source l n L d = k d (I/r 2 ) max(0, n l) v diffuse coefficient diffusely reflected light

24 Lambertian (Diffuse) Shading Produces matte appearance [Foley et al.] k d

25 Specular Shading (Blinn-Phong) Intensity depends on view direction Bright near mirror reflection direction l n v

26 Specular Shading (Blinn-Phong) Close to mirror direction half vector near normal Measure near by dot product of unit vectors h = bisector(v, l) l n h = v + l v + l v L s = k s (I/r 2 ) max(0, cos ) p = k s (I/r 2 ) max(0, n h) p specularly reflected light specular coefficient

27 Cosine Power Plots Increasing p narrows the reflection lobe [Foley et al.]

28 Specular Shading (Blinn-Phong) L s = k s (I/r 2 ) max(0, n h) p k s [Foley et al.] p

29 Ambient Shading Shading that does not depend on anything Add constant color to account for disregarded illumination and fill in black shadows L a = k a I a ambient coefficient reflected ambient light

30 Blinn-Phong Reflection Model Ambient + Diffuse + Specular = Phong Reflection L = L a + L d + L s = k a I a + k d (I/r 2 ) max(0, n l)+k s (I/r 2 ) max(0, n h) p

31 Shading Triangle Meshes

32 Shading Frequency: Triangle, Vertex or Pixel Shade each triangle (flat shading) Triangle face is flat one normal vector Not good for smooth surfaces Shade each vertex ( Gouraud shading) Interpolate colors from vertices across triangle Each vertex has a normal vector Shade each pixel ( Phong shading) Interpolate normal vectors across each triangle Compute full shading model at each pixel

33 Shading Frequency: Face, Vertex or Pixel Num Vertices Shading freq. : Face Vertex Pixel Shading type : Flat Gouraud Phong (*) Image credit: Happyman,

34 Defining Per-Vertex Normal Vectors Best to get vertex normals from the underlying geometry e.g. consider a sphere Otherwise have to infer vertex normals from triangle faces Simple scheme: average surrounding face normals

35 Defining Per-Pixel Normal Vectors Barycentric interpolation of vertex normals Problem: length of vectors?

36 Rasterization Pipeline

37 Rasterization Pipeline Application Input: vertices in 3D space Vertex Processing 2 Vertex Stream Vertices positioned in screen space Triangle Processing Triangle Stream Triangles positioned in screen space Rasterization Fragment Stream Fragments (one per covered sample) Fragment Processing Shaded Fragments Shaded fragments Framebuffer Operations Display Output: image (pixels)

38 Rasterization Pipeline Application Vertex Processing Modeling & viewing transforms Vertex Stream Triangle Processing y Triangle Stream Rasterization z Fragment Stream x Fragment Processing Shaded Fragments Framebuffer Operations Display

39 Rasterization Pipeline Application Vertex Processing Sampling triangle coverage Vertex Stream Triangle Processing Triangle Stream Rasterization Fragment Stream Fragment Processing Shaded Fragments Framebuffer Operations Display

40 Rasterization Pipeline Application Vertex Processing Evaluating shading functions Vertex Stream Triangle Processing Triangle Stream Rasterization Fragment Stream Ambient + Diffuse Fragment Processing Shaded Fragments Framebuffer Operations Display + Specular = Phong Reflection

41 Rasterization Pipeline Application Vertex Processing Texture mapping Vertex Stream Triangle Processing Triangle Stream Rasterization Fragment Stream Fragment Processing Shaded Fragments Framebuffer Operations Display

42 Rasterization Pipeline Application Vertex Processing Z-Buffer Visibility Tests Vertex Stream Triangle Processing Triangle Stream Rasterization Fragment Stream Fragment Processing Shaded Fragments Framebuffer Operations Display

43 Shader Programs Program vertex and fragment processing stages Describe operation on a single vertex (or fragment) Example GLSL fragment shader program uniform sampler2d mytexture; uniform vec3 lightdir; varying vec2 uv; varying vec3 norm; void diffuseshader() { vec3 kd; kd = texture2d(mytexture, uv); kd *= clamp(dot( lightdir, norm), 0.0, 1.0); gl_fragcolor = vec4(kd, 1.0); } Shader function executes once per fragment. Outputs color of surface at the current fragment s screen sample position. This shader performs a texture lookup to obtain the surface s material color at this point, then performs a diffuse lighting calculation.

44 Shader Programs Program vertex and fragment processing stages Describe operation on a single vertex (or fragment) Example GLSL fragment shader program uniform sampler2d mytexture; uniform vec3 lightdir; varying vec2 uv; varying vec3 norm; // program parameter // program parameter // per fragment value (interp. by rasterizer) // per fragment value (interp. by rasterizer) void diffuseshader() { vec3 kd; kd = texture2d(mytexture, uv); kd *= clamp(dot( lightdir, norm), 0.0, 1.0); gl_fragcolor = vec4(kd, 1.0); } // material color from texture // Lambertian shading model // output fragment color

45 Goal: Highly Complex 3D Scenes in Realtime 100 s of thousands to millions of triangles in a scene Complex vertex and fragment shader computations High resolution (2-4 megapixel + supersampling) frames per second (even higher for VR) Unreal Engine Kite Demo (Epic Games 2015)

46 Graphics Pipeline Implementation: GPUs Specialized processors for executing graphics pipeline computations Discrete GPU Card (NVIDIA GeForce Titan X) Integrated GPU: (Part of Intel CPU die)

47 GPU: Heterogeneous, Multi-Core Procesor Modern GPUs offer ~2-4 Tera-FLOPs of performance for executing vertex and fragment shader programs Tera-Op s of fixed-function compute capability over here

48 Things to Remember Visibility Painter s algorithm and Z-Buffer algorithm Simple Shading Model Key geometry: lighting, viewing & normal vectors Ambient, diffuse & specular reflection functions Shading frequency: triangle, vertex or fragment Graphics Rasterization Pipeline Where do transforms, rasterization, shading, texturing and visibility computations occur? GPU = parallel processor implementing graphics pipeline

49 Acknowledgments Thanks to Steve Marschner, Mark Pauly and Kayvon Fatahalian for presentation resources.

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

Shading Models There are two main types of rendering that we cover, polygon rendering ray tracing Polygon rendering is used to apply illumination models to polygons, whereas ray tracing applies to arbitrary

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

CSE 167: Introduction to Computer Graphics Lecture #8: GLSL Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012 Announcements Homework project #4 due Friday, November 2 nd Introduction:

### CS5620 Intro to Computer Graphics

So Far wireframe hidden surfaces Next step 1 2 Light! Need to understand: How lighting works Types of lights Types of surfaces How shading works Shading algorithms What s Missing? Lighting vs. Shading

### CMSC427 Shading Intro. Credit: slides from Dr. Zwicker

CMSC427 Shading Intro Credit: slides from Dr. Zwicker 2 Today Shading Introduction Radiometry & BRDFs Local shading models Light sources Shading strategies Shading Compute interaction of light with surfaces

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

Objectives Shading in OpenGL Introduce the OpenGL shading methods - per vertex shading vs per fragment shading - Where to carry out Discuss polygonal shading - Flat - Smooth - Gouraud CITS3003 Graphics

### Shaders. Slide credit to Prof. Zwicker

Shaders Slide credit to Prof. Zwicker 2 Today Shader programming 3 Complete model Blinn model with several light sources i diffuse specular ambient How is this implemented on the graphics processor (GPU)?

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

Orthogonal Projection Matrices 1 Objectives Derive the projection matrices used for standard orthogonal projections Introduce oblique projections Introduce projection normalization 2 Normalization Rather

### CPSC 314 LIGHTING AND SHADING

CPSC 314 LIGHTING AND SHADING UGRAD.CS.UBC.CA/~CS314 slide credits: Mikhail Bessmeltsev et al 1 THE RENDERING PIPELINE Vertices and attributes Vertex Shader Modelview transform Per-vertex attributes Vertex

### Illumination and Shading

Illumination and Shading Illumination (Lighting)! Model the interaction of light with surface points to determine their final color and brightness! The illumination can be computed either at vertices or

### Computer Graphics. Illumination and Shading

() Illumination and Shading Dr. Ayman Eldeib Lighting So given a 3-D triangle and a 3-D viewpoint, we can set the right pixels But what color should those pixels be? If we re attempting to create a realistic

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

CSE 167: Introduction to Computer Graphics Lecture #7: Color and Shading Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011 Announcements Homework project #3 due this Friday,

### COMP environment mapping Mar. 12, r = 2n(n v) v

Rendering mirror surfaces The next texture mapping method assumes we have a mirror surface, or at least a reflectance function that contains a mirror component. Examples might be a car window or hood,

### graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1 graphics pipeline sequence of operations to generate an image using object-order processing primitives processed one-at-a-time

### Rasterization Overview

Rendering Overview The process of generating an image given a virtual camera objects light sources Various techniques rasterization (topic of this course) raytracing (topic of the course Advanced Computer

### LIGHTING AND SHADING

DH2323 DGI15 INTRODUCTION TO COMPUTER GRAPHICS AND INTERACTION LIGHTING AND SHADING Christopher Peters HPCViz, KTH Royal Institute of Technology, Sweden chpeters@kth.se http://kth.academia.edu/christopheredwardpeters

### CMSC427 Advanced shading getting global illumination by local methods. Credit: slides Prof. Zwicker

CMSC427 Advanced shading getting global illumination by local methods Credit: slides Prof. Zwicker Topics Shadows Environment maps Reflection mapping Irradiance environment maps Ambient occlusion Reflection

### Deferred Rendering Due: Wednesday November 15 at 10pm

CMSC 23700 Autumn 2017 Introduction to Computer Graphics Project 4 November 2, 2017 Deferred Rendering Due: Wednesday November 15 at 10pm 1 Summary This assignment uses the same application architecture

### Evolution of GPUs Chris Seitz

Evolution of GPUs Chris Seitz Overview Concepts: Real-time rendering Hardware graphics pipeline Evolution of the PC hardware graphics pipeline: 1995-1998: Texture mapping and z-buffer 1998: Multitexturing

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

Introduction to Computer Graphics Farhana Bandukwala, PhD Lecture 14: Light Interacting with Surfaces Outline Computational tools Reflection models Polygon shading Computation tools Surface normals Vector

### Illumination & Shading

Illumination & Shading Goals Introduce the types of light-material interactions Build a simple reflection model---the Phong model--- that can be used with real time graphics hardware Why we need Illumination

### C P S C 314 S H A D E R S, O P E N G L, & J S RENDERING PIPELINE. Mikhail Bessmeltsev

C P S C 314 S H A D E R S, O P E N G L, & J S RENDERING PIPELINE UGRAD.CS.UBC.C A/~CS314 Mikhail Bessmeltsev 1 WHAT IS RENDERING? Generating image from a 3D scene 2 WHAT IS RENDERING? Generating image

### CS GPU and GPGPU Programming Lecture 7: Shading and Compute APIs 1. Markus Hadwiger, KAUST

CS 380 - GPU and GPGPU Programming Lecture 7: Shading and Compute APIs 1 Markus Hadwiger, KAUST Reading Assignment #4 (until Feb. 23) Read (required): Programming Massively Parallel Processors book, Chapter

### Shading and Illumination

Shading and Illumination OpenGL Shading Without Shading With Shading Physics Bidirectional Reflectance Distribution Function (BRDF) f r (ω i,ω ) = dl(ω ) L(ω i )cosθ i dω i = dl(ω ) L(ω i )( ω i n)dω

### Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

Computergrafik Matthias Zwicker Universität Bern Herbst 2016 Today More shading Environment maps Reflection mapping Irradiance environment maps Ambient occlusion Reflection and refraction Toon shading

### 03 RENDERING PART TWO

03 RENDERING PART TWO WHAT WE HAVE SO FAR: GEOMETRY AFTER TRANSFORMATION AND SOME BASIC CLIPPING / CULLING TEXTURES AND MAPPING MATERIAL VISUALLY DISTINGUISHES 2 OBJECTS WITH IDENTICAL GEOMETRY FOR NOW,

### 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 Spot the differences Terminology Illumination The transport

### Comp 410/510 Computer Graphics. Spring Shading

Comp 410/510 Computer Graphics Spring 2017 Shading Why we need shading Suppose we build a model of a sphere using many polygons and then color it using a fixed color. We get something like But we rather

### The Traditional Graphics Pipeline

Last Time? The Traditional Graphics Pipeline Reading for Today A Practical Model for Subsurface Light Transport, Jensen, Marschner, Levoy, & Hanrahan, SIGGRAPH 2001 Participating Media Measuring BRDFs

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

Foundations of Computer Graphics (Spring 2010) CS 184, Lecture 11: OpenGL 3 http://inst.eecs.berkeley.edu/~cs184 Methodology for Lecture Lecture deals with lighting (teapot shaded as in HW1) Some Nate

### Spring 2009 Prof. Hyesoon Kim

Spring 2009 Prof. Hyesoon Kim Application Geometry Rasterizer CPU Each stage cane be also pipelined The slowest of the pipeline stage determines the rendering speed. Frames per second (fps) Executes on

### Lessons Learned from HW4. Shading. Objectives. Why we need shading. Shading. Scattering

Lessons Learned from HW Shading CS Interactive Computer Graphics Prof. David E. Breen Department of Computer Science Only have an idle() function if something is animated Set idle function to NULL, when

### GLSL Introduction. Fu-Chung Huang. Thanks for materials from many other people

GLSL Introduction Fu-Chung Huang Thanks for materials from many other people Programmable Shaders //per vertex inputs from main attribute aposition; attribute anormal; //outputs to frag. program varying

### Interpolation using scanline algorithm

Interpolation using scanline algorithm Idea: Exploit knowledge about already computed color values. Traverse projected triangle top-down using scanline. Compute start and end color value of each pixel

### Light Sources. Spotlight model

lecture 12 Light Sources sunlight (parallel) Sunny day model : "point source at infinity" - lighting - materials: diffuse, specular, ambient spotlight - shading: Flat vs. Gouraud vs Phong light bulb ambient

### Illumination & Shading I

CS 543: Computer Graphics Illumination & Shading I Robert W. Lindeman Associate Professor Interactive Media & Game Development Department of Computer Science Worcester Polytechnic Institute gogo@wpi.edu

### Rendering Light Reflection Models

Rendering Light Reflection Models Visual Imaging in the Electronic Age Donald P. Greenberg October 3, 2017 Lecture #13 Program of Computer Graphics, Cornell University General Electric - 167 Cornell in

### CSE 681 Illumination and Phong Shading

CSE 681 Illumination and Phong Shading Physics tells us What is Light? We don t see objects, we see light reflected off of objects Light is a particle and a wave The frequency of light What is Color? Our

### Lighting and Shading. Slides: Tamar Shinar, Victor Zordon

Lighting and Shading Slides: Tamar Shinar, Victor Zordon Why we need shading Suppose we build a model of a sphere using many polygons and color each the same color. We get something like But we want 2

### Illumination and Shading

Illumination and Shading Computer Graphics COMP 770 (236) Spring 2007 Instructor: Brandon Lloyd 2/14/07 1 From last time Texture mapping overview notation wrapping Perspective-correct interpolation Texture

### OPENGL RENDERING PIPELINE

CPSC 314 03 SHADERS, OPENGL, & JS UGRAD.CS.UBC.CA/~CS314 Textbook: Appendix A* (helpful, but different version of OpenGL) Alla Sheffer Sep 2016 OPENGL RENDERING PIPELINE 1 OPENGL RENDERING PIPELINE Javascript

### Rendering Algorithms: Real-time indirect illumination. Spring 2010 Matthias Zwicker

Rendering Algorithms: Real-time indirect illumination Spring 2010 Matthias Zwicker Today Real-time indirect illumination Ray tracing vs. Rasterization Screen space techniques Visibility & shadows Instant

### Photorealism: Ray Tracing

Photorealism: Ray Tracing Reading Assignment: Chapter 13 Local vs. Global Illumination Local Illumination depends on local object and light sources only Global Illumination at a point can depend on any

### CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

CENG 477 Introduction to Computer Graphics Ray Tracing: Shading Last Week Until now we learned: How to create the primary rays from the given camera and image plane parameters How to intersect these rays

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

Computer Graphics 1 Chapter 7 (June 17th, 2010, 2-4pm): Shading and rendering 1 The 3D rendering pipeline (our version for this class) 3D models in model coordinates 3D models in world coordinates 2D Polygons

### Computer Graphics. Lecture 9 Environment mapping, Mirroring

Computer Graphics Lecture 9 Environment mapping, Mirroring Today Environment Mapping Introduction Cubic mapping Sphere mapping refractive mapping Mirroring Introduction reflection first stencil buffer

### Illumination. Illumination CMSC 435/634

Illumination CMSC 435/634 Illumination Interpolation Illumination Illumination Interpolation Illumination Illumination Effect of light on objects Mostly look just at intensity Apply to each color channel

### Introduction to 3D Graphics

Introduction to 3D Graphics Using OpenGL 3D 1/46 Classical Polygon Graphics (H/W) Pipeline Mesh objects with 3D polygons (triangles or quads usually) Apply material properties to each object (for reflectance

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

15-462 Computer Graphics I Lecture 7 Lighting and Shading February 12, 2002 Frank Pfenning Carnegie Mellon University http://www.cs.cmu.edu/~fp/courses/graphics/ Light Sources Phong Illumination Model

### - Rasterization. Geometry. Scan Conversion. Rasterization

Computer Graphics - The graphics pipeline - Geometry Modelview Geometry Processing Lighting Perspective Clipping Scan Conversion Texturing Fragment Tests Blending Framebuffer Fragment Processing - So far,

### Review for Ray-tracing Algorithm and Hardware

Review for Ray-tracing Algorithm and Hardware Reporter: 邱敬捷博士候選人 Lan-Da Van ( 范倫達 ), Ph. D. Department of Computer Science National Chiao Tung University Taiwan, R.O.C. Summer, 2017 1 2017/7/26 Outline

### 3D Programming. 3D Programming Concepts. Outline. 3D Concepts. 3D Concepts -- Coordinate Systems. 3D Concepts Displaying 3D Models

3D Programming Concepts Outline 3D Concepts Displaying 3D Models 3D Programming CS 4390 3D Computer 1 2 3D Concepts 3D Model is a 3D simulation of an object. Coordinate Systems 3D Models 3D Shapes 3D Concepts

### CEng 477 Introduction to Computer Graphics Fall

Illumination Models and Surface-Rendering Methods CEng 477 Introduction to Computer Graphics Fall 2007 2008 Illumination Models and Surface Rendering Methods In order to achieve realism in computer generated

### Instructor. Goals. Image Synthesis Examples. Applications. Foundations of Computer Graphics. Why Study 3D Computer Graphics?

Foundations of Computer Graphics Motivation: Why do we study 3D Graphics? http://www.cs.berkeley.edu/~ravir Instructor http://www.cs.berkeley.edu/~ravir PhD Stanford, 2002. PhD thesis developed Spherical

### Announcements. Written Assignment 2 out (due March 8) Computer Graphics

Announcements Written Assignment 2 out (due March 8) 1 Advanced Ray Tracing (Recursive) Ray Tracing Antialiasing Motion Blur Distribution Ray Tracing Ray Tracing and Radiosity Assumptions Simple shading

### Radiance. Radiance properties. Radiance properties. Computer Graphics (Fall 2008)

Computer Graphics (Fall 2008) COMS 4160, Lecture 19: Illumination and Shading 2 http://www.cs.columbia.edu/~cs4160 Radiance Power per unit projected area perpendicular to the ray per unit solid angle in

### Computer Science 175. Introduction to Computer Graphics lib175 time: m/w 2:30-4:00 pm place:md g125 section times: tba

Computer Science 175 Introduction to Computer Graphics www.fas.harvard.edu/ lib175 time: m/w 2:30-4:00 pm place:md g125 section times: tba Instructor: Steven shlomo Gortler www.cs.harvard.edu/ sjg sjg@cs.harvard.edu

### I expect to interact in class with the students, so I expect students to be engaged. (no laptops, smartphones,...) (fig)

Computer Science 175 Introduction to Computer Graphics www.fas.harvard.edu/ lib175 time: m/w 2:30-4:00 pm place:md g125 section times: tba Instructor: Steven shlomo Gortler www.cs.harvard.edu/ sjg sjg@cs.harvard.edu

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

Color and Light CSCI 4229/5229 Computer Graphics Summer 2008 Solar Spectrum Human Trichromatic Color Perception Are A and B the same? Color perception is relative Transmission,Absorption&Reflection Light

### Computergraphics Exercise 15/ Shading & Texturing

Computergraphics Exercise 15/16 3. Shading & Texturing Jakob Wagner for internal use only Shaders Vertex Specification define vertex format & data in model space Vertex Processing transform to clip space

### Surface Reflection Models

Surface Reflection Models Frank Losasso (flosasso@nvidia.com) Introduction One of the fundamental topics in lighting is how the light interacts with the environment. The academic community has researched

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

Surface Graphics Objects are explicitely defined by a surface or boundary representation (explicit inside vs outside) This boundary representation can be given by: - a mesh of polygons: 200 polys 1,000

### Illumination and Shading

Illumination and Shading Illumination and Shading z Illumination Models y Ambient y Diffuse y Attenuation y Specular Reflection z Interpolated Shading Models y Flat, Gouraud, Phong y Problems CS4451: Fall

### Turn on the Lights: Reflectance

Turn on the Lights: Reflectance Part 2: Shading Tuesday, October 15 2012 Lecture #14 Goal of Shading Model simple light sources Point light sources Extended light sources Ambient lighting Model lighting

### Parallelizing Graphics Pipeline Execution (+ Basics of Characterizing a Rendering Workload)

Lecture 2: Parallelizing Graphics Pipeline Execution (+ Basics of Characterizing a Rendering Workload) Visual Computing Systems Today Finishing up from last time Brief discussion of graphics workload metrics

### 6.837 Introduction to Computer Graphics Assignment 5: OpenGL and Solid Textures Due Wednesday October 22, 2003 at 11:59pm

6.837 Introduction to Computer Graphics Assignment 5: OpenGL and Solid Textures Due Wednesday October 22, 2003 at 11:59pm In this assignment, you will add an interactive preview of the scene and solid

### Illumination and Shading

Illumination and Shading Light sources emit intensity: assigns intensity to each wavelength of light Humans perceive as a colour - navy blue, light green, etc. Exeriments show that there are distinct I

### Levy: Constraint Texture Mapping, SIGGRAPH, CS 148, Summer 2012 Introduction to Computer Graphics and Imaging Justin Solomon

Levy: Constraint Texture Mapping, SIGGRAPH, 2001 CS 148, Summer 2012 Introduction to Computer Graphics and Imaging Justin Solomon Instructor: Justin Solomon Email: justin.solomon@stanford.edu Office: Clark

### Graphics Processing Unit Architecture (GPU Arch)

Graphics Processing Unit Architecture (GPU Arch) With a focus on NVIDIA GeForce 6800 GPU 1 What is a GPU From Wikipedia : A specialized processor efficient at manipulating and displaying computer graphics

### Computer Graphics Lecture 11

1 / 14 Computer Graphics Lecture 11 Dr. Marc Eduard Frîncu West University of Timisoara May 15th 2012 2 / 14 Outline 1 Introduction 2 Transparency 3 Reflection 4 Recap 3 / 14 Introduction light = local

### Classic Rendering Pipeline

CS580: Classic Rendering Pipeline Sung-Eui Yoon ( 윤성의 ) Course URL: http://sglab.kaist.ac.kr/~sungeui/gcg/ Course Objectives Understand classic rendering pipeline Just high-level concepts, not all the

### Projective Textures & Shadow Mapping. Prof. Aaron Lanterman School of Electrical and Computer Engineering Georgia Institute of Technology

Projective Textures & Shadow Mapping Prof. Aaron Lanterman School of Electrical and Computer Engineering Georgia Institute of Technology What is projective texturing? An intuition for projective texturing

### Three-Dimensional Graphics V. Guoying Zhao 1 / 55

Computer Graphics Three-Dimensional Graphics V Guoying Zhao 1 / 55 Shading Guoying Zhao 2 / 55 Objectives Learn to shade objects so their images appear three-dimensional Introduce the types of light-material

### Technical Game Development II. Reference: Rost, OpenGL Shading Language, 2nd Ed., AW, 2006 The Orange Book Also take CS 4731 Computer Graphics

Shader Programming Technical Game Development II Professor Charles Rich Computer Science Department rich@wpi.edu Reference: Rost, OpenGL Shading Language, 2nd Ed., AW, 2006 The Orange Book Also take CS

### Lecture 2. Shaders, GLSL and GPGPU

Lecture 2 Shaders, GLSL and GPGPU Is it interesting to do GPU computing with graphics APIs today? Lecture overview Why care about shaders for computing? Shaders for graphics GLSL Computing with shaders

### Mali Demos: Behind the Pixels. Stacy Smith

Mali Demos: Behind the Pixels Stacy Smith Mali Graphics: Behind the demos Mali Demo Team: Doug Day Stacy Smith (Me) Sylwester Bala Roberto Lopez Mendez PHOTOGRAPH UNAVAILABLE These days I spend more time

### TEXTURE MAPPING. DVA338 Computer Graphics Thomas Larsson, Afshin Ameri

TEXTURE MAPPING DVA338 Computer Graphics Thomas Larsson, Afshin Ameri OVERVIEW Motivation Texture Mapping Coordinate Mapping (2D, 3D) Perspective Correct Interpolation Texture Filtering Mip-mapping Anisotropic

### Supplement to Lecture 22

Supplement to Lecture 22 Programmable GPUs Programmable Pipelines Introduce programmable pipelines - Vertex shaders - Fragment shaders Introduce shading languages - Needed to describe shaders - RenderMan

### Programmable GPUS. Last Time? Reading for Today. Homework 4. Planar Shadows Projective Texture Shadows Shadow Maps Shadow Volumes

Last Time? Programmable GPUS Planar Shadows Projective Texture Shadows Shadow Maps Shadow Volumes frame buffer depth buffer stencil buffer Stencil Buffer Homework 4 Reading for Create some geometry "Rendering

### Shading, lighting, & BRDF Theory. Cliff Lindsay, PHD

Shading, lighting, & BRDF Theory Cliff Lindsay, PHD Overview of today s lecture BRDF Characteristics Lights in terms of BRDFs Classes of BRDFs Ambient light & Shadows in terms of BRDFs Decomposing Reflection

### OpenGL shaders and programming models that provide object persistence

OpenGL shaders and programming models that provide object persistence COSC342 Lecture 22 19 May 2016 OpenGL shaders We discussed forms of local illumination in the ray tracing lectures. We also saw that

### WebGL and GLSL Basics. CS559 Fall 2015 Lecture 10 October 6, 2015

WebGL and GLSL Basics CS559 Fall 2015 Lecture 10 October 6, 2015 Last time Hardware Rasterization For each point: Compute barycentric coords Decide if in or out.7,.7, -.4 1.1, 0, -.1.9,.05,.05.33,.33,.33

### Summary. What is Computer Graphics? IRISA 2. Coordinate systems. 4. Geometric transformations for display

Summary Basic Computer Graphics Kadi Bouatouch IRISA Email: kadi@irisa.fr 1. Introduction 2. Coordinate systems 3. Geometric transformations 4. Geometric transformations for display 5. Choosing the camera

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

Models and Architectures Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico 1 Objectives Learn the basic design of a graphics system Introduce

### Computer Graphics and Visualization. What is computer graphics?

CSCI 120 Computer Graphics and Visualization Shiaofen Fang Department of Computer and Information Science Indiana University Purdue University Indianapolis What is computer graphics? Computer graphics

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

CSE 167 - Intro to Computer Graphics ANSWER KEY: Midterm Examination November 18, 2003 Instructor: Sam Buss, UC San Diego Write your name or initials on every page before beginning the exam. You have 75

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

CSE 167: Introduction to Computer Graphics Lecture #8: Textures Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2016 Announcements Project 2 due this Friday Midterm next Tuesday

### Computer Graphics. Lecture 13. Global Illumination 1: Ray Tracing and Radiosity. Taku Komura

Computer Graphics Lecture 13 Global Illumination 1: Ray Tracing and Radiosity Taku Komura 1 Rendering techniques Can be classified as Local Illumination techniques Global Illumination techniques Local

### Texture Mapping. CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science

Texture Mapping CS 537 Interactive Computer Graphics Prof. David E. Breen Department of Computer Science 1 Objectives Introduce Mapping Methods - Texture Mapping - Environment Mapping - Bump Mapping Consider

### CS130 : Computer Graphics Lecture 2: Graphics Pipeline. Tamar Shinar Computer Science & Engineering UC Riverside

CS130 : Computer Graphics Lecture 2: Graphics Pipeline Tamar Shinar Computer Science & Engineering UC Riverside Raster Devices and Images Raster Devices - raster displays show images as a rectangular array

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

CSE 690: GPGPU Lecture 2: Understanding the Fabric - Intro to Graphics Klaus Mueller Stony Brook University Computer Science Department Klaus Mueller, Stony Brook 2005 1 Surface Graphics Objects are explicitely

### Graphics Hardware. Instructor Stephen J. Guy

Instructor Stephen J. Guy Overview What is a GPU Evolution of GPU GPU Design Modern Features Programmability! Programming Examples Overview What is a GPU Evolution of GPU GPU Design Modern Features Programmability!

### CS452/552; EE465/505. Lighting & Shading

CS452/552; EE465/505 Lighting & Shading 2-17 15 Outline! More on Lighting and Shading Read: Angel Chapter 6 Lab2: due tonight use ASDW to move a 2D shape around; 1 to center Local Illumination! Approximate

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

11 11.1 Basics So far, we have considered only local models of illumination; they only account for incident light coming directly from the light sources. Global models include incident light that arrives

### CS 5625 Lec 2: Shading Models

CS 5625 Lec 2: Shading Models Kavita Bala Spring 2013 Shading Models Chapter 7 Next few weeks Textures Graphics Pipeline Light Emission To compute images What are the light sources? Light Propagation Fog/Clear?

### Lecture 10: Shading Languages. Kayvon Fatahalian CMU : Graphics and Imaging Architectures (Fall 2011)

Lecture 10: Shading Languages Kayvon Fatahalian CMU 15-869: Graphics and Imaging Architectures (Fall 2011) Review: role of shading languages Renderer handles surface visibility tasks - Examples: clip,

### From Vertices to Fragments: Rasterization. Reading Assignment: Chapter 7. Special memory where pixel colors are stored.

From Vertices to Fragments: Rasterization Reading Assignment: Chapter 7 Frame Buffer Special memory where pixel colors are stored. System Bus CPU Main Memory Graphics Card -- Graphics Processing Unit (GPU)

### Computer Graphics I. Assignment 3

UNIVERSITÄT DES SAARLANDES Dr.-Ing. Hendrik P.A. Lensch Max Planck Institut Informatik Art Tevs (tevs@mpi-inf.mpg.de) Boris Ajdin (bajdin@mpi-inf.mpg.de) Matthias Hullin (hullin@mpi-inf.mpg.de) 12. November