Professional Documents
Culture Documents
Ian Parberry
University of North Texas
Chapter 10 2otes
Wor# Clou#
Chapter 10 2otes
"ection 10&1:
Chapter 10 2otes
Chapter 10 2otes
More ne0tA
Chapter 10 2otes
5ay Tracin%
5ather than follo$in% li%ht rays in the #irection that they tra'el from the emissi'e surfaces8 $e trace the rays bac+$ar#s8 so that $e can #eal only $ith the li%ht rays that matter: the ones that enter our eye from the %i'en #irection& We sen# a ray out from the eye in the #irection throu%h the center of each pi0el to see the first obBect in the scene this ray stri+es& Then $e compute the color that is bein% emitte#>reflecte# from that surface bac+ in the #irection of the ray&
Chapter 10 2otes
Depth Cuffer
Depth buffer is a solution to the occl%sion pro$lem: fi%urin% $hich trian%les are in front of $hich& Depth buffer has the same resolution as the screen& For each pi0el D x y E8 the correspon#in% #epth buffer entry FDxED yE stores the #epth of the pi0el& Gsually the ( coor#inate in clip space is use# H hence the name ('$%ffer&
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' /
Chapter 10 2otes
10
=i%htin%
What Color is That NbBect9 It #epen#s on the color of the reflecte# li%ht& More e0actly8 it #epen#s on the fre(uency #istribution of the reflecte# li%ht& It is calle# the $i)irectional reflectance )istri$%tion f%nction8 or C5DF for short8 %i'en by:
Chapter 10 2otes
11
C5DF
The 'alue of this function tells $hat fraction of the li%ht inci#ent at the point x from #irection is reflecte# in the out%oin% #irection @s in#icate# by the boldface an# hat8 OP mi%ht be a unit 'ector8 but more %enerally it can be any $ay of specifyin% a #irectionK polar an%les mi%ht be another choice& Different colors of li%ht are usually reflecte# #ifferently8 hence the #epen#ence on Q8 $hich is the color ;actually8 the $a'elen%th R more on this in a moment< of the li%ht&
Chapter 10 2otes
1)
C""DF
2e0t8 consi#er the #ifference bet$een shiny re# plastic an# #iffuse re# construction paper&
@ shiny surface reflects inci#ent li%ht much more stron%ly in one particular #irection compare# to others8 $hereas a #iffuse surface scatters li%ht more e'enly across all out%oin% #irections& @ perfect reflector $oul# reflect all the li%ht from one incomin% #irection in a sin%le out%oin% #irection8 $hereas a perfectly #iffuse surface $oul# reflect li%ht e(ually in all out%oin% #irections8 re%ar#less of the #irection of inci#ence& More complicate# phenomena can be e0presse# by %eneraliIin% the C5DF sli%htly& Translucence an# li%ht refraction can be easily incorporate#8 simply by allo$in% the #irection 'ectors to point bac+ into the surface& We mi%ht call this mathematical %eneraliIation a bi#irectional s%rface scatterin% #istribution function ;C""DF<& 6'en 'olumetric effects such as fo% an# subsurface scatterin% can be e0presse# by #roppin% the $or# 7surface: an# #efinin% a C"DF at any point in space& Ta+en at face 'alue8 these are ob'iously impractical theoretical tools8 but they can be useful in un#erstan#in% ho$ to #esi%n practical ones&
Chapter 10 2otes
1*
In some boo+s an# papers you may see C5DF!s $here the t$o #irections are not labele# as 7in: an# 7out:8 assumin% 4elmholtI reciprocity&
Chapter 10 2otes
1,
Chapter 10 2otes
1-
Chapter 10 2otes
1.
"ymbol appears $here $e normally $oul# $rite the limits of inte%ration& This is inten#e# to mean 7sum o'er the hemisphere of possible incomin% #irections&: For each incomin% #irection 8 $e #etermine ho$ much ra#iance $as inci#ent in this incomin% #irection an# %ot scattere# in the out%oin% #irection The sum of all these contributions from all the #ifferent inci#ent #irections %i'es the total ra#iance reflecte# in the #irection In the real ;continuous< $orl# this is an inte%ral& In the 'irtual ;#iscrete< $orl#8 this $ill be a summation&
Chapter 10 2otes
1/
Chapter 10 2otes
11
The first term #enotes the ra#iance inci#ent from the #irection of The next term is simply the C5DF8 $hich tells us ho$ much of the ra#iance inci#ent from this particular #irection $ill be reflecte# in the out%oin% #irection $e care about& Finally8 $e ha'e the Lambert term8 $hich accounts for the fact that more inci#ent li%ht is a'ailable to be reflecte#8 per unit surface area8 $hen is perpen#icular to the surface than $hen at a %lancin% an%le to the surface& The 'ector is the out$ar# facin% surface normal8 an# the #ot pro#uct pea+s at 1 in the perpen#icular #irection8 an# trails off to Iero as the an%le of inci#ence becomes more %lancin%& More about this term later&
Chapter 10 2otes
)0
5en#erin% as an @ppro0imation
To ren#er a scene realistically8 $e must sol'e the ren#erin% e(uation8 $hich re(uires us to +no$ ;in theory< not only the ra#iance arri'in% at the camera8 but the entire #istribution of ra#iance in the scene in e'ery #irection at e'ery point& Clearly this is too much to as+ for a finite8 #i%ital computer8 since both the set of surface locations an# the set of potential inci#ent an# e0itin% #irections are infinite& The real art in creatin% soft$are for #i%ital ima%e synthesis is to allocate the limite# processor time an# memory most efficiently8 in or#er to ma+e the best possible appro0imation&
Chapter 10 2otes
))
Global Illumination
The basic li%htin% mo#el that $e $ill learn only accounts for #irect li%ht& It #oesn!t account for in#irect li%ht that bounce# off of one surface an# arri'e# at another& In other $or#s8 it only #oes one le'el of recursion in the ren#erin% e(uation& @ hu%e component of realistic ima%es is accountin% for the in#irect li%htK that is8 to more fully sol'e the ren#erin% e(uation& The 'arious metho#s for accomplishin% this are +no$n as "lo$al ill%mination techni(ues&
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' )3
"ection 10&):
?ie$in% in 3D
Chapter 10 2otes
)*
Chapter 10 2otes
),
"creen Coor#inates
5ecall that coor#inates start $ith ;08 0< at the topMleft of the screen8 Uy %oes #o$n8 Ux %oes across& ;winPosx8 winPosy< is the top left corner of the output screen in screen coor#inates& )ev!esx an# )ev!esy are the #imensions of the #e'ice in pi0els& win!esx an# win!esy are the #imensions of the $in#o$ in pi0els&
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' )-
Chapter 10 2otes
).
Chapter 10 2otes
)/
The Frustum
The view fr%st%m is the 'olume of space that is 'isible to the camera& "hape# li+e pyrami# $ith tip snippe# off& The 'ie$ frustum is boun#e# by si0 planes8 +no$n as the clip planes&
top8 left8 $ottom8 an# ri"ht planes near clip plane: pre'ents obBects from %ettin% too close to the camera far clip plane: far obBects e'entually %et too small to ren#er effecti'ely an# can be clippe# entirely&
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' 30
Chapter 10 2otes
31
Camera Properties
Position Nrientation Fiel# of 'ie$ Foom @ctually8 the last t$o are interrelate#&
Chapter 10 2otes
3)
Fiel# of ?ie$
The fiel# of 'ie$ is the an%le intercepte# by the 'ie$ frustum& @bbre'iation: fov& @ctually8 $e nee# both a horiIontal an# a 'ertical fo' an%le& 6%& 4oriIontal fo' is sho$n here&
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' 33
Foom
&oom measures the ratio of the apparent siIe of the obBect relati'e to a 10 fo'& =ar%er numbers Ioom in& "maller numbers Ioom out& For e0ample8 a Ioom of )&0 means that the obBect $ill appear t$ice as bi% on screen as $ith a 10 fo'& @ Ioom of 1&0 means a fo' of 10 & Fo'MIoom e(uation:
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' 3*
Chapter 10 2otes
3,
3D Fooms
In 3D8 $e nee# t$o #ifferent Ioom 'alues8 one for the horiIontal an# one for the 'ertical& We can choose any t$o arbitrary 'alues8 but if $e #o not maintain a proper relationship bet$een the horiIontal an# 'ertical Ioom8 then the ren#ere# ima%e $ill appear stretche#&
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' 3-
Foom 5atio
In the formula on the ne0t sli#e: (oom refers to the cameraVs Ioom 'alues& winPhys refers to the physical $in#o$ siIe& win!es refers to the resolution of the $in#o$8 in pi0els& pixPhys refers to the physical #imensions of a pi0el& )evPhys refers to the physical #imensions of the output #e'ice& 5emember that $e usually #onVt +no$ the in#i'i#ual siIes8 but $e #o +no$ the ratio& )ev!es refers to the resolution of the output #e'ice&
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' 3.
Chapter 10 2otes
3/
Nrtho%raphic ProBection
We intro#uce# ortho%raphic proBection in Chapter ,8 but to briefly re'ie$8 in ortho%raphic proBection8 the lines of proBection are parallel8 rather than intersectin% at a sin%le point& There is no perspecti'e foreshortenin% in ortho%raphic proBectionK an obBect $ill appear the same siIe on the screen no matter ho$ far a$ay it is8 an# mo'in% the camera for$ar# or bac+$ar#s alon% the 'ie$in% #irection has no apparent effect so lon% as the obBects remain in front of the near clip plane&
Chapter 10 2otes
*0
Perspecti'e ProBection
2otice that $ith perspecti'e proBection8 parallel lines #o not remain parallel8 an# the closer %ri# s(uares are lar%er than the ones in the #istance&
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' *1
Nrtho%raphic ProBection
With ortho%raphic proBection8 the %ri# lines remain parallel an# the %ri# s(uares are all the same siIe &
Chapter 10 2otes
*)
Nrtho%raphic Fo'
For an ortho%raphic proBection8 it ma+es no sense to spea+ of the fiel# of 'ie$ as an an%le8 since the 'ie$ frustum is shape# li+e a bo08 not a pyrami#& 5ather than #efinin% the x an# y #imensions of the 'ie$ frustum usin% t$o an%les8 $e instea# %i'e t$o siIes: the physical $i#th an# hei%ht of the bo0& The Ioom 'alue has a #ifferent meanin% in ortho%raphic proBection compare# to perspecti'e& It is relate# to the physical siIe of the frustum bo0: (oom L )>si(e si(e L )>(oom
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' *3
Chapter 10 2otes
**
"ection 10&3:
Coor#inate "paces
Chapter 10 2otes
*,
Coor#inate "paces
NbBect 'ertices specifie# in o$,ect space& First transform these into worl) space
Weep trac+ of the obBect!s orientation an# position in $orl# space Calle# the mo)el transform or o$,ect transform&
Chapter 10 2otes
*/
ProBection 5e'isite#
Nne %oal of the clip matri0 is to %et the ri%ht 'alue into w so that the proper proBection occurs& We +no$ ho$ to proBect onto a plane perpen#icular to the (Ma0is an# ) units a$ay from the ori%in ;the plane ( L )&< The rectan%ular portion of the proBection plane insi#e the 'ie$ frustum %ets mappe# onto the screen&
Chapter 10 2otes
*1
Why 2ot9
In a real camera8 the ima%e proBection %ets bi%%er as $e increase the focal #istance8 an# the film stays the same siIe&
Chapter 10 2otes
,1
Chapter 10 2otes
,)
Chapter 10 2otes
,*
Chapter 10 2otes
,,
Chapter 10 2otes
,-
Clip Planes
The secon# %oal of the clip matri0 is to scale the x8 y8 an# ( components such that the si0 clip planes ha'e a tri'ial form& Points are outsi#e the 'ie$ frustum planes accor#in% to the ine(ualities belo$ left& Points insi#e the 'ie$ frustum satisfy the ine(ualities belo$ ri%ht&
Hw Y x Y w Hw Y y Y w Hw Y ( Y w
,.
Chapter 10 2otes
,/
This clip matri0 assumes a leftMhan#e# coor#inate system8 ro$ 'ectors on the left8 an# ( 'alues ran%in% from Hw to w from the near to far clip plane&
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' ,1
DirectZ
DirectZ $ants the proBection matri0 such that ( ran%es from 0 to w& In other $or#s8 the clip space ine(ualities become:
Outside : y J Hw Inside: Hw Y x Y w Hw Y y Y w 0Y(Yw
-0
Chapter 10 2otes
-1
Nrtho%raphic ?ersion
We can easily tell that the t$o matrices Bust %i'en are perspecti'e proBection matrices because the ri%htMhan# column is D08 08 18 0ET& What about ortho%raphic proBection9 The first an# secon# columns #onVt chan%e8 an# $e +no$ the fourth column $ill become D08 08 08 1ET& The thir# column8 $hich controls the output ( 'alue8 nee# to chan%e& "tart by assumin% the first set of con'entions8 that is $e $ish the output I 'alue to be scale# such that (>w ta+es on the 'alues H1 an# U1 at the near an# far clip planes8 respecti'ely&
Chapter 10 2otes
-)
Chapter 10 2otes
-3
NpenG= ?ersions
NpenG= has a leftMhan#e# coor#inate system an# column 'ectors& 4ence the clip matrices are a follo$s8 perspecti'e on the left an# ortho%raphic on the ri%ht&
Chapter 10 2otes
-*
Chapter 10 2otes
-,
Chapter 10 2otes
--
"creen "pace
Nnce $e ha'e clippe# the %eometry to the 'ie$ frustum8 it is proBecte# into screen space8 $hich correspon#s to actual pi0els in the frame buffer& 5emember that $e are ren#erin% into an output $in#o$ that #oes not necessarily occupy the entire #isplay #e'ice& 4o$e'er8 $e usually $ant our screen space coor#inates to be specifie# usin% coor#inates that are absolute to the ren#erin% #e'ice&
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' -.
Chapter 10 2otes
-/
Chapter 10 2otes
-1
Chapter 10 2otes
.0
wMbufferin%
"pea+in% of (8 $hat happens to clip(9 The precise #etails can 'ary8 but in %eneral itVs use# in some $ay for #epth bufferin%& @ tra#itional metho# is to ta+e the normaliIe# #epth 'alue clip(>clipw an# store this 'alue in the #epth buffer& @n alternati'e strate%y8 +no$n as wMbufferin% is to use clipw as the #epth 'alue& In most situations clipw is simply a scale# 'ersion of the cameraMspace ( 'alue8 an# thus by usin% clipw in the #epth buffer8 each 'alue has a linear relationship to the 'ie$in% #epth of the correspon#in% pi0el& This metho# can be attracti'e if the #epth buffer is fi0e#Mpoint $ith limite# precision8 because it sprea#s out the a'ailable precision more e'enly&
Chapter 10 2otes
.1
wMbufferin%
The tra#itional metho# of storin% clip(>clipw in the #epth buffer results in %reatly increase# precision up close8 at the e0pense of ;sometimes #rastically< re#uce# precision near the far clip plane& The precise #etails $ill #epen# on e0actly $hat sort of clip 'alues are use# for clippin%8 an# $hat sort of #epth 'alues %o into the #epth buffer& For e0ample8 in NpenG=8 the conceptual con'ention is for the 'ie$ frustum to contain H1 Y clip(>clipw Y 18 but this mi%ht not be optimal for #epth bufferin%& Dri'er 'en#ors must con'ert from the @PIVs conceptual con'entions to $hate'er is optimal for the har#$are& If the #epth buffer 'alues are store# in floatin% point8 this issue is much less important& @lso note that this #oesnVt $or+ for ortho%raphic proBection8 since an ortho%raphic proBection matri0 al$ays outputs w L 1&
Chapter 10 2otes
.)
Chapter 10 2otes
.*
Tan%ent "pace
Tan"ent space is a local space on the surface of an obBect8 $ith one basis 'ector the surface normal8 an# the other t$o basis 'ectors locally tan%ent to the surface& This establishes a )D coor#inate space that is flat on the surface at a %i'en spot& Cy far the most common reason to establish such a coor#inate space is for bump mappin% an# relate# techni(ues& More on this $hen $e co'er te0ture mappin% later& Tan%ent space is sometimes calle# s%rface'local space&
Chapter 10 2otes
.,
Chapter 10 2otes
.-
"ection 10&*:
Trian%le Meshes
Chapter 10 2otes
..
C"G
Constructi'e soli# %eometry ;C"G< is a system for #escribin% an obBects shape usin% Coolean operators ;union8 intersection8 subtraction< on primiti'es& Within 'i#eo %ames8 C"G can be especially useful for rapi# prototypin% tools8 $ith the Gnreal en%ine bein% a notable e0ample&
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' ./
Metaballs
Meta$alls are use# to mo#el or%anic shapes an# flui#s& @ three #imensional scalar #ensity function is #efine# surroun#in% each ball base# on the #istance to the center& Cy summin% the #ensity o'er all the balls8 $e can #efine an a%%re%ate #ensity function for any arbitrary point in space& The tric+ to metaballs is that the 'olume of the obBect is #efine# to be the re%ion $here the #ensity e0cee#s some nonIero threshol#& Thus balls ha'e a fuIIy re%ion aroun# them that e0ten#s outsi#e of the 'olume $hen the ball is in isolation& When t$o or more balls come to%ether8 the fuIIy re%ions interfere constructi'ely8 causin% a %raceful bon# of soli# 'olume to materialiIe in the re%ion in bet$een the balls8 $here no such soli# $oul# e0ist if either ball $ere there alone&
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' .1
Trian%le Meshes
C"G8 metaballs8 an# other 'olumetric #escriptions are 'ery useful in particular realms8 but for ren#erin% ;especially realMtime ren#erin%< $e are intereste# in a #escription of the surface of the obBect8 an# sel#om nee# to #etermine $hether a %i'en point is insi#e or outsi#e this surface& In#ee#8 the surface nee# not be close# or e'en #efine a coherent 'olume& The most common surface #escription is the poly"on mesh& In certain circumstances itVs useful to allo$ the poly%ons that form the surface of the obBect to ha'e an arbitrary number of 'erticesK this is often the case in importin% an# e#itin% tools& For realMtime ren#erin%8 ho$e'er8 mo#ern har#$are is optimiIe# for trian"le meshes8 $hich are poly%on meshes $here e'ery poly%on is a trian%le&
Chapter 10 2otes
/0
Chapter 10 2otes
/1
Chapter 10 2otes
/3
Trian%le Mesh
@n in)exe) trian"le mesh consists of t$o lists: a list of 'ertices8 an# a list of trian%les& 6ach 'erte0 contains a position in 3D& We may also store other information at the 'erte0 le'el8 such te0ture mappin% coor#inates8 surface normals8 or li%htin% 'alues& @ trian%le is represente# usin% three in#ices into the 'erte0 list& Gsually the or#er that these 'ertices are liste# is si%nificant8 since $e may consi#er faces to ha'e a front an# a bac+ si#es& We $ill a#opt the con'ention that the 'ertices are liste# in cloc+$ise or#er $hen 'ie$e# from the front si#e& Nther information may also be store# at the trian%le le'el8 such as a precompute# normal of the plane containin% the trian%le8 surface properties ;such as a te0ture map<8 etc&
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' /*
?erte0 "tructure
Chapter 10 2otes
/,
Trian%le "tructure
Chapter 10 2otes
/-
Chapter 10 2otes
/.
60ample
4ere is ho$ a cube an# a pyrami# mi%ht be represente# as a poly%on mesh or a trian%le mesh& 2ote that in either case8 it is a sin%le mesh $ith 13 'ertices& The li%hter8 thic+er $ires sho$ the outlines of poly%ons8 an# the %reen $ires sho$ one $ay to a## a##itional e#%es to trian%ulate the poly%on mesh&
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' //
Chapter 10 2otes
/1
Chapter 10 2otes
11
Implementation 2otes
@##itional #ata is almost al$ays store# per 'erte08 such as te0ture coor#inates8 surface normals8 basis 'ectors8 colors8 s+innin% #ata8 etc& @##itional #ata can also be store# at the trian%le le'el8 such as an in#e0 that tells $hich material to use for that face8 or the plane e(uation for the face& This is hi%hly useful for e#itin% purposes or in other tools that perform mesh manipulations& For realMtime ren#erin%8 ho$e'er8 $e sel#om store a##itional #ata at the trian%le le'el& In fact8 its 'ery common to not ha'e a struct Triangle at all8 an# simply represent the entire list of trian%les as an array li+e unsigned short []8 $here the len%th of the array is the number of trian%les times three& Trian%les $ith i#entical properties are %roupe# into batches so that an entire batch can be fe# to the GPG in this optimal format& We recommen# that you #on!t try to use the same mesh class for both ren#erin% an# e#itin%& The re(uirements are 'ery #ifferent8 an# a bul+ier #ata structure $ith more fle0ibility is best for use in tools etc&
Chapter 10 2otes
1)
Implementation 2otes
2ote that in an in#e0e# trian%le mesh8 the e#%es are not store# e0plicitly8 but rather the a#Bacency information containe# in an in#e0e# trian%le list is store# implicitly: to locate share# e#%es bet$een trian%les8 $e must search the trian%le list& Nur ori%inal tri'ial 7array of trian%les: format #i# not ha'e any lo%ical connecti'ity information&
4o$e'er8 $hat!s surprisin% is that the 7e0tra: connecti'ity information containe# in the in#e0e# representation actually results in a re#uction of memory usa%e in most cases8 compare# to the flat metho#& The reason for this is that the information store# at the 'erte0 le'el8 $hich is #uplicate# in the tri'ial flat format8 is relati'ely lar%e compare# to a sin%le inte%er in#e0& ;@t the minimum8 $e most store a 3D 'ector position&< In meshes that arise in practice8 a typical 'erte0 has 3H- nei%hbors8 $hich means that the flat format #uplicates (uite a lot of #ata&
Chapter 10 2otes
13
Implementation 2otes
The simple in#e0e# trian%le mesh scheme is appropriate for many simple applications8 inclu#in% the 'ery important one of ren#erin%& 4o$e'er8 some operations on trian%le meshes re(uire a more a#'ance# #ata structure in or#er to be implemente# more efficiently& The basic problem is that the a#Bacency bet$een trian%les is not e0presse# e0plicitly an# must be e0tracte# by searchin% the trian%le list& Nther representation techni(ues ma+e this information a'ailable in constant time& Nne i#ea is to maintain an e#%e list e0plicitly&
6ach e#%e is #efine# by listin% the t$o 'ertices on the en#s& We also maintain a list of trian%les that share the e#%e& Then the trian%les can be 'ie$e# as a list of three e#%es rather than a list of three 'ertices8 so that they are store# as three in#ices into the e#%e list rather than the 'erte0 list&
@n e0tension of this i#ea is +no$n as the win"e) e)"e mo)el8 $hich also stores8 for each 'erte08 a reference to one e#%e that uses the 'erte0& The e#%es an# trian%les may be tra'erse# intelli%ently to (uic+ly locate all e#%es an# trian%les that use the 'erte0&
Chapter 10 2otes
1*
Chapter 10 2otes
1,
Chapter 10 2otes
1-
What to Do9
If har#$are resources permit8 then $e can appro0imate the normal of the continuous surface correspon#in% to any point on a %i'en face by interpolatin% 'erte0 normals an# renormaliIin% the result& This is illustrate# belo$: a cross section of a cylin#er ;blac+ circle< is bein% appro0imate# by a he0a%onal prism ;blue<& Clac+ normals at the 'ertices are the true surface normals8 $hile the interior normals are bein% appro0imate# throu%h interpolation& The actual normals use# $oul# be the result of stretchin% these to unit len%th&
Chapter 10 2otes
1.
Chapter 10 2otes
1/
Phon% "ha#in%
4ere is perMpi0el li%htin% of cylin#ers $ith #ifferent numbers of si#es& @lthou%h the illusion brea+s #o$n on the en#s of the cylin#er8 this metho# of appro0imatin% a smooth surface can ma+e e'en a 'ery lo$Mresolution mesh loo+ smooth& Co'er up the en#s of the cylin#er8 an# e'en the ,Msi#e# cylin#er is remar+ably con'incin%&
Chapter 10 2otes
11
Chapter 10 2otes
101
Chapter 10 2otes
10)
Chapter 10 2otes
103
@ Gotcha
@'era%in% face normals to compute 'erte0 normals is a trie#M an#Mtrue techni(ue that $or+s $ell in most cases& 4o$e'er8 there are a fe$ thin%s to $atch out for8 as this picture sho$s&
"ometimes the mesh is suppose# to ha'e a #iscontinuity8 an# if $e!re not careful8 this #iscontinuity coul# %et smoothe# out& Ta+e the 'ery simple e0ample of a bo0& There shoul# be a sharp li%htin% #iscontinuity at its e#%es& 4o$e'er8 if $e use 'erte0 normals compute# from the a'era%e of the surface normals8 then there is no li%htin% #iscontinuity&
Chapter 10 2otes
10*
Detachin% Faces
The basic problem is that the surface #iscontinuity at the bo0 e#%es cannot be properly represente# because there is only one normal store# per 'erte0& The solution to this problem is to )etach the facesK in other $or#s8 #uplicate the 'ertices alon% the e#%e $here there is a true %eometric #iscontinuity& In #oin% so8 $e create a #iscontinuity to pre'ent the 'erte0 normals from bein% a'era%e#& @t this point8 the faces are no lon%er lo%ically connecte#8 but this seam in the topolo%y of the mesh #oesn!t cause a problem for many important tas+s such as ren#erin% an# ray tracin%& 2e0t8 cubes $ith $el#e# 's& #etache# facesA
Chapter 10 2otes
10,
Chapter 10 2otes
10-
Chapter 10 2otes
10.
Cillboar#s
@n e0treme 'ersion of this situation occurs $hen t$o faces are place# bac+MtoM bac+8 $hich is calle# a $ill$oar)& "uch infinitely thin #oubleMsi#e# %eometry can arise $ith folia%e an# cloth& In this case8 since the normals are e0actly opposite8 a'era%in% them pro#uces the Iero 'ector8 $hich cannot be normaliIe#& The simplest solution is to #etach the faces so that the 'erte0 normals $ill not a'era%e to%ether& Nr if the front an# bac+ si#es are mirror ima%es8 the t$o sin%leMsi#e# poly%ons can be replace# by one #oubleMsi#e# one& This re(uires special treatment #urin% ren#erin% to #isable bac+face cullin% ;more later< an# #ealin% $ith the normal intelli%ently in the li%htin% e(uation&
Chapter 10 2otes
10/
Chapter 10 2otes
101
6#%e Turnin%
Cut this topolo%y is the result of an arbitrary #ecision as to $here to #ra$ the e#%es to trian%ulate the faces of the cube& For e0ample8 if $e $ere to trian%ulate the top face by #ra$in% an e#%e bet$een 'ertices 0 an# ) ;this is +no$n as t%rnin" the e#%e8 see pictures at ri%ht<8 all of the normals on the top face $oul# chan%e& Techni(ues e0ist to #eal $ith this problem8 such as $ei%hin% the contribution from each a#Bacent face base# on the interior an%le a#Bacent to the 'erte0& Cut it!s often i%nore# in practice& Most of the really terrible e0amples are contri'e# ones li+e this8 $here the faces shoul# be #etache#8 any$ay& Furthermore8 the normals are an appro0imation to be%in $ith8 an# ha'in% a sli%htly perturbe# normal is often #ifficult to tell 'isually&
Chapter 10 2otes
110
Chapter 10 2otes
111
60ample of Contra'ariance
Ima%ine $e stretch a )D obBect such as a circle horiIontally& 2otice that the normals be%in to turn to point more 'erticallyRthe horiIontal coor#inates of the normals are #ecreasin% in absolute 'alue8 as the horiIontal coor#inates of the positions are increasin%& @ stretchin% of the obBect ;obBect %ettin% bi%%er $hile coor#inates space stays the same< has the same effect as scalin% #o$n the coor#inate space $hile hol#in% the obBect at the same siIe& The coor#inates of the normal chan%e in the same #irection as the scale of the coor#inate space8 $hich is $hy they are calle# co'ariant 'ectors&
Chapter 10 2otes
11)
"ection 10&,:
Te0ture Mappin%
Chapter 10 2otes
11*
Te0ture Mappin%
@ te0ture map is a bitmap ima%e that is paste# onto the surface of an obBect& @ texel is a sin%le pi0el in a te0ture map& Planar mappin" proBects the te0ture ortho%raphically onto the mesh& Spherical8 cylin)rical8 an# c%$ic mappin% are 'arious metho#s of $rappin% the te0ture aroun# the obBect& The +ey point is that8 at each point on the surface of the mesh8 $e can obtain te0ture mappin% coor#inates8 $hich #efine the )D location in the te0ture map that correspon#s to this 3D location& Tra#itionally8 these coor#inates are assi%ne# the 'ariables ; %8 v<8 $here % is the horiIontal coor#inate an# v is the 'ertical coor#inate8 thus te0ture mappin% coor#inates are often calle# UV coor)inates or simply UV.s&
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' 11,
G? Coor#inates
@lthou%h bitmaps come in #ifferent siIes8 G? coor#inates are normaliIe# such that the mappin% space ran%es from 0 to 1 o'er the entire $i#th ;%< or hei%ht ;v< of the ima%e8 rather than #epen#in% on the ima%e #imensions& The ori%in of this space is either in the upperMleftM han# corner of the ima%e ;DirectZ<8 or in the lo$er left corner ;NpenG=<& We!ll use DirectZ con'entions&
Chapter 10 2otes
11-
60ample
Chapter 10 2otes
11.
Chapter 10 2otes
11/
Chapter 10 2otes
1)0
"ection 10&-:
Chapter 10 2otes
1)1
Chapter 10 2otes
1)*
c is short for contri$%tion or component& There!s not much to say about cemis/ it!s a fi0e# 'alue&
Chapter 10 2otes
1),
Chapter 10 2otes
1)1
Phon% Parameters
r: the reflection 'ector8 the result of reflectin% l about n& : the an%le bet$een r an# !& m"ls: the "lossiness of the material8 also +no$n as the Phon" exponent& mspec: the material!s spec%lar color& sspec: the specular color of the li%ht source&
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' 130
Chapter 10 2otes
131
Chapter 10 2otes
13)
Chapter 10 2otes
133
Chapter 10 2otes
13*
Chapter 10 2otes
13,
Chapter 10 2otes
13-
Glossiness
m"ls controls ho$ $i#e the reflection hotspot is& @ smaller 'alue results in a lar%er8 more %ra#ual falloff from the hotspot8 an# a lar%er 'alue results in a 'ery ti%ht hotspot $ith sharp falloff& Perfectly reflecti'e surfaces8 such as %lass8 $ill ha'e a 'ery hi%h 'alue for m"lsRonly a perfectly reflecte# ray of li%ht $ill enter the eye& "hiny surfaces that are not perfect reflectors8 li+e the surface of an apple8 mi%ht ha'e lo$er 'alues8 resultin% in a lar%er hotspot&
Chapter 10 2otes
13.
"hininess
While m"ls controls the siIe of the hotspot8 the shininess mspec controls its intensity& mspec8 is usually a %rayscale 'alue that is constant for the entire material& 4i%hly reflecti'e surfaces $ill ha'e a hi%her 'alue for mspec8 an# more matte surfaces $ill ha'e a lo$er 'alue& If #esire#8 a "loss map may be use# to control the bri%htness of the reflections usin% a bitmap8 much as a te0ture map controls the color of an obBect&
Chapter 10 2otes
13/
Gobos
Furthermore8 e'en i%norin% attenuation8 li%hts #on!t ha'e to ha'e a constant color& For rectan%ular spotli%hts8 $e mi%ht #etermine the color from a "o$o8 $hich is a proBecte# bitmap ima%e& @ colore# %obo mi%ht be use# for a li%ht shinin% throu%h a staine# %lass $in#o$8 or an animate# %obo coul# be use# to fa+e sha#o$s of spinnin% ceilin% fans or trees blo$in% in the $in#& The term "o$o ori%inate# from the $orl# of theater8 $here it refers to a mas+ or filter place# o'er a spotli%ht use# to create a colore# li%ht or special effect8 an# it!s the term $e!ll use& Gobos are 'ery useful for fa+in% special li%htin% situations& If canonical li%hts are not #irectly supporte#8 they can be implemente# $ith an appropriately #esi%ne#circular %obo
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' 131
Chapter 10 2otes
1*0
Chapter 10 2otes
1*1
Chapter 10 2otes
1*)
Chapter 10 2otes
1*3
NptimiIin% Phon%
If the #istance to the 'ie$er is lar%e relati'e to the siIe of an obBect8 then ! may be compute# once an# then consi#ere# constant for an entire obBect& The same is true for a li%ht source an# the 'ector l& ;In fact8 for #irectional li%hts8 l is al$ays constant&< 4o$e'er8 since n is not constant8 $e must still compute r8 a computation $hich $e $oul# li+e to a'oi# if possible.
Chapter 10 2otes
1**
Chapter 10 2otes
1*,
Why are $e #oin% this9 h is sli%htly easier to compute than r& If the 'ie$er an# li%ht source are far enou%h a$ay from the obBect to be consi#ere# a constant8 then h is a constant an# only nee#s to be compute# once&
Chapter 10 2otes
1*-
Chapter 10 2otes
1*.
Chapter 10 2otes
1*/
Diffuse =i%htin%
Diffuse li%htin% #oes not #epen# on the location of the 'ie$er because the reflections are scattere# ran#omly& 4o$e'er8 the position of the li%ht source relati'e to the surface is important& If count the photons of li%ht that hit the surface of the obBect an# ha'e a chance of reflectin% into the eye8 a surface perpen#icular to the rays of li%ht recei'es more rays per unit area than a surface oriente# at a more %lancin% an%le&
Chapter 10 2otes
1*1
Chapter 10 2otes
1,0
Chapter 10 2otes
1,1
Chapter 10 2otes
1,)
=ambert!s =a$
Diffuse li%htin% obeys +am$ert.s law: intensity of reflecte# li%ht is proportional to the cosine of the an%le bet$een the surface normal an# the rays of li%ht& We $ill compute this cosine usin% the #ot pro#uct as usual:
Chapter 10 2otes
1,3
@mbient =i%htin%
"pecular an# #iffuse li%htin% mo#el li%ht rays that tra'el #irectly from the li%ht source to the surface of the obBect an# are then reflecte# to the 'ie$er& 4o$e'er8 in the real $orl#8 li%ht often bounces off of multiple interme#iate obBects before hittin% an obBect an# reflectin% to the eye& There!s li%ht e'ery$here H this is calle# am$ient li"htin"&
Chapter 10 2otes
1,*
Chapter 10 2otes
1,,
=i%ht @ttenuation
=i%ht intensity falls off $ith #istance from the li%ht source H in'ersely proportional to the s(uare of the #istance& This is calle# atten%ation& To sa'e the multiplication8 li%ht attention is often appro0imate# usin% linear interpolation&
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' 1,-
Chapter 10 2otes
1,.
Falloff Distances
=inear interpolation of li%ht attenuation uses t$o parameters& )min is the minim%m falloff )istance& @t #istances ) )min8 the li%ht has intensity 1&0 )max is the maxim%m falloff )istance& @t #istances ) )max8 the li%ht has intensity 0&0 @t #istances )min ) )max the li%ht intensity 'aries $ith 1>)
Chapter 10 2otes
1,/
Chapter 10 2otes
1,1
60ample
The ear is lit Bust as bri%ht as the nose8 e'en thou%h it is actually in the sha#o$ of the hea#& This is a conse(uence of usin% a local li%htin% mo#el& For sha#o$s8 a more a#'ance# techni(ue must be use#&
Chapter 10 2otes
1-0
"pecular
Chapter 10 2otes
1-1
Diffuse
Chapter 10 2otes
1-)
@mbient
Chapter 10 2otes
1-3
@mbient
Without ambient li%ht the si#e of the hea# that is facin% a$ay from the li%ht is completely blac+& In or#er to li%ht the bac+ si#e of obBects8 you must use ambient li%ht& Nr8 you can place enou%h li%hts in your scene so that e'ery surface is lit #irectly&
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' 1-*
2otes
With only ambient li%htin%8 Bust the silhouette is 'isible& =i%htin% is an e0tremely po$erful 'isual cue that ma+es the obBect appear 3D& The solution to this 7cartoon: effect is8 a%ain8 to place a sufficient number of li%hts in the scene so that e'ery surface is lit #irectly&
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' 1-,
Multiple =i%hts
"um the specular an# #iffuse components from each li%ht source&
Chapter 10 2otes
1--
"ha#in% Trian%les
Phon" sha)in": compute li%htin% e(uation for e'ery pi0el& Go%ra%) sha)in": compute li%htin% e(uation at 'ertices an# interpolate across trian%le& 2lat sha)in": compute a sin%le li%htin% 'alue for the $hole trian%le&
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' 1-.
Chapter 10 2otes
1-/
Flat "ha#in%
Chapter 10 2otes
1-1
Gourau# "ha#in%
Chapter 10 2otes
1.0
Phon% "ha#in%
Chapter 10 2otes
1.1
Chapter 10 2otes
1.*
Chapter 10 2otes
1.,
Chapter 10 2otes
1.-
Chapter 10 2otes
1./
Chapter 10 2otes
1.1
Chapter 10 2otes
1/0
Chapter 10 2otes
1/1
Chapter 10 2otes
1/)
"ection 10&.:
=i%ht "ources
Chapter 10 2otes
1/3
Chapter 10 2otes
1/*
Point =i%hts
@ point li%ht source represents li%ht at a sin%le point that ra#iates in all #irections& @lso calle# omni or spherical li%hts& @ttributes:
Position Color ;combines hue an# intensity<& Falloff ra#ius8 ;siIe of the sphere illuminate# by the li%ht<
Chapter 10 2otes
1/-
Directional =i%hts
@ )irectional li%ht represents li%ht emanatin% from a point in space sufficiently far a$ay that all the rays of li%ht point in the same #irection& @ttributes:
Color Nrientation
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' 1/.
"pot =i%hts
@ spot li%ht is use# to represent li%ht from a specific source in a specific #irection& The shape of the lit area is either a cone or pyrami#& @ttributes:
Position Nrientation Color Falloff #istance
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' 1//
Conical "potli%ht
@ conical spotli%ht has a circular bottom& @##itional attributes:
Falloff an%le 4otspot an%le
Chapter 10 2otes
1/1
Chapter 10 2otes
110
5ectan%ular "potli%ht
@ rectan%ular spotli%ht forms a pyrami# rather than a cone& 5ectan%ular spotli%hts are especially interestin% because they are use# to proBect an ima%e& @n ima%e proBecte# in this manner is +no$n as a pro,ecte) li"ht map&
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' 111
@mbient =i%htin%
@ constant li%ht le'el for the entire scene representin% in#irect li%htin%& Without ambient li%ht8 obBects that are in sha#o$ $oul# be completely blac+& @ttributes:
Color
Chapter 10 2otes
11)
=i%ht @ttenuation
=i%ht intensity falls off $ith #istance from the li%ht source H in'ersely proportional to the s(uare of the #istance& This is calle# atten%ation& To sa'e the multiplication8 li%ht attention is often appro0imate# usin% linear interpolation&
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' 113
Chapter 10 2otes
11*
Falloff Distances
=inear interpolation of li%ht attenuation uses t$o parameters& )min is the minim%m falloff )istance& @t #istances ) )min8 the li%ht has intensity 1&0 )max is the maxim%m falloff )istance& @t #istances ) )max8 the li%ht has intensity 0&0 @t #istances )min ) )max the li%ht intensity 'aries $ith 1>)
Chapter 10 2otes
11,
Chapter 10 2otes
11-
Chapter 10 2otes
11.
Chapter 10 2otes
11/
@ppro0imatin% Intensity
The most creati'e aspect of DoomMstyle 'olumetric li%hts is ho$ they #etermine the intensity at a %i'en point& It is controlle# throu%h t$o te0ture maps& Nne map is essentially a %obo8 $hich can be proBecte# usin% either ortho%raphic or perspecti'e proBection8 similar to a spot or #irectional li%ht& The other map is a one #imensional map8 +no$n as the falloff map8 $hich controls the falloff& The proce#ure for #eterminin% the li%ht intensity at point x is as follo$s: x is multiplie# by a *_* matri08 an# the resultin% coor#inates are use# to in#e0 into the t$o maps& The )D %obo is in#e0e# usin% ;x4w8 y4w<8 $hile 1D falloff map is in#e0e# $ith the (& The pro#uct of these t$o te0els #efines the li%ht intensity at x&
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' 111
The omni li%ht proBects the circular %obo ortho%raphically across the bo08 an# places the position of the li%ht ;$hich is use# to compute the l 'ector< in the center of the bo0& The *_* matri0 use# to %enerate the te0ture coor#inates in this case $oul# be as follo$s8 $here sx8 sy8 an# s( are the #imensions of the bo0 on each a0is ;ne0t sli#e<A
Chapter 10 2otes
)00
This matri0 operates on points in the obBect space of the li%ht8 $here the position of the li%ht is in the center of the bo08 so for the matri0 that operates on $orl# space coor#inates8 $e $oul# nee# to leftMmultiply this matri0 by a *_* $orl#MtoMobBect matri0& The ri%htmost column is D08 08 08 1ET8 since $e use an ortho%raphic proBection onto the %obo& The translation of 1>) is to a#Bust the coor#inates from the M1>) to U1>) ran%e into the 0 to 1 ran%e of the te0ture& The y a0is is flippe# since Uy points up8 but Uv points #o$n in the te0ture&
Chapter 10 2otes
)01
The spot li%ht uses a perspecti'e proBection8 $here the center of proBection is at one en# of the bo0& The position of the li%ht use# for calculatin% the l 'ector is at this same location8 but that isn!t al$ays the caseP
Chapter 10 2otes
)0)
Chapter 10 2otes
)03
4ere8 proBection is ortho%raphic an# si#e$ays& The conical nature of the li%ht as $ell as $hat $e or#inarily thin+ of as the falloff are both enco#e# in the %obo& The falloff map use# for this li%ht is the same as the omni li%ht& It is bri%htest in the center of the bo08 an# causes the li%ht to fa#e out as $e approach the M( an# U( faces of the bo0& The te0ture coor#inate matri0 in this case is actually the same as the omni& The entire chan%e comes from usin% a #ifferent %obo8 an# orientin% the li%ht properlyP
Chapter 10 2otes
)0*
Chapter 10 2otes
)0,
Chapter 10 2otes
)0-
Chapter 10 2otes
)0.
"ection 10&/:
"+eletal @nimation
Chapter 10 2otes
)0/
Character @nimation
@rticulate# mo#els are bro+en up into a hierarchy of parts8 for e0ample8 torso8 hea#8 left arm8 ri%ht arm8 etc& In ol#Mschool Play"tation ) %ames8 these articulate# parts are ri%i#8 that is8 they #o not fle0 or ben#& "o the characters loo+ li+e robots& @ better $ay: s+eletal animation&
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' )01
"+eletal @nimation
The i#ea behin# s+eletal animation is to replace the hierarchy of parts $ith an ima%inary hierarchy of bones& Then each 'erte0 of the mo#el is associate# $ith one or more bones8 each of $hich e0ert influence o'er the 'erte0 but #o not totally #etermine its position& @n artist nee#s to specify $hich bones influence $hich 'ertices8 an# by ho$ much& This process is +no$n as s0innin"& "+innin% can be 'ery labor intensi'e& @lthou%h automate# tools e0ist $hich can pro'i#e a (uic+ first pass at the s+innin%8 a $ellM s+inne# character re(uires e0pertise an# time&
Chapter 10 2otes
)10
60ample
=etVs loo+ at an e0ample& The ne0t fi%ure sho$s t$o e0ample s+inne# 'ertices near the elbo$ of a robot& The blue an# %reen #ots sho$ $hat a 'erte0 $oul# loo+ li+e if it $ere ri%i# to the correspon#in% bone& The cyan #ot is the s+inne# 'erte0K notice that it stays attache# to the surface of the mesh&
Chapter 10 2otes
)11
The 'erte0 on the left appears to be influence# about /0S by the forearm bone an# )0S by the upper arm bone8 an# thus it stays close to its green ri%i# 'erte0&
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' )1)
The 'erte0 on the ri%ht appears to be influence# about *0S by the forearm bone an# -0S by the upper arm bone8 an# thus it stays close to its blue ri%i# 'erte0&
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' )13
@ "imple "trate%y
For each 'erte08 +eep a list of bones that influence it& Typically $e set a limit on the number of bones that may influence any one 'erte0& ;Four is common&< For each bone8 $e +no$ the position of the 'erte0 relati'e to the boneVs local a0es8 an# $e ha'e a $ei%ht for that bone& To compute the s+inne# 'erte0 positions for a mo#el in an arbitrary pose8 $e $ill nee# a transform matri0 for each bone8 $hich tells ho$ to con'ert from bone coor#inate space into mo#el space& ?aryin% these transform matrices o'er time is $hat ma+es the character appear to animate& In the follo$in% t$o sli#es $e $ill see some #eclarations an# co#e that implement this simple strate%y&
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' )1*
Chapter 10 2otes
)1,
Chapter 10 2otes
)1-
60ample
The abo'e 3 fi%ures sho$ a s+inne# mo#el in bin#in% pose ;left<8 the s+eleton ;center<8 an# their relati'e positions ;ri%ht<& 5emember that bones are really Bust coor#inate spaces8 an# #onVt ha'e any actual %eometry& The %eometry you see abo'e is Bust so you can see it&
Chapter 10 2otes
)1/
5i%%in%
When the mesh is #one8 it is ri""e)8 $hich means a hierarchy of bones ;a s+eleton< is create# an# the s+innin% #ata is e#ite# to associate 'ertices $ith the appropriate bones& Durin% this process the ri%%er $ill ben# bones to 'arious e0treme an%les to pre'ie$ ho$ $ell the mo#el reacts& This is $here the s+ill an# e0perience of the character mo#eler an# the ri%%er come into play& The point for us is that althou%h Maya is constantly calculatin% ne$ 'erte0 positions in response to the manipulation of the bones8 it has sa'e# the ori%inal mo#elin% space coor#inates of each 'erte08 in the bin#in% pose& 6'erythin% starts $ith that ori%inal 'erte0 position&
Chapter 10 2otes
)11
@n NptimiIation
"tore the position of each 'erte0 in the bin#in% pose8 rather than storin% it relati'e to each bone that e0erts influence& Then8 $hen ren#erin% a mesh8 rather than ha'in% a boneMtoMmo#el transform for each bone8 $e ha'e a matri0 that transforms coor#inates from the ori%inal bin#in% space to mo#elin% space in the current pose& In other $or#s8 this matri0 #escribes the #ifference bet$een the boneVs orientation in the $in)in" pose8 an# its orientation in the c%rrent pose& In the follo$in% t$o sli#es $e $ill see some #eclarations an# co#e that implement this optimiIe# strate%y&
Chapter 10 2otes
))1
Chapter 10 2otes
)))
Chapter 10 2otes
))3
Chapter 10 2otes
))*
"ection 10&1:
Cump Mappin%
Chapter 10 2otes
)),
Cump Mappin%
1%mp mappin" is a %eneral term that can refer to at least t$o #ifferent metho#s of controllin% the surface normal per te0el& @ hei"ht map is a %reyscale map8 $here the intensity in#icates the local ele'ation of the surface& =i%hter colors in#icate portions of the surface that are 7bumpe# out8: an# #ar+ colors are areas $here the surface is 7bumpe# in&: 4ei%ht maps are attracti'e because they are 'ery easy to author8 but they are not i#eal for realMtime purposes8 because the normal is not #irectly a'ailableK instea# it must be calculate# from the intensity %ra#ient& We $ill focus on the techni(ue of normal mappin"8 $hich is 'ery common no$a#ays an# $hat most people usually mean $hen they say 7bump map&:
Chapter 10 2otes
))-
Chapter 10 2otes
)).
First Complication
Complications arise for t$o primary reasons& First8 normal maps are not intuiti'e to e#it& While a hei%ht map ;or true #isplacement map< can be easily painte# in Photoshop8 normal maps are not so easily 'isualiIe# an# e#ite#& CutMan#Mpaste operations on normal maps are usually safe8 but for the normal map to be 'ali#8 each pi0el shoul# enco#e a normaliIe# 'ector& The usual techni(ue for ma+in% a normal map is for an artist to actually mo#el a lo$ an# hi%h res 'ersion of the mesh& The lo$Mres mesh is the one actually use# at run time8 an# the hi%h res mesh is solely to create the bump map8 usin% an automate# tool that raytraces a%ainst the hi%her resolution mesh to #etermine the surface normal for e'ery te0el in the normal map&
Chapter 10 2otes
))/
"econ# Complication
The tric+ier issue is that te0ture memory is a precious resource& In some simple cases8 e'ery te0el in the normal map is use# at most once on the surface of the mesh&
In this case8 $e coul# simply enco#e the normal in obBect space8 an# our earlier #escription $oul# $or+ Bust fine& Cut realM$orl# obBects e0hibit a %reat #eal of symmetry an# selfMsimilarity8 an# patterns are often repeate#& For e0ample8 a bo0 often has similar bumps an# notches on more than one si#e&
Cecause of this8 currently it is a more efficient use of the same amount of memory ;an# artist time< to increase the resolution of the map8 an# reuse the same normal map ;or perhaps Bust portions of it< on multiple mo#els ;or perhaps Bust on multiple places in the same mo#el<& Nf course8 the same principle applies to any sort of te0ture map8 not Bust normal maps& Cut normal maps are #ifferent in that they cannot be arbitrarily rotate# or mirrore#8 because they enco#e a 'ector&
Chapter 10 2otes
))1
Chapter 10 2otes
)30
Chapter 10 2otes
)3)
5ecall that this is the same as multiplyin% st by a matri0 $hose ro$s are basis 'ectors:
u s m = st v n
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' )3*
Chapter 10 2otes
)3,
The left si#e sho$s an e0ample of s5%ishin"& In this case8 the tan%ent 'ector $oul# be pointin% to the ri%ht8 parallel to the horiIontal poly%on e#%es8 $hile the binormal $oul# be locally parallel to the 'ertical ;cur'in%< poly%on e#%es at each 'erte0&
Compare this $ith the te0ture mappin% on the ri%ht si#e8 $here the te0ture mappin% is planar& In this e0ample8 the binormal at e'ery 'erte0 ;an# e'ery interior point< points #irectly #o$n&
Chapter 10 2otes
)3-
Chapter 10 2otes
)3.
Chapter 10 2otes
)3/
Chapter 10 2otes
)31
u =n v
an# then multiply by our fla% to flip the basis 'ector if necessary& This fla% is calculate# usin% the triple pro#uct This is the same as the #eterminant of the transformation matri0 $e sa$ a fe$ sli#es a%o:
u v n
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' )*0
u v n
$hose G? coor#inates are ;%08 v0<8 ;%18 v1<8 an# ;%)8 v)<8 respecti'ely& It is al$ays possible to fin# a planar mappin%8 meanin% that the mappin% %ra#ient is constant o'er the entire trian%le& =et #1 an# #) be trian%le e#%e 'ectors %i'en by
#1 L "1H "08 an# #) L ")H "0
Chapter 10 2otes
)*1
"ee+in% u an# !
"ince $e see+ basis 'ectors u8 ! that lie in the plane of the trian%le8 $e can e0press the trian%le e#%e 'ectors #1 an# #) as a linear combination of u an# !& That is8 us1 U !t1 L #1 us) U !t) L #) We can $rite these e(uations more compactly in matri0 notation as
s1 s 2 t1 u q1 = t 2 v q 2
Chapter 10 2otes
)*)
t1 q1 q s1 2
"ince $e are plannin% on normaliIin% our basis 'ectors8 $e can #rop the lea#in% constant fraction8 an# $e are left $ith: u L t)#1 H t1#) ! L Hs)#1 U s1#)
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' )*3
Chapter 10 2otes
)**
Chapter 10 2otes
)*,
Chapter 10 2otes
)*-
Chapter 10 2otes
)*.
Chapter 10 2otes
)*/
@ Complication
Nne irritatin% complication that is not #ealt $ith by this co#e is that there may be a #iscontinuity in the mappin% $here the basis 'ectors shoul# not be a'era%e# to%ether8 an# the basis 'ectors must be #ifferent across a share# e#%e& Most of the time the faces $ill ha'e alrea#y be #etache# from each other ;the 'ertices $ill be #uplicate#< alon% such an e#%e8 since the G? coor#inates $ill not match& 4o$e'er8 there is unfortunately one particularly common case $here this is not true: mirrore# te0tures on symmetric obBects& For e0ample8 it is common for character mo#els an# other symmetric meshes to ha'e a line #o$n their center $here the te0ture has been mirrore#& The 'ertices alon% this seam 'ery often re(uire i#entical G?s but an opposite u or !& These 'ertices must be #etache# in or#er to a'oi# pro#ucin% in'ali# basis 'ectors alon% this seam&
Chapter 10 2otes
)*1
Do it =ater in a "ha#er
=ater $eVll sho$ some sample sha#er co#e that uses the basis 'ectors to perform bump mappin%& The runtime co#e is surprisin%ly simple once all the #ata has been mun%e# into the ri%ht format& This illustrates a common theme of contemporary realMtime %raphics: about .,S of the co#e is in the tools that manipulate the #ata8 optimiIin%8 pac+in%8 an# other$ise manipulatin% it into Bust the ri%ht format so that the runtime co#e ;the other ),S< can run as fast as possible&
Chapter 10 2otes
),0
"ection 10&10:
Chapter 10 2otes
),1
Chapter 10 2otes
),)
Ca'eat 1
There is no such thin% as the 7typical: mo#ern %raphics pipeline& The number of #ifferent ren#erin% strate%ies is e(ual to the number of %raphics pro%rammers& 6'eryone has his or her o$n preferences8 tric+s8 an# optimiIations& Graphics har#$are continues to e'ol'e rapi)ly& @s e'i#ence8 the use of sha#er pro%rams is no$ in $i#esprea# use in consumer har#$are li+e %amin% consoles8 an# this technolo%y $as in its infancy at the time of the $ritin% of the first e#ition of this boo+& "till8 althou%h there is %reat 'ariance in %raphics systems an# %raphics pro%rammers8 most systems #o ha'e a %reat #eal in common& WeV# li+e to reiterate that our %oal is to %i'e you a soli# o'er'ie$8 especially $here the mathematics are in'ol'e#8 from $hich you can e0pan# your +no$le#%e& This is not a sur'ey of the latest cuttin% e#%e techni(ues&
Chapter 10 2otes
),3
Ca'eat )
We $ill attempt to #escribe the basic proce#ure for %eneratin% a sin%le ren#ere# ima%e $ith 'ery basic li%htin%& We $ill not consi#er animation8 an# $e $ill only briefly mention techni(ues for %lobal illumination& Nur #escription $ill be of the conceptual flo$ of #ata throu%h the %raphics pipeline& In practice8 tas+s are often performe# in parallel or out of se(uence for performance reasons&
Chapter 10 2otes
),*
Ca'eat 3
We are intereste# in realMtime ren#erin% systems $hich8 at the time of this $ritin%8 are primarily %eare# for ren#erin% trian%le meshes& Nther means of pro#ucin% an ima%e8 such as raytracin"8 ha'e a 'ery #ifferent hi%h le'el structure than #iscusse# here& Ce $arne# that future techni(ues for realMtime an# offMline ren#erin% coul# con'er%e if parallel raytracin% pro'es to be a more economical $ay to +eep up $ith the ine0orable march of MooreVs la$&
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' ),,
Chapter 10 2otes
),1
Chapter 10 2otes
)-0
Chapter 10 2otes
)-1
Chapter 10 2otes
)-)
Chapter 10 2otes
)-3
Chapter 10 2otes
)-*
Chapter 10 2otes
)-,
Chapter 10 2otes
)--
Chapter 10 2otes
)-1
Chapter 10 2otes
).0
Cuffers
@ buffer is simply a rectan%ular re%ion of memory that stores some sort of #ata per pi0el& The most important buffers are the frame $%ffer an# the )epth $%ffer& The frame buffer hol#s the ren#ere# ima%e8 that is8 it stores one color per pi0el& This color may be store# in a 'ariety of formatsK the 'ariations are not si%nificant for the current #iscussion& In realMtime animation8 the frame buffer is normally locate# in 'i#eo 5@M& The vi)eo seriali(er on the 'i#eo car# is constantly rea#in% this area of 'i#eo 5@M8 con'ertin% the binary #ata into the appropriate si%nal to be sent to the #isplay #e'ice& Cut ho$ can the 'i#eo serialiIer rea# the frame buffer at the same time that the ren#erer is tryin% to $rite to it9
Chapter 10 2otes
).1
Double Cufferin%
@ techni(ue +no$n as )o%$le $%fferin" is use# to pre'ent an ima%e from bein% #isplaye# before it is completely ren#ere#& Double bufferin% uses t$o frame buffers ;%o fi%ure<& Nne frame buffer8 the front or )isplay buffer8 hol#s the ima%e currently #isplaye# on the monitor& The bac+ buffer is the offMscreen buffer that hol#s the ima%e currently bein% ren#ere#& When $e ha'e finishe# ren#erin% an ima%e an# are rea#y for it to be #isplaye#8 $e flip the buffers ;DirectZ uses the 'erb present<& We can #o this in one of t$o $ays& 1& If $e use pa%e flippin%8 then $e instruct the 'i#eo har#$are to be%in rea#in% from the buffer that $as the offMscreen buffer& We then s$ap the roles of the t$o buffersK the #isplay buffer no$ becomes the offMscreen buffer& This can be #one (uic+ly by s$appin% t$o pointers& )& Nr $e may blit ;copy< the offMscreen buffer o'er the #isplay buffer&
Chapter 10 2otes
).)
Chapter 10 2otes
).3
Chapter 10 2otes
).*
Chapter 10 2otes
).,
@fter #eci#in% $hich obBects to ren#er8 $e nee# to actually ren#er them& This is a t$oMstep process& First8 $e must set up the ren#er conte0t& This in'ol'es tellin% the ren#erer $hat 'erte0 an# pi0el sha#ers to use8 $hat te0tures to use8 an# settin% any other constants nee#e# by the sha#ers8 such as the transform matrices8 or li%htin% positions8 colors8 fo% settin%s8 etc& The #etails of this process #epen# %reatly on your hi%hMle'el ren#erin% strate%y an# tar%et platform8 so there isnVt much more specific $e can say here8 althou%h $eVll %i'e some e0amples later&
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' ).-
Chapter 10 2otes
)..
"ha#er Constants
Nf course8 in or#er for you to properly #etermine the proper clipMspace coor#inates8 you $ill probably nee# the matri0 that transforms from mo#el space to clip space& ou can pass parameters li+e this that apply to all the 'ertices or pi0els in a %i'en batch of trian%les by settin% sha)er constants&
This is conceptually Bust a lar%e table of 'ector 'alues that is part of the ren#er conte0t an# for you to use $hene'er an# ho$e'er you nee#& @ctually8 there is usually one set of re%isters assi%ne# for use in the 'erte0 sha#er an# a #ifferent set of re%isters that can be accesse# in the pi0el sha#er&
Chapter 10 2otes
).1
Chapter 10 2otes
)/1
Chapter 10 2otes
)/)
Typical ?erte0 =e'el Information: 3& "urface 2ormal8 an# *& Color
$urface Normal: Most li%htin% calculations nee# the surface normal& 6'en thou%h these li%htin% e(uations are often #one perMpi0el $ith the surface normal bein% #etermine# from a normal map8 $e still often store a normal at the 'erte0 le'el in or#er to establish the basis for tan%ent space& %olor: "ometimes itVs useful to assi%n a color input to each 'erte0& For e0ample8 if $e are ren#erin% particles8 the color of the particle may chan%e o'er time& Nr $e may use one channel ;such as alpha< to control the blen#in% bet$een t$o te0ture layers& @n artist can e#it the 'erte0 alpha to control this blen#in%& We mi%ht also ha'e perM'erte0 li%htin% calculations that $ere #one offline&
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' )/3
Chapter 10 2otes
)/*
Chapter 10 2otes
)/,
Chapter 10 2otes
)/-
Chapter 10 2otes
)/.
Chapter 10 2otes
)//
Chapter 10 2otes
)/1
?erte0 Format 60ample 4ereVs a 'erte0 that mi%ht be use# for s+eletal ren#erin%& The in#ices are store# in four /M bit 'alues8 an# the $ei%hts are store# as four floats&
Chapter 10 2otes
)10
Chapter 10 2otes
)11
The Graphics Pipeline ,: More on ?erte0 =e'el Nperations @fter mesh #ata has been submitte#8 a $i#e ran%e of 'erte0 le'el computations are performe#& In a sha#erMbase# ren#erer ;as oppose# to a fi0e#M function pipeline<8 this happens in the 'erte0 sha#er& The input to a 'erte0 sha#er is essentially one of the structs $e Bust #escribe#& @s $e #iscusse# earlier8 a 'erte0 sha#er can pro#uce many #ifferent types of output8 but there are t$o basic responsibilities it must fulfill&
Chapter 10 2otes
)1)
Chapter 10 2otes
)13
Chapter 10 2otes
)1,
@s $e mentione# alrea#y8 $e #onVt actually perform three separate matri0 multiplications in practice& We ha'e one matri0 that transforms from mo#el space to clip space8 an# insi#e the 'erte0 sha#er $e perform one matri0 multiplication usin% this matri0&
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' )1.
Chapter 10 2otes
)1/
Clippin%
Cefore $e can proBect the 'ertices onto screen space8 $e must ensure that they are completely insi#e the 'ie$ frustum& This process is +no$n as clippin"& "ince clippin% is normally performe# by the har#$are8 $e $ill only #escribe the process $ith cursory #etail& The stan#ar# al%orithm for clippin% poly%ons is the S%therlan)' *o)"man al"orithm8 $hich tac+les the #ifficult problem of poly%on clippin% by brea+in% it #o$n into a se(uence of easy subproblems&
Chapter 10 2otes
)11
"utherlan#M4o#%man
The input poly%on is clippe# a%ainst one plane at a time& To clip a poly%on a%ainst one plane8 $e iterate aroun# the poly%on8 clippin% each e#%e a%ainst the plane in se(uence& 6ach of the t$o 'ertices of the e#%e may be insi#e or outsi#e the plane8 thus there are four cases& 6ach case may %enerate Iero8 one8 or t$o output 'ertices8 as follo$s:
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' 300
Chapter 10 2otes
301
"utherlan#M4o#%man 60ample
The ne0t sli#e sho$s an e0ample of ho$ $e can apply these rules to clip a poly%on a%ainst the ri%ht clip plane& 5emember that the clipper outputs 'ertices8 not e#%es& In this fi%ure the e#%es are #ra$n only for illustration& In particular8 the final clip step appears to output t$o e#%es $hen actually only one 'erte0 $as output& The last e#%e is implicit to complete the poly%on&
Chapter 10 2otes
30)
Chapter 10 2otes
303
Clippin% 2otes
"ome %raphics har#$are #oes not clip poly%ons to all si0 planes in 3D ;or *D<& Instea#8 only the near clip is performe#8 an# then scissorin% is #one in )D to clip to the $in#o$& This can be a performance $in because clippin% is slo$ on certain har#$are& @ 'ariation on this techni(ue is to employ a %uar# ban#& Poly%ons completely outsi#e the screen are reBecte#8 poly%ons completely insi#e the %uar# ban# are scissore# rather than clippe# in 3D8 an# poly%ons that are partially on screen but outsi#e of the %uar# ban# are clippe# in 3D&
Chapter 10 2otes
30*
Cac+face Cullin%
1ac0face c%llin" reBects trian%les that face a$ay from the camera& In opa(ue close# meshes $e shoul# ne'er see the bac+ si#e of a trian%le unless $e are allo$e# to %o insi#e the mesh& 5emo'al of bac+facin% trian%les isn!t strictly necessary in an opa(ue mesh8 but $e cull bac+ faces because $e #onVt $ant to $aste time #ra$in% anythin% that isnVt 'isible& For #ynamic obBects that mo'e aroun# in the $orl# freely8 rou%hly half of the faces $ill be bac+facin% on a'era%e& This isn!t true for thin%s li+e terrain&
Chapter 10 2otes
30,
Cac+face Cullin% in )D
Cac+facin% trian%les can be #etecte# in 3D ;before proBection< or )D ;after proBection<& Nn mo#ern %raphics har#$are8 bac+face cullin% is performe# in )D base# on the #irection of 'erte0 enumeration in screen space& In a leftMhan#e# coor#inate system8 or#er the 'ertices cloc+$ise aroun# the trian%le $hen 'ie$e# from the front&& Cac+facin% trian%les ha'e 'ertices or#ere# counterMcloc+$ise on the screen&
Chapter 10 2otes
30-
Cac+face Cullin% in 3D
)D bac+face cullin% is usually #one in har#$are& ou can turn it off $hen not nee#e#& Cac+face cullin% sometimes nee#s to be #one in 3D8 e&%& In soft$are ren#erin%& Ta+e the #ot pro#uct of the trian%le normal $ith the 'ector from the camera to one of its 'ertices& Cull those trian%les $hose #ot pro#uct is positi'e&
Chapter 10 2otes
30.
Chapter 10 2otes
30/
Chapter 10 2otes
310
Chapter 10 2otes
311
Chapter 10 2otes
31)
"ection 10&11:
Chapter 10 2otes
31,
Chapter 10 2otes
31-
Input
This struct #eclares the inputs $e recei'e from the mesh& 2ote that the or#er here is not important& Inputs are i#entifie# by their semantic8 $hich is the thin% on the ri%ht after the colon& When sen#in% the 'erte0 list to the ren#erer8 $e must specify the semantic of each 'erte0 element&
Chapter 10 2otes
31/
Nutput
This is the #ata $e $ill output from our 'erte0 sha#er& These are matche# up $ith the pi0el sha#er inputs base# on the semantic&
4ere $e #eclare a %lobal 'ariable8 a sha#er constant that hol#s the mo#elbclip transform matri0&
Chapter 10 2otes
311
Chapter 10 2otes
3)0
Chapter 10 2otes
3)1
4ere8 Bust to sho$ ho$ a pi0el sha#er constant $or+s8 $e #eclare a %lobal constant color& The output of our sha#er is multiplie# by this 5GC@ 'alue& Nne of the most common reasons to ha'e such a constant is to a## an opacity settin% into the ren#er conte0t8 but itVs 'ery han#y to ha'e a full 5GC@ constant color&
Chapter 10 2otes
3))
Chapter 10 2otes
3)3
Chapter 10 2otes
3)*
Callin% Parameters
Clearly8 the hi%her le'el co#e must supply the sha#er constants an# the primiti'e #ata properly& The simplest $ay to match up a sha#er constant $ith the hi%her le'el co#e is to specifically assi%n a re%ister number to a constant usin% special 4="= 'ariable #eclaration synta0 There are subtler techni(ues8 such as locatin% constants by name&
Chapter 10 2otes
3),
?erte0 "ha#er
For the first e0ample8 $e $ill #o all of the $or+ in the pi0el sha#er& In this case8 the 'erte0 sha#er is fairly tri'ial& It Bust nee#s to pass throu%h the inputs to the pi0el sha#er&
Chapter 10 2otes
3).
Chapter 10 2otes
3)/
Chapter 10 2otes
3)1
Pi0el "ha#er
4ereVs the correspon#in% pi0el sha#er8 $here all the action happens& 2otice that $e are usin% t$o #ifferent te0ture maps8 one for the #iffuse color8 an# another for the specular color& We assume that the t$o maps use the same te0ture mappin% coor#inates&
Chapter 10 2otes
330
Chapter 10 2otes
331
Chapter 10 2otes
33)
2ote that $e assume that #iffuse an# spec maps are mappe# the same8 an# so they use the same G? coor#inates&
Chapter 10 2otes
333
Chapter 10 2otes
33*
Chapter 10 2otes
33,
Chapter 10 2otes
33.
Chapter 10 2otes
33/
Chapter 10 2otes
331
Chapter 10 2otes
3*0
Chapter 10 2otes
3*1
Chapter 10 2otes
3*)
2otice $e!'e mo'e# t$o %lobals from the pi0el sha#er ;at left< to the 'erte0 sha#er ;abo'e<& Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' 3*3
Chapter 10 2otes
3**
Chapter 10 2otes
3*,
Global ?ariables
Chapter 10 2otes
3*-
Co#e
Chapter 10 2otes
3*.
Co#e
Chapter 10 2otes
3*/
Gourau# "ha#in%
6'en mo#est mo#ern har#$are has plenty of beef for Phon% sha#in%K in#ee# the pre'ious e0amples are relati'ely cheap sha#ers& 4o$e'er8 itVs 'ery instructi'e to consi#er ho$ to implement Gourau# sha#in%& 6'en thou%h the results are inferior to Phon% sha#in%8 an# Gourau# sha#in% preclu#es bump mappin%8 Gourau# sha#in% can still be useful on the PC to emulate the results of other har#$are& Go bac+ to our sha#ers for basic perMpi0el li%htin% an# $or+ from there&
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' 3*1
Gourau# "ha#in%:
Chapter 10 2otes
3,0
Gourau# "ha#in%:
Chapter 10 2otes
3,1
Chapter 10 2otes
3,)
Chapter 10 2otes
3,3
Gourau# "ha#in%:
Chapter 10 2otes
3,*
Gourau# "ha#in%:
Chapter 10 2otes
3,,
Gourau# "ha#in%:
Chapter 10 2otes
3,-
Cump Mappin%
2e0t8 letVs loo+ at an e0ample of normal mappin%& We $ill be performin% the li%htin% in tan%ent space8 an# $eVll stic+ $ith the li%htin% en'ironment of a sin%le omni li%ht plus constant ambient8 to ma+e the e0amples easier to compare& In the 'erte0 sha#er8 $e ta+e the t$o basis 'ectors an# synthesiIe the binormal& Then8 $e use the three basis 'ectors to rotate = an# 4 into tan%ent space8 after first computin% them as usual in mo#el space& 2otice the use of the three #ot pro#ucts8 each of $hich is e(ui'alent to multiplication by the transpose of the matri0& We also perform the attenuation calculations in the 'erte0 sha#er8 passin% the unclampe# attenuate# li%ht color8 as in the earlier e0amples&
Chapter 10 2otes
3,.
Cump Mappin%:
Chapter 10 2otes
3,/
Cump Mappin%:
Chapter 10 2otes
3,1
Cump Mappin%:
Chapter 10 2otes
3-0
Cump Mappin%:
Pi0el "ha#er
The pi0el sha#er is (uite compact8 since most of the prep $or+ has been #one in the 'erte0 sha#er& We unpac+ the normal8 an# normaliIe the interpolate# L an# & 'ectors& Then $e perform the ClinnMPhon% li%htin% e(uation Bust as in other e0amples&
Chapter 10 2otes 3D Math Primer for Graphics 3 Game De' 3-1
Cump Mappin%:
Chapter 10 2otes
3-)
Cump Mappin%:
Chapter 10 2otes
3-3
Cump Mappin%:
Chapter 10 2otes
3-*
"+inne# Mesh
2o$ for some e0amples of s+eletal ren#erin%& @ll of the s+innin% happens in the 'erte0 sha#ers8 an# so $e $ill not nee# to sho$ any pi0el sha#ers& This is not unusual: s+inne# an# uns+inne# %eometry can usually share the same pi0el sha#er& WeVll %i'e t$o e0amples& The first e0ample illustrates perMpi0el li%htin% of our omniUambient li%htin% ri%& Then $e!ll a## bump mappin%&
Chapter 10 2otes
3-,
"+inne# Mesh:
Chapter 10 2otes
3--
"+inne# Mesh:
Chapter 10 2otes
3-.
Chapter 10 2otes
3-/
Chapter 10 2otes
3-1
Chapter 10 2otes
3.0
Chapter 10 2otes
3.1
Chapter 10 2otes
3.)
Chapter 10 2otes
3.3