Sorting multipass render objects pipeline

Started by
-1 comments, last by Zemedelec 19 years, 10 months ago
This question is especially targeted to people using ID3DXEffect framework for render state setup, but not only. I have RenderObject with its VBs,IB,VB offets,IB offset,vertex declaration,effect,effect params. Effect (or the way the object is drawn) is multipass one, with the ristriction that geometric streams stays the same (else we need other effect). But (vs,ps,ffp setup) + shader params change between passes. How to sort RenderObjects in that situation? When there are many objects with the same effect it is more appropriate to render first pass for all of them, then render the other passes in the same manner. When RenderObjects have all different shaders it is more suitable to render them one by one, after completing all passes for the previous object. How to mix that both techniques? I had an idea of splitting effect into passes, and to put passes as separate entities to be sorted... Any other ideas? Second question: the interface of the RenderObject. Now I have just one function that gives the rendering system the minimal data for the sorting job - a DWORD stream (vb1id,vb1offset,vb2id,vb2offset,ib,iboffset,vdeclid,shaderid,difftexid,normtexid,custid1,custid2,...). custidX are for custom shader params, that will sort RenderObjects of one effect pass (same shaderid). Other function is the Setup( SETUP_VB1 | SETUP_VB2 | SETUP_IB | SETUP_SHADER ) function, that tell exactly what is needed to be setup by the RenderObject. The system tracks the usage of resources and calls RenderObject::Setup() only with needed flags. Comments...?

This topic is closed to new replies.

Advertisement