-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnotes.htm
718 lines (625 loc) · 27.9 KB
/
notes.htm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
<!DOCTYPE html>
<html>
<head><script src="//archive.org/includes/analytics.js?v=cf34f82" type="text/javascript"></script>
<script type="text/javascript">window.addEventListener('DOMContentLoaded',function(){var v=archive_analytics.values;v.service='wb';v.server_name='wwwb-app13.us.archive.org';v.server_ms=310;archive_analytics.send_pageview({});});</script><script type="text/javascript" src="/_static/js/ait-client-rewrite.js" charset="utf-8"></script>
<script type="text/javascript">
WB_wombat_Init("https://web.archive.org/web/", "20170907193808", "pellacini.di.uniroma1.it:80");
</script>
<script type="text/javascript" src="/_static/js/wbhack.js" charset="utf-8"></script>
<script type="text/javascript">
__wbhack.init('https://web.archive.org/web');
</script>
<link rel="stylesheet" type="text/css" href="/_static/css/banner-styles.css" />
<link rel="stylesheet" type="text/css" href="/_static/css/iconochive.css" />
<!-- End Wayback Rewrite JS Include -->
<meta charset="utf-8">
<style>
/*! normalize.css v2.1.0 | MIT License | git.io/normalize */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined in IE 8/9.
*/
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
nav,
section,
summary {
display: block;
}
/**
* Correct `inline-block` display not defined in IE 8/9.
*/
audio,
canvas,
video {
display: inline-block;
}
/**
* Prevent modern browsers from displaying `audio` without controls.
* Remove excess height in iOS 5 devices.
*/
audio:not([controls]) {
display: none;
height: 0;
}
/**
* Address styling not present in IE 8/9.
*/
[hidden] {
display: none;
}
/* ==========================================================================
Base
========================================================================== */
/**
* 1. Set default font family to sans-serif.
* 2. Prevent iOS text size adjust after orientation change, without disabling
* user zoom.
*/
html {
font-family: sans-serif; /* 1 */
-webkit-text-size-adjust: 100%; /* 2 */
-ms-text-size-adjust: 100%; /* 2 */
}
/**
* Remove default margin.
*/
body {
margin: 0;
}
/* ==========================================================================
Links
========================================================================== */
/**
* Address `outline` inconsistency between Chrome and other browsers.
*/
a:focus {
outline: thin dotted;
}
/**
* Improve readability when focused and also mouse hovered in all browsers.
*/
a:active,
a:hover {
outline: 0;
}
/* ==========================================================================
Typography
========================================================================== */
/**
* Address variable `h1` font-size and margin within `section` and `article`
* contexts in Firefox 4+, Safari 5, and Chrome.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/**
* Address styling not present in IE 8/9, Safari 5, and Chrome.
*/
abbr[title] {
border-bottom: 1px dotted;
}
/**
* Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome.
*/
b,
strong {
font-weight: bold;
}
/**
* Address styling not present in Safari 5 and Chrome.
*/
dfn {
font-style: italic;
}
/**
* Address differences between Firefox and other browsers.
*/
hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
/**
* Address styling not present in IE 8/9.
*/
mark {
background: #ff0;
color: #000;
}
/**
* Correct font family set oddly in Safari 5 and Chrome.
*/
code,
kbd,
pre,
samp {
font-family: monospace, serif;
font-size: 1em;
}
/**
* Improve readability of pre-formatted text in all browsers.
*/
pre {
white-space: pre-wrap;
}
/**
* Set consistent quote types.
*/
q {
quotes: "\201C" "\201D" "\2018" "\2019";
}
/**
* Address inconsistent and variable font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` affecting `line-height` in all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
/* ==========================================================================
Embedded content
========================================================================== */
/**
* Remove border when inside `a` element in IE 8/9.
*/
img {
border: 0;
}
/**
* Correct overflow displayed oddly in IE 9.
*/
svg:not(:root) {
overflow: hidden;
}
/* ==========================================================================
Figures
========================================================================== */
/**
* Address margin not present in IE 8/9 and Safari 5.
*/
figure {
margin: 0;
}
/* ==========================================================================
Forms
========================================================================== */
/**
* Define consistent border, margin, and padding.
*/
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
/**
* 1. Correct `color` not being inherited in IE 8/9.
* 2. Remove padding so people aren't caught out if they zero out fieldsets.
*/
legend {
border: 0; /* 1 */
padding: 0; /* 2 */
}
/**
* 1. Correct font family not being inherited in all browsers.
* 2. Correct font size not being inherited in all browsers.
* 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome.
*/
button,
input,
select,
textarea {
font-family: inherit; /* 1 */
font-size: 100%; /* 2 */
margin: 0; /* 3 */
}
/**
* Address Firefox 4+ setting `line-height` on `input` using `!important` in
* the UA stylesheet.
*/
button,
input {
line-height: normal;
}
/**
* Address inconsistent `text-transform` inheritance for `button` and `select`.
* All other form control elements do not inherit `text-transform` values.
* Correct `button` style inheritance in Chrome, Safari 5+, and IE 8+.
* Correct `select` style inheritance in Firefox 4+ and Opera.
*/
button,
select {
text-transform: none;
}
/**
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
* and `video` controls.
* 2. Correct inability to style clickable `input` types in iOS.
* 3. Improve usability and consistency of cursor style between image-type
* `input` and others.
*/
button,
html input[type="button"], /* 1 */
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button; /* 2 */
cursor: pointer; /* 3 */
}
/**
* Re-set default cursor for disabled elements.
*/
button[disabled],
html input[disabled] {
cursor: default;
}
/**
* 1. Address box sizing set to `content-box` in IE 8/9.
* 2. Remove excess padding in IE 8/9.
*/
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.
* 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome
* (include `-moz` to future-proof).
*/
input[type="search"] {
-webkit-appearance: textfield; /* 1 */
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box; /* 2 */
box-sizing: content-box;
}
/**
* Remove inner padding and search cancel button in Safari 5 and Chrome
* on OS X.
*/
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* Remove inner padding and border in Firefox 4+.
*/
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
/**
* 1. Remove default vertical scrollbar in IE 8/9.
* 2. Improve readability and alignment in all browsers.
*/
textarea {
overflow: auto; /* 1 */
vertical-align: top; /* 2 */
}
/* ==========================================================================
Tables
========================================================================== */
/**
* Remove most spacing between table cells.
*/
table {
border-collapse: collapse;
border-spacing: 0;
}
@import url(https://web.archive.org/web/20170907193808cs_/http://fonts.googleapis.com/css?family=Open+Sans:400,700|Inconsolata:400,700);
html {
margin: 0;
padding: 0;
}
body {
margin: 0 auto;
padding: 0;
width: 600px;
font-family: 'Open Sans', sans-serif;
font-size: 16px;
line-height: 24px;
}
h1 {
font-size: 32px;
line-height: 48px;
margin: 144px 0 24px 0;
}
h2 {
font-size: 28px;
line-height: 48px;
margin: 0 0 24px 0;
}
h3 {
font-size: 22px;
line-height: 24px;
margin: 48px 0 24px 0;
}
p, ul {
margin: 0 0 24px 0;
}
ul ul {
margin: 0 0 0 0;
}
pre {
margin: 0 0 24px 0;
}
code {
font-family: Inconsolata, monospace;
}
@media print {
body {
margin: 72px 72px;
}
@page {
margin: 48px 48px;
}
}
</style>
</head>
<body><!-- BEGIN WAYBACK TOOLBAR INSERT -->
<script type="text/javascript" src="/_static/js/timestamp.js" charset="utf-8"></script>
<script type="text/javascript" src="/_static/js/graph-calc.js" charset="utf-8"></script>
<script type="text/javascript" src="/_static/js/auto-complete.js" charset="utf-8"></script>
<script type="text/javascript" src="/_static/js/toolbar.js" charset="utf-8"></script>
<style type="text/css">
body {
margin-top:0 !important;
padding-top:0 !important;
/*min-width:800px !important;*/
}
.wb-autocomplete-suggestions {
text-align: left; cursor: default; border: 1px solid #ccc; border-top: 0; background: #fff; box-shadow: -1px 1px 3px rgba(0,0,0,.1);
position: absolute; display: none; z-index: 2147483647; max-height: 254px; overflow: hidden; overflow-y: auto; box-sizing: border-box;
}
.wb-autocomplete-suggestion { position: relative; padding: 0 .6em; line-height: 23px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1.02em; color: #333; }
.wb-autocomplete-suggestion b { font-weight: bold; }
.wb-autocomplete-suggestion.selected { background: #f0f0f0; }
</style>
<div id="wm-ipp-base" lang="en" style="display:none;direction:ltr;">
<div id="wm-ipp" style="position:fixed;left:0;top:0;right:0;">
<div id="wm-ipp-inside">
<div style="position:relative;">
<div id="wm-logo" style="float:left;width:130px;padding-top:10px;">
<a href="/web/" title="Wayback Machine home page"><img src="/_static/images/toolbar/wayback-toolbar-logo.png" alt="Wayback Machine" width="110" height="39" border="0" /></a>
</div>
<div class="r" style="float:right;">
<div id="wm-btns" style="text-align:right;height:25px;">
<div id="wm-save-snapshot-success">success</div>
<div id="wm-save-snapshot-fail">fail</div>
<a href="#"
onclick="__wm.saveSnapshot('http://pellacini.di.uniroma1.it/teaching/graphics16/assignments/04_pathtrace/notes.html', '20170907193808')"
title="Share via My Web Archive"
id="wm-save-snapshot-open"
>
<span class="iconochive-web"></span>
</a>
<a href="https://archive.org/account/login.php"
title="Sign In"
id="wm-sign-in"
>
<span class="iconochive-person"></span>
</a>
<span id="wm-save-snapshot-in-progress" class="iconochive-web"></span>
<a href="http://faq.web.archive.org/" title="Get some help using the Wayback Machine" style="top:-6px;"><span class="iconochive-question" style="color:rgb(87,186,244);font-size:160%;"></span></a>
<a id="wm-tb-close" href="#close" onclick="__wm.h(event);return false;" style="top:-2px;" title="Close the toolbar"><span class="iconochive-remove-circle" style="color:#888888;font-size:240%;"></span></a>
</div>
<div id="wm-share">
<a href="/web/20170907193808/http://web.archive.org/screenshot/http://pellacini.di.uniroma1.it/teaching/graphics16/assignments/04_pathtrace/notes.html"
id="wm-screenshot"
title="screenshot">
<span class="wm-icon-screen-shot"></span>
</a>
<a href="#" onclick="window.open('https://www.facebook.com/sharer/sharer.php?u=https://web.archive.org/web/20170907193808/http://pellacini.di.uniroma1.it:80/teaching/graphics16/assignments/04_pathtrace/notes.html', '', 'height=400,width=600'); return false;" title="Share on Facebook" style="margin-right:5px;" target="_blank"><span class="iconochive-facebook" style="color:#3b5998;font-size:160%;"></span></a>
<a href="#" onclick="window.open('https://twitter.com/intent/tweet?text=https://web.archive.org/web/20170907193808/http://pellacini.di.uniroma1.it:80/teaching/graphics16/assignments/04_pathtrace/notes.html&via=internetarchive', '', 'height=400,width=600'); return false;" title="Share on Twitter" style="margin-right:5px;" target="_blank"><span class="iconochive-twitter" style="color:#1dcaff;font-size:160%;"></span></a>
</div>
</div>
<table class="c" style="">
<tbody>
<tr>
<td class="u" colspan="2">
<form target="_top" method="get" action="/web/submit" name="wmtb" id="wmtb"><input type="text" name="url" id="wmtbURL" value="http://pellacini.di.uniroma1.it/teaching/graphics16/assignments/04_pathtrace/notes.html" onfocus="this.focus();this.select();" /><input type="hidden" name="type" value="replay" /><input type="hidden" name="date" value="20170907193808" /><input type="submit" value="Go" /></form>
</td>
<td class="n" rowspan="2" style="width:110px;">
<table>
<tbody>
<!-- NEXT/PREV MONTH NAV AND MONTH INDICATOR -->
<tr class="m">
<td class="b" nowrap="nowrap"><a href="https://web.archive.org/web/20161221013057/http://pellacini.di.uniroma1.it:80/teaching/graphics16/assignments/04_pathtrace/notes.html" title="21 Dec 2016"><strong>Dec</strong></a></td>
<td class="c" id="displayMonthEl" title="You are here: 19:38:08 Sep 07, 2017">SEP</td>
<td class="f" nowrap="nowrap"><a href="https://web.archive.org/web/20171107162559/http://pellacini.di.uniroma1.it:80/teaching/graphics16/assignments/04_pathtrace/notes.html" title="07 Nov 2017"><strong>Nov</strong></a></td>
</tr>
<!-- NEXT/PREV CAPTURE NAV AND DAY OF MONTH INDICATOR -->
<tr class="d">
<td class="b" nowrap="nowrap"><a href="https://web.archive.org/web/20161221013057/http://pellacini.di.uniroma1.it:80/teaching/graphics16/assignments/04_pathtrace/notes.html" title="01:30:57 Dec 21, 2016"><img src="/_static/images/toolbar/wm_tb_prv_on.png" alt="Previous capture" width="14" height="16" border="0" /></a></td>
<td class="c" id="displayDayEl" style="width:34px;font-size:24px;white-space:nowrap;" title="You are here: 19:38:08 Sep 07, 2017">07</td>
<td class="f" nowrap="nowrap"><a href="https://web.archive.org/web/20171107162559/http://pellacini.di.uniroma1.it:80/teaching/graphics16/assignments/04_pathtrace/notes.html" title="16:25:59 Nov 07, 2017"><img src="/_static/images/toolbar/wm_tb_nxt_on.png" alt="Next capture" width="14" height="16" border="0" /></a></td>
</tr>
<!-- NEXT/PREV YEAR NAV AND YEAR INDICATOR -->
<tr class="y">
<td class="b" nowrap="nowrap">2016</td>
<td class="c" id="displayYearEl" title="You are here: 19:38:08 Sep 07, 2017">2017</td>
<td class="f" nowrap="nowrap">2018</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td class="s">
<div id="wm-nav-captures">
<a class="t" href="/web/20170907193808*/http://pellacini.di.uniroma1.it/teaching/graphics16/assignments/04_pathtrace/notes.html" title="See a list of every capture for this URL">3 captures</a>
<div class="r" title="Timespan for captures of this URL">21 Dec 2016 - 07 Nov 2017</div>
</div>
</td>
<td class="k">
<a href="" id="wm-graph-anchor">
<div id="wm-ipp-sparkline" title="Explore captures for this URL" style="position: relative">
<canvas id="wm-sparkline-canvas" width="625" height="27" border="0"></canvas>
</div>
</a>
</td>
</tr>
</tbody>
</table>
<div style="position:absolute;bottom:0;right:2px;text-align:right;">
<a id="wm-expand" class="wm-btn wm-closed" href="#expand" onclick="__wm.ex(event);return false;"><span id="wm-expand-icon" class="iconochive-down-solid"></span> <span style="font-size:80%">About this capture</span></a>
</div>
</div>
<div id="wm-capinfo" style="border-top:1px solid #777;display:none; overflow: hidden">
<div style="background-color:#666;color:#fff;font-weight:bold;text-align:center">COLLECTED BY</div>
<div style="padding:3px;position:relative" id="wm-collected-by-content">
<div style="display:inline-block;vertical-align:top;width:50%;">
<span class="c-logo" style="background-image:url(https://archive.org/services/img/alexacrawls);"></span>
Organization: <a style="color:#33f;" href="https://archive.org/details/alexacrawls" target="_new"><span class="wm-title">Alexa Crawls</span></a>
<div style="max-height:75px;overflow:hidden;position:relative;">
<div style="position:absolute;top:0;left:0;width:100%;height:75px;background:linear-gradient(to bottom,rgba(255,255,255,0) 0%,rgba(255,255,255,0) 90%,rgba(255,255,255,255) 100%);"></div>
Starting in 1996, <a href="http://www.alexa.com/">Alexa Internet</a> has been donating their crawl data to the Internet Archive. Flowing in every day, these data are added to the <a href="http://web.archive.org/">Wayback Machine</a> after an embargo period.
</div>
</div>
<div style="display:inline-block;vertical-align:top;width:49%;">
<span class="c-logo" style="background-image:url(https://archive.org/services/img/alexacrawls)"></span>
<div>Collection: <a style="color:#33f;" href="https://archive.org/details/alexacrawls" target="_new"><span class="wm-title">Alexa Crawls</span></a></div>
<div style="max-height:75px;overflow:hidden;position:relative;">
<div style="position:absolute;top:0;left:0;width:100%;height:75px;background:linear-gradient(to bottom,rgba(255,255,255,0) 0%,rgba(255,255,255,0) 90%,rgba(255,255,255,255) 100%);"></div>
Starting in 1996, <a href="http://www.alexa.com/">Alexa Internet</a> has been donating their crawl data to the Internet Archive. Flowing in every day, these data are added to the <a href="http://web.archive.org/">Wayback Machine</a> after an embargo period.
</div>
</div>
</div>
<div style="background-color:#666;color:#fff;font-weight:bold;text-align:center" title="Timestamps for the elements of this page">TIMESTAMPS</div>
<div>
<div id="wm-capresources" style="margin:0 5px 5px 5px;max-height:250px;overflow-y:scroll !important"></div>
<div id="wm-capresources-loading" style="text-align:left;margin:0 20px 5px 5px;display:none"><img src="/_static/images/loading.gif" alt="loading" /></div>
</div>
</div></div></div></div><div id="donato" style="position:relative;width:100%;">
<div id="donato-base">
<iframe id="donato-if" src="https://archive.org/includes/donate.php?as_page=1&transpiled=0&referer=https%3A//web.archive.org/web/20170907193808/http%3A//pellacini.di.uniroma1.it/teaching/graphics16/assignments/04_pathtrace/notes.html"
scrolling="no" frameborder="0" style="width:100%; height:100%">
</iframe>
</div>
</div><script type="text/javascript">
__wm.bt(625,27,25,2,"web","http://pellacini.di.uniroma1.it/teaching/graphics16/assignments/04_pathtrace/notes.html","2017-09-07",1996,"/_static/",['css/banner-styles.css','css/iconochive.css']);
__wm.checkScreenShot("http://pellacini.di.uniroma1.it/teaching/graphics16/assignments/04_pathtrace/notes.html", '20170907193808');
</script>
<!-- END WAYBACK TOOLBAR INSERT -->
<h1>Assignment 4: Pathtrace</h1>
<p>Out: Dec 14. Due: Jan 15.</p>
<h3>Introduction</h3>
<p>In your fifth assignment, you will implement a pathtracer. You will see that with a small amount of code, we can produce realistic images.</p>
<p>You are to perform this assignment using C++. To ease your development, we are providing a simple C++ framework to represent the scene, perform basic mathematical calculations, and save your image results. The framework also contain simple test scenes to judge the correctness of your algorithm. These test scenes are encoded in JSON, a readable ASCII format. You can compare to the correct output images we supply. To build the framework, you can use either Visual Studio Express 2013 on Windows or XCode 6 on OS X.</p>
<h3>Framework Overview</h3>
<p>We suggest you use our framework to create your renderer. We have removed from the code all the function implementations your will need to provide, but we have left the function declarations which can aid you in planning your solution. All code in the framework is documented, so please read the documentation for further information. Following is a brief description of the content of the framework.</p>
<ul>
<li><strong>common.h</strong> includes the basic files from the standard library and contains general utilities such as print messages, handle errors, and enable Python-style foreach loops;</li>
<li><strong>vmath.h</strong> includes various math functions from the standard library, and math types specific to graphics; <code>vecXX</code>s are 2d, 3d and 4d tuples, both float and integerers, with related arithmetic options and functions - you should use this type for point, vectors, colors, etc.; <code>frame3f</code>s are 3d frames with transformations to and from the frame for points, vectors, normals, etc.; <code>mat4f</code> defines a 4x4 matrix with matrix-vector operations and functions to create transform matrices and convert frames</li>
<li><strong>image.h/image.cpp</strong> defines a color image, with pixel access operations and image loading/saving operations</li>
<li><strong>lodepng.h/lodepng.cpp</strong> provide support for the PNG file format</li>
<li><strong>json.h/json.cpp/picojson.h</strong> provide support for the JSON file format</li>
<li><strong>scene.h/scene.cpp</strong> defines the scene data structure and provide JSON scene loading</li>
<li><strong>tesselation.h/tesselation.cpp</strong>: implements smooth curves and surfaces</li>
<li><strong>intersectionh/intersection.cpp</strong> implement ray-scene intersection</li>
<li><strong>scene.h/scene.cpp</strong> defines the scene data structure and provide test scenes</li>
<li><strong>pathtrace.cpp</strong> implements the renderer: <em>your code goes here</em></li>
</ul>
<p>In this homework, scenes are becoming more complex. A <code>Scene</code> is comprised of a <code>Camera</code>, and a list of <code>Mesh</code>es, a list of <code>Surface</code>s and a list of <code>Light</code>s. The <code>Camera</code> is defined by its frame, the size and distance of the image plane and the focus distance (used for interaction). Each <code>Mesh</code> is a collection of either points, lines or triangles and quads, centered with respect to its frame, and colored according to a Blinn-Phong <code>Material</code> with diffuse, specular coefficients as well as an emission term for area lights. Each <code>Mesh</code> is represented as an indexed polygonal mesh, with vertex position normals and texture coordinates. Each surface is either a quad or a sphere of a given radius. Each <code>Light</code> is a point light centered with respect to its frame and with given intensity. The scene also includes the background color, the ambient illumination, the image resolution and the samples per pixel.</p>
<p>In this homework, model geometry is read from RAW files. This is a trivial file format we built for the course to make parsing trivial in C++. This geometry is stored in the <code>models</code> directory.</p>
<p>Since we perform a lot of computation, we suggest you compile in <code>Release</code> mode. You <code>Debug</code> mode only when deemed stricly necessary. You can also modify the scenes, including the amount of samples while debugging. Finally, we provide a solution that runs code in parallel based on the hardware resources. While this might be confusing to debug, we felt it was important to provide the fastest execution possible. To disable it, just change the call in <code>pathtrace::main</code>.</p>
<h3>Requirements</h3>
<p>You are to implement the code left blank in <code>pathtrace.cpp</code>. In this homework, we will provide code for a standard raytracer that you can modify to reach the pathtracer. You will implement these features.</p>
<ol>
<li>
<p>Basic random tracer. Modify the standard raytracer to use a random number generator to set up the samples in the pixel.</p>
</li>
<li>
<p>Textures. Implement bilinear texture lookup in the renderer. Foreach material property, scale the material value by the texture if present.</p>
</li>
<li>
<p>Area lights. Implement area light sampling for quad surfaces. Use uniform sampling over the quad surface for this.</p>
</li>
<li>
<p>Environment illumination. Implement environment mapping by first looking up the environment map if a camera ray misses. Then implement environment lighting by sampling the brdf with the supplied function <code>sample_brdf</code>. Using this direction sample the environment light.</p>
</li>
<li>
<p>Microfacet materials. Implement a microfacet modification to Blinn-Phong illumination.</p>
</li>
<li>
<p>Indirect illumination. Implement recursive path tracing by shooting rays in the direction given by <code>sample_brdf</code>; stop recursion based on <code>path_max_depth</code>.</p>
</li>
<li>
<p>Create a complex and interesting scene. Create an interesting scene by using the models supplied before in class or new ones. We include in the distribution a Python script that converts OBJ files to JSON. The script is in no way robust. We have tested it with Blender by exporting the entire scene with normals checked.</p>
</li>
<li>
<p>To document the previous point and to support extra credit, please attach to your submission a PDF document that includes the images you generated, and the rendering features shown.</p>
</li>
</ol>
<h3>Hints</h3>
<p>We suggest to implement the renderer following the steps presented above. To debug code, you can use the step by step advancing.</p>
<p>To load better models, you can use <a href="https://web.archive.org/web/20170907193808/https://github.com/xelatihy/yocto-gl">yocto_obj.h</a> and get models from <a href="https://web.archive.org/web/20170907193808/http://www.blendswap.com/">blendswap</a> or <a href="https://web.archive.org/web/20170907193808/http://graphics.cs.williams.edu/data/meshes.xml">Williams</a>.</p>
<h3>Submission</h3>
<p>Please sent an email to <code>[email protected]</code> with your code as well as the images generated as a .zip file.
<strong>Also submit a PDF report that includes the images you generate and timing for them and the features that the images shows.</strong></p>
<h3>Extra Credit</h3>
<p>Pick the ones that are most interesting to you. In general the easiest to implement are less interesting than the hard ones.</p>
<ol>
<li>
<p>[easy] Implement depth of field.</p>
</li>
<li>
<p>[hard] Implement motion blur.</p>
</li>
<li>
<p>[medium] Implement mesh area light sampling. To do so, you have to pick a uniformly distributed random point on a Mesh. This can be done in the same manner as picking points for growing hair in homework02.</p>
</li>
<li>
<p>[easy] Implement russian roulette for faster ray termination.</p>
</li>
<li>
<p>[hard] Implement hair rendering. Implement ray-line intersection by treating each line segment as a small cylinder. Use Kajiya-Kay as the BRDF.</p>
</li>
</ol>
<p>6 [very hard] Implement skin rendering. Contact the professor.</p>
</body>
</html>
<!--
FILE ARCHIVED ON 19:38:08 Sep 07, 2017 AND RETRIEVED FROM THE
INTERNET ARCHIVE ON 17:34:21 Mar 29, 2020.
JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
SECTION 108(a)(3)).
-->
<!--
playback timings (ms):
exclusion.robots: 0.229
exclusion.robots.policy: 0.218
PetaboxLoader3.datanode: 141.952 (4)
esindex: 0.01
CDXLines.iter: 11.774 (3)
LoadShardBlock: 50.226 (3)
captures_list: 65.017
load_resource: 237.062
PetaboxLoader3.resolve: 114.478
RedisCDXSource: 0.582
-->