Shader "Custom/ShaderMovie"
{
Properties
{
_MainTex("Color (RGB)", 2D) = "black"
}
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.x >= 0.47)
{
o.Alpha=0;
}
else
{
o.Alpha = tex2D(_MainTex, float2(IN.uv_MainTex.x+0.5, IN.uv_MainTex.y)).rgb;
}
}
ENDCG
}
}
Unity透明视频播放 所需的Shader脚本
最新推荐文章于 2024-08-05 16:57:25 发布