![]() |
#1 |
Adept
Join Date: Aug 2019
Posts: 119
![]() |
Blending and tile sets
I'm tidying up the tile rendering in the Cocoa front end and had some questions about how blending should be handled with the tile sets in Angband.
1) How should the alphablend field in the graphics mode structure be interpreted? The comment about the alphablend field in the graphics mode structure says "Bool whether or not the tileset needs alpha blending". Based on how it's set for the current tile sets, it looks like it is zero if the alpha channel only has values of zero and 255 (i.e. either completely transparent or completely opaque) and nonzero if the alpha channel takes on values that are not zero and 255. Is that the correct interpretation? If so, why does the Gervais tile set have a value of zero for alphablend? From what I see (read in the PNG file in Python with PIL and examine the alpha channel with numpy), it has some values in the alpha channel that are not zero or 255. In terms of providing hints to the front ends, it may be useful to have something in the graphics mode structure (either more possible values for alphablend or a separate field) that says a tile set has no alpha channel. The front end could use a faster rendering path for those tile sets. Of the current tile sets, the Nomad tiles don't have an alpha channel (at least from what I see using Python with PIL to look at the PNG file). 2) What's the appropriate rendering strategy for double-height tiles used as background or terrain? From what I see in the Windows front end, the top half of such a tile is blended with what's already been rendered for the cell in the previous row. So it can obscure both the foreground and background for that cell. An alternative would be to render the background parts first (first the background tile for this cell and then the top half of the double-height background tile from the next row if present) and then the foreground (first the foreground for this cell and then the top half of the double-height foreground tile from the next row if present). |
![]() |
![]() |
![]() |
#2 |
Prophet
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,999
Donated: $40
![]() |
that is correct. Transparency allows the background tile to show thru, rather than just black. That is only use of alpha
|
![]() |
![]() |
![]() |
#3 |
Vanilla maintainer
Join Date: Apr 2007
Location: Canberra, Australia
Age: 55
Posts: 8,671
Donated: $60
![]() |
For the second question, I thought the only double-height tiles were monsters, which I think means you don't have to worry - but I'm really not sure at all on this.
__________________
One for the Dark Lord on his dark throne In the Land of Mordor where the Shadows lie. |
![]() |
![]() |
![]() |
#4 | |
Adept
Join Date: Aug 2019
Posts: 119
![]() |
Quote:
For the alphablend setting on David Gervais's tiles, I'll check how it renders on Windows (the only front end currently adjusting it's behavior for how alphablend is set) and submit a patch if setting alphablend to one for those tiles seems better. |
|
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Making randart sets more cohesive | Derakon | Development | 12 | December 19, 2017 09:54 |
Equipment sets | OOD Town drunk | v4 | 9 | April 5, 2013 18:32 |
Tile painters: request for a new tile | takkaria | Development | 8 | June 17, 2011 13:01 |
Differences between graphic sets | Ghen | Vanilla | 3 | August 28, 2009 05:34 |
Saving sets of squelched items. | Zero | Vanilla | 6 | October 3, 2008 04:44 |