Jump to content
  • Advertisement

Archived

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

L-Tryosine

Black->White color ramp on 16 bits

This topic is 6011 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!