Fruiting vegetables, such as tomatoes, peppers, beans, squash, melons, cucumbers, and eggplant, need at least 6 hours of direct sun a day for good yields. The amount of sun doesn’t have to be continuous though. You can have 3 hours in the morning with some shade midday and then 3 more hours in the late afternoon.