The media merging kernel is responsible for generating an LDI data structure representing the entire scene. Its input is the current LDI of each active media object in the scene. As previously mentioned, individual media players are responsible for content decoding or rendering. The media merging step receives the object LDIs from the media players as OpenGL textures. When composing two DepthPixels that rely on the same position, the pixels must be inserted in such a way that the LayeredDepthPixel data structure remains ordered (from the closest pixel to the farthest one). In theory, the number of layers in an LDI structure may be infinite. In practice, it may be useful to limit the number of layers, e.g., to achieve a constant rendering time.