Details
-
Suggestion
-
Resolution: Done
-
P2: Important
-
None
-
None
-
c26fcf6de85ea58babaee55b6577a68555f1ce04
Description
Stereoscopic displays take a left and right image, rendered from the perspective of the different eyes, and combine them for presentation to the viewer, either with special red/cyan or polarized glasses, or directly using a lensed display that sends different pixels to different eyes. QML/3D currently has support for rendering stereoscopic views for 3D scenes, but we need a similar technique for QML/2D, for the following use cases:
- "Floating dialogs", where QML items are placed at different depths in the 3D vision field.
- Mixed 2D and 3D scenes, with floating dialogs and controls above a 3D model drawn in the background.
- 2D background image drawn "behind" a 3D model drawn in the foreground.
- Animating the "z depth" property of a 2D item to animate items in the background coming forward, or items in the foreground moving back. The z value needs to also affect the item's scale for the illusion to be correct.
More advanced usages include:
- Flip animations where part of the flipped 2D item appears to "come out" of the screen during the animation.
Basic building blocks required to achieve this task:
- Modified QDeclarativeView that can double-render the entire scene if the underlying OpenGL implementation has left and right buffers.
- Method to specify the "z depth" for QML/2D items such that they will be automatically offset and scaled when they are drawn.
- Consistent method to specify viewing distance, eye separation, etc for the 2D parts of the scene.
- Changes to mouse handling so that clicking on an item will correct for left/right offsetting and deliver a consistent "center eye" position to the actual item.
A primary assumption is that the hardware is OpenGL-capable for maximum flexibility and performance when implementing stereoscopics. Some hardware can do "raster stereo" with manual pixel interleaving by the application to alternate left and right pixels. It is more difficult to achieve high performance with this approach, but it may also need to be considered.