|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.aviatrix3d.output.graphics.BaseSurface org.j3d.aviatrix3d.output.graphics.BaseAWTSurface org.j3d.aviatrix3d.output.graphics.StereoAWTSurface
public class StereoAWTSurface
Implementation of the most drawable surface, supporting stereo rendering capabilities.
This implementation of GraphicsOutputDevice renders to a normal GLCanvas instance and provides pBuffer support as needed. Stereo support is provided based on the underlying hardware capabilities in combination with the user requested features.
In implementing the alternate frame mode rendering, there's some odd artifacts/bugs in the rendering process. What seems to be happening is if we draw left and then right on the same canvas one after the other, the left one always gets drawn, and the right one is drawn, with the left cleared very quickly. The effect is that the right image is very prominent, but the left is almost not seen at all.
So, for now the implementation uses an internal flag to draw to alternate eyes on each alternate call to display() from the external rendering thread. This really slows the renderer down from a frame rate perspective, so make sure your rendering cycle time is halved if you are using that to control frame rate.
Field Summary |
---|
Fields inherited from class org.j3d.aviatrix3d.output.graphics.BaseAWTSurface |
---|
lightweight, resizer |
Fields inherited from class org.j3d.aviatrix3d.output.graphics.BaseSurface |
---|
alphaCutoff, canCreatePBuffers, canvas, canvasContext, canvasDescriptor, canvasRenderer, errorReporter, FAILED_CONTEXT_MSG, initComplete, numRenderables, renderableList, rendererMap, sharedSurface, singleThreaded, surfaceMonitor, terminate, useTwoPassTransparent |
Fields inherited from interface org.j3d.aviatrix3d.pipeline.graphics.GraphicsOutputDevice |
---|
ALTERNATE_FRAME_STEREO, NO_STEREO, QUAD_BUFFER_STEREO, TWO_CANVAS_STEREO |
Constructor Summary | |
---|---|
StereoAWTSurface(javax.media.opengl.GLCapabilities caps,
BaseSurface sharedWith,
boolean lightweight,
int policy)
Construct a surface shares it's GL context with the given surface. |
|
StereoAWTSurface(javax.media.opengl.GLCapabilities caps,
BaseSurface sharedWith,
int policy)
Construct a surface shares it's GL context with the given surface. |
|
StereoAWTSurface(javax.media.opengl.GLCapabilities caps,
boolean lightweight,
int policy)
Construct a surface that requires the given set of capabilities. |
|
StereoAWTSurface(javax.media.opengl.GLCapabilities caps,
javax.media.opengl.GLCapabilitiesChooser chooser,
BaseSurface sharedWith,
boolean lightweight,
int policy)
Construct a surface shares it's GL context with the given surface. |
|
StereoAWTSurface(javax.media.opengl.GLCapabilities caps,
javax.media.opengl.GLCapabilitiesChooser chooser,
BaseSurface sharedWith,
int policy)
Construct a surface shares it's GL context with the given surface. |
|
StereoAWTSurface(javax.media.opengl.GLCapabilities caps,
javax.media.opengl.GLCapabilitiesChooser chooser,
boolean lightweight,
int policy)
Construct a surface that requires the given set of capabilities. |
|
StereoAWTSurface(javax.media.opengl.GLCapabilities caps,
javax.media.opengl.GLCapabilitiesChooser chooser,
int policy)
Construct a surface that requires the given set of capabilities. |
|
StereoAWTSurface(javax.media.opengl.GLCapabilities caps,
int policy)
Construct a surface that requires the given set of capabilities. |
Method Summary | |
---|---|
boolean |
completeCanvasInitialisation(javax.media.opengl.GL gl)
Used during initialisation of the system for the first time. |
protected boolean |
createLightweightContext()
Attempt to create a new lightweight canvas renderer now. |
boolean |
draw(GraphicsProfilingData profilingData)
Instruct the surface to draw the collected set of nodes now. |
float |
getStereoEyeSeparation()
Get the current eye separation value - always returns 0. |
int |
getStereoRenderingPolicy()
Get the current stereo rendering policy in use. |
java.lang.Object |
getSurfaceObject()
Get the underlying object that this surface is rendered to. |
boolean |
isQuadStereoAvailable()
Check to see whether this surface supports Quad buffer stereo rendering. |
boolean |
isStereoAvailable()
Check to see whether this surface supports stereo rendering. |
void |
resychronizeRenderTarget()
Resynchronise the stereo rendering to be the next frame as the left eye view. |
void |
setStereoEyeSeparation(float sep)
Set the eye separation value when rendering stereo. |
void |
setStereoRenderingPolicy(int policy)
Set the rendering policy used when handling stereo. |
Methods inherited from class org.j3d.aviatrix3d.output.graphics.BaseAWTSurface |
---|
addGraphicsResizeListener, draw, removeGraphicsResizeListener, setDrawableObjects, setErrorReporter, swap |
Methods inherited from class org.j3d.aviatrix3d.output.graphics.BaseSurface |
---|
addSurfaceInfoListener, checkForExtension, createRenderingProcessor, dispose, disposeSingleThreadResources, enableSingleThreaded, enableTwoPassTransparentRendering, getAlphaTestCutoff, getCenterEyeInSurface, getGLContext, getPixelLocationInSurface, getSharedGLContext, getSurfaceToVWorld, init, initCanvas, isDisposed, isShared, isTwoPassTransparentEnabled, removeSurfaceInfoListener, setAlphaTestCutoff, setClearColor, setColorClearNeeded |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StereoAWTSurface(javax.media.opengl.GLCapabilities caps, int policy)
caps
- A set of required capabilities for this canvas.policy
- The policy to currently use
java.lang.IllegalArgumentException
- The policy type is not one of the legal
selections.public StereoAWTSurface(javax.media.opengl.GLCapabilities caps, javax.media.opengl.GLCapabilitiesChooser chooser, int policy)
caps
- A set of required capabilities for this canvas.chooser
- Custom algorithm for selecting one of the available
GLCapabilities for the component;policy
- The policy to currently use
java.lang.IllegalArgumentException
- The policy type is not one of the legal
selections.public StereoAWTSurface(javax.media.opengl.GLCapabilities caps, boolean lightweight, int policy)
caps
- A set of required capabilities for this canvas.lightweight
- If true, uses a GLJPanel (lightweight) JComponent,
otherwise a GLCanvas. Note that setting this to true could negatively
impact performance.policy
- The policy to currently use
java.lang.IllegalArgumentException
- The policy type is not one of the legal
selections.public StereoAWTSurface(javax.media.opengl.GLCapabilities caps, javax.media.opengl.GLCapabilitiesChooser chooser, boolean lightweight, int policy)
caps
- A set of required capabilities for this canvas.chooser
- Custom algorithm for selecting one of the available
GLCapabilities for the component;lightweight
- If true, uses a GLJPanel (lightweight) JComponent,
otherwise a GLCanvas. Note that setting this to true could negatively
impact performance.policy
- The policy to currently use
java.lang.IllegalArgumentException
- The policy type is not one of the legal
selections.public StereoAWTSurface(javax.media.opengl.GLCapabilities caps, BaseSurface sharedWith, int policy)
If the sharedWith parameter is null, then this is just treated as an ordinary non-shared frame. The return flag will be set appropriately.
caps
- A set of required capabilities for this canvas.sharedWith
- The surface that you'd like this surface to share
the GL context with, if possible. May be null.policy
- The policy to currently use
java.lang.IllegalArgumentException
- The policy type is not one of the legal
selections.public StereoAWTSurface(javax.media.opengl.GLCapabilities caps, javax.media.opengl.GLCapabilitiesChooser chooser, BaseSurface sharedWith, int policy)
If the sharedWith parameter is null, then this is just treated as an ordinary non-shared frame. The return flag will be set appropriately.
caps
- A set of required capabilities for this canvas.chooser
- Custom algorithm for selecting one of the available
GLCapabilities for the component;sharedWith
- The surface that you'd like this surface to share
the GL context with, if possible. May be null.policy
- The policy to currently use
java.lang.IllegalArgumentException
- The policy type is not one of the legal
selections.public StereoAWTSurface(javax.media.opengl.GLCapabilities caps, BaseSurface sharedWith, boolean lightweight, int policy)
If the sharedWith parameter is null, then this is just treated as an ordinary non-shared frame. The return flag will be set appropriately.
caps
- A set of required capabilities for this canvas.sharedWith
- The surface that you'd like this surface to share
the GL context with, if possible. May be null.lightweight
- If true, uses a GLJPanel (lightweight) JComponent,
otherwise a GLCanvas. Note that setting this to true could negatively
impact performance.policy
- The policy to currently use
java.lang.IllegalArgumentException
- The policy type is not one of the legal
selections.public StereoAWTSurface(javax.media.opengl.GLCapabilities caps, javax.media.opengl.GLCapabilitiesChooser chooser, BaseSurface sharedWith, boolean lightweight, int policy)
If the sharedWith parameter is null, then this is just treated as an ordinary non-shared frame. The return flag will be set appropriately.
caps
- A set of required capabilities for this canvas.chooser
- Custom algorithm for selecting one of the available
GLCapabilities for the component;sharedWith
- The surface that you'd like this surface to share
the GL context with, if possible. May be null.lightweight
- If true, uses a GLJPanel (lightweight) JComponent,
otherwise a GLCanvas. Note that setting this to true could negatively
impact performance.policy
- The policy to currently use
java.lang.IllegalArgumentException
- The policy type is not one of the legal
selections.Method Detail |
---|
public boolean isStereoAvailable()
isStereoAvailable
in interface GraphicsOutputDevice
isStereoAvailable
in class BaseSurface
public boolean isQuadStereoAvailable()
As this is not known until after initialisation, this method will return false until it can determine whether or not stereo is available.
isQuadStereoAvailable
in interface GraphicsOutputDevice
isQuadStereoAvailable
in class BaseSurface
public void setStereoEyeSeparation(float sep)
setStereoEyeSeparation
in interface GraphicsOutputDevice
setStereoEyeSeparation
in class BaseSurface
sep
- The amount of eye separationpublic float getStereoEyeSeparation()
getStereoEyeSeparation
in interface GraphicsOutputDevice
getStereoEyeSeparation
in class BaseSurface
public void setStereoRenderingPolicy(int policy)
setStereoRenderingPolicy
in interface GraphicsOutputDevice
setStereoRenderingPolicy
in class BaseSurface
policy
- The policy to currently use
java.lang.IllegalArgumentException
- The policy type is not one of the legal
selections.public int getStereoRenderingPolicy()
NO_STEREO
.
getStereoRenderingPolicy
in interface GraphicsOutputDevice
getStereoRenderingPolicy
in class BaseSurface
public boolean draw(GraphicsProfilingData profilingData)
The return value indicates success or failure in the ability to render this frame. Typically it will indicate failure if the underlying surface has been disposed of, either directly through the calling of the method on this interface, or through an internal check mechanism. If failure is indicated, then check to see if the surface has been disposed of and discontinue rendering if it has.
profilingData
- The timing and load data
public java.lang.Object getSurfaceObject()
protected boolean createLightweightContext()
createLightweightContext
in class BaseAWTSurface
public boolean completeCanvasInitialisation(javax.media.opengl.GL gl)
The return value indicates success or failure in the ability to initialise this surface. Typically it will indicate failure if the underlying surface has been disposed of or a failure to find the capabilities needed. The default implementation returns true.
completeCanvasInitialisation
in class BaseSurface
gl
- An initialised, current gl context to play with
public void resychronizeRenderTarget()
|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |