You can turn underground farming on in settings but that makes it so you can farm below sea level. As long as you are above sea level you can grow things. The direct sunlight part I believe is if you want the greenhouse effect to have a longer growing season by making a glass roof on the building. I did find out while building that glacier ice acts like glass for a green house. My house is much too big to count as a greenhouse, but it makes a really cool roof that lets light in.