From my experience the strain seems to be the biggest factor for dense buds. I grew several strains outdoors this year and our climate is hot, temps to high 90+, also I did not get constant direct sunlight because of trees and buildings blocking it out. During flowering direct sunlight was down to about 5 to 6hrs. After the buds dried some strains had rock hard dense buds and some strains the buds were a bit looser. All were very thick and dense when harvested. Same strains grown indoors with ideal conditions and the density of the buds were the same as the outdoor buds. With all that said i do believe that temps and light are still factors but genetics is the most important. Get some clones that have consistently produced dense bud from somebody trustworthy.