   VBO performance on non 'closed' objects
  Hi guys, me again.My whole engine is running on VBO / (E)IBO.Objects are static, not animated being rendered when in view frustum by a :for(x=0;x<objects_max;a++){if(object_in_frustum){  //visiblerender_with_VBO(x);}}I have noticed that when i draw models which are 'closed' i get plenty of FPS boost, around 60FPS ~4mln polys.But, when i render a tree for example the rendering is going so slow that it comes with 30FPS with 30k polys.What do i mean by saying 'opened' object - this term has been told to me by my 3d team. An opened object is an object like a tree ( having open polys ), grass.So i made a small test,i have created an VBO to emulate a simple 'open' object.I wanted to fill the 32x32 quad with the triangles which will be drawn by VBO and IBO.32*32=1024 - 1024 triangles to be drawn by VBO.I have created my VBO with GL_STATIC_DRAW IBO the same way and i have compiled the code.I have 7900GT Nividia and the test went bad,around 30FPS were rendered that time.Then i loaded a "BOX" object and rendered it the same way - got 300FPS..When to use VBO and when not to use it?Any other tricks you would recommend ?Why all my models that have the geometry 'closed' render very fast,but those (like grass) made with open geometry where quads are to be leafs - render verrry slow?Any idea?   
  there shouldn't be any difference, cause opengl don't see stuff as hole objects(closed or open).Instead it just sees a bunsh of primitives which it has to draw(triangles in ur case).So when u use in both tests the same amout of trinalges u should get the same frames amount.The only thing i could think about that backside clipping could have some impact on the performance?Cause if it is and u look at the cube only  1/4 of the triangles get drawn^^   ;  Well we switched our engine to 'batch' rendering now,all objects the same type render with one call ( glDrawElements )Still the same..I render a heightmap 256x256 with stepping of 1 so it is a 65536 * 3(triangles) = 196608And i get around 500FPSWe have performed many many performance tests yesterday,the effects are misleading..A single box rendered * 100, gives 30FPSA "Teapot" from 3DS MAX rendered * 100, gives 350FPS All that on 7900GT...What might be the problem here?We are lost at this moment...;  In your tests, are the different objects using different materials (alpha testing, alpha blending, depth-test, depth-write, shaders, etc)?   ;  Normally in the game, yes there is Alpha testing and multitexturing also per model.But the testing goes without texturing, just glDrawElements.No Normals, No textures - right now.Also no culling at all in the whole engine. glBindBuffer( GL_ARRAY_BUFFER,BATCH[a].m_nVBOVertices  );glBindBuffer( GL_ELEMENT_ARRAY_BUFFER,BATCH[a].m_nVBOIndices);   glEnableClientState(GL_VERTEX_ARRAY); glVertexPointer( 3, GL_FLOAT,sizeof(XYN_vbo_vert),(char*)0);// glDrawElements(GL_TRIANGLES, BATCH[a].numOfFaces*3,GL_UNSIGNED_INT,0);  glDrawRangeElements(GL_TRIANGLES, 0,  BATCH[a].numIndices, BATCH[a].numOfFaces*3, GL_UNSIGNED_INT,0);glDisableClientState(GL_VERTEX_ARRAY); glBindBufferARB( GL_ARRAY_BUFFER, 0);glBindBufferARB( GL_ELEMENT_ARRAY_BUFFER, 0); what about the alpha/tests you have mentioned?   ;  Ok guys,i return with a test screenshots and a few words in regards to batching we have implemented - and still the same.[XYN:LOADER] Model summary[XYN:LOADER] Objects inside: 1[XYN:LOADER] Vertices: 645[XYN:LOADER] Faces   : 512[XYN:LOADER] Indices : 1536[XYN:LOADER] Textures: 1[XYN:LOADER] Model summary[XYN:LOADER] Objects inside: 1[XYN:LOADER] Vertices: 2431[XYN:LOADER] Faces   : 4818[XYN:LOADER] Indices : 14454[XYN:LOADER] Textures: 1Batching pipeline:GenerateBatch();RenderBatchVBO();DeleteBatch();What has been the problem and persists as a problem still is the strange behaviour of the VBO render.We draw objects with:glDrawElementsand even switched toglDrawRangeElementsAnd it has been already confirmed that objects having less poly render slower (MUCH SLOWER) than those having a lot of polys ( proof above ).Before we were using a single DrawElements call per object in the scene, and the results were almost the same as now - when we batch all objects the same type into one big VBO and using one DrawElements call we render them.481800 polys render with ~19FPS51200 polys render with ~19FPSwhat might be the trick here?We tried non-batched approach, we have batching right now and nothing helps..We generate the vbos before we render the scene not to fall into 'race condition' where a scene is being rendered and a VBO for a batch is not prepared,after succesyfull render we glDeleteBuffersARBto free the memory.Any clues?;  Keep in mind there is a lot more to FPS than just number of vertices. You also have fill rate to consider. Your tree model is a lot "larger" on the screen than your human, so you are making much more work for texture lookups, fragment shaders, etc.Try to run your game at stupidly low resolution (like 10x10 or something) and I'll bet you see the discrepancy disappear.;  10x10 - still the same.   ;  Modern graphics cards store the result of the vertex shader in a cache. If another triangle uses a vertex that was processed recently, it can get the results from the cache instead of running the vertex shader a second time.In your first example, you've got lots of disconnected shapes, and hardly any of those vertices are going to be shared between triangles. In your second example -- assuming that the triangles are indexed in a sensible order -- most of the vertices will be re-used by more than one triangle.At a (complete) guess you could say that on average for your first example, each triangle has to process 2 vertices (1 is reused), and with your second example, each triangle has to process just 1 vertex (2 are reused).This explains some of the reason why the second example runs so much faster, but not the whole story, sorry...Quote:And it has been already confirmed that objects having less poly render slower (MUCH SLOWER) than those having a lot of polys ( proof above ).No, if you want to prove that, delete the legs from your second model and see if it increases the render times.   ;  Are you creating and deleting vertex (and index) buffer each frame?You must create VBO and IBO before main loop. At rendering time only fill the buffers. And delete them only when program finishes.   