Advertisement
Guest User

Untitled

a guest
Jun 14th, 2014
434
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. Shader "FOW/Fade In" {
  2. Properties {
  3. _FOW ("Fog of war texture", 2D) = "white" {}
  4. }
  5.  
  6. SubShader {
  7. Tags { "RenderType"="Opaque" }
  8. LOD 200
  9.  
  10. CGPROGRAM
  11. #pragma surface surf Lambert
  12.  
  13. sampler2D _FOW;
  14.  
  15. struct Input {
  16. float2 uv_MainTex;
  17. };
  18.  
  19. void surf( Input IN, inout SurfaceOutput o ) {
  20. float lastFog = tex2D( _FOW, IN.uv_MainTex ).a;
  21. if( lastFog < 0.5 ) {
  22. o.Alpha = lastFog + 0.05;
  23. }
  24. o.Alpha = 1;
  25. }
  26.  
  27. ENDCG
  28. }
  29. Fallback "Diffuse"
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement