(is it OK to post that link?) Now in the video, collision detection is off and it uses an on^2 algorithm because I wanted to get a simple demo up quickly. This engine also does not use a vertex buffer. My challenge now is getting that engine to support 1000 objects, maybe up to 10000 objects. As you know, I had to make the circle code myself (41 polygons each) because Direct X does not plot circles.
My dilemma is this. How do I effectively load that many objects into a vertex buffer and be able to update the positions of each of them at the same time and still have time left over to do collision detection and response and the other stuff I need to do? The engine in the video uses DrawPrimitiveUP calls to Direct X, in a simple for loop, that iterates through each object's vertices and does a draw call. This works for about 500 objects (assuming I take the collision detection and response with other objects out), and paints them nicely on the screen.
I have a vertex buffer that is dynamic (although I have tried static), and basically what happens is I load the vertices on program start up and then lock the buffer once each frame to update all object positions. This however does not work very well in the current project. Only about 3100 vertices can be supported if that. Now assuming we take the matrix transformation bit out and use basic pixel particles for a second here. I update the positions of the particles manually using the CPU. What is the most efficient method to say load 20,000 or more pixel particle vertices into the vertex buffer and achieve high frame rates?
Right now I have a class called particle that has properties such as velocity acceleration and of course a single vertex that stores xyz and position data. This vertex gets updated based on the CPU each frame. I also have a vector of particles in the scene. I am filling them into the vertex buffer one by one using methods described in this article -> http://www.gamedev.net/reference/articles/article1946.asp. Of course this can not support as many particles as I need to support. It slows down extremely fast with a high number. What I would really like to do is update the positions of the particles then memcpy them all in one go to the vertex buffer. Would this be efficient for say 20,000 particles? How would I go about memcpying the Vertex positions that are stored in a vector of class particle?
By the way, I know all of this is possible. I have seen for example the chipmunk physics engine do this rather easily. It supports a ton of objects. I would like to know how people do the rendering calls for each object, being able to update all those positions. Look at this video ->
I think geometry instancing may be out of the question because each of those objects are unique. How does the maker render all those unique objects, each with position, velocity, acceleration, etc?
[Edited by - LostTime77 on June 27, 2008 2:21:36 PM]