[crossfire] lighting & LOS redo.

Mark Wedel mwedel at sonic.net
Tue May 23 00:56:07 CDT 2006


Lalo Martins wrote:

> Having spent most of my last two working days implementing a colour picker
> :-P I must say I like the idea of hue/saturation; it's perfect for this
> purpose, as it completely describes a light colour.  And you can use one
> byte, wasting no bits, and have great resolution; 4 bits of hue and 4 of
> saturation is pretty good.
> 
> Of course, people don't know how to write their favourite colours as
> hue/saturation pairs :-) but they can open up the gimp and get the correct
> values from the colour picker therein.

  Playing with the color picker it gimp, it seems there is hue, saturation, and 
value, so 3 values.

  I suppose 4 bits (16 values) for hue is probably enough, but a little hard to 
tell (dividing the color circle in 16 pieces, hard to say where everything where 
really line up).

  I'm guessing that we're assuming that value will always be 100 (and thus don't 
need that)?  That makes sense to me - having it dimmer would really seem to be 
part of the glow radius, and not something that should be done by the light 
source itself.

  And thus, 4 bits for saturation may be more than enough, so yeah, that works. 
  Or maybe in a 5/3 mix, to give more colors, since I'm not sure how refinement 
people need in saturation (I'd tend to think that generally for effect to be 
more noticable, people will want to use more saturated values).

  It probably would be best, however, that the individual hue/saturation value 
be set in the object, like:

hue 301
value 86

  And then the loader would convert that to the 8 bit value for sending to the 
client, so that the conversion only needs to be done once.





More information about the crossfire mailing list