That may be mostly true, but supplementation can definitely help at least somewhat. Speaking from personal experience here. In my case it did a lot, but still only goes so far, and there seem to be other factors. I'm still trying to work it out.
Check for a Vitamin D deficiency, that can have a lot to do with it. Magnesium can help, iodine can help. It can also be a digestive issue that prevents uptake of nutrients. Eating a crappy diet can also deplete nutrients. Ideally one of these things already leads to a lot of improvement, otherwise it is down to experimentation with other things, or fixing some other underlying issue. It's not easy, but it is worth every effort.
Good points. If you have the option, definitely go for actual sunlight! In the north in winter it's hard though, and that's where supplementation can come in. Or cod liver.