Max # of Point Sprites 30 fps

Started by
6 comments, last by ddn3 14 years, 1 month ago
Hi everyone, I was just wondering what's max # of sprites you can have before you dip below 30fps on a iPhone 3G. With my current implementation using OpenGL point sprites. I can get to about 700 sprites before it dips below. At around 5000 sprites it goes to around 6-7 fps. Is this the limitation of the system or is there another way to draw more sprites? Thanks for the replies,
Advertisement
Over 9000!

[edit]How are you currently drawing the sprites? Do you lock/unlock any buffers each frame?
Im just using glDrawElements(GL_POINTS ...) to do them, I did not lock or unlock any buffers (not too sure how this ones goes?)
I think i got it up too 2000 at 30fps, using some demo I found off the internet. That was on the iPod Touch though.

-ddn
I looked up some code using VBOs can someone give me a hand? I can't get it to render:

init(){GLuint vboIDs[4];glGenBuffers(4 ,vboIDs);		//create 3 vbos//verticesglBindBuffer(GL_ARRAY_BUFFER, vboIDs[0]);glBufferData(GL_ARRAY_BUFFER, blotCount*8, blotVertex, GL_STATIC_DRAW);	//texturesglBindBuffer(GL_ARRAY_BUFFER, vboIDs[1]);glBufferData(GL_ARRAY_BUFFER, blotCount*8, blotVertex, GL_STATIC_DRAW);	//colorsglBindBuffer(GL_ARRAY_BUFFER, vboIDs[2]);glBufferData(GL_ARRAY_BUFFER, blotCount*16, blotColor, GL_STATIC_DRAW);//indexesglBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vboIDs[3]);glBufferData(GL_ELEMENT_ARRAY_BUFFER, 6*blotCount, blotTriangle, GL_STATIC_DRAW);//reset so other's can draw firstglBindBuffer(GL_ARRAY_BUFFER, 0);glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);}draw(){	glEnableClientState(GL_VERTEX_ARRAY);	glEnableClientState(GL_COLOR_ARRAY);	glEnableClientState(GL_TEXTURE_COORD_ARRAY);	//vertices	glBindBuffer(GL_ARRAY_BUFFER, vboIDs[0]);	glVertexPointer(2, GL_FLOAT, 0, 0);		//textures	glBindBuffer(GL_ARRAY_BUFFER, vboIDs[1]);	glTexCoordPointer(2, GL_FLOAT, 0, 0);		//colors	glBindBuffer(GL_ARRAY_BUFFER, vboIDs[2]);	glColorPointer(4, GL_UNSIGNED_BYTE, 0, 0);		//textures	glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vboIDs[3]);	glDrawElements(GL_TRIANGLES, 6*blotCount, GL_UNSIGNED_SHORT, 0);		glBindBuffer(GL_ARRAY_BUFFER, 0);	glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);}


Where:

vertex:137.000000,113.000000,157.000000,113.000000,137.000000,133.000000,157.000000,133.000000
uv:0.000000,0.000000,0.500000,0.000000,0.000000,0.500000,0.500000,0.500000
color:214,50,20,60,214,50,20,60,214,50,20,60,214,50,20,60
index:0,1,2,1,2,3
You want to draw billboard sprites instead and sort them per texture. Should be able to draw a whole lot more :)
thanks for the reply,
mine are already sorted by texture.

just as draw elements its not fast enough

and I cant get VBOs to work.
Check out the OOlong engine it has a point sprite implementation. For the iPhone you have to use some extensions to enable them (using VBOs)

http://oolongengine.com/

Also you can check out this post from another forum :

http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=258029

he posted a small small code of point sprite rendering.

Good Luck!

-ddn

This topic is closed to new replies.

Advertisement