Aviatrix3D
2.1.0

org.j3d.aviatrix3d.output.graphics
Class QuadBufferStereoProcessor

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

public class QuadBufferStereoProcessor
extends BaseRenderingProcessor
implements StereoRenderingProcessor

Handles the rendering for a single output device using quad-buffered stereo techniques.

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.25 $
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
QuadBufferStereoProcessor(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.
protected  void init()
          Called by the drawable immediately after the OpenGL context is initialized or has changed; the GLContext has already been made current when this method is called.
 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 setStereoEyeSeparation(float sep)
          Set the eye separation value when rendering stereo.
protected  void setupViewport(javax.media.opengl.GL gl, GraphicsEnvironmentData data)
          Setup the viewport environment to be drawn, but do not yet set up the viewpoint and other per-layer-specific effects.
 
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, 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

QuadBufferStereoProcessor

public QuadBufferStereoProcessor(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

protected void init()
Called by the drawable immediately after the OpenGL context is initialized or has changed; the GLContext has already been made current when this method is called.

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

setupViewport

protected void setupViewport(javax.media.opengl.GL gl,
                             GraphicsEnvironmentData data)
Setup the viewport environment to be drawn, but do not yet set up the viewpoint and other per-layer-specific effects. If a viewport has multiple layers, then each layer could potentially have a different viewpoint etc.

Overrides:
setupViewport in class BaseRenderingProcessor
Parameters:
gl - The gl context to draw with
data - The view environment information to setup

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