Advertisement

Real-time Night and Day effects

Started by December 08, 2002 09:01 PM
3 comments, last by Tancients 22 years, 1 month ago
What do you guys think would be the most efficent way to simulate real-time night and day effects, while keeping the framerate and size down? This is for a 2-d parallax scroller, with enviromental exploring options for non-linearity. Some of the options I have thought about: -A foreground transparent layer, that slowly tinted to create the blue and purple hues to simulate night. -Simply changing the pallete when the next screen loads. This would work fairly nice, but it doesn''t allow for gradual shifts in lighting and seems less realistic. Fairly efficent on space though. -I''m open for suggestions for any ideas that you think might work. I''m not incorperating high detail in the shadow, as it would then become slow with the program having to constantly calculate real shadow length.
I can''t think of any ideas that make the effort worth the reward, really.
Advertisement
I like the transparent foreground. It would also allow for gradient effects, simulating dawn/dusk. Not too tough graphically, but the pallette would have to change eventually. How hard would it be to have the pallette change gradually?
If you''re using C/C++, the Allegro library (try searching on sourceforge.net) has palette routines including a "fade to" routine that, at a dynamically specified rate, "fades" one palette to another by interpolation of colour values. All you need to do is make sure your colours are in the same place in both palettes
If you use OpenGL (which is just as good in 2D or 3D IMO), you can change the light color to simulate different lighting conditions. For example (1.0, 1.0, 0.8) would give you a yellowish almost white light and (0.2, 0.2, 0.7) would be a dark blue light and the part''s of the screen with the brightest blue component would be the most visible (just like the effect of a real blue light).

Just an idea, shoot me down if it''s stupid!!!

This topic is closed to new replies.

Advertisement