Unity透明视频播放 所需的Shader脚本

xiaoxiao2021-02-28  135

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 } }
转载请注明原文地址: https://www.6miu.com/read-27375.html

最新回复(0)