I suppose this is more of a math question than anything.
Here is a basic shader:
void mainImage( out vec4 fragColor, in vec2 fragCoord ) { // Norma