All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
Covering the ‘Awrah (those parts of the body which must be covered: a man must cover his body from the navel to the knee and a woman must cover her whole body) is an important condition in prayer. Allah Says (what means): {O children of Adam, take your adornment at every masjid.} [Quran 7:31] Ibn ‘Abbaas said the meaning of “adornment” in the verse is dressing for the prayer. The Prophet Muhammad said: “Allah would not accept the prayer of a pubescent woman without a veil.” Scholars have agreed upon that the prayer will be invalid if a person performs it without clothing as long as he is able to cover himself. For sure, garments should not be transparent. If the dress is covering the whole ‘Awrah and it is not diaphanous, then the prayer could be performed in it.
For more benefit on praying in underwear, please refer to Fataawa 81473, and 85302.
Allah knows best.