Ray tracer

 

 


The ray tracer is the result of a 2 week Masterclass given by Jacco bikker. I was part of a 3 man team.

 

Project details

Technical details

  • 2016 ( 2 weeks )
  • Team Project
  • Pc
  • C++
  • Template project for Basic functionality

Role

Awards / recognition

  • Graphics Programmer
  • Best of the class, graded a 10 by Jacco himself

 

Our Result

The main project included the following functions:

  • Reflection
  • Refraction
  • Hard and/or Soft Shading

In a second project we made included

  • God rays
  • Color bleeding

For optimisation we used:

  • Multi treading (worker pool)
  • BVH algorithm to dissect the objects vertexes
  • SSE SIMD for faster computing
http://johanholthausen.com/wp-content/uploads/2016/12/clip2016-07-10at08.41.44.jpg
clip+(2016-07-10+at+08.41.44)
http://johanholthausen.com/wp-content/uploads/2016/12/2016-07-15_18-27-09.jpg
2016-07-15_18-27-09
http://johanholthausen.com/wp-content/uploads/2016/12/2016-07-15_18-28-02.jpg
2016-07-15_18-28-02
http://johanholthausen.com/wp-content/uploads/2016/12/2016-07-15_00-07-36.jpg
2016-07-15_00-07-36
http://johanholthausen.com/wp-content/uploads/2016/12/2016-07-15_00-28-05.jpg
2016-07-15_00-28-05
http://johanholthausen.com/wp-content/uploads/2016/12/2016-07-15_00-28-42.jpg
2016-07-15_00-28-42
http://johanholthausen.com/wp-content/uploads/2016/12/2016-07-15_00-32-32.jpg
2016-07-15_00-32-32

 

What I worked on

In general the ray tracer was a combined effort, but some more specific parts where done by individuals.

 

Soft Shading

I created soft shading by shooting multiple rays from the objects hit point towards random points on the light source. I had a color buffer and for each ray I would either add black (no light hit) or the texture color (light hit). This gave a nice soft shading as result.

 

God Rays

For the god rays technique I made a color buffer list for each pixel position. With god rays you go to a random direction on a hemisphere with each ray hit until you reach the light or a cast limit. each frame I send a new ray and the result is added to the color buffer list. The buffer list is then rendered, as result you steadily get a better image of the scene with each tick.

 

Color  bleeding

With color bleeding you take into account the color of the object you hit with each ray bounce time the light strength. As a result you get a reflection of the objects color onto other objects. In the image below there is a light above the 2 green spheres and a white ball below.