Simple_fp.cg 488 B

1234567891011121314151617181920212223
  1. //
  2. // Simple Fragment Program
  3. //
  4. // - Just do a simple remap of RGBA
  5. //
  6. // Note: For OUT.color.a < 1 to work, you need
  7. // to set the blending mode of the material
  8. // that uses the shader to bmTransparency so
  9. // that blending is switched on.
  10. struct FragOut {
  11. float4 color : COLOR;
  12. };
  13. FragOut main(float4 color : COLOR)
  14. {
  15. FragOut OUT;
  16. OUT.color.rg = color.gg; // Red, Green channels <- Green value
  17. OUT.color.ba = float2(0.3, 1); // Blue <- 0.3; Alpha <- 1
  18. return OUT;
  19. }