divyanshu-talwar / Raytracing

Implement a raytracer and simulate real-life light interactions with objects (like shadows/reflections) while experimenting with rendering objects made up of different materials (like dielectrics or specular).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Raytracing

Implement a raytracer and simulate real-life light interactions with objects (like shadows/reflections) while experimenting with rendering objects made up of different materials (like dielectrics or specular).

In this project we:

  • Render a couple of objects in flat color.
  • Simulate specular/shiny surfaces with Blinn-Phong shading.
  • Render shadows.
  • Simulate reflective and dielectric materials using Schlick’s approximation to Fresnel’s reflection.
  • Simulate the attenuation of light while passing through dielectrics with Beer's law.

Results

  1. Rendering objects in flat color

  1. Blinn-Phong shading:

  1. Adding shadows:

  1. Simulate reflection and refraction with specular and dielectric objects:

    Reflection Refraction (Schlick’s approximation)
    cube_image sphere_image
  2. Beer–Lambert law

    Refraction (Schlick’s approximation) Refraction (Schlick’s approximation + Beer's Law)
    cube_image sphere_image

Execution

  • Generate the object file:
    • mkdir build && cd build
    • cmake ..\
    • make
    • cd ../
  • Execute the object file:
    • ./bin/raytracer

About

Implement a raytracer and simulate real-life light interactions with objects (like shadows/reflections) while experimenting with rendering objects made up of different materials (like dielectrics or specular).


Languages

Language:C 56.0%Language:C++ 32.1%Language:Makefile 4.8%Language:HTML 2.5%Language:CMake 1.4%Language:Objective-C 1.0%Language:Python 0.6%Language:VBA 0.3%Language:Shell 0.3%Language:Perl 0.3%Language:Pascal 0.2%Language:M4 0.1%Language:C# 0.1%Language:Less 0.1%Language:Visual Basic .NET 0.1%Language:Batchfile 0.1%Language:Raku 0.0%Language:Mathematica 0.0%Language:FreeBasic 0.0%Language:CSS 0.0%Language:Gnuplot 0.0%Language:GLSL 0.0%Language:SWIG 0.0%Language:Fortran 0.0%