Skip to content

Commit 7110e11

Browse files
committed
Rendered images use Markdeep class=pixel
Markdeep provides a `class=pixel` attribute for included images in order to render with a point-sampled result. I didn't realize this when I originally created CSS styling and an enclosing `div` element to do this before. Switching the prior styling to now use Markdeep's feature. Resolves #498
1 parent b363815 commit 7110e11

File tree

4 files changed

+67
-282
lines changed

4 files changed

+67
-282
lines changed

books/RayTracingInOneWeekend.html

+25-104
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,7 @@
137137
Opening the output file (in `ToyViewer` on my Mac, but try it in your favorite viewer and Google
138138
“ppm viewer” if your viewer doesn’t support it) shows this result:
139139

140-
<div class="render">
141-
142-
![First PPM image](../images/img.first-ppm-image.png)
143-
144-
</div>
140+
![First PPM image](../images/img.first-ppm-image.png class=pixel)
145141

146142
</div>
147143

@@ -516,11 +512,8 @@
516512

517513
with $t$ going from zero to one. In our case this produces:
518514

519-
<div class="render">
520-
521-
![A blue-to-white gradient depending on ray Y coordinate](../images/img.blue-to-white.png)
522-
523-
</div>
515+
![A blue-to-white gradient depending on ray Y coordinate
516+
](../images/img.blue-to-white.png class=pixel)
524517

525518
</div>
526519

@@ -634,11 +627,7 @@
634627
<div class='together'>
635628
What we get is this:
636629

637-
<div class="render">
638-
639-
![A simple red sphere](../images/img.red-sphere.png)
640-
641-
</div>
630+
![A simple red sphere](../images/img.red-sphere.png class=pixel)
642631

643632
</div>
644633

@@ -714,11 +703,7 @@
714703
<div class='together'>
715704
And that yields this picture:
716705

717-
<div class="render">
718-
719-
![A sphere colored according to its normal vectors](../images/img.normals-sphere.png)
720-
721-
</div>
706+
![A sphere colored according to its normal vectors](../images/img.normals-sphere.png class=pixel)
722707

723708
</div>
724709

@@ -877,7 +862,8 @@
877862
the sphere, the normal will point outward, but if the ray is inside the sphere, the normal will
878863
point inward.
879864

880-
![Figure [normal-directions]: Possible directions for sphere surface-normal geometry](../images/fig.normal-possibilities.jpg)
865+
![Figure [normal-directions]: Possible directions for sphere surface-normal geometry
866+
](../images/fig.normal-possibilities.jpg)
881867

882868
</div>
883869

@@ -1231,11 +1217,8 @@
12311217
This yields a picture that is really just a visualization of where the spheres are along with their
12321218
surface normal. This is often a great way to look at your model for flaws and characteristics.
12331219

1234-
<div class="render">
1235-
1236-
![Resulting render of normals-colored sphere with ground](../images/img.normals-sphere-ground.png)
1237-
1238-
</div>
1220+
![Resulting render of normals-colored sphere with ground
1221+
](../images/img.normals-sphere-ground.png class=pixel)
12391222

12401223
</div>
12411224

@@ -1422,11 +1405,7 @@
14221405
Zooming into the image that is produced, the big change is in edge pixels that are part background
14231406
and part foreground:
14241407

1425-
<div class="render">
1426-
1427-
![Close-up of antialiased pixels](../images/img.antialias.png)
1428-
1429-
</div>
1408+
![Close-up of antialiased pixels](../images/img.antialias.png class=pixel)
14301409

14311410
</div>
14321411

@@ -1601,11 +1580,7 @@
16011580
<div class='together'>
16021581
This gives us:
16031582

1604-
<div class="render">
1605-
1606-
![First render of a diffuse sphere](../images/img.first-diffuse.jpg)
1607-
1608-
</div>
1583+
![First render of a diffuse sphere](../images/img.first-diffuse.jpg class=pixel)
16091584

16101585
</div>
16111586

@@ -1646,11 +1621,7 @@
16461621
<div class='together'>
16471622
That yields light grey, as we desire:
16481623

1649-
<div class="render">
1650-
1651-
![Diffuse sphere, with gamma correction](../images/img.gamma-correct.jpg)
1652-
1653-
</div>
1624+
![Diffuse sphere, with gamma correction](../images/img.gamma-correct.jpg class=pixel)
16541625

16551626
</div>
16561627

@@ -1730,11 +1701,7 @@
17301701
<div class='together'>
17311702
After rendering we get a similar image:
17321703

1733-
<div class="render">
1734-
1735-
![Correct rendering of Lambertian spheres](../images/img.correct-lambertian.png)
1736-
1737-
</div>
1704+
![Correct rendering of Lambertian spheres](../images/img.correct-lambertian.png class=pixel)
17381705

17391706
It's hard to tell the difference between these two diffuse methods, given that our scene of two
17401707
spheres is so simple, but you should be able to notice two important visual differences:
@@ -1813,11 +1780,8 @@
18131780

18141781
Gives us the following image:
18151782

1816-
<div class="render">
1817-
1818-
![Rendering of diffuse spheres with hemispherical scattering](../images/img.rand-hemispherical.png)
1819-
1820-
</div>
1783+
![Rendering of diffuse spheres with hemispherical scattering
1784+
](../images/img.rand-hemispherical.png class=pixel)
18211785

18221786
</div>
18231787

@@ -2140,11 +2104,7 @@
21402104
<div class='together'>
21412105
Which gives:
21422106

2143-
<div class="render">
2144-
2145-
![Shiny metal](../images/img.metal-shiny.png)
2146-
2147-
</div>
2107+
![Shiny metal](../images/img.metal-shiny.png class=pixel)
21482108

21492109
</div>
21502110

@@ -2197,11 +2157,7 @@
21972157
<div class='together'>
21982158
We can try that out by adding fuzziness 0.3 and 1.0 to the metals:
21992159

2200-
<div class="render">
2201-
2202-
![Fuzzed metal](../images/img.metal-fuzz.png)
2203-
2204-
</div>
2160+
![Fuzzed metal](../images/img.metal-fuzz.png class=pixel)
22052161

22062162
</div>
22072163

@@ -2222,11 +2178,7 @@
22222178
there is a refraction ray at all. For this project, I tried to put two glass balls in our scene, and
22232179
I got this (I have not told you how to do this right or wrong yet, but soon!):
22242180

2225-
<div class="render">
2226-
2227-
![Glass first](../images/img.glass-first.png)
2228-
2229-
</div>
2181+
![Glass first](../images/img.glass-first.png class=pixel)
22302182

22312183
</div>
22322184

@@ -2330,11 +2282,7 @@
23302282

23312283
This gives us the following result:
23322284

2333-
<div class="render">
2334-
2335-
![Glass sphere that always refracts](../images/img.glass-always-refract.png)
2336-
2337-
</div>
2285+
![Glass sphere that always refracts](../images/img.glass-always-refract.png class=pixel)
23382286

23392287

23402288
Total Internal Reflection
@@ -2455,11 +2403,7 @@
24552403

24562404
We get:
24572405

2458-
<div class="render">
2459-
2460-
![Glass sphere that sometimes refracts](../images/img.glass-sometimes-refract.png)
2461-
2462-
</div>
2406+
![Glass sphere that sometimes refracts](../images/img.glass-sometimes-refract.png class=pixel)
24632407

24642408
</div>
24652409

@@ -2544,11 +2488,7 @@
25442488
<div class='together'>
25452489
This gives:
25462490

2547-
<div class="render">
2548-
2549-
![A hollow glass sphere](../images/img.glass-hollow.png)
2550-
2551-
</div>
2491+
![A hollow glass sphere](../images/img.glass-hollow.png class=pixel)
25522492

25532493
</div>
25542494

@@ -2625,11 +2565,7 @@
26252565

26262566
gives:
26272567

2628-
<div class="render">
2629-
2630-
![A wide-angle view](../images/img.wide-view.png)
2631-
2632-
</div>
2568+
![A wide-angle view](../images/img.wide-view.png class=pixel)
26332569

26342570
</div>
26352571

@@ -2713,11 +2649,7 @@
27132649

27142650
to get:
27152651

2716-
<div class="render">
2717-
2718-
![A distant view](../images/img.view-distant.png)
2719-
2720-
</div>
2652+
![A distant view](../images/img.view-distant.png class=pixel)
27212653

27222654
And we can change field of view:
27232655

@@ -2728,11 +2660,7 @@
27282660

27292661
to get:
27302662

2731-
<div class="render">
2732-
2733-
![Zooming in](../images/img.view-zoom.png)
2734-
2735-
</div>
2663+
![Zooming in](../images/img.view-zoom.png class=pixel)
27362664

27372665
</div>
27382666

@@ -2874,11 +2802,7 @@
28742802

28752803
We get:
28762804

2877-
<div class="render">
2878-
2879-
![Spheres with depth-of-field](../images/img.depth-of-field.png)
2880-
2881-
</div>
2805+
![Spheres with depth-of-field](../images/img.depth-of-field.png class=pixel)
28822806

28832807
</div>
28842808

@@ -2955,11 +2879,8 @@
29552879
<div class='together'>
29562880
This gives:
29572881

2958-
<div class="render">
2959-
29602882
![Final scene](../images/img.book1-final.jpg)
29612883

2962-
</div>
29632884
</div>
29642885

29652886
An interesting thing you might note is the glass balls don’t really have shadows which makes them

0 commit comments

Comments
 (0)