{"id":4380,"date":"2016-09-29T22:28:24","date_gmt":"2016-09-29T14:28:24","guid":{"rendered":"http:\/\/unitycoder.com\/blog\/?p=4380"},"modified":"2016-09-30T10:33:55","modified_gmt":"2016-09-30T02:33:55","slug":"using-xbox-one-kinect-with-unity","status":"publish","type":"post","link":"https:\/\/unitycoder.com\/blog\/2016\/09\/29\/using-xbox-one-kinect-with-unity\/","title":{"rendered":"Using XBox One Kinect with Unity"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" data-attachment-id=\"4384\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2016\/09\/29\/using-xbox-one-kinect-with-unity\/kinect_unity_greenscreen\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2016\/09\/kinect_unity_greenscreen.jpg?fit=680%2C475&amp;ssl=1\" data-orig-size=\"680,475\" 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=\"kinect_unity_greenscreen\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2016\/09\/kinect_unity_greenscreen.jpg?fit=300%2C210&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2016\/09\/kinect_unity_greenscreen.jpg?fit=680%2C475&amp;ssl=1\" class=\"alignnone size-full wp-image-4384\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2016\/09\/kinect_unity_greenscreen.jpg?resize=680%2C475\" alt=\"kinect_unity_greenscreen\" width=\"680\" height=\"475\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2016\/09\/kinect_unity_greenscreen.jpg?w=680&amp;ssl=1 680w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2016\/09\/kinect_unity_greenscreen.jpg?resize=300%2C210&amp;ssl=1 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><br \/>\n<em>*main image: Kinect GreenScreen example scene<\/em><\/p>\n<p><strong>Setting up Kinect with Windows 10<\/strong><br \/>\n&#8211; connect to pc (using <a href=\"https:\/\/www.microsoftstore.com\/store\/msusa\/en_US\/pdp\/Kinect-Adapter-for-Xbox-One-S-and-Windows-PC\/productID.2233937600\" target=\"_blank\">adapter<\/a>)<br \/>\n&#8211; Driver installs automatically and you are Done \ud83d\ude42<br \/>\n&#8211; You can test it with these apps:<br \/>\n3d scan: <a href=\"https:\/\/www.microsoft.com\/en-us\/store\/p\/3d-scan\/9nblggh68pmc\" target=\"_blank\">https:\/\/www.microsoft.com\/en-us\/store\/p\/3d-scan\/9nblggh68pmc<\/a><br \/>\n3d builder: <a href=\"https:\/\/www.microsoft.com\/en-us\/store\/p\/3d-builder\/9wzdncrfj3t6\" target=\"_blank\">https:\/\/www.microsoft.com\/en-us\/store\/p\/3d-builder\/9wzdncrfj3t6<\/a><\/p>\n<p>&nbsp;<\/p>\n<p><strong>Using Kinect XBox One with Unity 5 <\/strong>(I tested with Unity v<strong><a href=\"https:\/\/unity3d.com\/unity\/beta\/\" target=\"_blank\">5.50b5<\/a>)<\/strong><br \/>\n&#8211; Download &amp; install Kinect SDK <a href=\"https:\/\/www.microsoft.com\/en-us\/download\/details.aspx?id=44561\" target=\"_blank\">https:\/\/www.microsoft.com\/en-us\/download\/details.aspx?id=44561<\/a>\u00a0 (i&#8217;m using <a href=\"https:\/\/download.microsoft.com\/download\/F\/2\/D\/F2D1012E-3BC6-49C5-B8B3-5ACFF58AF7B8\/KinectSDK-v2.0_1409-Setup.exe\" target=\"_blank\">v2.0_1409<\/a>)<br \/>\n&#8211; UnityPackage is here <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/dn782041.aspx\" target=\"_blank\">https:\/\/msdn.microsoft.com\/en-us\/library\/dn782041.aspx<\/a> (<a href=\"http:\/\/go.microsoft.com\/fwlink\/?LinkID=513177\" target=\"_blank\">package download<\/a>)<br \/>\n&#8211; Import Kinect.2.0.1410.19000.unitypackage into your project<br \/>\n&#8211; Also Copy GreenScreen\/ and KinectView\/ folders from the zip to your project (they contain the sample scenes)<br \/>\n&#8211; One shader is giving this error message: &#8220;&#8216;Shader error in &#8216;DX11\/GreenScreenShader&#8217;: Fragment program &#8216;frag&#8217;: sampler &#8216;SampleType&#8217; has no matching texture and will be undefined&#8221;<\/p>\n<p>Fix is in the unity forums by @Michal<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n\/\/sampler SampleType;\r\nsampler sampler_MainTex;\r\n\/\/o = _MainTex.Sample(SampleType, i.tex);\r\no = _MainTex.Sample(sampler_MainTex, i.tex);\r\n<\/pre>\n<p><a href=\"https:\/\/forum.unity3d.com\/threads\/official-ms-kinect-unity-package-green-screen-shader-error.382295\/#post-2484117\" target=\"_blank\">https:\/\/forum.unity3d.com\/threads\/official-ms-kinect-unity-package-green-screen-shader-error.382295\/#post-2484117<\/a><\/p>\n<p>&#8211; To fix rest of the errors, run Unity Api Updater if it didn&#8217;t run automatically (from menu: Assets \/ Run Api Updater..)<br \/>\n&#8211; Open sample scene: GreenScreen\/MainScene or KinectView\/MainScene<br \/>\n&#8211; Hit play and it should work!<\/p>\n<p>&#8212;<\/p>\n<p><strong>More Resources:<\/strong><br \/>\n&#8211; Kinect experiments: <a href=\"http:\/\/www.kinecthacks.com\/\" target=\"_blank\">http:\/\/www.kinecthacks.com\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; *main image: Kinect GreenScreen example scene Setting up Kinect with Windows 10 &#8211; connect to pc (using adapter) &#8211; Driver installs automatically and you are Done \ud83d\ude42 &#8211; You can test it with these apps: 3d scan: https:\/\/www.microsoft.com\/en-us\/store\/p\/3d-scan\/9nblggh68pmc 3d builder: https:\/\/www.microsoft.com\/en-us\/store\/p\/3d-builder\/9wzdncrfj3t6 &nbsp; Using Kinect [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4384,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_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}},"categories":[420,3],"tags":[921,919,922,28,715,171,235,920],"class_list":["post-4380","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","category-unity3d","tag-adapter","tag-kinect","tag-package","tag-plugin","tag-sdk","tag-unity","tag-windows","tag-xbox"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2016\/09\/kinect_unity_greenscreen.jpg?fit=680%2C475&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p1KTaT-18E","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/4380","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=4380"}],"version-history":[{"count":2,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/4380\/revisions"}],"predecessor-version":[{"id":4386,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/4380\/revisions\/4386"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media\/4384"}],"wp:attachment":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media?parent=4380"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/categories?post=4380"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/tags?post=4380"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}