We are independent & ad-supported. We may earn a commission for purchases made through our links.

Advertiser Disclosure

Our website is an independent, advertising-supported platform. We provide our content free of charge to our readers, and to keep it that way, we rely on revenue generated through advertisements and affiliate partnerships. This means that when you click on certain links on our site and make a purchase, we may earn a commission. Learn more.

How We Make Money

We sustain our operations through affiliate commissions and advertising. If you click on an affiliate link and make a purchase, we may receive a commission from the merchant at no additional cost to you. We also display advertisements on our website, which help generate revenue to support our work and keep our content free for readers. Our editorial team operates independently from our advertising and affiliate partnerships to ensure that our content remains unbiased and focused on providing you with the best information and recommendations based on thorough research and honest evaluations. To remain transparent, we’ve provided a list of our current affiliate partners here.

What Is Z-Order?

By Eugene P.
Updated May 17, 2024
Our promise to you
WiseGeek is dedicated to creating trustworthy, high-quality content that always prioritizes transparency, integrity, and inclusivity above all else. Our ensure that our content creation and review process includes rigorous fact-checking, evidence-based, and continual updates to ensure accuracy and reliability.

Our Promise to you

Founded in 2002, our company has been a trusted resource for readers seeking informative and engaging content. Our dedication to quality remains unwavering—and will never change. We follow a strict editorial policy, ensuring that our content is authored by highly qualified professionals and edited by subject matter experts. This guarantees that everything we publish is objective, accurate, and trustworthy.

Over the years, we've refined our approach to cover a wide range of topics, providing readers with reliable and practical advice to enhance their knowledge and skills. That's why millions of readers turn to us each year. Join us in celebrating the joy of learning, guided by standards you can trust.

Editorial Standards

At WiseGeek, we are committed to creating content that you can trust. Our editorial process is designed to ensure that every piece of content we publish is accurate, reliable, and informative.

Our team of experienced writers and editors follows a strict set of guidelines to ensure the highest quality content. We conduct thorough research, fact-check all information, and rely on credible sources to back up our claims. Our content is reviewed by subject matter experts to ensure accuracy and clarity.

We believe in transparency and maintain editorial independence from our advertisers. Our team does not receive direct compensation from advertisers, allowing us to create unbiased content that prioritizes your interests.

Z-Order is the name given to the process involved in sorting which items in a computer application should appear visually in front of other objects. One common use for z-order is when there are multiple windows open in a graphical user interface (GUI) and the z-order determines which windows will be drawn fully and which ones will be obscured by the windows above them. The name z-order derives from the traditional naming conventions used when describing three-dimensional (3D) spaces, where X refers to the right-left direction, Y to the up-down direction and Z to the forward-back direction. Nearly all 3D applications use some form of z-ordering to quickly determine which objects should or should not be rendered to increase the display speed of a scene.

The actual axis being described by a z-order can be thought of as extending into the display field, moving either toward or away from a viewer looking at the monitor. The further away an object is, the higher its number in the ordering, while closer objects have lower numbers. By using simple sorting algorithms, objects that are more distant from the viewer can be excluded from view or can be only partially drawn, because they are obscured by objects that are closer.

One common use for z-order is to maintain the state of a series of open windows or other GUI elements in an application. When a window or other element is generated, it is assigned an order number to indicate that it is in full view. If another window or element is opened, the z-ordering is shifted so the new active window is considered closest. In addition to helping provide cues that make drawing GUI elements more efficient, some operating systems or applications also use it to determine the tab order so that, when a user uses the keyboard to cycle through a GUI, the elements that gain focus are selected based on their z-order.

Graphics editing programs use z-ordering methods to draw images that have multiple layers, ensuring that the layers are rendered in the correct sequence. This same principle is applied to programs used for publication or layout, where several elements can be stacked to create a composite. In some situations, as in vector graphics, the order also is used to calculate geometric operations on objects, such as creating a union or difference between layered geometries.

In 3D applications, the z-order also is sometimes called a z-buffer or depth buffer. Aside from providing an optimized way to sort objects within a scene, it also allows for efficient hidden surface removal. Objects that have a distant enough number in the z-ordering can be ignored and not rendered at all, while objects that are covered by closer shapes can have entire segments of their geometry left un-rendered because they cannot be seen.

WiseGeek is dedicated to providing accurate and trustworthy information. We carefully select reputable sources and employ a rigorous fact-checking process to maintain the highest standards. To learn more about our commitment to accuracy, read our editorial process.

Discussion Comments

WiseGeek, in your inbox

Our latest articles, guides, and more, delivered daily.

WiseGeek, in your inbox

Our latest articles, guides, and more, delivered daily.