Hi,
'today' I've implemented my (frustum) culling as followed:
- meshes: if boundingbox is not outside frustum, render
- point lights: if boundingsphere is not oustide frustum, render
There are most likely some optimizations possible, knowing that:
- for meshes situational box versus sphere might be considered (very 'high' or 'wide' objects as a sphere is bad)
- a box check is 8 times more checking then a sphere check
I see a few options:
1 - always do sphere check first (meshes) and if 'true' afterwards do the box check
(reduces checks for sure)
2 - only do sphere checks, winning checks, possibly losing unneccesary rendering
3 - do either sphere or box, based on a precalculated bool which one to do, for example if width is more then 'x'% of height and depth (and vice versa)
Another thing I consider is keeping track of my camera being moved or rotated, and only if TRUE, update visibility through checking everything against the frustum.
Really like to hear your thoughts on these 'dilemma's.