In order to simulate the real world as accurately as possible we utilize a number of techniques.
You can't render a scene if you don't have one. Our ray tracer can easily parse massive POV-Ray files and spit out a beautiful scene in no time!
As a final wrap up the class we had the chance to try our hands at virtual reality via Google Cardboard.
The main goal of this class was to develop a ray tracer that would be able to simulate several real world lighting effects and generate beautiful and captivating imagery. I'm happy to say that our attempt at this was a success as we have indeed managed to create such a program.
Ray tracing is a local illumination algorithm capable of high quality shadows. Color is calculated by having a ray cast from the camera through each pixel in an image plane. The color that is returned to that point depends on a variety of factors such as the positions and shape of geometries within the scene, the lights within the scene, and the material properties of the geometies in the scene.
Thanks to the use of a bounding volume hierarchy in order to check collisions, our ray tracer achieved massive performance gains. Additionally, the utilization of icpc as the goto compiler and multithreading resulted in even faster renders. The bunny to the left contains approximately 105400 geometries in the form of triangles and spheres and took our ray tracer an 1 hour 26 minutes and 39 seconds in order to run with both anti-aliasing and global illumination. On the banner at the top of the page section there is also a picture of Zoe's provided dragon_huge_tris.pov that contains approximately 202520 triangles and took 2 hours 6 minutes and 54 seconds to run with both anti-aliasing and global illumination.
Here is a collection of the POV-Ray scene files we produced as part of this project as well as their corresponding images. All images were rendering using anti-aliasing as well as global illumination. The sunflower and totoro files are both excellent ways of showing off how well our global illumination and anti-aliasing look. The crystalball file is less improved by anti-aliasing but is an excellent way of showing that our reflections and refractions are working and that they play nice with global illumination.
totoro.jpg | totoro.pov |
sunflower.jpg | sunflower.pov | crystalball.jpg | crystalball.pov |
This short project was a fun (and once working) relatively simple foray into the realm of virtual reality! The world we created was kept simple so as to avoid low framerates on mobile devices. It featured only assets that we obtained outside of Unity tutorials, which added a bit of extra set up time since most of them needed to have their textures assigned or their internal hierarchy positions shifted. The trees being the highest quality we made sure to set the shaders for the leaves to be the optimal ones for mobile devices. In our simple world we placed a number of such trees as well as a circling owl, a frog, and a wolf. All models but the owl (which could not be reached) had colliders associated with them so that the player could not simply walk through them. While the trees were kept completely immobile, the wolf is able to be moved (with effort as it is heavy), and the frog is easily moved, though its movement had been restricted so it can only move in a circle. With our world so populated by nature, we thought it would be appropriate to add relaxing forest ambient sounds as well, and so we did. Navigation through the world was done through tilting the headset forward a little bit in order to walk forward, forward a lot to run forward, and back in order to move backward. We utilized Unity's built in terrain editor in order to give the player an interesting expanse to explore with many hills and variations in the ground across its entirety thanks to normal mapping. Reaching the edge of the game world resets the player in the center of the map.