i have been doing some work on simulation on trees in the past few days,
but i met some problems now, may someone can help me. Thanks a lot.
i bind the texture of leaf and after alpha test,
the edge of these textures are black, just as it background color,
so it looks not very well,
the code are shown as blow.
glBindTexture(GL_TEXTURE_2D,texture_leaf); glEnable(GL_TEXTURE_2D); glNormal3f(0.0, 0.0, -1.0); glEnable(GL_ALPHA_TEST); glAlphaFunc(GL_GREATER, 0x0); glBegin(GL_POLYGON); glTexCoord2f(0.0f, 0.0f);glVertex3f(-0.5f,0.0f,0.0f); glTexCoord2f(1.0f, 0.0f);glVertex3f(0.5f,0.0f,0.0f); glTexCoord2f(1.0f, 1.0f);glVertex3f(0.5f,1.0f,0.0f); glTexCoord2f(0.0f, 1.0f);glVertex3f(-0.5f,1.0f,0.0f); glEnd(); glDisable(GL_ALPHA_TEST); glDisable(GL_TEXTURE_2D);
texture and simulation results are show in the followed pictures
as the third picture shown, the black edge looks not well,
so how can i fix this problem or is there any better method to simulate tree?