Day and night?Archives Forums/BlitzPlus Programming/Day and night?
| I am wondering, how would I be able to dark or lighten everything, with various values so just pre-rendering a dark/light version would work.|
I thought of gamma, that seems to work but then my friend brought up the HUD (heads up display) and well, that would be affected also.
Possible I could counter a gamma effect, thus making an image/color look as if it wasnt effected?
Any ideas on day/night effects appreciated :)
| I tried using gamma, and there are a few relevent advantages such as gradually fading between day and night...red skylight reflections, slight yellow buzz in spring, white mist in blizzard conditions etc.|
But as you say the one majour disadvantage there can overweigh all of that...so it depends how complex the hud is. If its something with eg: just a dial and a health bar, then gamma can fade to normal during pause menus...and using brightened images for those periods on the hud would be ok.
or..(as you know)..a second darker version of all in game images and tiles could exist, or be created during program.
In the Zelda Oracle of Seasons GameBoy game, they had four of every tile, one for each season. Having two of every tile for day and night cant be that bad.
With blitz its too slow to do any pixel editing in realtime (its slow to a degree any method), so as far as i know, there are no alternatives to wehat youve already mentioned.
| Theres gonna be 30 different "light" levels, so I can have 30 different tiles of the same.|
Im gonna be using BlitzUI for my HUD.
Hmm... what could I do.
With blitz its too slow to do any pixel editing in realtimeNot necessarily. If your tiles are small, and you change only 1 per frame over the course of a long period of time, you might be able to get by. All you would have to do is write a routine that would modify each tile in turn just a tiny increment. In fact, you might even get better results, then having seperate tiles.
| Hmm, any math I might use to dark/lighten pixels?|
EDIT: I got basic lighting, now time to optimize :D
EDIT EDIT: I managed to create (I think) a super fast function for this which can do *calculates* 615670 pixels in about 100 ms :o
| Change One tile at once WolRon? I never thought of that.|
..around 60 tiles each second...