View Full Version : blending / alpha textures
hi - i have a question about textures...i want to make a wing of a bug in opengl. to make it out of polygons and then texture it would be a disaster i think, so i thought that maybe i could take a picture of a wing and use it as a texture on 1 polygon. but since ogl textures are square, how do i code it so that the edges of the texture will be transparent, and i am just left with the picture of the bug-wing?
02-05-2001, 04:25 PM
Edit your picture in a paint program adding an alpha mask. Enable alpha testing in your OpenGL program.
Mango solution is the "school perfect" solution, IO must admit.
Just want to post antoher way of doing it.
It's also possible to draw the wing with veins and bones on a black background, and then use GL_SRC_COLOR for the glBlendFunc call.
It will give you a transparent texture where it's pixels are darker.
The method depends on how much space you have, Mango's solution is better but u need to store one bitplane more for alpha values.
Powered by vBulletin® Version 4.2.2 Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.