{"id":4955,"date":"2019-05-06T00:21:53","date_gmt":"2019-05-05T16:21:53","guid":{"rendered":"https:\/\/unitycoder.com\/blog\/?p=4955"},"modified":"2020-12-04T17:49:45","modified_gmt":"2020-12-04T15:49:45","slug":"ray-marching","status":"publish","type":"post","link":"https:\/\/unitycoder.com\/blog\/2019\/05\/06\/ray-marching\/","title":{"rendered":"Ray Marching"},"content":{"rendered":"\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"272\" data-attachment-id=\"4956\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2019\/05\/06\/ray-marching\/raymarching-min\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/05\/raymarching-min.gif?fit=600%2C272&amp;ssl=1\" data-orig-size=\"600,272\" data-comments-opened=\"1\" 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=\"raymarching-min\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/05\/raymarching-min.gif?fit=600%2C272&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/05\/raymarching-min.gif?resize=600%2C272&#038;ssl=1\" alt=\"\" class=\"wp-image-4956\"\/><figcaption>rays doing marching<\/figcaption><\/figure>\n\n\n\n<p>Tested ray marching in Unity after watching <a rel=\"noreferrer noopener\" aria-label=\"this episode (opens in a new tab)\" href=\"https:\/\/youtu.be\/-6iIc6-Y-kk?t=10828\" target=\"_blank\">this episode<\/a> of The Coding Train. <\/p>\n\n\n\n<p><strong>Source code:<\/strong><br><a rel=\"noreferrer noopener\" aria-label=\"https:\/\/gist.github.com\/unitycoder\/7120e492deba748dba3d4e1e424d3c2a (opens in a new tab)\" href=\"https:\/\/gist.github.com\/unitycoder\/7120e492deba748dba3d4e1e424d3c2a\" target=\"_blank\">https:\/\/gist.github.com\/unitycoder\/7120e492deba748dba3d4e1e424d3c2a<\/a><\/p>\n\n\n\n<p><strong>Usage:<br><\/strong>Set camera to 0,0,-10<br>Projection: Orthographic<br>Then Place spheres under empty gameobject, with sphere z values at 0<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"377\" height=\"365\" data-attachment-id=\"4957\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2019\/05\/06\/ray-marching\/image-9\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/05\/image.png?fit=377%2C365&amp;ssl=1\" data-orig-size=\"377,365\" data-comments-opened=\"1\" 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=\"image\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/05\/image.png?fit=377%2C365&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/05\/image.png?resize=377%2C365&#038;ssl=1\" alt=\"\" class=\"wp-image-4957\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/05\/image.png?w=377&amp;ssl=1 377w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/05\/image.png?resize=300%2C290&amp;ssl=1 300w\" sizes=\"auto, (max-width: 377px) 100vw, 377px\" \/><figcaption>My hierarchy setup<br><\/figcaption><\/figure>\n\n\n\n<p><br><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tested ray marching in Unity after watching this episode of The Coding Train. Source code:https:\/\/gist.github.com\/unitycoder\/7120e492deba748dba3d4e1e424d3c2a Usage:Set camera to 0,0,-10Projection: OrthographicThen Place spheres under empty gameobject, with sphere z values at 0<\/p>\n","protected":false},"author":1,"featured_media":4956,"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_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[804,420,3],"tags":[1087,1085,1086],"class_list":["post-4955","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripts","category-tutorials","category-unity3d","tag-distance-function","tag-ray-marching","tag-sphere-tracing"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/05\/raymarching-min.gif?fit=600%2C272&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p1KTaT-1hV","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/4955","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/comments?post=4955"}],"version-history":[{"count":3,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/4955\/revisions"}],"predecessor-version":[{"id":5305,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/4955\/revisions\/5305"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media\/4956"}],"wp:attachment":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media?parent=4955"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/categories?post=4955"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/tags?post=4955"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}