{"id":488,"date":"2014-09-12T21:50:12","date_gmt":"2014-09-12T21:50:12","guid":{"rendered":"http:\/\/blogs.discovery.wisc.edu\/projects\/?p=488"},"modified":"2014-09-22T21:07:12","modified_gmt":"2014-09-22T21:07:12","slug":"tracking-down-rift-fusion-problems","status":"publish","type":"post","link":"https:\/\/blogs.discovery.wisc.edu\/projects\/2014\/09\/12\/tracking-down-rift-fusion-problems\/","title":{"rendered":"Tracking down Rift fusion problems."},"content":{"rendered":"<p>For a while I was attempting to build visual stimulus in the Rift, but they always seemed off. \u00a0Sense of depth was off, it seemed difficult to fuse the two images at more than one small region at a time, and there were lots of candidates for why:<\/p>\n<ul>\n<li>a miscalculation in the virtual eye position, resulting in the wrong\u00a0binocular disparity<\/li>\n<li>a miscalibration of the physical Rift (the lens depth is deliberately adjustable, and there are multiple choices for lens cups; our\u00a0DK1 also had a bad habit of letting the screen pop out of place up to maybe an inch on the right side)<\/li>\n<li>lack of multisampling causing a lack of sub-pixel information, which may be of particular importance\u00a0considering the DK1&#8217;s low resolution<\/li>\n<li>incorrect\u00a0chromatic abberation correction causing visual acuity to suffer away from image and lens center (which could have been separate, competing problems in the case of miscalibration)<\/li>\n<li>something wrong in the distortion shader, causing subtle, stereo-cue destroying\u00a0misalignments<\/li>\n<\/ul>\n<p>Here&#8217;s two images I used\u00a0to test. \u00a0In both images, I\u00a0tried to center my view on\u00a0on a single &#8220;corner&#8221; point of a grid pattern, marked with a red dot; image center is marked with yellow axes.<\/p>\n<p>First, from the official OculusWorldDemo:<\/p>\n<p><a href=\"http:\/\/blogs.discovery.wisc.edu\/projects\/files\/2014\/09\/tuscany-floor-centered-marker-1-scribbles-smaller.png\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-489\" src=\"http:\/\/blogs.discovery.wisc.edu\/projects\/files\/2014\/09\/tuscany-floor-centered-marker-1-scribbles-smaller.png\" alt=\"oculus tuscany demo tile grid - focus marked\" width=\"640\" height=\"400\" srcset=\"https:\/\/blogs.discovery.wisc.edu\/projects\/files\/2014\/09\/tuscany-floor-centered-marker-1-scribbles-smaller.png 640w, https:\/\/blogs.discovery.wisc.edu\/projects\/files\/2014\/09\/tuscany-floor-centered-marker-1-scribbles-smaller-300x187.png 300w, https:\/\/blogs.discovery.wisc.edu\/projects\/files\/2014\/09\/tuscany-floor-centered-marker-1-scribbles-smaller-480x300.png 480w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>So, that&#8217;s roughly where we want our eye-center red dots to be, relative to image center.<\/p>\n<p>And from our\u00a0code:<\/p>\n<p><a href=\"http:\/\/blogs.discovery.wisc.edu\/projects\/files\/2014\/09\/lab-limestone-marker-2-1280x720-scribbles-smaller.png\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-490\" src=\"http:\/\/blogs.discovery.wisc.edu\/projects\/files\/2014\/09\/lab-limestone-marker-2-1280x720-scribbles-smaller.png\" alt=\"lab limestone -- marker 2 - 1280x720 - scribbles - smaller\" width=\"640\" height=\"360\" srcset=\"https:\/\/blogs.discovery.wisc.edu\/projects\/files\/2014\/09\/lab-limestone-marker-2-1280x720-scribbles-smaller.png 640w, https:\/\/blogs.discovery.wisc.edu\/projects\/files\/2014\/09\/lab-limestone-marker-2-1280x720-scribbles-smaller-300x168.png 300w, https:\/\/blogs.discovery.wisc.edu\/projects\/files\/2014\/09\/lab-limestone-marker-2-1280x720-scribbles-smaller-500x281.png 500w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p>Which matches what I was experiencing with the undistorted images in the Rift &#8212; things were in <em>almost<\/em> the right places, but differences\u00a0between the images\u00a0seem exaggerated in not immediately coherent\u00a0ways.<\/p>\n<p>The key difference is in the shape of the individual eye&#8217;s images. \u00a0In the image from my code, the shape of the right eye image is &#8220;flipped&#8221; relative to the official demo&#8217;s; or rather, our\u00a0code hadn&#8217;t flipped the right eye&#8217;s coordinate system, relative to the left&#8217;s.<\/p>\n<p>This is most apparent with the hard right edge &#8212; I&#8217;d written this off before as a mismatch in screen resolutions between PC and rift causing the screen to get cut off, but nope, turns out that lurking deep within OculusRoomTiny (the blueprint for our Rift integration), the center offset for the right eye was being inverted before being passed to the shader. \u00a0This happened well away from the rest of the rendering code, so it was easy to miss.<\/p>\n<p>I changed our code to match &#8212; and the difference was striking. \u00a0Full stereo fusion came naturally, and general visual acuity and awareness of the scene was improved. \u00a0And so was awareness of a whole host of new flaws in the scene &#8212; the lack of multisampling and screen door effect were much more apparent, tracking errors more annoying, and errors in recreations of realistic scenes\u00a0far more in focus. \u00a0It&#8217;s interesting how thoroughly the distortion misalignment dominated those other visual artifacts.<\/p>\n<p>Related &#8212; the misaligned distortion may have been causing vertical disparity, which I hear is the main problem when using toe-in to create stereo pairs. \u00a0Vertical disparity is accused of decreasing visual acuity; perhaps this\u00a0takes the form of inattention, rather than blurriness, which would explain our suddenly becoming more attentive to other artifacts when the distortion shader was fixed. \u00a0Maybe more in a future post.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For a while I was attempting to build visual stimulus in the Rift, but they always seemed off. \u00a0Sense of depth was off, it seemed difficult to fuse the two images at more than one small region at a time, &hellip; <a href=\"https:\/\/blogs.discovery.wisc.edu\/projects\/2014\/09\/12\/tracking-down-rift-fusion-problems\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":89,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[32,3],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/posts\/488"}],"collection":[{"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/users\/89"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/comments?post=488"}],"version-history":[{"count":2,"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/posts\/488\/revisions"}],"predecessor-version":[{"id":492,"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/posts\/488\/revisions\/492"}],"wp:attachment":[{"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/media?parent=488"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/categories?post=488"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.discovery.wisc.edu\/projects\/wp-json\/wp\/v2\/tags?post=488"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}