I can now draw multiple entities sharing the same alias model in a single API call; up to several hundred depending on the complexity of the model. One weird side effect here is that certain calls to SCR_UpdateScreen seem a little aberrant in that they cause an infinite chain of entities linked to each model to be generated. I say "weird" because I'm definitely clearing down pointers both immediately before and immediately after building and drawing the chain. I think what's happening here is that either an entity slot or a model slot that had previously been used is being reused on the client and is getting a stray pointer in the chain pointer. I'm going to tighten up that aspect of it.
An advantage of discovering this bug however is that it's also forcing me to tackle some of the uses of SCR_UpdateScreen in the engine. They were understandable enough for a software renderer, but with a hardware renderer it's sufficient to handle something like scr_drawdialog by just outputting the relevant stuff to the screen and swapping buffers without clearing and without doing a full update.
I'm going to need to index the alias models. Right now the geometry submission is just too high and I'm not seeing the gains I had expected from batching multiple models. Ultimately I'm thinking I might need to put them into a hardware VBO and do vertex blending, but I'm reluctant to go down that route just yet owing to potential lack of hardware support (although D3D software vertex shaders might be an option here).
I have exploratory code written to generate the indexes, and seem to be able to reduce the submission to somewhere between a quarter and a half of what it was, so it should be worthwhile.
Monday, January 4, 2010
Fun with Alias Models
Posted by
mhquake
at
11:16 AM
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment