Original Post
hi, I'm looking for a way to render small vegetation objects like bushes. I've decided to use planes which get a bush or grass texture. The problem is that all these planes are single-sided so that the bushes disappear when looked from behind. I've solved this by creating 2 planes from the vertices but using a different order of the vertices so that the surface normals point in other directions:
glBegin(GL_QUADS);
{
glTexCoord2f(1.0, 1.0);
glVertex3f( -0.5, 1.0, 0.0);
glTexCoord2f(0.0, 1.0);
glVertex3f(+0.5, +1.0, 0.0);
glTexCoord2f(0.0, 0.0);
glVertex3f(0.5, 0.0, 0.0);
glTexCoord2f(1.0, 0.0);
glVertex3f(-0.5, 0.0, 0.0);
}
glEnd();
glBegin(GL_QUADS);
{
glTexCoord2f(0.0, 1.0);
glVertex3f(+0.5, +1.0, 0.0);
glTexCoord2f(1.0, 1.0);
glVertex3f( -0.5, 1.0, 0.0);
glTexCoord2f(1.0, 0.0);
glVertex3f(-0.5, 0.0, 0.0);
glTexCoord2f(0.0, 0.0);
glVertex3f(0.5, 0.0, 0.0);
}
Then I store the planes in a display list (a bush consists of 4-8 planes). Is there a way to optimize this? Maybe have the normal always facing the camera so that I don't need that 2nd plane or use a different storage method for the data such as VBOs? I've been reading some articles about VBOs and I'm not sure whether they would be useful/faster in my case.