Nikon D5100 Teardown
The red tinted glass is a light filter known as a "hot mirror". The image sensor in digital still cameras is sensitive to the near-infrared spectrum (720nm or so). The hot mirror filters out this near infrared light so that it doesn't cause odd tints in your pictures. Incidentally, cameras which have been converted for IR photography have this filter replaced with one that does the opposite, so that only infrared light will reach the sensor.