Announcement: Be excellent to each other.


Caravel Forum : DROD Boards : Bugs : Transparency in Custom Styles
New Topic New Poll Post Reply
Poster Message
RabidChild
Level: Smitemaster
Rank Points: 720
Registered: 01-15-2006
IP: Logged

File: Transparency bug.png (5.9 KB)
Downloaded 346 times.
License: Public Domain
icon Transparency in Custom Styles (+2)  
I was playing an AE hold and noticed that transparency isn't working properly in some of the AE styles, specifically Lava and Cavern. The top section of this image shows Palace, which looks normal, and the bottom shows Lava, which should have transparency around the force arrows and trapdoors, but doesn't.


Looking at the style images, the only difference I can see is that Lava has an alpha channel and Palace doesn't.

I'm using 5.1.1.371 in Windows, so I'm not sure if this is related to the transparency issue bbb mentioned here. I'm also not sure whether this is a bug in the engine or a problem with the styles.

[Last edited by RabidChild at 12-14-2020 07:25 PM]
12-14-2020 at 07:24 PM
View Profile Send Private Message to User Show all user's posts High Scores Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: Transparency in Custom Styles (0)  
Thanks for noting this issue. Yes, I believe this is the same issue.

IIRC, PNGs need to have an alpha channel if we're applying standard alpha transparency display with the image (i.e., outside of the grey-192 masking), otherwise they should not have it (i.e., in the case of sprites where 192-grey is used for masking).

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
12-15-2020 at 04:00 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
skell
Level: Legendary Smitemaster
Avatar
Rank Points: 3734
Registered: 12-28-2004
IP: Logged
icon Re: Transparency in Custom Styles (+2)  
Initial investigation suggests that the problem is not, in fact, caused by my changes. I checked out the latest version of the code that I could get to build easily and it's still there.

I am assuming the version of PNG library might be at fault.

Suggestion: Make it so that if the PNG image has no alpha channel, when it's imported 0xC0C0C0 is automatically and always marked as transparent color.

____________________________
My website | Facebook | Twitter
03-01-2021 at 10:48 AM
View Profile Send Private Message to User Send Email to User Visit Homepage Show all user's posts High Scores This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: Transparency in Custom Styles (0)  
bump

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
07-28-2021 at 06:03 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
hyperme
Level: Smitemaster
Avatar
Rank Points: 1062
Registered: 06-23-2006
IP: Logged
icon Re: Transparency in Custom Styles (0)  
RabidChild wrote:
Lava has an alpha channel and Palace doesn't.

This is a pretty important piece of information, since it could mean that the game is working fine and that it's the styles that are wrong. If a PNG has an alpha channel, the expected behaviour is that DROD does alpha transparency stuff based on the alpha channel. So if you have an image with an alpha channel, but set up as if 0xC0C0C0 is the transparent colour, you're gonna have a bad time. Because DROD sees the alpha channel, and treats the image like an image that uses alpha, so all the grey pixels get drawn.

Obviously it's worth checking if Cavern and Lava do actually use an alpha channel, but I don't know how to do that. If they do, the problem is probably with the styles. Otherwise, the game is doing a bad thing.

____________________________
[Insert witty comment here]
Qzvlkx?
08-11-2021 at 04:33 PM
View Profile Send Private Message to User Show all user's posts High Scores This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: Transparency in Custom Styles (0)  
My current thinking is that the alpha channel needs to be removed from any style sprite sheet images that include it.

I don't recall if this is documented, but I consider it in the specification that sprite sheets don't include an alpha channel.

This change could be applied now, at any time, and shouldn't have any negative impact on current or earlier game engine versions.

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.

[Last edited by mrimer at 08-11-2021 05:54 PM]
08-11-2021 at 05:52 PM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
mrimer
Level: Legendary Smitemaster
Avatar
Rank Points: 5056
Registered: 02-04-2003
IP: Logged
icon Re: Transparency in Custom Styles (0)  
Thanks for a fix, hyperme!

PR

____________________________
Gandalf? Yes... That's what they used to call me.
Gandalf the Grey. That was my name.
I am Gandalf the White.
And I come back to you now at the turn of the tide.
08-21-2021 at 12:45 AM
View Profile Send Private Message to User Send Email to User Show all user's posts High Scores This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : DROD Boards : Bugs : Transparency in Custom Styles
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.