Jump to content
  • Advertisement
Sign in to follow this  
ahlywog

Drawing order.

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

How important is the order in which you draw you objects to your scene? Should they be drawn in a certain order?

Share this post


Link to post
Share on other sites
Advertisement
For opaque objects. The draw order is importatant for cutting down on the amount of overdraw. This is important if you have expensive shaders. You want to draw the objects near the front first, so that they have a chance to occlude the stuff behind. For transparent objects, the order is oposite. To get proper blending, you have to draw transparent objects from back to front, after all the opaque things.

Share this post


Link to post
Share on other sites
So opaque: Closest to the camera to the farthest.
Transparent: Farthest from the camera to the closest?

Does OGL determine this automatically or is this something I need to manage?

Share this post


Link to post
Share on other sites
No, opengl draws things in the order you give it, it doesn't sort it for you.

For opaque objects it isn't critical to do this, but it can hurt your performance if you're drawing hundreds of things behind other objects.

For transparency if you want physically correct transparency you need to manually draw things back to front.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!