Calculate viewport and screen texture coordinates correctly for sun shadows.  This fixes part of #5889.