CS451Real-time Rendering Pipeline

Similar documents
Spring 2009 Prof. Hyesoon Kim

Ulf Assarsson Department of Computer Engineering Chalmers University of Technology

Spring 2011 Prof. Hyesoon Kim

Ulf Assarsson Department of Computer Engineering Chalmers University of Technology

Rasterization Overview

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

Lecture 2. Shaders, GLSL and GPGPU

CHAPTER 1 Graphics Systems and Models 3

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

Pipeline Operations. CS 4620 Lecture 14

Models and Architectures

CSE4030 Introduction to Computer Graphics

Game Architecture. 2/19/16: Rasterization

Graphics Hardware and Display Devices

Rendering Objects. Need to transform all geometry then

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

RASTERISED RENDERING

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

Fondamenti di Grafica 3D The Rasterization Pipeline.

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

Graphics Hardware. Instructor Stephen J. Guy

CS 4620 Program 3: Pipeline

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

Introduction to Computer Graphics with WebGL

The Rasterization Pipeline

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

CIS 581 Interactive Computer Graphics

Optimisation. CS7GV3 Real-time Rendering

Real - Time Rendering. Graphics pipeline. Michal Červeňanský Juraj Starinský

3D graphics, raster and colors CS312 Fall 2010

Today. Rendering pipeline. Rendering pipeline. Object vs. Image order. Rendering engine Rendering engine (jtrt) Computergrafik. Rendering pipeline

TDA362/DIT223 Computer Graphics EXAM (Same exam for both CTH- and GU students)

3D GRAPHICS. design. animate. render

Topics and things to know about them:

Pipeline Operations. CS 4620 Lecture 10

3D Graphics and OpenGl. First Steps

CSE 167: Introduction to Computer Graphics Lecture #4: Vertex Transformation

The Graphics Pipeline

VTU QUESTION PAPER SOLUTION UNIT -1 INTRODUCTION

lecture 18 - ray tracing - environment mapping - refraction

Computer Graphics. Chapter 1 (Related to Introduction to Computer Graphics Using Java 2D and 3D)

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

Notes on Assignment. Notes on Assignment. Notes on Assignment. Notes on Assignment

Graphics and Interaction Rendering pipeline & object modelling

Could you make the XNA functions yourself?

Computer Graphics I Lecture 11

TSBK03 Screen-Space Ambient Occlusion

CS 464 Review. Review of Computer Graphics for Final Exam

The Application Stage. The Game Loop, Resource Management and Renderer Design

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

Computer Graphics Introduction. Taku Komura

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

CS 130 Final. Fall 2015

- Rasterization. Geometry. Scan Conversion. Rasterization

Animation & Rendering

CS 112 The Rendering Pipeline. Slide 1

Shaders. Slide credit to Prof. Zwicker

For each question, indicate whether the statement is true or false by circling T or F, respectively.

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

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

Scanline Rendering 2 1/42

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

Course Title: Computer Graphics Course no: CSC209

CS 130 Exam I. Fall 2015

Recall: Indexing into Cube Map

3D Rendering Pipeline

CS4620/5620: Lecture 14 Pipeline

Today. Rendering algorithms. Rendering algorithms. Images. Images. Rendering Algorithms. Course overview Organization Introduction to ray tracing

Computergrafik. Matthias Zwicker. Herbst 2010

Lecturer Athanasios Nikolaidis

Viewing with Computers (OpenGL)

CMSC427 Transformations II: Viewing. Credit: some slides from Dr. Zwicker

QUESTION BANK 10CS65 : COMPUTER GRAPHICS AND VISUALIZATION

Lecture 4. Viewing, Projection and Viewport Transformations

CS 381 Computer Graphics, Fall 2012 Midterm Exam Solutions. The Midterm Exam was given in class on Tuesday, October 16, 2012.

CIS 581 Interactive Computer Graphics (slides based on Dr. Han-Wei Shen s slides) Requirements. Reference Books. Textbook

CS 563 Advanced Topics in Computer Graphics Camera Models. by Kevin Kardian

3D Production Pipeline

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

Homework #2. Hidden Surfaces, Projections, Shading and Texture, Ray Tracing, and Parametric Curves

For Intuition about Scene Lighting. Today. Limitations of Planar Shadows. Cast Shadows on Planar Surfaces. Shadow/View Duality.

Lecture 1. Computer Graphics and Systems. Tuesday, January 15, 13

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

Computer Graphics and Visualization. Graphics Systems and Models

Shadows in the graphics pipeline

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

Transforms 3: Projection Christian Miller CS Fall 2011

Announcements. Submitting Programs Upload source and executable(s) (Windows or Mac) to digital dropbox on Blackboard

Computer Graphics Shadow Algorithms

Last Time. Why are Shadows Important? Today. Graphics Pipeline. Clipping. Rasterization. Why are Shadows Important?

Computer graphics 2: Graduate seminar in computational aesthetics

Drawing in 3D (viewing, projection, and the rest of the pipeline)

Game Programming. Bing-Yu Chen National Taiwan University

Today. Rendering algorithms. Rendering algorithms. Images. Images. Rendering Algorithms. Course overview Organization Introduction to ray tracing

Spatial Data Structures and Speed-Up Techniques. Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology

Advanced Rendering Techniques

Shadow Rendering EDA101 Advanced Shading and Rendering

Advanced Lighting Techniques Due: Monday November 2 at 10pm

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

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

Transcription:

1 CS451Real-time Rendering Pipeline JYH-MING LIEN DEPARTMENT OF COMPUTER SCIENCE GEORGE MASON UNIVERSITY Based on Tomas Akenine-Möller s lecture note

You say that you render a 3D 2 scene, but what does it mean? First of all, to take a picture, it takes a camera Decides what should end up in the final image far Create image of geometry inside gray region Used by OpenGL, DirectX, ray tracing, etc. Point camera dir fov (angle) near

You say that you render a 3D 3 scene, but what does it mean? A 3D scene includes: Geometry (triangles, lines, points, and more) A triangle consists of 3 vertices A vertex is 3D position, and may Material properties of geometry Light sources Textures (images to glue onto the geometry) Let us take a look at OBJ format include normals, texture coordinates and more

Rendering Primitives 4 Use graphics hardware (GPU) for real time computation These GPUs can render points, lines, triangles very efficiently A surface is thus an approximation by a number of such primitives

Fixed-Function Pipeline 5 From chapter 2 in the RTR book The pipeline is the engine that creates images from 3D scenes Three conceptual stages of the pipeline: Application (executed on the CPU) Geometry Rasterizer input 3D scene Image Game CAD/Maya GIS Transformation matrices (World, View, Projection) Textures / Color Lighting information output

Back to the pipeline: The APPLICATION stage 6 Executed on the CPU Means that the programmer decides what happens here Examples: Collision detection Speed-up techniques Animation Most important task: send rendering primitives (e.g. triangles) to the graphics hardware

The GEOMETRY stage 7 Task: geometrical operations on the input data (e.g. triangles) Allows: Move objects (matrix multiplication) Move the camera (matrix multiplication) Compute lighting at vertices of triangle Project onto screen (3D to 2D matrix multiplication) Clipping (remove triangles outside the screen) Map to window

Animate objects and camera 8 Can animate in many different ways with 4x4 matrices Example: Before displaying a torus on screen, a matrix that represents a rotation can be applied. The result is that the torus is rotated. Same thing with camera (this is possible since motion is relative)

The RASTERIZER stage 9 Main task: take output from GEOMETRY and turn into visible pixels on screen add textures and various other per-pixel operations And visibility is resolved here: sorts the primitives in the z- direction

Rewind! Let s take a closer look 10 The programmer sends down primtives to be rendered through the pipeline (using API calls) The geometry stage does per-vertex operations The rasterizer stage does per-pixel operations Next, scrutinize geometry and rasterizer

GEOMETRY stage in more detail 11 The model transform Originally, an object is in model space Move, orient, and transform geometrical objects into world space Ex: a sphere is defined with origin at (0,0,0) with radius 1 Translate, rotate, scale to make it appear elsewhere Done per vertex with a 4x4 matrix multiplication How does the matrix look like? Can it be any 4x4 matrix?

The view transform 12 You can move the camera in the same manner But apply inverse transform to objects, so that camera looks down negative z-axis (as in OpenGL) z x

Lighting 13 Compute lighting at vertices white light blue Rasterizer Geometry white white red green mimics how light in nature behaves uses empirical models, hacks, and some real theory Much more about this in later lectures

Application Projection Geometry Rasterizer 14 Two major ways to do it Orthogonal (useful in fewer applications) Perspective (most often used) Mimics how humans perceive the world, i.e., objects apparent size decreases with distance Orthogonal Perspective

Projection 15 Also done with a matrix multiplication Pinhole camera (left), analog used in CG (right) rendered image Frustum film Pinhole camera CG camera

Clipping and Screen Mapping 16 Square (cube) after projection Clip primitives to square Screen mapping, scales and translates square so that it ends up in a rendering window These screen space coordinates together with Z (depth) are sent to the rasterizer stage

Summary 17 model space world space world space camera space compute lighting projection image space clip map to screen

The RASTERIZER in more detail 18 Scan-conversion Find out which pixels are inside the primitive Texturing Put images on triangles Interpolation over triangle Z-buffering Make sure that what is visible from the camera really is displayed Double buffering And more

Scan conversion 19 Triangle vertices from GEOMETRY is input Find pixels inside the triangle Or on a line, or on a point Do per-pixel operations on these pixels: Interpolation Texturing Z-buffering And more

Interpolation 20 Interpolate colors over the triangle Called Gouraud interpolation blue red green flat Gouraud

Texturing 21 texturing is like gluing images onto geometrical object + = Uses and other applications More realism Bump mapping Pseudo reflections Light mapping... many others Bump mapping

Z-buffering 22 The graphics hardware is pretty stupid It just draws triangles However, a triangle that is covered by a more closely located triangle should not be visible Assume two equally large tris at different depths incorrect correct Triangle 1 near Triangle 2 far Draw 1 then 2 Draw 2 then 1

Z-buffering 23 Would be nice to avoid sorting The Z-buffer (aka depth buffer) solves this Idea: Store z value (depth) at each pixel When scan-converting a triangle, compute z at each pixel on triangle Compare triangle s z to Z-buffer z-value If triangle s z is smaller, then replace Z-buffer and color buffer Else do nothing Can render in any order (if no blending is involved)

Double buffering 24 The monitor displays one image at a time So if we render the next image to screen, then rendered primitives pop up And even worse, we often clear the screen before generating a new image A better solution is double buffering

Double buffering 25 Use two buffers: one front and one back The front buffer is displayed The back buffer is rendered to When new image has been created in back buffer, swap front and back

Programmable pipeline 26 Programmable shading has become a hot topic Vertex shaders Pixel shaders Adds more control and much more possibilities for the programmer bus HARDWARE CPU Very general Command GPU GPU Highly specialized e.g, vector calculations Highly parallelized Vertex shader program Pixel shader program More to come when we talk about shaders!!