23 Nisan 2017 Pazar

Homework 6

External libraries used:
- tinyxml2 (tinyxml2.h, tinyxml2.cpp are provided in the homework files.)
- lodepng (lodepng.h, lodepng.cpp are provided in the homework files.) 
- Eigen (Can be obtained from http://eigen.tuxfamily.org/) 
- jpeglib

Command to compile:
g++ -I /usr/include/eigen3/ -std=c++11 -O3 main.cpp RayTracer.cpp ray.cpp shape.cpp light.cpp tinyxml2.cpp lodepng.cpp BVH.cpp texture.cpp -o RayTracer -ljpeg

Computer specs:
Intel Core i7-2630QM CPU @ 2.00 GHz, 6 GB RAM

Running the ray tracer:
./RayTracer command should be fed by the relative path of the input file, e. g.,
./RayTracer 795_input_set_06/skybox.xml

This week's task was to implement texture mapping. 

File Name: sphere_texture_replace_nearest.xml
Interpolation Method: Nearest
Decal Mode: Replace kd
File Name: sphere_texture_replace_bilinear.xml
Interpolation Method: Bilinear
Decal Mode: Replace kd
File Name: sphere_texture_blend_bilinear.xml
Interpolation Method: Bilinear
Decal Mode: Blend kd
File Name: killeroo_diffuse_specular_texture.xml
Interpolation Method: Bilinear
Decal Mode: Blend kd
Appearance: Repeat

File Name: perlin_types.xml
Comments:
- Perlin noise examples. Smooth textures were generated in patch mode, textures with veins were generated in vein mode.
- There is also a directional light in the scene.
File Name: simple_texture.xml
Comments:
- Texture on the sphere in top-left was generated with nearest interpolation and replace kd modes.
- Texture on the sphere in bottom-left was generated with patch and replace kd modes.
- Texture on the sphere in bottom-right was generated with vein and replace kd modes.
- Textures on the square and the triangle were generated in nearest and replace kd modes.
File Name: skybox.xml
Anti-Aliasing: MSAA with 100 sample per pixel
Render time: 2 minutes 52.054 seconds
- Texture of the sky was generated in bilinear and replace all modes. 
- Texture of the floor was generated in bilinear and replace kd modes with repeated appearance. 



Other Comments and Highlights: 
- elliosoids_texture.xml could not be rendered because of the bug in scaling the spheres (i.e., ellipsoid shape cannot be obtained). 
- All in all, texture mapping seems to be working fine.
- There seems to be bugs related with the tasks of the previous weeks (such as transformations). 



18 Nisan 2017 Salı

Homework 5

External libraries used:
- tinyxml2 (tinyxml2.h, tinyxml2.cpp are provided in the homework files.)
- lodepng (lodepng.h, lodepng.cpp are provided in the homework files.) 
- Eigen (Can be obtained from http://eigen.tuxfamily.org/) 

Command to compile:
g++ -I /usr/include/eigen3/ -std=c++11 -O3 main.cpp RayTracer.cpp Ray.cpp shape.cpp light.cpp tinyxml2.cpp lodepng.cpp BVH.cpp -o RayTracer

Computer specs:
Intel Core i7-2630QM CPU @ 2.00 GHz, 6 GB RAM

Running the ray tracer:
./RayTracer command should be fed by the relative path of the input file, e. g.,
./RayTracer 795_input_set_05/spheres_dof.xml

This week's task was to implement multi sampling anti aliasing (MSAA), spot light, area light, glossy reflection and depth of field.


File Name: dragon_spot_light.xml
Render Time: 16.789 seconds
Comments: No MSAA only spot light.
















File Name: dragon_spot_light_msaa.xml
Number of Samples: 100
Render Time: 27 minutes 21.153 seconds
Comments: MSAA and spot light.

File Name: glass_plates_point.xml
Number of Samples: 36
Render Time: 4 minutes 33.520 seconds
Comments: MSAA and point light.















File Name: glass_plates_area.xml
Number of Samples: 36
Render Time: 3 minutes 45.235 seconds
Comments: MSAA and area light.


File Name: metal_plates_area.xml
Number of Samples: 36
Render Time: 3 minutes 39.345 seconds
Comments: MSAA and area light.
File Name: spheres_dof.xml
Number of Samples: 100
Render Time: 36.618 seconds
Comments: MSAA and point light plus finite aperture size which simulates a realistic camera lens.

11 Nisan 2017 Salı

Homework 4

External libraries used:
- tinyxml2 (tinyxml2.h, tinyxml2.cpp are provided in the homework files.)
- lodepng (lodepng.h, lodepng.cpp are provided in the homework files.) 
- Eigen (Can be obtained from http://eigen.tuxfamily.org/) 

Command to compile:
g++ -I /usr/include/eigen3/ -std=c++11 -O3 main.cpp RayTracer.cpp Vec3d.cpp Ray.cpp shape.cpp tinyxml2.cpp lodepng.cpp BVH.cpp -o RayTracer

Computer specs:
Intel Core i7-2630QM CPU @ 2.00 GHz, 6 GB RAM

Running the ray tracer:
./RayTracer command should be fed by the relative path of the input file, e. g.,
795_input_set_02/horse.xml

This week's task was to implement reflection and refraction, more specifically, implementation of Snell's Law, Schlick's approximation to Fresnel equations and Beer's Law. 


File Name: cornellbox_glass.xml
Render Time: 9.088 seconds

File Name: glass_plates.xml
Render Time: 12.981 seconds
Comments: Although refraction and transmission phenomena looks to be implemented correctly, the image looks as if we are looking at the scene at a slightly different angle than the original output. The problem seems to be related with the camera model implementation.
File Name: horse_and_glass_mug.xml
Render Time: ~1 minute 28 seconds
File Name: killeroo_glass.xml
Render Time: 44.333 seconds
Comments: When I run the .xml file provided as it is, the image looks like we are looking at the scene from just outside of the green wall (was discussed in the class.). To better understand the problem, I took all the box meshes out except the one under the dino (with mesh id's 3, 4, 5, 6, 7), and added the walls one by one.
File Name: killeroo_glass.xml
Render Time: ~45 seconds
Comments: Green wall added (mesh id 3).
File Name: killeroo_glass.xml
Render Time: ~45 seconds
Comments: Blue wall added (mesh id 4).
When the other walls are added, the image is created as if the camera outside the box. The problem seems to be related with triangle intersection routine (Especially when the triangle is at the back of the camera.) but I have not solved it yet. 

File Name: killeroo_half_mirror.xml
Render Time: 30.315 seconds
Comments: As in killeroo_glass.xml, meshes with id's 5, 6, and 7 are excluded.



File Name: killeroo_mirror.xml
Render Time: 28.262 seconds
Comments: As in killeroo_glass.xml, meshes with id's 5, 6, and 7 are excluded.