Sharper image without the edge artifacts

Split the code into different parts.

Also found a strange bug with TexelScale. It becomes wrong if you turn r.screenPercentage up and then back down again. Restarting the editor resets it to normal.