Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Shader "Custom/TextureCoordinates/PortalView" {
- Properties {
- _MainTex ("Texture", 2D) = "white" {}
- _Mask ("Mask", 2D) = "white" {}
- _Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
- }
- SubShader
- {
- Tags {"Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="TransparentCutout"}
- LOD 200
- Cull Back
- CGPROGRAM
- #pragma surface surf Unlit alphatest:_Cutoff
- sampler2D _MainTex,_Mask;
- struct Input {
- float2 uv_MainTex;
- float4 screenPos;
- };
- fixed4 LightingUnlit(SurfaceOutput s, fixed3 lightDir, fixed atten)
- {
- fixed4 c;
- c.rgb = s.Albedo;
- c.a = s.Alpha;
- return c;
- }
- inline fixed4 LightingUnlit_PrePass (SurfaceOutput s, half4 light)
- {
- fixed4 c;
- c.rgb = s.Albedo;
- c.a = s.Alpha;
- return c;
- }
- void surf (Input IN, inout SurfaceOutput o) {
- half4 c = tex2D (_MainTex, IN.screenPos.xy / IN.screenPos.w);
- o.Albedo = c.rgb;
- o.Alpha = tex2D (_Mask, IN.uv_MainTex).a;
- }
- ENDCG
- }
- Fallback "Legacy Shaders/Transparent/Cutout/VertexLit"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement