Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice

Kinect v2.0 SDK green screen demo for Unity 3D not working. Why?

Discussion in 'Scripting' started by DerrickLau, Apr 23, 2017.

?

Will you be using Kinect 2.0 green screen effects?

  1. Yes

    9 vote(s)
    90.0%
  2. No

    1 vote(s)
    10.0%
  1. DerrickLau

    DerrickLau

    Joined:
    Sep 29, 2013
    Posts:
    70
    I tried importing the files in the Kinect for Unity3D plugin in the GreenScreen folder and running the mainscene scene, but all I see is a purple screen. My kinect is working fine and pointed at me, but I don't see myself anywhere on the screen.

    What am I doing wrong?
     
  2. PapaStout

    PapaStout

    Joined:
    Jun 11, 2017
    Posts:
    16
    I have the same question, too. I've tried changing 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 that pink square.

     
  3. PapaStout

    PapaStout

    Joined:
    Jun 11, 2017
    Posts:
    16
    I was able to find the solution. The question has been asked and answered a few times in other forums.

    Link 1
    Link 2
    Link 3
    Link 4

    Short answer:

    1) change:
    Texture2D _MainTex;
    to:
    UNITY_DECLARE_TEX2D(_MainTex);

    2) Change:
    o = _MainTex.Sample(SampleType, i.tex);
    to:
    o = UNITY_SAMPLE_TEX2D( _MainTex, i.tex );


    Hope it proves useful to you. I was able to test it successfully in Unity v. 5.6.1f1 Personal.
     
  4. sandesh_unity721

    sandesh_unity721

    Joined:
    Feb 4, 2019
    Posts:
    1
    can anyone help me with change backgrounds with images ??