Kayıtlar

Homework 6 - All about BRDF

Resim
In the sixth assignment of CENG795, we are expected to introduce BRDFs for lighning computations, such as: Phong BRDF Modified Phong BRDF Normalized Modified Phong BRDF Blinn-Phong BRDF Modified Blinn-Phong BRDF Normalized Modified Blinn-Phong BRDF  Torrance-Sparrow BRDF  A few notes about my outputs: In killeroo scenes, my outputs are slightly different. I think that, main reason of this result is differences of smooth shading. Probably my way of calculating vertex normals is slightly different.  While my png outputs for tonemapped scenes are similar to the reference outputs, my exr outputs are not same for same exposures. I used OpenCV for image writing, since it handles all file types with one image writing function. I will try to use tinyexr when I'm available. My outputs: brdf_phong_original brdf_phong_modified brdf_phong_modified_normalized brdf_blinnphong_original brdf_blinnphong_modified brdf_blinnphong_modified_...

Homework 5 - Additional Light Sources, Tonemapping, HDR Output

Resim
In the fifth assignment of CENG795, we are expected to introduce many new features to the ray tracer, such as: Directional Light Sources Spot Light Sources Photographic Tonemapping HDR Output In this assignment, I removed lodepng library and added OpenCV library to be able to generate both png and exr outputs. Directional and Spot Light Sources To introduce new light sources, I implemented an virtual base named "Light" for all the light sources. After converting old light types(which are point and area), I implemented Directional and Spot Light sources. My outputs are: cube_directional.png(800x800) is saved in: 72 milliseconds 499 microseconds dragon_spot_light_msaa.png(800x800) is saved in: 20 seconds 363 milliseconds 401 microseconds   Photographic Tonemapping For photographic tonemapping, I followed Reinhard's Photographic Reproduction Technique ( http://www.cmap.polytechnique.fr/~peyre/cours/x2005signal/hdr_photographic.pdf ). Note that...

Homework 4 - All About Textures (Textures, Perlin Texture, Bump Mapping)

Resim
In the fourth assignment of CENG795, we are expected to introduce many new features to the ray tracer, such as: Textures: Interpolation Types: nearest, bilinear Decal Modes: Replacing Color, Replacing Diffuse Constant, Blending Diffuse Constant Appearance: Repeat, and Clamp  Perlin Texture: Appearance: Vein and Patch  Bump Mapping for both Textures and Perlin Textures. For reading texture data I used stb_image.h( https://github.com/nothings/stb ). To create perlin noise, and to calculate bump normals, I used the techniques that were mentioned in the lectures.  I couldn't get similar results with given bumpmapMultiplier values for normal textures(not perlin ones), I slightly changed the values for achieving similar results.  My results: bump_mapping_basic.png bump_mapping_transformed.png (bumpmapMultiplier ->75.0) ellipsoids_texture.png galactica_dynamic.png galactica_static.png killeroo_bump_walls.png (bump...

Homework 3 - Transformations, Instancing, Distribution Ray Tracing

Resim
In the third assignment of CENG795, we are expected to introduce many new features to the ray tracer, such as:  Transformations  Instancing  Smooth shading  Distribution Ray Tracing Depth of field Soft shadows (area lights) Glossy reflections Motion blur Simple Camera(Constructed with fov, distance, and aspect ratio) PLY parsing Transformations and Instancing: First I implemented basic transformation classes and matrix operations. If a mesh instance, a sphere, or a primitive triangle has some transformations, I apply them to their bounding boxes for keeping the order of the bvh. For instancing, I separated mesh triangles and primitive triangles.  Primitive triangles and spheres convert the ray into their local space to check if it intersects.  Mesh instances converts the ray into local space of the their meshes to check if it intersects. Meshes and mesh triangles doesn't apply any transformation, they expect rays from their space. I...

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...