Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Ray Tracer  (Read 3780 times)

0 Members and 1 Guest are viewing this topic.

Strikerklm96

  • Jr. Member
  • **
  • Posts: 74
    • View Profile
    • Email
Ray Tracer
« on: April 14, 2016, 07:45:15 pm »
For a class project I had to build a ray tracer from scratch, but we were allowed to use any program we wanted to display and manage things like color etc. So I use sfml to display and save the images, as well as sf::Color. I obviously had to make my own Vector and Geometry classes though.

It (can) use an Octree to speed up the ray tracing, but it only starts to pay off above a few hundred objects in the scene.

Features:
Octree
Soft and Hard Shadows
Antialiasing
Multijittering
Directional, Point, and Area Lights
Potentially Unlimited reflection recursion.
Any object can have varying levels of Reflection, Diffuse Shading, Specular Reflection, Object Color
Mesh Loading
Spheres
Triangles
Parallelograms
Infinite Planes
Camera (moves, pitches, yaws, rolls)

The camera actually moves all the objects in the scene by the inverse transformation.

I'll post the code when the class ends (to prevent other students from finding my code and potentially copying and getting me in trouble). In the mean time, here are some of the best images.

Click to enlarge:
1000x1000; 4 sample Multi-jitter; Unlimited reflective recursion; Area light with 36 samples (6x6); Various Diffuse,Specular,Reflective values for the spheres and planar floor. Took 4 minutes to render.


1601 Spheres.

A purple cow.

Purple Teapot.
« Last Edit: April 14, 2016, 07:50:18 pm by Strikerklm96 »

bitano

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
Re: Ray Tracer
« Reply #1 on: April 14, 2016, 09:26:35 pm »
The teapot made me go and make tea. I think there's a hidden message somewhere in the image :S

K.F

  • Jr. Member
  • **
  • Posts: 55
    • View Profile
    • Email
Re: Ray Tracer
« Reply #2 on: April 15, 2016, 05:20:15 am »
It's the Utah teapot, it's pretty much the "hello world" of 3d.

 

anything