FT_Emission 1.shader 3.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
  2. // Shader created with Shader Forge v1.04
  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.04;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: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:32923,y:32668,varname:node_1457,prsc:2|emission-9525-OUT;n:type:ShaderForge.SFN_Tex2d,id:2230,x:32007,y:32827,ptovrint:False,ptlb:Texture,ptin:_Texture,varname:node_2230,prsc:2,ntxv:2,isnm:False;n:type:ShaderForge.SFN_Color,id:5327,x:32214,y:32730,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:32493,y:32832,varname:node_316,prsc:2|A-9569-OUT,B-5327-RGB,C-8967-OUT;n:type:ShaderForge.SFN_ValueProperty,id:8967,x:32267,y:32648,ptovrint:False,ptlb:Emission,ptin:_Emission,varname:node_8967,prsc:2,glob:False,v1:1;n:type:ShaderForge.SFN_VertexColor,id:3762,x:32493,y:32988,varname:node_3762,prsc:2;n:type:ShaderForge.SFN_Multiply,id:9525,x:32730,y:32832,varname:node_9525,prsc:2|A-316-OUT,B-3762-RGB,C-3762-A;n:type:ShaderForge.SFN_Lerp,id:9569,x:32251,y:32916,varname:node_9569,prsc:2|A-8405-OUT,B-2230-RGB,T-2230-A;n:type:ShaderForge.SFN_Vector1,id:8405,x:32007,y:33010,varname:node_8405,prsc:2,v1:0;proporder:5327-2230-8967;pass:END;sub:END;*/
  6. Shader "FT/Emission" {
  7. Properties {
  8. _Color ("Color", Color) = (1,1,1,1)
  9. _Texture ("Texture", 2D) = "black" {}
  10. _Emission ("Emission", Float ) = 1
  11. }
  12. SubShader {
  13. Tags {
  14. "IgnoreProjector"="True"
  15. "Queue"="Transparent"
  16. "RenderType"="Transparent"
  17. }
  18. Pass {
  19. Name "ForwardBase"
  20. Tags {
  21. "LightMode"="ForwardBase"
  22. }
  23. Blend One One
  24. ZWrite Off
  25. CGPROGRAM
  26. #pragma vertex vert
  27. #pragma fragment frag
  28. #define UNITY_PASS_FORWARDBASE
  29. #include "UnityCG.cginc"
  30. #pragma multi_compile_fwdbase
  31. #pragma exclude_renderers xbox360 ps3 flash d3d11_9x
  32. #pragma target 3.0
  33. uniform sampler2D _Texture; uniform float4 _Texture_ST;
  34. uniform float4 _Color;
  35. uniform float _Emission;
  36. struct VertexInput {
  37. float4 vertex : POSITION;
  38. float2 texcoord0 : TEXCOORD0;
  39. float4 vertexColor : COLOR;
  40. };
  41. struct VertexOutput {
  42. float4 pos : SV_POSITION;
  43. float2 uv0 : TEXCOORD0;
  44. float4 vertexColor : COLOR;
  45. };
  46. VertexOutput vert (VertexInput v) {
  47. VertexOutput o = (VertexOutput)0;
  48. o.uv0 = v.texcoord0;
  49. o.vertexColor = v.vertexColor;
  50. o.pos = UnityObjectToClipPos(v.vertex);
  51. return o;
  52. }
  53. fixed4 frag(VertexOutput i) : COLOR {
  54. /////// Vectors:
  55. ////// Lighting:
  56. ////// Emissive:
  57. float node_8405 = 0.0;
  58. float4 _Texture_var = tex2D(_Texture,TRANSFORM_TEX(i.uv0, _Texture));
  59. float3 emissive = ((lerp(float3(node_8405,node_8405,node_8405),_Texture_var.rgb,_Texture_var.a)*_Color.rgb*_Emission)*i.vertexColor.rgb*i.vertexColor.a);
  60. float3 finalColor = emissive;
  61. return fixed4(finalColor,1);
  62. }
  63. ENDCG
  64. }
  65. }
  66. FallBack "Diffuse"
  67. CustomEditor "ShaderForgeMaterialInspector"
  68. }