» Blender 2.72 - Game Engine Autostereoscopy
Updated 15:14 October 17th, 2014
Be thankful, comment
(4828)  4,866

Overview

Testing build with "autostereographic" mode in the BGE, i.e. a stereo mode that doesn't requiere any apparatus to be viewed, but simply for the user to "cross the eyes" (or, to be precise, to make them be parallel, like if they were looking far, far away).

With autostereo mode enabled, the screen consists in a sort of tiled pattern with small displacements which interfere with each others giving a perspective feeling and thus allowing to "see" 3d objects.

More info about autostereography can be found on wikipedia: http://en.wikipedia.org/wiki/Autostereogram.

This kind of images if often referred to as "magic eye" images, from the name of a company selling books and products based on those: http://magiceye.com.

Others details as well as the code patch are available at: https://developer.blender.org/T41794.

 

Gallery

 

Autostereo panel with options "Eye Separation", "Animated" and "Show Guides":

Autostereo panel with options

 

The base cube, but in 3D!

The base cube, but in 3D!

 

Suzanne like you've never seen her (or like you don't see her?...)

Suzanne like you've never seen her (or like you don't see her?...)

 

Usage of the build

To test the autostereography option, simply download the compressed file, extract it and run the included Blender application. Then, switch Render mode to BGE, go into the Render panel of the Properties window and under Stereo choose Stereo -> Autostereographic.

Good practice is to enable "show guides" checkbox and to set eye separation to 0.2.

Then simply launch the game and watch... Try to "parallelize" your eyes so that portions of the screen overlap each other (particularly, the two black dots drawn if the the "draw guides" option is enabled should be put together). There are plenty of tutorials on the web about seeing those images. And it needs some habit ;-)

 

Options explaination

- Eye Separation: the width of one tile, expressed as a fraction of the screen's width. A value of 0.2 (i.e. 5 tiles in the image) usually give good results. This parameter, as well as the camera's focal length, should be tweaked by the user to give hime comfort.

- Animated: choose whether the background (tiled pattern) should be animated or not. People who are not very familiar with autostereoscopy should let this checkbox disabled, trying to first preceive the depth in a still image. For experienced users, checking this options permits to make game - i.e. moving scenes - without loosing focus each frame.

- Show Guides: choose whether two black dots should be drawn at the bottom of the screen. As the pattern currently consists of random noise, those dots indicate how much the eyes of the viewer should be moved in order to perceive the 3d effect.

 

Technical details

Autostereo rendering is implemented the same way as a Custom 2D Filter. It consequently consists of a GLSL shader with some tweaks in the filters stack.

Input for this shader is the Depth Buffer, which gives information about "real" 3D, i.e. the distance from objects to the camera. Depth value is then used to "displace" a random texture - a simple noise in this case.

The algorithm used in this computation has been completely created by myself and has evolved in a great way from the first implementation tests: from 5 minutes rendering of a single frame in the first Python script, it has come with after a complete rethinking to a constant 60fps speed in the GLSL shader. Its time complexity is currently about O(n), with n beeing the number of pixels in the viewport.

 

Current limitations and TODOs

  • Enabling autostereo disables all 2D filters;
  • It also puts the near clipping of the current camera to 0.1 (actually, near clipping is about never a useful parameter in an autostereo context);
  • The texture pattern is a simple noise, make it difficult to see parts that should be overlapped. It also has a fixed color, etc.
  • In special situations (like unappropriated focal length, objects very close to the camera, etc.), it can show artefacts.
  • There also some "normal" artefacts, due to the tiling. Choosing a bigger eye separation reduces this effect (but makes focalization more difficult!)
  • Due to the usage of the Depth Buffer, which has its own limitations, there can be a "stepping" effect, as if the relief would consist of layers (it actually does, but this is independant of the filter itself).

 

Any comment and/or feedback is much appreciated!

 

Edits

18.10.14: If Blender complains that msvcr120.dll and vcomp120.dll are missing, you should install the redistributable packages for VS2013.

Feeling talkative?
Log in to leave a comment.