The problem of "unlimited energy generator" of the sun is that on the ground it is intermitted based on day/night and clouds, meaning we would have to create a surplus of energy during the day and store it for later use. We have been working on batteries, but there has been promise at using air or water "batteries" as well via compressed air or Pumped Storage Hydropower (PSH).
I would highly recommend reading both Bill Gates's How to Avoid a Climate Disaster and Vaclav Smil's How the World Really Works, both of which have really shown what needs to happen to solve both our climate and energy problems going forward.