Aviatrix3D
2.1.0

org.j3d.aviatrix3d.output.graphics
Class SingleEyeStereoProcessor

java.lang.Object
  extended by org.j3d.aviatrix3d.output.graphics.BaseRenderingProcessor
      extended by org.j3d.aviatrix3d.output.graphics.SingleEyeStereoProcessor
All Implemented Interfaces:
RenderingProcessor, StereoRenderingProcessor

public class SingleEyeStereoProcessor
extends BaseRenderingProcessor
implements StereoRenderingProcessor

Handles the rendering for a single output device, generating stereo by using alternate frame renders to render left and right views to a single buffer.

The code expects that everything is set up before each call of the display() callback. It does not handle any recursive rendering requests as that is assumed to have been sorted out before calling this renderer.

Version:
$Revision: 3.26 $
Author:
Justin Couch

Field Summary
 
Fields inherited from class org.j3d.aviatrix3d.output.graphics.BaseRenderingProcessor
addedBuffers, addedProcessors, alphaCutoff, alwaysLocalClear, availableClips, availableLights, childBuffers, clearColor, clipIdMap, currentShaderProgramId, currentViewport, environmentList, errorReporter, eyePoint, initComplete, INVALID_SHADER, lastClipIdx, lastLightIdx, lightIdMap, localContext, numRenderables, operationList, otherDataRequests, ownerDevice, ownerRenderable, parentContext, removedBuffers, renderableList, resetColor, singleThreaded, surfaceMatrix, terminate, updatedBuffers, useTwoPassTransparent
 
Constructor Summary
SingleEyeStereoProcessor(javax.media.opengl.GLContext context, GraphicsOutputDevice owner)
          Construct handler for rendering objects to the main screen.
 
Method Summary
 void display(GraphicsProfilingData profilingData)
          Called by the drawable to perform rendering by the client.
 float getStereoEyeSeparation()
          Get the current eye separation value - always returns 0.
 void init()
          Called by the drawable when the surface resizes itself.
 boolean isStereoAvailable()
          Check to see whether this surface supports stereo rendering.
protected  void preLayerEnvironmentDraw(javax.media.opengl.GL gl, GraphicsEnvironmentData data, boolean left)
          Setup the view environment data for drawing now.
 void setEyeToRender(boolean leftEye)
          Set which eye should be rendered by this renderer.
 void setStereoEyeSeparation(float sep)
          Set the eye separation value when rendering stereo.
 
Methods inherited from class org.j3d.aviatrix3d.output.graphics.BaseRenderingProcessor
addChildBuffer, addSurfaceInfoListener, disposeSingleThreadResources, enableSingleThreaded, enableTwoPassTransparentRendering, getAlphaTestCutoff, getCenterEyeInSurface, getPixelLocationInSurface, getSurfaceToVWorld, halt, isTwoPassTransparentEnabled, postLayerEnvironmentDraw, postMPPassEnvironmentDraw, preLayerEnvironmentDraw, preMPPassEnvironmentDraw, prepareData, processRequestData, reinitialize, removeChildBuffer, removeSurfaceInfoListener, render, renderViewpoint, setAlphaTestCutoff, setClearColor, setColorClearNeeded, setDrawableObjects, setErrorReporter, setOwnerBuffer, setupMultipassViewport, setupViewport, swapBuffers, terminateCleanup, updateChildBuffer, updateContextChange, updateProjectionMatrix
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.j3d.aviatrix3d.output.graphics.RenderingProcessor
addChildBuffer, addSurfaceInfoListener, disposeSingleThreadResources, enableSingleThreaded, enableTwoPassTransparentRendering, getAlphaTestCutoff, getCenterEyeInSurface, getPixelLocationInSurface, getSurfaceToVWorld, halt, isTwoPassTransparentEnabled, prepareData, reinitialize, removeChildBuffer, removeSurfaceInfoListener, render, setAlphaTestCutoff, setClearColor, setColorClearNeeded, setDrawableObjects, setErrorReporter, setOwnerBuffer, swapBuffers, updateChildBuffer
 

Constructor Detail

SingleEyeStereoProcessor

public SingleEyeStereoProcessor(javax.media.opengl.GLContext context,
                                GraphicsOutputDevice owner)
Construct handler for rendering objects to the main screen.

Parameters:
context - The context that this processor is working on
owner - The owning device of this processor
Method Detail

init

public void init()
Called by the drawable when the surface resizes itself. Used to reset the viewport dimensions.

Overrides:
init in class BaseRenderingProcessor

display

public void display(GraphicsProfilingData profilingData)
Called by the drawable to perform rendering by the client.

Specified by:
display in class BaseRenderingProcessor
Parameters:
profilingData - The timing and load data

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.

Specified by:
isStereoAvailable in interface StereoRenderingProcessor
Returns:
true Stereo support is currently available

setStereoEyeSeparation

public void setStereoEyeSeparation(float sep)
Set the eye separation value when rendering stereo. The default value is 0.33 for most applications. The absolute value of the separation is always used. Ignored for this implementation.

Specified by:
setStereoEyeSeparation in interface StereoRenderingProcessor
Parameters:
sep - The amount of eye separation

getStereoEyeSeparation

public float getStereoEyeSeparation()
Get the current eye separation value - always returns 0.

Specified by:
getStereoEyeSeparation in interface StereoRenderingProcessor
Returns:
sep The amount of eye separation

setEyeToRender

public void setEyeToRender(boolean leftEye)
Set which eye should be rendered by this renderer.

Parameters:
leftEye - true to render the left eye, false for right

preLayerEnvironmentDraw

protected void preLayerEnvironmentDraw(javax.media.opengl.GL gl,
                                       GraphicsEnvironmentData data,
                                       boolean left)
Setup the view environment data for drawing now.

Parameters:
gl - The gl context to draw with
data - The view environment information to setup
left - true if this is the left eye

Aviatrix3D
2.1.0

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