{"id":1,"date":"2018-03-09T07:42:41","date_gmt":"2018-03-09T04:42:41","guid":{"rendered":"http:\/\/kadircenk.com\/?p=1"},"modified":"2022-03-15T00:32:04","modified_gmt":"2022-03-14T21:32:04","slug":"trace-the-ray-part-1","status":"publish","type":"post","link":"https:\/\/kadircenk.com\/blog\/trace-the-ray-part-1\/","title":{"rendered":"Trace the Ray &#8211; Part 1 (Core Ray Tracer)"},"content":{"rendered":"<p>Hello!<\/p>\n<p>In this series of blog posts, I will be providing detailed information on my adventures on coding a ray tracer in C++. In this first post, I will give a brief information about my coding environment and the implementation details of my core ray tracer.<\/p>\n<p><!--more--><\/p>\n<p>I am using a laptop which has an\u00a0Intel\u00ae Core\u2122 i7-4700HQ CPU @ 2.40GHz \u00d7 8 CPU and running Ubuntu 16.04 to render the scenes.<\/p>\n<p>Sample scene files are provided below:<\/p>\n<ul>\n<li><a href=\"http:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2022\/03\/hw1_dragon_lowres.zip\" target=\"_blank\" rel=\"noopener\">Dragon<\/a><\/li>\n<li><a href=\"http:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2022\/03\/hw1_horse_and_mug.zip\" target=\"_blank\" rel=\"noopener\">Horse and Mug<\/a><\/li>\n<li><a href=\"http:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2022\/03\/hw1_metuScienceTree.zip\" target=\"_blank\" rel=\"noopener\">METU Science Tree<\/a>\u00a0&#8211; <a href=\"http:\/\/www.binarytorgb.com\/\" target=\"_blank\" rel=\"noopener\">Credits to Emre Baris Coskun<\/a><\/li>\n<\/ul>\n<h3>Implementation Details<\/h3>\n<p>The first task before tracing rays is to read the input, obviously. My previous implementation of the ray tracer was using a very basic text file format to get the scene information.<\/p>\n<p>As we will use the .xml format to explain the scenes, I wrote some code to pipe the information read by the .xml scene file parser (<a href=\"http:\/\/www.grinninglizard.com\/tinyxml\/\" target=\"_blank\" rel=\"noopener\">tinyxml<\/a> library) to the primitive parser that my ray tracer already had. By doing so, my ray tracer was now ready to get the scene information from the .xml file type.<\/p>\n<p>To speed up the rendering progress, I have implemented a basic multi-threading capability, which uses 4 threads on 4 distinct scanlines of the image, to get a -nearly- x4 speed-up on the rendering time.<\/p>\n<p>The disadvantage of this method is that even if it speeds up the scenes where the objects are not clustered to one location of the 2D image plane, when they get clustered, for example, to the<strong>\u00a0<\/strong>space of the upper scanline (thread 1&#8217;s space), the performance drops as if the rendering is being done on a\u00a0 1-core CPU, as the others threads quickly finish their task and die.<\/p>\n<p>My future goal is to implement a multi-threading capability in which:<\/p>\n<ul>\n<li>The thread count will not be a fix number. It will be configurable.<\/li>\n<li>When a thread finishes its task, it will select another small 2D location from the output image plane and continue rendering until all small 2D locations are rendered (so the output image is rendered.)<\/li>\n<\/ul>\n<p>The output file, which is a .png file, is filled in with the help of a small-sized, but a giant problem-solver C library called <a href=\"http:\/\/lodev.org\/lodepng\/\" target=\"_blank\" rel=\"noopener\">lodepng<\/a>. I have used its C++ wrapper class to quickly pour the RGB data of the rendered output image into the .png file stated in the scene file.<\/p>\n<h3>Performance Results<\/h3>\n<p>Below are some sample output images that are rendered by the current version of my ray tracer, and their rendering times (calculated by the <strong>time<\/strong> utility):<\/p>\n<p><a href=\"http:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/bunny9_709sn.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"71\" data-permalink=\"https:\/\/kadircenk.com\/blog\/trace-the-ray-part-1\/bunny9_709sn\/\" data-orig-file=\"https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/bunny9_709sn.png\" data-orig-size=\"512,512\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"bunny9_709sn\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/bunny9_709sn.png\" class=\"aligncenter wp-image-71 size-full\" src=\"http:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/bunny9_709sn.png\" alt=\"\" width=\"512\" height=\"512\" srcset=\"https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/bunny9_709sn.png 512w, https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/bunny9_709sn-150x150.png 150w, https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/bunny9_709sn-300x300.png 300w, https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/bunny9_709sn-100x100.png 100w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" \/><\/a><\/p>\n<pre>bunny.xml\n(512x512)\n9.706 seconds (\/w 4 threads)<\/pre>\n<p><a href=\"http:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/cornellbox0_194s.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"79\" data-permalink=\"https:\/\/kadircenk.com\/blog\/trace-the-ray-part-1\/cornellbox0_194s\/\" data-orig-file=\"https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/cornellbox0_194s.png\" data-orig-size=\"800,800\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"cornellbox0_194s\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/cornellbox0_194s.png\" class=\"aligncenter wp-image-79 size-full\" src=\"http:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/cornellbox0_194s.png\" alt=\"\" width=\"800\" height=\"800\" srcset=\"https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/cornellbox0_194s.png 800w, https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/cornellbox0_194s-150x150.png 150w, https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/cornellbox0_194s-300x300.png 300w, https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/cornellbox0_194s-768x768.png 768w, https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/cornellbox0_194s-100x100.png 100w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<pre>cornellbox.xml\n(800x800)\n0.194 seconds (\/w 4 threads)<\/pre>\n<p><a href=\"http:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/scienceTree_1080x1080_38_150secs.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"82\" data-permalink=\"https:\/\/kadircenk.com\/blog\/trace-the-ray-part-1\/sciencetree_1080x1080_38_150secs\/\" data-orig-file=\"https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/scienceTree_1080x1080_38_150secs.png\" data-orig-size=\"1080,1080\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"scienceTree_1080x1080_38_150secs\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/scienceTree_1080x1080_38_150secs-1024x1024.png\" class=\"aligncenter wp-image-82 size-large\" src=\"http:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/scienceTree_1080x1080_38_150secs-1024x1024.png\" alt=\"\" width=\"525\" height=\"525\" srcset=\"https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/scienceTree_1080x1080_38_150secs-1024x1024.png 1024w, https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/scienceTree_1080x1080_38_150secs-150x150.png 150w, https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/scienceTree_1080x1080_38_150secs-300x300.png 300w, https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/scienceTree_1080x1080_38_150secs-768x768.png 768w, https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/scienceTree_1080x1080_38_150secs-100x100.png 100w, https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/scienceTree_1080x1080_38_150secs.png 1080w\" sizes=\"auto, (max-width: 525px) 100vw, 525px\" \/><\/a><\/p>\n<pre>scienceTree.xml\n(1080x1080)\n38.150 seconds (\/w 4 threads)<\/pre>\n<p><a href=\"http:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/simple_reflectance800_800_0_139secs.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"84\" data-permalink=\"https:\/\/kadircenk.com\/blog\/trace-the-ray-part-1\/simple_reflectance800_800_0_139secs\/\" data-orig-file=\"https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/simple_reflectance800_800_0_139secs.png\" data-orig-size=\"800,800\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"simple_reflectance800_800_0_139secs\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/simple_reflectance800_800_0_139secs.png\" class=\"aligncenter wp-image-84 size-full\" src=\"http:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/simple_reflectance800_800_0_139secs.png\" alt=\"\" width=\"800\" height=\"800\" srcset=\"https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/simple_reflectance800_800_0_139secs.png 800w, https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/simple_reflectance800_800_0_139secs-150x150.png 150w, https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/simple_reflectance800_800_0_139secs-300x300.png 300w, https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/simple_reflectance800_800_0_139secs-768x768.png 768w, https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/simple_reflectance800_800_0_139secs-100x100.png 100w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<pre>simple_reflectance.xml\n(800x800)\n0.139 seconds (\/w 4 threads)<\/pre>\n<p><a href=\"http:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/mirror_spheres1024_1024_0_301secs.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"85\" data-permalink=\"https:\/\/kadircenk.com\/blog\/trace-the-ray-part-1\/mirror_spheres1024_1024_0_301secs\/\" data-orig-file=\"https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/mirror_spheres1024_1024_0_301secs.png\" data-orig-size=\"1024,1024\" data-comments-opened=\"0\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"mirror_spheres1024_1024_0_301secs\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/mirror_spheres1024_1024_0_301secs.png\" class=\"aligncenter wp-image-85 size-full\" src=\"http:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/mirror_spheres1024_1024_0_301secs.png\" alt=\"\" width=\"1024\" height=\"1024\" srcset=\"https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/mirror_spheres1024_1024_0_301secs.png 1024w, https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/mirror_spheres1024_1024_0_301secs-150x150.png 150w, https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/mirror_spheres1024_1024_0_301secs-300x300.png 300w, https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/mirror_spheres1024_1024_0_301secs-768x768.png 768w, https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/mirror_spheres1024_1024_0_301secs-100x100.png 100w\" sizes=\"auto, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 543px, 580px\" \/><\/a><\/p>\n<pre>mirror_spheres.xml\n(1024x1024)\n0.301 seconds (\/w 4 threads)<\/pre>\n<p>See you in the next posts!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello! In this series of blog posts, I will be providing detailed information on my adventures on coding a ray tracer in C++. In this first post, I will give a brief information about my coding environment and the implementation details of my core ray tracer.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[4],"tags":[],"class_list":["post-1","post","type-post","status-publish","format-standard","hentry","category-ray-tracing"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Trace the Ray - Part 1 (Core Ray Tracer) - kadircenk<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kadircenk.com\/blog\/trace-the-ray-part-1\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Trace the Ray - Part 1 (Core Ray Tracer) - kadircenk\" \/>\n<meta property=\"og:description\" content=\"Hello! In this series of blog posts, I will be providing detailed information on my adventures on coding a ray tracer in C++. In this first post, I will give a brief information about my coding environment and the implementation details of my core ray tracer.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kadircenk.com\/blog\/trace-the-ray-part-1\/\" \/>\n<meta property=\"og:site_name\" content=\"kadircenk\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/kadircenk3\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/kadircenk3\" \/>\n<meta property=\"article:published_time\" content=\"2018-03-09T04:42:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-03-14T21:32:04+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/bunny9_709sn.png\" \/>\n<meta name=\"author\" content=\"kadircenk\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/kadircenkalpay\" \/>\n<meta name=\"twitter:site\" content=\"@kadircenkalpay\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"kadircenk\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/kadircenk.com\\\/blog\\\/trace-the-ray-part-1\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/kadircenk.com\\\/blog\\\/trace-the-ray-part-1\\\/\"},\"author\":{\"name\":\"kadircenk\",\"@id\":\"https:\\\/\\\/kadircenk.com\\\/blog\\\/#\\\/schema\\\/person\\\/8d9546d987c40be9d6ff61c6512b3a25\"},\"headline\":\"Trace the Ray &#8211; Part 1 (Core Ray Tracer)\",\"datePublished\":\"2018-03-09T04:42:41+00:00\",\"dateModified\":\"2022-03-14T21:32:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/kadircenk.com\\\/blog\\\/trace-the-ray-part-1\\\/\"},\"wordCount\":431,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/kadircenk.com\\\/blog\\\/#\\\/schema\\\/person\\\/8d9546d987c40be9d6ff61c6512b3a25\"},\"image\":{\"@id\":\"https:\\\/\\\/kadircenk.com\\\/blog\\\/trace-the-ray-part-1\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/kadircenk.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/03\\\/bunny9_709sn.png\",\"articleSection\":[\"Ray Tracing\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/kadircenk.com\\\/blog\\\/trace-the-ray-part-1\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/kadircenk.com\\\/blog\\\/trace-the-ray-part-1\\\/\",\"url\":\"https:\\\/\\\/kadircenk.com\\\/blog\\\/trace-the-ray-part-1\\\/\",\"name\":\"Trace the Ray - Part 1 (Core Ray Tracer) - kadircenk\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/kadircenk.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/kadircenk.com\\\/blog\\\/trace-the-ray-part-1\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/kadircenk.com\\\/blog\\\/trace-the-ray-part-1\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/kadircenk.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/03\\\/bunny9_709sn.png\",\"datePublished\":\"2018-03-09T04:42:41+00:00\",\"dateModified\":\"2022-03-14T21:32:04+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/kadircenk.com\\\/blog\\\/trace-the-ray-part-1\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/kadircenk.com\\\/blog\\\/trace-the-ray-part-1\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/kadircenk.com\\\/blog\\\/trace-the-ray-part-1\\\/#primaryimage\",\"url\":\"https:\\\/\\\/kadircenk.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/03\\\/bunny9_709sn.png\",\"contentUrl\":\"https:\\\/\\\/kadircenk.com\\\/blog\\\/wp-content\\\/uploads\\\/2018\\\/03\\\/bunny9_709sn.png\",\"width\":512,\"height\":512},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/kadircenk.com\\\/blog\\\/trace-the-ray-part-1\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/kadircenk.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Trace the Ray &#8211; Part 1 (Core Ray Tracer)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/kadircenk.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/kadircenk.com\\\/blog\\\/\",\"name\":\"kadircenk.com\",\"description\":\"Blog\",\"publisher\":{\"@id\":\"https:\\\/\\\/kadircenk.com\\\/blog\\\/#\\\/schema\\\/person\\\/8d9546d987c40be9d6ff61c6512b3a25\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/kadircenk.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/kadircenk.com\\\/blog\\\/#\\\/schema\\\/person\\\/8d9546d987c40be9d6ff61c6512b3a25\",\"name\":\"kadircenk\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/kadircenk.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/ss.png\",\"url\":\"https:\\\/\\\/kadircenk.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/ss.png\",\"contentUrl\":\"https:\\\/\\\/kadircenk.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/ss.png\",\"width\":696,\"height\":696,\"caption\":\"kadircenk\"},\"logo\":{\"@id\":\"https:\\\/\\\/kadircenk.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/02\\\/ss.png\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/kadircenk3\",\"https:\\\/\\\/www.instagram.com\\\/kadircenkalpay\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/kadir-cenk-alpay\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/kadircenkalpay\",\"https:\\\/\\\/www.youtube.com\\\/kadircenkalpay\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Trace the Ray - Part 1 (Core Ray Tracer) - kadircenk","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/kadircenk.com\/blog\/trace-the-ray-part-1\/","og_locale":"en_US","og_type":"article","og_title":"Trace the Ray - Part 1 (Core Ray Tracer) - kadircenk","og_description":"Hello! In this series of blog posts, I will be providing detailed information on my adventures on coding a ray tracer in C++. In this first post, I will give a brief information about my coding environment and the implementation details of my core ray tracer.","og_url":"https:\/\/kadircenk.com\/blog\/trace-the-ray-part-1\/","og_site_name":"kadircenk","article_publisher":"https:\/\/www.facebook.com\/kadircenk3","article_author":"https:\/\/www.facebook.com\/kadircenk3","article_published_time":"2018-03-09T04:42:41+00:00","article_modified_time":"2022-03-14T21:32:04+00:00","og_image":[{"url":"http:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/bunny9_709sn.png","type":"","width":"","height":""}],"author":"kadircenk","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/kadircenkalpay","twitter_site":"@kadircenkalpay","twitter_misc":{"Written by":"kadircenk","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kadircenk.com\/blog\/trace-the-ray-part-1\/#article","isPartOf":{"@id":"https:\/\/kadircenk.com\/blog\/trace-the-ray-part-1\/"},"author":{"name":"kadircenk","@id":"https:\/\/kadircenk.com\/blog\/#\/schema\/person\/8d9546d987c40be9d6ff61c6512b3a25"},"headline":"Trace the Ray &#8211; Part 1 (Core Ray Tracer)","datePublished":"2018-03-09T04:42:41+00:00","dateModified":"2022-03-14T21:32:04+00:00","mainEntityOfPage":{"@id":"https:\/\/kadircenk.com\/blog\/trace-the-ray-part-1\/"},"wordCount":431,"commentCount":2,"publisher":{"@id":"https:\/\/kadircenk.com\/blog\/#\/schema\/person\/8d9546d987c40be9d6ff61c6512b3a25"},"image":{"@id":"https:\/\/kadircenk.com\/blog\/trace-the-ray-part-1\/#primaryimage"},"thumbnailUrl":"http:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/bunny9_709sn.png","articleSection":["Ray Tracing"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/kadircenk.com\/blog\/trace-the-ray-part-1\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/kadircenk.com\/blog\/trace-the-ray-part-1\/","url":"https:\/\/kadircenk.com\/blog\/trace-the-ray-part-1\/","name":"Trace the Ray - Part 1 (Core Ray Tracer) - kadircenk","isPartOf":{"@id":"https:\/\/kadircenk.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/kadircenk.com\/blog\/trace-the-ray-part-1\/#primaryimage"},"image":{"@id":"https:\/\/kadircenk.com\/blog\/trace-the-ray-part-1\/#primaryimage"},"thumbnailUrl":"http:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/bunny9_709sn.png","datePublished":"2018-03-09T04:42:41+00:00","dateModified":"2022-03-14T21:32:04+00:00","breadcrumb":{"@id":"https:\/\/kadircenk.com\/blog\/trace-the-ray-part-1\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kadircenk.com\/blog\/trace-the-ray-part-1\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kadircenk.com\/blog\/trace-the-ray-part-1\/#primaryimage","url":"https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/bunny9_709sn.png","contentUrl":"https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2018\/03\/bunny9_709sn.png","width":512,"height":512},{"@type":"BreadcrumbList","@id":"https:\/\/kadircenk.com\/blog\/trace-the-ray-part-1\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/kadircenk.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Trace the Ray &#8211; Part 1 (Core Ray Tracer)"}]},{"@type":"WebSite","@id":"https:\/\/kadircenk.com\/blog\/#website","url":"https:\/\/kadircenk.com\/blog\/","name":"kadircenk.com","description":"Blog","publisher":{"@id":"https:\/\/kadircenk.com\/blog\/#\/schema\/person\/8d9546d987c40be9d6ff61c6512b3a25"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kadircenk.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/kadircenk.com\/blog\/#\/schema\/person\/8d9546d987c40be9d6ff61c6512b3a25","name":"kadircenk","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2023\/02\/ss.png","url":"https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2023\/02\/ss.png","contentUrl":"https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2023\/02\/ss.png","width":696,"height":696,"caption":"kadircenk"},"logo":{"@id":"https:\/\/kadircenk.com\/blog\/wp-content\/uploads\/2023\/02\/ss.png"},"sameAs":["https:\/\/www.facebook.com\/kadircenk3","https:\/\/www.instagram.com\/kadircenkalpay","https:\/\/www.linkedin.com\/in\/kadir-cenk-alpay","https:\/\/x.com\/https:\/\/twitter.com\/kadircenkalpay","https:\/\/www.youtube.com\/kadircenkalpay"]}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9NbhO-1","jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/kadircenk.com\/blog\/wp-json\/wp\/v2\/posts\/1","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kadircenk.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kadircenk.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kadircenk.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kadircenk.com\/blog\/wp-json\/wp\/v2\/comments?post=1"}],"version-history":[{"count":40,"href":"https:\/\/kadircenk.com\/blog\/wp-json\/wp\/v2\/posts\/1\/revisions"}],"predecessor-version":[{"id":659,"href":"https:\/\/kadircenk.com\/blog\/wp-json\/wp\/v2\/posts\/1\/revisions\/659"}],"wp:attachment":[{"href":"https:\/\/kadircenk.com\/blog\/wp-json\/wp\/v2\/media?parent=1"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kadircenk.com\/blog\/wp-json\/wp\/v2\/categories?post=1"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kadircenk.com\/blog\/wp-json\/wp\/v2\/tags?post=1"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}