Dali 3D User Interface Engine
Viewing modes


DALi supports multiple viewing modes:

MONO is the default viewing mode. When using MONO mode, only one image of the scene is produced in every update. In this setup, DALi will create a default render task, which will render everything added to the stage root layer, and one default camera for that render task.

STEREO_HORIZONTAL and STEREO_VERTICAL allow the application to produce stereo images. Stereo rendering techniques produce two images of the scene with an slight offset between them which will be presented to the left and the right eye independently. In this setup, DALi will create two additional render tasks, one for the right eye and one for the left, each with it's own camera. Those cameras will be parented to the default camera. The method to generate the projection transformation for each camera is known as "parallel axis asymmetric frustum perspective projection" and is illustrated in the image below.


The separation between the two cameras is configurable, but, typically, it should range between 50 and 70 millimeters. Too large a separation can be hard to resolve and is known as hyperstereo. The convergence plane for both frustums is the 2D plane, so, the projection of anything lying in the 2D plane will be coincident for both left and right eyes, hence zero parallax. Objects that lie in front of the projection plane will appear to be in front of the screen and object behind the projection plane will appear to be "into" the screen. Object behind the projection plane ( positive parallax ) are easier to look and minimises eye strain.

In order to view stereoscopic images correctly, each image must be presented to each eye independently. There exist devices in the market for this, like head-mounted displays, which is a display device, worn in the head, that have two small displays, one for each eye. A cheaper alternative to this often expensive devices is Google's cardboard viewer.


With Google cardboard, or some similar device, you can transform your phone into a basic virtual reality headset.

Stereoscopic rendering in DALi

STEREO_HORIZONTAL mode will present the left image on the top half of the screen and the right image on the bottom half. It is intended to be used in landspace orientation, so the images are rotated 90 degrees counterclockwise. STEREO_VERTICAL mode, on the other hand, will render the left image on the left half of the screen and the right image on the right side.

*To define the viewing mode to be used, applications can use the function Dali::Application::SetViewMode defined in the Application class, passing as the parameter which mode to use. It is possible for an application to query which view mode is being used by calling the funcion Dali::Application::GetViewMode. To define the separation between the left and right cameras, the application can use the function Dali::Application::SetStereoBase, passing as a parameter the distance in millimeters. This distance can be queried using Dali::Application::GetStereoBase.
*It is also possible to set the viewing mode and offset at initialization time using two command-line arguments for this purpose: –view-mode ( or -v ) and 0 for MONO, 1 for STEREO_HORIZONTAL, 2 for STEREO_VERTICAL, and –stereo-base ( or –s ) and the separation in millimeters.


*There are a some restrictions to be aware of when writing stereoscopic applications using DALi.

Dali Docs Home
Read more about Dali