The windshield on your racecar can range from simple to complex, but it has a seemingly simple job. Its function, of course, is to keep foreign objects from entering the driver's compartment and to provide the driver with a safe, unobstructed view of the racing surface.
No circle track racer should be using the safety glass that is OEM (Original Equipment Manufacturer) on the family auto that the racecar may be based on. That's due to the safety issues with having glass anywhere on the car. But the racer still needs something to help keep the majority of the "stuff" on the track from getting inside the car and entering the driver's compartment.
We start to see a different approach to protecting the driver based on the surface you race on. If you race on dirt, the windshield is not really a windshield in the truest sense of the word but more of a windscreen that deflects debris, or at least slows it down, rather than completely eliminating debris from entering the driver's compartment.
To protect the driver from...
To protect the driver from the sun and dirt, the crew on this Dirt Late Model has fabricated a sun shade from plastic...
If you race on the paved tracks, depending on the class, you still may not have a windshield. The faster the car, the more likely you will be using what we would consider a windshield. More than likely it will be made from polycarbonate or what we know as the GE brand name of Lexan, an incredibly strong plastic-type material. Lexan is very light in comparison to glass and has the ability to be worked much like a metal insomuch that it can be bent like sheetmetal. Many helmets have the face shield constructed from Lexan. You will find Lexan windshields on cars in NASCAR's top three divisions and on cars at the ARCA level. Legends Cars also have Lexan windshields. However, at the local short track, the majority of the cars will have a windscreen of some type.
If you look at a Dirt Late Model you will find some variation in the windshield department. Some cars have a sheetmetal ramp that leads to a fabricated screen that resembles the grill on a barbeque or the shelves in a refrigerator. While they may look similar, they are far from barbeque grills. These windscreens are more of a mud guard than a windshield. Given the surface these cars race on, dirt, the intent is to prevent any large rocks or clumps of mud from hitting the driver. These screens are easy to clean and their open nature makes it very easy for the driver to maintain a good level of visibility.
...and a small plastic windshield,...
...and a small plastic windshield, all in addition to the steel guard tubes.
Other cars will have a much more abbreviated windscreen just in front of the mud guard or grill. These screens look more like a fairing you would see on a motorcycle. They provide a bit more protection than the guard alone and may offer some sort of improved deflection while the car is at speed due to air currents coming off of the windscreen.
Other cars will have the same type of deflector, and some racers will install an open wire mesh or a very open wire screen on top of the grill. This type of screen is often seen on Street Stocks and some of the cars that race at slower speeds. These cars do not generate the speed to help "blow" the mud off of the car. And they seem to race in conditions that find the car covered in large quantities of mud, as they seem to be the cars that get sent out to pack the mud when the track is the messiest.

This car has a sheetmetal...

This car has a sheetmetal deflector built into the body and a set of tubes welded onto the chassis to help keep the mud and debris away from the driver. Simple, elegant aAnd a well-executed design.

These bars are in front of...

These bars are in front of the plastic deflector. As referenced by the mud and dirt residue, there is still a good bit of dirt reaching the driver.

Notice how the Lexan windshield...

Notice how the Lexan windshield is bolted in place on this Legends Car. If this car were to race on dirt, the Lexan windshield could be removed and a steel mesh and grill could be bolted in place.