FT_AlphaBlend.shader 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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:1,bsrc:3,bdst:7,culm:0,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-316-OUT,alpha-9525-OUT;n:type:ShaderForge.SFN_Tex2d,id:2230,x:32007,y:32827,ptovrint:False,ptlb:Texture,ptin:_Texture,varname:node_2230,prsc:2,tex:6b6582862e488694db9e84872a8fa4c5,ntxv:2,isnm:False;n:type:ShaderForge.SFN_Color,id:5327,x:32242,y:32573,ptovrint:False,ptlb:Color,ptin:_Color,varname:node_5327,prsc:2,glob:False,c1:1,c2:1,c3:1,c4:1;n:type:ShaderForge.SFN_Multiply,id:316,x:32507,y:32780,varname:node_316,prsc:2|A-2230-RGB,B-5327-RGB,C-3762-RGB,D-3800-OUT;n:type:ShaderForge.SFN_VertexColor,id:3762,x:32302,y:32949,varname:node_3762,prsc:2;n:type:ShaderForge.SFN_Multiply,id:9525,x:32812,y:32942,varname:node_9525,prsc:2|A-2230-A,B-3762-A;n:type:ShaderForge.SFN_ValueProperty,id:3800,x:32490,y:32619,ptovrint:False,ptlb:Emission,ptin:_Emission,varname:node_3800,prsc:2,glob:False,v1:1;proporder:5327-2230-3800;pass:END;sub:END;*/
  6. Shader "FT/AlphaBlend" {
  7. Properties {
  8. _Color ("Color", Color) = (1,1,1,1)
  9. _Texture ("Texture", 2D) = "black" {}
  10. _Emission ("Emission", Float ) = 1
  11. [HideInInspector]_Cutoff ("Alpha cutoff", Range(0,1)) = 0.5
  12. }
  13. SubShader {
  14. Tags {
  15. "IgnoreProjector"="True"
  16. "Queue"="Transparent"
  17. "RenderType"="Transparent"
  18. }
  19. Pass {
  20. Name "ForwardBase"
  21. Tags {
  22. "LightMode"="ForwardBase"
  23. }
  24. Blend SrcAlpha OneMinusSrcAlpha
  25. ZWrite Off
  26. CGPROGRAM
  27. #pragma vertex vert
  28. #pragma fragment frag
  29. #define UNITY_PASS_FORWARDBASE
  30. #include "UnityCG.cginc"
  31. #pragma multi_compile_fwdbase
  32. #pragma exclude_renderers xbox360 ps3 flash d3d11_9x
  33. #pragma target 3.0
  34. uniform sampler2D _Texture; uniform float4 _Texture_ST;
  35. uniform float4 _Color;
  36. uniform float _Emission;
  37. struct VertexInput {
  38. float4 vertex : POSITION;
  39. float2 texcoord0 : TEXCOORD0;
  40. float4 vertexColor : COLOR;
  41. };
  42. struct VertexOutput {
  43. float4 pos : SV_POSITION;
  44. float2 uv0 : TEXCOORD0;
  45. float4 vertexColor : COLOR;
  46. };
  47. VertexOutput vert (VertexInput v) {
  48. VertexOutput o = (VertexOutput)0;
  49. o.uv0 = v.texcoord0;
  50. o.vertexColor = v.vertexColor;
  51. o.pos = UnityObjectToClipPos(v.vertex);
  52. return o;
  53. }
  54. fixed4 frag(VertexOutput i) : COLOR {
  55. /////// Vectors:
  56. ////// Lighting:
  57. ////// Emissive:
  58. float4 _Texture_var = tex2D(_Texture,TRANSFORM_TEX(i.uv0, _Texture));
  59. float3 emissive = (_Texture_var.rgb*_Color.rgb*i.vertexColor.rgb*_Emission);
  60. float3 finalColor = emissive;
  61. return fixed4(finalColor,(_Texture_var.a*i.vertexColor.a));
  62. }
  63. ENDCG
  64. }
  65. }
  66. FallBack "Diffuse"
  67. CustomEditor "ShaderForgeMaterialInspector"
  68. }