Scry appears on some spells and abilities with one or more targets. If all of the spell or ability's targets are illegal when it tries to resolve, it won't resolve and none of its effects will happen. You won't scry.
When you scry, you may put all the cards you look at back on top of your library, you may put all of those cards on the bottom of your library, or you may put some of those cards on top and the rest of them on the bottom.
You choose how to order cards returned to your library after scrying no matter where you put them.
You perform the actions stated on a card in sequence. For some spells and abilities, that means you'll scry last. For others, that means you'll scry and then perform other actions.
If you choose zero targets, you'll just scry 1 when the spell resolves. However, if you choose at least one target and all of Glimpse the Sun God's targets are illegal as it tries to resolve, the spell won't resolve and none of its effects will happen. You won't scry in that case.