Set background color on lightning
Fixes #1243
https://github.com/SuperTux/supertux/assets/583169/20867e9b-7244-4ccc-b9fb-a32b7b13845e
https://github.com/SuperTux/supertux/assets/583169/59f2b905-d870-4d70-985a-aca4a1151211
Not sure how far we can go in terms of brighting up the screen, but the flash should be very bright! Perhaps working with something on an "additive layer" would help out. I also think that it looks much nicer if the flash appears immideatly upon lighting strike but then fades out rather than dissappearing instantly again.
Something along the lines of this, if brighter:
EDIT: There really should be a strong difference between the two states
https://cdn.discordapp.com/attachments/1033726844660351026/1195497037022646393/2024-01-12_23-37-31.mp4?ex=65b43460&is=65a1bf60&hm=b6bf7468679146e4310aab59ec96144d00245653cb7985e0d269b30d8295c7ed&
Personally I find the thunder too bright, making it uneasy on the eyes. Would there be an option to turn this off?
Personally I find the thunder too bright, making it uneasy on the eyes. Would there be an option to turn this off?
This was Rusty's idea. Battle with him.
It appears the white surface drawn when lightning strikes isn't even colored white. It looks rather gray. Even when the ambient light is set to r=1, g=1, b=1. Is its alpha value set to 1 when it flashes?
Ideally, if we get the flash to be white we may not even have to tamper with the ambient light at all during the flash as the blend mode "add" brightens it all up anyways (unless I am mistaking, though that's how it works with a pure white gradient set to "add" and a z-layer of 500).
It starts at 1 and then quickly levels off to 0.
Huh, it doesn't look like it though at all. I did notice something else though too. You should remove the stuff related to const Color Color::LIGHTNING_HIT_COLOR(0.6, 0.6, 0.6, 0.5); because it actually makes a fully bright sector darker when lightning strikes
Not sure if that fixes all of it though since the white surfaces appears as not white even in a fully bright sector too.
This is how it is supposed to look like. To give you a visual reference! Note: I used a scripted Gradient object for this!
https://github.com/SuperTux/supertux/assets/20615048/86e72405-97d5-4da0-95d9-184b5f44761a
https://github.com/SuperTux/supertux/assets/583169/ec82e7d8-983e-4ef2-ac3b-ce26f21b373f
I'm still convied that the blending mode didn't really apply. For comparison I set up a Gradient Object with the same values as the drawn lighning flash you added (and on the same z-layer -> 500). But as you can see it is not the same. I don't know why and rn my only assuption is that the code may not support blending modes for you methode of drawing it.
Gradient set to r:1, g:1, b:1, a:0.9 and blend mode "Additive":
Lighning Flash in this PR, which is supposedly also "Additive":
I think this code could be much better, but this works
In what way could the code be better?
https://github.com/SuperTux/supertux/assets/583169/70300238-2ee6-4213-b0a5-89a2ec4a357e