Renewable power is taking off around the world and fast approaching a tipping point in its development. Consider these recent developments:

A report from the McKinsey Global Institute published this week, “Beyond the supercycle: How technology is reshaping resources,” estimates that renewables, primarily solar and wind, could jump from 4% of global power generation today to as much as 36% by 2035, reshaping global electricity markets in the process.

Technological advances are driving these developments. The rapid growth of renewables is part of a bigger trend of rising global energy productivity. Increased energy efficiency in residential, industrial and commercial buildings, lower demand for energy in transportation due to the rise of electric and autonomous vehicles and ride sharing as well as falling costs and greater penetration of renewables is transforming the way we consume energy.

As a result of these developments, we calculate that the growth of primary energy demand worldwide will slow and could even peak in 2025 if new technologies such as robotics, data analytics and the Internet of Things are adopted rapidly. Global demand for oil and coal will most likely peak and could decline over the next two decades.

But there are regional differences. For example, the United States, China, and India are major consumers of oil. But while demand is likely to continue growing strongly in China and India due to a rapidly emerging middles class, it could slow in the U.S. due to increased energy efficiency and shifts in transport.

Renewable energy, particularly solar and wind, grew rapidly during the 2003-2015 commodities “supercycle” as people searched for alternatives to high-priced oil and gas. Since 2001, total solar generation worldwide has grown 50% annually while wind-power generation has grown at an annual rate of 24%. China is aggressively investing in renewables and is the leading investor in renewables in the world.

While government policy to diversify energy sources has driven much of this near-term growth, a sharp fall in technology costs has accelerated the deployment of renewables to the point where in some regions they now can compete with coal or gas without subsidies. The cost of solar modules worldwide has fallen 80% since 2008, and the levelized cost of energy for wind has fallen 50% since 2009. In recent power auctions for new construction in South America for example, solar photovoltaic (PV) installations have come in at below $0.03/kWh unsubsidized—about one-tenth the cost of solar plants six years ago.

American Wind Energy Association

A global tipping point could be reached in 2025, when solar PV and wind power could become competitive with the marginal cost of natural gas and coal production, accelerating the transition. Growth rates in renewable power deployment would likely accelerate after that.

Research and development has found new ways to improve efficiency, including with back contact cells for solar PVs (cells without electric contacts on the light-collecting side), improved thin film materials for solar PVs, and modulating blade position in real time for wind. Efforts are also under way to reduce material costs by creating less waste, for example with kerfless wafers, which require no saw to cut a silicon wafer off a large ingot, and to extend the lifetime of the equipment. This includes efforts to improve manufacturing quality to reduce defects in solar panels and increase use of predictive maintenance on wind turbines to ensure efficiency for as long as possible.

Soft costs associated with installing panels and turbines are likely to continue falling, too. Installers will continue to develop more efficient methods. The potential for breakthroughs in solar PV technology, such as next-generation thin film materials, reduced capital intensity of manufacturing capacity as well as continued improvements in the scale and capacity factor of wind technology means the levelized cost of energy could continue to fall.

One of the big issues for renewables are the technical limits of intermittent power in the grid—that is, power that cannot be dispatched at will and is not generated in a continuous fashion. When renewables hit those limits, the energy they produce will need to be stored.

But this is an obstacle that can be overcome, this time with technology from the consumer electronics sector. The levelized costs of storage have been declining rapidly, and a number of promising technologies are being developed to store energy in a cost-effective manner, such as through grid-scale lithium ion batteries, flow batteries, compressed air systems, and thermal storage.

Technological developments tend to outperform expectations and surprise with their upside and speed. In the case of renewable energies and the resource sector, the winds of innovation are gusting through.

Jonathan Woetzel is a director of the McKinsey Global Institute and senior partner of McKinsey, based in Shanghai. Matt Rogers leads McKinsey’s Sustainability and Resources practice and is a senior partner of the Firm, based in San Francisco.