Created
October 2, 2018 15:04
-
-
Save sgnm/7699fc24d10a4350a69c166eacb6702e to your computer and use it in GitHub Desktop.
correct transparent effect
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shader "Custom/SemiTransparent" { | |
Properties { | |
_Color ("Color", Color) = (1,1,1,1) | |
_MainTex ("Albedo (RGB)", 2D) = "white" {} | |
} | |
SubShader { | |
Tags { "RenderType"="Transparent" "Queue"="Transparent"} | |
LOD 200 | |
Pass{ | |
ZWrite ON | |
ColorMask 0 | |
} | |
CGPROGRAM | |
#pragma surface surf Standard fullforwardshadows alpha:fade | |
#pragma target 3.0 | |
sampler2D _MainTex; | |
struct Input { | |
float2 uv_MainTex; | |
}; | |
fixed4 _Color; | |
void surf (Input IN, inout SurfaceOutputStandard o) { | |
fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color; | |
o.Albedo = c.rgb; | |
o.Alpha = c.a; | |
} | |
ENDCG | |
} | |
FallBack "Diffuse" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment