Real-Time Rendering (2nd Edition)

Info icon This preview shows pages 1–17. Sign up to view the full content.

View Full Document Right Arrow Icon
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
Image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 6
Image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 8
Image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 10
Image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 12
Image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 14
Image of page 15

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 16
Image of page 17
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ECE 595 / CS 491 / C3591 Real-time Rendering and Graphics Hardware, Spring 2007 Midterm You have 1 hour, 15 minutes to complete this exam This exam is closed book and closed notes. The number in brackets (e.g. [51) tells you how many points each problem is worth If there are several parts, I sometimes break it down for each part to give you an idea of how I will grade it. This exam might be long for some of you. The pages are double-sided and there are 45 problems in total, which gives you a 1:40 to work on each problem. Some of the problems you will answer quickly, which will save you time for the problems that take longer. The exam is worth a total of 186 points. I suggest that in order to maximize your score, you work fast and efficiently. It would help to go through and answer all the questions you can answer quickly first, and then go back to the questions you have trouble with later. If you need more space, use the blank sheets of paper provided and label your work with the problem number (and indicate that your work is continued on the attached sheet next to the problem here). Do your best, I will normalize the grades at the end. So LurmMS' Name 1. [1] Write the matrix M that will translate the current coordinate system so that the new origin is now at point (a,b,c). 100‘?h :Ol0l9 M (3ch 00:3 W l 2. [1] Given the matrix M from above, here would point ((1, e, f) be transformed to? (Cl-FOL) 6H,) HP) 3. [1} Compute the result of multiplying the given vector by the following matrix. [a b][x] 90¢ + L3 6 d y CK + Ola 4. [1] What is the result of the following matrix-matrix multiplication? a b e f _ (124-193 “(34$ [6 diig hi_ ce't—cij all—Pdh 5. [1} If v; is vector [a, b, c]T and v; is vector Ed, 6, f] T what is the dot product v; T - vz? QGl-PLE-i'C'll 6.‘ [4] Describe the following coordinate spaces as defined by OpenGL: "[2} Eye—space coordinates Cmewa [S {>[Augl 9...”? [if (“$35k [OoL‘xd 6‘0““ J ‘l’LQ '% (”X-ii. "Ht is 4“ “HQ “7”.) +3 i3 “‘3‘ [2] Screen—space coordinates OWEN 2‘s och lower [2434‘ karma/e? lie Sarah. +x T5 1n. 41-1 fiSLFF) \lficJ—T'QA how fakafl fire». 0 +0 Sam W‘Q‘H‘Iwfir K) \ M 041: SW ”~5ij (Av—3) 7. [5] What are homogeneous coordinates [2]? Why do we use them in computer a hics [3]? gr P — a L at MW at w m».- Ao‘LdLAn—a ‘1. flaw/[k Cflvmrqtuqm Mod ( ) I“ luangius CGWAJqN‘LQSI bet (LE-fifhflh (XIUJEIW) ...._. J 2 I I X} j) zit“, \ h l '9‘" FOAM 4f? m such V‘Cl— (2:: {1: $3) 9» Bel) Sf’hcgu M. “N. Rowe s 090 w -3 ”I” 9 "."V ’ ’ _ J , r (A a; lo M we Ctr“ infra” (A-QFW 'l'VWFiWMJWV‘r (Matti) ( W 17/ iv‘ “jam/rho; ifmx-JJWw) L3 0» mgifix. g «Mink. 8. [7} If you transform a vertices of a model by modelview matrix M, what matrix should you multiply its normals by to get a correct result [2]? Remember, the normals should remain perpendicular to the surface after the transformation. How do you derive this, as we showed in class [5]? ‘ “(GU [email protected](. MEI-‘3“) 44* “(Humid Lb Mi MWV§L,+r_-____E%§ O&&_. T V "' O 4— horwals I 31‘0le L J'- 41) Swf—uw— n _. <.- MAP-r "WSLfMdL‘CA £7 [Mn “ff MV : O medial Nikki“ —L- 9. [3] Define the term ‘-‘rende1ing.” {2%me a 7% WW. ?/ was s bafihxj a SON (await LA wiry: 2%, W MM) ”OWL” :h&§94> 5")“ Mia-Pk; 6U“- May, “f” Hugh Sofia. cram 44-“ Spec-:3“ via» , 10. [10] Den've the perspective projection transformation functions for the x and y terms only. Assume that (as in OpenGL), the frustum is defined in x by the left plane I and the Ii ght plane r and in the y axis by the bottom plane I) and the top plane I. Unlike OpenGL, set up the transformation so that it maps the points to the canonical volume that ranges from 0 to 1. Write the functions in the form x’ = flx,y,z) and y’ = flx,y,z), where x’ and y’ are the transformed x and y coordinates. 11. [10} Derive the general orthographic projection matrix that projects the rectangular block (I, r), (b, r), (-n, -f) in eye space into the rectangular block (x0, 35;), (yo, yi), (20, Z1). pox fivsi‘? x‘: _L_ x’fl)pmrs «L Déwfil rofl Wm AI“ Xvéxr_><, f Xl—Xo' ’ +Xux" ‘35 K ; mt)‘ E) n x . X" 9 Wk" x“: .‘Xt'm —— “Wm—ta :7 O r—er r’ 50 a 9' Harry) M‘" O ”55:; O ‘ (_ "" a ..... ‘ «9 v ‘3 \>£’LV SW (3 ’ {"b y fré +3 0 0 fig “7: \‘5 R ii‘i‘HQ 4‘5ch Latmé/r .441?“ng gt-Bhs (in m “4—? O 0 O c» _L-._ - _. (~— W > in (Di-£51 '2 — 434/1 ( Z M) “11 f 2¢*%o % - - 12. [5] Using the matrix you derived in the previous problem, plug in (-1, 1), (-1, 1), (-1, I) for (x0, x1), (yo. yi), (zo, z;) and Show that you get OpenGL’s orthographic Projection matrix. ?l-§ fix .—\}\ r} r 29 - 2 O wag ‘ 2. O O "if-:71" #xg r,£ O r,Q r- Q é L . 2 + z e—EJ-L— O __._ o ,. __ ____ O — ~— . -i, 194, M9 ~ 0 6'19 fl 5 e £ “—1 ”2‘3— * o "-3—: 13.33 O O n-t «am 0 59-h — 12m 0 O O i O 0 O \ «$1 Ttgs \5 “ML 9%: M OFGL‘S UriM ”My“ 13. [5] During clipping, we clip line segments to the planes corresponding to the different sides of the frustum. Compute the new vertex when you Clip the following line segment to the x = w clipping plane. Li FWVM'KHC firm/“7“")? _ \ wrl 14. [5] In the following diagram, show where the four points would project to in the x—w space after performing the homogenous divide. Write down the coordinates of the final coordinates next to each projected point. 15. [4] Name four different values that are commonly interpolated by the rasterizer for use at each fragment. Calm”, $1pr) “WM-M‘s, MW coordmfies Write out the value stored in register res after the following fragment programs are executed independently of each other. Assume all the registers have been declared and initialized in the following manner: R1 = {1,2, 3, 4}, R2 = {0, —1, 2, —2}, R3 = {1, 1, 1, l}, res = {10, 11, 12, 13}. If the instruction is a syntax error, indicate so. 16. [2] ADD res, R1, R2; {€S:z‘/{)S,2f 17.[2]ADD res, R1.x, _R2.y; his =fo,0,0, '05} j 18.[2]MUL res.z, Rl, R2.y; regcilo) \\)*'3) r33 19.[2]MUL res.xz, R1, R2.y; res-2 {",ll)"3,l3§ 20. [2] SUB res.z, R1, R2.xy,- 1 - 21.[2]CMP res, R2.y, R2.x, R2.z; , {mm 1 22. [2] DP3 res, R1, R3; r63: { QIQJO, Lg 23.[2]IDP4 res, R1, R3; S‘mmx {EMF—l MN res 9i10'10,10,{03 For the following questions, you are executing a fragment program on a full—screen—sized quad and the texture coordinates uv range from 0 to I, with (0,0) in the bottom—left corner of the rendered quadrangle. The z and w components of uv are 0 and 1, respectively. What are the outputs of the following fragment programs? In other words, what do the shaded surfaces look like? Describe it with words or draw a picture if it helps to describe it. Try to be as precise as possible (e.g. label the dimension of things if they are known, and identify the output color in {r, g, b, a} format if it is known). The header of each fragment program is always the same: l!ARprl.O ATTRIB uv = fragment.texcoord£0] ; # so uv is {u, v, 0, l} The different fragment programs are given below. 24.[1] MOV result.color, {1, 1, 0, 0}; ‘END “3le ewallm‘fl L: a M'W YELLOW Uri/O) 17M 25.{2] MOV result.color, uv.x; END ~e~+ gm“ (elf—l- lo m7”. VOV “Allgpt a. jrafi; 30t_3 7‘4 I ' ‘ ‘ i " {S k Tul- m“ L; “ad; 9,‘ Jim» ’QLM' ewdk “Mm-L7 Movers; mid ( 3/9 [NE/\A'I't Gm 44‘s {fill/JET: I “ ’ 26..[2] TEMP t; SUB t, uv, 0.3; CMP result.color, t, 1, 0; END' WWW Wit-V elmfi M l?“ “so.“ 03,35... “WW 1, O_ M We. Ea SOCTL. WM "“3th (I) J J) 73‘ ~ 9: ' m3 qmri‘iv‘... Is a [C‘H'(€ #11:] l :v- E 1 27[5] \vaw‘AH- Swgras-ECL 40 [Ao’ifibe w 1%»... mt) TEMP V0, V1, t, 1.1V temp; 59., Cross- -\sr’°L"‘C/f KPD 03%;;th (4‘ Ln thj 9va $53, MOV v0, {0 5 l, l, O}; L“ 26 (03") M (O, 0.5) M h 3% MOV v1 {0 0 5 1, 0}; c, ,, 3,3 XPD t, v0 v1 95>: do,» w Stet-GM” £94 MOV uv_temp, uv; sch MOV uv_temp.z, l,- In}? , g5 DP3 t, t, uv_temp; , g,“ 3' “g WL/ Lo <53 CMP result.color, t, O, l; a END 4x 2 (0'08) may ,- 28 [5] Using the header for the fragment program above, write the remainder of the l program that would draw a circle of radius 0.25 (in texture space) at the center of the screen. The circle should be red {1,0,0 0,}, the rest of the background in black {0,0,0 ,.0} T “E efimfi‘ohu u-‘l (,‘Ycle 1 , ‘ EM? 7 T M? ‘r‘ 2% cii-LNQ {$4ti Rx, a) 2ij La) 4 r2 . E. 1 {NW (9‘ la) «'5 we?“ I li-f L;1’p(€. . , O 503 "t, w, 0.3; “fit: x—o-S, 3—0533, i , M04 {€ng 0 -~ fl , a I )z r ., "it ~E: boo-S) + 3““ W3 124., J: , Mdt, r, 9‘2§,0.2§ -, it V“: 6.3% 2 ‘ ~ 2- ".2: t “E w" 1H t" [x-O-Sfl'W'm’ 0 Sci; J‘ 2 , t, it o o 03, 0; it skate neck .Mraiz arr/(L . CM? V€SM‘&_(A'9() 3 ) r r: W L(c~gL 0‘1ng ”all black 6ND 29. [4] In class, we talked about the different ways we could represent the spatially- continuous theoretical texture signal. What are the four different techniques we talked about? Note that some of them could be approximations of the theoretical signal. I) EXPLtcLTLbf - wet/L amasar ”WSW“ 2) LMPLICATLW , “A ““ Fwy/“b, as no 6‘— Elm—JV 2;) [MPLlC{TL_L( -- 11.31% ‘Q/VVUBMJ WWW-s. fi’( ((61ka Magi props—161:4 . r_ . Fvedw (a). mmufiémaaj WMcL Cure/(La) (rah-’24, Sfflfl-Va', 92"?) Whit, 4) M’metmeur "’ “M“; F» ELL—"36% 49%;. 4° ‘~m.wz(e 4i: MM“: $74 30. [6] Suppose you are given a continuous signal that has the frequency spectrum shown below. Show what the frequency spectrum would look like when the signal has been under-sampled and is aliasing [5]. Identify the source of the aliasing in your diagram [1]. Fan) 31. [3] A signal f( I) passed through a linear system (such as a filter) can be modeled as a convolution offlt) by the impulse response of the system g(t) to result in the output Mr). What does the Fourier transform of the output 110‘)? to): transit) i; -Htw):i’~’tw)6(w) 32. [10] Describe why you need the Texture Sampling Filter (TSF) and the Screen-space Sampling Filter (SSF) that we discussed in class. {1J1 618$“ ‘H‘! W 8% of]! wnux 6“ Coasl'Mv-a ”M SW (M .Wij #7674“; sad) amt km s Mr M a. will“. HM, “L.” have s were have—HM smell flit ‘Mla J13“ Mama 4f MMU—vflg. “radar-Ida), J43»: Si‘jd L3 L; damn; (smiled!) {Hawk 75’ “Mi “dam” 94w“) 1% Saki/03 giwa», 1% 3:34 1h :H'KML I) J—«j a: 05%.! «#4 Tami-A §a~p£ij 3: Ar (’TI‘FJ_ WMJL ATM/{jg WM lo.) :UP-MCWUM “‘1‘” 6‘ cM‘W 3M7 "“ ”k“ I‘M; ("I'M/w LL NYE-31M «yak L3 #12 3% W ”TA-QA‘FWC, w: Maui lo LIA, FFW“ 4—0 We? “€315th This n m Law 33-?— g’h Wk“ W, 7th?) [‘7 Wick/(£7 960% nan—a WJWW‘MA‘ 33. [5] Assume that you are doing texture mapping and interpolation samples using a bilinear interpolation. Suppose that the corner colors are given by CNE,- CSE” Csw, CNw, and the projected point is given in local cell coordinates x and y with the origin being at the south—west (SW) comer and the north-east (NE) corner is 1, 1. What is the bilinear interpolation formula? (Am CAEHXIU) : (1’3)<Q ax) Cg“ + X ng) 4— 3 (LI-X) CNN + X CNE) 34. [2] What are the two kinds of reconstruction filters available in modem graphics hardware? I 35. [10] Expiain how SBTC compression-works and show how it achieves 6:1 compression. In other words, describe the algorithm in enough detail to show how many bits are used in the S3TC representation and what they are used for. SZTC M» U”"‘- {Lb fiSStwr'iow- ‘H‘w+ (10ka Am a. 4‘4 Fag-J £51005; tat/«ea m £63 C—0{W SPAQ‘ S; QwrF, 11;: M} a saw :mFu " f1 cox/bow ‘ FELT: Mc‘; £231— Rafolwi a; wee/3w 65d: 4‘4 i9!0rj¢.g' Rf WA Lice/Lida MW Mt: 203.1%!” r1. Lam §A+‘Z§‘S M fiZ‘A‘EZ‘EE mgr—S SMMAF “Pistch. ULJ‘J’GM—I’Ofihwflh M M35114 “4‘40er 1%.. (fa—Jar: ("{‘I-ZULm/ LJQCL Mahmud. ZLSB/fmfl, SM‘ kw); alum A? 13 1“: do“, wheel—M Lamond 00% K, {ad-y 4W (-pwfc‘ «fa—571 of {2. L43) Ak— h lair/L: J W (7% (Kw—OJ "F“ 2x IGJHWLJ :- glgr{s_ SD. M 47.? glad; (7 L‘W ”)1 £4 fat-h 36. [5] Why can’t JPEG be used for texture compression for realntime rendering?________ ______ "Tm 0—3 Serbs/‘1 mass”; M») “EEG Camil- cm.) L W 9“ ”hi—‘6‘“ ”Mama 1 ‘) do“, Maw Ssfih— " L"?- M‘ “4”] Lat 064.09% $3.15“ 2) Wear-M Lfilfl WW2»)...— JPEG 619124 («m—hi“. WW m—‘Hx t>'“7‘L1”"‘7{‘ Inc“) v-mfafio w Ww~~hM M (Mom AW v13MMwaj-‘QV WHERE» Nah») 37. [4} Given the following formulas for the Fourier transform and inverse transform: F(a)) = of f(t)e”j‘”’dt —DO f(r)— — — :flTanemdt Prove the shift property of Fourier transforms. f(t a)————> 17(60):? 38. [6] What are hard and soft shadows? HMSWM M 9% GHQ 1") “Tm”? 51“ij SW' «71" dun‘mx le‘fi): 44m? Warmth—r m SW w a» flrjbb (W “(Le W711; 441° 5' 4:2. [awry can. MW m n‘tiz 9,:qu w pmfl SEQ/F SLuJ-om MSW Wji-Q‘G'v— M’fi— WWW ,Qc'fn’e Sw_ TL! BL; 1301. SM anm M (Lam/9+ Sap, an? .1 “L/ M Pod? m 5‘61 ML) (HP—ff! 7a T’f‘fimzaunyf_ EM] 3:411}th M-clflywww 39. [10] The two principal hard shadow algorithms we talked about in class are shadow maps and shadow volumes. Explain how each of them works, as if you are describing them to someone so that they can implement them [6]. It might be helpful to draw diagrams. Also, what are the advantages/disadvantages of each [4]? SW H} ‘) Talk a. OLE/pk mar £002 4L F‘O~‘j- «I 4%.; £343" EW‘ 2) Men We, yew TM a e rw P WM l 7% 1/; .‘Ml‘k mmhweiofislkj'sw M W W h~ 5%. M‘ slww M #1 swat; J . gtriwrt Wxfl‘“ “.4 TS €k& k Jpn-Ski) fl ‘f/MLfM‘L “ml <2 aha/glim? fats‘rbs 0L.» (LESW‘Q 4:. P :‘K OER “W Ola We t—l :9 M §W&J_ Wt “+th w 14: I flaky-136%)?» off/Zu- 18%w3—émafm N’Pfl‘mafi , ‘ _ P 40. [2] What is the source of the artifacts in shadow maps? ONL e’( ”2 twp: 5W :1 oJliLQaw‘l'S WK 9% W5 R m ‘l’LL dapflxwmfa (N 5% 5%) ll 0L3 C-a-U'E" 04.2% N'( Wald-1mg.” ‘ 3.5141 7}“- oi 41‘3““ {a tsp/mi“ MW salmon Mike 5% WMTEMI ‘73" WW We M a ma» «r W s a law (a t WW; Cm— W SM 61.2% 54% ”a- SWMZ 41. [8] Percentage—Closer Filtering is a technique used to improve the quality of the shadow map algorithm in high—end rendering systems, such as those used by Pixar. Suppose you were given the depth map shown below. Your task is to shade the inner 4 x 4 region (the cells in white) for a polygon who spans the entire region and whose depth is 30. To present your solution, use the following. notation: write a 1.0 in the regions where the polygon is fully illuminated, a 0.0 for the parts where it will be fully dark. For the regions where the shaded value is in between 0 and 1, write it either as a fraction or a decimal. First shade the result you would get using standard shadow maps [2]. Highlight the shadow boundary between llght and dark [1}. . 3i i Lém 7k aims-“j '{SW 'V’ULMJM Show: ~39 6»: TMeSTE-cafl meaxes‘ Now shade the 4x4 region of the surface with Percentage Closer Filtering [5]. For every sample, use the four nearest depth samples for comparison. ‘ No R M at float; pl #— -!l\ Ell-1E 2x2 Mahler bate) .m-l-Hflflln 9W“ Meiji? a ‘I "a"; W a “Carl sac la WM 42. [5] Hard shadows can contain infinitely—high frequencies, which means that unless they are filtered properly they will exhibit aliasing artifacts when sampled for the screen. We talked about some of the artifacts of shadow maps. However, shadow volumes are not filtered either. What do the aliasing artifacts of shadow volumes look like? Describe them. :ihelm has, swastika ZWMW me chle' Lib/- (Mara/04193) LJ ”31(1— rwm IW MW M,f;- “41* fl‘? W - 10/. 43. {5] In class, we talked about the differences between projective aliasing and perspective aliasing-when it comes to shadow maps. What are the differences between the two and how do they come about? It might help to draw some diagrams to explain this. Vmpctdnim Atacama @CCVW‘S MAM nth W smCma M MM psi/L mflpaJ‘L HQ VMQVJW MM. Rafi-4074) \k ‘l’r‘i £733er wire... 04-4; erg .fm a. 3““)!4 SLAM wavy: P‘Y‘P’o w L4 fflif’rtfe—v‘ .WFV . ,, 1L? 4 a a. (01)“ 'fl 4 {mafia fjlehEcLz/J-u @jS-l Hi 04'1”th w [2. WEILJL?‘ t) > CmCOc) ' '44. [5] Describe how perspective shadow maps strive to reduce the artifacts of shadow maps. Diagrams might help. VMMW QM“ “Nif’ +W) ‘(K‘ “M MH‘PNXK Ba W‘dhfi-H“ 99.1%.: Mix/p Am... g) $l—Pflgtr/i‘w 560‘;ij la «M wfrrjw “RM“; 14—2 S‘w :3 W, thfiw 1,,b KL . (is W «(fig/1“"; an...“ an ”v1 1453”) a; ma #4 $4M? ('4 W .. Qtrw 41%“ Jim (T M 7%:3 "AW—vS-c‘h‘lwcjém HM «$4; ‘L’l‘g-qta-rw jQ—x RQYVWJJ Eta-4L0“ Fwd — Fido/2.56% we've ‘ Syria... 45. [2] What are the two largest manufacturers of consumer—level graphics hardware-(e. g. the GPU’s we’ve been talking about in the class)? Ami) NWDng .) pm ( )...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern