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

FR: Add improved contrast options for HUD

Open Kiloku opened this issue 4 years ago • 6 comments

Some HUD elements become hard to see against certain the background of certain missions, or against certain objects, even with the "High Contrast" mode.
The simplest solution would be to add a stroke or a "drop shadow" in contrasting color to the HUD elements.
This would probably need to be a command line option. The color of the stroke or shadow could either be set in the command line as well, or default to the most contrasting color to the HUD element's color.

Doing it as drop shadow would probably not be difficult from what I can tell of HUD code. Doing it as a stroke would probably require applying a shader to each HUD element.

Kiloku avatar Oct 09 '21 14:10 Kiloku

Drop shadow is probably easiest to do. Just take the HUD element, darken it, and offset it a few pixels towards a corner, then draw the HUD element as normal on top of it.

Now the problem is... Should this be an engine feature or should it be baked into HUD assets by the modder? If an engine feature, the commandline option is currently the fastest way to get such a feature in, but if you want it so that the players can adjust it you'll have to use the new SCP menu UI.

z64555 avatar Oct 12 '21 00:10 z64555

Aren't HUD assets limited in their color palette? Could an edited HUD texture have a functional drop shadow?

Kiloku avatar Oct 12 '21 02:10 Kiloku

The HUD currently allows both increased contrast and drop shadow enabled with a keybind. Is this asking for more than that?

MjnMixael avatar Apr 16 '25 20:04 MjnMixael

The FR mentions strokes and dynamically changing the colors of the shadows/strokes if needed. My favorite solution would be a stroke around the text and UI elements, but I don't know how feasible this is (I guess we'd have to make a shader that dynamically generates distance fields?). Regardless, I believe that the drop-shadows are good enough for most of the use-cases.

Kiloku avatar Apr 16 '25 20:04 Kiloku

Ah, the PR for the drops shadows also mentions something else that I think would be very good, but maybe could be a separate Issue:

Allow HUD elements to be fully opaque (currently even with alpha at 255 and High Contrast mode, they'll be slightly transparent due to how aabitmaps work

Kiloku avatar Apr 16 '25 21:04 Kiloku

That all seems like overkill to me. I feel like the current options handle the needs but I suppose it won't hurt anything if a developer someday wants to implement all that.

MjnMixael avatar Apr 16 '25 21:04 MjnMixael