Skip to content

Instantly share code, notes, and snippets.

@Leopotam
Created March 28, 2017 15:25
Show Gist options
  • Save Leopotam/ee71201e1b28d9ff131ac50d77557d2a to your computer and use it in GitHub Desktop.
Save Leopotam/ee71201e1b28d9ff131ac50d77557d2a to your computer and use it in GitHub Desktop.
test-transparent
Shader "Custom/UnlitTransparent" {
Properties {
_MainTex ("Texture", 2D) = "white" {}
}
SubShader {
Tags { "RenderType" = "Transparent" "Queue" = "Transparent" "IgnoreProjector" = "True" "ForceNoShadowCasting" = "True" }
LOD 100
Cull Off
ZWrite Off
Blend SrcAlpha OneMinusSrcAlpha
CGINCLUDE
#include "UnityCG.cginc"
sampler2D _MainTex;
float4 _MainTex_ST;
struct v2f {
float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
};
v2f vert (appdata_full v) {
v2f o;
o.pos = mul (UNITY_MATRIX_MVP, v.vertex);
o.uv = TRANSFORM_TEX (v.texcoord, _MainTex);
return o;
}
fixed4 frag (v2f i) : SV_Target {
return tex2D (_MainTex, i.uv);
}
ENDCG
Pass {
Tags { "LightMode" = "ForwardBase" }
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
ENDCG
}
}
Fallback Off
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment