Maximum Number of Texture Objects

I am working on developing a particle system modeler using OpenGL and texture-bound point sprites. It works fine, up to the point that I really crank up the number of points generated, and I hit a limit on the number of texture objects I can render (I guess?). Stranger still is that I’m only using a single texture (I only call glBindTexture once), so I assumed I should be able to render a great deal of points that share a single texture. Does anyone know how to increase this limit? Or if I’m making a common noob mistake. Here is a code example:

glEnable(GL_TEXTURE_2D);
glEnable(GL_POINT_SPRITE);
glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_TRUE);
glPointSize(4.0f);
glBegin(GL_POINTS);
//can only call glVertex3f here so many times before I stop seeing rendered points
glEnd();

I know this is a texture issue, since if I instead just render primitive points, I can generate as many as I want.

I’m guessing that you’re probably hitting some kind of immediate mode limitation, and so I would recommend storing the points inside a VBO instead.

Hm, difficult, but what HexCat said does make sense. Did you try it on another PC (with another vendor’s hardware) ?

Point-sprites are evil, anyway (in my opinion), because they have some serious limitations regarding their size. You might want to switch to billboarded quads.

If HexCat is right, it might be possible to render more sprites, by limiting the number of glVertex calls between glBegin/glEnd, and just do several glBegin/glEnd calls.

Ie:
loop over n calls
{
glBegin (GL_POINTS);

loop over m sprites
{
glVertex…
}

glEnd ();
}

Hope that helps,
Jan.

Seems that simply calling glEnd/begin (as suggested by Jan) every so many particles is a quick fix. Although I’m going to try to use VBOs eventually as I understand it will help with performance.