Seven is the number.
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.

99 lines
3.5 KiB

4 years ago
  1. Shader "Ciconia Studio/Double Sided/Emissive/Diffuse" {
  2. Properties {
  3. _Color ("Diffuse Color", Color) = (1,1,1,1)
  4. _MainTex ("Diffuse map", 2D) = "white" {}
  5. _EmissiveIntensity ("Emissive Intensity", Range(0, 2)) = 1
  6. }
  7. SubShader {
  8. Tags {
  9. "RenderType"="Opaque"
  10. }
  11. Pass {
  12. Name "FORWARD"
  13. Tags {
  14. "LightMode"="ForwardBase"
  15. }
  16. Cull Off
  17. CGPROGRAM
  18. #pragma vertex vert
  19. #pragma fragment frag
  20. #include "UnityCG.cginc"
  21. #pragma multi_compile_fwdbase_fullshadows
  22. #pragma multi_compile_fog
  23. #pragma only_renderers d3d9 d3d11 glcore gles gles3 metal d3d11_9x xboxone ps4 psp2 n3ds wiiu
  24. #pragma target 3.0
  25. uniform sampler2D _MainTex; uniform float4 _MainTex_ST;
  26. uniform float4 _Color;
  27. uniform float _EmissiveIntensity;
  28. struct VertexInput {
  29. float4 vertex : POSITION;
  30. float2 texcoord0 : TEXCOORD0;
  31. };
  32. struct VertexOutput {
  33. float4 pos : SV_POSITION;
  34. float2 uv0 : TEXCOORD0;
  35. UNITY_FOG_COORDS(1)
  36. };
  37. VertexOutput vert (VertexInput v) {
  38. VertexOutput o = (VertexOutput)0;
  39. o.uv0 = v.texcoord0;
  40. o.pos = UnityObjectToClipPos( v.vertex );
  41. UNITY_TRANSFER_FOG(o,o.pos);
  42. return o;
  43. }
  44. float4 frag(VertexOutput i, float facing : VFACE) : COLOR {
  45. float isFrontFace = ( facing >= 0 ? 1 : 0 );
  46. float faceSign = ( facing >= 0 ? 1 : -1 );
  47. ////// Lighting:
  48. ////// Emissive:
  49. float4 _MainTex_var = tex2D(_MainTex,TRANSFORM_TEX(i.uv0, _MainTex));
  50. float3 emissive = ((_MainTex_var.rgb*_Color.rgb)*_EmissiveIntensity);
  51. float3 finalColor = emissive;
  52. fixed4 finalRGBA = fixed4(finalColor,1);
  53. UNITY_APPLY_FOG(i.fogCoord, finalRGBA);
  54. return finalRGBA;
  55. }
  56. ENDCG
  57. }
  58. Pass {
  59. Name "ShadowCaster"
  60. Tags {
  61. "LightMode"="ShadowCaster"
  62. }
  63. Offset 1, 1
  64. Cull Off
  65. CGPROGRAM
  66. #pragma vertex vert
  67. #pragma fragment frag
  68. #include "UnityCG.cginc"
  69. #include "Lighting.cginc"
  70. #pragma fragmentoption ARB_precision_hint_fastest
  71. #pragma multi_compile_shadowcaster
  72. #pragma multi_compile_fog
  73. #pragma only_renderers d3d9 d3d11 glcore gles gles3 metal d3d11_9x xboxone ps4 psp2 n3ds wiiu
  74. #pragma target 3.0
  75. struct VertexInput {
  76. float4 vertex : POSITION;
  77. };
  78. struct VertexOutput {
  79. V2F_SHADOW_CASTER;
  80. };
  81. VertexOutput vert (VertexInput v) {
  82. VertexOutput o = (VertexOutput)0;
  83. o.pos = UnityObjectToClipPos( v.vertex );
  84. TRANSFER_SHADOW_CASTER(o)
  85. return o;
  86. }
  87. float4 frag(VertexOutput i, float facing : VFACE) : COLOR {
  88. float isFrontFace = ( facing >= 0 ? 1 : 0 );
  89. float faceSign = ( facing >= 0 ? 1 : -1 );
  90. SHADOW_CASTER_FRAGMENT(i)
  91. }
  92. ENDCG
  93. }
  94. }
  95. FallBack "Diffuse"
  96. }