In certain embodiments, a device comprises a laser device and a control computer. The laser device directs a laser beam with laser energy through an outer portion of an eye to a target portion of the eye. The control computer receives an optical density measurement of the outer portion, determines the laser energy according to the optical density measurement, and instructs the laser device to direct the laser beam with the laser energy through the outer portion of the eye to the target portion of the eye.