3
votes

I've been trying to make a Unity game that uses the Xbox One Kinect (V2).

I followed the instructions in this tutorial: http://www.imaginativeuniversal.com/blog/2015/03/27/unity-5-and-kinect-2-integration/

There are two sample scenes in this zip file: (1) KinectView and (2) GreenScreen.

When I run the first sample (KinectView), the image looks warped, like the right part of the screenshot below:

enter image description here

When I run the second sample (the GreenScreen scene) I get a Null frame error:

enter image description here



Now I'm not really concerned the warping issue in the first scene (KinectView). I am concerned with the Background Removal feature in the second scene (GreenScreen). All I need is to see myself clipped against a custom background.

Can anyone help me figure out how to fix this NULL MSFR Frame issue?

I have uploaded the zipped project in case anyone is interested: https://www.sendspace.com/file/j2ftqz

Thank you very much.



Update:

I have been messing with some of the Shader options in the Inspector, and noticed that all shader options work except the DX11\GreenScreenShader one. Some of them look like a normal video capture; others are better lit (additive/multiply/alpha blend/etc...).

Why is it that the DX\GreenScreenShader option is the only one that does not work, and instead show nothing more than a pink square.

Screenshot below.

enter image description here

1

1 Answers

0
votes

Open the shader in question on your favorite text editor and change these two lines:

1) Line 15. from Texture2D _MainTex; to UNITY_DECLARE_TEX2D(_MainTex);

2) Line 59. from o = _MainTex.Sample(SampleType, i.tex); to o = UNITY_SAMPLE_TEX2D( _MainTex, i.tex );

Updating the shaders as shown above will solve the issue you describe.

Secondary Reference/Source: https://forum.unity.com/threads/kinect-v2-0-sdk-green-screen-demo-for-unity-3d-not-working-why.467687/