Characteristics of the hexagonal polymorph Si3N4 i.e., phase transition, electronic and optical properties (band structure, dielectric function, reflectivity and energy loss function) are investigated by the first-principles pseudo-potential method. The results suggest that it is feasible that the P6 transition takes place at room temperature. The critical pressures of the P6 and P6 transformations are 42.9 and 47.7~GPa, respectively. The phase transition from P6 is accompanied by the volume shrinkage. The calculated results also show that the P6 and P6' phases belong to direct bandgap and indirect bandgap semiconductors, respectively. The calculated band gaps are 4.98 and 4.01 eV for the P6 and P6' phases, respectively. Besides, the static dielectric constants are also obtained. The reflectivity shows that the two phases can serve as the shielding and detecting devices for ultraviolet radiation and they have optical transparent behaviors in the visible light region.