You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
7.1 KiB

  1. // Shader created with Shader Forge v1.26
  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.26;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,vtps:0,hqsc:True,nrmq:1,nrsp:0,vomd:0,spxs:False,tesm:0,olmd:1,culm:0,bsrc:0,bdst:1,dpts:2,wrdp:True,dith:0,rfrpo:True,rfrpn:Refraction,coma:15,ufog:True,aust:True,igpj:False,qofs:0,qpre:1,rntp:1,fgom:False,fgoc:False,fgod:False,fgor:False,fgmd:0,fgcr:0.5,fgcg:0.5,fgcb:0.5,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,fnsp:False,fnfb:False;n:type:ShaderForge.SFN_Final,id:9361,x:33209,y:32712,varname:node_9361,prsc:2|custl-6614-OUT;n:type:ShaderForge.SFN_Color,id:2943,x:32587,y:32901,ptovrint:False,ptlb:HighLight,ptin:_HighLight,varname:_HighLight,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,c1:0.8676471,c2:0.03827853,c3:0.03827853,c4:1;n:type:ShaderForge.SFN_Color,id:5129,x:32576,y:32684,ptovrint:False,ptlb:LowLight,ptin:_LowLight,varname:_LowLight,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,c1:0.3823529,c2:0.3823529,c3:0.3823529,c4:1;n:type:ShaderForge.SFN_Lerp,id:6614,x:32890,y:32938,varname:node_6614,prsc:2|A-5129-RGB,B-2943-RGB,T-7325-OUT;n:type:ShaderForge.SFN_Tex2d,id:7481,x:31875,y:33749,ptovrint:False,ptlb:GradienceMap,ptin:_GradienceMap,varname:_Gradience,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,tex:cb89da7e1100944499f9783f8a750859,ntxv:0,isnm:False|UVIN-2380-UVOUT;n:type:ShaderForge.SFN_TexCoord,id:2380,x:31564,y:33766,varname:node_2380,prsc:2,uv:0;n:type:ShaderForge.SFN_Add,id:4392,x:32094,y:33110,varname:node_4392,prsc:2|A-4708-OUT,B-8125-OUT;n:type:ShaderForge.SFN_Lerp,id:8125,x:31852,y:33157,varname:node_8125,prsc:2|A-8573-RGB,B-714-OUT,T-288-OUT;n:type:ShaderForge.SFN_RemapRange,id:714,x:31618,y:33221,varname:node_714,prsc:2,frmn:0,frmx:1,tomn:1,tomx:0|IN-8573-RGB;n:type:ShaderForge.SFN_Tex2d,id:8573,x:31147,y:33174,ptovrint:False,ptlb:TimeMap,ptin:_TimeMap,varname:_TimeNode,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,tex:b8f1d2aab7a1ed0478705fbbbbffde97,ntxv:0,isnm:False|UVIN-1982-UVOUT;n:type:ShaderForge.SFN_TexCoord,id:1982,x:30920,y:33087,varname:node_1982,prsc:2,uv:0;n:type:ShaderForge.SFN_ComponentMask,id:4482,x:32305,y:33086,varname:node_4482,prsc:2,cc1:0,cc2:-1,cc3:-1,cc4:-1|IN-4392-OUT;n:type:ShaderForge.SFN_Code,id:1023,x:32714,y:33346,varname:node_1023,prsc:2,code:IABmAGwAbwBhAHQAIAByAGUAdABWAGEAbAA7AA0ACgAgACAAIAAgACAAIAAgACAAIAAgAA0ACgAgAGYAbABvAGEAdAAgAHQAIAA9ACAAKAAoAEkAbgBwAHUAdAAgACsAIABTAGwAaQBkAGUAcgApAC8AKAAyACoAUwBsAGkAZABlAHIAKQApADsADQAKACAAcgBlAHQAVgBhAGwAIAA9ACAAbABlAHIAcAAgACgAMAAsADEALAB0ACkAOwANAAoAIAAgACAAIAAgACAAIAAgACAAIAAgACAADQAKACAAcgBlAHQAdQByAG4AIABjAGwAYQBtAHAAIAAoAHIAZQB0AFYAYQBsACwAIAAwAC4AMAAsACAAMQAuADAAKQA7AA==,output:0,fname:CieltoGrad,width:384,height:187,input:0,input:0,input_1_label:Input,input_2_label:Slider|A-5345-OUT,B-3076-OUT;n:type:ShaderForge.SFN_Slider,id:4708,x:31020,y:32871,ptovrint:False,ptlb:TimeNode,ptin:_TimeNode,varname:node_4708,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,min:-1,cur:-0.007141635,max:1;n:type:ShaderForge.SFN_ToggleProperty,id:288,x:31690,y:33410,ptovrint:False,ptlb:InvertMap,ptin:_InvertMap,varname:node_288,prsc:2,glob:False,taghide:False,taghdr:False,tagprd:False,tagnsco:False,tagnrm:False,on:True;n:type:ShaderForge.SFN_Clamp01,id:5345,x:32503,y:33211,varname:node_5345,prsc:2|IN-4482-OUT;n:type:ShaderForge.SFN_Clamp01,id:5374,x:32066,y:33749,varname:node_5374,prsc:2|IN-7481-R;n:type:ShaderForge.SFN_RemapRange,id:3076,x:32297,y:33684,varname:node_3076,prsc:2,frmn:0,frmx:1,tomn:0.0001,tomx:1|IN-5374-OUT;n:type:ShaderForge.SFN_RemapRange,id:7325,x:32955,y:33142,varname:node_7325,prsc:2,frmn:0,frmx:1,tomn:-1,tomx:1|IN-1023-OUT;proporder:2943-5129-7481-8573-4708-288;pass:END;sub:END;*/
  5. Shader "Shader Forge/BackGroundEffect" {
  6. Properties {
  7. _HighLight ("HighLight", Color) = (0.8676471,0.03827853,0.03827853,1)
  8. _LowLight ("LowLight", Color) = (0.3823529,0.3823529,0.3823529,1)
  9. _GradienceMap ("GradienceMap", 2D) = "white" {}
  10. _TimeMap ("TimeMap", 2D) = "white" {}
  11. _TimeNode ("TimeNode", Range(-1, 1)) = -0.007141635
  12. [MaterialToggle] _InvertMap ("InvertMap", Float ) = 1
  13. }
  14. SubShader {
  15. Tags {
  16. "RenderType"="Opaque"
  17. }
  18. Pass {
  19. Name "FORWARD"
  20. Tags {
  21. "LightMode"="ForwardBase"
  22. }
  23. CGPROGRAM
  24. #pragma vertex vert
  25. #pragma fragment frag
  26. #define UNITY_PASS_FORWARDBASE
  27. #include "UnityCG.cginc"
  28. #pragma multi_compile_fwdbase_fullshadows
  29. #pragma multi_compile_fog
  30. #pragma exclude_renderers gles3 metal d3d11_9x xbox360 xboxone ps3 ps4 psp2
  31. #pragma target 3.0
  32. uniform float4 _HighLight;
  33. uniform float4 _LowLight;
  34. uniform sampler2D _GradienceMap; uniform float4 _GradienceMap_ST;
  35. uniform sampler2D _TimeMap; uniform float4 _TimeMap_ST;
  36. float CieltoGrad( float Input , float Slider ){
  37. float retVal;
  38. float t = ((Input + Slider)/(2*Slider));
  39. retVal = lerp (0,1,t);
  40. return clamp (retVal, 0.0, 1.0);
  41. }
  42. uniform float _TimeNode;
  43. uniform fixed _InvertMap;
  44. struct VertexInput {
  45. float4 vertex : POSITION;
  46. float2 texcoord0 : TEXCOORD0;
  47. };
  48. struct VertexOutput {
  49. float4 pos : SV_POSITION;
  50. float2 uv0 : TEXCOORD0;
  51. UNITY_FOG_COORDS(1)
  52. };
  53. VertexOutput vert (VertexInput v) {
  54. VertexOutput o = (VertexOutput)0;
  55. o.uv0 = v.texcoord0;
  56. o.pos = mul(UNITY_MATRIX_MVP, v.vertex );
  57. UNITY_TRANSFER_FOG(o,o.pos);
  58. return o;
  59. }
  60. float4 frag(VertexOutput i) : COLOR {
  61. ////// Lighting:
  62. float4 _TimeMap_var = tex2D(_TimeMap,TRANSFORM_TEX(i.uv0, _TimeMap));
  63. float4 _GradienceMap_var = tex2D(_GradienceMap,TRANSFORM_TEX(i.uv0, _GradienceMap));
  64. float node_1023 = CieltoGrad( saturate((_TimeNode+lerp(_TimeMap_var.rgb,(_TimeMap_var.rgb*-1.0+1.0),_InvertMap)).r) , (saturate(_GradienceMap_var.r)*0.9999+0.0001) );
  65. float3 finalColor = lerp(_LowLight.rgb,_HighLight.rgb,(node_1023*2.0+-1.0));
  66. fixed4 finalRGBA = fixed4(finalColor,1);
  67. UNITY_APPLY_FOG(i.fogCoord, finalRGBA);
  68. return finalRGBA;
  69. }
  70. ENDCG
  71. }
  72. }
  73. FallBack "Diffuse"
  74. CustomEditor "ShaderForgeMaterialInspector"
  75. }