News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

Alpha channel drawing bug on the dialog window

Started by Ranran(retired), January 12, 2019, 01:14:21 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ranran(retired)

1. Nighttime drawing only affects pixels with alpha channel on the dialog window.
The nighttime effect should be unnecessary on the dialog window.
I mean, on the dialog window, pixels that are not transparent will not get dark but only pixels with alpha channels will get dark in the night.

This occurs with both standard and extended.
(Currently there are few pak files with transparent pixels but I think that this will increase in the future mainly rendered by 3D modeling.)


2. Alpha channel reversal phenomenon on the dialog window.


The black contamination rate during this night is inversely proportional to the transmittance.
(I suppose this may be other than the grayscale color.)
Roughly speaking, 99% black is mixed in pixel with a transmittance of 1%, and 1% black is mixed in pixel with a transmittance of 99%.

This seems to distinguish between 0 and null (when makeobj creates a pak file), if it is perceived as transmittance 0%, the pixel may become completely black at night.


The result of replacing the icon with an image with an alpha channel in pak192.comic.






It is the same in every dialog window, such as line managemant screen and convoi list, not only in depot.
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

Leartin

I can confirm, semi-transparent pixels get darkened while keeping their transparency. Despite using a lot of transparency these days, it's mostly black shadows, which are unaffected by this problem (they can't get darker).

About the "reversal": I'm not entirely sure what you mean. Since the pixel changes color, the black is more visible the more visible the pixel is.


Ranran(retired)

Sorry. I am not good at English, so it may not express well what I want to say.

I think that behavior is different between achromatic color and color. It will be broken if it has a color.

Please check this comparison image.

Below are in the nighttime.
You can see that the center of snail shells and the center of red symbols are abnormally black.
The lower the transparency, the more black it looks.

This is the original image.
Please check the black pixels.
It can not be distinguished from surrounding color.
Does it look like it is transparent? At least makeobj decided that pixel is transparent. (Close to 0%).
It is my mistake that mixed unnecessary alpha channels.
I could do the same as other pixels by completely removing the alpha channel from that pixel.
Even if I look at other pixels, I do not think that it keeps the transmittance normally at night.
The lower the transparency, the darker it is.
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

Leartin


Quote from: Ranran on January 12, 2019, 03:11:39 PMDoes it look like it is transparent?
Yes, all pixels that do turn black are semitransparent. I checked your sources, it is only 1% transparent, very hard to see, but a tool can read the values.
Quote from: Ranran on January 12, 2019, 03:11:39 PMYou can see that the center of snail shells and the center of red symbols are abnormally black.
The lower the transparency, the more black it looks.
Yes. What was red in the sign turns black. It keeps transparency and mixes with the background. So very transparent pixels will be light gray, less transparent pixels will be dark gray. And a 99% visible pixel will be 99% black.

Dwachs

The parameter 'do not draw night colors' is used by the gui code, but it is not propagated down to the pixel copy routines, which use night colors on transparent pixels.
Parsley, sage, rosemary, and maggikraut.

prissi

Since transparency does work as expected on already darkened pixels in the display, I would suggest to no darken any transparent pixel at all. What do you think?

Ranran(retired)

I have to dig up an old thread.
Unfortunately, this problem is now manifesting.
I have previously revived the aero theme. It has a transparent background. Because I thought it would match the "aero" theme.
That exposed this bug. But I didn't do it intentionally.
Use the aero theme and put it in night mode. It is swallowed by the darkness, even though it has low transparency. That is clearly not the intended behavior.
This also applies to all objects and GUI parts as previously reported. The theme add-on created by Ranran and others causes the transparent pixels of the icon to turn black at night due to this problem.
For example, the outline of a button with a modern theme also has transparent pixels, which darkens the area at night and creates a strange appearance.
Therefore, we hope that the root of this problem will be fixed rather than making the background of the aero theme non-transparent. (´・ω・`)
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)

prissi

That was hard work with all these templates etc Fixed in r9753

Ranran(retired)

Thank you for your excellent work. It has been fixed and is much better.
Also, it is nice that the edges of buildings and vehicles with transparent pixels output by 3D modeling placed on the GUI look beautiful even at night.  :)
ひめしという日本人が開発者達の助言を無視して自分好みの機能をextendedに"強引に"実装し、
コードをぐちゃぐちゃにしてメンテナンスを困難にし(とりわけ道路と建物関連)、
挙句にバグを大量に埋め込み、それを知らんぷりして放置し(隠居するなどと言って)別のところに逃げ隠れて自分のフォーク(OTRP)は開発を続けている
その事実と彼の無責任さに日本人プレイヤーは目を向けるべき。らんらんはそれでやる気をなくした(´・ω・`)
他人の振り見て我が振り直せ。ひめしのようにならないために、らんらんが生み出したバグや問題は自分で修正しなくちゃね(´・ω・`)