Giter Club home page Giter Club logo

cpp-raytracer's Introduction

CPP_Raytracer

A simple raytracing API. Partly for use in other graphics projects, mostly for my own education in graphics and C++.

To include this in other projects, first build this API by navigating to lib. From there:

  • mkdir build && cd build && cmake ..

This set of commands will create two libraries, libRtxRelease and libRtxDebug. The Release version has all the compiler optimizations that make this library run fast, while the Debug version has debug symbols in case you want to inspect the API in a debugger. For all intents and purposes, the Release version should be fine. Link this library with your project, and #include include/rtcore.h in your main file.

You can check out some examples in ./demo. Just run /bin/bash build.sh to run it.

Features

  • Renders spheres (still and moving) and triangle meshes. Meshes can be loaded from OBJ files, as shown in ./demos/main.cpp.
  • Lazy construction of acceleration structures such as Bounding Volume Hierarchies and AABBs.
  • Different surface material types, such as Lambertian, Dielectric, Metallic, and Glossy.
  • A Transform class for easily applying linear transformations (translation, scale, rotation) to objects.

TODOs

  • Implement Texture and Sampler classes.
  • A class for light sources. Currently the only light source is a a blue-sky environment light, and it cannot be modified.
  • Ray-scattering should be iterative. Currently, it is implemented recursively, which is more intuitive but inefficient.
  • A lot of other stuff...
  • Create Renderer class that accepts a scene, along with user parameters, and renders that scene. Currently, the task of rendering a scene is left up to the user, though the ./demo explains how to do it. Parameters should include the output texture dimensions, samples per pixel, maximum num of ray bounces, etc.

References

Raytracing In One Weekend - For getting started

Physically Based Rendering: From Theory to Implementation (3rd ed.) - For doing everything else

cpp-raytracer's People

Contributors

rshiv2 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.