Download as pdf or txt
Download as pdf or txt
You are on page 1of 21

Architecture of a Graphics Pipeline

Architecture of a Graphics Pipeline


6 February 2007
CMPT370
Dr. Sean Ho
Trinity Western University
6 Feb 2007 6 Feb 2007 CMPT370: graphics pipeline CMPT370: graphics pipeline 2 2
Reie! last ti"e
Reie! last ti"e

Visual o!"utin#$

Co!"uter #ra"%is an& i!a#e analysis

'b(etives o) visual o!"utin#

Ca"ture an& un&erstan& reality

*!ulate an& en%ane reality

Part%enon vi&eo

+!a#e )or!ation

Ca!era !o&el
6 Feb 2007 6 Feb 2007 CMPT370: graphics pipeline CMPT370: graphics pipeline 3 3
#hat$s on for to%a&
#hat$s on for to%a&

,i#%t an& olour !o&els

-eo!etri re"resentation$ tri!es%

')).line ren&erin#$ raytrain#/ ra&iosity

0eal.ti!e interative #ra"%is "i"eline$

Verte1 "roessin#

Cli""in# an& ullin#

0asteri2in#

Fra#!ent "roessin#

-ra"%is 3P+ overvie4 5'"en-,6


6 Feb 2007 6 Feb 2007 CMPT370: graphics pipeline CMPT370: graphics pipeline ' '
("age for"ation
("age for"ation

Co!"onents to "ro&ue a stati i!a#e$

'b(ets

-eo!etry 5verties/ )aes/ et.6/ !aterial "ro"erties$


olour/ s%ininess/ bu!"iness/ et.

,i#%t soures

Colour s"etru!/ &iretion/


area/ et.

Vie4er

Ca!era !o&el$ lens/


&e"t% o) )iel&/ et.
6 Feb 2007 6 Feb 2007 CMPT370: graphics pipeline CMPT370: graphics pipeline ) )
*ight
*ight

Visible li#%t
is eletro!a#neti ra&iation about 370.770n! in
4avelen#t% 58900 to :70 TH2 in )re;ueny6

,i#%t olour is a )re;ueny &istribution o) ener#y

,asers$ !ono%ro!ati

<ut our eyes only %ave )our =in&s o) sensors$

0o&s$ lu!inane 5s%a&es o) #rey6

0/-/< ones$ %ro!inane 5olour6

*a% sensor %as its o4n


)re;ueny res"onse urve
6 Feb 2007 6 Feb 2007 CMPT370: graphics pipeline CMPT370: graphics pipeline 6 6
Colour "o%els
Colour "o%els

>True? i!a#e$ )re;ueny &istribution at ea% "i1el

0-<$ !at%es our ones

3&&itive olour$ C0Ts use 3 eletron #uns

Must still &e)ine %ro!atiities o) 0/-/<

CM@A$ subtrative olour$ CB.C0/ MB.C-/ @B.C<

+n=sD"i#!ents$ ne4s"a"er/ "aint

HSV$ %ue/ saturation/ value

C+*,3<$ li#%tness/ aDb %ro!inane$

3bsolute olour s"ae$ only &e"en&s on 4%ite"oint

Convert to absolute via "ro)ile$ 3&obe0-</ s0-<


6 Feb 2007 6 Feb 2007 CMPT370: graphics pipeline CMPT370: graphics pipeline 7 7
Geo"etric representation: tri"esh
Geo"etric representation: tri"esh

T%e !ost o!!on re"resentation )or t%e


#eo!etry o) 3D sur)aes is a trian#le !es%$

Verte1 list 5"oint lou&6$ 51/y/26 oor&inates

E0.2/ 0./ 2.7F/ E0.2/ .0.GG2/ 2.7F/ E0.GG2/ .0.2/ 2.7F/

Fae list$ in&e1es into verties

EG2/ G3/ G9F/ EG3/ G9/ G7F/ ...

Can also use ot%er "oly#ons

<ut trian#le is a 2D si!"le1$


3l4ays )lat

Faes %ave nor!al vetors


6 Feb 2007 6 Feb 2007 CMPT370: graphics pipeline CMPT370: graphics pipeline + +
,ff-line s. real-ti"e graphics
,ff-line s. real-ti"e graphics

')).line ren&erin#

0en&er ti!e is not very i!"ortant

Use bi# "arallel ren&er )ar!s

P%oto.realis! is t%e "riority

0aytrain#/ ra&iosity/ ot%er ren&erin# !et%o&s

0eal.ti!e 5interative6 #ra"%is

Per)et "%oto.realis! is not so i!"ortant

Fra!e rate is t%e "riority$ at least 60H2

3D !o&ellin#/ C3D/ sienti)i visuali2ation

-ra"%is "i"eline in vi&eo ar& or so)t4are


6 Feb 2007 6 Feb 2007 CMPT370: graphics pipeline CMPT370: graphics pipeline / /
,ff-line ren%ering
,ff-line ren%ering

0aytrain#$

Cast rays )ro! a!era into sene


until eit%er absorbe& or #o to in)inity

S=y s"%ere %an&les in)inity

0e)letions/ translueny/ re)ration

'nly trae rays t%at are nee&e&

0a&iosity$

,i#%t soures e!it ener#y

Follo4 li#%t ener#y as it bounes in sene

-lobal illu!ination$ not vie4.&e"en&ent


6 Feb 2007 6 Feb 2007 CMPT370: graphics pipeline CMPT370: graphics pipeline 00 00
Real-ti"e graphics pipeline
Real-ti"e graphics pipeline

Proess ob(ets one at a ti!e$ loal li#%tin#

T%is is all &one in %ar&4are on t%e #ra"%is ar&

+n"ut$ sene ob(ets/ li#%tin#/ a!era

Most o) t%e &ata is t%e verte1 list

'ut"ut$ "i1els store& in t%e )ra!ebu))er

0aster #ra"%is
1erte2
processing
Clipping Rasteri3e
Frag"ent
processing
1erte2
list
Pi2els
6 Feb 2007 6 Feb 2007 CMPT370: graphics pipeline CMPT370: graphics pipeline 00 00
1erte2 processing
1erte2 processing

Mu% o) t%e 4or= is in trans)or!in# verties )ro!


one oor&inate syste! to anot%er$

'b(et.base& oor&s

Ca!era.base& oor&s

Sreen.base& oor&s

*a% trans)or! is a !atri1 !ulti"liation

Verte1 "roessor also o!"utes 0-< olour at


ea% verte1
6 Feb 2007 6 Feb 2007 CMPT370: graphics pipeline CMPT370: graphics pipeline 02 02
4in%s of coor%inate transfor"s
4in%s of coor%inate transfor"s

T%e trans)or!ations &one on verties inlu&e$

Translation$ s%i)t in 51/y/26

0otation$ e.#./ 3 *uler an#les

Salin#$ uni)or! or alon# 3 a1es

5Pers"etive/ a))ine6

3D "oints are "ro(ete& onto 2D i!a#e "lane$

Pers"etive "ro(etion$

Pro(etion lines !eet at enter o) "ro(etion

Parallel "ro(etion$

Pro(etion lines are all "arallel


6 Feb 2007 6 Feb 2007 CMPT370: graphics pipeline CMPT370: graphics pipeline 03 03
Pri"itie asse"bl&
Pri"itie asse"bl&

T%e verte1 "roessor is also res"onsible )or


asse!blin# verties into "ri!itives$

,inesDurves/ trian#lesD"oly#onsDsur)aes

Uses t%e )ae list to in&e1 into t%e verte1 list


1erte2
processing
Clipping Rasteri3e
Frag"ent
processing
Pi2els
1erte2
list
6 Feb 2007 6 Feb 2007 CMPT370: graphics pipeline CMPT370: graphics pipeline 0' 0'
Clipping an% culling
Clipping an% culling

DonHt ren&er 4%at 4e anHt see

Cli""in#

0e!ove "ri!itives outsi&e o)


t%e a!eraHs vie4 )rustru!

<a=)ae ullin#

0e!ove trian#les )ain# a4ay )ro! a!era

Usually uts &o4n I o) trian#les by about 70JK

't%er o"ti!i2ations also "ossible


6 Feb 2007 6 Feb 2007 CMPT370: graphics pipeline CMPT370: graphics pipeline 0) 0)
Rasteri3ation
Rasteri3ation

Convert a "ri!itive into a )ra#!ent$

Set o) "i1els (ust )or t%at "ri!itive

*a% "i1el %as 0-< olour an& &e"t%

+nter"olate verte1 olours over t%e )ra#!ent


1erte2
processing
Clipping Rasteri3e
Frag"ent
processing
Pi2els
1erte2
list
6 Feb 2007 6 Feb 2007 CMPT370: graphics pipeline CMPT370: graphics pipeline 06 06
Frag"ent processing
Frag"ent processing

3sse!ble t%e )ra#!ents into )inal )ra!ebu))er

Hi&&en.sur)ae re!oval$

So!e )ra#!ents !ay olu&e "arts o) ot%ers

Han&le trans"areny
1erte2
processing
Clipping Rasteri3e
Frag"ent
processing
Pi2els
1erte2
list
6 Feb 2007 6 Feb 2007 CMPT370: graphics pipeline CMPT370: graphics pipeline 07 07
Progra""er$s interface
Progra""er$s interface

3 #ra"%is 3P+ allo4s a "ro#ra! to interat 4it%


t%e #ra"%is "i"eline

,ibrary subroutines 5see CubeVie4.116

S"ei)y t%e sene 5!o&els6

S"ei)y t%e li#%tin#

S"ei)y t%e a!era


Application
progra"
AP(: ,penG*5
6irect36
GP7: graphics car%
6 Feb 2007 6 Feb 2007 CMPT370: graphics pipeline CMPT370: graphics pipeline 0+ 0+
Graphics AP(: Mo%el
Graphics AP(: Mo%el

-eo!etry$ verties 50D6

,ine se#!ents/ urves 5GD6

Poly#ons 52D6/ so!eti!es "ara!etri sur)aes

Material "ro"erties$ olour/ s"eularity/ et.

*1a!"le$
#l<e#in5-,LT0+3M-,*6N
#lColor3)50.0/ G.0/ 0.06N
#lVerte13)50.0/ 0.0/ 0.06N
#lVerte13)5G.0/ 0.0/ 0.06N
#lVerte13)50.0/ G.0/ 0.06N
#l*n&56N
-,LT0+3M-,*LST0+P
6 Feb 2007 6 Feb 2007 CMPT370: graphics pipeline CMPT370: graphics pipeline 0/ 0/
Graphics AP(: *ighting
Graphics AP(: *ighting

Ty"e o) li#%t$

3!bient 5uni)or!/ every4%ere6

Diretional 5e.#./ sunli#%t6

S"otli#%t 5one 4it% )allo))6

Point vs. area li#%t

Material "ro"erties$

3!bient olour

Di))use olour

S"eular olour

*!issive olour
6 Feb 2007 6 Feb 2007 CMPT370: graphics pipeline CMPT370: graphics pipeline 20 20
Graphics AP(: Ca"era
Graphics AP(: Ca"era

6D'F a!era !o&el$

Position o) enter o) "ro(etion 53D'F6

'rientation 53D'F6

3lso$ loation an& si2e o) i!a#e "lane

Coul& also onsi&er


!o&ellin# lens &istortion
6 Feb 2007 6 Feb 2007 CMPT370: graphics pipeline CMPT370: graphics pipeline 20 20
T,6,
T,6,

,ab2 &ue toni#%t

Desi#n O i!"le!ent your o4n '"enMP


"ro#ra!

,ab 4rite.u"

Mi&ter! G ne1t 4ee= T%u G7Feb

-U+/ "arallel

*!"%asis on leture !aterial

Co&in# so!e sni""ets

You might also like