CS230 : Computer Graphics Lecture 4. Tamar Shinar Computer Science & Engineering UC Riverside

Similar documents
CS130 : Computer Graphics. Tamar Shinar Computer Science & Engineering UC Riverside

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

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

Pipeline Operations. CS 4620 Lecture 10

Pipeline Operations. CS 4620 Lecture 14

CHAPTER 1 Graphics Systems and Models 3

CS 498 VR. Lecture 19-4/9/18. go.illinois.edu/vrlect19

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

Interactive Computer Graphics A TOP-DOWN APPROACH WITH SHADER-BASED OPENGL

CS451Real-time Rendering Pipeline

CS 130 Final. Fall 2015

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

CS452/552; EE465/505. Clipping & Scan Conversion

CS 130 Exam I. Fall 2015

CS 130 Exam I. Fall 2015

CS 464 Review. Review of Computer Graphics for Final Exam

Models and Architectures

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

CSC 8470 Computer Graphics. What is Computer Graphics?

Lecturer Athanasios Nikolaidis

CS 4620 Program 3: Pipeline

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

Computer Graphics I Lecture 11

Rendering approaches. 1.image-oriented. 2.object-oriented. foreach pixel... 3D rendering pipeline. foreach object...

GLOBAL EDITION. Interactive Computer Graphics. A Top-Down Approach with WebGL SEVENTH EDITION. Edward Angel Dave Shreiner

Interpolation using scanline algorithm

Introduction to Computer Graphics with WebGL

Spring 2009 Prof. Hyesoon Kim

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

Lecture 2. Shaders, GLSL and GPGPU

Computer Graphics Shadow Algorithms

Graphics and Interaction Rendering pipeline & object modelling

Graphics Hardware. Instructor Stephen J. Guy

Graphics Hardware and Display Devices

Module 13C: Using The 3D Graphics APIs OpenGL ES

CS427 Multicore Architecture and Parallel Computing

- Location: Annenberg Text: Mostly Self-Contained on course Web pages. - Al Barr

Rasterization Overview

Computer Graphics. Shadows

PROFESSIONAL. WebGL Programming DEVELOPING 3D GRAPHICS FOR THE WEB. Andreas Anyuru WILEY. John Wiley & Sons, Ltd.

Enhancing Traditional Rasterization Graphics with Ray Tracing. October 2015

Rendering Objects. Need to transform all geometry then

CHETTINAD COLLEGE OF ENGINEERING & TECHNOLOGY CS2401 COMPUTER GRAPHICS QUESTION BANK

CSE 167: Introduction to Computer Graphics Lecture #5: Visibility, OpenGL

CIS 581 Interactive Computer Graphics

Today s Agenda. Basic design of a graphics system. Introduction to OpenGL

The Traditional Graphics Pipeline

COMP30019 Graphics and Interaction Rendering pipeline & object modelling

Lecture outline. COMP30019 Graphics and Interaction Rendering pipeline & object modelling. Introduction to modelling

Last Time: Acceleration Data Structures for Ray Tracing. Schedule. Today. Shadows & Light Sources. Shadows

The Traditional Graphics Pipeline

3D Rasterization II COS 426

Computer Graphics. Lecture 02 Graphics Pipeline. Edirlei Soares de Lima.

Three Main Themes of Computer Graphics

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

The Rasterization Pipeline

6.837 Introduction to Computer Graphics Final Exam Tuesday, December 20, :05-12pm Two hand-written sheet of notes (4 pages) allowed 1 SSD [ /17]

Level of Details in Computer Rendering

- Rasterization. Geometry. Scan Conversion. Rasterization

Drawing Fast The Graphics Pipeline

Spring 2011 Prof. Hyesoon Kim

Computer Graphics (CS 543) Lecture 10: Soft Shadows (Maps and Volumes), Normal and Bump Mapping

CS GPU and GPGPU Programming Lecture 2: Introduction; GPU Architecture 1. Markus Hadwiger, KAUST

CSE4030 Introduction to Computer Graphics

DEFERRED RENDERING STEFAN MÜLLER ARISONA, ETH ZURICH SMA/

Computer Graphics (CS 543) Lecture 1 (Part 1): Introduction to Computer Graphics

Graphics Processing Unit Architecture (GPU Arch)

lecture 19 Shadows - ray tracing - shadow mapping - ambient occlusion Interreflections

Real-Time Rendering (Echtzeitgraphik) Michael Wimmer

The Traditional Graphics Pipeline

CSC Graphics Programming. Budditha Hettige Department of Statistics and Computer Science

Introduction to OpenGL

2: Introducing image synthesis. Some orientation how did we get here? Graphics system architecture Overview of OpenGL / GLU / GLUT

CS 498 VR. Lecture 18-4/4/18. go.illinois.edu/vrlect18

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

Chapter 7 - Light, Materials, Appearance

lecture 18 - ray tracing - environment mapping - refraction

Recall: Indexing into Cube Map

CPSC GLOBAL ILLUMINATION

Particle systems, collision detection, and ray tracing. Computer Graphics CSE 167 Lecture 17

2D Drawing Primitives

Computer Graphics 10 - Shadows

OpenGl Pipeline. triangles, lines, points, images. Per-vertex ops. Primitive assembly. Texturing. Rasterization. Per-fragment ops.

Soft shadows. Steve Marschner Cornell University CS 569 Spring 2008, 21 February

Graphics Programming. Computer Graphics, VT 2016 Lecture 2, Chapter 2. Fredrik Nysjö Centre for Image analysis Uppsala University

Tutorial on GPU Programming #2. Joong-Youn Lee Supercomputing Center, KISTI

Hardware Accelerated Volume Visualization. Leonid I. Dimitrov & Milos Sramek GMI Austrian Academy of Sciences

Adaptive Point Cloud Rendering

Shaders. Slide credit to Prof. Zwicker

ERKELEY DAVIS IRVINE LOS ANGELES RIVERSIDE SAN DIEGO SAN FRANCISCO EECS 104. Fundamentals of Computer Graphics. OpenGL

CS4620/5620: Lecture 14 Pipeline

CSE 167: Introduction to Computer Graphics Lecture #5: Illumination Model

Computer Graphics CS 543 Lecture 1 (Part I) Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Next-Generation Graphics on Larrabee. Tim Foley Intel Corp

The Graphics Pipeline

CMSC427 Final Practice v2 Fall 2017

Deferred Rendering Due: Wednesday November 15 at 10pm

COMP371 COMPUTER GRAPHICS

Institutionen för systemteknik

Transcription:

CS230 : Computer Graphics Lecture 4 Tamar Shinar Computer Science & Engineering UC Riverside

Shadows

Shadows for each pixel do compute viewing ray if ( ray hits an object with t in [0, inf] ) then compute n evaluate shading model and set pixel to that color else set pixel color to the background color

Shadows for each pixel do compute viewing ray if ( ray hits an object with t in [0, inf] ) then compute n evaluate shading model and set pixel to that color else set pixel color to the background color

Shadows for each pixel do compute viewing ray if ( ray hits an object with t in [0, inf] ) then compute n // e.g., phong shading for each light add light s ambient component compute shadow ray if (! shadow ray hits an object ) add light s diffuse and specular components else set pixel color to the background color

- Reflective_Shader subclass of Phong shader Reflections

Reflections for each pixel do compute viewing ray if ( ray hits an object with t in [0, inf] ) then compute n evaluate shading model and set pixel to that color else set pixel color to the background color

Reflections for each pixel do compute viewing ray if ( ray hits an object with t in [0, inf] ) then compute n evaluate shading model and set pixel to that color else set pixel color to the background color

Reflections for each pixel do compute viewing ray pixel color = cast_ray(viewing ray) cast_ray: if ( ray hits an object with t in [0, inf] ) then compute n return color = shade_surface else return color = to the background color shade_surface: color =... compute reflected ray return color = color + k * cast_ray(reflected ray)

Distribution Ray Tracing

Anti-aliasing [Shirley and Marschner]

Soft Shadows [Shirley and Marschner]

Soft Focus [Shirley and Marschner]

[Shirley and Marschner]

Fuzzy Reflections [Shirley and Marschner]

Motion Blur [Shirley and Marschner]

Acceleration Structures

Acceleration Structures [Shirley and Marschner]

Bounding boxes [Shirley and Marschner]

Uniform Spatial Partitioning [Shirley and Marschner]

Bounding Volume Hierarchy [Shirley and Marschner]

Graphics Pipeline

Z-buffer Rendering Z-buffering is very common approach, also often accelerated with hardware OpenGL is based on this approach 3D Polygons GRAPHICS PIPELINE Image Pixels 23

Pipelining operations An arithmetic pipeline that computes c+(a*b) a b * + c By pipelining the arithmetic operation, the throughput, or rate at which data flows through the system, has been doubled If the pipeline had more boxes, the latency, or time it takes one datum to pass through the system, would be higher throughput and latency must be balanced

3D graphics pipeline Vertices Vertex processor Clipper and primitive assembler Rasterizer Fragment processor Pixels Geometry: objects - made of primitives - made of vertices Vertex processing: coordinate transformations and color Clipping and primitive assembly: output is a set of primitives Rasterization: output is a set of fragments for each primitive Fragment processing: update pixels in the frame buffer the pipeline is best when we are doing the same operations on many data sets -- good for computer graphics!! where we process larges sets of vertices and pixels in the same manner 1. Geometry: objects - made of primitives - made of vertices 2. Vertex processing: coordinate transformations and color 3. Clipping and primitive assembly: use clipping volume. must be primitive by primitive rather than vertex by vertex. therefore vertices must be assembled into primitives before clipping can take place. Output is a set of primitives. 4. Rasterization: primitives are still in terms of vertices -- must be converted to pixels. E.g., for a triangle specificied by 3 vertices, the rasterizer must figure out which pixels in the frame buffer fill the triangle. Output is a set of fragments for each primitive. A fragment is like a potential pixel. Fragments can carry depth information used to figure out if they lie behind other fragments for a given pixel. 5. Fragment processing: update pixels in the frame buffer. some fragments may not be visible. texture mapping and bump mapping. blending.

3D graphics pipeline optimized for drawing 3D triangles with shared vertices map 3D vertex locations to 2D screen locations shade triangles and draw them in back to front order using a z-buffer speed depends on # of triangles most operations on vertices can be represented using a 4D coordinate space - 3D position + homogeneous coordinate for perspective viewing 4x4 matrices and 4-vectors - use varying level of detail - fewer triangles for distant objects 1. construct shapes from primitives - points, lines, polygons, images, bitmaps, (mathematical descriptions of objects) - specify the model

Primitives and Attributes

Choice of primitives Which primitives should an API contain? small set - supported by hardware, or lots of primitives - convenient for user

Choice of primitives Which primitives should an API contain? small set - supported by hardware lots of primitives - convenient for user Performance is in 10s millions polygons/sec -- portability, hardware support key

Choice of primitives Which primitives should an API contain? small set - supported by hardware lots of primitives - convenient for user GPUs are optimized for points, lines, and triangles

Choice of primitives Which primitives should an API contain? small set - supported by hardware lots of primitives - convenient for user GPUs are optimized for points, lines, and triangles Other geometric shapes will be built out of these

Two classes of primitives Angel and Shreiner Geometric : points, lines, polygons Image : arrays of pixels

Point and line segment types Angel and Shreiner

Polygons Multi-sided planar element composed of edges and vertices. Vertices (singular vertex) are represented by points Edges connect vertices as line segments E1 (x2,y2) (x1,y1) E3 E2 (x3,y3)

Simple Convex Flat Valid polygons

Simple Convex Flat Valid polygons

OpenGL polygons Only triangles are supported (in latest versions) GL_TRIANGLE_STRIP GL_POINTS GL_TRIANGLES GL_TRIANGLE_FAN

Other polygons triangulation triangulation as long as triangles are not collinear, they will be simple, flat, and convex -- easy to render

Sample attributes Color glclearcolor(1.0, 1.0, 1.0, 1.0); Point size glpointsize(2.0); Line width gllinewidth(3.0);