If for whatever reason you happen to be in your underwear (just woke up, just took a shower, etc), are you allowed to say berachot (such as asher yatzar or shehakol on water) before getting fully dressed?
This article summarizes the rules of dress for both men and women required for saying brachot. There are footnotes to sources, as well. Excerpts:
Another aspect of “holiness” when saying a bracha is that a man is required to have a “separation between his heart and his lower body.” This typically requires no special attention, as it is accomplished by wearing a belt, pants or underwear. However, if a man is at home wearing just a bathrobe, he would need to tie the robe’s belt, in order to create a separation between the heart and lower body.
Although, not directly addressing your question, I've included the next paragraph for general interest. If it's unuseful, comment or you may edit my answer and delete it.
It is improper to say a bracha with one’s top half uncovered, unless there is no realistic option. Joe is sitting at the beach in his bathing suit and wants to say a bracha on a nice cold drink. This is permitted, since his private parts are covered by a bathing suit, which also acts as a separation “between his heart and lower body.” If possible, Joe should use a towel or t-shirt to also cover his upper half.
While the 2nd quote discusses the bracha aspect, if you were sitting on a public beach this way, you're prob. not dressed tzniutly, anyway, so I would recommend waiting to make a bracha until you are.