Archived

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

tyreth

Alpha Blending

Recommended Posts

Hello I have been trying for quite a while now to get alpha blending working properly. I am using SDL 1.23, SDL Image 1.20, and OpenGL in Linux. I use SDL Image to load the image (png, bmp, tga I have tried I think). I bhave a 3D application, and am trying to create a cursor. I can get the cursor to draw, but not with proper blending. For example, glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); which was recommended in NeHe''s tutorials caused nothing to blend. I tried various combinations for glBlendFunc (not knowing fully what they do), and received mixed results - the best being the supposedly transparent area being totally transparent, but the colored areas still being semi-transparent. Help using SDL Image to load a png, and so that only the transparent bit is transparent, and the rest is solid would be much appreciated. The problem may be with the alpha channel not being properly setup, so help doing this with the GIMP would also be useful. (when I load my png image in the gimp, it shows the transparent area as the grey grids you normally get). Thanks for any help Tyreth

Share this post


Link to post
Share on other sites
I don''t know - that''s half the problem. In the gimp when I use the color picker on a colored area of my png, it says Alpha is 255, and the transpared (grey gridded bit) is an Alpha 0. I have also tried with images that seem to work for other applications, but I still can''t see what I am doing different.

Share this post


Link to post
Share on other sites
gimp saves tga''s differently than say photoshop.
make a 256x256 sized image and save it as a uncompressed tga file. now see how large the file is if its 256kb then theres an alpha channel. if its 192kb then there is no alpha channel.

Share this post


Link to post
Share on other sites
I think that your question is being answered in the NeHe forum. (right click on the image and layers->add alpha channel)

Share this post


Link to post
Share on other sites