Added AltitudeUnderWater class to project file.
[VesselSimulator.git] / Assets / PartTools / Shaders / ParticleAdditiveFresnel.shader
cybutek 1 // Shader created with Shader Forge v1.18
2 // Shader Forge (c) Neat Corporation / Joachim Holmer - http://www.acegikmo.com/shaderforge/
3 // Note: Manually altering this data may prevent you from opening it in Shader Forge
4 /*SF_DATA;ver:1.18;sub:START;pass:START;ps:flbk:,iptp:0,cusa:False,bamd:0,lico:1,lgpr:1,limd:0,spmd:1,trmd:0,grmd:0,uamb:True,mssp:True,bkdf:False,hqlp:False,rprd:False,enco:False,rmgx:True,rpth:0,hqsc:True,nrmq:1,nrsp:0,vomd:0,spxs:False,tesm:0,culm:2,bsrc:0,bdst:0,dpts:2,wrdp:False,dith:0,rfrpo:True,rfrpn:Refraction,coma:15,ufog:True,aust:True,igpj:True,qofs:0,qpre:3,rntp:2,fgom:False,fgoc:True,fgod:False,fgor:False,fgmd:0,fgcr:0,fgcg:0,fgcb:0,fgca:1,fgde:0.01,fgrn:0,fgrf:300,stcl:False,stva:128,stmr:255,stmw:255,stcp:6,stps:0,stfa:0,stfz:0,ofsf:0,ofsu:0,f2p0:False;n:type:ShaderForge.SFN_Final,id:4795,x:32987,y:32660,varname:node_4795,prsc:2|emission-1451-OUT;n:type:ShaderForge.SFN_Tex2d,id:6074,x:32235,y:32601,ptovrint:False,ptlb:MainTex,ptin:_MainTex,varname:_MainTex,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,ntxv:0,isnm:False;n:type:ShaderForge.SFN_Multiply,id:2393,x:32495,y:32793,varname:node_2393,prsc:2|A-6074-RGB,B-2053-RGB,C-797-RGB,D-9248-OUT,E-6554-OUT;n:type:ShaderForge.SFN_VertexColor,id:2053,x:32235,y:32772,varname:node_2053,prsc:2;n:type:ShaderForge.SFN_Color,id:797,x:32235,y:32930,ptovrint:True,ptlb:Color,ptin:_TintColor,varname:_TintColor,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,c1:0.5,c2:0.5,c3:0.5,c4:1;n:type:ShaderForge.SFN_Vector1,id:9248,x:32235,y:33081,varname:node_9248,prsc:2,v1:2;n:type:ShaderForge.SFN_Fresnel,id:3878,x:32179,y:33234,varname:node_3878,prsc:2|EXP-8837-OUT;n:type:ShaderForge.SFN_Slider,id:8837,x:31808,y:33254,ptovrint:False,ptlb:Fresnel Exponent,ptin:_FresnelExponent,varname:node_8837,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,min:1,cur:2.944261,max:4;n:type:ShaderForge.SFN_Subtract,id:6554,x:32506,y:33094,varname:node_6554,prsc:2|A-4911-OUT,B-3878-OUT;n:type:ShaderForge.SFN_Vector1,id:4911,x:32235,y:33139,varname:node_4911,prsc:2,v1:1;n:type:ShaderForge.SFN_Multiply,id:1451,x:32673,y:32885,varname:node_1451,prsc:2|A-2393-OUT,B-797-A;proporder:6074-797-8837;pass:END;sub:END;*/
5
6 Shader "Shader Forge/ParticleAdditiveFresnel" {
7 Properties {
8 _MainTex ("MainTex", 2D) = "white" {}
9 _TintColor ("Color", Color) = (0.5,0.5,0.5,1)
10 _FresnelExponent ("Fresnel Exponent", Range(1, 4)) = 2.944261
11 }
12 SubShader {
13 Tags {
14 "IgnoreProjector"="True"
15 "Queue"="Transparent"
16 "RenderType"="Transparent"
17 }
18 Pass {
19 Name "FORWARD"
20 Tags {
21 "LightMode"="ForwardBase"
22 }
23 Blend One One
24 Cull Off
25 ZWrite Off
26
27 CGPROGRAM
28 #pragma vertex vert
29 #pragma fragment frag
30 #define UNITY_PASS_FORWARDBASE
31 #include "UnityCG.cginc"
32 #pragma multi_compile_fwdbase
33 #pragma multi_compile_fog
34 #pragma exclude_renderers gles3 metal d3d11_9x xbox360 xboxone ps3 ps4 psp2
35 #pragma target 3.0
36 uniform sampler2D _MainTex; uniform float4 _MainTex_ST;
37 uniform float4 _TintColor;
38 uniform float _FresnelExponent;
39 struct VertexInput {
40 float4 vertex : POSITION;
41 float3 normal : NORMAL;
42 float2 texcoord0 : TEXCOORD0;
43 float4 vertexColor : COLOR;
44 };
45 struct VertexOutput {
46 float4 pos : SV_POSITION;
47 float2 uv0 : TEXCOORD0;
48 float4 posWorld : TEXCOORD1;
49 float3 normalDir : TEXCOORD2;
50 float4 vertexColor : COLOR;
51 UNITY_FOG_COORDS(3)
52 };
53 VertexOutput vert (VertexInput v) {
54 VertexOutput o = (VertexOutput)0;
55 o.uv0 = v.texcoord0;
56 o.vertexColor = v.vertexColor;
57 o.normalDir = UnityObjectToWorldNormal(v.normal);
58 o.posWorld = mul(_Object2World, v.vertex);
59 o.pos = mul(UNITY_MATRIX_MVP, v.vertex);
60 UNITY_TRANSFER_FOG(o,o.pos);
61 return o;
62 }
63 float4 frag(VertexOutput i, float facing : VFACE) : COLOR {
64 float isFrontFace = ( facing >= 0 ? 1 : 0 );
65 float faceSign = ( facing >= 0 ? 1 : -1 );
66 i.normalDir = normalize(i.normalDir);
67 i.normalDir *= faceSign;
68 /////// Vectors:
69 float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - i.posWorld.xyz);
70 float3 normalDirection = i.normalDir;
71 ////// Lighting:
72 ////// Emissive:
73 float4 _MainTex_var = tex2D(_MainTex,TRANSFORM_TEX(i.uv0, _MainTex));
74 float3 emissive = ((_MainTex_var.rgb*i.vertexColor.rgb*_TintColor.rgb*2.0*(1.0-pow(1.0-max(0,dot(normalDirection, viewDirection)),_FresnelExponent)))*_TintColor.a);
75 float3 finalColor = emissive;
76 fixed4 finalRGBA = fixed4(finalColor,1);
77 UNITY_APPLY_FOG_COLOR(i.fogCoord, finalRGBA, fixed4(0,0,0,1));
78 return finalRGBA;
79 }
80 ENDCG
81 }
82 }
83 FallBack "Diffuse"
84 CustomEditor "ShaderForgeMaterialInspector"
85 }
86