One shouldn't assume that the body of the first creature to start developing a light sensitive cluster of cells had an opaque body. An animal with a transparent body could have light sensitive cells as part of their nervous system, they would only need to migrate near the surface when the body becomes opaque.