This article is on how to use 256 indexed color translucency. It does not work on 16-bit or 32-bit color due to memory constraints. It involves building a 256 by 256 unsigned char table, which contains the result of every color combination. The table would be extremely large with 16-bit or 32-bit color. The first index for the table (which is in the form of a 2D array) is the translucency color. The second index for the table is the color behind the translucent pixel. This is a function that shows how to use this translucency technique. (The translucency actually should not be in a function or method, even an inline method.) DON'T ACTUALLY USE THIS FUNCTION! IF A FUNCTION CALL WAS USED TO DRAW EACH SINGLE PIXEL IN A SINGLE SOLIDCOLOR POLYGON, IT WOULD BE HORRENDOUSLY SLOW! Variables
Implementation
Discuss this article in the forums
See Also: © 1999-2011 Gamedev.net. All rights reserved. Terms of Use Privacy Policy
|