Most of the fly larvae in my compost pile are basic maggots with not much visible structure.
But I recently had occasion to put some freshly hatched Black Soldier Fly larvae under a microscope, and I was surprised to see that they have two prominent eyespots.
In retrospect this makes sense. I' have previously noticed that large larvae of this species will quickly dive for cover when exposed by moving stuff over them, so it seems they might have pretty good light sensors. But larger larvae are also colored an opaque dark gray, which makes the eyes much less obvious. So, I've never really thought of large BSFL as having significant eyes, even though I'm pretty sure that when I look again I'll see that they were there all along.
Anyway, here are several views of a live larva as it wanders around in a shallow bath of water.
All of the above were extracted from video shot at 1920x1080 using a finite 10X NA 0.3 objective, direct projected onto the camera sensor in a microscope with condenser. Image contrast decreased significantly from start to finish, which I'm guessing is due to condensation on the front of the objective.
Here is a much closer view of a preserved specimen, presented as crossed-eye stereo:
For this last view, the specimen was transferred directly from water to 95% ethyl alcohol, left there until it stopped moving, then sandwiched between two cover slips still soaked in alcohol. The sandwich was placed on a regular microscope slide, oriented to place the larva dorsal side toward the camera. I had to periodically replenish the alcohol while setting up the shot, but there was plenty of time for the several minutes that it took to shoot a stack of 41 frames with 0.001 mm stack depth. Canon R7 camera, Mitutoyo M Plan Apo 20X NA 0.42 on Raynox DCR-150, transilluminated by Jansjö LED bounced off an index card, ISO 100, 1/15 second full electronic shutter. Synthetic stereo at +-6 degrees off axis.
Comparing the preserved specimen with what I see in the live video, I think the refractive dome over the eyespot has been collapsed by dehydration. There is much room for improvement in this process.
Regarding the eyespot, this is what the literature refers to as an "ocellus". I was hoping to find a lot more information in the article titled "Morphological description of the immature stages of Hermetia illucens (Linnaeus, 1758) (Diptera: Stratiomyidae)", Barros et.al. 2018 (HERE), but it basically just says that they exist, one on each side of the head.
Images taken in a controlled environment or with a posed subject. All subject types.