Package com.ardor3d.renderer.pass
Class Pass
java.lang.Object
com.ardor3d.renderer.pass.Pass
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
BloomRenderPass
,ParallelSplitShadowMapPass
,RenderPass
Pass
encapsulates logic necessary for rendering one or more steps in a multipass technique.
Rendering:
When renderPass is called, a check is first made to see if the pass isEnabled(). Then any states set on this pass are
enforced via Spatial.enforceState(RenderState). This is useful for doing things such as causing this pass to be
blended to a previous pass via enforcing an BlendState, etc. Next, doRender(Renderer) is called to do the actual
rendering work. Finally, any enforced states set before this pass was run are restored.- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected RenderContext
protected boolean
if false, pass will not be updated or rendered.protected final EnumMap
<RenderState.StateType, RenderState> RenderStates registered with this pass - if a given state is not null it overrides the corresponding state set during rendering.list of Spatial objects registered with this pass. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
cleanUp()
void
Clears an enforced render state index by setting it to null.void
sets all enforced states to null.boolean
protected abstract void
protected void
doRender
(TextureRenderer r, int clear, List<Texture> texs) protected void
doUpdate
(double tpf) get
(int index) boolean
boolean
final void
if enabled, set the states for this pass and then render.final void
renderPass
(TextureRenderer r, int clear, List<Texture> texs) if enabled, set the states for this pass and then render.void
setEnabled
(boolean enabled) void
setPassState
(RenderState state) Enforce a particular state.int
size()
final void
updatePass
(double tpf) if enabled, call doUpdate to update information for this pass.
-
Field Details
-
_spatials
list of Spatial objects registered with this pass. -
_enabled
protected boolean _enabledif false, pass will not be updated or rendered. -
_passStates
RenderStates registered with this pass - if a given state is not null it overrides the corresponding state set during rendering. -
_context
-
-
Constructor Details
-
Pass
public Pass()
-
-
Method Details
-
renderPass
if enabled, set the states for this pass and then render.- Parameters:
r
- the renderer
-
renderPass
if enabled, set the states for this pass and then render.- Parameters:
r
- the rendererclear
- the cleartexs
- the list of textures
-
setPassState
Enforce a particular state. In other words, the given state will override any state of the same type set on a scene object. Remember to clear the state when done enforcing. Very useful for multipass techniques where multiple sets of states need to be applied to a scenegraph drawn multiple times.- Parameters:
state
- state to enforce
-
clearPassState
Clears an enforced render state index by setting it to null. This allows object specific states to be used.- Parameters:
type
- The type of RenderState to clear enforcement on.
-
clearPassStates
public void clearPassStates()sets all enforced states to null.- See Also:
-
doRender
-
doRender
-
updatePass
public final void updatePass(double tpf) if enabled, call doUpdate to update information for this pass.- Parameters:
tpf
- the time per frame
-
doUpdate
protected void doUpdate(double tpf) -
add
-
get
-
contains
-
remove
-
size
public int size() -
isEnabled
public boolean isEnabled()- Returns:
- Returns the enabled.
-
setEnabled
public void setEnabled(boolean enabled) - Parameters:
enabled
- The enabled to set.
-
cleanUp
public void cleanUp()
-