Supernova sun glare and fade regressions
There are a few regression bugs that were introduced at some point -- including but possibly not limited to ffc14f5d9e52de58008de2998c6c641c656886ae -- related to how the sun glare is treated during the supernova impact.
The attached image sequence shows what it looks like in retail...
- When the supernova is close, the glare should affect the whole screen even when the player is not looking at the sun. This does not currently happen in FSO. The
Sun_spotvariable is supposed to color the screen using the same mechanism as the red "pain flash". - The glare is a lot more dramatic in the retail letterbox scene than the FSO letterbox scene.
- In retail, the glare always affects the camera's view of the player. In FSO, this does not happen unless the sun happens to be near the camera's view direction.
- The screen fades to white in retail. In FSO this is again dependent on the camera direction.
Part of this is due to the introduction of light shafts in the above referenced commit. When I modified gr_lightshafts_enabled() to return false if a supernova was in progress, this almost entirely fixed the problem - the glare behaved as it was supposed to. However there are still two deficiencies:
- Disabling light shafts when a supernova starts could abruptly remove any lightshafts currently on the screen.
- During the letterbox scene, the entire screen faded to white, not just the part inside the letterbox.

With the merge of #4153 the glare now behaves properly, but the two deficiencies mentioned in the top post still need to be resolved.
I have an idea or two to try, no promises they'll pan out
Okay my attempt didn't work. should the glare be visible when you're looking directly away from the star, or just when it's only slightly off screen?
The glare should tint the screen even if the player is facing directly away from the sun. See the first screenshot from retail.
If the light-shafts feature is disabled entirely from user settings, does deficiency 2 still occur?
I'm guessing that the cutscene bars (aka the letterbox) are being rendered before the whiteout glare is done.
So far I've found the call to draw the bars in freespace.cpp:4044 which is clip_frame_view(), but haven't found the call to draw the glare.
Edit: Ok, found where it calls the block which eventually does glare... which is the function call immediately above clip_frame_view(). So that rules that theory out.
So... perhaps its a post-processing issue? I noticed the post-proc render frame is near the end of game_frame() at 4109?
Punting issue to 22.4 due to time constraints.
What's the feasibility of this being fixed in the next two to three weeks?
Somebody familiar with the graphics code may be able to knock it out within a week, but all the same, the source of the regression needs to be tracked down.
A git-blame strategy may also work well for somebody that can compile and test the mission quickly.
The source of the regression is almost certainly one of the major graphics upgrades, which means solving this isn't going to be simple as finding a section of code and reverting it. Someone will need to figure out how to reproduce the original effect with the new code.
Just adding my two cents into this: When you disable lightshafts per engine, since FSO 22.0, there's no in-mission sunglare at all. So it'll most likely not be limited to just supernovas.
Hmm. The term "glare" is used for both, but the sun brightening as part of the supernova effect is not the same thing as the sun brightening when the player looks at it. They are, in fact, handled in two distinct branches of an if() statement.