The International Simutrans Forum


Author Topic: Player colors and transparency  (Read 338 times)

0 Members and 1 Guest are viewing this topic.

Offline nrg

  • *
  • Posts: 4
Player colors and transparency
« on: September 21, 2020, 07:54:57 AM »
While trying to figure out why the player colors didn't seem to be working on a bus stop I made, I put together a quick png test image (attached).  This has each shade of the primary player color on the left and the secondary on the right, decreasing in opacity as you go away from the center.  As you can see the transparent colors are sometimes way off.  This happens with every combination of colors.

Offline jamespetts

  • Simutrans-Extended project coordinator
  • Administrator
  • *
  • Posts: 20817
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Player colors and transparency
« Reply #1 on: September 22, 2020, 10:46:44 AM »
Thank you for your report.

The code for player colour transparency (and graphics generally) is unaltered from Standard and is not a part of the code that I know anything about. However, if I understand correctly, I believe that this is a general issue with transparency, not just in Simutrans, but in a large proportion of computer graphics using colour blending of various kinds: see here for details.

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2346
Re: Player colors and transparency
« Reply #2 on: September 22, 2020, 08:34:02 PM »
This was picked up when transparency was introduced. The difficulty is that having gamma correction would be potentially much slower, and with only 15 bit images gains in accuracy wouldn't necessarily be huge. Hence simple averages had been (largely) felt to be good enough.