Aviatrix3D
2.1.0

org.j3d.aviatrix3d
Class RenderPass

java.lang.Object
  extended by org.j3d.aviatrix3d.SceneGraphObject
      extended by org.j3d.aviatrix3d.RenderPass
All Implemented Interfaces:
Cullable, RenderPassCullable

public class RenderPass
extends SceneGraphObject
implements RenderPassCullable

Representation of a single pass in a multipass rendering layer setup.

A render pass encapsulates a viewpoint that is used to view the scene from, the geometry structure to render, global fog, the geometry of the scene and a collection of buffer states.

Each pass has its own view environment that works in addition to the global environment from the parent scene. Some aspects of this environment are ignored for multipass rendering, such as the stereo flags.

Internationalisation Resource Names

Version:
$Revision: 2.12 $
Author:
Justin Couch

Field Summary
 
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject
alive, LISTENER_SET_TIMING_ERR_PROP, updateHandler
 
Constructor Summary
RenderPass()
          Create a default instance of this scene with no content provided.
 
Method Summary
 BufferStateRenderable getAccumBufferRenderable()
          Fetch renderable information about the accumulation buffer.
 AccumulationBufferState getAccumulationBufferState()
          Get the currently set accumulation buffer state.
 Viewpoint getActiveView()
          Get the currently set active view.
 EnvironmentCullable getBackgroundCullable()
          Get the cullable object representing the active background that in this environment.
 BufferStateRenderable getColorBufferRenderable()
          Fetch renderable information about the colour buffer.
 ColorBufferState getColorBufferState()
          Get the currently set color buffer state.
 BufferStateRenderable getDepthBufferRenderable()
          Fetch renderable information about the depth buffer.
 DepthBufferState getDepthBufferState()
          Get the currently set depth buffer state.
 LeafCullable getFogCullable()
          Get the cullable object representing the active fog in this environment.
 BufferStateRenderable getGeneralBufferRenderable()
          Fetch renderable information about the general buffer.
 GeneralBufferState getGeneralBufferState()
          Get the currently set general buffer state.
 Group getRenderedGeometry()
          Get the root of the currently rendered scene.
 Cullable getRootCullable()
          Get the primary cullable that represents the root of the scene graph.
 BufferStateRenderable getStencilBufferRenderable()
          Fetch renderable information about the stencil buffer.
 StencilBufferState getStencilBufferState()
          Get the currently set stencil buffer state.
 ViewEnvironmentCullable getViewCullable()
          Get the primary view environment.
 ViewEnvironment getViewEnvironment()
          Get the currently set active view.
 EnvironmentCullable getViewpointCullable()
          Get the cullable object representing the active viewpoint that in this environment.
 void getViewportDimensions(float[] vals)
          Get the viewport dimensions.
 ViewportRenderable getViewportRenderable()
          Fetch the renderable used to control the viewport setting.
 boolean is2D()
          Check to see if this represents a 2D scene that has no 3D rendering capabilities.
 boolean isActiveSoundLayer()
          Check to see if this is the currently active layer for sound rendering.
 boolean isAudioSource()
          Check to see if this render pass is the one that also has the spatialised audio to be rendered for this frame.
 boolean isEnabled()
          Check to see if this render pass is valid to render for this frame.
 void makeActiveSoundLayer()
          Set this layer to be the currently active sound layer.
 void setAccumulationBufferState(AccumulationBufferState state)
          Set the accumulation buffer state that should be applied to the during this pass.
 void setActiveView(Viewpoint vp)
          Set the viewpoint path that should be applied to the current surface.
 void setColorBufferState(ColorBufferState state)
          Set the color buffer state that should be applied to the during this pass.
 void setDepthBufferState(DepthBufferState state)
          Set the depth buffer state that should be applied to the during this pass.
 void setEnabled(boolean state)
          Set the enabled state of the light.
 void setGeneralBufferState(GeneralBufferState state)
          Set the general buffer state that should be applied to the during this pass.
protected  void setLive(boolean state)
          Notification that this object is live now.
 void setRenderedGeometry(Group geom)
          Set the collection of geometry that should be rendered to this texture.
 void setStencilBufferState(StencilBufferState state)
          Set the stencil buffer state that should be applied to the during this pass.
protected  void setUpdateHandler(NodeUpdateHandler handler)
          Set the scenegraph update handler for this node.
 void setViewportDimensions(int x, int y, int w, int h)
          Override the scene's viewport dimensions with a specific set for this pass only.
 
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject
checkForCyclicChild, checkForCyclicParent, dataChanged, getAppUpdateWriteTimingMessage, getBoundsWriteTimingMessage, getDataWriteTimingMessage, getUserData, isLive, setUserData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.j3d.aviatrix3d.rendering.RenderPassCullable
getUserData
 

Constructor Detail

RenderPass

public RenderPass()
Create a default instance of this scene with no content provided.

Method Detail

isEnabled

public boolean isEnabled()
Check to see if this render pass is valid to render for this frame.

Specified by:
isEnabled in interface RenderPassCullable
Returns:
true if this is valid to process

is2D

public boolean is2D()
Check to see if this represents a 2D scene that has no 3D rendering capabilities. A purely 2D scene sets up the view environment quite different to a full 3D scene.

Specified by:
is2D in interface RenderPassCullable
Returns:
true if this is a 2D scene rather than a 3D version

isAudioSource

public boolean isAudioSource()
Check to see if this render pass is the one that also has the spatialised audio to be rendered for this frame. See the package documentation for more information about how this state is managed.

Specified by:
isAudioSource in interface RenderPassCullable
Returns:
true if this is the source that should be rendered this this frame.

getViewportRenderable

public ViewportRenderable getViewportRenderable()
Fetch the renderable used to control the viewport setting. If the default environment is to be used, this will return null.

Specified by:
getViewportRenderable in interface RenderPassCullable
Returns:
A renderable instance if custom viewport handling is need or null if not

getViewCullable

public ViewEnvironmentCullable getViewCullable()
Get the primary view environment.

Specified by:
getViewCullable in interface RenderPassCullable

getViewpointCullable

public EnvironmentCullable getViewpointCullable()
Get the cullable object representing the active viewpoint that in this environment.

Specified by:
getViewpointCullable in interface RenderPassCullable
Returns:
The viewpoint renderable to use

getBackgroundCullable

public EnvironmentCullable getBackgroundCullable()
Get the cullable object representing the active background that in this environment. If no background is set, this will return null.

Specified by:
getBackgroundCullable in interface RenderPassCullable
Returns:
The background renderable to use

getFogCullable

public LeafCullable getFogCullable()
Get the cullable object representing the active fog in this environment. If no fog is set or this is a pass in a multipass rendering, this will return null. If the underlying fog node is currently disabled or not labeled as global, then this method should return null.

Specified by:
getFogCullable in interface RenderPassCullable
Returns:
The fog renderable to use

getRootCullable

public Cullable getRootCullable()
Get the primary cullable that represents the root of the scene graph. If this is a multipass cullable, this should return null.

Specified by:
getRootCullable in interface RenderPassCullable

getGeneralBufferRenderable

public BufferStateRenderable getGeneralBufferRenderable()
Fetch renderable information about the general buffer. If this is a single pass scene, this will return null.

Specified by:
getGeneralBufferRenderable in interface RenderPassCullable
Returns:
The state representation for the general buffer

getColorBufferRenderable

public BufferStateRenderable getColorBufferRenderable()
Fetch renderable information about the colour buffer. If this is a single pass scene, this will return null.

Specified by:
getColorBufferRenderable in interface RenderPassCullable
Returns:
The state representation for the colour buffer

getDepthBufferRenderable

public BufferStateRenderable getDepthBufferRenderable()
Fetch renderable information about the depth buffer. If this is a single pass scene, this will return null.

Specified by:
getDepthBufferRenderable in interface RenderPassCullable
Returns:
The state representation for the depth buffer

getStencilBufferRenderable

public BufferStateRenderable getStencilBufferRenderable()
Fetch renderable information about the stencil buffer. If this is a single pass scene, this will return null.

Specified by:
getStencilBufferRenderable in interface RenderPassCullable
Returns:
The state representation for the stencil buffer

getAccumBufferRenderable

public BufferStateRenderable getAccumBufferRenderable()
Fetch renderable information about the accumulation buffer. If this is a single pass scene, this will return null.

Specified by:
getAccumBufferRenderable in interface RenderPassCullable
Returns:
The state representation for the accumulation buffer

setLive

protected void setLive(boolean state)
Notification that this object is live now. Overridden to make sure that the live state of the nodes represents the same state as the parent scene graph.

Overrides:
setLive in class SceneGraphObject
Parameters:
state - true if this should be marked as live now

setUpdateHandler

protected void setUpdateHandler(NodeUpdateHandler handler)
Set the scenegraph update handler for this node. It will notify all its children of the value. A null value will clear the current handler.

Overrides:
setUpdateHandler in class SceneGraphObject
Parameters:
handler - The instance to use as a handler

setEnabled

public void setEnabled(boolean state)
                throws InvalidWriteTimingException
Set the enabled state of the light. Can use this to turn it on and off in a general fashion.

Parameters:
state - The new state of the light
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the NodeUpdateListener data changed callback method

makeActiveSoundLayer

public void makeActiveSoundLayer()
                          throws InvalidWriteTimingException
Set this layer to be the currently active sound layer. The previously active layer will be disabled. This method can only be called during the dataChanged() callback.

Throws:
InvalidWriteTimingException

isActiveSoundLayer

public boolean isActiveSoundLayer()
Check to see if this is the currently active layer for sound rendering. This will only return true the frame after calling makeActiveSoundLayer(). The effects, however, will be rendered starting the frame that this is set.

Returns:
true if this is the layer that will generate sound rendering

getViewEnvironment

public ViewEnvironment getViewEnvironment()
Get the currently set active view. If none is set, return null.

Returns:
The current view instance or null

setRenderedGeometry

public void setRenderedGeometry(Group geom)
                         throws InvalidWriteTimingException
Set the collection of geometry that should be rendered to this texture. A null value will clear the current geometry and result in only rendering the background, if set. if not set, then whatever the default colour is, is used (typically black).

Parameters:
geom - The new geometry to use or null
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the ApplicationUpdateObserver callback method

getRenderedGeometry

public Group getRenderedGeometry()
Get the root of the currently rendered scene. If none is set, this will return null.

Returns:
The current scene root or null.

setActiveView

public void setActiveView(Viewpoint vp)
                   throws InvalidWriteTimingException,
                          java.lang.IllegalArgumentException
Set the viewpoint path that should be applied to the current surface. The output drawn will be a combination of this information and that of the view environment.

Parameters:
vp - The instance of the active viewpoint to use
Throws:
java.lang.IllegalArgumentException - The path contains a SharedGroup or the node is not live
InvalidWriteTimingException - An attempt was made to write outside of the ApplicationUpdateObserver callback method

getActiveView

public Viewpoint getActiveView()
Get the currently set active view. If none is set, return null.

Returns:
The current view instance or null

setGeneralBufferState

public void setGeneralBufferState(GeneralBufferState state)
                           throws InvalidWriteTimingException
Set the general buffer state that should be applied to the during this pass. A null value will clear the state.

Parameters:
state - The instance of the state to set
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the ApplicationUpdateObserver callback method

getGeneralBufferState

public GeneralBufferState getGeneralBufferState()
Get the currently set general buffer state. If none is set, return null.

Returns:
The current buffer state or null

setStencilBufferState

public void setStencilBufferState(StencilBufferState state)
                           throws InvalidWriteTimingException
Set the stencil buffer state that should be applied to the during this pass. A null value will clear the state.

Parameters:
state - The instance of the state to set
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the ApplicationUpdateObserver callback method

getStencilBufferState

public StencilBufferState getStencilBufferState()
Get the currently set stencil buffer state. If none is set, return null.

Returns:
The current buffer state or null

setDepthBufferState

public void setDepthBufferState(DepthBufferState state)
                         throws InvalidWriteTimingException
Set the depth buffer state that should be applied to the during this pass. A null value will clear the state.

Parameters:
state - The instance of the state to set
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the ApplicationUpdateObserver callback method

getDepthBufferState

public DepthBufferState getDepthBufferState()
Get the currently set depth buffer state. If none is set, return null.

Returns:
The current buffer state or null

setColorBufferState

public void setColorBufferState(ColorBufferState state)
                         throws InvalidWriteTimingException
Set the color buffer state that should be applied to the during this pass. A null value will clear the state.

Parameters:
state - The instance of the state to set
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the ApplicationUpdateObserver callback method

getColorBufferState

public ColorBufferState getColorBufferState()
Get the currently set color buffer state. If none is set, return null.

Returns:
The current buffer state or null

setAccumulationBufferState

public void setAccumulationBufferState(AccumulationBufferState state)
                                throws InvalidWriteTimingException
Set the accumulation buffer state that should be applied to the during this pass. A null value will clear the state.

Parameters:
state - The instance of the state to set
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the ApplicationUpdateObserver callback method

getAccumulationBufferState

public AccumulationBufferState getAccumulationBufferState()
Get the currently set accumulation buffer state. If none is set, return null.

Returns:
The current buffer state or null

setViewportDimensions

public void setViewportDimensions(int x,
                                  int y,
                                  int w,
                                  int h)
                           throws InvalidWriteTimingException
Override the scene's viewport dimensions with a specific set for this pass only. All values in pixels. To clear an explicitly set viewport, set the width or height parameters to zero.

Parameters:
x - The left position of the location
y - The top position of the location
w - The width of the viewport
h - The left position of the location
Throws:
InvalidWriteTimingException - An attempt was made to write outside of the ApplicationUpdateObserver callback method

getViewportDimensions

public void getViewportDimensions(float[] vals)
Get the viewport dimensions. If no dimensions have been previously set this will set the array to all zeros.

Parameters:
vals - The array to copy dimensions in to

Aviatrix3D
2.1.0

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