Way Back home

I just want to go home
Scene Concept Scene Render

Scene Concept

For this project, we tried out a lot of ideas and they didn't work out despite us trying extremely hard. We felt like crying and... just wanted to feel safe. The place where we wanted to be was home.

This scene is a tribute to home. There is a song called “This house is not for sale”, which shares the feelings we have. Even if there is nowhere to run, we can always go home. The place where we are always welcome, regardless of what we achieved or failed to. It is the place “where memories live and my dreams don’t fail” and that is why precisely it can never be for sale.

There ultimately comes a time in our lives when we are lost and have forgotten who we are and if you ever find yourself in that situation, I hope that you find your way back home. Your home isn’t necessarily something physical. It may be something abstract like a set of values that guide you. Again, It should never be something that you put for sale. It is who we are. We can’t exist without our home but our home can exist without us.

Lastly, we would like to acknowledge a home that is very dear to us.

To the people, who I can call home: Thank you, you mean more than the world to me. You are the shoulders I could rest on, and every time I pushed myself and it didn’t work out, what ever bond we had, got me through. We often neglect our homes, spending time on work but I hope that I never neglect you. I hope the time and effort we put in this scene serves as a visible reminder to us to always find our way home. There is no other place I would rather be.

Scene Details

Primitive Count: 119,736 Primitives Low Resolution: 500×300 px

Render Time: 1.867 seconds

High Resolution: 1500×900 px

Render Time: 15.803 seconds

Before the scene: The road of disappointments

We initially wanted a scene that is set in a cherry blossom garden in Japan. It was supppsed to look like this:

The Dream

Contact

Started out with a tree

Contact

How did it end up like this: It was only a render, only a render

Contact

Calm down... lets get back to step 1

Contact

Some Area Light might help (Note that this scene contains over 500,000 primitives)

Contact

The actual scene

At this point, our desire to go home grew deeply and this scene is a visual depiction of that. In order to make the scene, we used our anti-aliasing raytracer which took 100 images and averages them. We placed 4 area lights. One at the sun, and the rest at 3 ends of the house boundary (excluding the bottom left boundary). The sun is of cosine material, while the house is of Phong Material. We added the coloring of the polygons ourselves.

Low Resolution Version (500x300)

High Resolution Version (1500x900)

The Visual Touches

Image Features

Class

Baseline: Simple Sampler

Full Resolution

Class

Anti-Aliasing: Regular Sampling

Full Resolution

Class

Anti-Aliasing: Random Sampling

Full Resolution

Class

Anti-Aliasing: Jittered Sampling

Full Resolution

Class

Flat Shading

Full Resolution

Class

Smooth Shading

Full Resolution

Class

Shiny, Glass and Transparent Material*

Full Resolution

Class

Point Light: Hello World (again)!*

Full Resolution

Class

Directional Light with Recursive Tracer

Full Resolution

Class

Directional Light with Shadow Tracer

Full Resolution

Class

Area Light

Full Resolution

Class

Phong Shading

Full Resolution

Class

Reflections with Transparency

Full Resolution

Acceleration Structure: How fast can we get?

Uniform Grid

Without Grid Time Without Grid RAM Usage(kbytes) With Grid Time With Grid RAM Usage(kbytes)
1,000 primitives 6.946 seconds 8,136 0.41 seconds 8,452
10,000 primitives 66.792 seconds 8,704 0.512 seconds 13,284
20,000 primitives 133.622 seconds 9236 0.535 seconds 12,412
40,000 primitives 266.496 seconds 10,936 0.629 seconds 17,356
100,000 primitives ≈ 1 hour 14,447 0.817 seconds 32,008
Class

1,000 primitives

With/Without Uniform Grid
Class

10,000 primitives

With/Without Uniform Grid
Class

20,000 primitives

With/Without Uniform Grid
Class

40,000 Primitives

With/Without Uniform Grid
Class

100,000 Primitives

With/Without Uniform Grid
Class

1,000,000 Primitives

With/Without Uniform Grid
What can the tracer do?

Code Features

Acceleration Structure: Uniform Grid

Acceleration Structure: BVH

Camera: Parallel & Perspective

Geometry: Triangles, Spheres, Smooth Triangles, "Compound"

Lighting: Point Light, Area Light, Directional Light

Material: Cosine, Transparent, Shiny, Phong

Multi-threading

Mesh Loading

Smooth Shading for meshes

Build the scenes yourselves! (just replace the build file) In order to use a different tracer, just change the tracer set in the build files. for example new BasicTracer() for the Basic tracer.

Build files

Instruction: Be in the raytracer folder and run g++ main.cpp ./tracers/*.cpp ./utilities/*.cpp ./world/*.cpp ./cameras/*.cpp ./geometry/*.cpp ./materials/*.cpp ./samplers/*.cpp ./lights/*.cpp ./acceleration/*.cpp ./build/file.cpp -fopenmp

buildHelloWorld.cpp
buildHelloWorldJittered.cpp
buildHelloWorldRandom.cpp
buildHelloWorldRegular.cpp
buildFlatBunny.cpp
buildBalls.cpp (You can modify it to generate more balls)
BuildNewMvp.cpp
buildSmoothBunny.cpp
buildTree.cpp
buildNewMVP.cpp
buildNewMVP2.cpp
buildHouse.cpp
buildChapter14Reflective.cpp
buildChapter14ReflectiveTransparent.cpp
The shoulders we stood on

Acknowledgements

Ray Tracing from the Ground Up

Wikipedia (Shading articles)

Ray Tracing in One Weekend (It actually took more 😢)

House Model

Cherry Blossom Tree Model

Grass Model

HapPLY

Bunny Mesh

Meet The Team

Hello. We are 3 CS seniors at Habib University and this was our ray tracer project for Computer Graphics. Thanks for checking it out. We really appreciate it and hope you liked it.

Shams Arfeen

CS 2022

Fasih Hussain

CS 2022

Khubaib Kasbati

CS 2022

A few words

Hello, you made it to the end. Thank you for reading so far. We really appreciate it. We would like to thank Dr. Waqar Saleem to teach the course. It was a fun experience. For transparency, I want to tell you that the renders with * have been done in a previous version of the code and since the structure changed, we can no longer create them in the new tracer. We implemented 3 new tracers in total: Recursive tracer, which traces recursively without shadows, shadow tracer to trace recursively with shadows and anti-aliasing tracer, which makes multiple images and averages them and recurses like the shadow tracer. If you want to create the renders marked as * image, there is a folder in the repository called reflections+refractions folder, where you can use the tracer to make them. The Instructions for generating them can be found in the raytracer.cpp file of that folder.