Update change log.
[VesselSimulator.git] / Assets / PartTools / Shaders / CutoffBumped.shader
cybutek 1 Shader "KSP/Alpha/Cutoff Bumped"
2 {
3 Properties{
4 _Color("Main Color", Color) = (1,1,1,1)
5 _MainTex("Base (RGB) Trans (A)", 2D) = "white" {}
6 _BumpMap("Normalmap", 2D) = "bump" {}
7 _Cutoff("Alpha cutoff", Range(0,1)) = 0.5
8 _RimFalloff("_RimFalloff", Range(0.01,5)) = 0.1
9 _RimColor("_RimColor", Color) = (0,0,0,0)
10
11 _TemperatureColor("_TemperatureColor", Color) = (0,0,0,0)
12 _BurnColor("Burn Color", Color) = (1,1,1,1)
13 }
14
15 SubShader{
16 Tags{ "Queue" = "AlphaTest" "IgnoreProjector" = "True" "RenderType" = "TransparentCutout" }
17 LOD 300
18
19 CGPROGRAM
20 #pragma surface surf Lambert alphatest:_Cutoff
21
22 sampler2D _MainTex;
23 sampler2D _BumpMap;
24 fixed4 _Color;
25 float _RimFalloff;
26 float4 _RimColor;
27 float4 _TemperatureColor;
28 float4 _BurnColor;
29
30 struct Input {
31 float2 uv_MainTex;
32 float2 uv_BumpMap;
33 float2 uv_Emissive;
34 float3 viewDir;
35 };
36
37 void surf(Input IN, inout SurfaceOutput o)
38 {
39 fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color * _BurnColor;
40 float3 normal = float3(0, 0, 1);
41 half rim = 1.0 - saturate(dot(normalize(IN.viewDir), normal));
42 float3 emission = (_RimColor.rgb * pow(rim, _RimFalloff)) * _RimColor.a;
43 emission += _TemperatureColor.rgb * _TemperatureColor.a;
44 o.Albedo = c.rgb;
45 o.Emission = emission;
46 o.Alpha = c.a;
47 o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap));
48 }
49 ENDCG
50 }
51
52 FallBack "Legacy Shaders/Transparent/Cutout/Diffuse"
53 }