Added resolution param to generateTexture