Robert Nickelsberg / Getty Images Photovoltaic panels track and rotate along the path of the sun in Hinesburg, Vt., on Dec. 24, 2012

On the surface, it looks like the renewable-energy industry has never been healthier. This year, wind-turbine installation in the U.S. actually outpaced the installation of new natural-gas capacity — despite the shale-gas boom, which has pushed down the price of natural gas. In 2012 new wind capacity reached 6,519 MW as of Nov. 30, just edging out gas capacity and more than doubling new coal installations. Meanwhile, new solar capacity in the U.S. reached nearly 2,000 MW, beating out 2011’s numbers. Globally the stock of installed wind and solar power hit 307 GW in 2011, up from 50 GW in 2004, while total investment in the sector hit $280 billion last year. Those are some bright numbers.

Yet there are clouds on the horizon for renewables. (Sorry — weather metaphors are hard to avoid with wind and solar.) The wind industry faces the loss of the valuable production tax credit next year if Congress can’t get its act together to renew it — and indeed, some of the growth the industry experienced this year may be due to companies rushing to get their projects in while the credit is still in place. (And those capacity figures comparing wind to gas or coal are a bit misleading — the intermittency of renewables means that a megawatt of wind doesn’t deliver the same amount of actual juice as a megawatt of gas.) The solar industry faces serious global oversupply, which has driven a number of manufacturers in the U.S. and elsewhere into bankruptcy and helped depress the recent IPO of the major panel installer SolarCity. According to the Financial Times, total investment in wind and solar in 2012 may well fall compared with 2011 — the first time that’s happened in nearly a decade.

So what’s the real forecast for wind and solar power?

(MORE: Debating the New Environmentalism)

That’s dependent — as it always is with the power sector, regardless of whether it’s renewable or not — on policy. For the wind industry in the U.S., continuation of the tax credit would be vital. It pays wind-farm owners 2.2 cents per kilowatt-hour of electricity they produce over 10 years. If Congress fails to renew the tax credit, Bloomberg New Energy Finance predicts installations could fall by 88% next year to just 1.5 GW, at the cost of nearly 40,000 jobs, according to a study sponsored by the American Wind Energy Association (AWEA).

A quick check at the headlines will show how unlikely renewal is in the current political atmosphere. It’s so bad that the AWEA, in an effort to get fiscal conservatives on their side, this month proposed a six-year phaseout of the credit. But while a bill to renew the credit was passed by the Senate Finance Committee in August and is sponsored by a Republican — Senator Chuck Grassley of wind-rich Iowa — little has happened since, and producers are getting ready for the fallout. Already turbinemakers have announced hundreds of layoffs.

As for the solar industry, the low costs for modules that have driven installation are a double-edged sword for manufacturers, who increasingly can’t make money off their products at current prices. That’s also led to something of a trade war — the U.S and Europe have charged Chinese solar manufacturers, with ample help from Beijing, of selling solar modules at below cost. The E.U. opened up an antidumping investigation in September, and the U.S. slapped tariffs on Chinese solar panels. That might be good for domestic manufacturers, but a trade war would likely hold back global growth of solar power.

(MORE: U.S. Slaps Tariffs on Chinese Solar Panels, but the Trade War May Be on Hold)

There is good news, though. Both wind and solar are becoming more competitive against fossil fuels — solar modules are 75% cheaper than they were four years ago, while the cost of wind turbines has fallen by 25% over the past three years. And that’s not just due to government help — technological advances have continued to drive down the cost of renewable energy, and grid parity has already been achieved in some areas. It’s important to remember that a decade ago renewable energy was just a hobby. We’ve come a long way.

That’s why I’m ultimately pretty optimistic about both the immediate and long-term future of renewable energy. There’s still an enormous market out there for new electricity generation, especially in untapped markets like Latin America and the Middle East. Renewable power is an excellent option — sunny Saudi Arabia, for its part, has said it wants more than $100 billion in renewables, while Japan and Germany need renewables to replace forsworn nuclear power. As wind and solar improve, the need for supportive public policy will drop away, like the scaffolding that surrounds a rocket at liftoff. The year 2013 may not be as good for renewables as 2012 — a lot will depend on how the larger global economy fares — but we won’t be going backward.

MORE: Air Pollution Becomes a Major Global Killer