|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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.
Internationalisation Resource Names
Field Summary | |
---|---|
protected java.util.ArrayList<OffscreenBufferRenderable> |
addedBuffers
Child renderables that have just been added, but not processed yet. |
protected java.util.ArrayList<RenderingProcessor> |
addedProcessors
Mirror list of the matching rendering processors for added buffers |
protected float |
alphaCutoff
Alpha Test value for the parts of transparent objects that should be handled as opaque |
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 java.util.HashMap<OffscreenBufferRenderable,BaseBufferDescriptor> |
childBuffers
Currently managed child buffers |
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 boolean |
initComplete
Flag indicating if any initialisation has been performed yet. |
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 javax.media.opengl.GLContext |
localContext
The context from the drawable |
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 GraphicsOutputDevice |
ownerDevice
The owner device of us. |
protected BaseBufferDescriptor |
ownerRenderable
A reference to the containing renderable object that the contents of this rendering will be applied to. |
protected javax.media.opengl.GLContext |
parentContext
The context from the drawable that is above us in the rendering |
protected java.util.ArrayList<OffscreenBufferRenderable> |
removedBuffers
Child renderables that have been removed, but have not yet had their underlying resources deleted. |
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. |
protected java.util.ArrayList<OffscreenBufferRenderable> |
updatedBuffers
Child renderables that have just been added, but not processed yet. |
protected boolean |
useTwoPassTransparent
Flag indicating if we should do single or two-pass rendering of transparent objects. |
Constructor Summary | |
---|---|
protected |
BaseRenderingProcessor(javax.media.opengl.GLContext parentCtx,
GraphicsOutputDevice owner)
Construct handler for rendering objects to the main screen. |
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. |
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. |
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. |
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 |
isTwoPassTransparentEnabled()
Check the state of the two pass transprent rendering flag. |
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. |
EnableState |
prepareData()
Perform the pre-rendering tasks now, including enabling the context for this buffer as needed. |
protected void |
processRequestData(javax.media.opengl.GL gl)
Process the shader and delete requests for this scene now. |
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. |
protected void |
renderViewpoint(javax.media.opengl.GL gl,
GraphicsEnvironmentData data)
Render the viewpoint setup. |
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. |
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. |
void |
updateChildBuffer(OffscreenBufferRenderable rend)
Request that the given buffer gets updated. |
protected void |
updateContextChange()
The GL class instance has changed due to reinitialising the context, so work through the list of current renderable items and reinitialise them. |
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 java.lang.Integer INVALID_SHADER
protected GraphicsOutputDevice ownerDevice
protected float[] clearColor
protected boolean resetColor
protected float alphaCutoff
protected boolean useTwoPassTransparent
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 parentContext
protected javax.media.opengl.GLContext localContext
protected boolean singleThreaded
protected BaseBufferDescriptor ownerRenderable
protected java.util.ArrayList<OffscreenBufferRenderable> addedBuffers
protected java.util.ArrayList<RenderingProcessor> addedProcessors
protected java.util.ArrayList<OffscreenBufferRenderable> updatedBuffers
protected java.util.HashMap<OffscreenBufferRenderable,BaseBufferDescriptor> childBuffers
protected java.util.ArrayList<OffscreenBufferRenderable> removedBuffers
Constructor Detail |
---|
protected BaseRenderingProcessor(javax.media.opengl.GLContext parentCtx, GraphicsOutputDevice owner)
parentCtx
- The parent GL context to the surface that holds
this processor.owner
- The owning device of this processorMethod 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 enableTwoPassTransparentRendering(boolean state)
enableTwoPassTransparentRendering
in interface RenderingProcessor
state
- true if we should enable two pass renderingpublic boolean isTwoPassTransparentEnabled()
isTwoPassTransparentEnabled
in interface RenderingProcessor
public void setAlphaTestCutoff(float cutoff)
setAlphaTestCutoff
in interface RenderingProcessor
cutoff
- The alpha value at which to enable renderingpublic float getAlphaTestCutoff()
getAlphaTestCutoff
in interface RenderingProcessor
public 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 EnableState prepareData()
prepareData
in interface RenderingProcessor
public void reinitialize()
reinitialize
in interface RenderingProcessor
public 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.
public void setOwnerBuffer(BaseBufferDescriptor desc)
setOwnerBuffer
in interface RenderingProcessor
desc
- The descriptor of the buffer that this renders topublic void addChildBuffer(OffscreenBufferRenderable rend, RenderingProcessor proc)
addChildBuffer
in interface RenderingProcessor
rend
- The renderable instance to be updatedproc
- The processor associated with the renderablepublic void updateChildBuffer(OffscreenBufferRenderable rend)
updateChildBuffer
in interface RenderingProcessor
rend
- The renderable instance to be addedpublic void removeChildBuffer(OffscreenBufferRenderable rend)
removeChildBuffer
in interface RenderingProcessor
rend
- The renderable instance to be addedpublic void addSurfaceInfoListener(SurfaceInfoListener l)
addSurfaceInfoListener
in interface RenderingProcessor
l
- The new listener instance to addpublic void removeSurfaceInfoListener(SurfaceInfoListener l)
removeSurfaceInfoListener
in interface RenderingProcessor
l
- The listener instance to removeprotected abstract void display(GraphicsProfilingData profilingData)
profilingData
- The timing and load dataprotected void init()
protected void processRequestData(javax.media.opengl.GL gl)
gl
- The GL context to process the requests withprotected 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 setupprotected void updateContextChange()
|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |