The following pseudo-code describes how to implement a renderer
using a StereoDeviceRenderer.
See StereoClientRenderer which implements the following:
beginFrame(GL)updateViewerPose(int)ppAvailable(): Set the render target, e.g. FBOEye#getViewport()upstream.reshapeEye(..) upstream.display(..) .ppAvailable():ppBegin(GL)ppBothEyes(GL) or device.ppOneEye(GL, int) for both eyesppEnd(GL)endFrame(GL)Asymmetric FOV Rendering
The StereoClientRenderer shall render both images for each eye correctly Off-axis
utilizing an asymmetric camera frustum, i.e. by using StereoDevice's default FovHVHalves.
Some references:
| Modifier and Type | Class and Description |
|---|---|
| public static interface | StereoDeviceRenderer.
Interface describing one eye of the stereoscopic device,
see |
| Modifier and Type | Field and Description |
|---|---|
| public static final int | DISTORTION_BARREL
Distortion Bit: Barrel distortion compensating lens pincushion distortion |
| public static final int | DISTORTION_CHROMATIC
Distortion Bit: Chromatic distortion compensating lens chromatic aberration. |
| public static final int | DISTORTION_TIMEWARP
Distortion Bit: Timewarp distortion technique to predict
|
| public static final int | DISTORTION_VIGNETTE
Distortion Bit: Vignette distortion compensating lens chromatic aberration. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void | |
| public StereoDevice | |
| public int | getDistortionBits()
Returns used distortion compensation bits, e.g. |
| public StereoDeviceRenderer. | |
| public DimensionImmutable[] | |
| public ViewerPose | |
| public int | |
| public int | |
| public DimensionImmutable | getTotalSurfaceSize()
Returns the total surface size required for the complete images in pixel units. |
| public void | |
| public boolean | ppAvailable()
Returns |
| public void | |
| public void | |
| public void | ppOneEye(final GL gl, final int eyeNum)
Performs stereoscopic post-processing for one eye, see |
| public ViewerPose | |
| public boolean | usesSideBySideStereo()
Method returns |
| DISTORTION_BARREL | back to summary |
|---|---|
| public static final int DISTORTION_BARREL Distortion Bit: Barrel distortion compensating lens pincushion distortion | |
| DISTORTION_CHROMATIC | back to summary |
|---|---|
| public static final int DISTORTION_CHROMATIC Distortion Bit: Chromatic distortion compensating lens chromatic aberration. | |
| DISTORTION_TIMEWARP | back to summary |
|---|---|
| public static final int DISTORTION_TIMEWARP Distortion Bit: Timewarp distortion technique to predict
FIXME: Explanation needs refinement! | |
| DISTORTION_VIGNETTE | back to summary |
|---|---|
| public static final int DISTORTION_VIGNETTE Distortion Bit: Vignette distortion compensating lens chromatic aberration. | |
| beginFrame | back to summary |
|---|---|
| public void beginFrame(final GL gl) Notifying that a new frame is about to start. | |
| dispose | back to summary |
|---|---|
| public void dispose(final GL gl) Release all OpenGL related resources | |
| endFrame | back to summary |
|---|---|
| public void endFrame(final GL gl) Notifying that the frame has been rendered completely. | |
| getDevice | back to summary |
|---|---|
| public StereoDevice getDevice() Returns the | |
| getDistortionBits | back to summary |
|---|---|
| public int getDistortionBits() Returns used distortion compensation bits, e.g.
Distortion requires | |
| getEye | back to summary |
|---|---|
| public StereoDeviceRenderer. Returns the | |
| getEyeSurfaceSize | back to summary |
|---|---|
| public DimensionImmutable[] getEyeSurfaceSize() Returns the surface size for each eye's a single image in pixel units. | |
| getLastViewerPose | back to summary |
|---|---|
| public ViewerPose getLastViewerPose() Returns the last | |
| getTextureCount | back to summary |
|---|---|
| public int getTextureCount() Returns the used texture-image count for post-processing, see
In case the renderer does not support multiple textures for post-processing,
or no post-processing at all, method returns zero despite the request
from | |
| getTextureUnit | back to summary |
|---|---|
| public int getTextureUnit() Returns the desired texture-image unit for post-processing, see | |
| getTotalSurfaceSize | back to summary |
|---|---|
| public DimensionImmutable getTotalSurfaceSize() Returns the total surface size required for the complete images in pixel units.
If
Otherwise the size is equal to | |
| init | back to summary |
|---|---|
| public void init(final GL gl) Initialize OpenGL related resources | |
| ppAvailable | back to summary |
|---|---|
| public boolean ppAvailable() Returns Stereoscopic post-processing is available if:
If stereoscopic post-processing is used
the following post-processing methods must be called to before
| |
| ppBegin | back to summary |
|---|---|
| public void ppBegin(final GL gl) Begin stereoscopic post-processing, see
| |
| ppEnd | back to summary |
|---|---|
| public void ppEnd(final GL gl) End stereoscopic post-processing, see | |
| ppOneEye | back to summary |
|---|---|
| public void ppOneEye(final GL gl, final int eyeNum) Performs stereoscopic post-processing for one eye, see | |
| updateViewerPose | back to summary |
|---|---|
| public ViewerPose updateViewerPose() Updates the | |
| usesSideBySideStereo | back to summary |
|---|---|
| public boolean usesSideBySideStereo() Method returns SBS requires that both eye's images are presented side-by-side in the final framebuffer.
Either the renderer presents the images side-by-side according to the | |
StereoDeviceRenderer#getEye(int).
| Modifier and Type | Method and Description |
|---|---|
| public EyeParameter | |
| public RectangleImmutable |
| getEyeParameter | back to summary |
|---|---|
| public EyeParameter getEyeParameter() Returns the | |
| getViewport | back to summary |
|---|---|
| public RectangleImmutable getViewport() Returns the viewport for this eye. | |