While initially building the scene for showcasing the raytracer we had built over the semester, we wanted to build something that looks realistic. As both of us like simplicity we tried to replicate this concept scene we saw on r/blender. The scene exactly fit our two important motives: photorealisim and simplicity.
In blender when we modeled, the candle we have used subsurface scattering to get a realistic effect, but in order to get a similar effect in our raytracer, we used gradient-based texture to mimic the BSSSF. The candle flame was modeled by combining a cone and an inverted cone resulting in a similar structure of a flame. Then we deformed it to get the irregular surfaces to obtain as close to a real-looking flame. Then we tried a few textures that mapped the flame in the way we wanted and set it to the flat material, which gives a burning effect. We were really happy with what we ended up with initially, particularly some of the effects like the reflection of the candle in the mirror.
Once we had this initial scene, we wanted to test the limits of our raytracer. We choose a Halloween theme for these modifications and added objects and lighting around the scene to best fit this theme, We extensively used textures to highlight the scene, and mainly flat material is used throughout the scene. The spider's eyes are set to white texture with flat material that gives a glowing effect in the darkness. In addition, the pumpkin's and ghost interiors contain a flat material with gradient image texture to give a nice emission effect which gets highlighted in an overall dark background.
To enhance the realism of the scene we added irregular spider webs and ants. We also added broken glass in the background, along with fungus texture to the mushroom and wooden plank. Finally, we added a sunset environment, which blends nicely in our scene.
eventually, everything fell into place and ended up in a nice realistic Halloween theme scene which we are really satisfied with.
Prototyping
This is the result of our first good looking renderer.
This is our model file in blender
Concept
We came across a great photorealistic image in r/blender, which sparked our inspiration for the scene.
We conceptualized and modeled our scene with the help of blender.
Result
Finally, after a lot of iterations, we were able to achieve a convincing-looking scene.
As a Key Feature, we incorporated a depth of field camera to shoot rays in our scene. This gives the scene a nice effect (by blurring the wall and mirror) and adds realism to the scene, also it attracts attention to the central objects of the scene, for example in the case of the perspective camera, the render of the background mirror is very sharp and the viewer is instantly drawn to it.
The inspiration image has a nice realistic look for the candle glass by incorporating the fingerprint textures. Since, our implementation of glass material does not have a texture property to it, we modified the combine material to consider a texture weighting parameter in addition the material weight parameter, resulting in nice output. We tried to get the fingerprints to work, but unfortnately it didn't work out but we ended up with a satisfying output.
materials/combineTex.h; materials/combineTex.cpp
With Bump Map
Without Bump Map
Another feature important for our scene is bumpmapping. We use displacements read off a bump texture to perturb normals to a surface, this adds more fine grained surface properties withhout the cost of using high triangulation to potray them. As can be seen, bump mapping gives the plank a scratchy wooden texture which looks more realistic
primmod/bmap.h; primmod/bmap.cpp
With Env Mapper
Without Env Mapper
One of the most vital features for our scene is the environment map.Without the addition of this our scene seems empty,
We incorporated the smooth triangles on the ghost, to give it a smoother appearance. For each surface hit we interpolated the normals using barycentric coordinates. With this, the ghost gets a smoother appearance and the triangulation artifact on it’s chest is gone.
solids/striangle.h; solids/striangle.cpp
Extras
Bounding Volume Hierarchies
We have used bounding volume hierarchies to greatly reduce the time of ray-intersection with the scene compared to simplegroups
Multithreading
We used multithreading in render.cpp and also in the ray intersection part of the bvh.cpp which vastly reduced the overall rendering time.
Area Lights
We have used four area lights spread across the entire scene which was better than point lights resulting in a softer shadows. In additon, a spot light is placed above the spider to give importance to it.
Credits
We would like to thank Dr. Phillip for this amazing course and to the tutors who made it even more amazing by clarifying all our doubts throughout duration of the course.