5 minutes
The Sun's Flare
There is a sun in this scene, and it reads as a bright circle stuck to the sky. A real light does more to a camera pointed near it: the chain of coloured ghosts across the frame, the halo, the wash as it clears an obstruction. All of that is missing, and it is most of what makes a light feel like a source rather than a decal.
A flare doesn't know where the sun is
The effect is a post-process. After the frame is rendered, it scans the image for pixels above a brightness threshold and derives everything from them: a chain of ghosts spaced along the line through screen centre, a halo, an optional anamorphic streak, a prismatic fringe.
Nothing in that description mentions the sun. The shader has no sun position, no light handle, no scene knowledge at all. It has an image, and that is a feature: put two suns in the sky and both flare, fly through an explosion and the explosion flares, with no extra code. The effect is a property of the picture, exactly as it is in a real lens.
Continue reading
Unlock the Full Course
Every lesson, the runnable examples, and the finished build — yours to keep.