But if I then add ONE 4 poly quad, with a single 256x256 texture, the framerate drops to 30fps. How can a 800 poly ship render at 60fps, yet one more quad in a seperate entity slaughter the framerate?
If I add just one hundred quads, the framerate drops to 10fps and is unplayable.
Here's my bind/rendering code for pspgl, you can get the full engine in the release forum.
Code: Select all
virtual void Bind()
{
Profile->Enter("Bind\n");
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3,GL_FLOAT,0,_verts);
_mat->Bind();
_mat->_texs.start();
while( _mat->_texs.next() == true )
{
Texture *tex = _mat->_texs.get();
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(3,GL_FLOAT,0,_coords[tex->_coordset]->_uv);
}
Profile->Leave("Bind\n");
}
virtual void Unbind()
{
Profile->Enter("Unbind\n");
glDisableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3,GL_FLOAT,0,NULL);
_mat->Unbind();
_mat->_texs.start();
while( _mat->_texs.next() == true )
{
Texture *tex = _mat->_texs.get();
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glTexCoordPointer(3,GL_FLOAT,0,NULL);
}
Profile->Leave("Unbind\n");
}
virtual void Render()
{
Profile->Enter("VL_Render\n");
glDrawElements(GL_TRIANGLES,_tric*3,GL_UNSIGNED_INT,_tris);
Profile->Leave("VL_Render\n");
}
Code: Select all
Function:Unbind
Total(Seconds):2.868000
Avg(Ms):0
-----------------------Function:VL_Render
Total(Seconds):48.893002
Avg(Ms):0
-----------------------Function:Bind
Total(Seconds):3.407000
Avg(Ms):0
-----------------------Function:Main Loop
Total(Seconds):83.888000
Avg(Ms):171
-----------------------End of profile dump.
Logger deleted
So, is there anything faster than glDrawElements? Can I write my own renderer using gu that won't be such a huge bottleneck?
I mean, how do you do a particle engine without using lots of tri-based quads? Do most psp games use a single surface particle system?