I agree. When it is sunny, I get at least 20 min of sun on my bare skin and in my eyes (not protected from UV by glasses) every other day as recommended by neuroscientist Andrew Huberman. I am however careful not to get a lot more than that at once and have high-UPF clothing, hat and sunglasses to protect myself if I ever do need to be out in the sun for an extended period. (I am of Northern European ancestry.)
Even though I believe that the vitamin D we can buy in bottles is probably just as good as the vitamin D my skin makes, I do not consider vitamin D supplementation an adequate replacement for getting UV light on my skin and in my eyes because vitamin D production is only one of the benefits of getting UV light on the skin and in the eyes. (BTW I think HN put way too much emphasis on vitamin D.)
There are UV light receptors (that use a compound called neuropsin to sense the UV light) on the skin and in the parts of the brain that receive UV light (which gets into the skull mainly through the eyes). These receptors have nothing to do with vitamin D. Getting UV light onto these receptors is a more potent trigger for the release of endorphins in the brain than exercise is.
Regular UV light exposure also increases levels of sex hormones in men and in women. In men, increasing testosterone increases optimism and motivation and drive. Again, IIUC this effect has nothing to do with vitamin D.
When people eat plants, the compounds (e.g., lutein, zeaxanthin and lycopene) that plants use to protect themselves from UV light and blue light tend to be absorbed and to end up in high concentrations in the retina. If you do what I do, namely, get UV light from the sun every other day in moderate doses, then I suggest making sure you are getting plenty of these compounds. (Alexis Cowan says that omega 3 is helpful here, too.)
> I get at least 20 min of sun on my bare skin and in my eyes (not protected from UV by glasses) every other day as recommended by neuroscientist Andrew Huberman
Andrew Huberman peddles nothing more than pop-science supplement grift. I highly recommend you get your health info from somewhere other than bro-optimization podcasts and "light therapy" hucksters.