Jump to content

Featured Replies

Posted

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?

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

}

  • Author

I didn't use NeHe's tuts for this one.... :)

 

But that doesn't help. Nothing changes if I disable depth testing...

  • Author
Oh, it compiles fine, it just doesn't blend. The alpha section is just plain not blending.

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)

  • 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 :)
Guest
This topic is now closed to further replies.