Aviatrix3D
2.1.0

org.j3d.aviatrix3d.output.graphics
Interface RenderingProcessor

All Known Subinterfaces:
StereoRenderingProcessor
All Known Implementing Classes:
BaseRenderingProcessor, DebugRenderingProcessor, ElumensRenderingProcessor, QuadBufferStereoProcessor, SingleEyeStereoProcessor, StandardRenderingProcessor

public interface RenderingProcessor

Handles the rendering for a single output device - be it on-screen or off.

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.20 $
Author:
Justin Couch

Method Summary
 void addChildBuffer(OffscreenBufferRenderable rend, RenderingProcessor proc)
          Add a dependent child rendering buffer to this processor.
 void addSurfaceInfoListener(SurfaceInfoListener l)
          Add a surface info listener instance to this surface.
 void disposeSingleThreadResources()
          If the output device is marked as single threaded, this instructs the device that the current rendering thread has exited.
 void enableSingleThreaded(boolean state)
          Notification that this surface is being drawn to with a single thread.
 void enableTwoPassTransparentRendering(boolean state)
          Enable or disable two pass rendering of transparent objects.
 float getAlphaTestCutoff()
          Get the current value of the alpha test cutoff number.
 boolean getCenterEyeInSurface(int x, int y, int layer, int subLayer, javax.vecmath.Point3f position, java.lang.String deviceId, boolean useLastFound)
          Get the Center Eye position in surface coordinates.
 boolean getPixelLocationInSurface(int x, int y, int layer, int subLayer, javax.vecmath.Point3f position, java.lang.String deviceId, boolean useLastFound)
          Convert a pixel location to surface coordinates.
 boolean getSurfaceToVWorld(int x, int y, int layer, int subLayer, javax.vecmath.Matrix4f matrix, java.lang.String deviceId, boolean useLastFound)
          Get the surface to VWorld transformation matrix.
 void halt()
          Force a halt of the current processing.
 boolean isTwoPassTransparentEnabled()
          Check the state of the two pass transprent rendering flag.
 EnableState prepareData()
          Perform the pre-rendering tasks now, including enabling the context for this buffer as needed.
 void reinitialize()
          In the prepare data call, it was found that the GL context had been reinitialised.
 void removeChildBuffer(OffscreenBufferRenderable rend)
          Remove a dependent child rendering buffer to this processor.
 void removeSurfaceInfoListener(SurfaceInfoListener l)
          Remove a surface info listener from this surface.
 boolean render(GraphicsProfilingData profilingData)
          Draw to the drawable now.
 void setAlphaTestCutoff(float cutoff)
          If two pass rendering of transparent objects is enabled, this is the alpha test value used when deciding what to render.
 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(GraphicsRequestData otherData, GraphicsDetails[] nodes, int[] renderOps, int numValid, GraphicsEnvironmentData[] envData)
          Update the list of items to be rendered to the current list.
 void setErrorReporter(org.j3d.util.ErrorReporter reporter)
          Register an error reporter with the engine so that any errors generated by the node's internals can be reported in a nice, pretty fashion.
 void setOwnerBuffer(BaseBufferDescriptor desc)
          Set the buffer descriptor that represents the surface that this renderer works with.
 void swapBuffers()
          Cause the buffers of the underlying drawable to swap now.
 void updateChildBuffer(OffscreenBufferRenderable rend)
          Request that the given buffer gets updated.
 

Method Detail

setErrorReporter

void setErrorReporter(org.j3d.util.ErrorReporter reporter)
Register an error reporter with the engine so that any errors generated by the node's internals can be reported in a nice, pretty fashion. Setting a value of null will clear the currently set reporter. If one is already set, the new value replaces the old.

Parameters:
reporter - The instance to use or null

setClearColor

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

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

enableTwoPassTransparentRendering

void enableTwoPassTransparentRendering(boolean state)
Enable or disable two pass rendering of transparent objects. By default it is disabled.

Parameters:
state - true if we should enable two pass rendering

isTwoPassTransparentEnabled

boolean isTwoPassTransparentEnabled()
Check the state of the two pass transprent rendering flag.

Returns:
true if two pass rendering of transparent objects is enabled

setAlphaTestCutoff

void setAlphaTestCutoff(float cutoff)
If two pass rendering of transparent objects is enabled, this is the alpha test value used when deciding what to render. The default value is 1.0. No sanity checking is performed, but the value should be between [0,1].

Parameters:
cutoff - The alpha value at which to enable rendering

getAlphaTestCutoff

float getAlphaTestCutoff()
Get the current value of the alpha test cutoff number. Will always return the currently set number regardless of the state of the two pass rendering flag.

Returns:
The currently set cut off value

setDrawableObjects

void setDrawableObjects(GraphicsRequestData otherData,
                        GraphicsDetails[] nodes,
                        int[] renderOps,
                        int numValid,
                        GraphicsEnvironmentData[] envData)
Update the list of items to be rendered to the current list. Draw them at the next oppourtunity.

Parameters:
otherData - data to be processed before the rendering
nodes - The list of nodes in sorted order
renderOps - Operation to perform on each node
numValid - The number of valid items in the array
envData - environment data to be rendered with this scene

setOwnerBuffer

void setOwnerBuffer(BaseBufferDescriptor desc)
Set the buffer descriptor that represents the surface that this renderer works with. Can be used to enable and disable the buffer at the appropriate time for rendering.

Parameters:
desc - The descriptor of the buffer that this renders to

addChildBuffer

void addChildBuffer(OffscreenBufferRenderable rend,
                    RenderingProcessor proc)
Add a dependent child rendering buffer to this processor. If it is already a current child, it will ignore the request.

Parameters:
rend - The renderable instance to be added
proc - The processor associated with the renderable

updateChildBuffer

void updateChildBuffer(OffscreenBufferRenderable rend)
Request that the given buffer gets updated.

Parameters:
rend - The renderable instance to be added

removeChildBuffer

void removeChildBuffer(OffscreenBufferRenderable rend)
Remove a dependent child rendering buffer to this processor. If it is not a current child, it will ignore the request.

Parameters:
rend - The renderable instance to be added

prepareData

EnableState prepareData()
Perform the pre-rendering tasks now, including enabling the context for this buffer as needed.

Returns:
either The enable was good, a reinitialisation was performed or it failed completely.

reinitialize

void reinitialize()
In the prepare data call, it was found that the GL context had been reinitialised. So, pass through all the current geometry now and reinitialise everything that needs it.


render

boolean render(GraphicsProfilingData profilingData)
Draw to the drawable now. This causes the drawable's context to be made current and the GL commands are issued. Derived classes should not override this method, instead they should use the display() or init() methods as needed.

Parameters:
profilingData - The timing and load data
Returns:
false if the rendering should not continue

swapBuffers

void swapBuffers()
Cause the buffers of the underlying drawable to swap now.


enableSingleThreaded

void enableSingleThreaded(boolean state)
Notification that this surface is being drawn to with a single thread. This can be used to optmise internal state handling when needed in a single versus multithreaded environment.

This method should never be called by end user code. It is purely for the purposes of the RenderManager to inform the device about what state it can expect.

Parameters:
state - true if the device can expect single threaded behaviour

disposeSingleThreadResources

void disposeSingleThreadResources()
If the output device is marked as single threaded, this instructs the device that the current rendering thread has exited. Next time the draw method is called, a new rendering context will need to be created for a new incoming thread instance. Also, if any other per-thread resources are around, clean those up now. This is called just before that thread exits.


getSurfaceToVWorld

boolean getSurfaceToVWorld(int x,
                           int y,
                           int layer,
                           int subLayer,
                           javax.vecmath.Matrix4f matrix,
                           java.lang.String deviceId,
                           boolean useLastFound)
Get the surface to VWorld transformation matrix. The coordinate system is in the window-system interface: The x,y position is the lower left corner, with height going up the screen and width heading to the right.

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
deviceId - A user-defined identifier for the requesting device when using the lastFound items
useLastFound - Should we skip the search process and use the last data found for this layer/sublayer combo.
Returns:
Whether the coordinates where on the layer

getPixelLocationInSurface

boolean getPixelLocationInSurface(int x,
                                  int y,
                                  int layer,
                                  int subLayer,
                                  javax.vecmath.Point3f position,
                                  java.lang.String deviceId,
                                  boolean useLastFound)
Convert a pixel location to surface coordinates. The coordinate system is in the window-system interface: The x,y position is the lower left corner, with height going up the screen and width heading to the right.

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.
deviceId - A user-defined identifier for the requesting device when using the lastFound items
useLastFound - Should we skip the search process and use the last data found for this layer/sublayer combo.
Returns:
Whether the coordinates where on the layer

getCenterEyeInSurface

boolean getCenterEyeInSurface(int x,
                              int y,
                              int layer,
                              int subLayer,
                              javax.vecmath.Point3f position,
                              java.lang.String deviceId,
                              boolean useLastFound)
Get the Center Eye position in surface coordinates. The coordinate system is in the window-system interface: The x,y position is the lower left corner, with height going up the screen and width heading to the right.

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.
deviceId - A user-defined identifier for the requesting device when using the lastFound items
useLastFound - Should we skip the search process and use the last data found for this layer/sublayer combo.
Returns:
Whether the coordinates where on the layer

halt

void halt()
Force a halt of the current processing. Any processing in progress should exit immediately. Used to abort the current scene processing due to application shutdown.


addSurfaceInfoListener

void addSurfaceInfoListener(SurfaceInfoListener l)
Add a surface info listener instance to this surface. Duplicate listener instance add requests are ignored, as are null values.

Parameters:
l - The new listener instance to add

removeSurfaceInfoListener

void removeSurfaceInfoListener(SurfaceInfoListener l)
Remove a surface info listener from this surface. If the listener is not currently registered the request is ignored.

Parameters:
l - The listener instance to remove

Aviatrix3D
2.1.0

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