Drawing order.
How important is the order in which you draw you objects to your scene? Should they be drawn in a certain order?
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.
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?
Transparent: Farthest from the camera to the closest?
Does OGL determine this automatically or is this something I need to manage?
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.
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.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement