Posted March 25, 200619 yr I have a texture mapped onto a quad. It has an alpha component, it has a texture generated with an alpha component, but it's not blending. I've put these while initializing OpenGL: glEnable(GL_BLEND); and glBlendFunc(GL_SRC_ALPHA,GL_ONE); Anyone have any idea why it's not working?
March 26, 200619 yr Because you can't copy and paste code out of Nehe's tuts, lawl J/k Did you remember to add this part? if(blend) // Is blend TRUE? { glEnable(GL_BLEND); // Turn Blending On glDisable(GL_DEPTH_TEST); // Turn Depth Testing Off } else // Otherwise { glDisable(GL_BLEND); // Turn Blending Off glEnable(GL_DEPTH_TEST); // Turn Depth Testing On }
March 26, 200619 yr Author I didn't use NeHe's tuts for this one.... :) But that doesn't help. Nothing changes if I disable depth testing...
March 26, 200619 yr Well, that's all they do in the tut, http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=08 glBlendFunc() then disable/enable depth-testing and blending... Compiles fine for me on linux, not sure what your problem is then :[
March 26, 200619 yr Author Oh, it compiles fine, it just doesn't blend. The alpha section is just plain not blending.
March 26, 200619 yr Well, if you're trying to work with Nehe's tut, keep in mind you gotta hit B after launching the app: http://xs73.xs.to/pics/06120/cube.jpg Blending is actually rather simple, gonna mess with it in orthographic project later (probably make some kind of animated fog background, like in a sidescroller)
March 26, 200619 yr Author Nvm... I did something stupid. The image was 65x65, so I used paint to cut it down to 64x64 in a hurry, but paint removed the alpha channel. Oh well :)