Cycling shorts are meant to sit on your skin and protect you so do not wear any underwear below them. Wearing an underwear underneath your cycling shorts is counter-productive as it just adds further seam lines that can cut down on blood flow and increase irritation by not absorbing sweat properly. Padding is one of the most important components of bike shorts if not the most important. Make sure that the padding is thicker towards the center, good padded shorts will be able to absorb much of the shock and reduce the stress your body is putting on the perineum as you shift your weight while pedaling.
A thickened gel pad is preferable over foam if you are riding long distances as gel tends to last longer keeping its compression property intact.
Cycling shorts are meant to fit you perfectly while riding, this is achieved with spandex, a material that can stretch as per your body movement when pedaling. The polyester interlaced with the spandex wicks out dampness and lets your skin respire.