First-principles investigation on optical properties of GaN and InGaN alloys