Aviatrix3D
2.0 Dev

org.j3d.aviatrix3d.pipeline.graphics
Interface GraphicsOutputDevice

All Superinterfaces:
OutputDevice
All Known Subinterfaces:
ElumensOutputDevice
All Known Implementing Classes:
BaseSurface, ElumensAWTSurface, ElumensSWTSurface

public interface GraphicsOutputDevice
extends OutputDevice

Interface representing the output of a render pipeline.

The output may be any of the traditional types: pBuffer, screen or memory or any non-traditional type like haptic devices, network streams etc.

Version:
$Revision: 3.3 $
Author:
Justin Couch

Field Summary
static int ALTERNATE_FRAME_STEREO
          The stereo rendering type draws to alternate eyes on each frame.
static int NO_STEREO
          The surface will render only non-stereo projection (traditional monoscopic projection policy).
static int QUAD_BUFFER_STEREO
          The stereo rendering type to be used should use quad buffered, alternate frame rendering.
static int TWO_CANVAS_STEREO
          The stereo rendering uses two canvases - one for each eye.
 
Method Summary
 void addGraphicsResizeListener(GraphicsResizeListener l)
          Add a resize listener instance to this surface.
 void getCenterEyeInSurface(int x, int y, int layer, int subLayer, javax.vecmath.Point3f position)
          Get the Center Eye position in surface coordinates.
 void getPixelLocationInSurface(int x, int y, int layer, int subLayer, javax.vecmath.Point3f position)
          Convert a pixel location to surface coordinates.
 float getStereoEyeSeparation()
          Get the current eye separation value, defined as the distance from the center axis to one eye.
 int getStereoRenderingPolicy()
          Get the current stereo rendering policy in use.
 void getSurfaceToVWorld(int x, int y, int layer, int subLayer, javax.vecmath.Matrix4f matrix)
          Get the surface to VWorld transformation matrix.
 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 queueShaderRequests(ShaderSceneGraphObject[] initList, int numInit, ShaderSceneGraphObject[] logList, int numLog)
          Queue up a collection of shader objects for processing on the next frame.
 void removeGraphicsResizeListener(GraphicsResizeListener l)
          Remove a resize listener from this surface.
 void setClearColor(float r, float g, float b, float a)
          Set the background colour that this surface should be cleared to before the drawing step.
 void setColorClearNeeded(boolean state)
          Set whether we should always force a local colour clear before beginning any drawing.
 void setDrawableObjects(GraphicsInstructions[] commands, int numValid)
          Update the list of items to be rendered to the current list.
 void setStereoEyeSeparation(float sep)
          Set the eye separation value when rendering stereo, defined as the distance from the center axis to one eye.
 void setStereoRenderingPolicy(int policy)
          Set the rendering policy used when handling stereo.
 void swap()
          Swap the buffers now if the surface supports multiple buffer drawing.
 
Methods inherited from interface org.j3d.aviatrix3d.pipeline.OutputDevice
dispose, disposeSingleThreadResources, draw, enableSingleThreaded, getSurfaceObject, isDisposed, queueDeletedObject, setErrorReporter
 

Field Detail

NO_STEREO

public static final int NO_STEREO
The surface will render only non-stereo projection (traditional monoscopic projection policy).

See Also:
Constant Field Values

QUAD_BUFFER_STEREO

public static final int QUAD_BUFFER_STEREO
The stereo rendering type to be used should use quad buffered, alternate frame rendering. In this type it renders to the left back buffer, then right back buffer and then swaps both. This is useful if you have HMDs which have two separate windows for the rendering.

See Also:
Constant Field Values

ALTERNATE_FRAME_STEREO

public static final int ALTERNATE_FRAME_STEREO
The stereo rendering type draws to alternate eyes on each frame. Used if you have shutter glasses where the user's vision is restricted to one eye or the other, but not both at the same time. Only uses a single double buffer to render alternate eye points

See Also:
Constant Field Values

TWO_CANVAS_STEREO

public static final int TWO_CANVAS_STEREO
The stereo rendering uses two canvases - one for each eye. The canvases are placed either side by side or vertically stacked, depending on the rendering options requested.

See Also:
Constant Field Values
Method Detail

isStereoAvailable

public boolean isStereoAvailable()
Check to see whether this surface supports stereo rendering. As this is not known until after initialisation, this method will return false until it can determine whether or not stereo is available.

Returns:
true Stereo support is currently available

isQuadStereoAvailable

public boolean isQuadStereoAvailable()
Check to see whether this surface supports Quad buffer stereo rendering. Quadbuffers uses the GL_BACK_LEFT and GL_BACK_RIGHT for rendering pairs rather than drawing alternate frames to the same window.

As this is not known until after initialisation, this method will return false until it can determine whether or not stereo is available.

Returns:
true Stereo support is currently available

setStereoRenderingPolicy

public void setStereoRenderingPolicy(int policy)
Set the rendering policy used when handling stereo. The policy must be one of the _STEREO constants defined in this interface.

Parameters:
policy - The policy to currently use
Throws:
java.lang.IllegalArgumentException - The policy type is not one of the legal selections.

getStereoRenderingPolicy

public int getStereoRenderingPolicy()
Get the current stereo rendering policy in use. If not explicitly set by the user, then it will default to NO_STEREO.

Returns:
One of the *_STEREO values

setStereoEyeSeparation

public void setStereoEyeSeparation(float sep)
Set the eye separation value when rendering stereo, defined as the distance from the center axis to one eye. The default value is 0.33 for most applications. The absolute value of the separation is always used.

Parameters:
sep - The amount of eye separation

getStereoEyeSeparation

public float getStereoEyeSeparation()
Get the current eye separation value, defined as the distance from the center axis to one eye. If we are in no-stereo mode then this will return zero.

Returns:
sep The amount of eye separation

setClearColor

public void setClearColor(float r,
                          float g,
                          float b,
                          float a)
Set the background colour that this surface should be cleared to before the drawing step. Colours range from 0 to 1 in the normal manner.

Parameters:
r - The red component of the background clear colour
g - The green component of the background clear colour
b - The blue component of the background clear colour
a - The alpha component of the background clear colour

setColorClearNeeded

public void setColorClearNeeded(boolean state)
Set whether we should always force a local colour clear before beginning any drawing. If this is set to false, then we can assume that there is at least one background floating around that we can use to clear whatever was drawn in the previous frame, and so we can ignore the glClear(GL.GL_COLOR_BUFFER_BIT) call. The default is set to true.

Parameters:
state - true if we should always locally clear first

queueShaderRequests

public void queueShaderRequests(ShaderSceneGraphObject[] initList,
                                int numInit,
                                ShaderSceneGraphObject[] logList,
                                int numLog)
Queue up a collection of shader objects for processing on the next frame. These processing requests are for either initialisation or log handling, not for rendering.

Parameters:
initList - The shaders needing initialisation
numInit - The number of shaders needing initialisation
logList - The shaders needing log fetching
numLog - The number of shaders needing log fetching

setDrawableObjects

public void setDrawableObjects(GraphicsInstructions[] commands,
                               int numValid)
Update the list of items to be rendered to the current list. Draw them at the next oppourtunity.

Parameters:
commands - The list of drawable surfaces to render
numValid - The number of valid items in the array

swap

public void swap()
Swap the buffers now if the surface supports multiple buffer drawing. For surfaces that don't support multiple buffers, this does nothing.


getSurfaceToVWorld

public void getSurfaceToVWorld(int x,
                               int y,
                               int layer,
                               int subLayer,
                               javax.vecmath.Matrix4f matrix)
Get the surface to VWorld transformation matrix.

Parameters:
x - The X coordinate in the entire surface
y - The Y coordinate in the entire surface
layer - The layer ID to fetch from. Layer 0 is the front-most
subLayer - The ID of the viewport-layer that is needed. If there are no sub-layers, use 0.
matrix - The matrix to copy into

getPixelLocationInSurface

public void getPixelLocationInSurface(int x,
                                      int y,
                                      int layer,
                                      int subLayer,
                                      javax.vecmath.Point3f position)
Convert a pixel location to surface coordinates.

Parameters:
x - The X coordinate in the entire surface
y - The Y coordinate in the entire surface
layer - The layer ID to fetch from. Layer 0 is the front-most
subLayer - The ID of the viewport-layer that is needed. If there are no sub-layers, use 0.
position - The converted position. It must be preallocated.

getCenterEyeInSurface

public void getCenterEyeInSurface(int x,
                                  int y,
                                  int layer,
                                  int subLayer,
                                  javax.vecmath.Point3f position)
Get the Center Eye position in surface coordinates.

Parameters:
x - The X coordinate in the entire surface
y - The Y coordinate in the entire surface
layer - The layer ID to fetch from. Layer 0 is the front-most
subLayer - The ID of the viewport-layer that is needed. If there are no sub-layers, use 0.
position - The current eye position. It must be preallocated.

addGraphicsResizeListener

public void addGraphicsResizeListener(GraphicsResizeListener l)
Add a resize listener instance to this surface. Duplicate listener instance add requests are ignored, as are null values.

Parameters:
l - The new listener instance to add

removeGraphicsResizeListener

public void removeGraphicsResizeListener(GraphicsResizeListener l)
Remove a resize listener from this surface. If the listener is not currently registered the request is ignored.

Parameters:
l - The listener instance to remove

Aviatrix3D
2.0 Dev

Latest Info from http://aviatrix3d.j3d.org/
Copyright © 2003 - 2005 j3d.org