// It may not look pretty but it's actually fairly efficient vec4 CRT(vec4 input_colour) { float intensity = 0.225; vec4 returnCol = input_colour; if ((positionY - 0) % 3 == 0) { if ((positionX - 0) % 3 == 0) returnCol = mix(input_colour, vec4(1.0, 0.0, 0.0, 1.0), intensity); if ((positionX - 1) % 3 == 0) returnCol = mix(input_colour, vec4(0.0, 1.0, 0.0, 1.0), intensity); if ((positionX - 2) % 3 == 0) returnCol = mix(input_colour, vec4(0.0, 0.0, 1.0, 1.0), intensity); } if ((positionY - 1) % 3 == 0) { if ((positionX - 0) % 3 == 0) returnCol = mix(input_colour, vec4(0.0, 1.0, 0.0, 1.0), intensity); if ((positionX - 1) % 3 == 0) returnCol = mix(input_colour, vec4(0.0, 0.0, 1.0, 1.0), intensity); if ((positionX - 2) % 3 == 0) returnCol = mix(input_colour, vec4(1.0, 0.0, 0.0, 1.0), intensity); } if ((positionY - 2) % 3 == 0) { if ((positionX - 0) % 3 == 0) returnCol = mix(input_colour, vec4(0.0, 0.0, 1.0, 1.0), intensity); if ((positionX - 1) % 3 == 0) returnCol = mix(input_colour, vec4(1.0, 0.0, 0.0, 1.0), intensity); if ((positionX - 2) % 3 == 0) returnCol = mix(input_colour, vec4(0.0, 1.0, 0.0, 1.0), intensity); } return returnCol; }
0 Comments
Leave a Reply. |
AuthorHi there, the name's Matthew Jenkinson and I'm currently working at Firesprite. In my spare time I work on programming projects like you see here. Archives
March 2021
CategoriesLinks to each effect in order:
|