Kayıtlar

Mart, 2018 tarihine ait yayınlar gösteriliyor

Homework 2 - Part 3: Refraction

Resim
In the last part of the second assignment, we are expected to introduce Refraction for the objects which have transparent material(dielectric). A transparent material refracts and reflects the light according to refractive index of two mediums and angle of the light. In my implementation, I followed the calculations which were shared at the lecture. They can also be found in "Fundamentals of Computer Graphics 3rd Edition" (Shirley, and Marschner, 2009). When a reflection happened, I increased current recursive step. Also, I didn't let any reflection happen, if max recursive depth is reached. On the other hand, I didn't change current recursive step for the transmitted ray, since it is just refracted version of the incoming ray. -  cornelbox_glass.xml (100 samples for each pixel) [bilaly@Kalimdor | 23:34:59 | HW2]$ ./raytracer ../scenes/cornellbox_glass.xml  Scene is parsed Starting rendering on #8 thread(s) cornellbox_glass.png(800x800) is saved in:  1...

Homework 2 - Part 2: Multisampling

Resim
In the second part of the second assignment, we are expected to introduce Multisampling technique to the ray tracer. Multisampling is basically increasing sampling rate for the each pixel for more accurate images. There are two steps to achieve this. The first part is randomly determining sample points. When sample number is n^2, I divided each dimension of pixel to n equal parts, to get n^2 sub-pixels. For samples, I determined one random point which is inside of the related sub-pixel, for each sub-pixel. After computing color of the each sample, the first part is complete. In the second part, we need to filter those samples. I used 2D Gaussian Function with sigma=1/3 and mean = 0. By choosing sigma like this, each sample point also contributed to the nearest neighbors. It caused more accurate contributions of each sample. While doing so, I converted my pixels to a monitor pixel class to avoid race conditions. After all the calculations are done, I divided total weighted color va...

Homework 2 - Part 1: Bounding Volume Hierarchy

Resim
In the first part of the second assignment, we are expected to introduce Bounding Volume Hierarchy as an acceleration structure. Bounding Volume Hierarchy lets us traverse scene objects in logarithmic time on average.  In my  implementation, scene has a BVH for the all meshes, primitive triangles, and spheres according to their axis aligned bounding boxes. Also all meshes have each their BVH according to all the triangles that form the mesh. For generating BVH, I split bounding box from the middle of the current dimension. I alternate the dimension in the order x->y->z for each level. Scene consists of: - 1 Mesh(4978 Triangles) Before BVH: rendering on #8 thread(s) bunny.png(512x512) is saved in: 6 seconds 717 milliseconds 342 microseconds After BVH: rendering on #8 thread(s) bunny.png(512x512) is saved in: 42 milliseconds 690 microseconds Scene consists of: - 2 Spheres - 5 Meshes, each one has 2 Triangles Before BVH: rendering...

Homework 1: First blood

Resim
In this assignment, we are expected to implement a basic ray tracer. The ray tracer is supposed to satisfy some properties, such as: Parsing scene files which are XML format Being able to render images of different cameras of the scene Intersecting with spheres, triangles, and meshes. Finding the nearest intersected object for the related pixel. Deciding if the point is in shadow Computing ambient, diffuse, specular shadings of the contact point   If the surface has mirror reflectance, being able to compute reflected color in a recursive way For this assignment (and probably for the next ones), I choose to use C++14 as the programming language, since it is fast and have strong Object-Oriented Programming features. I used some external libraries for irrelevant tasks, such as: lodepng  - a  PNG encoder and decoder in C and C++.  tinyxml2  - TinyXML-2 is a simple, small, efficient, C++ XML parser that can be easily integrated into other progra...

Hello World

Hello World