Jump to content
  • Advertisement
Sign in to follow this  
fathom88

OpenGL How Does OpenGL Treat Off Screen Items?

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

When OpenGL draws, how does it treat item outside of the view. If one uses glortho to define a space of 800x800x0, what happens if one defines a triangle at say 1000, 1000, 1000, 1500, and 1500, 1000. Does OpenGL ignore it, or is it the user's responsibility to remove the triangle from any drawing list/routine. What happens when the part of the triangle is within the view space and part is not? Let say one of the triangle points was at 700, 500 within the view space. Thanks.

Share this post


Link to post
Share on other sites
Advertisement
OpenGL will 'clip' polygons that are partially offscreen, only rendering the visible part. It will also ignore polygons you draw totally off the screen. So it's not really a problem. However if you have ways of rejecting groups of hidden polygons before sending them to OpenGL (eg. a model which is entirely offscreen doesn't need any of its polys rendering), then you're best off not sending them at all, for the sake of efficiency.

Share this post


Link to post
Share on other sites
Quote:
Original post by Kylotan
OpenGL will 'clip' polygons that are partially offscreen, only rendering the visible part. It will also ignore polygons you draw totally off the screen. So it's not really a problem. However if you have ways of rejecting groups of hidden polygons before sending them to OpenGL (eg. a model which is entirely offscreen doesn't need any of its polys rendering), then you're best off not sending them at all, for the sake of efficiency.


Good advice. You should note that Kylotan wrote groups of hidden polygons.
In practice you should 'cull' invisible geometry if this is efficient and fast (at least test bounding box of complex objects not single triangles).

OpenGL will cull the geometry after vertex transform but before fragment rendering (probably there is also a second cull in screen space but I'm not sure)

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.

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!