From: Ferran Sole Date: Fri, 15 Aug 2014 13:52:59 +0000 (+0100) Subject: Updated Programming guide with information on stereoscopic rendering. X-Git-Tag: dali_1.0.5~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F06%2F26106%2F4;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git Updated Programming guide with information on stereoscopic rendering. Change-Id: I0c3c42da8ea207aa90597a463ee4d0a91e97a7b4 --- diff --git a/docs/content/images/viewing-modes/google-cardboard.png b/docs/content/images/viewing-modes/google-cardboard.png new file mode 100644 index 0000000..b931339 Binary files /dev/null and b/docs/content/images/viewing-modes/google-cardboard.png differ diff --git a/docs/content/images/viewing-modes/stereo-projection.png b/docs/content/images/viewing-modes/stereo-projection.png new file mode 100755 index 0000000..b012524 Binary files /dev/null and b/docs/content/images/viewing-modes/stereo-projection.png differ diff --git a/docs/content/main-page.h b/docs/content/main-page.h index 564590c..53851e3 100644 --- a/docs/content/main-page.h +++ b/docs/content/main-page.h @@ -57,6 +57,9 @@ * - \link boost-library Boost Library \endlink * - \link boost-function Boost function usage \endlink * + * \section Rendering + * - \link viewing-modes Viewing modes \endlink + * * \section Profiling * - \link resource-tracking Resource Tracking \endlink * - \link performance-profiling Performance Profiling \endlink diff --git a/docs/content/programming-guide/viewing-modes.h b/docs/content/programming-guide/viewing-modes.h new file mode 100644 index 0000000..f2cad16 --- /dev/null +++ b/docs/content/programming-guide/viewing-modes.h @@ -0,0 +1,44 @@ +/*! \page viewing-modes Viewing modes + * + * + *

Introduction

+ * + * 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.

+ +* \image html viewing-modes/stereo-projection.png + +*
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.
+ * \image html viewing-modes/google-cardboard.png + *
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.

+ +*

Considerations

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