[GD-General] Zen of Model Rendering
Brought to you by:
vexxed72
From: Chris B. <Chr...@ma...> - 2003-01-18 09:07:16
|
I've rendered and seen render models in may different ways. However I've always just fudges it and use a single texture per model. Now my engine is getting serious and I want multiple surfaces on my models. Easy, I hacked it in, but after a little while I realised something I had never noticed before(suprisingly). For a surface to be rendered you of course need a separate DrawArrays call (or something similar in D3D). I knew this so I used separate index lists. Now I render the triangles and it all works well, however performance bites and I have a thought. I have a single Vertex array. If I had an object of 10k polys using 10 textures I now presented the vertex array to the API 10 times. This has got to be bad, since on average 90% of those verts won't even be needed. I guess I've found my performance problem. So I decompose the giant vertex array in to mini vertex arrays per surface and remap the indices back in to the new array. This works, but I'm left feeling all those duplicate verts in each array (along seams for example) are evil. Have I don't the right thing? Is this 'the' way to do it? Many thanks Chris NOTICE This e-mail and any attachments are confidential and may contain copyright material of Macquarie Bank or third parties. If you are not the intended recipient of this email you should not read, print, re-transmit, store or act in reliance on this e-mail or any attachments, and should destroy all copies of them. Macquarie Bank does not guarantee the integrity of any emails or any attached files. The views or opinions expressed are the author's own and may not reflect the views or opinions of Macquarie Bank. |