• FEATURED

View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# Rendering Efficiency: Many matrices vs. resubmitting points

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

3 replies to this topic

### #1anstmich  Members

Posted 16 January 2012 - 01:51 AM

Hi all,

I have a quick question regarding the computational costs of different methods of rendering a large set of points. Consider, for example, that you were trying to deform a solid on a per-point basis. I can think of two options for managing the deformation:

1) render each point one at a time, pushing and popping a new matrix containing the necessary translation information for each individual, pre-allocated point, or

2) calculate the new point positions, generate values locally, and then resubmit the vertex data to the gpu.

Which of these methods would ultimately yield the best performance? My gut feeling is that the second method is more likely to be "correct" however I fear that resubmitting a large number of points regularly could be bad. Are there any other methods for manipulating vertex data efficiently?

### #2V-man  Members

Posted 16 January 2012 - 04:34 AM

you have dynamic vertices
http://www.opengl.org/wiki/VBO_-_more#Dynamic_VBO

and general info
http://www.opengl.org/wiki/Vertex_Buffer_Object
http://www.opengl.org/wiki/VBO_-_just_examples
Sig: http://glhlib.sourceforge.net
an open source GLU replacement library. Much more modern than GLU.
float matrix[16], inverse_matrix[16];
glhTranslatef2(matrix, 0.0, 0.0, 5.0);
glhScalef2(matrix, 1.0, 1.0, -1.0);
glhQuickInvertMatrixf2(matrix, inverse_matrix);
glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

### #3LorenzoGatti  Members

Posted 16 January 2012 - 05:01 AM

3) Send points in their baseline position once, keep them in a VBO, and deform the same points on the GPU in different ways every frame with a vertex shader that needs very little input (small textures to represent changing deformation shapes, low-dimension interpolation between key positions, and so on).

Omae Wa Mou Shindeiru