3D graphics rendering pipeline (1) 3D graphics rendering pipeline (3) 3D graphics rendering pipeline (2) 8/29/11

Similar documents
3D Coordinates & Transformations

CS Computer Graphics: Transformations & The Synthetic Camera

Modeling Transformations

To Do. Demo (Projection Tutorial) Motivation. What we ve seen so far. Outline. Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 5: Viewing

Motivation. What we ve seen so far. Demo (Projection Tutorial) Outline. Projections. Foundations of Computer Graphics

To Do. Motivation. Demo (Projection Tutorial) What we ve seen so far. Computer Graphics. Summary: The Whole Viewing Pipeline

4. Two Dimensional Transformations

What does OpenGL do?

Homogeneous Coordinates

Two Dimensional Viewing

The 3-D Graphics Rendering Pipeline

Modeling Transformations

2D transformations and homogeneous coordinates

Midterm Review. Wen-Chieh (Steve) Lin Department of Computer Science

Today s class. Geometric objects and transformations. Informationsteknologi. Wednesday, November 7, 2007 Computer Graphics - Class 5 1

CSE328 Fundamentals of Computer Graphics: Theory, Algorithms, and Applications

Viewing/Projection IV. Week 4, Fri Jan 29

GEOMETRIC TRANSFORMATIONS AND VIEWING

[ ] [ ] Orthogonal Transformation of Cartesian Coordinates in 2D & 3D. φ = cos 1 1/ φ = tan 1 [ 2 /1]

1. We ll look at: Types of geometrical transformation. Vector and matrix representations

CSE528 Computer Graphics: Theory, Algorithms, and Applications

CS F-07 Objects in 2D 1

CS 335 Graphics and Multimedia. Geometric Warping

CSC 305 The Graphics Pipeline-1

Image Warping : Computational Photography Alexei Efros, CMU, Fall Some slides from Steve Seitz

Image Warping. Some slides from Steve Seitz

Computer Graphics. Geometric Transformations

Computer Graphics. Geometric Transformations

Viewing and Projection

Interactive Computer Graphics. Warping and morphing. Warping and Morphing. Warping and Morphing. Lecture 14+15: Warping and Morphing. What is.

CS559: Computer Graphics

Viewing/Projections III. Week 4, Wed Jan 31

General Purpose Computation (CAD/CAM/CAE) on the GPU (a.k.a. Topics in Manufacturing)

Last Time. Correct Transparent Shadow. Does Ray Tracing Simulate Physics? Does Ray Tracing Simulate Physics? Refraction and the Lifeguard Problem

Modeling Transformations Revisited

3D Graphics for Game Programming (J. Han) Chapter II Vertex Processing

To Do. Outline. Translation. Homogeneous Coordinates. Foundations of Computer Graphics. Representation of Points (4-Vectors) Start doing HW 1

3D Geometry and Camera Calibration

(x, y) (ρ, θ) ρ θ. Polar Coordinates. Cartesian Coordinates

High Dimensional Rendering in OpenGL

Realtime 3D Computer Graphics & Virtual Reality. Viewing

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

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

Software Engineering. ò Look up Design Patterns. ò Code Refactoring. ò Code Documentation? ò One of the lessons to learn for good design:

Chap 7, 2009 Spring Yeong Gil Shin

The Graphics Pipeline and OpenGL I: Transformations!

Image Warping. Many slides from Alyosha Efros + Steve Seitz. Photo by Sean Carroll

The Importance of Matrices in the DirectX API. by adding support in the programming language for frequently used calculations.

What and Why Transformations?

Transformations II. Week 2, Wed Jan 17

Lecture 4: Viewing. Topics:

Computer Graphics 7: Viewing in 3-D

Supplementary Material: The Rotation Matrix

Rasterization Overview

3-Dimensional Viewing

Computer Graphics: Viewing in 3-D. Course Website:

Projection Matrix Tricks. Eric Lengyel

The Graphics Pipeline and OpenGL I: Transformations!

COMP30019 Graphics and Interaction Three-dimensional transformation geometry and perspective

To Do. Course Outline. Course Outline. Goals. Motivation. Foundations of Computer Graphics (Fall 2012) CS 184, Lecture 3: Transformations 1

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

MAN-522: COMPUTER VISION SET-2 Projections and Camera Calibration

CS 4731/543: Computer Graphics Lecture 5 (Part I): Projection. Emmanuel Agu

Today. The Graphics Pipeline: Projective Transformations. Last Week: Schedule. XForms Forms Library. Questions?

Geometry of image formation

XNA: The Big Picture Initialization phase

Determining the 2d transformation that brings one image into alignment (registers it) with another. And

Warping, Morphing and Mosaics

To Do. Computer Graphics (Fall 2004) Course Outline. Course Outline. Motivation. Motivation

Editing and Transformation

Culling. Computer Graphics CSE 167 Lecture 12

Parallelization. Memory coherency helps when distributing rays to various threads/processors

CS4670: Computer Vision

CS 428: Fall Introduction to. Viewing and projective transformations. Andrew Nealen, Rutgers, /23/2009 1

Matrix Transformations. Affine Transformations

Advanced Lighting Techniques Due: Monday November 2 at 10pm

Real-Time Graphics Architecture

Computer Graphics. P04 Transformations. Aleksandra Pizurica Ghent University

CT5510: Computer Graphics. Transformation BOCHANG MOON

6. Modelview Transformations

How is project #1 going?

Announcements. Equation of Perspective Projection. Image Formation and Cameras

Computer Graphics. 2D Transforma5ons. Review Vertex Transforma5ons 2/3/15. adjust the zoom. posi+on the camera. posi+on the model

Scene Graphs & Modeling Transformations COS 426

Transformations II. Arbitrary 3D Rotation. What is its inverse? What is its transpose? Can we constructively elucidate this relationship?

CS770/870 Spring 2017 Transformations

Introduction to Homogeneous Transformations & Robot Kinematics

3D Polygon Rendering. Many applications use rendering of 3D polygons with direct illumination

Viewing Transformations I Comp 535

Image Warping. Some slides from Steve Seitz

MATHEMATICS FOR ENGINEERING TUTORIAL 5 COORDINATE SYSTEMS

Textures. Texture coordinates. Introduce one more component to geometry

Image Warping. Computational Photography Derek Hoiem, University of Illinois 09/28/17. Photo by Sean Carroll

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

Announcements. Tutorial this week Life of the polygon A1 theory questions

Image Metamorphosis By Affine Transformations

Projections. Brian Curless CSE 457 Spring Reading. Shrinking the pinhole. The pinhole camera. Required:

2D Transformations. 7 February 2017 Week 5-2D Transformations 1

Introduction to Visualization and Computer Graphics

News. Projections and Picking. Transforming View Volumes. Projections recap. Basic Perspective Projection. Basic Perspective Projection

Transcription:

3D graphics rendering pipeline (1) Geometr Rasteriation 3D Coordinates & Transformations Prof. Aaron Lanterman (Based on slides b Prof. Hsien-Hsin Sean Lee) School of Electrical and Computer Engineering Georgia Institute of Technolog Geometr Pipeline Vertices Mainl floating-point operations Rasteriation Pipeline Piels Mainl dealing with Integer operations 3D graphics rendering pipeline () 3D graphics rendering pipeline (3) Geometr MMX ISA Rasteriation SSE/SSE ISA Geometr MMX ISA Rasteriation Geometr Pipeline Vertices Mainl floating-point operations Rasteriation Pipeline Piels Mainl dealing with Integer operations MMX was originall designed to accelerate this tpe of functionalit Geometr Pipeline Vertices Mainl floating-point operations SSE/SSE were designed for this part Rasteriation Pipeline Piels Mainl dealing with Integer operations MMX was originall designed to accelerate this tpe of functionalit 1

Fied-function 3D graphics pipeline 3D Coord: Math tetbooks use -up Geometr Performed b GPU Geometr Pipeline Vertices Mainl floating-point operations SSE/SSE were designed for this part Rasteriation Pipeline Piels Mainl dealing with Integer operations MMX was originall designed to accelerate this tpe of functionalit Rasteriation Z-up, Right-Handed Sstem 3D Coord: Real games tend to use -up X-Y natural for screen coordinates (awa from the viewer) (toward the viewer) Left-Handed Sstem Direct3D Unit3D Right-Handed Sstem OpenGL XNA Left-Handed Sstem Direct3D Unit3D Right-Handed Sstem OpenGL XNA

Some use Z-up for world coordinates Another view Left-Handed Sstem Right-Handed Sstem Z-up, LHS: Unreal Z-up, RHS: Quake/Radiant, Source/Hammer, C4 Engine Nearl everthing still uses Y-up for screen coordinates! Left-Handed Sstem Unreal Right-Handed Sstem Quake/Radiant Source/Hammer C4 Engine 3D object modeling software Geometr format verte coordinates +Y (X, Y, Z) +Z Right-Handed Sstem 3D Studio Ma, Blender Right-Handed Sstem Maa, Milkshape Y1 Z1 (X1, Y1, Z1) X1 (X3, Y3, Z3) +X 3

Geometr format verte normals +Y Geometr format verte colors +Y (NX, NY, NZ) (R, G, B, A) +Z +Z (NX3, NY3, NZ3) (R3, B3, B3, G3) (NX1, NY1, NZ1) (R1, G1, B1, A1) +X +X Triangle-based geometr representation Specifing a 3D object (1) V4 V7 V1 V5 V3 V6 V9 V V V4 V3 V5 V3 V4 V1 V5 V1 V7 V5 V6 Triangle list {v1, v3, v}, {v1, v5, v3}, {v5, v6, v3}, {v4, v3, v6}, {v1, v7, v6}, {v1, v6, v5} V8 Triangle List (note the verte order) V1 Triangle Strip V Triangle Fan V V3 V4 Triangle strip {v5, v3, v1, v}, {v5, v6, v3, v4}, {v7, v6, v1, v5} Verte ordering is critical when culling mode enabled We will discuss normal computation later 4

Specifing a 3D object () 3D rendering pipeline V1 V7 V8 V6 V4 Triangle list {v1, v, v7}, {v, v8, v7}, {v, v3, v4}, {v, v4, v8}, {v4, v7, v8}, {v4, v6, v7} Triangle strip {v1, v, v7, v8}, {v3, v4, v, v8}, {v6, v7, v4, v8} World Transform View Transform Lighting Projection Transform Backface Culling Clipping Perspective Divide Viewport Transform Rasteriation V V3 Verte ordering is critical when culling mode enabled We will discuss normal computation later Transformation pipeline World Transformation Model coordinates à World coordinates View Transformation World coordinates à Camera space Projection Transformation Camera space à View plane World transformation World Coordinates Local model coordinates Translation Rotation Scaling These are a series of matri multiplications World origin Local model coordinates 5

View transformation Projection transformation World Coordinates Set up camera internals Camera position Look vector Set up Field of View (FOV) View frustum View planes World origin Will discuss in the net lecture Homogeneous coordinates Transformation 1: translation (Offset) Enable all transformations to be done b multiplication Primaril for translation (see net few slides) ( t, t, t ) Add one coordinate (w) to a 3D vector Each verte has [,,, w] w will be useful for perspective projection (,, ) w should be 1 in a Cartesian coordinate sstem 6

Translation matri 1 [ t, t, t,1] = [,,,1] T 1 1 T T Transformation : scaling Eample of a row-coordinate convention Direct3D & XNA use row coordinates OpenGL uses column coordinates Scaling matri Transformation 3: rotation S [ s, s, s,1] = [,,,1] S S 7

D rotation (, ) (, ) θ ϕ (, ) cosθ sin θ [ ', ',1] = [,,1] sin θ cosθ Rotate along which ais? θ 3D rotation matri (LHS) Rotation along Z ais Rotation along Y ais Rotation along X ais cosθ sin θ [', ',',1] = [,,,1] cosθ = 1 [', ',',1] [,,,1] sinθ 1 [', ',',1] = [,,,1] cosθ sin θ sin θ cosθ 1 sinθ cosθ sin θ cosθ Non-commutative propert (1) 1. Counter-clockwise 9 o along. Clockwise 9 o along 1. Clockwise 9 o along. Counter-clockwise 9 o along Non-commutative propert () π cos( ) π sin( ) 1 π cos( ) π sin( ) π 1 sin( ) π cos( ) 1 π π cos( ) sin( ) (,, ) = (-, -, ) π sin( ) π cos( ) π cos( ) π sin( ) (,, ) = (-, -, ) π 1 sin( ) = π cos( ) 1 π sin( ) 1 1 π = cos( ) 1 1 1 8

Non-commutative propert (3) 1. Translation b (,, ). Scale b times 1. Scale b times. Translation b (,, ) Non-commutative propert (4) 1 T S 1 S 1 T T S = S ST S ST S ST (,, ) = (*S+S*T, *S+S*T, *S+S*T) Offsets were scaled as well S S 1 S T S 1 = S 1 T T T T S T (,, ) = (*S+T, *S+T, *S+T) Non-commutative propert (5) View transformation revisited Ordering matters! World Coordinates Be careful when performing matri multiplication World origin Camera position Look vector 9

Specifing the view transformation Most commonl parameteried b: Position of camera Position of point to look at Vector indicating up direction of camera In Direct3D: D3DXMatriLookAtLH! D3D uses a LHS, but also have D3DXMatriLookAtRH In XNA: Matri.CreateLookAt (RHS) In OpenGL: glulookat (RHS) Can also build a rotation+translation matri as if the camera was an object in scene, then take the inverse of that matri msdn.microsoft.com/en-us/librar/bb534(vs.85).asp msdn.microsoft.com/en-us/librar/bb5343(vs.85).asp 1