xcrypt at November 20th, 2012 14:55 — #1
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
rouncer at November 20th, 2012 15:43 — #2
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...
xcrypt at November 20th, 2012 16:09 — #3
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.
reedbeta at November 20th, 2012 17:26 — #4
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.
rouncer at November 20th, 2012 20:58 — #5
Another idea, it also would give you this really whacky way to wrap an object discontinuously, like having the texture coordinates in the triangles.
thenut at November 20th, 2012 21:52 — #6
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.