Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Shader "Cutoff/Ramp Cutoff Transparent" {
- Properties {
- _MainTex ("Main Texture", 2D) = "white" {}
- [HDR] _Color ("Main Color", Color) = (0, 0, 0, 1)
- [HDR] _DarkEmissiveColor ("Dark Color", Color) = (0, 0, 0, 1)
- [HDR] _LightEmissiveColor ("Light Color", Color) = (1, 1, 1, 1)
- _Cutoff ("Cutoff", Range (0, 1)) = 0.5
- _Transparency("Transparency", Range(0.0,1.0)) = 0
- }
- SubShader {
- Tags {"Queue"="Transparent" "RenderType"="Transparent"}
- CGPROGRAM
- #pragma surface surf Lambert alpha
- struct Input {
- float2 uv_MainTex;
- float3 viewDir;
- };
- sampler2D _MainTex;
- sampler2D _BumpMap;
- float4 _Color;
- float4 _Transparency;
- float4 _DarkEmissiveColor;
- float4 _LightEmissiveColor;
- float _Cutoff;
- void surf (Input IN, inout SurfaceOutput o) {
- o.Albedo = _Color;
- float rampValue = tex2D (_MainTex, IN.uv_MainTex).r;
- float cutoff = step(_Cutoff, rampValue);
- o.Emission = lerp(_DarkEmissiveColor, _LightEmissiveColor, cutoff);
- o.Alpha = lerp(_DarkEmissiveColor.a, _LightEmissiveColor.a, cutoff);
- }
- ENDCG
- }
- Fallback "Diffuse"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement