Think about how much luckier we are that air is transparent!
I suspect it is not possible to evolve to detect X-Rays given the basic building blocks life has to work with, but yes your general idea is right. Vision has evolved independently at least half a dozen times because of this selection pressure.
Other wavelengths may have issues with detection or the information provided; if something can cut through obstructions in the atmosphere it may be hard to grow cells which interact with it or the rays may also ignore whatever is present locally at most scales.
The eye might be reduced in detail to the same domain as hearing or smell.