Jump to content
Posted 20 January 2013 - 02:21 PM
Posted 20 January 2013 - 02:54 PM
It’s not “normal” (as in not a lot of people are doing this) but it is the best way to go in terms of efficiency for some things.
If it is for the HUD and, as you say, static objects, yes, this is best.
For moving objects, you would have to convert from pixel coordinates to normalized screen coordinates manually on the CPU, which will likely be slower to do than on the GPU, especially for batch rendering.
For your case of static objects, omitting the matrix transform (which just transforms things into -1 to 1 anyway) is the best way to go. Not only does it save on cycles but also on bandwidth, as there is less to send to the shaders.
Edited by L. Spiro, 21 January 2013 - 12:34 AM.
Posted 20 January 2013 - 03:27 PM
Posted 21 January 2013 - 04:25 PM
Posted 22 January 2013 - 12:27 AM
Updating vertex buffers and calculating the normalized coordinates of vertices is slow. You have to decide based on your usage.
If it doesn’t move or moves rarely, use this method. If it moves a lot, use matrices.
HUD elements are just sprites, so there is no single answer. Use this to decide when you should use matrices and when you should not.