CS 636 Programming Assignment 5 - Add shadows

Summary

This scene shows shadows from three different lights(pure white, redish, blueish).

Rendering uses BVH acceleration and adaptive supersampling with two levels of subdivision.

Scene Setup

The camera for the scene is setup at (0,0,4) for the eye point, with a view direction of (0,0,-1) and a view up direction of (0, 1,0 ). The view plane distance is 6, and the horizontal camera angle is PI / 6.

The scene has three point light sources:

The scene has a floor (made from a scaled cube) underneath to provide a surface for shadows. The other objects are four spheres, a cube, a mesh cylinder, a bunny, and a teddy bear.

                Bunny
                    transform[
                        translate=[0, -1, 0]
                        scale=[2, 2, 2]
                        rotate=[0, -1.0472, 0]
                    ]
                    surface[
                        colors diffuse=(0.8, 0.2, 0.9),  ambient=(0.8, 0.2, 0.9),  specular=(1, 1, 1)
                        coeff. diffuse=0.5,  ambient=0.1,  specular=0.7
                        specular factor=30
                    ]

                Sphere 1
                    center=[3, -1.1, -5]
                    radius=0.7
                    surface[
                        colors diffuse=(0.0117647, 0.32549, 0.592157),  ambient=(1, 1, 1),  specular=(1, 1, 1)
                        coeff. diffuse=0.8,  ambient=0.1,  specular=0.4
                        specular factor=25
                    ]

                Sphere 2
                    center=[-4, -1, -3]
                    radius=1
                    surface[
                        colors diffuse=(0.909804, 0.388235, 0.0392157),  ambient=(0.909804, 0.388235, 0.0392157),  specular=(1, 1, 1)
                        coeff. diffuse=0.3,  ambient=0.1,  specular=0.6
                        specular factor=15
                    ]

                Sphere 3
                    center=[2, 1, -20]
                    radius=8
                    surface[
                        colors diffuse=(0.470588, 0.988235, 0.54902),  ambient=(1, 1, 1),  specular=(1, 1, 1)
                        coeff. diffuse=0.8,  ambient=0.1,  specular=0.4
                        specular factor=25
                    ]

                Sphere 4
                    center=[6, 0.2, -9]
                    radius=2
                    surface[
                        colors diffuse=(0.988235, 0.0784314, 0.0784314),  ambient=(1, 1, 1),  specular=(1, 1, 1)
                        coeff. diffuse=0.8,  ambient=0.1,  specular=0.4
                        specular factor=25
                    ]

                Teddy
                    transform[
                        translate=[-3, 1, -9]
                        scale=[0.15, 0.15, 0.15]
                        rotate=[0, 0.785398, 0]
                    ]
                    surface[
                        colors diffuse=(0, 0.117647, 1),  ambient=(0, 0.117647, 1),  specular=(1, 1, 1)
                        coeff. diffuse=0.5,  ambient=0.1,  specular=0.5
                        specular factor=25
                    ]

                Cylinder
                    transform[
                        translate=[3, -1, -2]
                        scale=[1, 1, 1]
                        rotate=[0.523599, 0, 0]
                    ]
                    surface[
                        colors diffuse=(0.988235, 0.85098, 0),  ambient=(0.988235, 0.85098, 0),  specular=(0.988235, 0.85098, 0)
                        coeff. diffuse=0.8,  ambient=0.05,  specular=0.05
                        specular factor=2
                    ]

                Cube
                    transform[
                        translate=[0, 3.5, -11]
                        scale=[1, 1, 1]
                        rotate=[0, -1.0472, 0]
                    ]
                    surface[
                        colors diffuse=(0, 0.117647, 0.423529),  ambient=(0, 0.117647, 0.423529),  specular=(0, 0.117647, 0.423529)
                        coeff. diffuse=0.8,  ambient=0.1,  specular=0.4
                        specular factor=25
                    ]

                Floor
                    transform[
                        translate=[0, -2, -6.7]
                        scale=[14, 0.2, 14]
                        rotate=[0, -0.523599, 0]
                    ]
                    surface[
                        colors diffuse=(0.8, 0.8, 0.8),  ambient=(0.8, 0.8, 0.8),  specular=(0.8, 0.8, 0.8)
                        coeff. diffuse=0.8,  ambient=0.1,  specular=0.1
                        specular factor=2
                    ]
            

Rendering time using on my M1 Mac Mini was 410 seconds.