A shader is a set of instructions that are executed simultaneously for each pixel on the screen. It can produce different color result depending on the pixel data such as position on the screen.
Use the x
component of the pixel's normalized coordinates as the red and the y
component as the green when writing pixel's color. As a result, you should notice that the intensity of the red color increases from left to right, and the intensity of the green color increases from bottom to top. In the upper right corner we get yellow color as a result of mixing green and red.