Posted: 02 Apr 2005, 16:30
I talked about this somewhere (forums or irc, can't remember) and the idea was to use alpha channel instead of pink "channel"
Feel the mana power growing inside you!
https://forums.themanaworld.org/
I don't mean to be a dick, but 2 things:Elven Programmer wrote:Yeah probably in 2009 when everyone will have 128 bit processorsPajarico wrote:But we will use png alpha channel someday, right?Rotonen wrote:Using the png alpha channel for tiles is too cpu intensive at least with our current client.
Don't worry, any critic is welcome. If it makes you feel better, I don't like your avatarJetryl wrote:I don't mean to be a dick
I think the performance difference is in using alpha or not, using 1 or 8 should be pretty the same. (I'd like to say I'm not an alpha expert, I only read something about it when we introduced it in TMW, before that I've always ignored everything regarding alpha channel)Jetryl wrote:if you use a 1-bit channel, it actually might be faster and easier to extract.
Well maybe 25 fps is enough for Wesnoth, but we'd like to have a bit more and our target is to make TMW run on very slow computers where there's no hardware acceleration. The bad thing about current TMW status is that it's a 2D game and it runs as if it was 3D requiring lot of resources. Of course is a matter of code and I think there's a lot of space for improvement. That's why we're looking for an SDL guru to help us reaching a decent framerate. (Ah the old good days when we were using Allegro and the frame rate was over 120 fps ). Looking at your code? Why not, we could give it a try.Jetryl wrote:we use full 8-bit alpha channels in pngs, and I'll be darned but the game does run at >25fps with dozens of sprites concurrently animating - on even a measley 600mhz machine.
It's just a question of decent code - and hey - we're open-source, too, so you can look at our code and see how we do it.
Ok noted down, we will discuss it in the next developers meeting.Jetryl wrote:It's a necessary feature for almost any decent spell effects, and for any smoke, or fog, or shadows, or ghosts, and can also be used to more cleanly define edges by hand-antialiasing them. Because we didn't have our original graphics set in this format, we had to go through the whole thing and convert it by hand. I suggest that you don't make that mistake - we paid for it, hard
It was just to emphasize computer's horsepower, don't take that as written law.Jetryl wrote:And secondly, the "bit-width" of processors really has nothing to do with speed of graphics composition, since on any decent graphics layer these days, most of the composition is actually performed by the GPU. It could, if you were having the processor do the composition manually, and were coding special instructions in assembly to treat multiple pixels as single double-long words (or whatever the highest size of the processor's width was - on a 64bit chip, it would be a 64-bit value), with special bitwise operations to modify the individual components of the pixel color value according to what the transparency dictated.
The client already supports alpha PNGs since quite a while, in specifically since we added that alpha-layered mouse cursor. The alpha layer is however not used for the tiles, because the tiles form most of the drawn area of the screen. Masked drawing is actually faster than using an alpha layer, in particular because there is no need for multiplying and SDL can use run length encoding on the transparent parts.Elven Programmer wrote:Ok noted down, we will discuss it in the next developers meeting.Jetryl wrote:It's a necessary feature for almost any decent spell effects, and for any smoke, or fog, or shadows, or ghosts, and can also be used to more cleanly define edges by hand-antialiasing them. Because we didn't have our original graphics set in this format, we had to go through the whole thing and convert it by hand. I suggest that you don't make that mistake - we paid for it, hard
I've got a 64bit processor with 2 cores, sums up to 128bit! Will that be enough?ElvenProgrammer wrote:Yeah probably in 2009 when everyone will have 128 bit processorsPajarico wrote:But we will use png alpha channel someday, right?Rotonen wrote:Using the png alpha channel for tiles is too cpu intensive at least with our current client.
Rotonen has been going over our old threads in this forum. He found what Elven said funny, linked to it on IRC, and Matt found it that way.5t3v3 wrote:OMG did you bookmark this page and put a reminder in your calendar to post this when it's 2009???
Yes, of course!5t3v3 wrote:OMG did you bookmark this page and put a reminder in your calendar to post this when it's 2009???