Giter Site home page Giter Site logo

djstingraytracer's Introduction

DJStingRayTracer

This is an implementation of a simple ray tracer following Ray Tracing In One Weekend by Peter Shirley

Dependencies

I've directly included the two single file header dependencies (json.hpp and cxxopts.hpp) in the source directory so there are no library prerequisites to download / install.

Compiling

The simplest way is to use CMake

git clone [email protected]:matthewh806/DJStingrayTracer.git
cd DJStingrayTracer
mkdir build && cd build
cmake .. -GXcode

Change the argument for the -G flag according to your platform

Building

From within the build directory:

cmake --build . --config Debug

Change the --config flag to Release if you really want (there's no difference at the moment beyond size of the binary).

This will create an executable in the Debug / Release directory.

Running

The executable expects one command line argument specified with an -i / --inputdata flag. This is a path to a json file containing world data for constructing the scene to be rendered (see world_data/basic_world.json for an example).

Note: At the moment the rendered world pixel data is written to standard output - which isn't really very useful, so I would suggest redirecting it to a file on the command line. For example:

./WeekendRayTracer -i path/to/directory/DJStingrayTracer/world_data/basic_world.json > raytracer.ppm

This only works with absolute paths at the moment. Once this file is generated you can use a tool like ToyViewer (macOS) to see the rendered result.

Thanks

DJ Stingray 313 - for that mix and throwing great parties in general, but also for providing the inspiration for the (shitty) name for this project. The dream is to create a raycaster which can render an image of DJ Stingray 313 swimming & raving with real stingrays. This will be 313 x 313 pixels in honour of his artist name change.

Peter Shirley - without whom none of this would have been possible :')

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.