The F-35 Lightning II pilot's helmet is made of carbon fiber and Kevlar; the lens on the visor is made of a strong polycarbonate for impact protection.

WASHINGTON — The F-35 Lightning II is one of the most complicated weapons systems ever developed, a sleek and stealthy fighter jet years in the making that is often called a flying computer because of its more than 8 million lines of code. The Joint Strike Fighter comes in three versions, including one that is designed to take off and land on an aircraft carrier and another that lands vertically, as if it were a helicopter.

But to truly understand the most expensive weapons program in the history of the Pentagon, forget the plane for a minute. Consider the helmet.

It’s designed to protect the pilot’s head, of course. But compared to everything the helmet does, protection becomes something of an afterthought.

The helmet sees through the plane. Or rather it helps the pilot see through the plane. When the pilots look down, they don’t see the floor of the plane; they see the world below them. If the pilots look back, they see the sky behind them. Embedded in the skin of the aircraft are six cameras, and when the pilots move their heads to look in a particular direction, they are actually seeing through the corresponding camera, which sends an image to projectors inside the helmet that beam an image of the outside world on the helmet’s visor.

Which makes the visor not really a visor. It’s a screen that posts information the way some cars are now posting fuel and gas mileage on the windshield in what’s called a heads-up display. But beyond speed and altitude, F-35 pilots would see things such as the location of enemy aircraft or weapons on the ground.

"When the helmet’s tuned correctly to the pilot’s eyes, you almost step into this other world where all this information comes in," said Al Norman, an F-35 test pilot for Lockheed Martin, the prime contractor. "You can look through the jet’s eyeballs to see the world as the jet sees the world."

Like the plane, the helmet is enormously expensive. The cost of each custom-made helmet is more than $400,000. And like the plane, which is years behind schedule and millions over its original budget, the helmet has encountered problems.

Earlier versions were jittery when the plane hit turbulence. There was a latency in the video, which caused pilots motion sickness. The night vision technology didn’t work as well as it should have. There was a "green glow" that obscured the pilots’ view. Things got so bad that in 2011 the Pentagon hired BAE Systems to build a back-up helmet in case the one in development couldn’t be rescued.

Two years later, it decided to go with the one being built by Rockwell Collins, saying that the competition helped get the program back on track and solve the problems. The program’s executive officer, Air Force Lt. Gen. Chris Bogdan, recently told reporters that the helmet, once a concern, was no longer "on my top 10 worry list."

Pilots have recently started flying tests with the third iteration of the helmet, which has a new night vision camera and software improvements. But there have also been problems with the software that gathers information and then shares it among the F-35s flying together in formation, Bogdan said.

If one or two jets are flying together, they have been able to share information seamlessly, he said. But when there are four jets, communication problems emerge, which can "create an inaccurate picture for the pilot," he said.

The issue won’t affect the jet’s delivery date or combat readiness, he said, and should be fixed shortly. But it will cost prime contractor Lockheed Martin a portion of its $300 million incentive fee.

Recent flights have shown that progress on the helmet is continuing as well, Norman said. Many of the previous issues have been resolved, but there are still issues with the green glow, and the way the pilots see the images projected on the visor.

"There’s still a little bit of tweaking we might want to do with how we stitch together the imagery," he said. "Testing is an ongoing process. And if you find problems we try to fix them and look ahead."

