Jump to content
  • Advertisement
Sign in to follow this  
chibitotoro0_0

Max # of Point Sprites 30 fps

This topic is 3018 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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,

Share this post


Link to post
Share on other sites
Advertisement
Over 9000!

[edit]How are you currently drawing the sprites? Do you lock/unlock any buffers each frame?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

//vertices
glBindBuffer(GL_ARRAY_BUFFER, vboIDs[0]);
glBufferData(GL_ARRAY_BUFFER, blotCount*8, blotVertex, GL_STATIC_DRAW);

//textures
glBindBuffer(GL_ARRAY_BUFFER, vboIDs[1]);
glBufferData(GL_ARRAY_BUFFER, blotCount*8, blotVertex, GL_STATIC_DRAW);

//colors
glBindBuffer(GL_ARRAY_BUFFER, vboIDs[2]);
glBufferData(GL_ARRAY_BUFFER, blotCount*16, blotColor, GL_STATIC_DRAW);

//indexes
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vboIDs[3]);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, 6*blotCount, blotTriangle, GL_STATIC_DRAW);

//reset so other's can draw first
glBindBuffer(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

Share this post


Link to post
Share on other sites
You want to draw billboard sprites instead and sort them per texture. Should be able to draw a whole lot more :)

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!