Advertisement
Guest User

Untitled

a guest
Oct 17th, 2015
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.63 KB | None | 0 0
  1. texture tex0;
  2. sampler sBase=sampler_state{Texture=(tex0);};
  3. float Angle = 0.0;
  4.  
  5. #define PI 3.14159265f
  6.  
  7. float4 ps1(float2 Base:TEXCOORD0):COLOR
  8. {
  9.     float4 color = tex2D( sBase, Base.xy );
  10.     if( color.a != 0.0)
  11.     {
  12.         float2 vec1 = float2( 0.5, 1.0 );
  13.         float2 vec2 = normalize( float2( 0.5 - Base.x, 0.5 - Base.y ) );
  14.         float VecAngle = PI + atan2( vec1.x * vec2.y - vec1.y * vec2.x, dot( vec1, vec2 ) );
  15.         if( VecAngle > radians( Angle ) )
  16.             color.a = 0.0;
  17.     }
  18.     return color;
  19. }
  20.  
  21. technique remover
  22. {
  23.     pass p0
  24.     {
  25.         PixelShader=compile ps_2_0 ps1();
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement