Crossfire Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CF: images & caching.



On Mar 5,  5:08pm, Scott MacFiggen wrote:

> Conversion is easy I think. I converted some XPM images to
> PNG and it was quick and easy with ImageMagick. Although I
> didn't look real close at the new image. I'm not sure what
> it did with the palete, stuff like that. And I'm also not sure
> how it dealt with transparency..

 Note that any conversion method must work without user intervention and be
runable from a script (I am not saying that png does not meet that.)
 Converting 2000+ images require a minimal amount of conversion effort.

 As a note - how do space usage compare on xpm vs png images?


> To get translucense to work, you would need to work with all the images
> in PNG format, ie, when combining multiple images, they all have to
> be PNG, then once you have your finished composite image, you
> convert it to the OS native format. I know this isn't how the
> X client does things, I believe it just does an XcopyArea and
> uses the SHAPE x-extension to take care of the transparent
> pixels.. But I think translucency would work fine on any OS, although
> I'm not going to say for sure until I try it...

 Ok.  So all image actions handle in PNG until you get your composite image and
decide to draw it.  I am curious on the performance on that - I would think
that for most systems, handling in native format will be faster than a generic
PNG format - although it may not be that significant.  However, redraw logic
and knowing what to redraw could make things more complicated.

 As a note, the X11 stuff actually uses clipmasks (standard part of X).  I
believe the X shape extension is mostly for odd sized windows, which crossfire
doesn't use at all.


> I'd rather see a format image with more 'feature sets' picked, if
> we decide to change image formats, so that the client writers
> have more flexibilty to do things graphics wise if they
> so chooose.

 On the other hand, feature set should not be the only criteria when deciding
on something (whether it is image format or package to use for npc logic.)
 Identifying the features that are needed, and then finding what best matches
that is probalby the best approach to use.

 If we go by that - current features of XPM:
 transparency
 alternate color information for greyscale & bw systems

 I believe most other formats loose the second point.  Ideally, if we go to
another image format, it would be nice to only have 1 set of images needed (ie,
get read of the bitmaps that are their now) - simplifies stuff all around, and
means less space used.  Unfortuantely, for black and white support, alternate
color information is really needed (or do we maybe jsut want to make color a
requirement?)

 Is multiple transparency levels/translucent pixels a big gain/advantage?  The
argument about nicer lighting code probably doesn't really fall into that
(better method would be for server to communicate light sources and their
diameter, and have client deal with shading however it might want - saves some
server cpu cycles, might save overall bandwidth (don't transfer darkness shadow
masks), certainly can get better effects (good clients could do smooth light
calculations, shading, whatever.)

 A simple method, though not perfect, would be to have shadow masks of varying
diameter (ie, square radius mask - center has all pixels enable, and as you
move out, fewere are enabled.)  Client then premerges these for the overall
11x11 viewing area (and thus, overlaps will probably be lit bettter as all the
pixels won't match out), and then apply over the map.  That way, at least
smooth radius shading would happen without having to adjust all the various RGB
values on the fly.

>
> I think I'll experiment a little bit with PNG in windows
> a see how it goes...
>

 I would be curious on how good/the number of tools under unix for PNG.  After
all, that is where crossfire is still developed for the most part, so good
support under unix is fairly important.


-- 

-- Mark Wedel
mark@pyramid.com
[to unsubscribe etc., send mail to crossfire-request@ifi.uio.no]


Follow-Ups: References: