Assn 3 - Basic Shading

All code for this assignment can be found here

PHONG Screenshot:


Coordinate System Used RHS
Camera Location (0, 1, 7) looking at origin with (0, 1, 0) as up vector
Blue Sphere Radius 1.3 Units
Blue Sphere Position (2.3, -0.3, 2.2)
Blue Sphere Illumination Model Phong (k_a = 0.9, k_d = 0.3, k_s = 0.65, k_e = 50)
Red Sphere Radius 1 Unit
Red Sphere Position (0.1, 1, 4.5)
Red Sphere Illumination Model Phong (k_a = 0.9, k_d = 0.3, k_s = 0.65, k_e = 50)
Floor Size 10x70
Floor Position (TL, TR, BL, BR) (-3, -1.5, -60), (7, -1.5, -60), (-3, -1.5, 10), (7, -1.5, 10)
Floor Illumination Model Phong (k_a = 0.9, k_d = 0.3, k_s = 0.65, k_e = 50)
Image WidthxHeight (pixels) 512x368
Focal Length 0.5 Units
Film Plane WidthxHeight (Units) 1.33x1.0


PHONG (with SUPERSAMPLING) Screenshot:


Coordinate System Used RHS
Camera Location (0, 1, 7) looking at origin with (0, 1, 0) as up vector
Blue Sphere Radius 1.3 Units
Blue Sphere Position (2.3, -0.3, 2.2)
Blue Sphere Illumination Model Phong (k_a = 0.9, k_d = 0.3, k_s = 0.65, k_e = 50)
Red Sphere Radius 1 Unit
Red Sphere Position (0.1, 1, 4.5)
Red Sphere Illumination Model Phong (k_a = 0.9, k_d = 0.3, k_s = 0.65, k_e = 50)
Floor Size 10x70
Floor Position (TL, TR, BL, BR) (-3, -1.5, -60), (7, -1.5, -60), (-3, -1.5, 10), (7, -1.5, 10)
Floor Illumination Model Phong (k_a = 0.9, k_d = 0.3, k_s = 0.65, k_e = 50)
Image WidthxHeight (pixels) 512x368
Focal Length 0.5 Units
Film Plane WidthxHeight (Units) 1.33x1.0

Selected differences between phong with/without supersampling

Corner of red sphere no supersampling

Corner of red sphere with supersampling

Floor and shadow no supersampling

Floor and shadow with supersampling

Blue sphere no supersampling

Blue sphere with supersampling

Hi-Res (1024x736) full pic no supersampling

Hi-Res (1024x736) full pic with supersampling



PHONG-BLINN (with SUPERSAMPLING) Screenshot:


Coordinate System Used RHS
Camera Location (0, 1, 7) looking at origin with (0, 1, 0) as up vector
Blue Sphere Radius 1.3 Units
Blue Sphere Position (2.3, -0.3, 2.2)
Blue Sphere Illumination Model Phong-Blinn (k_a = 0.9, k_d = 0.3, k_s = 0.65, k_e = 50)
Red Sphere Radius 1 Unit
Red Sphere Position (0.1, 1, 4.5)
Red Sphere Illumination Model Phong-Blinn (k_a = 0.9, k_d = 0.3, k_s = 0.65, k_e = 50)
Floor Size 10x70
Floor Position (TL, TR, BL, BR) (-3, -1.5, -60), (7, -1.5, -60), (-3, -1.5, 10), (7, -1.5, 10)
Floor Illumination Model Phong (k_a = 0.9, k_d = 0.3, k_s = 0.65, k_e = 50)
Image WidthxHeight (pixels) 512x368
Focal Length 0.5 Units
Film Plane WidthxHeight (Units) 1.33x1.0


ASHIKHMIN-SHIRLEY (no mods) (with SUPERSAMPLING) Screenshot 1:


Coordinate System Used RHS
Camera Location (0, 1, 7) looking at origin with (0, 1, 0) as up vector
Blue Sphere Radius 1.3 Units
Blue Sphere Position (2.3, -0.3, 2.2)
Blue Sphere Illumination Model Ashikhmin-Shirley (n_u = 10, n_v = 1000, r_s = 0.1, r_d = 0.9)
Red Sphere Radius 1 Unit
Red Sphere Position (0.1, 1, 4.5)
Red Sphere Illumination Model Ashikhmin-Shirley (n_u = 10, n_v = 1000, r_s = 0.1, r_d = 0.9)
Floor Size 10x70
Floor Position (TL, TR, BL, BR) (-3, -1.5, -60), (7, -1.5, -60), (-3, -1.5, 10), (7, -1.5, 10)
Floor Illumination Model Phong (k_a = 0.9, k_d = 0.3, k_s = 0.65, k_e = 50)
Image WidthxHeight (pixels) 512x368
Focal Length 0.5 Units
Film Plane WidthxHeight (Units) 1.33x1.0


The following mods were used to create a brighter image:

Added Background Radiance

When calculating the final Radiance, I also added 0.2 * object_color * background_radiance for each of the RGB bands


Modified Diffuse Calculation + BG Radiance

The regular diffuse calculation has a factor of (1 - R_s). When R_s is high enough, this can vastly reduce the diffuse component. To counter this, I have changed it to (1 - 0.5 * R_s), resulting in a brighter image even for high values of R_s.




ASHIKHMIN-SHIRLEY (with mods) (with SUPERSAMPLING) Screenshot 2:


Coordinate System Used RHS
Camera Location (0, 1, 7) looking at origin with (0, 1, 0) as up vector
Blue Sphere Radius 1.3 Units
Blue Sphere Position (2.3, -0.3, 2.2)
Blue Sphere Illumination Model Ashikhmin-Shirley (n_u = 1000, n_v = 10, r_s = 0.1, r_d = 0.9)
Red Sphere Radius 1 Unit
Red Sphere Position (0.1, 1, 4.5)
Red Sphere Illumination Model Ashikhmin-Shirley (n_u = 1000, n_v = 10, r_s = 0.1, r_d = 0.9)
Floor Size 10x70
Floor Position (TL, TR, BL, BR) (-3, -1.5, -60), (7, -1.5, -60), (-3, -1.5, 10), (7, -1.5, 10)
Floor Illumination Model Phong (k_a = 0.9, k_d = 0.3, k_s = 0.65, k_e = 50)
Image WidthxHeight (pixels) 512x368
Focal Length 0.5 Units
Film Plane WidthxHeight (Units) 1.33x1.0


ASHIKHMIN-SHIRLEY (with mods) (with SUPERSAMPLING) Screenshot 3:


Coordinate System Used RHS
Camera Location (0, 1, 7) looking at origin with (0, 1, 0) as up vector
Blue Sphere Radius 1.3 Units
Blue Sphere Position (2.3, -0.3, 2.2)
Blue Sphere Illumination Model Ashikhmin-Shirley (n_u = 100, n_v = 100, r_s = 0.1, r_d = 0.9)
Red Sphere Radius 1 Unit
Red Sphere Position (0.1, 1, 4.5)
Red Sphere Illumination Model Ashikhmin-Shirley (n_u = 100, n_v = 100, r_s = 0.1, r_d = 0.9)
Floor Size 10x70
Floor Position (TL, TR, BL, BR) (-3, -1.5, -60), (7, -1.5, -60), (-3, -1.5, 10), (7, -1.5, 10)
Floor Illumination Model Phong (k_a = 0.9, k_d = 0.3, k_s = 0.65, k_e = 50)
Image WidthxHeight (pixels) 512x368
Focal Length 0.5 Units
Film Plane WidthxHeight (Units) 1.33x1.0