split render_tiles into single and multithreaded