[VIDEO + IMAGES] Help Me Solve This (Probably Simple) shader math problem?

Hey Kashaar, I replied on Facebook too but I’ll also post here just so everyone’s on the same page :slight_smile:

I actually originally tried a sprite, but the problem is, as the distance between you and the object increases or decreases, the relative sizes of the two change completely. This is I suspect just because of the way the camera’s FOV works, but as you get closer, the sphere takes up more of the screen space and completely hides the sprite. At more glancing angles or when the sun is near the edge of the screen, some of it is also hidden too. Just the way the camera-facing math works.

This is why I turned to a sphere. You can see the effect at an equal distance from the sun at all angles then, but obviously it’s just this issue of distortion as you move around. What I need to do is literally map a gradient on the sphere that always lines up to the screen-space X and Y positions, and always ranges from 0 > 1. I thought normalizing the screen-space UV’s on the object would work, but of course, it just normalizes each pixel individually, not the object as a whole. That’s where I’m struggling.