Posted 27 December 2012 - 08:12 AM
<blockquote class="ipsBlockquote" data-author="Retsu90" data-cid="5014676"><p>1) Use only one program for everything. The projection matrix is one, i can group the vertexes and send via glVertexAttribArray the values for shader and draw everything with one call. The problem is the model view matrix, that should be one for every vertex and this isn't the thing that I want because every sprite has own matrix.</p></blockquote>I'm not sure what you mean by this, but maybe what you want is instancing.<br /><blockquote class="ipsBlockquote"><p>2) Continue to use various shader. The projection matrix is shared between programs (how can I do it?), every sprite has own shader with own model view matrix and uniform values. The problem here is that I need to switch the program between sprite draws.</p></blockquote>Uniform buffers make sharing easy.