Top Description Inners Fields Methods
com.jogamp.opengl.util.stereo

public Interface StereoDeviceRenderer

Known Direct Implementers
jogamp.opengl.oculusvr.OVRStereoDeviceRenderer, jogamp.opengl.util.stereo.GenericStereoDeviceRenderer
Imports
com.jogamp.nativewindow.util.DimensionImmutable, .RectangleImmutable, com.jogamp.opengl.GL, com.jogamp.opengl.math.FovHVHalves

Stereoscopic device rendering interface.

The following pseudo-code describes how to implement a renderer using a StereoDeviceRenderer. See StereoClientRenderer which implements the following:

Correct 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:

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
StereoDeviceRenderer.Eye

Interface describing one eye of the stereoscopic device, see StereoDeviceRenderer#getEye(int).

Field Summary

Modifier and TypeField 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 ViewerPose movement to reduce latency.

public static final int
DISTORTION_VIGNETTE

Distortion Bit: Vignette distortion compensating lens chromatic aberration.

Method Summary

Modifier and TypeMethod and Description
public void
beginFrame(final GL gl)

Notifying that a new frame is about to start.

public void
dispose(final GL gl)

Release all OpenGL related resources

public void
endFrame(final GL gl)

Notifying that the frame has been rendered completely.

public StereoDevice
getDevice()

Returns the StereoDevice of this StereoDeviceRenderer instance.

public int
getDistortionBits()

Returns used distortion compensation bits, e.g. DISTORTION_BARREL, in case the stereoscopic display requires such, i.e. in case lenses are utilized.

public StereoDeviceRenderer.Eye
getEye(final int eyeNum)

Returns the Eye instance for the denoted eyeNum.

public DimensionImmutable[]
getEyeSurfaceSize()

Returns the surface size for each eye's a single image in pixel units.

public ViewerPose
getLastViewerPose()

Returns the last ViewerPose.

public int
getTextureCount()

Returns the used texture-image count for post-processing, see ppAvailable().

public int
getTextureUnit()

Returns the desired texture-image unit for post-processing, see ppAvailable().

public DimensionImmutable
getTotalSurfaceSize()

Returns the total surface size required for the complete images in pixel units.

public void
init(final GL gl)

Initialize OpenGL related resources

public boolean
ppAvailable()

Returns true if stereoscopic post-processing is required and available, otherwise false.

public void
ppBegin(final GL gl)

Begin stereoscopic post-processing, see ppAvailable().

public void
ppEnd(final GL gl)

End stereoscopic post-processing, see ppAvailable().

public void
ppOneEye(final GL gl, final int eyeNum)

Performs stereoscopic post-processing for one eye, see ppAvailable().

public ViewerPose
updateViewerPose()

Updates the ViewerPose and returns it.

public boolean
usesSideBySideStereo()

Method returns true if using side-by-side (SBS) stereoscopic images, otherwise false.

Field Detail

DISTORTION_BARRELback to summary
public static final int DISTORTION_BARREL

Distortion Bit: Barrel distortion compensating lens pincushion distortion

DISTORTION_CHROMATICback to summary
public static final int DISTORTION_CHROMATIC

Distortion Bit: Chromatic distortion compensating lens chromatic aberration.

DISTORTION_TIMEWARPback to summary
public static final int DISTORTION_TIMEWARP

Distortion Bit: Timewarp distortion technique to predict ViewerPose movement to reduce latency.

FIXME: Explanation needs refinement!

DISTORTION_VIGNETTEback to summary
public static final int DISTORTION_VIGNETTE

Distortion Bit: Vignette distortion compensating lens chromatic aberration.

Method Detail

beginFrameback to summary
public void beginFrame(final GL gl)

Notifying that a new frame is about to start.

disposeback to summary
public void dispose(final GL gl)

Release all OpenGL related resources

endFrameback to summary
public void endFrame(final GL gl)

Notifying that the frame has been rendered completely.

getDeviceback to summary
public StereoDevice getDevice()

Returns the StereoDevice of this StereoDeviceRenderer instance.

getDistortionBitsback to summary
public int getDistortionBits()

Returns used distortion compensation bits, e.g. DISTORTION_BARREL, in case the stereoscopic display requires such, i.e. in case lenses are utilized.

Distortion requires post-processing.

getEyeback to summary
public StereoDeviceRenderer.Eye getEye(final int eyeNum)

Returns the Eye instance for the denoted eyeNum.

getEyeSurfaceSizeback to summary
public DimensionImmutable[] getEyeSurfaceSize()

Returns the surface size for each eye's a single image in pixel units.

getLastViewerPoseback to summary
public ViewerPose getLastViewerPose()

Returns the last ViewerPose.

getTextureCountback to summary
public int getTextureCount()

Returns the used texture-image count for post-processing, see ppAvailable().

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 StereoDevice#createRenderer(int, int, float[], com.jogamp.opengl.math.FovHVHalves[], float).

getTextureUnitback to summary
public int getTextureUnit()

Returns the desired texture-image unit for post-processing, see ppAvailable().

getTotalSurfaceSizeback to summary
public DimensionImmutable getTotalSurfaceSize()

Returns the total surface size required for the complete images in pixel units.

If usesSideBySideStereo() the total size spans over both getEyeSurfaceSize(), side-by-side.

Otherwise the size is equal to getEyeSurfaceSize().

initback to summary
public void init(final GL gl)

Initialize OpenGL related resources

ppAvailableback to summary
public boolean ppAvailable()

Returns true if stereoscopic post-processing is required and available, otherwise false.

Stereoscopic post-processing is available if:

If stereoscopic post-processing is used the following post-processing methods must be called to before endFrame():

ppBeginback to summary
public void ppBegin(final GL gl)

Begin stereoscopic post-processing, see ppAvailable().

updateViewerPose(int) for both eyes must be called upfront when rendering upstream StereoGLEventListener.

ppEndback to summary
public void ppEnd(final GL gl)

End stereoscopic post-processing, see ppAvailable().

ppOneEyeback to summary
public void ppOneEye(final GL gl, final int eyeNum)

Performs stereoscopic post-processing for one eye, see ppAvailable().

updateViewerPoseback to summary
public ViewerPose updateViewerPose()

Updates the ViewerPose and returns it.

usesSideBySideStereoback to summary
public boolean usesSideBySideStereo()

Method returns true if using side-by-side (SBS) stereoscopic images, otherwise false.

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 eye's viewport, or post-processing is utilized to merge textures to a side-by-side configuration.

com.jogamp.opengl.util.stereo back to summary

public Interface StereoDeviceRenderer.Eye

Known Direct Implementers
jogamp.opengl.oculusvr.OVRStereoDeviceRenderer.OVREye, jogamp.opengl.util.stereo.GenericStereoDeviceRenderer.GenericEye

Interface describing one eye of the stereoscopic device, see StereoDeviceRenderer#getEye(int).

Method Summary

Modifier and TypeMethod and Description
public EyeParameter
getEyeParameter()

Returns the EyeParameter of this eye.

public RectangleImmutable
getViewport()

Returns the viewport for this eye.

Method Detail

getEyeParameterback to summary
public EyeParameter getEyeParameter()

Returns the EyeParameter of this eye.

getViewportback to summary
public RectangleImmutable getViewport()

Returns the viewport for this eye.