Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

nullstate

Bizarre Frustum Culling Bug

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey All, I’ve working on a bug for two days and I’m out of ideas. I wanted to implement frustum culling in my 3D application, which uses a quadtree. I went with a version of Mark Morley’s frustum culling to perform the frustum culling. The problem: patches of land that should be drawn are being culled. I rebuilt my camera class that uses gluLookAt(). Also, I walked through my quadtree’s creation. All which appear to be correct. I’m completely out of ideas as to why this is not working and any help would be greatly appreciated. Thanks in advance, NS

Share this post


Link to post
Share on other sites
Advertisement
Rearrange your code such that it renders only one chunk of land which occasionally culls wrong.

Move until it''s culling incorrectly.

Place breakpoint at beginning of culling routine.

Step until culling rejects inappropriately.

Try to fathom why.

Fix.

Repeat if desired.

Share this post


Link to post
Share on other sites
One of the easiest bugs to miss in frustum culling code is the generation of your frustum planes. Since you''re using a quadtree, you''re frustum is made up of only two planes, so it should be easy to check if they''re accurate.

Once you know you''re planes are accurate, make sure they''re being transformed to the camera position correctly (such as which direction they should rotate, etc.).

And finally, if the other two were correct, make sure you''re frustum culling math code is correct (the actual IsNodeInsideFrustum() function).

Share this post


Link to post
Share on other sites
quote:
Original post by c t o a n
Since you''re using a quadtree, you''re frustum is made up of only two planes


Why would your frustum contain only 2 planes? Why not all 6? What if you are looking straight down at the ground? You would want to only draw that one patch and not every patch that lies between your left and right planes, which can be many since the planes go to infinity.

Anyway, it sounds like your planes are off. I had this type of problem earlier and it was because I was multiplying my Modelview and Projection View matrices in the wrong order.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!