|
Aviatrix3D 2.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.j3d.aviatrix3d.output.graphics.BaseRenderingProcessor
public abstract class BaseRenderingProcessor
Common implementation for rendering handling to render for a single output device - be it on-screen or off.
This class implements everything except for the display() method of GLEventListener.
Field Summary | |
---|---|
protected boolean |
alwaysLocalClear
Flag to say if we the default clear colour should be used, or if there is at least one background that we can make use of |
protected java.lang.Integer[] |
availableClips
Stack of the available OGL clip IDs that could be assigned to clips |
protected java.lang.Integer[] |
availableLights
Stack of the available OGL light IDs that could be assigned to lights |
protected float[] |
clearColor
The current clear colour |
protected org.j3d.util.IntHashMap |
clipIdMap
Mapping of the object ID to it's used clip ID |
protected java.lang.Integer |
currentShaderProgramId
The current program ID for GLSLang shaders. |
protected float[] |
currentViewport
Data describing the current viewport if explicit values used |
protected GraphicsEnvironmentData[] |
environmentList
Local storage of the environment data collections |
protected org.j3d.util.ErrorReporter |
errorReporter
Error reporter used to send out messages |
protected float[] |
eyePoint
The eye offset from the normal position |
protected javax.media.opengl.GLContext |
glContext
The context from the drawable |
protected boolean |
initComplete
Flag indicating if any initialisation has been performed yet. |
protected static int |
INITIAL_PATH_DEPTH
Initial depth for the number of transforms above a view,fog or bg |
protected static java.lang.Integer |
INVALID_SHADER
The invalid shader ID |
protected int |
lastClipIdx
index in the availableClips list of the last available |
protected int |
lastLightIdx
index in the availableLights list of the last available |
protected org.j3d.util.IntHashMap |
lightIdMap
Mapping of the object ID to it's used light ID |
protected static int |
LIST_START_SIZE
The initial size of the children list |
protected int |
numRenderables
Number of items in the renderable list |
protected int[] |
operationList
Local storage of the nodes that need to be rendered |
protected GraphicsRequestData |
otherDataRequests
Request object for deletions, shader stuff etc |
protected GraphicsDetails[] |
renderableList
Local storage of the nodes that need to be rendered |
protected boolean |
resetColor
Flag to say that colour needs to be reset this frame |
protected boolean |
singleThreaded
Single threaded rendering mode operation state. |
protected javax.vecmath.Matrix4f |
surfaceMatrix
Combined view and projection matrix. |
protected boolean |
terminate
Request that the current drawing terminate immediately. |
Constructor Summary | |
---|---|
protected |
BaseRenderingProcessor(javax.media.opengl.GLContext context)
Construct handler for rendering objects to the main screen. |
Method Summary | |
---|---|
protected abstract void |
display(GraphicsProfilingData profilingData)
Called for each rendering loop. |
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. |
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. |
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. |
protected void |
postLayerEnvironmentDraw(javax.media.opengl.GL gl,
GraphicsEnvironmentData data,
GraphicsProfilingData profilingData)
Complete the view environment setup at the end of the layer. |
protected void |
postMPPassEnvironmentDraw(javax.media.opengl.GL gl,
GraphicsEnvironmentData data)
Complete the view environment setup at the end of the layer. |
protected void |
preLayerEnvironmentDraw(javax.media.opengl.GL gl,
GraphicsEnvironmentData data)
Setup the view environment for a specific layer for drawing now. |
protected void |
preMPPassEnvironmentDraw(javax.media.opengl.GL gl,
GraphicsEnvironmentData data)
Setup the view environment for a specific pass of a multipass rendering for drawing now. |
protected void |
processRequestData(javax.media.opengl.GL gl)
|
boolean |
render(GraphicsProfilingData profilingData)
Draw to the drawable now. |
protected void |
renderViewpoint(javax.media.opengl.GL gl,
GraphicsEnvironmentData data)
Render the viewpoint setup. |
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. |
protected void |
setupMultipassViewport(javax.media.opengl.GL gl,
GraphicsEnvironmentData data)
Setup the viewport environment to be drawn for a multipass rendering. |
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. |
void |
swapBuffers()
Cause the buffers of the underlying drawable to swap now. |
protected void |
terminateCleanup()
If termination has been requested during the last call to the display loop, this method is called to destroy and cleanup the context instance. |
protected void |
updateProjectionMatrix(javax.media.opengl.GL gl,
GraphicsEnvironmentData data)
Update the projection matrix. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int LIST_START_SIZE
protected static final int INITIAL_PATH_DEPTH
protected static final java.lang.Integer INVALID_SHADER
protected float[] clearColor
protected boolean resetColor
protected GraphicsDetails[] renderableList
protected int[] operationList
protected int numRenderables
protected GraphicsEnvironmentData[] environmentList
protected GraphicsRequestData otherDataRequests
protected java.lang.Integer currentShaderProgramId
protected java.lang.Integer[] availableLights
protected int lastLightIdx
protected org.j3d.util.IntHashMap lightIdMap
protected java.lang.Integer[] availableClips
protected int lastClipIdx
protected org.j3d.util.IntHashMap clipIdMap
protected boolean alwaysLocalClear
protected javax.vecmath.Matrix4f surfaceMatrix
protected float[] eyePoint
protected float[] currentViewport
protected boolean initComplete
protected boolean terminate
protected org.j3d.util.ErrorReporter errorReporter
protected javax.media.opengl.GLContext glContext
protected boolean singleThreaded
Constructor Detail |
---|
protected BaseRenderingProcessor(javax.media.opengl.GLContext context)
context
- The context that this processor is working onMethod Detail |
---|
public void setErrorReporter(org.j3d.util.ErrorReporter reporter)
setErrorReporter
in interface RenderingProcessor
reporter
- The instance to use or nullpublic void halt()
halt
in interface RenderingProcessor
public void setClearColor(float r, float g, float b, float a)
setClearColor
in interface RenderingProcessor
r
- The red component of the background clear colourg
- The green component of the background clear colourb
- The blue component of the background clear coloura
- The alpha component of the background clear colourpublic void setColorClearNeeded(boolean state)
setColorClearNeeded
in interface RenderingProcessor
state
- true if we should always locally clear firstpublic void setDrawableObjects(GraphicsRequestData otherData, GraphicsDetails[] nodes, int[] renderOps, int numValid, GraphicsEnvironmentData[] envData)
setDrawableObjects
in interface RenderingProcessor
nodes
- The list of nodes in sorted orderrenderOps
- Operation to perform on each nodenumValid
- The number of valid items in the arrayenvData
- environment data to be rendered with this sceneotherData
- data to be processed before the renderingpublic final boolean render(GraphicsProfilingData profilingData)
render
in interface RenderingProcessor
profilingData
- The timing and load data
public void swapBuffers()
swapBuffers
in interface RenderingProcessor
public void enableSingleThreaded(boolean state)
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.
enableSingleThreaded
in interface RenderingProcessor
state
- true if the device can expect single threaded behaviourpublic void disposeSingleThreadResources()
disposeSingleThreadResources
in interface RenderingProcessor
public boolean getSurfaceToVWorld(int x, int y, int layer, int subLayer, javax.vecmath.Matrix4f matrix, java.lang.String deviceId, boolean useLastFound)
getSurfaceToVWorld
in interface RenderingProcessor
x
- The X coordinate on the surfacey
- The Y coordinate on the surfacematrix
- The matrix to copy into It must be preallocated.layer
- The layer ID to fetch from. Layer 0 is the front-mostsubLayer
- The ID of the viewport-layer that is needed. If there
are no sub-layers, use 0.deviceId
- A user-defined identifier for the requesting device when
using the lastFound itemsuseLastFound
- Should we skip the search process and use the last
data found for this layer/sublayer combo.
public boolean getPixelLocationInSurface(int x, int y, int layer, int subLayer, javax.vecmath.Point3f position, java.lang.String deviceId, boolean useLastFound)
getPixelLocationInSurface
in interface RenderingProcessor
x
- The X coordinatey
- The Y coordinatelayer
- The layer ID to fetch from. Layer 0 is the front-mostsubLayer
- 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 itemsuseLastFound
- Should we skip the search process and use the last
data found for this layer/sublayer combo.
public boolean getCenterEyeInSurface(int x, int y, int layer, int subLayer, javax.vecmath.Point3f position, java.lang.String deviceId, boolean useLastFound)
getCenterEyeInSurface
in interface RenderingProcessor
x
- The X coordinate on the surfacey
- The Y coordinate on the surfaceposition
- The current eye position. It must be preallocated.layer
- The layer ID to fetch from. Layer 0 is the front-mostdeviceId
- A user-defined identifier for the requesting device when
using the lastFound itemsuseLastFound
- Should we skip the search process and use the last
data found for this layer/sublayer combo.subLayer
- The ID of the viewport-layer that is needed. If there
are no sub-layers, use 0.
protected abstract void display(GraphicsProfilingData profilingData)
profilingData
- The timing and load dataprotected void init()
protected void processRequestData(javax.media.opengl.GL gl)
protected void terminateCleanup()
protected void setupViewport(javax.media.opengl.GL gl, GraphicsEnvironmentData data)
gl
- The gl context to draw withdata
- The view environment information to setupprotected void setupMultipassViewport(javax.media.opengl.GL gl, GraphicsEnvironmentData data)
gl
- The gl context to draw withdata
- The view environment information to setupprotected void preLayerEnvironmentDraw(javax.media.opengl.GL gl, GraphicsEnvironmentData data)
gl
- The gl context to draw withdata
- The view environment information to setupprotected void postLayerEnvironmentDraw(javax.media.opengl.GL gl, GraphicsEnvironmentData data, GraphicsProfilingData profilingData)
gl
- The gl context to draw withdata
- The view environment information to setupprofilingData
- The timing and load dataprotected void preMPPassEnvironmentDraw(javax.media.opengl.GL gl, GraphicsEnvironmentData data)
gl
- The gl context to draw withdata
- The view environment information to setupprotected void postMPPassEnvironmentDraw(javax.media.opengl.GL gl, GraphicsEnvironmentData data)
gl
- The gl context to draw withdata
- The view environment information to setupprotected void renderViewpoint(javax.media.opengl.GL gl, GraphicsEnvironmentData data)
gl
- The gl context to draw withdata
- The view environment information to setupprotected void updateProjectionMatrix(javax.media.opengl.GL gl, GraphicsEnvironmentData data)
gl
- The gl context to draw withdata
- The view environment information to setup
|
Aviatrix3D 2.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |