We optimize modulation formats for the additive white Gaussian noise channel with nonnegative input, also known as the intensity-modulated direct-detection channel, with and without confining them to a lattice structure. Our optimization criteria are the average electrical, average optical, and peak power. The nonnegative constraint on the input to the channel is translated into a conical constraint in signal space, and modulation formats are designed by sphere packing inside this cone. Some dense packings are found, which yield more power-efficient modulation formats than previously known. For example, at a spectral efficiency of 1.5 bit/s/Hz, the modulation format optimized for average electrical power has a 2.55 dB average electrical power gain over the best known format to achieve a symbol error rate of 10 −6 . The corresponding gains for formats optimized for average and peak optical power are 1.35 and 1.72 dB, respectively. Using modulation formats optimized for peak power in average-power limited systems results in a smaller power penalty than when using formats optimized for average power in peak-power limited systems. We also evaluate the modulation formats in terms of their mutual information to predict their performance in the presence of capacity-achieving errorcorrecting codes, and finally show numerically and analytically that the optimal modulation formats for reliable transmission in the wideband regime have only one nonzero point.