Original Post
Hi, I apologise if this has been covered before. No amount of searching yielded anything useful. The basic problem is to determine whether two frusta intersect. I need this to find out whether the objects illuminated by a spotlight are visible, for example so that I only update the depth shadow/light map when I have to. I figured the quickest way to do this is to determine whether the viewing volume intersects with the light's volume. The rest of the post assumes this technique - if you know a better one, I'd like to hear it, of course. :) Note that I only need to know if the frusta intersect, no details. I'd also like to avoid false positives, that is, using an algorithm that may claim that two frusta intersect, even though they don't. This is because the frustum tests are for avoiding render target switches, which are almost definitely more expensive than the intersection test. I've been thinking about this for weeks, but I'm kind of stuck. I'm already doing bounding-box/frustum intersection tests using an extension to the projection method described in [1], but its main shortcoming is that it may turn up false positives. I also can't find a simple (well, fast) way of applying this method to two frusta. My ideas so far have been: 1) Test whether any vertices of one frustum lie within the other frustum, and vice versa, by checking which side of each frustum plane a given vertex lies. If a vertex lies on the 'inside' of each plane, the frusta intersect. This won't work because two frusta can intersect although all vertices are 'free'. 2) Extend the frusta to pyramids in your mind. Take each of the 4 vectors from pyramid 1's apex (e.g. the camera or light position) to the vertices of pyramid 1's far plane and intersect them with pyramid 2's triangle faces. Calculate the point of intersection, and determine whether it lies between far and near plane of pyramid 2. If no intersections are found, do the same test against the near and far plane of pyramid 2, and check whether the intersections are within the quadrilateral. This will miss the case where one frustum completely contains the other, so one vertex of each frustum must be tested for being contained by the other frustum. The only reason I've included (1) is because I have a feeling it might be extensible to actually work. Method (2) seems awfully complicated and slow, as you have to check wether the vectors are parallel to the tested planes, etc. I'm also not 100% sure it'll work, either. Any ideas? Thanks ~phil [1] David Eberly, 3D Game Engine Design