created function to generate a frag shader based on the number of tiles