In a fish glass far far away from home...

This is the story of Frank the fish

far away from home

Nobody likes being taken away frome home. Especially not Frank. Back in the day, he lived a happy life in the pacific ocean with his family. He was a really funny fish and everybody liked him, because he told the best jokes in the whole ocean.
But one really rainy day in 2019, he lost everything he had. Some weird creatures with arms and legs took him out of the sea, and into a really small glass with water. This is where the story ends, because Frank the fish didn't get a happy ending. He is still missing his family and the ocean.


Our road from jellyfish in the water to a fish glass

We first came up with the idea to take some jellyfish models and put them in water.
After modeling a low-poly jellyfish by ourselves in blender we then realised that we needed volume sampling, and at that point we thought that wouldn't be practically achievable for us so we decided to screw the jellyfish idea.

While looking for other ideas we stumbled upone this image of rendering competition of Stanford.

In their implementation details we found out how they used the enviroment mapper to make their scene look realistic and that introduced us to this website. And after looking at the amazing pictures they made with their raytracer and background image it was clear that we wanted to use it. The best way show the beauty of an enviroment was to use glass, and since we had the jellyfish still in mind, our idea evolved to having a fish jar on a table.


As we wanted to make our picture around a good HDR image, we started to look at ways to import the HDR image to our renderer but since the renderer only supports png, we ended up converting the image to LDR png format. We used the environmental mapper from the assignments to cover our scene.

Our main focus was to make a fish in a glass bowl and that means that a large part of the scene was using glass material. This lead to 2 issues with our implementation:
1) The implementation depended on RNG Jesus to make our image noise-free.
2) Only vacuum to "some other medium" interactions were possible.
So we ended up doing a complete remake of our glass implementation. You can find this code in rt/Materials/rGlass.cpp. This material class computes two rays, one for reflection and one for refraction, and our integrator was modified to account for both rays. Moreover, we added functionality to allow "medium" to "other medium" interactions. After a lot of runs with weird results the glass was finally working.

The next problem was lighting. To make sure diffuse objects didn't stand out from the environment itself, we placed the area light at the light source according to the image and that gave us realistic results. Later on, we added water bubbles, stones, and other decorations.

Because of using area light, we needed a good sampler to reduce noise in the low-resolution image. So after researching about it on the PBRT book and past rendering competitions we realized that zero two sampler would be the best sampler to use. We also implemented a sampling interface and we now have two samplers currently in project.

Random Sampling
Zero Two Sampling

Random Sampler

Zero Two Sampler

We were already using the BVH we made in our assignment but we needed a way to utilize the complete power of our machine so we ended up adding a parallelization support to our code.


  • Rendering Time:
    • ~5 hours (2560x1440) with 256 samples
    • Machine Specs: Intel Core i7-8700 / 6 Cores / 32GB Ram
  • Triangles:~28000
  • Ray Tracing Depth: 10


Here we provide all the links for the obj models and textures we used.