fs2open.github.com icon indicating copy to clipboard operation
fs2open.github.com copied to clipboard

Supernova sun glare and fade regressions

Open Goober5000 opened this issue 3 years ago • 12 comments

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...

  1. 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_spot variable is supposed to color the screen using the same mechanism as the red "pain flash".
  2. The glare is a lot more dramatic in the retail letterbox scene than the FSO letterbox scene.
  3. 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.
  4. 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:

  1. Disabling light shafts when a supernova starts could abruptly remove any lightshafts currently on the screen.
  2. During the letterbox scene, the entire screen faded to white, not just the part inside the letterbox.

sup1 sup2 sup3 sup4

Goober5000 avatar Apr 08 '22 04:04 Goober5000

With the merge of #4153 the glare now behaves properly, but the two deficiencies mentioned in the top post still need to be resolved.

Goober5000 avatar Apr 09 '22 17:04 Goober5000

I have an idea or two to try, no promises they'll pan out

EatThePath avatar Jun 06 '22 14:06 EatThePath

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?

EatThePath avatar Jun 13 '22 00:06 EatThePath

The glare should tint the screen even if the player is facing directly away from the sun. See the first screenshot from retail.

Goober5000 avatar Jun 13 '22 05:06 Goober5000

If the light-shafts feature is disabled entirely from user settings, does deficiency 2 still occur?

z64555 avatar Jul 23 '22 13:07 z64555

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?

z64555 avatar Jul 23 '22 14:07 z64555

Punting issue to 22.4 due to time constraints.

z64555 avatar Jul 25 '22 12:07 z64555

What's the feasibility of this being fixed in the next two to three weeks?

TRBlount avatar Dec 29 '22 20:12 TRBlount

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.

z64555 avatar Dec 30 '22 04:12 z64555

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.

Goober5000 avatar Dec 30 '22 18:12 Goober5000

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.

MoerasGrizzly avatar Jan 09 '23 14:01 MoerasGrizzly

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.

Goober5000 avatar Jan 21 '23 22:01 Goober5000