Interface StereoDeviceRenderer
-
public interface StereoDeviceRendererStereoscopic device rendering interface.The following pseudo-code describes how to implement a renderer using a
StereoDeviceRenderer. SeeStereoClientRendererwhich implements the following:- device.
beginFrame(GL) - For both eyes:
- device.
#updateViewerPose(int) - if device.
ppAvailable(): Set the render target, e.g. FBO - Set the viewport using
StereoDeviceRenderer.Eye.getViewport() upstream.reshapeEye(..)upstream.display(..).
- device.
- Reset the viewport
- If device.
ppAvailable():- device.
ppBegin(GL) - Use render target, e.g. FBO's texture
- device.
#ppBothEyes(GL)or device.ppOneEye(GL, int)for both eyes - device.
ppEnd(GL)
- device.
- device.
endFrame(GL)
Correct
Asymmetric FOVRenderingThe
StereoClientRenderershall render both images for each eye correctly Off-axis utilizing an asymmetric camera frustum, i.e. by usingStereoDevice'sdefaultFovHVHalves.
Some references: - device.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceStereoDeviceRenderer.EyeInterface describing one eye of the stereoscopic device, seegetEye(int).
-
Field Summary
Fields Modifier and Type Field Description static intDISTORTION_BARRELDistortion Bit: Barrel distortion compensating lens pincushion distortionstatic intDISTORTION_CHROMATICDistortion Bit: Chromatic distortion compensating lens chromatic aberration.static intDISTORTION_TIMEWARPDistortion Bit: Timewarp distortion technique to predictViewerPosemovement to reduce latency.static intDISTORTION_VIGNETTEDistortion Bit: Vignette distortion compensating lens chromatic aberration.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidbeginFrame(GL gl)Notifying that a new frame is about to start.voiddispose(GL gl)Release all OpenGL related resourcesvoidendFrame(GL gl)Notifying that the frame has been rendered completely.StereoDevicegetDevice()Returns theStereoDeviceof thisStereoDeviceRendererinstance.intgetDistortionBits()Returns used distortion compensation bits, e.g.StereoDeviceRenderer.EyegetEye(int eyeNum)Returns theStereoDeviceRenderer.Eyeinstance for the denotedeyeNum.DimensionImmutable[]getEyeSurfaceSize()Returns the surface size for each eye's a single image in pixel units.ViewerPosegetLastViewerPose()Returns the lastViewerPose.intgetTextureCount()Returns the used texture-image count for post-processing, seeppAvailable().intgetTextureUnit()Returns the desired texture-image unit for post-processing, seeppAvailable().DimensionImmutablegetTotalSurfaceSize()Returns the total surface size required for the complete images in pixel units.voidinit(GL gl)Initialize OpenGL related resourcesbooleanppAvailable()Returnstrueif stereoscopic post-processing is required and available, otherwisefalse.voidppBegin(GL gl)Begin stereoscopic post-processing, seeppAvailable().voidppEnd(GL gl)End stereoscopic post-processing, seeppAvailable().voidppOneEye(GL gl, int eyeNum)Performs stereoscopic post-processing for one eye, seeppAvailable().ViewerPoseupdateViewerPose()Updates theViewerPoseand returns it.booleanusesSideBySideStereo()Method returnstrueif using side-by-side (SBS) stereoscopic images, otherwisefalse.
-
-
-
Field Detail
-
DISTORTION_BARREL
static final int DISTORTION_BARREL
Distortion Bit: Barrel distortion compensating lens pincushion distortion- See Also:
- Constant Field Values
-
DISTORTION_CHROMATIC
static final int DISTORTION_CHROMATIC
Distortion Bit: Chromatic distortion compensating lens chromatic aberration.- See Also:
- Constant Field Values
-
DISTORTION_VIGNETTE
static final int DISTORTION_VIGNETTE
Distortion Bit: Vignette distortion compensating lens chromatic aberration.- See Also:
- Constant Field Values
-
DISTORTION_TIMEWARP
static final int DISTORTION_TIMEWARP
Distortion Bit: Timewarp distortion technique to predictViewerPosemovement to reduce latency.FIXME: Explanation needs refinement!
- See Also:
- Constant Field Values
-
-
Method Detail
-
getDevice
StereoDevice getDevice()
Returns theStereoDeviceof thisStereoDeviceRendererinstance.
-
getEye
StereoDeviceRenderer.Eye getEye(int eyeNum)
Returns theStereoDeviceRenderer.Eyeinstance for the denotedeyeNum.
-
updateViewerPose
ViewerPose updateViewerPose()
Updates theViewerPoseand returns it.
-
getLastViewerPose
ViewerPose getLastViewerPose()
Returns the lastViewerPose.
-
getDistortionBits
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.
-
usesSideBySideStereo
boolean usesSideBySideStereo()
Method returnstrueif using side-by-side (SBS) stereoscopic images, otherwisefalse.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, orpost-processingis utilized to mergetexturesto a side-by-side configuration.
-
getEyeSurfaceSize
DimensionImmutable[] getEyeSurfaceSize()
Returns the surface size for each eye's a single image in pixel units.
-
getTotalSurfaceSize
DimensionImmutable getTotalSurfaceSize()
Returns the total surface size required for the complete images in pixel units.If
usesSideBySideStereo()the total size spans over bothgetEyeSurfaceSize(), side-by-side.Otherwise the size is equal to
getEyeSurfaceSize().
-
getTextureCount
int getTextureCount()
Returns the used texture-image count for post-processing, seeppAvailable().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.math.FovHVHalves[], float).
-
getTextureUnit
int getTextureUnit()
Returns the desired texture-image unit for post-processing, seeppAvailable().
-
init
void init(GL gl)
Initialize OpenGL related resources
-
dispose
void dispose(GL gl)
Release all OpenGL related resources
-
beginFrame
void beginFrame(GL gl)
Notifying that a new frame is about to start.
-
endFrame
void endFrame(GL gl)
Notifying that the frame has been rendered completely.
-
ppAvailable
boolean ppAvailable()
Returnstrueif stereoscopic post-processing is required and available, otherwisefalse.Stereoscopic post-processing is available if:
- one of the distortion bits are set, see
getDistortionBits()
If stereoscopic post-processing is used the following post-processing methods must be called to before
#endFrame():ppBegin(GL)ppOneEye(GL, int)for both eyesppEnd(GL)
- one of the distortion bits are set, see
-
ppBegin
void ppBegin(GL gl)
Begin stereoscopic post-processing, seeppAvailable().#updateViewerPose(int)for both eyes must be called upfront when rendering upstreamStereoGLEventListener.- Parameters:
gl-
-
ppOneEye
void ppOneEye(GL gl, int eyeNum)
Performs stereoscopic post-processing for one eye, seeppAvailable().- Parameters:
gl-eyeNum-
-
ppEnd
void ppEnd(GL gl)
End stereoscopic post-processing, seeppAvailable().- Parameters:
gl-
-
-