Part Tools Import
[VesselSimulator.git] / Assets / PartTools / Shaders / AlphaAdditive.shader
cybutek 1 Shader "KSP/Alpha/Translucent Additive"
2 {
3 Properties
4 {
5 _MainTex("MainTex (RGBA)", 2D) = "white" {}
6 _TintColor("TintColor", Color) = (1,1,1,1)
7 _Fresnel("Fresnel", Range(0,10)) = 0
8 //_FresnelInvert("Inverse Fresnel", Range(0,10)) = 0
9 }
10
11
12
13 SubShader
14 {
15 Tags{ "Queue" = "Transparent" }
16
17 ZWrite Off
18 ZTest LEqual
19 Blend SrcAlpha One
20
21 CGPROGRAM
22
23 #include "LightingKSP.cginc"
24 #pragma surface surf NoLighting noshadow noambient novertexlights nolightmap
25 #pragma target 3.0
26
27
28 sampler2D _MainTex;
29 float _Fresnel;
30 float _FresnelInvert;
31 float4 _TintColor;
32
33 struct Input
34 {
35 float2 uv_MainTex;
36 float2 uv_BumpMap;
37 float2 uv_Emissive;
38 float3 viewDir;
39 };
40
41 void surf(Input IN, inout SurfaceOutput o)
42 {
43 float4 color = tex2D(_MainTex, (IN.uv_MainTex)) * _TintColor;
44
45 float3 normal = float3(0,0,1);
46 half rim = 1.0 - saturate(dot(normalize(IN.viewDir), normal));
47
48 o.Albedo = 0;
49 //o.Emission = color.rgb*(_FresnelColor+(_FresnelInvert + (pow(1 - rim, _Fresnel))) * (1 - _FresnelInvert + 1 - (pow(1 - rim, _Fresnel))));
50 //o.Emission = color.rgb*(pow(1 - rim, _Fresnel))*((pow(rim, _FresnelInvert)));
51 o.Emission = color.rgb * (pow(1 - rim, _Fresnel));
52
53 o.Normal = normal;
54
55
56 }
57
58 ENDCG
59 }
60 Fallback "KSP/Particles/Additive"
61
62 }
63