>Batches should be large enough to make the
>API call overhead irrelevant but small
>enough to fit in the cache, if at all
>possible.
I understand. However, my modeling skills
aresuch that getting even 50 vertexes in
something like a “lower leg” would be quite
an accomplishment
What I’m hearing is that this loop is
preferrable, though (because T&L is “free”):
(please excuse the blatant simplifications)
void transform_and_draw_bone(bone & b)
{
transform_bone(b);
draw_bone(b);
}
void draw_texture_geometry(texture & t)
{
bind_textures(t);
for_each(t.bones.begin(),
t.bones.end(),
transform_and_draw_bone);
}
for_each(used_textures.begin(),
used_textures.end(),
draw_texture_geometry);
as opposed to:
void draw_bone_texture(texture & t)
{
bind_textures(b);
draw_bone(b);
}
void draw_bone_geometry(bone & b)
{
transform_bone(b);
for_each(b.textures.begin(),
b.textures.end(),
draw_bone_texture);
}
for_each(geometry_bones.begin(),
geometry_bones.end(),
draw_bone_geometry);
I’m currently looking into the fence and
vertex array range extensions, to see if they
are what I need (ideally, I’d like to pre-
transform various sections of the model, then
bind/draw textures on indexed vertexes from
that transformed set).
Oh, and desperately trying to figure out how
to get all this to be interactive enough on
non-HT&L systems. With SSE or 3DNow!, it’ll
probably be good enough. Besides, I can save
that for later, and maybe it’ll be moot by
the time I get there