Aviatrix3D
2.0 Dev

org.j3d.aviatrix3d.pipeline.graphics
Class GenericCullStage

java.lang.Object
  extended byorg.j3d.aviatrix3d.pipeline.graphics.BaseCullStage
      extended byorg.j3d.aviatrix3d.pipeline.graphics.GenericCullStage
All Implemented Interfaces:
CullStage, GraphicsCullStage

public class GenericCullStage
extends BaseCullStage

A cull stange that does not cull anything except those parts requested by the Cullable and CustomRenderable interfaces.

By default, the implementation will walk into Shape3Ds looking for any offscreen textures to be rendered. If you know that you do not have any in the scene, then you can set an internal flag to not look for them, thus achieving a simple performance boost.

Version:
$Revision: 3.6 $
Author:
Justin Couch

Field Summary
 
Fields inherited from class org.j3d.aviatrix3d.pipeline.graphics.BaseCullStage
activeParent, checkOffscreens, clipList, clipTxList, currentViewpointPath, eyePoint, fogStack, lastClip, lastFogStack, lastLight, lastOutputLayer, lastOutputList, lastSubscene, lastTxStack, layerCounts, layersTmp, LIGHT_INCREMENT, LIGHT_START_SIZE, lightList, lightTxList, LIST_INCREMENT, LIST_START_LENGTH, matrixUtils, orientationMatrix, outputLayers, outputSceneParents, pendingParents, pendingSubscenes, processedPBufferTextures, receiver, screenOrientation, SHARED_BG_MSG, SHARED_VP_MSG, terminate, textureUnits, transformStack, useEyePoint, useOrientation, validSceneParents, viewMatrix1, viewMatrix2, visitedNodes, workCullList
 
Constructor Summary
GenericCullStage()
          Create a basic instance of this class with the list assuming there are no off-screen buffers in use for the initial internal setup.
GenericCullStage(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 cleanupOldRefs()
          Clean up the unused resources after the end of the cull process.
protected  void cullRenderPass(RenderPass pass, int passNumber, int subsceneId, int layerId, int viewIndex, int layerIndex, int buffer)
          Update and cull the a single pass from a multipass rendering.
protected  void cullScene(SimpleScene scene, int subsceneId, int layerId, int viewIndex, int layerIndex, int buffer)
          Update and cull the scenegraph.
protected  int cullSingle(Group node, int buffer)
          Update and cull the scenegraph of a single node without doing any other processing.
protected  void fillEnvData(SimpleScene scene, GraphicsEnvironmentData envData, int buffer)
          Take the scene and fill in a GraphicsEnvironmentData instance.
 
Methods inherited from class org.j3d.aviatrix3d.pipeline.graphics.BaseCullStage
checkForOffscreens, cull, cull2DLayer, cullCompositeLayer, cullCompositeViewport, cullMultipassViewport, cullMultipassViewportLayer, cullSimpleLayer, cullSimpleViewport, cullViewport, fillEnvData, fillEnvData, halt, isOffscreenCheckEnabled, processSubsceneLayers, resizeClipList, resizeCullList, resizeFogStack, resizeLightList, resizeOffscreenList, resizeOutputLists, resizeStack, setCulledGeometryReceiver, setEyePointOffset, setOffscreenCheckEnabled, setScreenOrientation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericCullStage

public GenericCullStage()
Create a basic instance of this class with the list assuming there are no off-screen buffers in use for the initial internal setup.


GenericCullStage

public GenericCullStage(int numSurfaces)
Create a basic instance of this class with the list initial internal setup for the given number of renderable surfaces. The size is just an initial esstimate, and is used for optimisation purposes to prevent frequent array reallocations internally. As such, the number does not have to be perfect, just good enough.

Parameters:
numSurfaces - Total number of surfaces to prepare rendering for
Method Detail

cullScene

protected void cullScene(SimpleScene scene,
                         int subsceneId,
                         int layerId,
                         int viewIndex,
                         int layerIndex,
                         int buffer)
Update and cull the scenegraph. This generates an ordered list of nodes to render. It will not return until the culling is complete.

Specified by:
cullScene in class BaseCullStage
Parameters:
scene - The scene instance to cull
subsceneId - The index of the subscene in the viewport output
layerId - The index of the layer in the output
viewIndex - The index of the viewport in the parent ViewportCollection
layerIndex - The index of the layer within the viewport
buffer - The buffer ID to use to output the data to when multi-threaded

cullRenderPass

protected void cullRenderPass(RenderPass pass,
                              int passNumber,
                              int subsceneId,
                              int layerId,
                              int viewIndex,
                              int layerIndex,
                              int buffer)
Update and cull the a single pass from a multipass rendering. This generates an ordered list of nodes to render in the same was as a normal scene, but with fewer items updated, such as only a single background for all passes. It will not return until the culling is complete.

Specified by:
cullRenderPass in class BaseCullStage
Parameters:
pass - The rendering pass instance to cull
subsceneId - The index of the subscene in the viewport output
layerId - The index of the layer in the output
viewIndex - The index of the viewport in the parent ViewportCollection
layerIndex - The index of the layer within the viewport
buffer - The buffer ID to use to output the data to when multi-threaded

cullSingle

protected int cullSingle(Group node,
                         int buffer)
Update and cull the scenegraph of a single node without doing any other processing. This generates an ordered list of nodes to render. It will not return until the culling is complete.

Specified by:
cullSingle in class BaseCullStage
Parameters:
node - The root node to start the cull from
buffer - The buffer ID to use to output the data to when multi-threaded
Returns:
The index of the last item on the cull list

fillEnvData

protected void fillEnvData(SimpleScene scene,
                           GraphicsEnvironmentData envData,
                           int buffer)
Take the scene and fill in a GraphicsEnvironmentData instance.

Overrides:
fillEnvData in class BaseCullStage
Parameters:
scene - The scene to take data from
envData - Data instance to copy it to
buffer - The buffer ID to use to output the data to when multi-threaded

cleanupOldRefs

protected void cleanupOldRefs()
Clean up the unused resources after the end of the cull process. This releases any references that are no longer needed, and may have been kept from the previous culling pass.

Overrides:
cleanupOldRefs in class BaseCullStage

Aviatrix3D
2.0 Dev

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