posterize2.glsl 225 B

12345678910111213141516171819
  1. float bound(float color)
  2. {
  3. if (color < 0.35)
  4. {
  5. if (color < 0.25)
  6. return color;
  7. return 0.5;
  8. }
  9. return 1.0;
  10. }
  11. void main()
  12. {
  13. float4 c0 = Sample();
  14. SetOutput(float4(bound(c0.r), bound(c0.g), bound(c0.b), c0.a));
  15. }