load in the RGB texture and for each pixel check if its colour is black if so set the pixels alpha value to 0 if not set it to 1
use glTexImage2D(…) with the modified texture data (it now has a alpha channel)
and use
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, 0 );
easier still is to make in some paint program the alpha’s 0 of the pixels u dont wanna see and save the textures as a RGBA image.
Thankyou for that tip.
Can I paint RGBA-Textures with Photoshop?
I know that you can work with layers, but how can I save such a picture with Alpha-values?
How do you get the alpha channel out of a seperate texture? That would be easier for me to handle cuz I don’t have any money, nor a program that can decently store an alpha channel. I have yet to try Ulead PhotoImpact6 in this respect though. I hope it can… I hope it can…
You can also get a port of the Gimp for Win32. (Check www.cygwin.com, there’s a link to it somewhere there.) It does a lot of similar things to what you can do in Photoshop, but it’s free. The one thing I don’t like about it is that it doesn’t exactly have a standard Windows UI, which is understandable since it was written for UNIX/Linux. Still… it gets to be annoying.
TorbenKeil - To get an alpha channel in Photoshop go to the “Channels” panel. It should be one of the tabs in the “Layers” panel, if I recall right. Click the button on the bottom for “new channel” and you’ll get an alpha channel. Click on that channel to write to it. (Grayscale only for that channel)
Okay, if I understood right, I have to paint with photoshop and then enable the alpha-values?
And then on the Alpha-channel I can ‘draw’ the alpha-values in 8 Bit Greyscale.
Okay, then I have to save it as targa and load it somehow into my OpenGL-program.
But how? Nehe’s tutorials only load normal BMPs…
Help me again…