DirectX: What are the (dis)advantages of multi-stream multi-index rendering?

A528d11e2590c45b74a53dadde386125
0
Xcrypt 101 Nov 20, 2012 at 19:55

What are the advantages and disadvantages of multi-stream multi-index rendering? (as is done in a d3d10 sample)
Is it often used in graphics engines? When should I bother to implement it?


Also, I’m back guys, I’ve been off the forums for a while because I changed studies to pure mathematics instead of game dev because I want to do physics programming. But I still want to work on graphics as a side-skill :) Hai to reedbeta - thenut - rouncer - stainless - vilem otte :D

5 Replies

Please log in or register to post a reply.

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 103 Nov 20, 2012 at 20:43

Ive used multiple streams for instancing, in d3d11 - its good for animating loads of instances (an extra matrix per instance) without overblowing the gpu send allowance - But thats classed as multi vertex stream, not multi index, I dont think ive ever used that before, cant think what it would be good for, maybe good for something…

A528d11e2590c45b74a53dadde386125
0
Xcrypt 101 Nov 20, 2012 at 21:09

Well, I suppose it’s not a name you hear tossed around a lot. The name just means that you use multiple vertex buffers for storing index data, and for vertexattributes you only store indices (posindices, texindices, normalindices, …)
Then you have multiple SRV created from buffers that respresent the actual vertex data, those SRV get bound to the shader as buffers in HLSL, and you can acces them within HLSL with your indices.

A8433b04cb41dd57113740b779f61acb
0
Reedbeta 167 Nov 20, 2012 at 22:26

I can’t really think of any good benefits to rendering this way, honestly. You add an extra layer of indirection and therefore slow your shader down with more memory reads. In return what do you get? I suppose you can save some vertex buffer storage by deduplicating positions, normals, UVs etc. separately. But I doubt that saves a significant amount of memory in real-world scenarios, and I doubt it’s worth the extra complexity and slowness.

Using multiple vertex streams can certainly be useful, e.g. for instancing, or for efficiency in different rendering passes (e.g. shadow map pass needs only positions, so you might keep the positions in a separate stream from everything else, improving cache hit rates for the shadow map pass). But I can’t think of anything very interesting to do with multi-index rendering.

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 103 Nov 21, 2012 at 01:58

Another idea, it also would give you this really whacky way to wrap an object discontinuously, like having the texture coordinates in the triangles. :)

6837d514b487de395be51432d9cdd078
0
TheNut 179 Nov 21, 2012 at 02:52

Yeah, I can’t really think of any good reason where multiple index streams would come in handy. Maybe if you wanted to store UVs per polygon instead of per vertex like how all 3D modelling tools work. Although the gain is lost when you have to store another 2 sets of indices and you have to do extra fetches in the vertex shader.