As rampant inflation and fears of recession roiled the global economy over the past year, one sector appears to have emerged in relatively good shape: renewable energy.

Costs for wind, solar and other clean energy sources have risen slower than those for fossil fuels, while the amount of investor money flowing into these sectors is for the first time set to exceed funds moving into oil and gas this year, according to research firms.