Angband.oook.cz
Angband.oook.cz
AboutVariantsLadderForumCompetitionComicScreenshotsFunniesLinks

Go Back   Angband Forums > Angband > Development

Reply
 
Thread Tools Display Modes
Old January 25, 2020, 17:10   #1
backwardsEric
Rookie
 
Join Date: Aug 2019
Posts: 24
backwardsEric is on a distinguished road
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).
backwardsEric is offline   Reply With Quote
Old January 25, 2020, 17:55   #2
Pete Mack
Prophet
 
Join Date: Apr 2007
Location: Seattle, WA
Posts: 5,596
Donated: $40
Pete Mack is on a distinguished road
that is correct. Transparency allows the background tile to show thru, rather than just black. That is only use of alpha
Pete Mack is offline   Reply With Quote
Old January 25, 2020, 21:10   #3
Nick
Vanilla maintainer
 
Nick's Avatar
 
Join Date: Apr 2007
Location: Canberra, Australia
Age: 54
Posts: 7,971
Donated: $60
Nick will become famous soon enough
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.
Nick is online now   Reply With Quote
Old January 26, 2020, 22:22   #4
backwardsEric
Rookie
 
Join Date: Aug 2019
Posts: 24
backwardsEric is on a distinguished road
Quote:
Originally Posted by Nick View Post
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.
Yes, none of the features in graf-shb.prf map into the double-height rows. So how to order the rendering for the top half of a terrain tile doesn't matter at this point. I'll try to mimic what the front ends for Windows and SDL do for drawing double height terrain tiles.

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.
backwardsEric is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
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


All times are GMT +1. The time now is 11:58.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.