✔️ NEW FEATURE: Two Horizon Colors (ADF/TAW)

Eggheads talking about bytes and stuff.
Post Reply
User avatar
Krishty
Site Admin
Posts: 1364
Joined: 2022-Jan-09, 00:59

✔️ NEW FEATURE: Two Horizon Colors (ADF/TAW)

Post by Krishty »

TFXplorer already supports two horizon colors: One towards the Sun and one opposed to it.

At the moment, this feature is used exclusively by Ace Combat 3, which uses it heavily in its missions to improve situational awareness.

But we know that it was implemented experimentally in f22, too. Specifically, this old screenshot from Polak exists (source):
Image

F22 calls it East/West palettes. From redxxxx.txt:

Code: Select all

;────────────────────────────────────────────────────────────────────────
; new palette commands
; <east_palette> <start_altitude> <end_altitude> <west_palette>
; nb. (1) The altitude is specified in feet
;     (2) If no west palette is given only one
;             palette will be used within the altitudes.
;────────────────────────────────────────────────────────────────────────
Even without East/West palettes being active, this feature can easily be enabled in TAW by setting the sun color for second horizon color. It seems the sun color is always at index 255. Multiply by 1.5 to brighten it up. This gives a really nice effect:
2024-01-13 two sky colors in TAW day.png
2024-01-13 two sky colors in TAW day.png (379.99 KiB) Viewed 1214 times
2024-01-13 two sky colors in TAW dusk.png
2024-01-13 two sky colors in TAW dusk.png (364.32 KiB) Viewed 1214 times
There is one situation, however, where it is not nice – at night. The Moon is too bright in TAW, most likely due to it being programmed before linear color space was established.
2024-01-13 two sky colors in TAW night.png
2024-01-13 two sky colors in TAW night.png (243.36 KiB) Viewed 1214 times
So this feature could be implemented and it’s only a few lines of code, too. In DIDtoUAW F22 scenarios.cpp, in getSkyColors(), replace

Code: Select all

store(result->horizonSunny, GFX::linearFrom(load(palette[143])));
with

Code: Select all

store(result->horizonSunny, GFX::linearFrom(load(palette[255])));
result->horizonSunny.red *= 1.5f;
result->horizonSunny.green *= 1.5f;
result->horizonSunny.blue *= 1.5f;
Some kind of if should be added to tell night apart from day, and to make horizonSunny darker instead of light then:

Code: Select all

if(utc.i17f15 < 6 * 60 * 60 * 32768 || utc.i17f15 > 22 * 60 * 60 * 32768) // before 6 or after 22?
This seems like a low-hanging fruit. But I’ll postpone it because I have too much stuff to fix right now.
User avatar
Krishty
Site Admin
Posts: 1364
Joined: 2022-Jan-09, 00:59

Re: 💡 OPEN FEATURE: Two Horizon Colors (ADF/TAW)

Post by Krishty »

Will be in the next version.
User avatar
Krishty
Site Admin
Posts: 1364
Joined: 2022-Jan-09, 00:59

Re: ✔️ NEW FEATURE: Two Horizon Colors (ADF/TAW)

Post by Krishty »

Feature has landed.
Post Reply