{"id":1963,"date":"2015-01-26T21:15:00","date_gmt":"2015-01-26T21:15:00","guid":{"rendered":"http:\/\/www.spellcasterstudios.com\/?p=1963"},"modified":"2015-01-22T19:23:44","modified_gmt":"2015-01-22T19:23:44","slug":"so-ashamed","status":"publish","type":"post","link":"https:\/\/www.spellcasterstudios.com\/?p=1963","title":{"rendered":"So ashamed&hellip;"},"content":{"rendered":"<p>Finally figured out what was the problem with my reconstruction of the position from the FOV and depth\u2026<\/p>\n<p>NOTHING! ABSOLUTELY NOTHING!<\/p>\n<p>The problem was way before that\u2026 For some reason (and I never noticed it for years on end), I was using the field of view parameter as the VERTICAL field of view, scaled by half (for some another really unknown reason), but everything I made with shaders that required the field of view assumed I was using the fov property as the HORIZONTAL FOV\u2026 The scaling factor I had only screwed up everything\u2026 <\/p>\n<p>So I was looking at at a scene with a FOV property set to 80\u00ba\u2026 But since I was diving that scale by 2 (yielding 40\u00ba), and then computing the horizontal FOV from it by dividing by the aspect ratio (yielding 71\u00ba), the visual result was close enough for me never to suspect a thing\u2026 <\/p>\n<p>Except when I\u2019m actually using the fov in another calculation on a shader and nothing seems right\u2026<\/p>\n<p>What helped this revelation was the fact that I decided to change the way I was seeing the error on screen\u2026 Instead of using colors, I decided to compute the world position and compare that with the depth I had on the depth buffer\u2026<\/p>\n<p>The two images below show the \u201cnormal\u201d result (the one rendered correctly), and the one that the SSAO would compute half-way through the process:<\/p>\n<p><a href=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2015\/01\/screen396.jpg\" class=\"thickbox\"><img loading=\"lazy\" decoding=\"async\" title=\"screen396\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"screen396\" src=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2015\/01\/screen396_thumb.jpg\" width=\"830\" height=\"482\" \/><\/a><\/p>\n<p><a href=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2015\/01\/screen397.jpg\" class=\"thickbox\"><img loading=\"lazy\" decoding=\"async\" title=\"screen397\" style=\"border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px\" border=\"0\" alt=\"screen397\" src=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2015\/01\/screen397_thumb.jpg\" width=\"830\" height=\"482\" \/><\/a><\/p>\n<p>When I saw this, I figured the problem would have to have something to do with the FOV, the images were too close to be a normal math or reasoning error\u2026<\/p>\n<p>After a lot more debugging, finally figured it out! <\/p>\n<p>Now, tomorrow I\u2019ll be able to see the SSAO in action properly!<\/p>\n<p><em>Now listening to \u201cGhost Opera\u201d by \u201cKamelot\u201d<\/em><\/p>\n<p><em>Link of the Day: I know this is a hype video, and we\u2019re really far from this, no matter what Microsoft marketers says\u2026 But it looks soooooo cool! I can imagine my \u201cSkylander\u2019s-like\u201d game here\u2026 <img decoding=\"async\" class=\"wlEmoticon wlEmoticon-smile\" style=\"border-top-style: none; border-bottom-style: none; border-right-style: none; border-left-style: none\" alt=\"Smile\" src=\"http:\/\/www.spellcasterstudios.com\/wp-content\/uploads\/2015\/01\/wlEmoticon-smile5.png\" \/><\/em><\/p>\n<div id=\"scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:32fba199-7080-492c-af00-4baa3176cbb8\" class=\"wlWriterEditableSmartContent\" style=\"float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px\">\n<div><object width=\"448\" height=\"252\"><param name=\"movie\" value=\"http:\/\/www.youtube.com\/v\/aThCr0PsyuA?hl=en&amp;hd=1\"><\/param><embed src=\"http:\/\/www.youtube.com\/v\/aThCr0PsyuA?hl=en&amp;hd=1\" type=\"application\/x-shockwave-flash\" width=\"448\" height=\"252\"><\/embed><\/object><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Finally figured out what was the problem with my reconstruction of the position from the FOV and depth\u2026 NOTHING! ABSOLUTELY NOTHING! The problem was way before that\u2026 For some reason (and I never noticed it for years on end), I was using the field of view parameter as the VERTICAL field of view, scaled by [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,147,8],"tags":[184],"class_list":["post-1963","post","type-post","status-publish","format-standard","hentry","category-development","category-chrome-hunter","category-technology","tag-bugs"],"_links":{"self":[{"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=\/wp\/v2\/posts\/1963","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1963"}],"version-history":[{"count":1,"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=\/wp\/v2\/posts\/1963\/revisions"}],"predecessor-version":[{"id":1964,"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=\/wp\/v2\/posts\/1963\/revisions\/1964"}],"wp:attachment":[{"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1963"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1963"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.spellcasterstudios.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1963"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}