Aviatrix3D
2.1.0

org.j3d.aviatrix3d.pipeline.graphics
Class StateAndTransparencyDepthSortStage

java.lang.Object
  extended by org.j3d.aviatrix3d.pipeline.graphics.BaseSortStage
      extended by org.j3d.aviatrix3d.pipeline.graphics.BaseStateSortStage
          extended by org.j3d.aviatrix3d.pipeline.graphics.StateAndTransparencyDepthSortStage
All Implemented Interfaces:
GraphicsSortStage

public class StateAndTransparencyDepthSortStage
extends BaseStateSortStage

Implementation of the sort stage that does everything - state sorting and depth sorted transparency.

Internationalisation Resource Names

Version:
$Revision: 3.20 $
Author:
Justin Couch

Field Summary
 
Fields inherited from class org.j3d.aviatrix3d.pipeline.graphics.BaseStateSortStage
clipTmp, currentAppearance, currentBlendAttr, currentClipPlanes, currentDepthAttr, currentFog, currentLights, currentLineAttr, currentMaterial, currentPointAttr, currentPolyAttr, currentShader, currentShaderArgs, currentStencilAttr, currentTextures, keepClipPlanes, keepLights, lightIdMap, newClipPlanes, newLights, numTextures, oldClipPlanes, oldLights, stateComparator, TEX_IDS
 
Fields inherited from class org.j3d.aviatrix3d.pipeline.graphics.BaseSortStage
commandList, errorReporter, instructionMap, lastGlobalId, LIST_START_SIZE, terminate
 
Constructor Summary
StateAndTransparencyDepthSortStage()
          Create an empty sorting stage that assumes just a single renderable output.
StateAndTransparencyDepthSortStage(int numSurfaces)
          Create an empty sorting stage that initialises the internal structures to assume that there is a minumum number of surfaces, both on and offscreen.
StateAndTransparencyDepthSortStage(int numSurfaces, int depthBits)
          Create an empty sorting stage that initialises the internal structures to assume that there is a minumum number of surfaces, both on and offscreen.
 
Method Summary
protected  int estimateInstructionSize(MultipassRenderBucket scene)
          Estimate the required size of the instruction list needed for this scene to be processed.
protected  int estimateInstructionSize(SceneRenderBucket scene)
          Estimate the required size of the instruction list needed for this scene to be processed.
protected  int sort2DNodes(GraphicsCullOutputDetails[] nodes, int numNodes, GraphicsEnvironmentData data, GraphicsInstructions instr, int instrCount)
          Sort a single set of nodes into the output details of a single layer of a single viewport and place in the provided GraphicsInstructions instance.
protected  int sortNodes(GraphicsCullOutputDetails[] nodes, int numNodes, GraphicsEnvironmentData data, GraphicsInstructions instr, int instrCount)
          Sort a single set of nodes into the output details of a single layer of a single viewport and place in the provided GraphicsInstructions instance.
 
Methods inherited from class org.j3d.aviatrix3d.pipeline.graphics.BaseStateSortStage
appendClipPlanes, appendLights, appendObject, cleanupObjects, cleanupVisuals, updateBlendAttribs, updateDepthAttribs, updateFog, updateLineAttribs, updateMaterial, updatePointAttribs, updatePolyAttribs, updateShader, updateStencilAttribs, updateTextures
 
Methods inherited from class org.j3d.aviatrix3d.pipeline.graphics.BaseSortStage
halt, realloc, setErrorReporter, setSortedGeometryReceiver, sort
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StateAndTransparencyDepthSortStage

public StateAndTransparencyDepthSortStage()
Create an empty sorting stage that assumes just a single renderable output.


StateAndTransparencyDepthSortStage

public StateAndTransparencyDepthSortStage(int numSurfaces)
Create an empty sorting stage that initialises the internal structures to assume that there is a minumum number of surfaces, both on and offscreen. The number of depth bits is set to 16.

Parameters:
numSurfaces - The number of surfaces to start the internal lists sizes at.

StateAndTransparencyDepthSortStage

public StateAndTransparencyDepthSortStage(int numSurfaces,
                                          int depthBits)
Create an empty sorting stage that initialises the internal structures to assume that there is a minumum number of surfaces, both on and offscreen.

Parameters:
numSurfaces - The number of surfaces to start the internal lists sizes at.
depthBits - The number of bits of depth precision to quantize the depth sorting to
Throws:
java.lang.IllegalArgumentException - Depth bits is zero or negative
Method Detail

estimateInstructionSize

protected int estimateInstructionSize(SceneRenderBucket scene)
Estimate the required size of the instruction list needed for this scene to be processed. This is an initial rough estimate that will be used to make sure the arrays are at least big enough to start with. There is no issue if this underestimates, as most sorting will continually check and resize as needed. However, each resize is costly, so the closer this can be to estimating the real size, the better for performance.

Specified by:
estimateInstructionSize in class BaseSortStage
Parameters:
scene - The scene bucket to use for the source
Returns:
A greater than zero value

estimateInstructionSize

protected int estimateInstructionSize(MultipassRenderBucket scene)
Estimate the required size of the instruction list needed for this scene to be processed. This is an initial rough estimate that will be used to make sure the arrays are at least big enough to start with. There is no issue if this underestimates, as most sorting will continually check and resize as needed. However, each resize is costly, so the closer this can be to estimating the real size, the better for performance.

Specified by:
estimateInstructionSize in class BaseSortStage
Parameters:
scene - The scene bucket to use for the source
Returns:
A greater than zero value

sortNodes

protected int sortNodes(GraphicsCullOutputDetails[] nodes,
                        int numNodes,
                        GraphicsEnvironmentData data,
                        GraphicsInstructions instr,
                        int instrCount)
Sort a single set of nodes into the output details of a single layer of a single viewport and place in the provided GraphicsInstructions instance. The implementation of this method should only concern itself with this set of nodes and not worry about dealing with nested scenes or other viewports.

Specified by:
sortNodes in class BaseSortStage
Parameters:
nodes - The list of nodes to perform sorting on
numNodes - The number of valid items in the nodes array
instr - Instruction instant to put the details into
instrCount - Offset of current number of valid instructions
data - The environment data used during sorting
Returns:
The current instruction count after sorting

sort2DNodes

protected int sort2DNodes(GraphicsCullOutputDetails[] nodes,
                          int numNodes,
                          GraphicsEnvironmentData data,
                          GraphicsInstructions instr,
                          int instrCount)
Sort a single set of nodes into the output details of a single layer of a single viewport and place in the provided GraphicsInstructions instance. The implementation of this method should only concern itself with this set of nodes and not worry about dealing with nested scenes or other viewports.

Specified by:
sort2DNodes in class BaseSortStage
Parameters:
nodes - The list of nodes to perform sorting on
numNodes - The number of valid items in the nodes array
instr - Instruction instant to put the details into
instrCount - Offset of current number of valid instructions
data - The environment data used during sorting
Returns:
The current instruction count after sorting

Aviatrix3D
2.1.0

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