Toying around with a space scene and I'm working on getting the flare to occur when the sun spot is near the center of the screen (full intensity) and deminish with the distance from center.

I don't want it to occur from the edges of the screen though, I only want to fade the flare in and out based on a region smaller then the screen. If the screen is 640 by 480, then the point in which the flare would begin is when the sun spot passes into a 320 by 240 region (centered).

The flare intensity should be 0 outside of the region, and 1.0 at dead center.

Any one know a good formula?