Advertisement
Guest User

HLSL snippet

a guest
Jun 1st, 2014
3,453
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. sampler2D input : register(s0);
  2.  
  3. float4 main(float2 uv : TEXCOORD) : COLOR
  4. {
  5.  
  6. //colorin is the original color of the pixel, colorout the altered color
  7.  
  8. float4 colorin, colorout;
  9. colorin = tex2D( input , uv.xy);
  10. colorout = colorin;
  11.  
  12. if((colorin.g + colorin.b) < colorin.r )
  13. {
  14. colorout.r = colorin.r;
  15. colorout.g = 0;
  16. colorout.b = 0;
  17.  
  18. }else
  19. {
  20. colorout.rgb = dot(colorin.rgb, colorin.rgb ) * dot(colorin.rgb, float4(2, 1, 2, 1) );
  21. }
  22.  
  23. return colorout;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement