Code Monkey home page Code Monkey logo

raytracing.github.io's Introduction

Ray Tracing in One Weekend Book Series

RT in One Weekend RT The Next Week RT The Rest of Your Life
In One Weekend The Next Week The Rest of Your Life

Getting the Books

The Ray Tracing in One Weekend series of books are now available to the public for free directly from the web:

These books have been formatted for both screen and print. For printed copies, or to create PDF versions, use the print function in your browser.

News

2020-March-23 โ€” v3.0.0 is out! Following the major v2.0.0 release, we finally had the chance to dig into some of the larger changes we'd been wanting to make for a long time. This is a large change across the books and entire source code. The new source code now builds using CMake, for most platforms and build systems. We've refactored a good deal of the project source, cleaning things up, refactoring, adding new functionality where it made sense, and generally trying to simplify the code with the goal of making it easier to understand and modify. Finally, this release includes a number of changes to areas of the book that have given readers difficulties. Enjoy!

Branches

The master branch contains the code at latest release. All ongoing development, with all of the latest changes, can be found in the dev-patch, dev-minor, and dev-major branches.

Downloading The Source Code

The GitHub home for this project contains all source and documentation associated with the Ray Tracing in One Weekend series of books. To clone or download the source code, see the green "Clone or download" button in the upper right of the project home page.

Building and Running

Copies of source are provided for you to check your work and compare against. If you wish to build the provided source, the project uses CMake. At the root of the project directory, run the following commands to build the debug version of every executable:

$ cmake -B build
$ cmake --build build

You can specify the target with the --target <program> option, where the program may be inOneWeekend, theNextWeek, theRestOfYourLife, or any of the demonstration programs. By default (with no --target option), CMake will build all targets.

On Windows, you can build either debug (the default) or release (the optimized version). To specify this, use the --config <debug|release> option.

CMake GUI on Windows

You may choose to use the CMake GUI when building on windows.

  1. Open CMake GUI on Windows
  2. For "Where is the source code:", set to location of the copied directory. For example, C:\Users\Peter\raytracing.github.io.
  3. Add the folder "build" within the location of the copied directory. For example, C:\Users\Peter\raytracing.github.io\build.
  4. For "Where to build the binaries", set this to the newly-created build directory.
  5. Click "Configure".
  6. For "Specify the generator for this project", set this to your version of Visual Studio.
  7. Click "Done".
  8. Click "Configure" again.
  9. Click "Generate".
  10. In File Explorer, navigate to build directory and double click the newly-created .sln project.
  11. Build in Visual Studio.

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

Running The Programs

On Linux or OSX, from the terminal, run like this:

$ build/inOneWeekend > image.ppm

On Windows, run like this:

build\debug\inOneWeekend > image.ppm

or, run the optimized version (if you've built with --config release):

build\release\inOneWeekend > image.ppm

The generated PPM file can be viewed directly as a regular computer image, if your operating system supports this image type. If your system doesn't handle PPM files, then you should be able to find PPM file viewers online. We like ImageMagick.

Corrections & Contributions

If you spot errors, have suggested corrections, or would like to help out with the project, please review the CONTRIBUTING document for the most effective way to proceed.

raytracing.github.io's People

Contributors

hollasch avatar trevordblack avatar ronaldfw avatar kberna avatar shaunplee avatar lmancini avatar lorihollasch avatar oxine avatar celeph avatar fsan avatar tatsuya-ogawa avatar jammm avatar bennetthardwick avatar dmdrummond avatar dafhi avatar joeycho avatar lesleylai avatar rastaban avatar szellmann avatar m-grimaud avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.