weebull
03-22-2003, 05:59 AM
I have this image with a circular alpha channel in the middle
http://www.redbrick.dcu.ie/~creech/proper.jpg
and when i load it in with some alpha blending it looks like this
http://www.redbrick.dcu.ie/~creech/wierd.jpg
i use the following to blend it:
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, 0);
and this is my init code
glEnable(GL_TEXTURE_2D);
glShadeModel(GL_FLAT); // Enable Smooth Shading
glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // Black Background
glClearDepth(1.0f); // Depth Buffer Setup
glDepthFunc(GL_LESS); // The Type Of Depth Testing To Do
glEnable(GL_DEPTH_TEST); // Enables Depth Testing
//glEnable(GL_CULL_FACE);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Really Nice Perspective Calculations
i know that its fading out to black because of the clear colour but what is with the banding?? And can i stop it from fading to black at all? and actually use the alpha channels?
[This message has been edited by weebull (edited 03-22-2003).]
[This message has been edited by weebull (edited 03-22-2003).]
http://www.redbrick.dcu.ie/~creech/proper.jpg
and when i load it in with some alpha blending it looks like this
http://www.redbrick.dcu.ie/~creech/wierd.jpg
i use the following to blend it:
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_GREATER, 0);
and this is my init code
glEnable(GL_TEXTURE_2D);
glShadeModel(GL_FLAT); // Enable Smooth Shading
glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // Black Background
glClearDepth(1.0f); // Depth Buffer Setup
glDepthFunc(GL_LESS); // The Type Of Depth Testing To Do
glEnable(GL_DEPTH_TEST); // Enables Depth Testing
//glEnable(GL_CULL_FACE);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Really Nice Perspective Calculations
i know that its fading out to black because of the clear colour but what is with the banding?? And can i stop it from fading to black at all? and actually use the alpha channels?
[This message has been edited by weebull (edited 03-22-2003).]
[This message has been edited by weebull (edited 03-22-2003).]