WTF! We only saved a THREE WHOLE SECONDS after dropping 786,431 ent_getvertex calls????
Are you SURE there is no wait calls between each terrain that may be causing a delay?
And are you sure each terrain only gets called once?
I cant really see anything wrong here, nor anything to eat significant horsepower.
And you've coded it pretty much how I would have, so there is not much room for optimisation, if any.
I expected MUCH more of an improvement than this...
One last test though.
Disable the pixel_for_bmap and pixel_to_bmap lines and see if we get any significant
speed improvements. Othersize I think we've hit the limit...