Enhancement of optical gain of semiconductors embedded in three-dimensional photonic crystals