View Full Version : Colorkeying!
11-13-2002, 05:23 AM
Is there a way to use colorkeying in opengl? For example, I have an image that is loaded with DevIL (i know its data), and I want the black color to be transparent. How do i do that??
First allocate a new image with room for all color components in the original image plus an alpha channel. Copy each pixel from the old image to the new, and set the alpha channel to either one or zero, depending on the color. If black, set it to zero. Then use alpha test to reject pxiels with alpha other than one, that is, black pixels.
11-13-2002, 07:18 AM
Thanks a lot!
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.