vertexT BillboardData[6] = {
// x y z r g b nx ny nz s t
{{ -1.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 1.0, 0.0},{0.0, 0.0}},
{{ 1.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {1.0, 0.0}},
The texture loading from before works just fine
void BillboardClass::LoadTexture() {
BitMapFile *image[1];
image[0] = getbmp("tree1.bmp");
glGenTextures(1, Textures);
glBindTexture(GL_TEXTURE_2D, Textures[0]);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, image[0]->sizeX,
image[0]->sizeY, 0, GL_RGBA, GL_UNSIGNED_BYTE, image[0]->data);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
float color[] = { 1.0f, 1.0f, 1.0f, 1.0f };
glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, color);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glGenerateMipmap(GL_TEXTURE_2D);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
GL_NEAREST_MIPMAP_NEAREST);
return;
}
- GL_REPEAT The integer part of the coordinate will be ignored and a repeating pattern is formed. (A mod operation)
- GL_CLAMP_TO_BORDER means coordinates outside of the range (s,t 0-1) will be given the border color.
- And this is set in the next command.
- GL_CLAMP_TO_EDGE means that the coordinates outside will be set to the values at the edge of the texmap
- GL_MIRRORED_REPEAT The texture will also be repeated, but it will be mirrored when the integer part of the coordinate is odd.