Don't forget to normalize viewdir