Code Monkey home page Code Monkey logo

monte_carlo_ray_tracer's Introduction

Monte Carlo Ray Tracer

This project is a program for rendering virtual 3D scenes with the global illumination algorithm Monte Carlo ray tracing.

The algorithm recursively trace light rays from the camera out in the scene and bounces them around on / through the surface of objects.

The project was made for the course Advanded Global Illumination and Rendering, TNCG15, at Linköpings University.

Features

  • Some predefined object classes (spheres, planes).
  • Possibility to load triangle meshes in to the scene.
    • Octree data structure used to partition triangles for faster rendering.
  • Material properties for 3D objects
    • Diffuse color
    • Specular color
    • Reflectance [0, 1]
    • Specular reflectance [0 (diffuse), 1 (mirror)]
    • Transmissivity [0, 1]
    • Refraction_index [1 (air), 2.4 (diamond)]
    • Roughness [0, inf) Used for evaluation of the Oren-Nayar BRDF
  • Monte Carlo ray tracing algorithm, simulates many light phenomena:
    • Color bleeding
    • Soft shadows
    • Reflection
      • Currently not considering the Fresnel effect.
    • Refraction
      • Uses Schlick's approximation to Fresnels equations for reflected part.
  • Photon mapping for caustic effects.
    • Using a kd tree from the c++ library "kdtree++" by Martin F. Krafft.
  • Simple paralellization using openMP.
  • Using the XML parser pugixml to be able to load XML files describing the scenes.

Future Work

  • Implement a depth of field technique.
  • Other optimizations (reduce cash misses, simplify code, precomputing, better paralellization technique).
  • Make different wavelengths refract a different amount and increase number of wavelengths.
    • This way it is possible to achieve rainbow effects from refraction.

monte_carlo_ray_tracer's People

Contributors

kbladin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

monte_carlo_ray_tracer's Issues

crash on windows system due to the filename

I am only here to suggest changing the filename of our output to something else~ Some times, it is not allowed to use ":" as part of filename.(it takes me sometime to discover that fact...)
As you can see, the default filename now has the format "YYYY-MM-DD.HH:mm:ss.ppm".

Licensing Question

Hello! What is the license for the project?

I want to fork this ray tracer and integrate it to my dcdr (this project is mainly focused on distributed ray tracing over network idea presentation and not on raytracing techniques itself). It looks like your implementation is enough for my purpose, and it can be easily integrated to dcdr code base.

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.