TSMesh::buildPolyList optimization
by Igor G · in Torque Game Engine · 05/24/2007 (1:10 pm) · 3 replies
My world starts lagging when there's more than 60-ish players, and it's because of collision detection with DTS objects. The buildPolyList function is consuming the most CPU cycles and I am attempting to try and speed it up.
So..this may be a dumb question - I am not very familiar yet with how TGE deals with collision detection, but can this poly list be built once instead of every frame? I mean, the DTS shape is pretty static, so why call this function every frame for every player?
Thanks.
So..this may be a dumb question - I am not very familiar yet with how TGE deals with collision detection, but can this poly list be built once instead of every frame? I mean, the DTS shape is pretty static, so why call this function every frame for every player?
Thanks.
#2
05/24/2007 (3:05 pm)
One of the main uses of buildPolyList() is to calculate the which polys the dynamic shadows cast onto which changes constantly as object who cast dynamic shadows move around (like the Player). This means that it can't really precalculate the results. buildPolyList() also supports animation which would cause the polys/verts returned to potentially be very different every frame.
#3
So, if my shapes do not animate and if I didn't want dynamic shadows, pre-calculating this list would theoretically be possible?
05/24/2007 (5:33 pm)
Yes - My shapes are big, and contains many collision polygons. Also, my shape is instanced many times in a dense world. So, if these users are running around, they almost constantly hit my shapes.So, if my shapes do not animate and if I didn't want dynamic shadows, pre-calculating this list would theoretically be possible?
Associate Manoel Neto
Default Studio Name