Software Rasterization

Slides:



Advertisements
Similar presentations
Today Composing transformations 3D Transformations
Advertisements

CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © 1/16 Deferred Lighting Deferred Lighting – 11/18/2014.
COMPUTER GRAPHICS CS 482 – FALL 2014 NOVEMBER 10, 2014 GRAPHICS HARDWARE GRAPHICS PROCESSING UNITS PARALLELISM.
Understanding the graphics pipeline Lecture 2 Original Slides by: Suresh Venkatasubramanian Updates by Joseph Kider.
Graphics Pipeline.
CGDD 4003 THE MASSIVE FIELD OF COMPUTER GRAPHICS.
X86 and 3D graphics. Quick Intro to 3D Graphics Glossary: –Vertex – point in 3D space –Triangle – 3 connected vertices –Object – list of triangles that.
A Crash Course on Programmable Graphics Hardware Li-Yi Wei 2005 at Tsinghua University, Beijing.
1 Jinxiang Chai CSCE 441 Computer Graphics. 2 Midterm Time: 10:10pm-11:20pm, 10/20 Location: HRBB 113.
Status – Week 231 Victor Moya. Summary Primitive Assembly Primitive Assembly Clipping triangle rejection. Clipping triangle rejection. Rasterization.
Status – Week 277 Victor Moya.
The Graphics Pipeline CS2150 Anthony Jones. Introduction What is this lecture about? – The graphics pipeline as a whole – With examples from the video.
1 Chapter 5 Viewing. 2 Perspective Projection 3 Parallel Projection.
Part I: Basics of Computer Graphics Rendering Polygonal Objects (Read Chapter 1 of Advanced Animation and Rendering Techniques) Chapter
CHAPTER 7 Viewing and Transformations © 2008 Cengage Learning EMEA.
Geometric Objects and Transformations Geometric Entities Representation vs. Reference System Geometric ADT (Abstract Data Types)
Introduction to 3D Graphics John E. Laird. Basic Issues u Given a internal model of a 3D world, with textures and light sources how do you project it.
Lecture 5: 3D Rendering Pipeline (II) Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering Georgia Institute of Technology.
Basics of Rendering Pipeline Based Rendering –Objects in the scene are rendered in a sequence of steps that form the Rendering Pipeline. Ray-Tracing –A.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Computer graphics & visualization REYES Render Everything Your Eyes Ever Saw.
CSE 381 – Advanced Game Programming Basic 3D Graphics
02/26/02 (c) 2002 University of Wisconsin, CS 559 Last Time Canonical view pipeline Orthographic projection –There was an error in the matrix for taking.
Week 2 - Wednesday CS361.
Week 2 - Friday.  What did we talk about last time?  Graphics rendering pipeline  Geometry Stage.
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS The Geometry Pipeline.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
COMPUTER GRAPHICS CSCI 375. What do I need to know?  Familiarity with  Trigonometry  Analytic geometry  Linear algebra  Data structures  OOP.
CAP4730: Computational Structures in Computer Graphics 3D Transformations.
OpenGL: Introduction Yanci Zhang Game Programming Practice.
Games Development 1 Camera Projection / Picking CO3301 Week 8.
1 Visiblity: Culling and Clipping Computer Graphics COMP 770 (236) Spring 2009 January 21 & 26: 2009.
OpenGL The Viewing Pipeline: Definition: a series of operations that are applied to the OpenGL matrices, in order to create a 2D representation from 3D.
Mark Nelson 3d projections Fall 2013
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
David Luebke1/10/2016 CS 551 / 645: Introductory Computer Graphics David Luebke
Honours Graphics 2008 Session 2. Today’s focus Vectors, matrices and associated math Transformations and concatenation 3D space.
What are shaders? In the field of computer graphics, a shader is a computer program that runs on the graphics processing unit(GPU) and is used to do shading.
Coordinate Systems Lecture 1 Fri, Sep 2, The Coordinate Systems The points we create are transformed through a series of coordinate systems before.
The Graphics Pipeline Revisited Real Time Rendering Instructor: David Luebke.
Midterm Review. Overall No OpenGL programming questions, but programming pipeline and concepts of important OpenGL functions are required. – Parameter.
Computer Graphics One of the central components of three-dimensional graphics has been a basic system that renders objects represented by a set of polygons.
09/23/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Reflections Shadows Part 1 Stage 1 is in.
Applications and Rendering pipeline
Introduction to Computer Graphics
Visible Surface Detection
COMPUTER GRAPHICS CHAPTER 38 CS 482 – Fall 2017 GRAPHICS HARDWARE
- Introduction - Graphics Pipeline
Rasterizer Overview References:
Camera Position (5.6) we specify the position and orientation of the camera to determine what will be seen. use gluLookAt (eye x, y, z, at x, y, z, up.
Week 2 - Friday CS361.
Hidden Surface Removal
Intro to 3D Graphics.
A Crash Course on Programmable Graphics Hardware
3D Computer Graphics (3080/GV10) Week 5-6 Tutorial 3
3D Transformations Source & Courtesy: University of Wisconsin,
Graphics Processing Unit
Deferred Lighting.
3D Graphics Rendering PPT By Ricardo Veguilla.
The Graphics Rendering Pipeline
CS451Real-time Rendering Pipeline
Models and Architectures
Introduction to Computer Graphics with WebGL
Graphics Processing Unit
Computer Graphics One of the central components of three-dimensional graphics has been a basic system that renders objects represented by a set of polygons.
The Graphics Pipeline Lecture 5 Mon, Sep 3, 2007.
Chapter V Vertex Processing
(c) 2002 University of Wisconsin, CS 559
Lecture 13 Clipping & Scan Conversion
Presentation transcript:

Software Rasterization Stanislaw Jaroszynski

History GPU’s used to be expensive and a non-consumer product John Carmack pioneered 3D in video games through software rasterization

Quake Engine Very fast Heavily optimized and limited to use case Uses BSP to only render a small portion of map Most lighting and effects pre rendered Uses palette for gradients and full screen post- processing

Pipeline Follows general fixed pipeline of early GPU’s Model View Transform Cull Faces Lighting Calculations Projection Transform Div by W To Screen Space Follows general fixed pipeline of early GPU’s Triangle Rasterization

Homogeneous Coordinates Allows for simplification of calculations with transformation matrices Matrices can be concatenated which results in one matrix multiplication per vertex 1

Affine Transformations

Projection Matrix not affine s = 1 / tan(fov * 0.5) a = aspect ratio (width / height) s/a S

Modelview Transformation Composed of affine transformations World/Camera space Could be combined with projection if not doing calculations in world space Lighting and backface culling done in this space

Backface Culling If triangles are in counter-clockwise direction, we can take the cross product of u and v to get n Since we are in camera space, if z > 0, the triangle must be facing away from the camera and can be culled

Lighting Diffuse light = cos(theta) between face and direction to light

Projection Transform Converts world coordinates to unit cube (except Z) Stores form of Z in W (vertices no longer homogenous) Space is still linear

Clipping Faces clipped to unit cube in projection space Faces outside are removed Faces partially inside are clipped and form two new triangles with interpolated values. Projection space is the best for clipping because visible vertices are bound to -1 to 1 and space is still linear.

W Divide Transforms viewing cube to frustrum Coordinates are homogenized (in theory; W keeps Z value for later because a 1 W isn’t useful anymore anyway)

Screen Space Transformation Just maps -1 -> 1 to 0 -> [Screen Dimension]

Triangle Rasterization Fills triangles line by line Implemented by traversing edges Not true to GPU implementations which use barycentric coordinates (more parallel + other useful properties)

Value Interpolation Values are interpolated linearly between the ends of two edges and then again between the edges This is good enough for most properties but it is not correct When interpolating textures the error is apparent

Perspective Correct Textures The solution to this is to interpolate [u/w, v/w, 1/w] Then u/w / 1/w = u Can be done every couple steps to improve performance with less significant visual errors