# Argh! Where Should I Frustum Cull In DirectX!? :)

This topic is 4976 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I've covered some of this in another topic, but I think this warrants a new topic as my question has changed somewhat. My main reference for this frustum culling business right now is... http://www2.ravensoft.com/users/ggribb/plane extraction.pdf If I use the projection matrix to extract the frustum planes, I get the planes in homogeneous clipping space. I'm still a bit shaky on the homogeneous part, but that's okay for now. If I use a concatenated view and projection matrix, I get the planes in world space. If I use the world, view, and projection matrices, I get the planes in object space. Where should I be frustum culling? If I do it in object space, I have to recalculate the frustum planes for every object?! If I do it in world space, I only have to calculate the frustum planes once per frame, but I have to manually apply the world transformations so I can use just the view and projection matrices. This all seems sort of painful. Am I missing something? I would really appreciate some advice.

##### Share on other sites
AFAIK, you should only have to calculate the frustum planes once IF the camera stays still. When the camera moves, moving the view frustum at the same time, you need to recalculate.

Now, you DO have to check every object against the frustum every frame, unless your objects don't move or you put them in some kind of space partition (quad/octrees) and test the partitions.

EDIT: Multiply model matrix times projection matrix...

##### Share on other sites
Original post by chxfryer
AFAIK, you should only have to calculate the frustum planes once IF the camera stays still. When the camera moves, moving the view frustum at the same time, you need to recalculate.[/QUOTE]

This is what I'm trying to understand. I realize that if you use the projection matrix, you have the frustum planes in clip space. But these only do you good if you can cull in clip space. Does this not mean that you have to have your vertices transformed to clip space as well? How do you jump in at that point and cull after that transformation? Doesn't DirectX take over and perform all the transformations after you call DrawIndexed Primitive?

Quote:
 EDIT: Multiply model matrix times projection matrix...

?

##### Share on other sites
Quote:
 Original post by Low BiasIf I use a concatenated view and projection matrix, I get the planes in world space.If I do it in world space, I only have to calculate the frustum planes once per frame, but I have to manually apply the world transformations so I can use just the view and projection matrices.

If your planes are in World Space and you use Bounding Spheres for your objects, then you only need to transform 1 point per object into World Space. That doesn't seem too painful.

If you have a lot of objects you'll also want to use some higher level culling like a Quad tree since that can quickly reduce the number of objects you'll cull via the frustrum.

1. 1
2. 2
Rutin
18
3. 3
4. 4
5. 5

• 14
• 12
• 9
• 12
• 37
• ### Forum Statistics

• Total Topics
631431
• Total Posts
3000040
×