FT_Emission_DoubleSide.shader 5.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
  2. // Shader created with Shader Forge v1.05
  3. // Shader Forge (c) Neat Corporation / Joachim Holmer - http://www.acegikmo.com/shaderforge/
  4. // Note: Manually altering this data may prevent you from opening it in Shader Forge
  5. /*SF_DATA;ver:1.05;sub:START;pass:START;ps:flbk:,lico:1,lgpr:1,nrmq:1,limd:0,uamb:True,mssp:True,lmpd:False,lprd:False,rprd:False,enco:False,frtr:True,vitr:True,dbil:False,rmgx:True,rpth:0,hqsc:True,hqlp:False,tesm:0,blpr:2,bsrc:0,bdst:0,culm:2,dpts:2,wrdp:False,dith:2,ufog:True,aust:True,igpj:True,qofs:0,qpre:3,rntp:2,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,ofsf:0,ofsu:0,f2p0:False;n:type:ShaderForge.SFN_Final,id:1457,x:33288,y:32719,varname:node_1457,prsc:2|emission-9525-OUT;n:type:ShaderForge.SFN_Tex2d,id:2230,x:31977,y:32843,ptovrint:False,ptlb:Texture,ptin:_Texture,varname:node_2230,prsc:2,ntxv:0,isnm:False;n:type:ShaderForge.SFN_Color,id:5327,x:32244,y:32573,ptovrint:False,ptlb:Color,ptin:_Color,varname:node_5327,prsc:2,glob:False,c1:1,c2:0.3529412,c3:0,c4:1;n:type:ShaderForge.SFN_Multiply,id:316,x:32493,y:32832,varname:node_316,prsc:2|A-1515-OUT,B-5327-RGB,C-8967-OUT;n:type:ShaderForge.SFN_ValueProperty,id:8967,x:32493,y:32700,ptovrint:False,ptlb:Emission,ptin:_Emission,varname:node_8967,prsc:2,glob:False,v1:16;n:type:ShaderForge.SFN_VertexColor,id:3762,x:32637,y:32874,varname:node_3762,prsc:2;n:type:ShaderForge.SFN_Multiply,id:9525,x:32857,y:32793,varname:node_9525,prsc:2|A-316-OUT,B-3762-RGB,C-3762-A,D-3692-OUT;n:type:ShaderForge.SFN_Lerp,id:1515,x:32202,y:32943,varname:node_1515,prsc:2|A-9007-OUT,B-2230-RGB,T-2230-A;n:type:ShaderForge.SFN_Vector1,id:9007,x:31969,y:33076,varname:node_9007,prsc:2,v1:0;n:type:ShaderForge.SFN_Slider,id:6177,x:32557,y:32580,ptovrint:False,ptlb:SoftParticle_Value,ptin:_SoftParticle_Value,varname:node_5073,prsc:2,min:0,cur:0,max:1;n:type:ShaderForge.SFN_SwitchProperty,id:3692,x:33114,y:32525,ptovrint:False,ptlb:Use_SoftPaticle,ptin:_Use_SoftPaticle,varname:node_287,prsc:2,on:False|A-4558-OUT,B-6600-OUT;n:type:ShaderForge.SFN_DepthBlend,id:6600,x:32907,y:32590,varname:node_6600,prsc:2|DIST-6177-OUT;n:type:ShaderForge.SFN_Vector1,id:4558,x:32907,y:32525,varname:node_4558,prsc:2,v1:1;proporder:5327-2230-8967-3692-6177;pass:END;sub:END;*/
  6. Shader "FT/Emission_DoubleSide" {
  7. Properties {
  8. _Color ("Color", Color) = (1,0.3529412,0,1)
  9. _Texture ("Texture", 2D) = "white" {}
  10. _Emission ("Emission", Float ) = 16
  11. [MaterialToggle] _Use_SoftPaticle ("Use_SoftPaticle", Float ) = 1
  12. _SoftParticle_Value ("SoftParticle_Value", Range(0, 1)) = 0
  13. }
  14. SubShader {
  15. Tags {
  16. "IgnoreProjector"="True"
  17. "Queue"="Transparent"
  18. "RenderType"="Transparent"
  19. }
  20. Pass {
  21. Name "ForwardBase"
  22. Tags {
  23. "LightMode"="ForwardBase"
  24. }
  25. Blend One One
  26. Cull Off
  27. ZWrite Off
  28. CGPROGRAM
  29. #pragma vertex vert
  30. #pragma fragment frag
  31. #define UNITY_PASS_FORWARDBASE
  32. #include "UnityCG.cginc"
  33. #pragma multi_compile_fwdbase
  34. #pragma exclude_renderers xbox360 ps3 flash d3d11_9x
  35. #pragma target 3.0
  36. uniform sampler2D _CameraDepthTexture;
  37. uniform sampler2D _Texture; uniform float4 _Texture_ST;
  38. uniform float4 _Color;
  39. uniform float _Emission;
  40. uniform float _SoftParticle_Value;
  41. uniform fixed _Use_SoftPaticle;
  42. struct VertexInput {
  43. float4 vertex : POSITION;
  44. float2 texcoord0 : TEXCOORD0;
  45. float4 vertexColor : COLOR;
  46. };
  47. struct VertexOutput {
  48. float4 pos : SV_POSITION;
  49. float2 uv0 : TEXCOORD0;
  50. float4 vertexColor : COLOR;
  51. float4 projPos : TEXCOORD1;
  52. };
  53. VertexOutput vert (VertexInput v) {
  54. VertexOutput o = (VertexOutput)0;
  55. o.uv0 = v.texcoord0;
  56. o.vertexColor = v.vertexColor;
  57. o.pos = UnityObjectToClipPos(v.vertex);
  58. o.projPos = ComputeScreenPos (o.pos);
  59. COMPUTE_EYEDEPTH(o.projPos.z);
  60. return o;
  61. }
  62. fixed4 frag(VertexOutput i) : COLOR {
  63. float sceneZ = max(0,LinearEyeDepth (UNITY_SAMPLE_DEPTH(tex2Dproj(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos)))) - _ProjectionParams.g);
  64. float partZ = max(0,i.projPos.z - _ProjectionParams.g);
  65. /////// Vectors:
  66. ////// Lighting:
  67. ////// Emissive:
  68. float node_9007 = 0.0;
  69. float4 _Texture_var = tex2D(_Texture,TRANSFORM_TEX(i.uv0, _Texture));
  70. float3 emissive = ((lerp(float3(node_9007,node_9007,node_9007),_Texture_var.rgb,_Texture_var.a)*_Color.rgb*_Emission)*i.vertexColor.rgb*i.vertexColor.a*lerp( 1.0, saturate((sceneZ-partZ)/_SoftParticle_Value), _Use_SoftPaticle ));
  71. float3 finalColor = emissive;
  72. return fixed4(finalColor,1);
  73. }
  74. ENDCG
  75. }
  76. }
  77. FallBack "Diffuse"
  78. CustomEditor "ShaderForgeMaterialInspector"
  79. }