Archived

This topic is now archived and is closed to further replies.

L-Tryosine

Black->White color ramp on 16 bits

Recommended Posts

L-Tryosine    122
Some times the gouraud shading on a white face on my 3d eng comes with some litte of green and red, very little, but visible. I thinked that was an error of my eng on color calc, but I saw it on some other games using 16bits colors mode. Even the Jasc Paint Shop Pro 7 make this on gradient paint when go from/to black->white. On this days i saw the game Runescape, and the guy managed some way to draw a black-white gradient on white/gray gouraud faces without this green/red distortion. How?

Share this post


Link to post
Share on other sites
Crawl    136
In 16-bit mode the red, green and blue color values must be stored in 16 bits (duh!!!!), but there is no way to divide the bits equally among the color values ( 16 / 3 = 5.3333 which is not a rounded number ). So two 16-bit modes were created:

555 - mode (in total 15 bits, 1 bit isn't used)
5 bits for red
5 bits for green
5 bits for blue

and, 565 - mode (16 bits, everything is used)
5 bits for red
6 bits for green (!)
5 bits for blue

In 565 mode green has 64 different values, but red and blue have only 32. So occasionally green has a somewhat different value because of it's higher accuracy.

It's hard to explain (well it is for *me*), it is at least part of the answer.

----------------------------
"Now comes the mystery."

Last words of Henry Ward Beecher (I have no idea who that is, but it's a cool quote)


Edited by - Crawl on January 30, 2002 8:35:43 AM

Share this post


Link to post
Share on other sites