Blending Question
I have a 32 bit image with varying alpha values and I want to use it as transparent texture. Now I know I can use the...
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA,GL_ONE);
...blending functions for "any" texture (alphas set or not). I'm wondering if there's a way to take advantage of the alpha values set in the image without having to use a blending function? I want to do this since I can pick regions in my texture that are more opaque or transparent.
Thanks in advance,
pseudosig
Having more or less opaque regions in a texture to render correctly you need blending functions. You can however skip pixels below a specific threshold (using alpha test) and render the rest without blending (fully opaque).
Blending means you get a single color of two or more input colors by using a blending equation/function. This can use colors for the blend weights or alpha. You can't however render transparent (blended) objects without blending.
Blending means you get a single color of two or more input colors by using a blending equation/function. This can use colors for the blend weights or alpha. You can't however render transparent (blended) objects without blending.
Thanks. One more thing then, I currently have an array of texture coordinates...
(Code snip)
glNormalPointer(GL_FLOAT, 0, m_surf_normals);
// my triangle vertices...
glVertexPointer(3, GL_FLOAT, 0,m_vert_ary);
glTexCoordPointer(2, GL_FLOAT, 0, m_tex_cords);
glDrawArrays(GL_TRIANGLES, 0, m_triangle_count*3);
Each texture coord is applied to a triangle. How can I vary the transparency of each triangle when using gl*Pointer functions?
Thanks again,
pseudosig
(Code snip)
glNormalPointer(GL_FLOAT, 0, m_surf_normals);
// my triangle vertices...
glVertexPointer(3, GL_FLOAT, 0,m_vert_ary);
glTexCoordPointer(2, GL_FLOAT, 0, m_tex_cords);
glDrawArrays(GL_TRIANGLES, 0, m_triangle_count*3);
Each texture coord is applied to a triangle. How can I vary the transparency of each triangle when using gl*Pointer functions?
Thanks again,
pseudosig
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement