2014-12-01 60 views

回答

2

Vuforia通過將它們設置爲輸出到渲染紋理使用內置系統視頻播放器(在iOS和Android)播放視頻。

系統播放器不支持Alpha通道視頻。

您需要在渲染紋理上應用色度鍵着色器來刪除綠色或紫色。

有一個在vuforia論壇上一些討論:

playing-video-alpha-channel-videosample-demo-project

+0

謝謝,我跟着那個網址裏面的鏈接:) – Osuka42 2014-12-03 20:51:07

+0

你也可以用庫來渲染視頻,看到這個其他的問題,爲一個qorking的例子。 https://stackoverflow.com/questions/6574801/ios-video-as-gl-texture-with-alpha-transparency/11713684#11713684 – MoDJ 2014-12-19 04:34:32

+0

@ Osuka42你會發布你是怎麼做到的?我無法播放阿爾法視頻。實際上,我想創建一張名片,將圖片放在上面,如果掃描我想播放視頻。我怎樣才能做到這一點? – 2016-03-23 09:07:09

1

你需要做一個「特殊的視頻」之類的PIC,像二的冪:256×512個格式

pic of special video to be used

然後用這個自定義着色器:

Properties{ 
     _MainTex("Color (RGB)", 2D) = "white" 
    } 
    SubShader{ 
     Tags{ "Queue" = "Transparent" "RenderType" = "Transparent" } 
     CGPROGRAM 
     #pragma surface surf NoLighting alpha 
     fixed4 LightingNoLighting(SurfaceOutput s, fixed3 lightDir, fixed atten) { 
     fixed4 c; 
     c.rgb = s.Albedo; 
     c.a = s.Alpha; 
     return c; 
    } 
    struct Input { 
     float2 uv_MainTex; 
    }; 
    sampler2D _MainTex; 
    void surf(Input IN, inout SurfaceOutput o) { 
     o.Emission = tex2D(_MainTex, IN.uv_MainTex).rgb; 

     if(IN.uv_MainTex.y <= 0.5){ 
      o.Alpha=0; 
     } 

     else{ 
      o.Alpha = tex2D(_MainTex, float2(IN.uv_MainTex.x, IN.uv_MainTex.y-0.5)).rgb; 
     } 

    } 
    ENDCG 
    } 
} 

你也可以在我的帖子中看到:http://answers.unity3d.com/questions/833537/how-to-play-alpha-video-in-unity.html#answer-1094012

+0

請檢查這個線程。我發佈了一個問題[這裏](http://stackoverflow.com/questions/36173928/how-to-play-an-alpha-video-in-unity-for-android) – 2016-03-23 10:30:51

相關問題