Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2004:
[Freeciv-Dev] Re: (PR#11433) Fog of War rendering improvement
Home

[Freeciv-Dev] Re: (PR#11433) Fog of War rendering improvement

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: andrearo@xxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#11433) Fog of War rendering improvement
From: "email_address=jdorje@xxxxxxxxxxx" <email_address=jdorje@xxxxxxxxxxx>
Date: Thu, 9 Dec 2004 09:04:05 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=11433 >

>
> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=11433 >
>
> Following the discussion on how to do fog of war with alpha blending, I
> did a little test to implement an improvement to the fog of war rendering.
>
> It doesn't use alpha-blending, since you would need to use pixbufs.
> Instead the brightness of every pixel is reduced by 50%, by iterating over
> each pixel in the pixmap.
>
> There is little or no performance hit that I can notice, but it would be a
> good idea to do some benchmarking. Is is possible to get a frames/s
> output?
>
> Patch against CVS head, for the Gtk 2.x client.

Well if you use this algorithm you could easily use the civ3 fog graphics.
 They don't have alpha layers in the image but express the amount of
darkness as a grayscale gradient.  Instead of making it 50% darker you
would make it darker based on the color in the fog sprite.  Another
alternative would be to hard-code fog using pixbufs while all the other
drawing was done in pixmaps.

However civ3 and civ1 fog work differently from civ2 fog.  In civ2 fog
(used in isotrident) each sprite is fogged separately.  I think this will
be slower since you may have to fog each tile multiple times.  It means
that mountains that stick up onto other tiles still get fogged.  In civ1
and civ3, fog was done per-tile.  At the end of the drawing the fog is
just drawn on top.  This means (in civ3) that mountains may stick up "out
of the fog".  It also means that in trident tileset your fog code won't
make any difference (since there is a fog sprite in the tileset that's
already used instead).

Future discussion on this should be sent to RT.

jason







[Prev in Thread] Current Thread [Next in Thread]