Serious performance problem - boundingsphere?

hi there,



i rendered a few hundred low poly trees and wondered about the extremely low fps. i switched my trees from boundingsphere to boundingbox, the amout of meshes (statistics) stayed the same, but the performance went up from 10 fps to > 100.

That's probably because Boxes are far easier shapes as Spheres.

are you recalculating the boundingvolumes every frame or something? i can't provoke that same difference between them myself…

also, doing a few compares as in the box case isnt worse than:



(pseudocode from my head only)


        diff.x = a.center.x - b.center.x;
        diff.y = a.center.y - b.center.y;
        diff.z = a.center.z - b.center.z;
        distanceSquared = diff.x * diff.x + diff.y * diff.y + diff.z * diff.z;       
        radiusSumSquared = (a.radius + b.radius) * (a.radius + b.radius);
        return distanceSquared < radiusSumSquared;


no, i'm locking the sharednodes, attaching them to a quadtree and don't touch them ever again.

i'll ask my yourkit profiler where the cpu spends its time.

cool, let us know what you come up with

The spheres are going to be bigger, so less culling is going to happen…  other than that, a 10X factor is also something I've never seen before.

the problem was not caused by less efficient culling. i'll post more as soon as i know more.