Since alcohol containers were a breached topic for raytracing, I thought I'd try to find something original to render. I thought about what kind of liqour they sell in our home country, Norway, and it struck me: "Old Danish" (Gammel Dansk). A type of bitter, like Jägermeister, produced in Denmark that has a unique logo and a beautiful bottle.
Family back home was contacted, and they found two different bottles. My father, the photographer, took a bunch of pictures of the bottles and different glasses. We picked out the ones we liked, and got it modelled. One of the pictures used for inspiration was the following.
To achieve our goals, we implemented the following algorithms/techniques:
- Beer's law
- Fresnel refraction
- Depth of field
- Photon mapping
Beer's law was neccessary to get a good simulation of colored glass, and also to some extent, the liquid inside the glass. We made sure that photons' intensity also was absorbed by the absorbant materials, so that caustics and photon mapping for indirect lighting is affected.
Using Fresnel's equations to determine the amount of reflection and refraction provided by a material was vital to make the glass look "glass-like" - reflecting some of the incoming light as well as refracting it.
Simple file-based texturing was implemented to render the logo on the bottle.
Depth of field
To make the image look more like a real photography and to take attention away from some of the non-realism in the scene, we implemented depth of field, simulating the aperture of a camera shooting rays at a central point. In addition, to reduce computational costs, we implemented an "adaptive" depth of field sampling. When the initial ray is closer to the plane of focus, less samples are used - since they'll hit close together. When the ray hits farther away, we increase the number of samples.
We implemented antialiasing - and specialized it when using depth of field so that we only anti-alias close to the plane of focus - since everything else is blurred when it's out of focus. This is a performance optimization that reduces the amount of samples per pixel for most of the pixels. The rendering uses a 4x4 AA filter on the plane of focus with jittering to prevent artifacts (creating noise instead).
Photon mapping was implemented both for indirect lighting and for caustics (using rejection sampling). Photons are combined with Beer's law and Fresnel refraction to give realistic behaviour to the photons, their direction and their intensity. The final image only uses photon mapping for caustics due to rendering time constraints
The final image looks as follow: