Numerous experiments, mostly performed in particular environments, have shown positive diversity-productivity relationships. Although the complementary use of resources is discussed as an important mechanism explaining diversity effects, less is known about how resource availability controls the strength of diversity effects and how this response depends on the functional composition of plant communities. We studied aboveground biomass production in experimental monocultures, two- and four-species mixtures assembled from two independent pools of four perennial grassland species, each representing two functional groups (grasses, forbs) and two growth statures (small, tall), and exposed to different combinations of light and nutrient availability. On average, shade led to a decrease in aboveground biomass production of 24% while fertilization increased biomass production by 36%. Mixtures were on average more productive than expected from their monocultures (relative yield total, RYT>1) and showed positive net diversity effects (NE: +34% biomass increase; mixture minus mean monoculture biomass). Both trait-independent complementarity effects (TICE: +21%) and dominance effects (DE: +12%) positively contributed to net diversity effects, while trait-dependent complementarity effects were minor (TDCE: +1%). Shading did not alter diversity effects and overyielding. Fertilization decreased RYT and the proportion of biomass gain through TICE and TDCE, while DE increased. Diversity effects did not increase with species richness and were independent of functional group or growth stature composition. Trait-based analyses showed that the dominance of species with root and leaf traits related to resource conservation increased TICE. Traits indicating the tolerance of shade showed positive relationships with TDCE. Large DE were associated with the dominance of species with tall growth and low diversity in leaf nitrogen concentrations. Our field experiment shows that positive diversity effects are possible in grass-forb mixtures irrespective of differences in light availability, but that the chance for the complementary use of resources increases when nutrients are not available at excess.