public interface StereoDeviceRenderer
The following pseudo-code describes how to implement a renderer
using a StereoDeviceRenderer
.
See StereoClientRenderer
which implements the following:
beginFrame(GL)
updateEyePose(int)
ppAvailable()
: Set the render target, e.g. FBOStereoDeviceRenderer.Eye.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 | Interface and Description |
---|---|
static interface |
StereoDeviceRenderer.Eye
Interface describing one eye of the stereoscopic device,
see
getEye(int) . |
Modifier and Type | Field and Description |
---|---|
static int |
DISTORTION_BARREL
Distortion Bit: Barrel distortion compensating lens pincushion distortion
|
static int |
DISTORTION_CHROMATIC
Distortion Bit: Chromatic distortion compensating lens chromatic aberration.
|
static int |
DISTORTION_TIMEWARP
Distortion Bit: Timewarp distortion technique to predict
EyePose movement to reduce latency. |
static int |
DISTORTION_VIGNETTE
Distortion Bit: Vignette distortion compensating lens chromatic aberration.
|
Modifier and Type | Method and Description |
---|---|
void |
beginFrame(GL gl)
Notifying that a new frame is about to start.
|
void |
dispose(GL gl)
Release all OpenGL related resources
|
void |
endFrame(GL gl)
Notifying that the frame has been rendered completely.
|
StereoDevice |
getDevice()
Returns the
StereoDevice of this StereoDeviceRenderer instance. |
int |
getDistortionBits()
Returns used distortion compensation bits, e.g.
|
StereoDeviceRenderer.Eye |
getEye(int eyeNum)
Returns the
StereoDeviceRenderer.Eye instance for the denoted eyeNum . |
DimensionImmutable |
getSingleSurfaceSize()
Returns the unified surface size of one eye's a single image in pixel units.
|
int |
getTextureCount()
Returns the used texture-image count for post-processing, see
ppAvailable() . |
int |
getTextureUnit()
Returns the desired texture-image unit for post-processing, see
ppAvailable() . |
DimensionImmutable |
getTotalSurfaceSize()
Returns the total surface size required for the complete images in pixel units.
|
void |
init(GL gl)
Initialize OpenGL related resources
|
boolean |
ppAvailable()
Returns
true if stereoscopic post-processing is required and available,
otherwise false . |
void |
ppBegin(GL gl)
Begin stereoscopic post-processing, see
ppAvailable() . |
void |
ppEnd(GL gl)
End stereoscopic post-processing, see
ppAvailable() . |
void |
ppOneEye(GL gl,
int eyeNum)
Performs stereoscopic post-processing for one eye, see
ppAvailable() . |
EyePose |
updateEyePose(int eyeNum)
Updates the
StereoDeviceRenderer.Eye.getLastEyePose()
for the denoted eyeNum . |
boolean |
usesSideBySideStereo()
Method returns
true if using side-by-side (SBS)
stereoscopic images, otherwise false . |
static final int DISTORTION_BARREL
static final int DISTORTION_CHROMATIC
static final int DISTORTION_VIGNETTE
static final int DISTORTION_TIMEWARP
EyePose
movement to reduce latency.
FIXME: Explanation needs refinement!
StereoDevice getDevice()
StereoDevice
of this StereoDeviceRenderer
instance.StereoDeviceRenderer.Eye getEye(int eyeNum)
StereoDeviceRenderer.Eye
instance for the denoted eyeNum
.EyePose updateEyePose(int eyeNum)
StereoDeviceRenderer.Eye.getLastEyePose()
for the denoted eyeNum
.int getDistortionBits()
DISTORTION_BARREL
,
in case the stereoscopic display requires such, i.e. in case lenses are utilized.
Distortion requires post-processing
.
boolean usesSideBySideStereo()
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.
DimensionImmutable getSingleSurfaceSize()
DimensionImmutable getTotalSurfaceSize()
If usesSideBySideStereo()
the total size spans over both getSingleSurfaceSize()
, side-by-side.
Otherwise the size is equal to getSingleSurfaceSize()
.
int getTextureCount()
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)
.
int getTextureUnit()
ppAvailable()
.void init(GL gl)
void dispose(GL gl)
void beginFrame(GL gl)
void endFrame(GL gl)
boolean ppAvailable()
true
if stereoscopic post-processing is required and available,
otherwise false
.
Stereoscopic post-processing is available if:
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)
void ppBegin(GL gl)
ppAvailable()
.
updateEyePose(int)
for both eyes must be called upfront
when rendering upstream StereoGLEventListener
.
gl
- void ppOneEye(GL gl, int eyeNum)
ppAvailable()
.gl
- eyeNum
- void ppEnd(GL gl)
ppAvailable()
.gl
- Copyright 2010 JogAmp Community.