Alpha on Quadrics
Hi everyone,
Long time listener, first-time caller.
I''m trying to get a quadric object (gluDisk) to show its alpha channel. What do I need to do except setting the color with an alpha and drawing the object? Lame question, I know. Please help.
Thanks
awesome... welcome! I don''t know if you can specify the alpha channel of each vertice of a quadric, but I know you can generate the quadrics with texture coordinates... so perhaps you can apply a texture with an alpha channel. Even if the texture is just all white with special alpha values that you desire. Or I can provided you with an algorithm to generate the vertices of any size disc at any resolution if you really want... its simple trig
Whatsoever you do, do it heartily as to the Lord, and not unto men.
1. Enable blending during INITIALISATION
glEnable (GL_BLEND);
2. Disable depth writes when RENDERING the transparent object
glDepthMask (GL_FALSE);
3. Render the transparent object
4. Re-enable depth writes after drawing the transparent object
glDepthMask (GL_TRUE);
If you don't disable depth buffer writes, sometimes the pixels won't blend into ones further away.
Hope it helps
-MENTAL
glEnable (GL_BLEND);
2. Disable depth writes when RENDERING the transparent object
glDepthMask (GL_FALSE);
3. Render the transparent object
4. Re-enable depth writes after drawing the transparent object
glDepthMask (GL_TRUE);
If you don't disable depth buffer writes, sometimes the pixels won't blend into ones further away.
Hope it helps
-MENTAL
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement