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.

67 lines
1.7 KiB

  1. // Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
  2. // Unlit shader. Simplest possible textured shader.
  3. // - no lighting
  4. // - no lightmap support
  5. // - no per-material color
  6. Shader "Unlit/Double-Sided" {
  7. Properties {
  8. _MainTex ("Base (RGB)", 2D) = "white" {}
  9. }
  10. SubShader {
  11. Tags { "RenderType"="Opaque" }
  12. LOD 100
  13. Pass {
  14. Name "FORWARD"
  15. Tags { "LightMode" = "ForwardBase" }
  16. Cull Off
  17. CGPROGRAM
  18. #pragma vertex vert
  19. #pragma fragment frag
  20. #pragma target 2.0
  21. #pragma multi_compile_fog
  22. #include "UnityCG.cginc"
  23. struct appdata_t {
  24. float4 vertex : POSITION;
  25. float2 texcoord : TEXCOORD0;
  26. UNITY_VERTEX_INPUT_INSTANCE_ID
  27. };
  28. struct v2f {
  29. float4 vertex : SV_POSITION;
  30. float2 texcoord : TEXCOORD0;
  31. UNITY_FOG_COORDS(1)
  32. UNITY_VERTEX_OUTPUT_STEREO
  33. };
  34. sampler2D _MainTex;
  35. float4 _MainTex_ST;
  36. v2f vert (appdata_t v)
  37. {
  38. v2f o;
  39. UNITY_SETUP_INSTANCE_ID(v);
  40. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  41. o.vertex = UnityObjectToClipPos(v.vertex);
  42. o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
  43. UNITY_TRANSFER_FOG(o,o.vertex);
  44. return o;
  45. }
  46. fixed4 frag (v2f i) : SV_Target
  47. {
  48. fixed4 col = tex2D(_MainTex, i.texcoord);
  49. UNITY_APPLY_FOG(i.fogCoord, col);
  50. UNITY_OPAQUE_ALPHA(col.a);
  51. return col;
  52. }
  53. ENDCG
  54. }
  55. }
  56. }