|
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.pipeline.graphics.BaseCullStage
public abstract class BaseCullStage
Common implementation of many of the capabilities required by any cull stage.
The class takes care of the majority of the basic implementation requirements such as resizing various data structures, traversing the top of the scene graph super structure (layers, viewports et al) and processing offscreen sources, before sending onto the next stage. All the derived class is required to do is handle traversing a single scene instance and registering any pBuffer offscreens it happens to find. This class will make sure that they are looked after appropriately.
Field Summary | |
---|---|
protected OffscreenCullable |
activeParent
The active parent scene of the scene we are processing. |
protected OverrideRenderable[] |
appearanceStack
A stack used to control the appearance override nodes down the tree |
protected boolean |
checkOffscreens
If set, recurse into Shape3Ds looking for offscreen textures |
protected EffectRenderable[] |
clipList
The list of clip plane nodes currently valid while traversing. |
protected float[][] |
clipTxList
The list of clip transforms currently valid while traversing |
protected java.util.ArrayList<Cullable> |
currentViewpointPath
Path to the current viewpoint |
protected org.j3d.util.ErrorReporter |
errorReporter
Local reporter to put errors in |
protected float[] |
eyePoint
Storage variable for the eye offset values |
protected EffectRenderable[] |
fogStack
A stack used to control the depth of the fog nodes down the tree |
protected int |
lastAppearanceStack
Index to the next place to add items in the fogStack |
protected int |
lastClip
Index to the next place to add items in the clipList |
protected int |
lastFogStack
Index to the next place to add items in the fogStack |
protected int |
lastLight
Index to the next place to add items in the lightList |
protected int |
lastOutputLayer
Index of the the next layer output |
protected int |
lastOutputList
Index to the next output list in the validCullList |
protected int |
lastSubscene
Index of the last subscene in the list |
protected int |
lastTxStack
Index to the next place to add items in the transformStack |
protected LayerCullable[] |
layersTmp
Temporary variable for fetching layers from sub scenes |
protected static int |
LIGHT_INCREMENT
The increment size of the list if it gets overflowed |
protected static int |
LIGHT_START_SIZE
The initial size of the light list |
protected EffectRenderable[] |
lightList
The list of lights nodes currently valid while traversing. |
protected float[][] |
lightTxList
The list of light transforms currently valid while traversing |
protected static int |
LIST_INCREMENT
The increment size of the list if it gets overflowed |
protected static int |
LIST_START_LENGTH
Initial size of the cull list for the number of offscreen surfaces |
protected org.j3d.util.MatrixUtils |
matrixUtils
Matrix utility code for doing inversions |
protected javax.vecmath.Matrix4f |
orientationMatrix
Rotation matrix for the orientation provided by user |
protected int[] |
outputLayerCounts
Final list of the counts of layers in each subscene |
protected ViewportCollection[][] |
outputLayers
Final list of the layers that are to be passed to the output |
protected OffscreenBufferRenderable[][] |
outputSceneParents
List of valid subscene parents as we process them |
protected OffscreenCullable[] |
pendingParents
Buffer list of sub scenes that still need processing |
protected OffscreenCullable[] |
pendingSubscenes
Buffer list of sub scenes that still need processing |
protected org.j3d.util.HashSet |
processedPBufferTextures
Collection of offscreen textures we've found this frame |
protected float[] |
screenOrientation
Storage variable for the screen orientation values |
protected static java.lang.String |
SHARED_VP_MSG
Message when setting the active view if it contains a shared parent |
protected boolean |
terminate
Flag indicating a shutdown of the current processing is requested |
protected javax.vecmath.Matrix4f[] |
transformStack
A stack used to control the depth of the transform tree |
protected boolean |
useEyePoint
Flag to say explicit eyepoint values have been provided |
protected boolean |
useOrientation
Flag to say explicit screen orientation values have been provided |
protected OffscreenBufferRenderable[][] |
validSceneParents
List of valid subscene parents as we process them |
protected javax.vecmath.Matrix4f |
viewMatrix1
Matrix used for pre-computing the view stack |
protected javax.vecmath.Matrix4f |
viewMatrix2
Matrix used for pre-computing the view stack |
protected GraphicsCullOutputDetails[] |
workCullList
List that is being used to fill values into |
protected int[] |
workLayerCounts
Working list of the counts of layers in each subscene |
protected ViewportCollection[][] |
workLayers
Working list of the layers that are to be passed to the output |
Constructor Summary | |
---|---|
BaseCullStage(int numSurfaces)
Create a basic instance of this class with the list initial internal setup for the given number of renderable surfaces. |
Method Summary | |
---|---|
protected void |
checkForOffscreens(ShapeRenderable shape)
Check a shape node for the offscreen textures that may be present. |
protected void |
cleanupOldRefs()
Clean up the unused resources after the end of the cull process. |
void |
cull(RenderableRequestData otherData,
ProfilingData profilingData,
LayerCullable[] layers,
int numLayers)
Update and cull the scenegraph defined by a set of layers. |
protected void |
cullMultipassViewportLayer(SceneCullable scene,
int subsceneId,
int layerId,
int viewIndex,
int layerIndex)
Cull through a multipass viewport layer. |
protected abstract void |
cullRenderPass(RenderPassCullable pass,
int passNumber,
int subsceneId,
int layerId,
int viewIndex,
int layerIndex)
Update and cull the a single pass from a multipass rendering. |
protected abstract void |
cullScene(RenderPassCullable scene,
int subsceneId,
int layerId,
int viewIndex,
int layerIndex)
Update and cull the scenegraph. |
protected abstract void |
cullScene2D(RenderPassCullable scene,
int subsceneId,
int layerId,
int viewIndex,
int layerIndex)
Update and cull a 2D scenegraph. |
protected void |
cullSingleViewportLayer(SceneCullable scene,
int subsceneId,
int layerId,
int viewIndex,
int layerIndex)
Cull through a multipass viewport layer. |
protected void |
cullViewport(ViewportCullable view,
int subsceneId,
int layerId,
int viewIndex)
Process a single viewport for culling. |
protected void |
fill2DEnvData(SceneCullable scene,
GraphicsEnvironmentData envData)
Take a 2D scene and fill in a GraphicsEnvironmentData instance. |
protected void |
fillMultipassEnvData(SceneCullable scene,
GraphicsEnvironmentData envData)
Take a simple scene and fill in a GraphicsEnvironmentData instance. |
protected void |
fillRenderPassEnvData(RenderPassCullable pass,
GraphicsEnvironmentData envData,
BufferDetails bufferData)
Take a simple scene and fill in a GraphicsEnvironmentData instance. |
protected void |
fillSingleEnvData(SceneCullable scene,
GraphicsEnvironmentData envData)
Take a simple scene and fill in a GraphicsEnvironmentData instance. |
void |
halt()
Force a halt of the current processing. |
boolean |
isOffscreenCheckEnabled()
Find out what the current offscreen check state is. |
protected void |
processLayer(LayerCullable layer,
int subsceneId,
int layerId)
Process the layers of a pbuffer texture source. |
protected void |
resizeAppearanceStack()
Resize the appearance stack if needed. |
protected void |
resizeClipList()
Resize the list if needed. |
protected void |
resizeCullList(int cur_size)
Resize the list if needed. |
protected void |
resizeFogStack()
Resize the fog stack if needed. |
protected void |
resizeLightList()
Resize the list if needed. |
protected void |
resizeOffscreenList()
Resize the list if needed. |
protected void |
resizeOutputLists()
Resize the list if needed. |
protected void |
resizeStack()
Resize the transform stack if needed. |
void |
setCulledGeometryReceiver(CulledGeometryReceiver sgr)
Register a reciever for the output of the sorter. |
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 |
setEyePointOffset(float x,
float y,
float z)
Set the eyepoint offset from the centre position. |
void |
setOffscreenCheckEnabled(boolean state)
Set the flag for whether to check for offscreen textures or not. |
void |
setScreenOrientation(float x,
float y,
float z,
float a)
Set the orientation of this screen relative to the user's normal view direction. |
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.String SHARED_VP_MSG
protected static final int LIST_START_LENGTH
protected static final int LIST_INCREMENT
protected static final int LIGHT_START_SIZE
protected static final int LIGHT_INCREMENT
protected boolean checkOffscreens
protected OffscreenCullable[] pendingSubscenes
protected OffscreenCullable[] pendingParents
protected int lastSubscene
protected ViewportCollection[][] workLayers
protected ViewportCollection[][] outputLayers
protected int[] workLayerCounts
protected int[] outputLayerCounts
protected int lastOutputLayer
protected OffscreenBufferRenderable[][] validSceneParents
protected OffscreenBufferRenderable[][] outputSceneParents
protected GraphicsCullOutputDetails[] workCullList
protected int lastOutputList
protected javax.vecmath.Matrix4f[] transformStack
protected int lastTxStack
protected EffectRenderable[] fogStack
protected int lastFogStack
protected EffectRenderable[] lightList
protected float[][] lightTxList
protected int lastLight
protected EffectRenderable[] clipList
protected float[][] clipTxList
protected int lastClip
protected OverrideRenderable[] appearanceStack
protected int lastAppearanceStack
protected org.j3d.util.HashSet processedPBufferTextures
protected OffscreenCullable activeParent
protected java.util.ArrayList<Cullable> currentViewpointPath
protected javax.vecmath.Matrix4f viewMatrix1
protected javax.vecmath.Matrix4f viewMatrix2
protected javax.vecmath.Matrix4f orientationMatrix
protected float[] screenOrientation
protected float[] eyePoint
protected boolean useOrientation
protected boolean useEyePoint
protected boolean terminate
protected LayerCullable[] layersTmp
protected org.j3d.util.MatrixUtils matrixUtils
protected org.j3d.util.ErrorReporter errorReporter
Constructor Detail |
---|
public BaseCullStage(int numSurfaces)
numSurfaces
- Total number of surfaces to prepare rendering forMethod Detail |
---|
public void cull(RenderableRequestData otherData, ProfilingData profilingData, LayerCullable[] layers, int numLayers)
cull
in interface CullStage
otherData
- data to be passed along unprocessedprofilingData
- The timing and load data on each stagelayers
- The collection of layers, in order, to rendernumLayers
- The number of valid layers to usepublic void setCulledGeometryReceiver(CulledGeometryReceiver sgr)
setCulledGeometryReceiver
in interface GraphicsCullStage
sgr
- The receiver instance to add or nullpublic void setOffscreenCheckEnabled(boolean state)
setOffscreenCheckEnabled
in interface GraphicsCullStage
state
- true if offscreen textures should be looked forpublic boolean isOffscreenCheckEnabled()
isOffscreenCheckEnabled
in interface GraphicsCullStage
public void setEyePointOffset(float x, float y, float z)
setEyePointOffset
in interface GraphicsCullStage
x
- The x axis offsety
- The y axis offsetz
- The z axis offsetpublic void setScreenOrientation(float x, float y, float z, float a) throws java.lang.IllegalArgumentException
setScreenOrientation
in interface GraphicsCullStage
x
- The x axis componenty
- The y axis componentz
- The z axis componenta
- The angle to rotate around the axis in radians
java.lang.IllegalArgumentException
- The length of the axis is zeropublic void halt()
halt
in interface CullStage
public void setErrorReporter(org.j3d.util.ErrorReporter reporter)
setErrorReporter
in interface CullStage
reporter
- The instance to use or nullprotected abstract void cullScene(RenderPassCullable scene, int subsceneId, int layerId, int viewIndex, int layerIndex)
scene
- The scene instance to cullsubsceneId
- The index of the subscene in the viewport outputlayerId
- The index of the layer in the outputviewIndex
- The index of the viewport in the parent
ViewportCollectionlayerIndex
- The index of the layer within the viewportprotected abstract void cullScene2D(RenderPassCullable scene, int subsceneId, int layerId, int viewIndex, int layerIndex)
scene
- The scene instance to cullsubsceneId
- The index of the subscene in the viewport outputlayerId
- The index of the layer in the outputviewIndex
- The index of the viewport in the parent
ViewportCollectionlayerIndex
- The index of the layer within the viewportprotected abstract void cullRenderPass(RenderPassCullable pass, int passNumber, int subsceneId, int layerId, int viewIndex, int layerIndex)
pass
- The rendering pass instance to cullsubsceneId
- The index of the subscene in the viewport outputlayerId
- The index of the layer in the outputviewIndex
- The index of the viewport in the parent
ViewportCollectionlayerIndex
- The index of the layer within the viewportprotected void processLayer(LayerCullable layer, int subsceneId, int layerId)
subsceneId
- The index of the subscene in the viewport outputlayerId
- The index of the layer in the outputprotected void cullViewport(ViewportCullable view, int subsceneId, int layerId, int viewIndex)
view
- The viewport instance to process nowsubsceneId
- The index of the subscene in the viewport outputlayerId
- The index of the layer in the outputviewIndex
- The index of the viewport in the parent
ViewportCollectionprotected void cullSingleViewportLayer(SceneCullable scene, int subsceneId, int layerId, int viewIndex, int layerIndex)
scene
- The scene instance to processsubsceneId
- The index of the subscene in the viewport outputlayerId
- The index of the layer in the outputviewIndex
- The index of the viewport in the parent
ViewportCollectionlayerIndex
- The index of the layer within the viewportprotected void cullMultipassViewportLayer(SceneCullable scene, int subsceneId, int layerId, int viewIndex, int layerIndex)
scene
- The scene instance to processsubsceneId
- The index of the subscene in the viewport outputlayerId
- The index of the layer in the outputviewIndex
- The index of the viewport in the parent
ViewportCollectionlayerIndex
- The index of the layer within the viewportprotected void fillSingleEnvData(SceneCullable scene, GraphicsEnvironmentData envData)
scene
- The scene to take data fromenvData
- Data instance to copy it toprotected void fill2DEnvData(SceneCullable scene, GraphicsEnvironmentData envData)
scene
- The scene to take data fromenvData
- Data instance to copy it toprotected void fillMultipassEnvData(SceneCullable scene, GraphicsEnvironmentData envData)
scene
- The scene to take data fromenvData
- Data instance to copy it toprotected void fillRenderPassEnvData(RenderPassCullable pass, GraphicsEnvironmentData envData, BufferDetails bufferData)
pass
- The render pass to take data fromenvData
- Data instance to copy it tobufferData
- The object to copy the extra buffer state toprotected void checkForOffscreens(ShapeRenderable shape)
shape
- The object instance to processprotected void cleanupOldRefs()
This base implementation cleans up the workLayers list. Derived classes that override this method for their own needs should also make sure to call this method too.
protected final void resizeCullList(int cur_size)
protected final void resizeOutputLists()
protected final void resizeOffscreenList()
protected final void resizeLightList()
protected final void resizeClipList()
protected final void resizeStack()
protected final void resizeFogStack()
protected final void resizeAppearanceStack()
|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |