Skip to content

Commit e8c65a9

Browse files
committed
Merge branch 'development' into tdb/normals_and_dielectrics_rebase
2 parents 3944d8d + d3cf9db commit e8c65a9

File tree

1 file changed

+60
-62
lines changed

1 file changed

+60
-62
lines changed

README.md

Lines changed: 60 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -15,71 +15,70 @@ from the web:
1515
- [Ray Tracing: The Next Week][web2]
1616
- [Ray Tracing: The Rest of Your Life][web3]
1717

18-
For printed copies, or to create PDF versions, use the print function in your browser. These books
19-
have been properly formatted for print versions as well.
20-
21-
22-
Getting and Building the Source
23-
--------------------
24-
The [github page][git repo] for this project contains all source and documentation associated
25-
with the _Ray Tracing in One Weekend_ series of books.
26-
27-
A local copy of the project can be created on your machine through git bash:
28-
```
29-
$ git clone https://github.com/RayTracing/raytracing.github.io
30-
```
31-
A local copy can also be obtained by pointing a git gui client to the link:
32-
```
33-
https://github.com/RayTracing/raytracing.github.io
34-
```
35-
36-
Copies of source are provided for you to check your work and compare against.
37-
If you wish to build the provided source, the process uses CMake.
38-
39-
40-
If on Linux or OSX, from the terminal:
41-
```
42-
$ git clone https://github.com/RayTracing/raytracing.github.io
43-
$ cd raytracing.github.io
44-
$ mkdir build
45-
$ cd build
46-
$ cmake ..
47-
$ make
48-
```
49-
50-
If on Windows, building is recommended on CMake Gui with Visual Studio:
51-
```
52-
1. Open CMake Gui on Windows
53-
2. Under "Where is the source code:" set to location of the copied directory
54-
e.g. C:\Users\Peter\raytracing.github.io
55-
3. Add Folder "build" within the location of the copied directory
56-
e.g. C:\Users\Peter\raytracing.github.io\build
57-
4. Under "Where to build the binaries" set to newly created build directory
58-
5. Click "Configure"
59-
6. Under "Specify the generator for this project" set to your version of Visual Studio
60-
7. Click "Done"
61-
8. Click "Configure" again
62-
9. Click "Generate"
63-
10. In File Explorer, navigate to build directory and double-click the newly created .sln project
64-
11. Build in Visual Studio
65-
```
18+
These books have been formatted for both screen and print. For printed copies, or to create PDF
19+
versions, use the print function in your browser.
20+
21+
22+
Downloading The Source Code
23+
----------------------------
24+
The [GitHub home][] for this project contains all source and documentation associated with the _Ray
25+
Tracing in One Weekend_ series of books. To clone or download the source code, see the green "Clone
26+
or download" button in the upper right of the project home page.
27+
28+
29+
Building and Running
30+
---------------------
31+
Copies of source are provided for you to check your work and compare against. If you wish to build
32+
the provided source, the project uses CMake. At the root of the project directory, run the following
33+
commands to build the debug version of every executable:
34+
35+
$ cmake -B build
36+
$ cmake --build build
37+
38+
You can specify the target with the `--target <program>` option, where the program may be
39+
`inOneWeekend`, `theNextWeek`, `theRestOfYourLife`, or any of the demonstration programs. By default
40+
(with no `--target` option), CMake will build all targets.
41+
42+
On Windows, you can build either `debug` (the default) or `release` (the optimized version). To
43+
specify this, use the `--config <debug|release>` option.
44+
45+
### CMake GUI on Windows
46+
You may choose to use the CMake GUI when building on windows.
47+
48+
1. Open CMake GUI on Windows
49+
2. For "Where is the source code:", set to location of the copied directory. For example,
50+
`C:\Users\Peter\raytracing.github.io`.
51+
3. Add the folder "build" within the location of the copied directory. For example,
52+
`C:\Users\Peter\raytracing.github.io\build`.
53+
4. For "Where to build the binaries", set this to the newly-created build directory.
54+
5. Click "Configure".
55+
6. For "Specify the generator for this project", set this to your version of Visual Studio.
56+
7. Click "Done".
57+
8. Click "Configure" again.
58+
9. Click "Generate".
59+
10. In File Explorer, navigate to build directory and double click the newly-created `.sln` project.
60+
11. Build in Visual Studio.
6661

6762
If the project is succesfully cloned and built, you can then use the native terminal of your
6863
operating system to simply print the image to file.
6964

70-
If on Linux or OSX, from the terminal:
71-
```
72-
$ ./inOneWeekend > weekendOutput.ppm
73-
```
65+
### Running The Programs
66+
67+
On Linux or OSX, from the terminal, run like this:
68+
69+
$ build/inOneWeekend > image.ppm
70+
71+
On Windows, run like this:
72+
73+
build\debug\inOneWeekend > image.ppm
74+
75+
or, run the optimized version (if you've built with `--config release`):
7476

75-
If on Windows, open the command line, cmd.exe:
76-
```
77-
C:\Users\Peter\raytracing.github.io\build\inOneWeekend.exe > weekendOutput.ppm
78-
```
77+
build\release\inOneWeekend > image.ppm
7978

80-
This PPM file can then be viewed as a regular computer image. Most operating systems come natively
81-
with a PPM viewer included. If your operating system has difficulty knowing what to do with the
82-
output, then PPM file viewers can be easily found online.
79+
The generated PPM file can be viewed directly as a regular computer image, if your operating system
80+
supports this image type. If your system doesn't handle PPM files, then you should be able to find
81+
PPM file viewers online. We like [ImageMagick][].
8382

8483

8584
Corrections & Contributions
@@ -96,9 +95,8 @@ review the [CONTRIBUTING][] document for the most effective way to proceed.
9695
[cover1]: images/RTOneWeekend-small.jpg
9796
[cover2]: images/RTNextWeek-small.jpg
9897
[cover3]: images/RTRestOfYourLife-small.jpg
99-
[git repo]: https://github.com/RayTracing/raytracing.github.io/
100-
[releases]: https://github.com/RayTracing/raytracing.github.io/releases/
101-
[submit issues via GitHub]: https://github.com/raytracing/raytracing.github.io/issues/
98+
[GitHub home]: https://github.com/RayTracing/raytracing.github.io/
99+
[ImageMagick]: https://imagemagick.org/
102100
[web1]: https://raytracing.github.io/books/RayTracingInOneWeekend.html
103101
[web2]: https://raytracing.github.io/books/RayTracingTheNextWeek.html
104102
[web3]: https://raytracing.github.io/books/RayTracingTheRestOfYourLife.html

0 commit comments

Comments
 (0)