none
Hello, the Unity plug-in Package 'GreenScreen' get wrong in Unity5. RRS feed

  • Question

  • Hello.

    I get a wrong message in Unity5: 

        Fragment program 'frag': sampler 'SampleType' has no matching texture and will be undefined.

    But, it is ok in Unity4.

    I have tried to fix it. But I failed.

    I need some help.

    Thanks.

    Friday, August 14, 2015 10:07 AM

Answers

  • Now.

    it fixed it in Unity 5.2.1.

    change

    "Texture2D _MainTex;" 

    to

    "UNITY_DECLARE_TEX2D(_MainTex);"

    change

    "o = _MainTex.Sample(SampleType, i.tex);"

    to

    "o = UNITY_SAMPLE_TEX2D( _MainTex, i.tex );"

    And the sample "GreenScreen"only work on Unity 5.2.1.

    • Marked as answer by nugao Friday, October 30, 2015 3:11 AM
    Friday, October 30, 2015 3:10 AM

All replies

  • You mean Microsoft's developed package for Unity? Yeah they made it for Unity 4, but I doubt they meant to maintain it or keep updated.

    There is another package on the asset store that seems to use this same package. It has been updated to work with Unity 5:
    https://www.assetstore.unity3d.com/en/#!/content/18708
    • Proposed as answer by Yanis Lukes Saturday, September 5, 2015 12:29 PM
    Friday, August 14, 2015 12:00 PM
  • Hello.

    The Microsoft's developed package for Unity it can run in Unity5, but that Sample 'GreenScreen' has shader error in Unity5.

    The 'GreenScreen' it not work in Unity5.

    Thanks.

    • Proposed as answer by AMaceika Thursday, October 29, 2015 5:27 PM
    • Unproposed as answer by AMaceika Thursday, October 29, 2015 5:27 PM
    Saturday, August 15, 2015 7:31 AM
  • So I fixed this sort of by doing this to the shader. 

    //o = float4(0, 1, 0, 1);
    o = tex2D(SampleType, i.tex);

    It seemed to work granted no green screen but it works now. If I find anything else out as I play around in the shader I will post my findings. Hope this helps. 

    Thursday, October 29, 2015 5:30 PM
  • Now.

    it fixed it in Unity 5.2.1.

    change

    "Texture2D _MainTex;" 

    to

    "UNITY_DECLARE_TEX2D(_MainTex);"

    change

    "o = _MainTex.Sample(SampleType, i.tex);"

    to

    "o = UNITY_SAMPLE_TEX2D( _MainTex, i.tex );"

    And the sample "GreenScreen"only work on Unity 5.2.1.

    • Marked as answer by nugao Friday, October 30, 2015 3:11 AM
    Friday, October 30, 2015 3:10 AM
  • Thank you.
    Monday, January 4, 2016 3:34 PM