   Slow when rendering lots of points
  I'm generating approximately 800.000 points in my scene right now and it gets kind of slow when trying to move around in the scene.What can be done to increase the speed when moving around in the scene?   
Quote:Original post by spirreI'm generating approximately 800.000 points in my scene right now and it gets kind of slow when trying to move around in the scene.What can be done to increase the speed when moving around in the scene?If you're using immediate rendering calls (ie: glBegin/glVertex/glEnd) then that's probably the main problem.  You should use vertex arrays, display lists, or VBOs so that you can render with just one (or a few) function call instead of 800k+ function calls.You didn't really give us much information so that's probably the best advice you're going to get unless you post your rendering code.   ;  What do your mean by 'Kind of slow'?If you want to test your performance. Get your card base speed (say 80 million tris/sec) and multiply it by 3 (if you are doing points).Then compute how many instructions are being used to transform each point in the GPU. Usually a matrix multiplication. You can get the exact number of cycles using a shader profiler (like FXComposer or RenderMonkey). Lets say it takes 30 cycles to transform one vertex. So you have 80million*3/30 = 8 million verts/secNow, 8 million verts/sec is about 10FPS rendering your 800000 particles in the best case. You should check how your are batching your primitives or if your verte buffer has been appropiately created.Luck!Guimo;  By "Kind of slow" i meant 0.5-1 fps slow..Display lists did improve alot. Thanks !   ;  The next step would probably be, to determine if all of those points are within your point of view, and only render those who are.Read up on "frustum culling" and "spatial partitioning" for thatGreetsChris   ;  ok, I thought i should give frustum culling a shot too.But how will it work with the display lists?I have set up the lists like this:glNewList(pointlist, GL_COMPILE)for(int i=0; i< verts.Length; i++){    glBegin(GL_POINTS);    glVertex3f(verts.x, verts.y, verts.z)    glEnd();}glEndList();Then I calculate frustum planes, but then how will the checking if the points are inside or outside the frustum be done?I based my implementation on this example;  You can't do dynamic frustum culling (if your frustum moves at all) with a single display list. Not that it would matter anyway, since culling invidual vertices on software is prohibitively expensive.The solution: use a spatial culling hierarchy. Correct me if I'm wrong, but I think your vertices are rather evenly spaced in space. So, a good solution would be an octree. Google/whatever for it. Basically, what you would do, is to set up a octree with leaf nodes of say, ~5000 points (stop the division on a given node when you reach 5000 points or less). Then set up a display list of each of those leaf nodes. And perform standard hierarchical view-frustum culling on the octree. Just look up "view-frustum-culling" on google. If you think about it a little, you can probably figure out how to derive a octree node's bounding box to intersect against the view frustum.   ;  Before you do anything, please put the glBegin/glEnd instructions outside of the drawing loop. There's no reason to call glBegin(), draw a single vertex, call glEnd(), then call glBegin() again... It's a killer. You're pushing 800,000 vertices, plus you do 800,000 glBegin/glEnd for no reason. Do it like this:glNewList(pointlist, GL_COMPILE)glBegin(GL_POINTS);for(int i=0; i< verts.Length; i++){    glVertex3f(verts.x, verts.y, verts.z)}glEnd();glEndList();;  True, but it shouldn't affect anything when creating a display list anyway? Using straight immediate mode it's going to surely kill performance, yes.   ;Quote:Original post by oggialliTrue, but it shouldn't affect anything when creating a display list anyway? Using straight immediate mode it's going to surely kill performance, yes.Calling glBegin and glEnd excessively will definitly affect something.  Your program.That's two excessive fucntion calls EACH ITERATION OF YOUR LOOP.  The function calls are relatively quick if you just do it once, but doing it tons of times for no reason will definitly slow it down as it ends and begins every time you want to draw a little something.   