RASTERISED RENDERING

Similar documents
RASTERISED RENDERING

GLOBAL ILLUMINATION. Christopher Peters INTRODUCTION TO COMPUTER GRAPHICS AND INTERACTION

Rasterization Overview

IMAGE-BASED RENDERING AND ANIMATION

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

CHAPTER 1 Graphics Systems and Models 3

Pipeline Operations. CS 4620 Lecture 14

Pipeline Operations. CS 4620 Lecture 10

CS451Real-time Rendering Pipeline

LIGHTING AND SHADING

Models and Architectures

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

COMPUTER GRAPHICS AND INTERACTION

RAYTRACING. Christopher Peters INTRODUCTION TO COMPUTER GRAPHICS AND INTERACTION. HPCViz, KTH Royal Institute of Technology, Sweden

CS4620/5620: Lecture 14 Pipeline

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

Introduction to Visualization and Computer Graphics

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

INFOGR Computer Graphics. J. Bikker - April-July Lecture 11: Visibility. Welcome!

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

Topics and things to know about them:

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

QUESTION BANK 10CS65 : COMPUTER GRAPHICS AND VISUALIZATION

Course Title: Computer Graphics Course no: CSC209

Introduction to Computer Graphics with WebGL

3D Rasterization II COS 426

Visibility: Z Buffering

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

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

VISIBILITY & CULLING. Don t draw what you can t see. Thomas Larsson, Afshin Ameri DVA338, Spring 2018, MDH

CS 464 Review. Review of Computer Graphics for Final Exam

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

Computer Graphics and GPGPU Programming

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

Spring 2011 Prof. Hyesoon Kim

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

Computer Graphics. Rendering. by Brian Wyvill University of Calgary. cpsc/enel P 1

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

CPSC / Illumination and Shading

Game Architecture. 2/19/16: Rasterization

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

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

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

Graphics and Interaction Rendering pipeline & object modelling

Deferred Rendering Due: Wednesday November 15 at 10pm

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

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

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

Visibility and Occlusion Culling

The Viewing Pipeline Coordinate Systems

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

CS184 : Foundations of Computer Graphics Professor David Forsyth Final Examination (Total: 100 marks)

Computer Graphics. Illumination and Shading

The Rasterization Pipeline

FROM VERTICES TO FRAGMENTS. Lecture 5 Comp3080 Computer Graphics HKBU

Computer Graphics I Lecture 11

Many rendering scenarios, such as battle scenes or urban environments, require rendering of large numbers of autonomous characters.

CS 488. More Shading and Illumination. Luc RENAMBOT

Rendering. Mike Bailey. Rendering.pptx. The Rendering Equation

INTRODUCTION COMPUTER GRAPHICS AND INTERACTION. Christopher Peters. CST, KTH Royal Institute of Technology, Sweden

Institutionen för systemteknik

SRM INSTITUTE OF SCIENCE AND TECHNOLOGY

Ulf Assarsson Department of Computer Engineering Chalmers University of Technology

Blue colour text questions Black colour text sample answers Red colour text further explanation or references for the sample answers

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

Overview. A real-time shadow approach for an Augmented Reality application using shadow volumes. Augmented Reality.

Computing Visibility. Backface Culling for General Visibility. One More Trick with Planes. BSP Trees Ray Casting Depth Buffering Quiz

CS184 : Foundations of Computer Graphics Professor David Forsyth Final Examination

Real-Time Shadows. Last Time? Textures can Alias. Schedule. Questions? Quiz 1: Tuesday October 26 th, in class (1 week from today!

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

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

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

Chapter 7 - Light, Materials, Appearance

03 RENDERING PART TWO

Spring 2009 Prof. Hyesoon Kim

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

Visible Surface Detection. (Chapt. 15 in FVD, Chapt. 13 in Hearn & Baker)

Clipping and Scan Conversion

LOD and Occlusion Christian Miller CS Fall 2011

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

Graphics for VEs. Ruth Aylett

Computer Graphics. Bing-Yu Chen National Taiwan University The University of Tokyo

Computer Graphics. Lecture 9 Hidden Surface Removal. Taku Komura

CS 130 Exam I. Fall 2015

Computer Graphics. Bing-Yu Chen National Taiwan University

CS452/552; EE465/505. Intro to Lighting

Overview. Pipeline implementation I. Overview. Required Tasks. Preliminaries Clipping. Hidden Surface removal

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

INFOGR Computer Graphics. Jacco Bikker - April-July Lecture 14: Grand Recap. Welcome!

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

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

Hidden surface removal. Computer Graphics

3D Graphics Pipeline II Clipping. Instructor Stephen J. Guy

Computer Graphics 10 - Shadows

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

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

Real-Time Universal Capture Facial Animation with GPU Skin Rendering

CSE528 Computer Graphics: Theory, Algorithms, and Applications

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

CS 130 Final. Fall 2015

Transcription:

DH2323 DGI16 INTRODUCTION TO COMPUTER GRAPHICS AND INTERACTION RASTERISED RENDERING Christopher Peters HPCViz, KTH Royal Institute of Technology, Sweden chpeters@kth.se http://kth.academia.edu/christopheredwardpeters Based on DGI12 notes by Carl Henrik Ek

The Rendering Equation Emitted radiance BRDF Account for angle w.r.t. light Describes: Total amount of light emitted from a point x along a specific viewing direction Given: Incoming light function BRDF Basis: Law of conservation of energy Incoming radiance Hemisphere containing all 2013 Christopher Peters, Simulating virtual crowds: A perceptual approach chpeters@kth.se Christopher Peters DH2323 Global Illumination chpeters@kth.se

Global Illumination Ray tracing: Good for specular Bad for diffuse Radiosity: Good for diffuse Bad for specular Hybrid techniques

Caustics Curved regions of bright reflected or refracted light Christopher Peters, Simulating virtual crowds: A perceptual approach chpeters@kth.se Christopher Peters DH2323 Global Illumination chpeters@kth.se

Sub-surface scattering Light bouncing around inside material before exiting 2013 Christopher Peters, Simulating virtual crowds: A perceptual approach chpeters@kth.se Christopher Peters DH2323 Global Illumination chpeters@kth.se

Ray tracing Pixel order rendering technique Trace at least one ray through each image pixel Maintains primitives in geometric scene model Queries this for each ray Determine which primitive is visible for each pixel Geometry queries can have high cost

Rasterisation Scanline: object order based Fragments Data for single pixel Frame buffer Handle occlusion using depth buffer Later details (more specifically, fragments) overwrite earlier ones if closer to camera Shade based on vertices and interpolate See lighting and shading lecture

Rasterisation Process of converting geometry into a raster image (series of pixels) 3D scene converted into 2D image Polygons...composed of triangles...composed of vertices

Rasterisation Rasteriser takes stream of vertices Project them onto the 2D surface of the screen Fill in the interior of the 2D triangles Core concepts: Geometry and transformations Projection Clipping Scanline Conversion

Geometry Transformations Matrix multiplication Translation, scaling, rotation, projection Familiar?

Transformation Stack Stack of transforms (i.e. matrices) Push and pop Position stream of input vertices Incoming vertices transformed according to the transformation stack Remember: local coordinate marker idea

Projection Remove depth Convert 3D geometry to flat 2D representation Do so for each vertex of each polygon Orthographic projection Simply remove z coordinate Viewing volume is a cube Perspective projection Single point of projection (focal point) Viewing volume is a pyramid

Parallel Projections axonometric orthographic oblique

Orthographic Projection From OpenGL Programming Guide

Perspective Projection From OpenGL Programming Guide

Example Nicolas P. Rougier, ERSF Code camp

Projection

Camera Specification Parameters Centre of projection (COP) Field of view (FOV) Projection direction Up direction

Outcomes 2013

Clipping Projected locations may be outside the viewing window Truncate triangles to fit them inside the viewing area e.g. Sutherland-Hodgeman algorithm Real-time Rendering, Akenine-Moller, Haines and Hoffman

Scan Conversion Fill interior of triangles in image plane Use scanline fill algorithm to fill polygons Framebuffer

Line Drawing A line usually defined as infinitely thin How to display using pixels? Fixed and finite area Choose pixels that best represent the line Different algorithms, providing different results: mid-point mid-point neighbourhood weighted area

Line Drawing Bresenham's line algorithm dx = x_end x_start dy = y_end y_start d = 2 * dy dx x = x_start y = y_start while x < x_end if d <= 0 then d = d + (2 * dy) x = x + 1 else d = d + 2 * (dy - dx) x = x + 1 y = y + 1 endif SetPixel(x,y) endwhile

Fill surface Triangles Interpolation Compute edges Polygon Filling

Backface Culling Objects within the view-frustum may have polygons pointing away from the viewer Not visible Back-faces The process is known as back-face culling

Backface Culling To eliminate back-faces: For each polygon in the scene { Take its normal vector Take the view direction vector Use the dot product the find the angle between normal and view direction If the angle is LESS than 90 degrees, then the polygon is culled }

Visible Surface Determination Painter's algorithm Sort polygons relative to the viewpoint Render those polygons that are nearer the viewpoint after those polygons that are further away from the viewpoint Problems?

Visible Surface Determination Painter's algorithm Sort polygons relative to the viewpoint Render those polygons that are nearer the viewpoint after those polygons that are further away from the viewpoint Problems?

Depth Buffer Image-space visibility algorithm Buffer is 2D array, one element per pixel Compute depth of each generated pixel Overwrite depth buffer value if new value is nearer to camera than previous Non-linear, Z-fighting

Note: BSP Trees Used by Quake, Quake 2, etc World-space visibility algorithm Visibility calculations on a per polygon basis Split polygons Compare with Z-buffer algorithm

Texturing Bitmap (2D image) applied to a triangle Each triangle associated with an image Each vertex associated with a texture coordinate (u,v) For each rendered pixel: Lookup corresponding texture element (texel) Interpolation

Labs Animation track, lab 3 posted this Friday

Labs Animation track, lab 3 posted this Friday You should be finishing Lab 2 soon Any major problems? Suggested steps: Fork(continue working on problem) If (help session happening soon) Goto help session and ask(question) Else Post(specific details, KTH Social) Wait until (reply or help session) Try not to crash in meanwhile

(Physical) Labs Session Friday 29 th April, 12.30-2p.m, Visualisation (VIC) Studio See previous KTH Social posts for directions Purposes: Ask questions/get help if in process of completing a lab task Obtain feedback if you have work-in-progress Code / report Documentation 2013

Submission dates Submission date for all labs: On or before May 20th Through Bilda (will open by end of this week look out for the notification email) Submission date for all projects**: On or before May 31st Through Bilda (will open by end of this week) **Also upload your project specifications to Bilda