ShowEmission.shader 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. Shader "Hidden/ShowEmission"
  2. {
  3. SubShader
  4. {
  5. Tags { "RenderType" = "Opaque" }
  6. LOD 100
  7. Pass
  8. {
  9. CGPROGRAM
  10. #pragma vertex vert
  11. #pragma fragment frag
  12. #include "UnityCG.cginc"
  13. struct appdata
  14. {
  15. float4 vertex : POSITION;
  16. float2 uv : TEXCOORD0;
  17. };
  18. struct v2f
  19. {
  20. float4 vertex : SV_POSITION;
  21. float2 uv : TEXCOORD0;
  22. };
  23. sampler2D _EmissionMap;
  24. float4 _EmissionMap_ST;
  25. v2f vert(appdata v)
  26. {
  27. v2f o;
  28. o.vertex = UnityObjectToClipPos(v.vertex);
  29. o.uv = TRANSFORM_TEX(v.uv, _EmissionMap);
  30. return o;
  31. }
  32. fixed4 frag(v2f i) : SV_Target
  33. {
  34. float4 emission = tex2D(_EmissionMap, i.uv);
  35. return emission;
  36. }
  37. ENDCG
  38. }
  39. }
  40. }