What do you mean, rendered in the viewport? You can turn on viewport ambient occlusion by clicking the little panel icon that looks like ambient occlusion.