There are many sprites to render me, and want to get feedback from those who have performed in this area Has pushed. / P>
So I sort by shader and texture. And to send the shaders to submit, VBO has batches of sprites with the same render settings. All the normal things are my phantom all classes and all have the same basic data: central position (p), orientation (o), scale (s), rgb color (colonel) and global ambiguity (alpha). I have to update the situation and orientation in the CPU code (although almost 50% do not change between any pair of Sprite Frame) and scale, color and opacity almost never change for the phantom, but never really.
I can not accept geometry shaders (I will support them, but in that case there is a question).
I want to:
-
When I update the phantom posts, calculate the top positions on the CPU peak shader make a simple change step (to each frame A significant amount of data is available to update, but the CPU has to trigger a lot of).
-
POS data as additional data is kept in VBO, duplicated for 4Writes, then in simple case the offset (-1, -1; -1) , 1; 1,1; 1, -1) should be triggered in the shader (the advantage is that the GP is calculated more, but each head has 5 additional words of data).
-
It is not clear which is better, so seeing both approaches requires profiling what happens.
In my large number of particles from experience, I will use the option (2). Maybe you can pack offset / index indices in your data (like the W-component of your postion vector, if you do not use it yet)? 0 = (-1, -1); 1 = (-1,1); 2 = (1,1); 3 = (1, -1).
(As suggested by Ian, I have copied my comment in a reply!)
@ IN: If I understand you hard, you said that you have a global ambiguity / alpha, so you should be able to use a
uniform for it and enter your <<> code Code for
vec4 color . However, I suspect that this will make a difference ...
By the way, the geometry shader solution you mentioned earlier will not only be more elegant, but will be a little faster.
Comments
Post a Comment