Truly terrible rendering performance...

Started by
21 comments, last by Mace 18 years ago
I see conceptually what is going on.. but unfortunately I do not see how it would be coded. I'll have to go through the sdk docs a bit and see how I can transform these in world space.

The only thing I don't get is that starting vertex for each index part. Is there any good tutorial on how to do this stuff out there? Something with code that is easily understood?

[Piebert Entertainment] [Ask The All-Knowing Oracle A Question]------------------------------------------------------------GDSFUBY GameDev Society For UnBanning YodaTheCodaIf you want to see yoda unbanned then put this in your sig ------------------------------------------------------------DAIAGA Dave Astle is a God Association. To join, put this in your sig!Founder and High Priest of DAIAGA[edited by - YodaTheCoda on December 10, 2003 1:57:54 PM]
Advertisement
Quote:Original post by jollyjeffers
Sadly there is no trivial way of combining multiple transforms and single draw calls. There is a technique called "Geometry Instancing" that can achieve this, but it's fairly advanced and isn't available on all hardware - thus it doesn't make sense to be relying on it for such a basic feature [oh]



Geometry instancing is available on all ATI SM2 cards and up (Radeon 9500 and up) and GeForce 6x00 and up, so these days I'd say that most users are likely to have it, and it's worth implementing. That said, for ATI pre-SM3 cards it's a cludge, and it won't run in Direct3D Debug, because it's defined to be a SM3 feature.

Note also that in my experience instancing becomes slower at higher numbers. On my Radeon 9800 Pro it because horrendously slow over 1000 instances (with the drivers a few months ago). On the GeForce 6600 it also became slower, but to a lesser extent and at a higher number. Still I won't recommend more than about 1000 instances at a time.

For simple objects, like your boxes, the constant instancing method works well. This works by storing the transforms in shader constants. The number of constants changes by the shader model, but you should be able to get a few tens of transforms in any shader model, let's say 40. Your vertex buffer contains your box duplicated these 40 times, with an instance index appended to the position (therefore xyzw instead of xyz). This index is then used for indexing into the constants.

For a good demo of instancing methods, including const instancing and how to enable instancing on SM2 ATI cards, see http://www.humus.ca/index.php?page=3D&ID=52 (Humus' is a great site).
Thanks ET3D (and Jack), for the great replies.
Ill see what i can come up with.

This topic is closed to new replies.

Advertisement