Author Topic: Alphachannel for streetlights  (Read 1203 times)

0 Members and 1 Guest are viewing this topic.

Offline Vladki

Alphachannel for streetlights
« on: December 24, 2016, 03:18:53 PM »
I'm really glad that now we have full alpha support: http://forum.simutrans.com/index.php?topic=15314 Thanks to all involved in making it.

I was thinking how this could be used to improve the game, and thought about street lights. We already have a quite nice set for pak128.CS from VTPSim, so I decided to improve them a little bit. But the problem is that the light is either shining all day, or is casting a shadow during the day. See the pictures:

I experimented with a few special colors, but all I got was just different color tint of the shadow. Last resort is to make the color very transparent so that the daytime shadow is not noticeable, but then also the nighttime light is very weak. This gradient is 50% to 100% transparency.

So the question is - would it be worth adding one more special color, that will be fully transparent during the day, and shiny (like windows) during the night?

Or even it could be transparent during the day, and bring the background to dailight color during the day. But that would probably be much more complicated.

Offline DrSuperGood

Re: Alphachannel for streetlights
« Reply #1 on: December 25, 2016, 03:12:26 PM »
The correct solution would be to have the street lamps use different images for day and night. In the day they use an off image. In the night they use an on image. This would be the most visually accurate as street lamp state is pretty binary in most countries.

Introducing special colours for this would be adding excessive complexity. If one wants street lamps of different colours (eg the new eco LED ones which emit a more blue tinted light) then that would mean even more special colours had to be added.

Offline kierongreen

Re: Alphachannel for streetlights
« Reply #2 on: December 25, 2016, 05:34:10 PM »
Or indeed all objects to have nighttime and daytime images - that way could have vehicle headlights too and maybe interesting station effects too.

Offline jamespetts

  • Simitrans-Extended project coordinator
  • Devotee
  • *
  • Posts: 16164
  • Total likes: 450
  • Helpful: 178
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Alphachannel for streetlights
« Reply #3 on: December 25, 2016, 08:50:55 PM »
Or indeed all objects to have nighttime and daytime images - that way could have vehicle headlights too and maybe interesting station effects too.

Just imagine the amount of work for pakset maintainers!
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 4900
  • Total likes: 217
  • Helpful: 108
  • Languages: EN, NO
Re: Alphachannel for streetlights
« Reply #4 on: December 26, 2016, 03:47:43 PM »
But would it be any easier for them to get the effects they want using a single image? Special colors seems to be problematic as they are, since they can't be anti-aliased, nor do any programs know to care about them.

Offline Leartin

Re: Alphachannel for streetlights
« Reply #5 on: December 26, 2016, 05:10:09 PM »
Just imagine the amount of work for pakset maintainers!
Potentially no work at all, like most additions on the graphics side. You simply would not be required to use it, if you are fine with the current system. There is no need to abandon the special-color-code if night-images indeed get added.


Though is it really feasable to add "night" as another complete image, like seasons and rotations? It's no problem for street lights and vehicles, but it might be a burden for buildings. After all, they already may have 8 rotations and 5 seasons, so you could end up having to create 40 new images just for that one building to use better lights.
Even worse, sometimes it's the same building with a variety of colors or different accessory. All of those slightly different versions would have to be duplicated for a night image. The creation process can be automated, but you'd still end up with a lot more wasted storage - in the games memory as well.

I'd like to propose "light" as an extra image layer, similar to frontimages, but only appearing at night and of course not affected by night-screen-tint. This would allow to use one "lights" graphic for several buildings that have their windows in the same positions; or reuse the same headlights for several vehicles, etc.
These would not replace special colors, however, and rather accompany them. The streetlights vladki used would still have the special color where the lamp is, but the glow would be in an extra layer. Using such a system, we could allow the player to opt out of these "advanced lights" and no light layers would be rendered at all. - just in case it would be too much for older computers.

Offline Yona-TYT

Re: Alphachannel for streetlights
« Reply #6 on: December 26, 2016, 06:02:26 PM »
Without doubt a magnificent idea, the night illumination will be very pleasant.  ;D ;D ;D