Jump to content
  • Advertisement
Sign in to follow this  
Raptisoft

Object Visibility

This topic is 2075 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

Hi all,

 

This is probably the oldest question in the book, so forgive me-- it seems the google keywords I'm trying to look it up with have become polluted, and I keep getting answers to unrelated questions.

 

I'm trying to determine if a 3D object is visible so that I don't push it into the draw pipe if it's not.  For my purposes, it's sufficient to do this by the bounding cube of the object-- the objects are mostly square and have a tight bounding cube computed.

 

Given a premultiplied view/world/perspective matrix and viewport, what's the fastest and best way to determine if a cube is visible or not?  I've tried the following:

 

1. If closest point on the cube to camera is visible, draw (works in about 99% of cases)

2. Any closest point on any side of the cube to camera is visible, draw (again, about 99%)

3. If any line of the cube is visible, draw (seems to work even worse, though I thought this was going to be solution)

 

Fiddling with it, it occurred to me there's probably a very simple way of doing it that I'm missing by trying these kludgy solutions.  Can anyone enlighten me?

Share this post


Link to post
Share on other sites
Advertisement

Hello

This is called frustum culling (you'll find a lot of articles via these keywords) : you compute the frustum that represents the visible area of your world according to your point of view (camera), and then you check collisions/penetrations between it and the bounding volumes of your entities.

 

Then, in order to accelerate the process (and do not check individually all the bounding volumes), space partitioning is needed, like octrees

Edited by Tournicoti

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!