[Dir3d-l] cloning models speed - optimisations?

Barry Swan gerbil at theburrow.co.uk
Fri Dec 23 09:57:26 EST 2005


I found using director's inbuilt cloning to slow down over time - presumably 
as it tries to assign unique names and goes through the list comparing.
So what I do for local copies is do a 'manual' copy - IE create a new model 
using the source's modelresource and then copy across anything that needs to 
be the same (shaderlist being the most obvious, but other things may be 
needed such as visibility info etc).
For each model I store various bits of info such as shortcuts (to shaders in 
the shaderlist) where appropriate, and a counter that I increment each copy 
and use as the basis for new model's name (eg new model name = source model 
name & string(counter)) - while I don't know if it's faster early on, it's 
certainly not discernably slower and when the number of copies adds up, it's 
definately faster - this method has no slow down, but good old clone soon 
craaaaawls.

Barry
gerbil at theburrow.co.uk



More information about the Dir3d-l mailing list