Coder Social home page Coder Social logo

jsilll / raytracer Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 9.75 MB

Raytracer engine based on the Raytracing Series by Peter Shirley

License: MIT License

CMake 7.72% C++ 92.28%
raytracing raytracing-engine raytracing-in-one-weekend raytracing-one-weekend

raytracer's Introduction

Raytracer

This is simple CPU raytracer. It is based on the book "Ray Tracing in One Weekend" by Peter Shirley. The code is written in C++ and only uses the standard library. The code is written in a way that it is easy to understand and modify. The code is not optimized for speed and is not meant to be used in production. It is meant to be used as a learning tool.

It consists in a raytracing library and a simple application that uses the library. The library is in the include/rt folder and the application is in the apps folder.

Roadmap:

  • Code coverage
  • Review RT API
  • Raytracing in One Weekend
  • Raytracing the Next Week
  • Raytracing the Rest of Your Life
  • Adding support for other image formats

Application / Library Features

  • BMP File Support
  • Normal Map Rendering
  • Depth Map Rendering

Library Documentation

The library documentation can be built using Doxygen. The Doxygen will produce adocs folder. The documentation can be built using the following command:

doxygen Doxyfile

Building the Application

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release

Application Usage

The application can be run with the following command:

./raytracer
--seed=<SEED>
--width=<WIDTH>
--height=<HEIGHT>
--output=<OUTPUT>
--samples=<SAMPLES>
--bounces=<BOUNCES>
--render_type=[normal_map|depth_map]

The seed argument is used to seed the random number generator. The width and height arguments are used to set the width and height of the output image. The output argument is used to set the output file name. The samples argument is used to set the number of samples per pixel. The bounces argument is used to set the number of bounces per ray. The render_type argument is used to set the type of render to produce.

There are a few optional arguments that can be passed to the application.

--max_depth=<MAX_DEPTH>

This argument is useful when --render_type=depth_map is set. The max_depth argument is used to set the maximum depth for the depth map. The default value is 1.

Benchmarks

The following benchmarks were run on an Intel Core i7-7700K CPU @ 4.20GHz with 16GB of RAM.

Benchmark Time
1 0.00
2 0.00
3 0.00
4 0.00

Contributing

If you want to contribute to this project, please follow the following steps:

  1. Fork the project
  2. Create a new branch
  3. Make your changes
  4. Create a pull request
  5. Wait for the pull request to be reviewed and merged

License

This project is licensed under the MIT License - see the LICENSE file for details

Acknowledgments

Contact

If you have any questions, feel free to contact me via email.

raytracer's People

Contributors

jsilll avatar

Watchers

 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.